@awarevue/api-types 2.0.24 → 2.0.26

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.
Files changed (139) hide show
  1. package/dist/_legacy/index.js +18 -2
  2. package/dist/_legacy/milestone.js +2 -1
  3. package/dist/_legacy/orchid.js +2 -1
  4. package/dist/alarm-automation.js +37 -26
  5. package/dist/api/agent-protocol/index.js +17 -1
  6. package/dist/api/agent-protocol/protocol.js +219 -212
  7. package/dist/api/commands/alarm.js +46 -43
  8. package/dist/api/commands/all.js +25 -22
  9. package/dist/api/commands/camera-lift.js +13 -10
  10. package/dist/api/commands/camera.js +65 -61
  11. package/dist/api/commands/display.js +27 -24
  12. package/dist/api/commands/door.js +21 -18
  13. package/dist/api/commands/index.js +28 -12
  14. package/dist/api/commands/intercom-terminal.js +2 -1
  15. package/dist/api/commands/io-board.js +11 -8
  16. package/dist/api/commands/nvr-exporter.js +20 -17
  17. package/dist/api/commands/pbx.js +13 -10
  18. package/dist/api/commands/presence-tracker.js +25 -22
  19. package/dist/api/commands/server.js +21 -18
  20. package/dist/api/error.js +93 -89
  21. package/dist/api/events/alarm.js +53 -50
  22. package/dist/api/events/all.js +57 -53
  23. package/dist/api/events/camera.js +68 -65
  24. package/dist/api/events/display.js +6 -3
  25. package/dist/api/events/door.js +60 -57
  26. package/dist/api/events/index.js +28 -12
  27. package/dist/api/events/intercom-terminal.js +16 -13
  28. package/dist/api/events/io-board.js +10 -7
  29. package/dist/api/events/nvr-exporter.js +14 -11
  30. package/dist/api/events/panic-button.js +8 -5
  31. package/dist/api/events/presence-tracker.js +29 -26
  32. package/dist/api/events/reader.js +11 -8
  33. package/dist/api/events/server.js +12 -9
  34. package/dist/api/index.js +25 -9
  35. package/dist/api/mqtt/index.js +17 -1
  36. package/dist/api/mqtt/payloads.js +15 -12
  37. package/dist/api/queries/all.js +23 -20
  38. package/dist/api/queries/camera.js +19 -16
  39. package/dist/api/queries/index.js +21 -5
  40. package/dist/api/queries/nvr-analytics-server.js +57 -54
  41. package/dist/api/queries/nvr-exporter.js +26 -23
  42. package/dist/api/queries/nvr-recorder.js +32 -29
  43. package/dist/api/rest/access-rule.js +14 -8
  44. package/dist/api/rest/agreement.js +6 -3
  45. package/dist/api/rest/alarm.js +2 -1
  46. package/dist/api/rest/api-keys.js +11 -8
  47. package/dist/api/rest/app.js +11 -8
  48. package/dist/api/rest/auth.js +12 -9
  49. package/dist/api/rest/automation.js +13 -10
  50. package/dist/api/rest/aware-config.js +2 -1
  51. package/dist/api/rest/bookmarks.js +17 -14
  52. package/dist/api/rest/cast.js +11 -5
  53. package/dist/api/rest/custom-field.js +6 -3
  54. package/dist/api/rest/device-event.js +2 -1
  55. package/dist/api/rest/device-group.js +19 -13
  56. package/dist/api/rest/file.js +2 -1
  57. package/dist/api/rest/index.js +50 -34
  58. package/dist/api/rest/io-device.js +21 -14
  59. package/dist/api/rest/layout.js +23 -17
  60. package/dist/api/rest/macros.js +6 -3
  61. package/dist/api/rest/media.js +55 -52
  62. package/dist/api/rest/module-config.js +2 -1
  63. package/dist/api/rest/notifications.js +11 -8
  64. package/dist/api/rest/person-agreement.js +11 -5
  65. package/dist/api/rest/person-presence.js +26 -23
  66. package/dist/api/rest/person-type.js +6 -3
  67. package/dist/api/rest/person.js +11 -5
  68. package/dist/api/rest/query.js +13 -8
  69. package/dist/api/rest/schedule.js +11 -8
  70. package/dist/api/rest/security-level.js +6 -3
  71. package/dist/api/rest/template.js +13 -10
  72. package/dist/api/rest/token-conversion.js +6 -3
  73. package/dist/api/rest/user.js +31 -28
  74. package/dist/api/rest/view.js +20 -14
  75. package/dist/api/rest/webrtc-playback.js +12 -6
  76. package/dist/api/rest/zone.js +14 -8
  77. package/dist/api/state/index.js +2 -1
  78. package/dist/api/ws/device-communication.js +46 -38
  79. package/dist/api/ws/index.js +21 -5
  80. package/dist/api/ws/notifications.js +17 -10
  81. package/dist/api/ws/progress.js +37 -30
  82. package/dist/api/ws/web-rtc-signaling.js +72 -65
  83. package/dist/api/ws/web-socket.js +5 -2
  84. package/dist/index.js +22 -6
  85. package/dist/objects/access-rule.js +32 -29
  86. package/dist/objects/agent-metadata.js +33 -30
  87. package/dist/objects/agreement.js +10 -7
  88. package/dist/objects/all.js +7 -4
  89. package/dist/objects/api-key.js +10 -7
  90. package/dist/objects/automation-rule.js +28 -25
  91. package/dist/objects/bookmark.js +14 -11
  92. package/dist/objects/credential.js +15 -9
  93. package/dist/objects/custom-field.js +11 -8
  94. package/dist/objects/device/alarm.js +6 -3
  95. package/dist/objects/device/any-device.js +206 -203
  96. package/dist/objects/device/camera-lift.js +6 -3
  97. package/dist/objects/device/camera.js +30 -27
  98. package/dist/objects/device/device-gateway.js +4 -1
  99. package/dist/objects/device/device-import.js +26 -23
  100. package/dist/objects/device/device-relation.js +16 -13
  101. package/dist/objects/device/display.js +6 -3
  102. package/dist/objects/device/door.js +10 -7
  103. package/dist/objects/device/index.js +38 -22
  104. package/dist/objects/device/intercom-operator.js +4 -1
  105. package/dist/objects/device/intercom-terminal.js +20 -17
  106. package/dist/objects/device/io-board.js +8 -5
  107. package/dist/objects/device/motion-sensor.js +6 -3
  108. package/dist/objects/device/nvr-analytics-server.js +8 -5
  109. package/dist/objects/device/nvr-exporter.js +9 -6
  110. package/dist/objects/device/nvr-recorder.js +8 -5
  111. package/dist/objects/device/panic-button.js +6 -3
  112. package/dist/objects/device/pbx.js +7 -4
  113. package/dist/objects/device/presence-tracker.js +4 -1
  114. package/dist/objects/device/reader.js +4 -1
  115. package/dist/objects/device/server.js +4 -1
  116. package/dist/objects/device/system.js +7 -4
  117. package/dist/objects/device-group.js +11 -8
  118. package/dist/objects/index.js +44 -28
  119. package/dist/objects/layout.js +23 -20
  120. package/dist/objects/macro.js +20 -17
  121. package/dist/objects/module-config.js +2 -1
  122. package/dist/objects/notification.js +15 -12
  123. package/dist/objects/person-agreement.js +10 -7
  124. package/dist/objects/person-presence.js +32 -29
  125. package/dist/objects/person-type.js +17 -11
  126. package/dist/objects/person.js +42 -39
  127. package/dist/objects/role.js +11 -8
  128. package/dist/objects/schedule.js +45 -39
  129. package/dist/objects/security-level.js +13 -10
  130. package/dist/objects/template.js +10 -7
  131. package/dist/objects/token-conversion.js +10 -7
  132. package/dist/objects/user.js +14 -11
  133. package/dist/objects/view.js +53 -50
  134. package/dist/objects/world-object.js +8 -5
  135. package/dist/objects/zone.js +16 -13
  136. package/dist/package.json +1 -1
  137. package/dist/permissions.js +149 -146
  138. package/dist/primitives.js +30 -27
  139. package/package.json +1 -1
