From c198b2d75e5c880027248b98c1c21a335bdbf36a Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Tue, 26 Sep 2017 14:24:15 -0600 Subject: [PATCH] Migrated from paho-mqtt to mqtt package --- app/state/index.ts | 2 +- app/tsconfig.json | 6 +- {app => common}/mqtt.ts | 93 +++++++-------- package.json | 4 +- server/index.ts | 10 ++ yarn.lock | 247 +++++++++++++++++++++++++++++++++++++--- 6 files changed, 288 insertions(+), 74 deletions(-) rename {app => common}/mqtt.ts (80%) diff --git a/app/state/index.ts b/app/state/index.ts index ea0e2a0..ad62236 100644 --- a/app/state/index.ts +++ b/app/state/index.ts @@ -1,4 +1,4 @@ -import { MqttApiClient } from "@app/mqtt"; +import { MqttApiClient } from "@common/mqtt"; import { ISprinklersApi } from "@common/sprinklers"; import { UiMessage, UiStore } from "./ui"; diff --git a/app/tsconfig.json b/app/tsconfig.json index 849a559..4986000 100644 --- a/app/tsconfig.json +++ b/app/tsconfig.json @@ -16,13 +16,13 @@ "node" ], "strict": true, - "baseUrl": ".", + "baseUrl": "..", "paths": { "@common/*": [ - "../common/*" + "./common/*" ], "@app/*": [ - "./*" + "./app/*" ] } } diff --git a/app/mqtt.ts b/common/mqtt.ts similarity index 80% rename from app/mqtt.ts rename to common/mqtt.ts index 9e6de78..a7d597b 100644 --- a/app/mqtt.ts +++ b/common/mqtt.ts @@ -1,5 +1,4 @@ -import "paho-mqtt"; -import MQTT = Paho.MQTT; +import * as mqtt from "../node_modules/mqtt"; import { Duration, @@ -16,14 +15,11 @@ import { import { checkedIndexOf } from "@common/utils"; export class MqttApiClient implements ISprinklersApi { - client: MQTT.Client; + client: mqtt.Client; connected: boolean; devices: { [prefix: string]: MqttSprinklersDevice } = {}; constructor() { - this.client = new MQTT.Client(location.hostname, 1884, MqttApiClient.newClientId()); - this.client.onMessageArrived = (m) => this.onMessageArrived(m); - this.client.onConnectionLost = (e) => this.onConnectionLost(e); // (this.client as any).trace = (m => console.log(m)); } @@ -32,19 +28,25 @@ export class MqttApiClient implements ISprinklersApi { } start() { - console.log("connecting to mqtt with client id %s", this.client.clientId); - this.client.connect({ - onFailure: (e) => { - console.log("mqtt error: ", e.errorMessage); - }, - onSuccess: () => { - console.log("mqtt connected"); - this.connected = true; - for (const prefix of Object.keys(this.devices)) { - const device = this.devices[prefix]; - device.doSubscribe(); - } - }, + const clientId = MqttApiClient.newClientId(); + console.log("connecting to mqtt with client id %s", clientId); + this.client = mqtt.connect(`ws://${location.hostname}:1884`, { + clientId, + }); + this.client.on("message", this.onMessageArrived.bind(this)); + this.client.on("offline", () => { + this.connected = false; + }); + this.client.on("error", (e) => { + console.error("mqtt error: ", e); + }); + this.client.on("connect", () => { + console.log("mqtt connected"); + this.connected = true; + for (const prefix of Object.keys(this.devices)) { + const device = this.devices[prefix]; + device.doSubscribe(); + } }); } @@ -70,37 +72,29 @@ export class MqttApiClient implements ISprinklersApi { delete this.devices[prefix]; } - private onMessageArrived(m: MQTT.Message) { + private onMessageArrived(topic: string, payload: Buffer, packet: mqtt.Packet) { try { - this.processMessage(m); + this.processMessage(topic, payload, packet); } catch (e) { console.error("error while processing mqtt message", e); } } - private processMessage(m: MQTT.Message) { - // console.log("message arrived: ", m); - if (m.destinationName == null) { - console.warn(`revieved invalid message: ${m}`); - return; - } - const topicIdx = m.destinationName.indexOf("/"); // find the first / - const prefix = m.destinationName.substr(0, topicIdx); // assume prefix does not contain a / - const topic = m.destinationName.substr(topicIdx + 1); + private processMessage(topic: string, payload: Buffer, packet: mqtt.Packet) { + console.log("message arrived: ", { topic, payload }); + const topicIdx = topic.indexOf("/"); // find the first / + const prefix = topic.substr(0, topicIdx); // assume prefix does not contain a / + const topicSuffix = topic.substr(topicIdx + 1); const device = this.devices[prefix]; if (!device) { console.warn(`received message for unknown device. prefix: ${prefix}`); return; } - device.onMessage(topic, m.payloadString); - } - - private onConnectionLost(e: MQTT.MQTTError) { - this.connected = false; + device.onMessage(topicSuffix, payload); } } -const subscriptions = [ +const subscriptions = [ "/connected", "/sections", "/sections/+/#", @@ -130,23 +124,22 @@ class MqttSprinklersDevice extends SprinklersDevice { } doSubscribe() { - const c = this.apiClient.client; - subscriptions - .forEach((filter) => c.subscribe(this.prefix + filter, { qos: 1 })); + const topics = subscriptions.map((filter) => this.prefix + filter); + this.apiClient.client.subscribe(topics, { qos: 1 }); } doUnsubscribe() { - const c = this.apiClient.client; - subscriptions - .forEach((filter) => c.unsubscribe(this.prefix + filter)); + const topics = subscriptions.map((filter) => this.prefix + filter); + this.apiClient.client.unsubscribe(topics); } /** * Updates this device with the specified message * @param topic The topic, with prefix removed - * @param payload The payload string + * @param payload The payload buffer */ - onMessage(topic: string, payload: string) { + onMessage(topic: string, payloadBuf: Buffer) { + const payload = payloadBuf.toString("utf8"); if (topic === "connected") { this.connected = (payload === "true"); // console.log(`MqttSprinklersDevice with prefix ${this.prefix}: ${this.connected}`) @@ -240,13 +233,11 @@ class MqttSprinklersDevice extends SprinklersDevice { return Math.floor(Math.random() * 1000000000); } - private makeRequest(topic: string, payload: object | string = {}): Promise { + private makeRequest(topic: string, payload: any = {}): Promise { return new Promise((resolve, reject) => { - const payloadStr = (typeof payload === "string") ? - payload : JSON.stringify(payload); - const message = new MQTT.Message(payloadStr); - message.destinationName = this.prefix + "/" + topic; - const requestId = this.nextRequestId(); + const requestId = payload.rid = this.nextRequestId(); + const payloadStr = JSON.stringify(payload); + const fullTopic = this.prefix + "/" + topic; this.responseCallbacks[requestId] = (data) => { if (data.error != null) { reject(data); @@ -254,7 +245,7 @@ class MqttSprinklersDevice extends SprinklersDevice { resolve(data); } }; - this.apiClient.client.send(message); + this.apiClient.client.publish(fullTopic, payloadStr, { qos: 1 }); }); } diff --git a/package.json b/package.json index a0546fd..95f7ad5 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,9 @@ "@types/classnames": "^2.2.0", "@types/core-js": "^0.9.43", "@types/express": "^4.0.37", + "@types/mqtt": "^0.0.34", "@types/node": "^8.0.6", "@types/object-assign": "^4.0.30", - "@types/paho-mqtt": "^1.0.0", "@types/pino": "^4.7.0", "@types/prop-types": "^15.5.1", "@types/react": "^16", @@ -48,8 +48,8 @@ "font-awesome": "^4.7.0", "mobx": "^3.1.11", "mobx-react": "^4.2.1", + "mqtt": "^2.13.0", "object-assign": "^4.1.1", - "paho-mqtt": "^1.0.3", "pino": "^4.7.2", "prop-types": "^15.5.10", "react": ">=15.6.1 <16", diff --git a/server/index.ts b/server/index.ts index 76c220f..8cd7954 100644 --- a/server/index.ts +++ b/server/index.ts @@ -2,6 +2,16 @@ import { Server } from "http"; import app from "./app"; import log from "./log"; +import * as mqtt from "mqtt"; + +const mqttClient = mqtt.connect("mqtt://localhost:1882"); +mqttClient.on("connect", () => { + log.info("mqtt connected"); +}); +mqttClient.on("error", (err) => { + log.error("mqtt error: ", err); +}); + const server = new Server(app); const port = +(process.env.PORT || 8080); diff --git a/yarn.lock b/yarn.lock index 4a8af6f..2a9dfce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -37,6 +37,12 @@ version "1.3.1" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.1.tgz#2cf42972d0931c1060c7d5fa6627fce6bd876f2f" +"@types/mqtt@^0.0.34": + version "0.0.34" + resolved "https://registry.yarnpkg.com/@types/mqtt/-/mqtt-0.0.34.tgz#7865790000cc8a312242ead9a0e209ba2aa686d4" + dependencies: + "@types/node" "*" + "@types/node@*": version "8.0.27" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.27.tgz#13fbe7e92afeecebb843d7cea6c15b521e0000e1" @@ -49,10 +55,6 @@ version "4.0.30" resolved "https://registry.yarnpkg.com/@types/object-assign/-/object-assign-4.0.30.tgz#8949371d5a99f4381ee0f1df0a9b7a187e07e652" -"@types/paho-mqtt@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/paho-mqtt/-/paho-mqtt-1.0.0.tgz#9dc7d4d98dac7940187f6ccb77aab649249d0799" - "@types/pino@^4.7.0": version "4.7.0" resolved "https://registry.yarnpkg.com/@types/pino/-/pino-4.7.0.tgz#c95790496a82766a1b41050df9b322fe9639a129" @@ -336,6 +338,10 @@ async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + async@^0.9.0: version "0.9.2" resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" @@ -492,6 +498,12 @@ binary-extensions@^1.0.0: version "1.10.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.10.0.tgz#9aeb9a6c5e88638aad171e167f5900abe24835d0" +bl@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.1.tgz#cac328f7bee45730d404b692203fcb590e172d5e" + dependencies: + readable-stream "^2.0.5" + block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" @@ -663,6 +675,13 @@ cache-base@^0.8.4: union-value "^0.2.3" unset-value "^0.1.1" +callback-stream@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/callback-stream/-/callback-stream-1.1.0.tgz#4701a51266f06e06eaa71fc17233822d875f4908" + dependencies: + inherits "^2.0.1" + readable-stream "> 1.0.0 < 3.0.0" + camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" @@ -860,6 +879,13 @@ commander@2.11.x, commander@^2.9.0, commander@~2.11.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" +commist@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/commist/-/commist-1.0.0.tgz#c0c352501cf6f52e9124e3ef89c9806e2022ebef" + dependencies: + leven "^1.0.0" + minimist "^1.1.0" + component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" @@ -886,6 +912,14 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" +concat-stream@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + connect-history-api-fallback@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.3.0.tgz#e51d17f8f0ef0db90a64fdb47de3051556e9f169" @@ -1279,6 +1313,15 @@ duplexer@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" +duplexify@^3.1.2, duplexify@^3.2.0: + version "3.5.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd" + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" @@ -1319,7 +1362,7 @@ encoding@^0.1.11: dependencies: iconv-lite "~0.4.13" -end-of-stream@^1.1.0: +end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206" dependencies: @@ -1590,7 +1633,7 @@ extend-shallow@^2.0.1: dependencies: is-extendable "^0.1.0" -extend@~3.0.0: +extend@^3.0.0, extend@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" @@ -1843,6 +1886,28 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob-stream@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" + dependencies: + extend "^3.0.0" + glob "^7.1.1" + glob-parent "^3.1.0" + is-negated-glob "^1.0.0" + ordered-read-streams "^1.0.0" + pumpify "^1.3.5" + readable-stream "^2.1.5" + remove-trailing-separator "^1.0.1" + to-absolute-glob "^2.0.0" + unique-stream "^2.0.2" + glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -1963,6 +2028,15 @@ he@1.1.x: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" +help-me@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/help-me/-/help-me-1.1.0.tgz#8f2d508d0600b4a456da2f086556e7e5c056a3c6" + dependencies: + callback-stream "^1.0.2" + glob-stream "^6.1.0" + through2 "^2.0.1" + xtend "^4.0.0" + hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -2160,6 +2234,13 @@ is-absolute-url@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" +is-absolute@^0.2.5: + version "0.2.6" + resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-0.2.6.tgz#20de69f3db942ef2d87b9c2da36f172235b1b5eb" + dependencies: + is-relative "^0.2.1" + is-windows "^0.2.0" + is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -2260,6 +2341,10 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" +is-negated-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -2318,6 +2403,12 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" +is-relative@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-0.2.1.tgz#d27f4c7d516d175fb610db84bbeef23c3bc97aa5" + dependencies: + is-unc-path "^0.1.1" + is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2336,10 +2427,20 @@ is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" +is-unc-path@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-0.1.2.tgz#6ab053a72573c10250ff416a3814c35178af39b9" + dependencies: + unc-path-regex "^0.1.0" + is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +is-windows@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" + is-wsl@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" @@ -2416,7 +2517,7 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.1: +json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" dependencies: @@ -2479,6 +2580,10 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +leven@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/leven/-/leven-1.0.2.tgz#9144b6eebca5f1d0680169f1a6770dcea60b75c3" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -2721,7 +2826,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.2.0: +minimist@^1.1.0, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -2752,6 +2857,33 @@ mobx@^3.1.11: version "3.3.0" resolved "https://registry.yarnpkg.com/mobx/-/mobx-3.3.0.tgz#1bc1dd7e78547065af04b49bdb7f2098cada47aa" +mqtt-packet@^5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/mqtt-packet/-/mqtt-packet-5.4.0.tgz#387104c06aa68fbb9f8159d0c722dd5c3e45df22" + dependencies: + bl "^1.2.1" + inherits "^2.0.3" + process-nextick-args "^1.0.7" + safe-buffer "^5.1.0" + +mqtt@^2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/mqtt/-/mqtt-2.13.0.tgz#cbf3fae8f0c48328472b0d5f8e049cc800957d7e" + dependencies: + commist "^1.0.0" + concat-stream "^1.6.0" + end-of-stream "^1.1.0" + help-me "^1.0.1" + inherits "^2.0.3" + minimist "^1.2.0" + mqtt-packet "^5.4.0" + pump "^1.0.2" + readable-stream "^2.3.3" + reinterval "^1.1.0" + split2 "^2.1.1" + websocket-stream "^5.0.1" + xtend "^4.0.1" + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -3000,6 +3132,12 @@ opn@^5.1.0: dependencies: is-wsl "^1.1.0" +ordered-read-streams@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" + dependencies: + readable-stream "^2.0.1" + original@>=0.0.5: version "1.0.0" resolved "https://registry.yarnpkg.com/original/-/original-1.0.0.tgz#9147f93fa1696d04be61e01bd50baeaca656bd3b" @@ -3057,10 +3195,6 @@ p-map@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" -paho-mqtt@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/paho-mqtt/-/paho-mqtt-1.0.3.tgz#3e7ff69ff0b608d43946b02f990b5d6010d9eaa1" - pako@~0.2.0: version "0.2.9" resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" @@ -3108,6 +3242,10 @@ path-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -3475,7 +3613,7 @@ pretty-error@^2.0.2: renderkid "^2.0.1" utila "~0.4" -process-nextick-args@~1.0.6: +process-nextick-args@^1.0.7, process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -3531,13 +3669,21 @@ public-encrypt@^4.0.0: parse-asn1 "^5.0.0" randombytes "^2.0.1" -pump@^1.0.2: +pump@^1.0.0, pump@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.2.tgz#3b3ee6512f94f0e575538c17995f9f16990a5d51" dependencies: end-of-stream "^1.1.0" once "^1.3.1" +pumpify@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.3.5.tgz#1b671c619940abcaeac0ad0e3a3c164be760993b" + dependencies: + duplexify "^3.1.2" + inherits "^2.0.1" + pump "^1.0.0" + punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" @@ -3698,7 +3844,7 @@ readable-stream@1.0, readable-stream@~1.0.2: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.6, readable-stream@^2.2.9: +"readable-stream@> 1.0.0 < 3.0.0", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.0, readable-stream@^2.2.2, readable-stream@^2.2.6, readable-stream@^2.2.9, readable-stream@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" dependencies: @@ -3785,6 +3931,10 @@ regjsparser@^0.1.4: dependencies: jsesc "~0.5.0" +reinterval@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/reinterval/-/reinterval-1.1.0.tgz#3361ecfa3ca6c18283380dd0bb9546f390f5ece7" + relateurl@0.2.x: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" @@ -4184,6 +4334,12 @@ split2@^2.0.1: dependencies: through2 "^2.0.2" +split2@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-2.2.0.tgz#186b2575bcf83e85b7d18465756238ee4ee42493" + dependencies: + through2 "^2.0.2" + split@0.3: version "0.3.3" resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" @@ -4246,6 +4402,10 @@ stream-http@^2.3.1: to-arraybuffer "^1.0.0" xtend "^4.0.0" +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" @@ -4377,7 +4537,14 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" -through2@^2.0.2: +through2-filter@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec" + dependencies: + through2 "~2.0.0" + xtend "~4.0.0" + +through2@^2.0.1, through2@^2.0.2, through2@~2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" dependencies: @@ -4402,6 +4569,14 @@ timers-browserify@^2.0.2: dependencies: setimmediate "^1.0.4" +to-absolute-glob@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.1.tgz#70c375805b9e3105e899ee8dbdd6a9aa108f407b" + dependencies: + extend-shallow "^2.0.1" + is-absolute "^0.2.5" + is-negated-glob "^1.0.0" + to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" @@ -4516,6 +4691,10 @@ type-is@~1.6.15: media-typer "0.3.0" mime-types "~2.1.15" +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + typescript@^2.3.4: version "2.5.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.5.2.tgz#038a95f7d9bbb420b1bf35ba31d4c5c1dd3ffe34" @@ -4556,6 +4735,14 @@ uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" +ultron@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.0.tgz#b07a2e6a541a815fc6a34ccd4533baec307ca864" + +unc-path-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + union-value@^0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/union-value/-/union-value-0.2.4.tgz#7375152786679057e7b37aa676e83468fc0274f0" @@ -4579,6 +4766,13 @@ uniqs@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" +unique-stream@^2.0.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.2.1.tgz#5aa003cfbe94c5ff866c4e7d668bb1c4dbadb369" + dependencies: + json-stable-stringify "^1.0.0" + through2-filter "^2.0.0" + unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -4798,6 +4992,17 @@ websocket-extensions@>=0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" +websocket-stream@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/websocket-stream/-/websocket-stream-5.0.1.tgz#51cb992988c2eeb4525ccd90eafbac52a5ac6700" + dependencies: + duplexify "^3.2.0" + inherits "^2.0.1" + readable-stream "^2.2.0" + safe-buffer "^5.0.1" + ws "^3.0.0" + xtend "^4.0.0" + whatwg-fetch@>=0.10.0: version "2.0.3" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" @@ -4845,11 +5050,19 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +ws@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-3.2.0.tgz#d5d3d6b11aff71e73f808f40cc69d52bb6d4a185" + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" + xml-char-classes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d" -xtend@^4.0.0, xtend@~4.0.1: +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"