@awarevue/agent-sdk 1.0.28 → 1.0.29

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
@@ -125,12 +125,18 @@ class AgentApp {
125
125
  }).pipe((0, rxjs_1.retry)({ delay: 3000 }))
126
126
  : rxjs_1.EMPTY));
127
127
  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'
128
- ? (0, rxjs_1.merge)((0, rxjs_1.of)({
128
+ ? (0, rxjs_1.merge)(this.agent
129
+ .getDevicesAndRelations$({
130
+ provider: message.provider,
131
+ config: message.config,
132
+ })
133
+ .pipe((0, rxjs_1.map)((deviceCatalog) => ({
129
134
  provider: message.provider,
130
135
  config: message.config,
131
136
  lastEventForeignRef: message.lastEventForeignRef,
132
137
  lastEventTimestamp: message.lastEventTimestamp,
133
- }).pipe((0, rxjs_1.mergeMap)((context) => this.runProvider$(context))), (0, rxjs_1.of)({
138
+ deviceCatalog,
139
+ })), (0, rxjs_1.mergeMap)((context) => this.runProvider$(context))), (0, rxjs_1.of)({
134
140
  kind: 'start-rs',
135
141
  requestId: message.id,
136
142
  }).pipe((0, rxjs_1.tap)((reply) => this.options.transport.send(this.addEnvelope(reply)))))
package/dist/agent.d.ts CHANGED
@@ -6,14 +6,21 @@ export type Context = {
6
6
  config: Record<string, unknown>;
7
7
  };
8
8
  export type RunContext = Context & {
9
+ deviceCatalog: DeviceDiscoveryDto;
9
10
  lastEventForeignRef: string | null;
10
11
  lastEventTimestamp: number | null;
11
12
  };
13
+ export type RunCommandContext = Context & {
14
+ deviceCatalog: DeviceDiscoveryDto;
15
+ };
16
+ export type AccessChangeContext = Context & {
17
+ deviceCatalog: DeviceDiscoveryDto;
18
+ };
12
19
  export interface Agent {
13
20
  getConfigIssues$: (context: Context) => Observable<ValidateProviderConfigRs['issues']>;
14
21
  getDevicesAndRelations$: (context: Context) => Observable<DeviceDiscoveryDto>;
15
22
  run$: (context: RunContext) => Observable<DeviceActivity>;
16
- runCommand$: (context: Context, command: RunCommandRq) => Observable<unknown>;
17
- validateAccessChange$?: (context: Context, change: AccessValidateChangeRq) => Observable<AccessChangeIssue[]>;
18
- applyAccessChange$?: (context: Context, change: AccessApplyChange) => Observable<AccessRefMap>;
23
+ runCommand$: (context: RunCommandContext, command: RunCommandRq) => Observable<unknown>;
24
+ validateAccessChange$?: (context: AccessChangeContext, change: AccessValidateChangeRq) => Observable<AccessChangeIssue[]>;
25
+ applyAccessChange$?: (context: AccessChangeContext, change: AccessApplyChange) => Observable<AccessRefMap>;
19
26
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/agent-sdk",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "SDK for building Agent implementations that speak the Aware protocol.",
5
5
  "author": "Yaser Awajan",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/agent-sdk",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "SDK for building Agent implementations that speak the Aware protocol.",
5
5
  "author": "Yaser Awajan",
6
6
  "license": "MIT",