@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.
- package/dist/_legacy/index.js +18 -2
- package/dist/_legacy/milestone.js +2 -1
- package/dist/_legacy/orchid.js +2 -1
- package/dist/alarm-automation.js +37 -26
- package/dist/api/agent-protocol/index.js +17 -1
- package/dist/api/agent-protocol/protocol.js +219 -212
- package/dist/api/commands/alarm.js +46 -43
- package/dist/api/commands/all.js +25 -22
- package/dist/api/commands/camera-lift.js +13 -10
- package/dist/api/commands/camera.js +65 -61
- package/dist/api/commands/display.js +27 -24
- package/dist/api/commands/door.js +21 -18
- package/dist/api/commands/index.js +28 -12
- package/dist/api/commands/intercom-terminal.js +2 -1
- package/dist/api/commands/io-board.js +11 -8
- package/dist/api/commands/nvr-exporter.js +20 -17
- package/dist/api/commands/pbx.js +13 -10
- package/dist/api/commands/presence-tracker.js +25 -22
- package/dist/api/commands/server.js +21 -18
- package/dist/api/error.js +93 -89
- package/dist/api/events/alarm.js +53 -50
- package/dist/api/events/all.js +57 -53
- package/dist/api/events/camera.js +68 -65
- package/dist/api/events/display.js +6 -3
- package/dist/api/events/door.js +60 -57
- package/dist/api/events/index.js +28 -12
- package/dist/api/events/intercom-terminal.js +16 -13
- package/dist/api/events/io-board.js +10 -7
- package/dist/api/events/nvr-exporter.js +14 -11
- package/dist/api/events/panic-button.js +8 -5
- package/dist/api/events/presence-tracker.js +29 -26
- package/dist/api/events/reader.js +11 -8
- package/dist/api/events/server.js +12 -9
- package/dist/api/index.js +25 -9
- package/dist/api/mqtt/index.js +17 -1
- package/dist/api/mqtt/payloads.js +15 -12
- package/dist/api/queries/all.js +23 -20
- package/dist/api/queries/camera.js +19 -16
- package/dist/api/queries/index.js +21 -5
- package/dist/api/queries/nvr-analytics-server.js +57 -54
- package/dist/api/queries/nvr-exporter.js +26 -23
- package/dist/api/queries/nvr-recorder.js +32 -29
- package/dist/api/rest/access-rule.js +14 -8
- package/dist/api/rest/agreement.js +6 -3
- package/dist/api/rest/alarm.js +2 -1
- package/dist/api/rest/api-keys.js +11 -8
- package/dist/api/rest/app.js +11 -8
- package/dist/api/rest/auth.js +12 -9
- package/dist/api/rest/automation.js +13 -10
- package/dist/api/rest/aware-config.js +2 -1
- package/dist/api/rest/bookmarks.js +17 -14
- package/dist/api/rest/cast.js +11 -5
- package/dist/api/rest/custom-field.js +6 -3
- package/dist/api/rest/device-event.js +2 -1
- package/dist/api/rest/device-group.js +19 -13
- package/dist/api/rest/file.js +2 -1
- package/dist/api/rest/index.js +50 -34
- package/dist/api/rest/io-device.js +21 -14
- package/dist/api/rest/layout.js +23 -17
- package/dist/api/rest/macros.js +6 -3
- package/dist/api/rest/media.js +55 -52
- package/dist/api/rest/module-config.js +2 -1
- package/dist/api/rest/notifications.js +11 -8
- package/dist/api/rest/person-agreement.js +11 -5
- package/dist/api/rest/person-presence.js +26 -23
- package/dist/api/rest/person-type.js +6 -3
- package/dist/api/rest/person.js +11 -5
- package/dist/api/rest/query.js +13 -8
- package/dist/api/rest/schedule.js +11 -8
- package/dist/api/rest/security-level.js +6 -3
- package/dist/api/rest/template.js +13 -10
- package/dist/api/rest/token-conversion.js +6 -3
- package/dist/api/rest/user.js +31 -28
- package/dist/api/rest/view.js +20 -14
- package/dist/api/rest/webrtc-playback.js +12 -6
- package/dist/api/rest/zone.js +14 -8
- package/dist/api/state/index.js +2 -1
- package/dist/api/ws/device-communication.js +46 -38
- package/dist/api/ws/index.js +21 -5
- package/dist/api/ws/notifications.js +17 -10
- package/dist/api/ws/progress.js +37 -30
- package/dist/api/ws/web-rtc-signaling.js +72 -65
- package/dist/api/ws/web-socket.js +5 -2
- package/dist/index.js +22 -6
- package/dist/objects/access-rule.js +32 -29
- package/dist/objects/agent-metadata.js +33 -30
- package/dist/objects/agreement.js +10 -7
- package/dist/objects/all.js +7 -4
- package/dist/objects/api-key.js +10 -7
- package/dist/objects/automation-rule.js +28 -25
- package/dist/objects/bookmark.js +14 -11
- package/dist/objects/credential.js +15 -9
- package/dist/objects/custom-field.js +11 -8
- package/dist/objects/device/alarm.js +6 -3
- package/dist/objects/device/any-device.js +206 -203
- package/dist/objects/device/camera-lift.js +6 -3
- package/dist/objects/device/camera.js +30 -27
- package/dist/objects/device/device-gateway.js +4 -1
- package/dist/objects/device/device-import.js +26 -23
- package/dist/objects/device/device-relation.js +16 -13
- package/dist/objects/device/display.js +6 -3
- package/dist/objects/device/door.js +10 -7
- package/dist/objects/device/index.js +38 -22
- package/dist/objects/device/intercom-operator.js +4 -1
- package/dist/objects/device/intercom-terminal.js +20 -17
- package/dist/objects/device/io-board.js +8 -5
- package/dist/objects/device/motion-sensor.js +6 -3
- package/dist/objects/device/nvr-analytics-server.js +8 -5
- package/dist/objects/device/nvr-exporter.js +9 -6
- package/dist/objects/device/nvr-recorder.js +8 -5
- package/dist/objects/device/panic-button.js +6 -3
- package/dist/objects/device/pbx.js +7 -4
- package/dist/objects/device/presence-tracker.js +4 -1
- package/dist/objects/device/reader.js +4 -1
- package/dist/objects/device/server.js +4 -1
- package/dist/objects/device/system.js +7 -4
- package/dist/objects/device-group.js +11 -8
- package/dist/objects/index.js +44 -28
- package/dist/objects/layout.js +23 -20
- package/dist/objects/macro.js +20 -17
- package/dist/objects/module-config.js +2 -1
- package/dist/objects/notification.js +15 -12
- package/dist/objects/person-agreement.js +10 -7
- package/dist/objects/person-presence.js +32 -29
- package/dist/objects/person-type.js +17 -11
- package/dist/objects/person.js +42 -39
- package/dist/objects/role.js +11 -8
- package/dist/objects/schedule.js +45 -39
- package/dist/objects/security-level.js +13 -10
- package/dist/objects/template.js +10 -7
- package/dist/objects/token-conversion.js +10 -7
- package/dist/objects/user.js +14 -11
- package/dist/objects/view.js +53 -50
- package/dist/objects/world-object.js +8 -5
- package/dist/objects/zone.js +16 -13
- package/dist/package.json +1 -1
- package/dist/permissions.js +149 -146
- package/dist/primitives.js +30 -27
- package/package.json +1 -1
package/dist/_legacy/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/_legacy/orchid.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/alarm-automation.js
CHANGED
|
@@ -1,49 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
37
|
+
const formatByDeviceAutomationCode = (eventKind, deviceId, variant = null) => {
|
|
34
38
|
return `by-device:${deviceId}:${eventKind}${variant ? `:${variant}` : ''}`;
|
|
35
39
|
};
|
|
36
|
-
|
|
40
|
+
exports.formatByDeviceAutomationCode = formatByDeviceAutomationCode;
|
|
41
|
+
const formatByTypeAutomationCode = (eventKind, deviceType, variant = null) => {
|
|
37
42
|
return `by-type:${deviceType}:${eventKind}${variant ? `:${variant}` : ''}`;
|
|
38
43
|
};
|
|
39
|
-
|
|
44
|
+
exports.formatByTypeAutomationCode = formatByTypeAutomationCode;
|
|
45
|
+
const isByDeviceAutomationCode = (code) => {
|
|
40
46
|
return code.startsWith('by-device:');
|
|
41
47
|
};
|
|
42
|
-
|
|
48
|
+
exports.isByDeviceAutomationCode = isByDeviceAutomationCode;
|
|
49
|
+
const isByTypeAutomationCode = (code) => {
|
|
43
50
|
return code.startsWith('by-type:');
|
|
44
51
|
};
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);
|