@awarevue/agent-sdk 2.0.82 → 2.0.84

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.
@@ -7,6 +7,7 @@ export type AgentOptions = {
7
7
  accessControlProviders?: Record<string, AccessControlCapabilityReport>;
8
8
  agentId: string;
9
9
  replyTimeout?: number;
10
+ testerCliTags?: string[];
10
11
  transport: DuplexTransport<Message<FromServer>, Message<FromAgent>>;
11
12
  };
12
13
  export declare class AgentApp {
package/dist/agent-app.js CHANGED
@@ -50,7 +50,6 @@ class AgentApp {
50
50
  person: {},
51
51
  accessRule: {},
52
52
  schedule: {},
53
- device: {},
54
53
  zone: {},
55
54
  };
56
55
  return this.options.transport.messages$.pipe((0, rxjs_1.startWith)(null), // emit immediately to ensure subscription is active
@@ -136,6 +135,28 @@ class AgentApp {
136
135
  requestId: message.id,
137
136
  refs: result,
138
137
  })));
138
+ case 'describe-object': {
139
+ if (!this.agent.find$) {
140
+ return (0, rxjs_1.throwError)(() => new agent_error_1.AgentError(`Agent ${context.provider} does not support object description`, 'NOT_SUPPORTED')).pipe(this.handleResponse$(message.id));
141
+ }
142
+ const find$ = this.agent.find$;
143
+ return find$(context, message.objectKind, [
144
+ message.objectAssignedRef,
145
+ ]).pipe((0, rxjs_1.map)((result) => {
146
+ const data = result[message.objectAssignedRef];
147
+ return data !== undefined
148
+ ? {
149
+ objectKind: message.objectKind,
150
+ objectAssignedRef: message.objectAssignedRef,
151
+ data,
152
+ }
153
+ : null;
154
+ }), this.handleResponse$(message.id, (object) => ({
155
+ kind: 'describe-object-rs',
156
+ requestId: message.id,
157
+ object: object,
158
+ })));
159
+ }
139
160
  default:
140
161
  return rxjs_1.EMPTY;
141
162
  }
@@ -148,6 +169,7 @@ class AgentApp {
148
169
  kind: 'register',
149
170
  providers: this.options.providers,
150
171
  accessControlProviders: this.options.accessControlProviders,
172
+ testerCliTags: this.options.testerCliTags,
151
173
  })
152
174
  .pipe((0, rxjs_1.retry)({ delay: 3000 }))
153
175
  : rxjs_1.EMPTY));
package/dist/agent.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ValidateProviderConfigRs, DeviceDiscoveryDto, RunCommandRq, AccessValidateChangeRq, AccessChangeIssue, AccessApplyChange, AccessRefMap, AccessObjectKind, QueryRq, PushFile } from '@awarevue/api-types';
1
+ import { ValidateProviderConfigRs, DeviceDiscoveryDto, RunCommandRq, AccessValidateChangeRq, AccessChangeIssue, AccessApplyChange, AccessRefMap, AccessObjectKind, ObjectKinds, QueryRq, PushFile, ExternalObjectProps } from '@awarevue/api-types';
2
2
  import { Observable } from 'rxjs';
3
3
  import { DeviceActivity } from './agent-app';
4
4
  export type Context = {
@@ -15,8 +15,8 @@ export type RunCommandContext = Context & {
15
15
  };
16
16
  export type AccessChangeContext = Context & {
17
17
  deviceCatalog: DeviceDiscoveryDto;
18
- objectsById: <T extends Record<string, unknown>>(objectKind: AccessObjectKind, objectId: string) => T[];
19
- objectByForeignRef: <T extends Record<string, unknown>>(objectKind: AccessObjectKind, foreignRef: string) => T | null;
18
+ objectsById: <K extends AccessObjectKind>(objectKind: K, objectId: string) => ObjectKinds[K][];
19
+ objectByForeignRef: <K extends AccessObjectKind>(objectKind: K, foreignRef: string) => ObjectKinds[K] | null;
20
20
  };
21
21
  export interface Agent {
22
22
  getConfigIssues$: (context: Context) => Observable<ValidateProviderConfigRs['issues']>;
@@ -26,6 +26,6 @@ export interface Agent {
26
26
  getResult$?: (context: Context, query: QueryRq) => Observable<unknown>;
27
27
  validateAccessChange$?: (context: AccessChangeContext, change: AccessValidateChangeRq) => Observable<AccessChangeIssue[]>;
28
28
  applyAccessChange$?: (context: AccessChangeContext, change: AccessApplyChange) => Observable<AccessRefMap>;
29
- find$?: (context: Context, objectKind: AccessObjectKind, objectIds: string[]) => Observable<Record<string, Record<string, unknown>>>;
29
+ find$?: <K extends AccessObjectKind>(context: Context, objectKind: K, objectIds: string[]) => Observable<Record<string, ExternalObjectProps[K]>>;
30
30
  pushFile?: (context: Context, req: PushFile) => Observable<boolean>;
31
31
  }
@@ -1,10 +1,10 @@
1
1
  import { AccessValidateChangeRq } from '@awarevue/api-types';
2
2
  import { Agent, Context } from './agent';
3
3
  export declare const createValidator: <T extends Agent>(agent: T) => (context: Context, change: AccessValidateChangeRq) => import("rxjs").Observable<readonly [{
4
+ objectId?: string | undefined;
5
+ objectKind?: "accessRule" | "schedule" | "person" | "zone" | undefined;
4
6
  code?: "BAD_REFERENCE" | "NOT_SUPPORTED" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | undefined;
5
7
  path?: string | undefined;
6
- message?: string | undefined;
7
- objectKind?: "person" | "zone" | "schedule" | "device" | "accessRule" | undefined;
8
- objectId?: string | undefined;
9
8
  index?: number | undefined;
10
- }[], Record<"accessRule" | "schedule" | "person" | "zone" | "device", Record<string, Record<string, unknown>>>]>;
9
+ message?: string | undefined;
10
+ }[], Record<"accessRule" | "schedule" | "person" | "zone", Record<string, Record<string, unknown>>>]>;
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.82",
7
+ "version": "2.0.84",
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,13 @@
31
31
  "lint:fix": "yarn lint --fix"
32
32
  },
33
33
  "peerDependencies": {
34
- "@awarevue/api-types": "2.0.82",
34
+ "@awarevue/api-types": "2.0.84",
35
35
  "rxjs": "^7.8.2",
36
- "ws": "^8"
36
+ "ws": "^8",
37
+ "zod": "4.4.3"
37
38
  },
38
39
  "devDependencies": {
39
- "@awarevue/api-types": "2.0.82",
40
+ "@awarevue/api-types": "2.0.84",
40
41
  "@types/node": "^20.12.7",
41
42
  "@types/ws": "^8.18.1",
42
43
  "@typescript-eslint/eslint-plugin": "^8.31.1",
@@ -48,7 +49,7 @@
48
49
  "typescript": "^5.8.3",
49
50
  "vitest": "^4.1.4",
50
51
  "ws": "^8",
51
- "zod": "3.25.76"
52
+ "zod": "4.4.3"
52
53
  },
53
54
  "publishConfig": {
54
55
  "access": "public",
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.82",
7
+ "version": "2.0.84",
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,13 @@
31
31
  "lint:fix": "yarn lint --fix"
32
32
  },
33
33
  "peerDependencies": {
34
- "@awarevue/api-types": "2.0.82",
34
+ "@awarevue/api-types": "2.0.84",
35
35
  "rxjs": "^7.8.2",
36
- "ws": "^8"
36
+ "ws": "^8",
37
+ "zod": "4.4.3"
37
38
  },
38
39
  "devDependencies": {
39
- "@awarevue/api-types": "2.0.82",
40
+ "@awarevue/api-types": "2.0.84",
40
41
  "@types/node": "^20.12.7",
41
42
  "@types/ws": "^8.18.1",
42
43
  "@typescript-eslint/eslint-plugin": "^8.31.1",
@@ -48,7 +49,7 @@
48
49
  "typescript": "^5.8.3",
49
50
  "vitest": "^4.1.4",
50
51
  "ws": "^8",
51
- "zod": "3.25.76"
52
+ "zod": "4.4.3"
52
53
  },
53
54
  "publishConfig": {
54
55
  "access": "public",