@awarevue/api-types 2.0.121 → 2.0.123

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.
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.alarmEventVariants = exports.resolveAlarmExclusivityGroup = exports.createAlarmRuleBody = exports.parseAlarmAutomationCode = exports.isByTypeAutomationCode = exports.isByDeviceAutomationCode = exports.formatByTypeAutomationCode = exports.formatByDeviceAutomationCode = exports.isAlarmAutomationMetadata = exports.sAlarmAutomationMetadata = exports.sAlarmAutomationCriteria = exports.sAlarmAutomationLevel = exports.sAlarmBehavior = void 0;
4
4
  const zod_1 = require("zod");
5
- const world_object_1 = require("./objects/world-object");
6
5
  exports.sAlarmBehavior = zod_1.z.enum([
7
6
  'ignore',
8
7
  'trigger-always',
@@ -130,6 +129,36 @@ exports.resolveAlarmExclusivityGroup = resolveAlarmExclusivityGroup;
130
129
  const sorted = (specs) => {
131
130
  return specs.sort((a, b) => a.label.localeCompare(b.label));
132
131
  };
132
+ const worldObjects = [
133
+ {
134
+ id: 'person',
135
+ label: 'Person',
136
+ },
137
+ {
138
+ id: 'backpack',
139
+ label: 'Backpack',
140
+ },
141
+ {
142
+ id: 'cell-phone',
143
+ label: 'Cell Phone',
144
+ },
145
+ {
146
+ id: 'handbag',
147
+ label: 'Handbag',
148
+ },
149
+ {
150
+ id: 'laptop',
151
+ label: 'Laptop',
152
+ },
153
+ {
154
+ id: 'bicycle',
155
+ label: 'Bicycle',
156
+ },
157
+ {
158
+ id: 'car',
159
+ label: 'Car',
160
+ },
161
+ ];
133
162
  exports.alarmEventVariants = {
134
163
  'door-access': sorted([
135
164
  {
@@ -145,7 +174,7 @@ exports.alarmEventVariants = {
145
174
  ]),
146
175
  'object-detection-started': sorted([
147
176
  // TODO - add criteria for object detection started
148
- ...world_object_1.worldObjects.map((object) => ({
177
+ ...worldObjects.map((object) => ({
149
178
  name: object.id,
150
179
  label: `${object.label} Detected`,
151
180
  criteria: [{ field: 'objectKind', value: object.id }],
@@ -44,7 +44,13 @@ export declare const sTrackableUpdatePayload: z.ZodObject<{
44
44
  }, z.core.$strip>>;
45
45
  }, z.core.$strip>;
46
46
  export type TrackableUpdatePayload = z.infer<typeof sTrackableUpdatePayload>;
47
+ export declare const sSubscribeTrackablePayload: z.ZodObject<{}, z.core.$strip>;
48
+ export type SubscribeTrackablePayload = z.infer<typeof sSubscribeTrackablePayload>;
49
+ export declare const sUnsubscribeTrackablePayload: z.ZodObject<{}, z.core.$strip>;
50
+ export type UnsubscribeTrackablePayload = z.infer<typeof sUnsubscribeTrackablePayload>;
47
51
  interface TrackableMessageMap {
52
+ subscribe: SubscribeTrackablePayload;
53
+ unsubscribe: UnsubscribeTrackablePayload;
48
54
  update: TrackableUpdatePayload;
49
55
  }
50
56
  export type TrackableWsMessage = {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTrackableMessage = exports.sTrackableUpdatePayload = exports.sTrackableUpdate = void 0;
3
+ exports.isTrackableMessage = exports.sUnsubscribeTrackablePayload = exports.sSubscribeTrackablePayload = exports.sTrackableUpdatePayload = exports.sTrackableUpdate = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const primitives_1 = require("../../primitives");
6
6
  exports.sTrackableUpdate = zod_1.z.object({
@@ -18,7 +18,11 @@ exports.sTrackableUpdate = zod_1.z.object({
18
18
  exports.sTrackableUpdatePayload = zod_1.z.object({
19
19
  updates: zod_1.z.record(zod_1.z.string(), exports.sTrackableUpdate),
20
20
  });
21
+ exports.sSubscribeTrackablePayload = zod_1.z.object({});
22
+ exports.sUnsubscribeTrackablePayload = zod_1.z.object({});
21
23
  const validators = {
24
+ subscribe: exports.sSubscribeTrackablePayload,
25
+ unsubscribe: exports.sUnsubscribeTrackablePayload,
22
26
  update: exports.sTrackableUpdatePayload,
23
27
  };
24
28
  const isTrackableMessage = (message) => {
@@ -4,4 +4,10 @@ export declare const sWorldObject: z.ZodObject<{
4
4
  label: z.ZodString;
5
5
  }, z.core.$strip>;
6
6
  export type WorldObject = z.infer<typeof sWorldObject>;
7
- export declare const worldObjects: WorldObject[];
7
+ export declare const sWorldObjectDto: z.ZodObject<{
8
+ id: z.ZodString;
9
+ label: z.ZodString;
10
+ createdOn: z.ZodString;
11
+ lastModifiedOn: z.ZodString;
12
+ }, z.core.$strip>;
13
+ export type WorldObjectDto = z.infer<typeof sWorldObjectDto>;
@@ -1,38 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.worldObjects = exports.sWorldObject = void 0;
3
+ exports.sWorldObjectDto = exports.sWorldObject = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.sWorldObject = zod_1.z.object({
6
6
  id: zod_1.z.string().describe('The unique identifier of the world object'),
7
7
  label: zod_1.z.string().describe('The label of the world object'),
8
8
  });
9
- exports.worldObjects = [
10
- {
11
- id: 'person',
12
- label: 'Person',
13
- },
14
- {
15
- id: 'backpack',
16
- label: 'Backpack',
17
- },
18
- {
19
- id: 'cell-phone',
20
- label: 'Cell Phone',
21
- },
22
- {
23
- id: 'handbag',
24
- label: 'Handbag',
25
- },
26
- {
27
- id: 'laptop',
28
- label: 'Laptop',
29
- },
30
- {
31
- id: 'bicycle',
32
- label: 'Bicycle',
33
- },
34
- {
35
- id: 'car',
36
- label: 'Car',
37
- },
38
- ];
9
+ exports.sWorldObjectDto = exports.sWorldObject.extend({
10
+ createdOn: zod_1.z
11
+ .string()
12
+ .describe('The date and time when the world object was created'),
13
+ lastModifiedOn: zod_1.z
14
+ .string()
15
+ .describe('The date and time when the world object was last modified'),
16
+ });
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.121",
7
+ "version": "2.0.123",
8
8
  "description": "Common types between backend, agent(s) and frontend(s)",
9
9
  "main": "dist/index.js",
10
10
  "types": "dist/index.d.ts",
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.121",
7
+ "version": "2.0.123",
8
8
  "description": "Common types between backend, agent(s) and frontend(s)",
9
9
  "main": "dist/index.js",
10
10
  "types": "dist/index.d.ts",