@@ -1,2 +1,18 @@
1
- export * from './milestone';
2
- export * from './orchid';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./milestone"), exports);
18
+ __exportStar(require("./orchid"), exports);
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,49 +1,57 @@
1
- import { z } from 'zod';
2
- import { worldObjects } from './objects/world-object';
3
- export const sAlarmBehavior = z.enum([
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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
+ const zod_1 = require("zod");
5
+ const world_object_1 = require("./objects/world-object");
6
+ exports.sAlarmBehavior = zod_1.z.enum([
4
7
  'ignore',
5
8
  'trigger-always',
6
9
  'trigger-when-armed',
7
10
  ]);
8
- export const sAlarmAutomationLevel = z.enum(['by-device', 'by-type']);
9
- export const sAlarmAutomationCriteria = z.object({
10
- field: z.string().describe('The field to match'),
11
- value: z.unknown().describe('The value to match'),
11
+ exports.sAlarmAutomationLevel = zod_1.z.enum(['by-device', 'by-type']);
12
+ exports.sAlarmAutomationCriteria = zod_1.z.object({
13
+ field: zod_1.z.string().describe('The field to match'),
14
+ value: zod_1.z.unknown().describe('The value to match'),
12
15
  });
13
- export const sAlarmAutomationMetadata = z.object({
14
- behavior: sAlarmBehavior,
15
- level: sAlarmAutomationLevel,
16
- eventKind: z.string().describe('The kind of event to match'),
17
- eventVariant: z
16
+ exports.sAlarmAutomationMetadata = zod_1.z.object({
17
+ behavior: exports.sAlarmBehavior,
18
+ level: exports.sAlarmAutomationLevel,
19
+ eventKind: zod_1.z.string().describe('The kind of event to match'),
20
+ eventVariant: zod_1.z
18
21
  .string()
19
22
  .nullable()
20
23
  .describe('Optional variant for specific device events'),
21
- eventCriteria: z.array(sAlarmAutomationCriteria),
24
+ eventCriteria: zod_1.z.array(exports.sAlarmAutomationCriteria),
22
25
  });
23
- export const isAlarmAutomationMetadata = (metadata) => {
26
+ const isAlarmAutomationMetadata = (metadata) => {
24
27
  if (typeof metadata !== 'object' || metadata === null) {
25
28
  return false;
26
29
  }
27
- const parsed = sAlarmAutomationMetadata.safeParse(metadata);
30
+ const parsed = exports.sAlarmAutomationMetadata.safeParse(metadata);
28
31
  return parsed.success;
29
32
  };
33
+ exports.isAlarmAutomationMetadata = isAlarmAutomationMetadata;
30
34
  // Alarm assigns automation rules with code that is either:
31
35
  // [by-event]:[event-kind]
32
36
  // [by-device]:[device-id]
33
- export const formatByDeviceAutomationCode = (eventKind, deviceId, variant = null) => {
37
+ const formatByDeviceAutomationCode = (eventKind, deviceId, variant = null) => {
34
38
  return `by-device:${deviceId}:${eventKind}${variant ? `:${variant}` : ''}`;
35
39
  };
36
- export const formatByTypeAutomationCode = (eventKind, deviceType, variant = null) => {
40
+ exports.formatByDeviceAutomationCode = formatByDeviceAutomationCode;
41
+ const formatByTypeAutomationCode = (eventKind, deviceType, variant = null) => {
37
42
  return `by-type:${deviceType}:${eventKind}${variant ? `:${variant}` : ''}`;
38
43
  };
39
- export const isByDeviceAutomationCode = (code) => {
44
+ exports.formatByTypeAutomationCode = formatByTypeAutomationCode;
45
+ const isByDeviceAutomationCode = (code) => {
40
46
  return code.startsWith('by-device:');
41
47
  };
42
- export const isByTypeAutomationCode = (code) => {
48
+ exports.isByDeviceAutomationCode = isByDeviceAutomationCode;
49
+ const isByTypeAutomationCode = (code) => {
43
50
  return code.startsWith('by-type:');
44
51
  };
45
- export const parseAlarmAutomationCode = (code) => {
46
- if (isByDeviceAutomationCode(code)) {
52
+ exports.isByTypeAutomationCode = isByTypeAutomationCode;
53
+ const parseAlarmAutomationCode = (code) => {
54
+ if ((0, exports.isByDeviceAutomationCode)(code)) {
47
55
  const parts = code.replace('by-device:', '').split(':');
48
56
  if (parts.length < 2) {
49
57
  return null; // Invalid format
@@ -55,7 +63,7 @@ export const parseAlarmAutomationCode = (code) => {
55
63
  eventVariant: parts[2] || null, // Optional variant for specific device events
56
64
  };
57
65
  }
58
- if (isByTypeAutomationCode(code)) {
66
+ if ((0, exports.isByTypeAutomationCode)(code)) {
59
67
  const parts = code.replace('by-type:', '').split(':');
60
68
  if (parts.length < 2) {
61
69
  return null; // Invalid format
@@ -69,6 +77,7 @@ export const parseAlarmAutomationCode = (code) => {
69
77
  }
70
78
  return null;
71
79
  };
80
+ exports.parseAlarmAutomationCode = parseAlarmAutomationCode;
72
81
  const encodeValue = (value) => {
73
82
  if (typeof value === 'string') {
74
83
  return `${JSON.stringify(value)}`;
@@ -90,7 +99,7 @@ const encodeComparison = (value) => {
90
99
  }
91
100
  return `== ${encodeValue(value)}`;
92
101
  };
93
- export const createAlarmRuleBody = (eventKind, behavior, deviceType, eventCriteria, deviceId) => {
102
+ const createAlarmRuleBody = (eventKind, behavior, deviceType, eventCriteria, deviceId) => {
94
103
  let runIf = 'source.type == "' + deviceType + '"';
95
104
  if (deviceId) {
96
105
  runIf += ` and source.id == "${deviceId}"`;
@@ -115,11 +124,13 @@ export const createAlarmRuleBody = (eventKind, behavior, deviceType, eventCriter
115
124
  ],
116
125
  };
117
126
  };
118
- export const resolveAlarmExclusivityGroup = (deviceType) => `alarm-${deviceType}`;
127
+ exports.createAlarmRuleBody = createAlarmRuleBody;
128
+ const resolveAlarmExclusivityGroup = (deviceType) => `alarm-${deviceType}`;
129
+ exports.resolveAlarmExclusivityGroup = resolveAlarmExclusivityGroup;
119
130
  const sorted = (specs) => {
120
131
  return specs.sort((a, b) => a.label.localeCompare(b.label));
121
132
  };
122
- export const alarmEventVariants = {
133
+ exports.alarmEventVariants = {
123
134
  'door-access': sorted([
124
135
  {
125
136
  name: 'allowed',
@@ -134,7 +145,7 @@ export const alarmEventVariants = {
134
145
  ]),
135
146
  'object-detection-started': sorted([
136
147
  // TODO - add criteria for object detection started
137
- ...worldObjects.map((object) => ({
148
+ ...world_object_1.worldObjects.map((object) => ({
138
149
  name: object.id,
139
150
  label: `${object.label} Detected`,
140
151
  criteria: [{ field: 'objectKind', value: object.id }],
@@ -1 +1,17 @@
1
- export * from './protocol';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./protocol"), exports);