@awarevue/api-types 2.0.12 → 2.0.13

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.
@@ -15,7 +15,7 @@ exports.sRunMacroCommand = zod_1.z.object({
15
15
  exports.sNotify = zod_1.z.object({
16
16
  command: zod_1.z.literal('server.notify'),
17
17
  params: zod_1.z.object({
18
- source: primitives_1.sDeviceId,
18
+ source: primitives_1.sDeviceParam,
19
19
  message: zod_1.z.string().nonempty(),
20
20
  severity: primitives_1.sNotificationSeverity,
21
21
  metadata: zod_1.z.record(zod_1.z.unknown()),
@@ -24,7 +24,7 @@ export declare const commandSchemas: {
24
24
  command: import("zod").ZodLiteral<"nvr-exporter.start-export">;
25
25
  params: import("zod").ZodObject<{
26
26
  requestId: import("zod").ZodString;
27
- device: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodIntersection<import("zod").ZodObject<{
27
+ device: import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodIntersection<import("zod").ZodObject<{
28
28
  name: import("zod").ZodString;
29
29
  foreignRef: import("zod").ZodString;
30
30
  provider: import("zod").ZodString;
@@ -276,14 +276,14 @@ export declare const commandSchemas: {
276
276
  type: "system";
277
277
  }, {
278
278
  type: "system";
279
- }>]>>]>;
279
+ }>]>>]>, import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodString], null>]>;
280
280
  timeFrom: import("zod").ZodNumber;
281
281
  timeTo: import("zod").ZodNumber;
282
282
  name: import("zod").ZodString;
283
283
  }, "strip", import("zod").ZodTypeAny, {
284
284
  name: string;
285
285
  requestId: string;
286
- device: string | ({
286
+ device: string | [string, string] | ({
287
287
  name: string;
288
288
  foreignRef: string;
289
289
  provider: string;
@@ -368,7 +368,7 @@ export declare const commandSchemas: {
368
368
  }, {
369
369
  name: string;
370
370
  requestId: string;
371
- device: string | ({
371
+ device: string | [string, string] | ({
372
372
  name: string;
373
373
  foreignRef: string;
374
374
  provider: string;
@@ -455,7 +455,7 @@ export declare const commandSchemas: {
455
455
  params: {
456
456
  name: string;
457
457
  requestId: string;
458
- device: string | ({
458
+ device: string | [string, string] | ({
459
459
  name: string;
460
460
  foreignRef: string;
461
461
  provider: string;
@@ -543,7 +543,7 @@ export declare const commandSchemas: {
543
543
  params: {
544
544
  name: string;
545
545
  requestId: string;
546
- device: string | ({
546
+ device: string | [string, string] | ({
547
547
  name: string;
548
548
  foreignRef: string;
549
549
  provider: string;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "description": "Common types between backend, agent(s) and frontend(s)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -270,7 +270,8 @@ export declare const sAgentDeviceInfo: z.ZodIntersection<z.ZodObject<{
270
270
  }, {
271
271
  type: "system";
272
272
  }>]>>;
273
- export declare const sDeviceParam: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
273
+ export declare const sForeignDeviceId: z.ZodTuple<[z.ZodString, z.ZodString], null>;
274
+ export declare const sDeviceParam: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
274
275
  name: z.ZodString;
275
276
  foreignRef: z.ZodString;
276
277
  provider: z.ZodString;
@@ -522,6 +523,7 @@ export declare const sDeviceParam: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.
522
523
  type: "system";
523
524
  }, {
524
525
  type: "system";
525
- }>]>>]>;
526
+ }>]>>]>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
527
+ export type DeviceParam = z.infer<typeof sDeviceParam>;
526
528
  export declare const sNotificationSeverity: z.ZodEnum<["info", "warning", "critical"]>;
527
529
  export type NotificationSeverity = z.infer<typeof sNotificationSeverity>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sNotificationSeverity = exports.sDeviceParam = exports.sAgentDeviceInfo = exports.sFileResponse = exports.sUrl = exports.sDuration = exports.sMacroId = exports.sZoneId = exports.sPersonId = exports.sDeviceEvent = exports.sPresetId = exports.sDeviceId = void 0;
3
+ exports.sNotificationSeverity = exports.sDeviceParam = exports.sForeignDeviceId = exports.sAgentDeviceInfo = exports.sFileResponse = exports.sUrl = exports.sDuration = exports.sMacroId = exports.sZoneId = exports.sPersonId = exports.sDeviceEvent = exports.sPresetId = exports.sDeviceId = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const device_1 = require("./device");
6
6
  exports.sDeviceId = zod_1.z.string().uuid().nonempty();
@@ -21,6 +21,10 @@ exports.sFileResponse = zod_1.z
21
21
  exports.sAgentDeviceInfo = zod_1.z.intersection(device_1.sForeignDeviceInfo, device_1.sAnyDeviceSpecs, zod_1.z.object({
22
22
  presets: zod_1.z.array(device_1.sPresetDto),
23
23
  }));
24
- // reusable device argument. This schema can be checked at runtime to see if it's a device ID or full device info and substituted accordingly.
25
- exports.sDeviceParam = exports.sDeviceId.or(exports.sAgentDeviceInfo);
24
+ exports.sForeignDeviceId = zod_1.z.tuple([
25
+ zod_1.z.string().nonempty().describe('Foreign system identifier'),
26
+ zod_1.z.string().nonempty().describe('Device identifier in foreign system'),
27
+ ]);
28
+ // a pointer to a device, can be local device id, foreign device info, or full device info for agents
29
+ exports.sDeviceParam = exports.sDeviceId.or(exports.sAgentDeviceInfo).or(exports.sForeignDeviceId);
26
30
  exports.sNotificationSeverity = zod_1.z.enum(['info', 'warning', 'critical']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "description": "Common types between backend, agent(s) and frontend(s)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",