Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

home-assistant-js-websocket

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

home-assistant-js-websocket - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

49

dist/haws.cjs.js

@@ -69,2 +69,8 @@ 'use strict';

function ping$1() {
return {
type: 'ping',
};
}
var ERR_CANNOT_CONNECT = 1;

@@ -133,3 +139,3 @@ var ERR_INVALID_AUTH = 2;

/* eslint-disable no-console */
console.log(message);
console.log('Received', message);
/* eslint-enable no-console */

@@ -139,2 +145,18 @@ }

switch (message.type) {
case 'event':
this$1.commands[message.id].eventCallback(message.event);
break;
case 'result':
if (message.success) {
this$1.commands[message.id].resolve(message);
} else {
this$1.commands[message.id].reject(message.error);
}
delete this$1.commands[message.id];
break;
case 'pong':
break;
case 'auth_required':

@@ -168,15 +190,2 @@ this$1.sendMessage(auth(this$1.options.authToken));

case 'event':
this$1.commands[message.id].eventCallback(message.event);
break;
case 'result':
if (message.success) {
this$1.commands[message.id].resolve(message);
} else {
this$1.commands[message.id].reject(message.error);
}
delete this$1.commands[message.id];
break;
default:

@@ -260,3 +269,13 @@ {

Connection.prototype.ping = function ping () {
return this.sendMessagePromise(ping$1());
};
Connection.prototype.sendMessage = function sendMessage (message) {
{
/* eslint-disable no-console */
console.log('Sending', message);
/* eslint-enable no-console */
}
this.socket.send(JSON.stringify(message));

@@ -288,2 +307,2 @@ };

exports['default'] = createConnection;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjpudWxsLCJzb3VyY2VzIjpbIi4uL2xpYi9tZXNzYWdlcy5qcyIsIi4uL2xpYi9pbmRleC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gYXV0aChhdXRoVG9rZW4pIHtcbiAgcmV0dXJuIHtcbiA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GEpO1xuXG4gICAgICAgIGlmIChfX0RFVl9fKSB7XG4gICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgIGNvbnNvbGUubG9nKG1lc3NhZ2UpO1xuICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tY29uc29sZSAqL1xuICAgICAgICB9XG5cbiAgICAgICAgc3dpdGNoIChtZXNzYWdlLnR5cGUpIHtcbiAgICAgICAgICBjYXNlICdhdXRoX3JlcXVpcmVkJzpcbiAgICAgICAgICAgIHRoaXMuc2VuZE1lc3NhZ2UobWVzc2FnZXMuYXV0aCh0aGlzLm9wdGlvbnMuYXV0aFRva2VuKSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJ2F1dGhfaW52YWxpZCc6XG4gICAgICAgICAgICByZWplY3QoeyBjb2RlOiBFUlJfSU5WQUxJRF9BVVRIIH0pO1xuICAgICAgICAgICAgaW52YWxpZEF1dGggPSB0cnVlO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlICdhdXRoX29rJzpcbiAgICAgICAgICAgIHJlc29sdmUodGhpcyk7XG4gICAgICAgICAgICB0aGlzLmZpcmVFdmVudCgncmVhZHknKTtcblxuICAgICAgICAgICAgLy8gUmUtc3Vic2NyaWJlIHRvIGV2ZW50cyBhbmQgdXBkYXRlIG9sZCBsb2NhdGlvbiBvZiB1bnN1YiBtZXRob2RcbiAgICAgICAgICAgIC8vIHNvIG9sZCB1bnN1YiBtZXRob2Qga2VlcHMgd29ya2luZy5cbiAgICAgICAgICAgIHRoaXMuY29tbWFuZElkID0gMTtcbiAgICAgICAgICAgIHRoaXMuY29tbWFuZHMgPSB7fTtcblxuICAgICAgICAgICAgT2JqZWN0LmtleXMob2xkQ29tbWFuZHMpLmZvckVhY2goKGlkKSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IGluZm8gPSBvbGRDb21tYW5kc1tpZF07XG5cbiAgICAgICAgICAgICAgaWYgKGluZm8uZXZlbnRUeXBlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdWJzY3JpYmVFdmVudHMoaW5mby5ldmVudENhbGxiYWNrLCBpbmZvLmV2ZW50VHlwZSlcbiAgICAgICAgICAgICAgICAgIC50aGVuKCh1bnN1YikgPT4geyBpbmZvLnVuc3Vic2NyaWJlID0gdW5zdWI7IH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAnZXZlbnQnOlxuICAgICAgICAgICAgdGhpcy5jb21tYW5kc1ttZXNzYWdlLmlkXS5ldmVudENhbGxiYWNrKG1lc3NhZ2UuZXZlbnQpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlICdyZXN1bHQnOlxuICAgICAgICAgICAgaWYgKG1lc3NhZ2Uuc3VjY2Vzcykge1xuICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzW21lc3NhZ2UuaWRdLnJlc29sdmUobWVzc2FnZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzW21lc3NhZ2UuaWRdLnJlamVjdChtZXNzYWdlLmVycm9yKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmNvbW1hbmRzW21lc3NhZ2UuaWRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgaWYgKF9fREVWX18pIHtcbiAgICAgICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ1VuaGFuZGxlZCBtZXNzYWdlJywgbWVzc2FnZSk7XG4gICAgICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgfVxuICAgICAgIC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ICAgICAgLyogZXNsaW50LWVuYWJsZSBuby1jb25zb2xlICovXG4gICAgICAgIH1cblxuICAgICAgICBzd2l0Y2ggKG1lc3NhZ2UudHlwZSkge1xuICAgICAgICAgIGNhc2UgJ2V2ZW50JzpcbiAgICAgICAgICAgIHRoaXMuY29tbWFuZHNbbWVzc2FnZS5pZF0uZXZlbnRDYWxsYmFjayhtZXNzYWdlLmV2ZW50KTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAncmVzdWx0JzpcbiAgICAgICAgICAgIGlmIChtZXNzYWdlLnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgdGhpcy5jb21tYW5kc1ttZXNzYWdlLmlkXS5yZXNvbHZlKG1lc3NhZ2UpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhpcy5jb21tYW5kc1ttZXNzYWdlLmlkXS5yZWplY3QobWVzc2FnZS5lcnJvcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWxldGUgdGhpcy5jb21tYW5kc1ttZXNzYWdlLmlkXTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAncG9uZyc6XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJ2F1dGhfcmVxdWlyZWQnOlxuICAgICAgICAgICAgdGhpcy5zZW5kTWVzc2FnZShtZXNzYWdlcy5hdXRoKHRoaXMub3B0aW9ucy5hdXRoVG9rZW4pKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAnYXV0aF9pbnZhbGlkJzpcbiAgICAgICAgICAgIHJlamVjdCh7IGNvZGU6IEVSUl9JTlZBTElEX0FVVEggfSk7XG4gICAgICAgICAgICBpbnZhbGlkQXV0aCA9IHRydWU7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJ2F1dGhfb2snOlxuICAgICAgICAgICAgcmVzb2x2ZSh0aGlzKTtcbiAgICAgICAgICAgIHRoaXMuZmlyZUV2ZW50KCdyZWFkeScpO1xuXG4gICAgICAgICAgICAvLyBSZS1zdWJzY3JpYmUgdG8gZXZlbnRzIGFuZCB1cGRhdGUgb2xkIGxvY2F0aW9uIG9mIHVuc3ViIG1ldGhvZFxuICAgICAgICAgICAgLy8gc28gb2xkIHVuc3ViIG1ldGhvZCBrZWVwcyB3b3JraW5nLlxuICAgICAgICAgICAgdGhpcy5jb21tYW5kSWQgPSAxO1xuICAgICAgICAgICAgdGhpcy5jb21tYW5kcyA9IHt9O1xuXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhvbGRDb21tYW5kcykuZm9yRWFjaCgoaWQpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgaW5mbyA9IG9sZENvbW1hbmRzW2lkXTtcblxuICAgICAgICAgICAgICBpZiAoaW5mby5ldmVudFR5cGUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnN1YnNjcmliZUV2ZW50cyhpbmZvLmV2ZW50Q2FsbGJhY2ssIGluZm8uZXZlbnRUeXBlKVxuICAgICAgICAgICAgICAgICAgLnRoZW4oKHVuc3ViKSA9PiB7IGluZm8udW5zdWJzY3JpYmUgPSB1bnN1YjsgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgaWYgKF9fREVWX18pIHtcbiAgICAgICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ1VuaGFuZGxlZCBtZXNzYWdlJywgbWVzc2FnZSk7XG4gICAgICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgdGhpcy5zb2NrZXQuYWRkRXZlbnRMaXN0ZW5lcignY2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LFVBQVUsQ0FBQyxHQUFHLEVBQUUsT0FBTyxDQUFDLENBQUM7RUFDMUMsT0FBTyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7Q0FDdkIsQUFFRCxBQUFnQzs7Ozs7In0=

@@ -65,2 +65,8 @@ function auth(authToken) {

function ping$1() {
return {
type: 'ping',
};
}
var ERR_CANNOT_CONNECT = 1;

@@ -129,3 +135,3 @@ var ERR_INVALID_AUTH = 2;

/* eslint-disable no-console */
console.log(message);
console.log('Received', message);
/* eslint-enable no-console */

@@ -135,2 +141,18 @@ }

switch (message.type) {
case 'event':
this$1.commands[message.id].eventCallback(message.event);
break;
case 'result':
if (message.success) {
this$1.commands[message.id].resolve(message);
} else {
this$1.commands[message.id].reject(message.error);
}
delete this$1.commands[message.id];
break;
case 'pong':
break;
case 'auth_required':

@@ -164,15 +186,2 @@ this$1.sendMessage(auth(this$1.options.authToken));

case 'event':
this$1.commands[message.id].eventCallback(message.event);
break;
case 'result':
if (message.success) {
this$1.commands[message.id].resolve(message);
} else {
this$1.commands[message.id].reject(message.error);
}
delete this$1.commands[message.id];
break;
default:

@@ -256,3 +265,13 @@ {

Connection.prototype.ping = function ping () {
return this.sendMessagePromise(ping$1());
};
Connection.prototype.sendMessage = function sendMessage (message) {
{
/* eslint-disable no-console */
console.log('Sending', message);
/* eslint-enable no-console */
}
this.socket.send(JSON.stringify(message));

@@ -281,2 +300,2 @@ };

export { ERR_CANNOT_CONNECT, ERR_INVALID_AUTH, createConnection };export default createConnection;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjpudWxsLCJzb3VyY2VzIjpbIi4uL2xpYi9tZXNzYWdlcy5qcyIsIi4uL2xpYi9pbmRleC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gYXV0aChhdXRoVG9rZW4pIHtcbiAgcmV0dXJuIHtcbiAgICB0eXBlOiAnYXV0aCcsXG4gICAgYXBpX3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SB7XG4gICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgIGNvbnNvbGUubG9nKG1lc3NhZ2UpO1xuICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tY29uc29sZSAqL1xuICAgICAgICB9XG5cbiAgICAgICAgc3dpdGNoIChtZXNzYWdlLnR5cGUpIHtcbiAgICAgICAgICBjYXNlICdhdXRoX3JlcXVpcmVkJzpcbiAgICAgICAgICAgIHRoaXMuc2VuZE1lc3NhZ2UobWVzc2FnZXMuYXV0aCh0aGlzLm9wdGlvbnMuYXV0aFRva2VuKSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJ2F1dGhfaW52YWxpZCc6XG4gICAgICAgICAgICByZWplY3QoeyBjb2RlOiBFUlJfSU5WQUxJRF9BVVRIIH0pO1xuICAgICAgICAgICAgaW52YWxpZEF1dGggPSB0cnVlO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlICdhdXRoX29rJzpcbiAgICAgICAgICAgIHJlc29sdmUodGhpcyk7XG4gICAgICAgICAgICB0aGlzLmZpcmVFdmVudCgncmVhZHknKTtcblxuICAgICAgICAgICAgLy8gUmUtc3Vic2NyaWJlIHRvIGV2ZW50cyBhbmQgdXBkYXRlIG9sZCBsb2NhdGlvbiBvZiB1bnN1YiBtZXRob2RcbiAgICAgICAgICAgIC8vIHNvIG9sZCB1bnN1YiBtZXRob2Qga2VlcHMgd29ya2luZy5cbiAgICAgICAgICAgIHRoaXMuY29tbWFuZElkID0gMTtcbiAgICAgICAgICAgIHRoaXMuY29tbWFuZHMgPSB7fTtcblxuICAgICAgICAgICAgT2JqZWN0LmtleXMob2xkQ29tbWFuZHMpLmZvckVhY2goKGlkKSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IGluZm8gPSBvbGRDb21tYW5kc1tpZF07XG5cbiAgICAgICAgICAgICAgaWYgKGluZm8uZXZlbnRUeXBlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdWJzY3JpYmVFdmVudHMoaW5mby5ldmVudENhbGxiYWNrLCBpbmZvLmV2ZW50VHlwZSlcbiAgICAgICAgICAgICAgICAgIC50aGVuKCh1bnN1YikgPT4geyBpbmZvLnVuc3Vic2NyaWJlID0gdW5zdWI7IH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAnZXZlbnQnOlxuICAgICAgICAgICAgdGhpcy5jb21tYW5kc1ttZXNzYWdlLmlkXS5ldmVudENhbGxiYWNrKG1lc3NhZ2UuZXZlbnQpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlICdyZXN1bHQnOlxuICAgICAgICAgICAgaWYgKG1lc3NhZ2Uuc3VjY2Vzcykge1xuICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzW21lc3NhZ2UuaWRdLnJlc29sdmUobWVzc2FnZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzW21lc3NhZ2UuaWRdLnJlamVjdChtZXNzYWdlLmVycm9yKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmNvbW1hbmRzW21lc3NhZ2UuaWRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgaWYgKF9fREVWX18pIHtcbiAgICAgICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ1VuaGFuZGxlZCBtZXNzYWdlJywgbWVzc2FnZSk7XG4gICAgICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgdGhpcy5z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ICovXG4gICAgICAgIH1cblxuICAgICAgICBzd2l0Y2ggKG1lc3NhZ2UudHlwZSkge1xuICAgICAgICAgIGNhc2UgJ2V2ZW50JzpcbiAgICAgICAgICAgIHRoaXMuY29tbWFuZHNbbWVzc2FnZS5pZF0uZXZlbnRDYWxsYmFjayhtZXNzYWdlLmV2ZW50KTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAncmVzdWx0JzpcbiAgICAgICAgICAgIGlmIChtZXNzYWdlLnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgdGhpcy5jb21tYW5kc1ttZXNzYWdlLmlkXS5yZXNvbHZlKG1lc3NhZ2UpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhpcy5jb21tYW5kc1ttZXNzYWdlLmlkXS5yZWplY3QobWVzc2FnZS5lcnJvcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWxldGUgdGhpcy5jb21tYW5kc1ttZXNzYWdlLmlkXTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAncG9uZyc6XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJ2F1dGhfcmVxdWlyZWQnOlxuICAgICAgICAgICAgdGhpcy5zZW5kTWVzc2FnZShtZXNzYWdlcy5hdXRoKHRoaXMub3B0aW9ucy5hdXRoVG9rZW4pKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAnYXV0aF9pbnZhbGlkJzpcbiAgICAgICAgICAgIHJlamVjdCh7IGNvZGU6IEVSUl9JTlZBTElEX0FVVEggfSk7XG4gICAgICAgICAgICBpbnZhbGlkQXV0aCA9IHRydWU7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJ2F1dGhfb2snOlxuICAgICAgICAgICAgcmVzb2x2ZSh0aGlzKTtcbiAgICAgICAgICAgIHRoaXMuZmlyZUV2ZW50KCdyZWFkeScpO1xuXG4gICAgICAgICAgICAvLyBSZS1zdWJzY3JpYmUgdG8gZXZlbnRzIGFuZCB1cGRhdGUgb2xkIGxvY2F0aW9uIG9mIHVuc3ViIG1ldGhvZFxuICAgICAgICAgICAgLy8gc28gb2xkIHVuc3ViIG1ldGhvZCBrZWVwcyB3b3JraW5nLlxuICAgICAgICAgICAgdGhpcy5jb21tYW5kSWQgPSAxO1xuICAgICAgICAgICAgdGhpcy5jb21tYW5kcyA9IHt9O1xuXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhvbGRDb21tYW5kcykuZm9yRWFjaCgoaWQpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgaW5mbyA9IG9sZENvbW1hbmRzW2lkXTtcblxuICAgICAgICAgICAgICBpZiAoaW5mby5ldmVudFR5cGUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnN1YnNjcmliZUV2ZW50cyhpbmZvLmV2ZW50Q2FsbGJhY2ssIGluZm8uZXZlbnRUeXBlKVxuICAgICAgICAgICAgICAgICAgLnRoZW4oKHVuc3ViKSA9PiB7IGluZm8udW5zdWJzY3JpYmUgPSB1bnN1YjsgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgaWYgKF9fREVWX18pIHtcbiAgICAgICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ1VuaGFuZGxlZCBtZXNzYWdlJywgbWVzc2FnZSk7XG4gICAgICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgdGhpcy5zb2NrZXQuYWRkRXZlbnRMaXN0ZW5lcignY2xvc2UnLCAoKSA9PiB7XG4gICAgICAgIGlmIChpbnZ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sQ0FBQztFQUMxQyxPQUFPLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztDQUN2QixBQUVELEFBQWdDOzsifQ==

@@ -71,2 +71,8 @@ (function (global, factory) {

function ping$1() {
return {
type: 'ping',
};
}
var ERR_CANNOT_CONNECT = 1;

@@ -135,3 +141,3 @@ var ERR_INVALID_AUTH = 2;

/* eslint-disable no-console */
console.log(message);
console.log('Received', message);
/* eslint-enable no-console */

@@ -141,2 +147,18 @@ }

switch (message.type) {
case 'event':
this$1.commands[message.id].eventCallback(message.event);
break;
case 'result':
if (message.success) {
this$1.commands[message.id].resolve(message);
} else {
this$1.commands[message.id].reject(message.error);
}
delete this$1.commands[message.id];
break;
case 'pong':
break;
case 'auth_required':

@@ -170,15 +192,2 @@ this$1.sendMessage(auth(this$1.options.authToken));

case 'event':
this$1.commands[message.id].eventCallback(message.event);
break;
case 'result':
if (message.success) {
this$1.commands[message.id].resolve(message);
} else {
this$1.commands[message.id].reject(message.error);
}
delete this$1.commands[message.id];
break;
default:

@@ -262,3 +271,13 @@ {

Connection.prototype.ping = function ping () {
return this.sendMessagePromise(ping$1());
};
Connection.prototype.sendMessage = function sendMessage (message) {
{
/* eslint-disable no-console */
console.log('Sending', message);
/* eslint-enable no-console */
}
this.socket.send(JSON.stringify(message));

@@ -294,2 +313,2 @@ };

})));
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjpudWxsLCJzb3VyY2VzIjpbIi4uL2xpYi9tZXNzYWdlcy5qcyIsIi4uL2xpYi9pbmRleC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gYXV0aChhdXRoVG9rZW4pIHtcbiAgcmV0dXJuIHtcbiAgICB0eXBlOiAnYXV0aCcsXG4gICAgYXBpX3Bhc3N3b3JkOiBhdXRoVG9rZW4sXG4gIH07XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGF0ZXMoKSB7XG4gIHJldHV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2UpO1xuICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tY29uc29sZSAqL1xuICAgICAgICB9XG5cbiAgICAgICAgc3dpdGNoIChtZXNzYWdlLnR5cGUpIHtcbiAgICAgICAgICBjYXNlICdhdXRoX3JlcXVpcmVkJzpcbiAgICAgICAgICAgIHRoaXMuc2VuZE1lc3NhZ2UobWVzc2FnZXMuYXV0aCh0aGlzLm9wdGlvbnMuYXV0aFRva2VuKSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJ2F1dGhfaW52YWxpZCc6XG4gICAgICAgICAgICByZWplY3QoeyBjb2RlOiBFUlJfSU5WQUxJRF9BVVRIIH0pO1xuICAgICAgICAgICAgaW52YWxpZEF1dGggPSB0cnVlO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlICdhdXRoX29rJzpcbiAgICAgICAgICAgIHJlc29sdmUodGhpcyk7XG4gICAgICAgICAgICB0aGlzLmZpcmVFdmVudCgncmVhZHknKTtcblxuICAgICAgICAgICAgLy8gUmUtc3Vic2NyaWJlIHRvIGV2ZW50cyBhbmQgdXBkYXRlIG9sZCBsb2NhdGlvbiBvZiB1bnN1YiBtZXRob2RcbiAgICAgICAgICAgIC8vIHNvIG9sZCB1bnN1YiBtZXRob2Qga2VlcHMgd29ya2luZy5cbiAgICAgICAgICAgIHRoaXMuY29tbWFuZElkID0gMTtcbiAgICAgICAgICAgIHRoaXMuY29tbWFuZHMgPSB7fTtcblxuICAgICAgICAgICAgT2JqZWN0LmtleXMob2xkQ29tbWFuZHMpLmZvckVhY2goKGlkKSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IGluZm8gPSBvbGRDb21tYW5kc1tpZF07XG5cbiAgICAgICAgICAgICAgaWYgKGluZm8uZXZlbnRUeXBlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdWJzY3JpYmVFdmVudHMoaW5mby5ldmVudENhbGxiYWNrLCBpbmZvLmV2ZW50VHlwZSlcbiAgICAgICAgICAgICAgICAgIC50aGVuKCh1bnN1YikgPT4geyBpbmZvLnVuc3Vic2NyaWJlID0gdW5zdWI7IH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAnZXZlbnQnOlxuICAgICAgICAgICAgdGhpcy5jb21tYW5kc1ttZXNzYWdlLmlkXS5ldmVudENhbGxiYWNrKG1lc3NhZ2UuZXZlbnQpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlICdyZXN1bHQnOlxuICAgICAgICAgICAgaWYgKG1lc3NhZ2Uuc3VjY2Vzcykge1xuICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzW21lc3NhZ2UuaWRdLnJlc29sdmUobWVzc2FnZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLmNvbW1hbmRzW21lc3NhZ2UuaWRdLnJlamVjdChtZXNzYWdlLmVycm9yKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRlbGV0ZSB0aGlzLmNvbW1hbmRzW21lc3NhZ2UuaWRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgaWYgKF9fREVWX18pIHtcbiAgICAgICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ1VuaGFuZGxlZCBtZXNzYWdlJywgbWVzc2FnZSk7XG4gICAgICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgdGhpcy5zb2NrZXQuYWRkRXZlbnRMaXN0ZW5lcignY2xvc2UnLCAoKSA9PiB7XG4gICAgICAgIGlmIChpbnZhbGlkQXV0aCB8fCB0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CB1cGRhdGUgb2xkIGxvY2F0aW9uIG9mIHVuc3ViIG1ldGhvZFxuICAgICAgICAgICAgLy8gc28gb2xkIHVuc3ViIG1ldGhvZCBrZWVwcyB3b3JraW5nLlxuICAgICAgICAgICAgdGhpcy5jb21tYW5kSWQgPSAxO1xuICAgICAgICAgICAgdGhpcy5jb21tYW5kcyA9IHt9O1xuXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhvbGRDb21tYW5kcykuZm9yRWFjaCgoaWQpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgaW5mbyA9IG9sZENvbW1hbmRzW2lkXTtcblxuICAgICAgICAgICAgICBpZiAoaW5mby5ldmVudFR5cGUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnN1YnNjcmliZUV2ZW50cyhpbmZvLmV2ZW50Q2FsbGJhY2ssIGluZm8uZXZlbnRUeXBlKVxuICAgICAgICAgICAgICAgICAgLnRoZW4oKHVuc3ViKSA9PiB7IGluZm8udW5zdWJzY3JpYmUgPSB1bnN1YjsgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgaWYgKF9fREVWX18pIHtcbiAgICAgICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ1VuaGFuZGxlZCBtZXNzYWdlJywgbWVzc2FnZSk7XG4gICAgICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tY29uc29sZSAqL1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgdGhpcy5zb2NrZXQuYWRkRXZlbnRMaXN0ZW5lcignY2xvc2UnLCAoKSA9PiB7XG4gICAgICAgIGlmIChpbnZhbGlkQXV0aCB8fCB0aGlzLmNsb3NlUmVxdWVzdGVkKSB7XG4gICAgICAgICAgLy8gV2hlb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2QixBQUVELEFBQWdDOzs7Ozs7Ozs7In0=
{
"name": "home-assistant-js-websocket",
"version": "0.1.3",
"version": "0.1.4",
"description": "Home Assistant websocket client",

@@ -5,0 +5,0 @@ "main": "dist/haws.cjs.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc