@pioneer-platform/pioneer-events 8.1.39 → 8.1.44

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.d.ts CHANGED
@@ -15,5 +15,6 @@ export declare class Events {
15
15
  private disconnect;
16
16
  private subscribeToKey;
17
17
  private subscribeToInvocation;
18
+ private send;
18
19
  constructor(config: EventsConfig);
19
20
  }
package/lib/index.js CHANGED
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -38,7 +38,7 @@ 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 EventEmitter = require('events');
41
+ var events_1 = require("events");
42
42
  var io = require('socket.io-client');
43
43
  var wait = require('wait-promise');
44
44
  var sleep = wait.sleep;
@@ -50,7 +50,7 @@ var Events = /** @class */ (function () {
50
50
  this.username = config.username;
51
51
  this.queryKey = config.queryKey;
52
52
  this.isPaired = false;
53
- this.events = new EventEmitter();
53
+ this.events = new events_1.EventEmitter();
54
54
  this.init = function () {
55
55
  return __awaiter(this, void 0, void 0, function () {
56
56
  var tag, e_1;
@@ -171,6 +171,26 @@ var Events = /** @class */ (function () {
171
171
  });
172
172
  });
173
173
  };
174
+ this.send = function (channel, event) {
175
+ return __awaiter(this, void 0, void 0, function () {
176
+ var tag;
177
+ return __generator(this, function (_a) {
178
+ tag = TAG + " | subscribeToKey | ";
179
+ try {
180
+ //attempt join
181
+ this.socket.emit('join', {
182
+ queryKey: config.queryKey
183
+ });
184
+ return [2 /*return*/, true];
185
+ }
186
+ catch (e) {
187
+ console.error(e);
188
+ throw e;
189
+ }
190
+ return [2 /*return*/];
191
+ });
192
+ });
193
+ };
174
194
  this.pair = function (username) {
175
195
  return __awaiter(this, void 0, void 0, function () {
176
196
  var tag;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer-events",
3
- "version": "8.1.39",
3
+ "version": "8.1.44",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/main.d.ts",
6
6
  "scripts": {
@@ -14,12 +14,13 @@
14
14
  "refresh": "rm -rf ./node_modules ./package-lock.json && npm install"
15
15
  },
16
16
  "dependencies": {
17
- "@pioneer-platform/pioneer-types": "^8.1.44",
18
- "log-node": "^8.0.3",
17
+ "@pioneer-platform/pioneer-types": "^8.1.53",
18
+ "@types/node": "^18.15.11",
19
19
  "socket.io-client": "^4.5.4",
20
20
  "ts-node": "^8.10.2",
21
- "typescript": "^3.9.7",
22
- "wait-promise": "^0.4.1"
21
+ "typescript": "^5.0.2",
22
+ "wait-promise": "^0.4.1",
23
+ "events": "^3.3.0"
23
24
  },
24
- "gitHead": "d0e74ea447175d6d7e9697793093f9155f0dab38"
25
+ "gitHead": "8c626a669f7045d1eb9c00252d9a81845a57fa50"
25
26
  }