@pioneer-platform/pioneer-events 8.1.35 → 8.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +6 -11
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -38,7 +38,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Events = void 0;
|
|
40
40
|
var TAG = " | ws-client | ";
|
|
41
|
-
var log = require("log");
|
|
42
41
|
var EventEmitter = require('events');
|
|
43
42
|
var io = require('socket.io-client');
|
|
44
43
|
var wait = require('wait-promise');
|
|
@@ -69,7 +68,6 @@ var Events = /** @class */ (function () {
|
|
|
69
68
|
});
|
|
70
69
|
//sub
|
|
71
70
|
this.socket.on('connect', function () {
|
|
72
|
-
log.debug(tag, 'Connected to ' + _this.wss);
|
|
73
71
|
_this.isConnected = true;
|
|
74
72
|
//rejoin
|
|
75
73
|
if (_this.username) {
|
|
@@ -80,7 +78,6 @@ var Events = /** @class */ (function () {
|
|
|
80
78
|
}
|
|
81
79
|
});
|
|
82
80
|
this.socket.on('subscribedToUsername', function (event) {
|
|
83
|
-
log.debug(tag, 'subscribed to ' + event.username, " id: " + event.socketId);
|
|
84
81
|
_this.isPaired = true;
|
|
85
82
|
_this.username = event.username;
|
|
86
83
|
});
|
|
@@ -96,12 +93,10 @@ var Events = /** @class */ (function () {
|
|
|
96
93
|
});
|
|
97
94
|
//sub to errors
|
|
98
95
|
this.socket.on('errorMessage', function (message) {
|
|
99
|
-
log.error(tag, "error: ", message);
|
|
100
96
|
if (message.code && message.code === 6)
|
|
101
97
|
throw Error(" Failed to connect!");
|
|
102
98
|
});
|
|
103
99
|
this.socket.on('invocation', function (message) {
|
|
104
|
-
log.debug('invocation: ', message);
|
|
105
100
|
_this.events.emit('message', message);
|
|
106
101
|
});
|
|
107
102
|
_a.label = 2;
|
|
@@ -114,7 +109,7 @@ var Events = /** @class */ (function () {
|
|
|
114
109
|
case 4: return [2 /*return*/, true];
|
|
115
110
|
case 5:
|
|
116
111
|
e_1 = _a.sent();
|
|
117
|
-
|
|
112
|
+
console.error(e_1);
|
|
118
113
|
throw e_1;
|
|
119
114
|
case 6: return [2 /*return*/];
|
|
120
115
|
}
|
|
@@ -130,7 +125,7 @@ var Events = /** @class */ (function () {
|
|
|
130
125
|
this.username = username;
|
|
131
126
|
}
|
|
132
127
|
catch (e) {
|
|
133
|
-
|
|
128
|
+
console.error(e);
|
|
134
129
|
}
|
|
135
130
|
return [2 /*return*/];
|
|
136
131
|
});
|
|
@@ -149,7 +144,7 @@ var Events = /** @class */ (function () {
|
|
|
149
144
|
return [2 /*return*/, true];
|
|
150
145
|
}
|
|
151
146
|
catch (e) {
|
|
152
|
-
|
|
147
|
+
console.error(e);
|
|
153
148
|
throw e;
|
|
154
149
|
}
|
|
155
150
|
return [2 /*return*/];
|
|
@@ -169,7 +164,7 @@ var Events = /** @class */ (function () {
|
|
|
169
164
|
return [2 /*return*/, true];
|
|
170
165
|
}
|
|
171
166
|
catch (e) {
|
|
172
|
-
|
|
167
|
+
console.error(e);
|
|
173
168
|
throw e;
|
|
174
169
|
}
|
|
175
170
|
return [2 /*return*/];
|
|
@@ -195,7 +190,7 @@ var Events = /** @class */ (function () {
|
|
|
195
190
|
return [2 /*return*/, true];
|
|
196
191
|
}
|
|
197
192
|
catch (e) {
|
|
198
|
-
|
|
193
|
+
console.error(e);
|
|
199
194
|
throw e;
|
|
200
195
|
}
|
|
201
196
|
return [2 /*return*/];
|
|
@@ -211,7 +206,7 @@ var Events = /** @class */ (function () {
|
|
|
211
206
|
return [2 /*return*/, this.socket.disconnect()];
|
|
212
207
|
}
|
|
213
208
|
catch (e) {
|
|
214
|
-
|
|
209
|
+
console.error(e);
|
|
215
210
|
}
|
|
216
211
|
return [2 /*return*/];
|
|
217
212
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/pioneer-events",
|
|
3
|
-
"version": "8.1.
|
|
4
|
-
|
|
3
|
+
"version": "8.1.38",
|
|
5
4
|
"main": "./lib/index.js",
|
|
6
5
|
"types": "./lib/main.d.ts",
|
|
7
6
|
"scripts": {
|
|
@@ -16,7 +15,8 @@
|
|
|
16
15
|
},
|
|
17
16
|
"dependencies": {
|
|
18
17
|
"@pioneer-platform/pioneer-types": "^8.1.44",
|
|
19
|
-
"
|
|
18
|
+
"log-node": "^8.0.3",
|
|
19
|
+
"socket.io-client": "^4.5.4",
|
|
20
20
|
"ts-node": "^8.10.2",
|
|
21
21
|
"typescript": "^3.9.7",
|
|
22
22
|
"wait-promise": "^0.4.1"
|