@awarevue/agent-sdk 2.0.80 → 2.0.82

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/dist/agent-app.js CHANGED
@@ -151,7 +151,11 @@ class AgentApp {
151
151
  })
152
152
  .pipe((0, rxjs_1.retry)({ delay: 3000 }))
153
153
  : rxjs_1.EMPTY));
154
- const startStop$ = this.options.transport.messages$.pipe((0, rxjs_1.filter)((message) => message.kind === 'start' || message.kind === 'stop'), (0, rxjs_1.switchMap)((message) => message.kind === 'start'
154
+ const fakeStop$ = this.options.transport.connected$.pipe((0, rxjs_1.pairwise)(), (0, rxjs_1.filter)(([, connected]) => !connected), (0, rxjs_1.map)(() => ({
155
+ kind: 'stop',
156
+ id: 'fake-stop',
157
+ })));
158
+ const startStop$ = (0, rxjs_1.merge)(this.options.transport.messages$, fakeStop$).pipe((0, rxjs_1.filter)((message) => message.kind === 'start' || message.kind === 'stop'), (0, rxjs_1.switchMap)((message) => message.kind === 'start'
155
159
  ? this.agent
156
160
  .getDevicesAndRelations$({
157
161
  provider: message.provider,
@@ -167,7 +171,8 @@ class AgentApp {
167
171
  deviceCatalog,
168
172
  startRequestId: message.id,
169
173
  })), (0, rxjs_1.mergeMap)((context) => this.runProvider$(context)))
170
- : (0, rxjs_1.of)(message).pipe((0, rxjs_1.tap)(() => this.protocol.send({
174
+ : (0, rxjs_1.of)(message).pipe((0, rxjs_1.filter)((msg) => msg.id !== 'fake-stop'), // ignore fake stop signals for protocol communication
175
+ (0, rxjs_1.tap)(() => this.protocol.send({
171
176
  kind: 'stop-rs',
172
177
  requestId: message.id,
173
178
  })))));
package/dist/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
6
6
  },
7
- "version": "2.0.80",
7
+ "version": "2.0.82",
8
8
  "description": "SDK for building Agent implementations that speak the agent protocol.",
9
9
  "author": "Yaser Awajan",
10
10
  "license": "MIT",
@@ -31,12 +31,12 @@
31
31
  "lint:fix": "yarn lint --fix"
32
32
  },
33
33
  "peerDependencies": {
34
- "@awarevue/api-types": "2.0.80",
34
+ "@awarevue/api-types": "2.0.82",
35
35
  "rxjs": "^7.8.2",
36
36
  "ws": "^8"
37
37
  },
38
38
  "devDependencies": {
39
- "@awarevue/api-types": "2.0.80",
39
+ "@awarevue/api-types": "2.0.82",
40
40
  "@types/node": "^20.12.7",
41
41
  "@types/ws": "^8.18.1",
42
42
  "@typescript-eslint/eslint-plugin": "^8.31.1",
@@ -19,7 +19,7 @@ class LoggingDuplexTransport {
19
19
  (_b = opts.logger) !== null && _b !== void 0 ? _b : ((direction, label, msg) => console.log(`[${label}] ${direction}`, JSON.stringify(msg)));
20
20
  this.connected$ = inner.connected$;
21
21
  // Tap into the incoming stream before exposing it to consumers.
22
- this.messages$ = inner.messages$.pipe((0, operators_1.tap)((msg) => this.sink('IN', this.label, msg)));
22
+ this.messages$ = inner.messages$.pipe((0, operators_1.tap)((msg) => this.sink('IN', this.label, msg)), (0, operators_1.share)());
23
23
  }
24
24
  send(msg) {
25
25
  this.sink('OUT', this.label, msg);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
6
6
  },
7
- "version": "2.0.80",
7
+ "version": "2.0.82",
8
8
  "description": "SDK for building Agent implementations that speak the agent protocol.",
9
9
  "author": "Yaser Awajan",
10
10
  "license": "MIT",
@@ -31,12 +31,12 @@
31
31
  "lint:fix": "yarn lint --fix"
32
32
  },
33
33
  "peerDependencies": {
34
- "@awarevue/api-types": "2.0.80",
34
+ "@awarevue/api-types": "2.0.82",
35
35
  "rxjs": "^7.8.2",
36
36
  "ws": "^8"
37
37
  },
38
38
  "devDependencies": {
39
- "@awarevue/api-types": "2.0.80",
39
+ "@awarevue/api-types": "2.0.82",
40
40
  "@types/node": "^20.12.7",
41
41
  "@types/ws": "^8.18.1",
42
42
  "@typescript-eslint/eslint-plugin": "^8.31.1",