@awarevue/api-types 2.0.15 → 2.0.16
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/events/all.d.ts +87 -12
- package/dist/events/all.js +20 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/events/all.d.ts
CHANGED
|
@@ -10,12 +10,24 @@ import { ReaderEvent } from './reader';
|
|
|
10
10
|
import { ServerEvent } from './server';
|
|
11
11
|
import { NvrExporterEvent } from './nvr-exporter';
|
|
12
12
|
import { DeviceType } from '../device';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import { NotificationSeverity } from 'src/primitives';
|
|
14
|
+
export declare const sDeviceCommandTriggered: z.ZodObject<{
|
|
15
|
+
kind: z.ZodLiteral<"device-command">;
|
|
16
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
command: z.ZodString;
|
|
18
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
args: Record<string, unknown>;
|
|
21
|
+
kind: "device-command";
|
|
16
22
|
command: string;
|
|
17
|
-
|
|
18
|
-
}
|
|
23
|
+
userId?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
args: Record<string, unknown>;
|
|
26
|
+
kind: "device-command";
|
|
27
|
+
command: string;
|
|
28
|
+
userId?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export type DeviceCommandTriggered = z.infer<typeof sDeviceCommandTriggered>;
|
|
19
31
|
export declare const sMotionDetected: z.ZodObject<{
|
|
20
32
|
kind: z.ZodLiteral<"motion-detected">;
|
|
21
33
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -24,15 +36,42 @@ export declare const sMotionDetected: z.ZodObject<{
|
|
|
24
36
|
kind: "motion-detected";
|
|
25
37
|
}>;
|
|
26
38
|
export type MotionDetectedEvent = z.infer<typeof sMotionDetected>;
|
|
27
|
-
export
|
|
28
|
-
kind:
|
|
29
|
-
clientId
|
|
39
|
+
export declare const sDeviceConnectedEvent: z.ZodObject<{
|
|
40
|
+
kind: z.ZodLiteral<"device-connected">;
|
|
41
|
+
clientId: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
kind: "device-connected";
|
|
44
|
+
clientId?: number | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
kind: "device-connected";
|
|
47
|
+
clientId?: number | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
export type DeviceConnectedEvent = z.infer<typeof sDeviceConnectedEvent>;
|
|
50
|
+
export declare const sDeviceDisconnectedEvent: z.ZodObject<{
|
|
51
|
+
kind: z.ZodLiteral<"device-disconnected">;
|
|
52
|
+
clientId: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
kind: "device-disconnected";
|
|
55
|
+
clientId?: number | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
kind: "device-disconnected";
|
|
58
|
+
clientId?: number | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
export type DeviceDisconnectedEvent = z.infer<typeof sDeviceDisconnectedEvent>;
|
|
61
|
+
export interface NotificationCreatedEvent {
|
|
62
|
+
kind: 'notification-created';
|
|
63
|
+
notificationId: string;
|
|
64
|
+
message: string;
|
|
65
|
+
severity: NotificationSeverity;
|
|
66
|
+
metadata: Record<string, unknown>;
|
|
67
|
+
notificationRef: string | null;
|
|
68
|
+
recipientId: string | null;
|
|
30
69
|
}
|
|
31
|
-
export interface
|
|
32
|
-
kind: '
|
|
33
|
-
|
|
70
|
+
export interface NotificationAcknowledgedEvent {
|
|
71
|
+
kind: 'notification-acknowledged';
|
|
72
|
+
notificationId: string;
|
|
34
73
|
}
|
|
35
|
-
export type AnyDeviceEvent = DeviceCommandTriggered | CameraEvent | DoorEvent | AlarmEvent | MotionDetectedEvent | ReaderEvent | PanicButtonEvent | DeviceConnectedEvent | DeviceDisconnectedEvent | IntercomTerminalEvent | ServerEvent | PresenceTrackerEvent | IoBoardEvent | NvrExporterEvent;
|
|
74
|
+
export type AnyDeviceEvent = DeviceCommandTriggered | CameraEvent | DoorEvent | AlarmEvent | MotionDetectedEvent | ReaderEvent | PanicButtonEvent | DeviceConnectedEvent | DeviceDisconnectedEvent | NotificationCreatedEvent | NotificationAcknowledgedEvent | IntercomTerminalEvent | ServerEvent | PresenceTrackerEvent | IoBoardEvent | NvrExporterEvent;
|
|
36
75
|
export declare const sEventHeader: z.ZodObject<{
|
|
37
76
|
id: z.ZodString;
|
|
38
77
|
timestamp: z.ZodNumber;
|
|
@@ -60,6 +99,42 @@ export declare const eventSchemaByKind: {
|
|
|
60
99
|
}, {
|
|
61
100
|
kind: "motion-detected";
|
|
62
101
|
}>;
|
|
102
|
+
'device-command': z.ZodObject<{
|
|
103
|
+
kind: z.ZodLiteral<"device-command">;
|
|
104
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
105
|
+
command: z.ZodString;
|
|
106
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
args: Record<string, unknown>;
|
|
109
|
+
kind: "device-command";
|
|
110
|
+
command: string;
|
|
111
|
+
userId?: string | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
args: Record<string, unknown>;
|
|
114
|
+
kind: "device-command";
|
|
115
|
+
command: string;
|
|
116
|
+
userId?: string | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
'device-connected': z.ZodObject<{
|
|
119
|
+
kind: z.ZodLiteral<"device-connected">;
|
|
120
|
+
clientId: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
kind: "device-connected";
|
|
123
|
+
clientId?: number | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
kind: "device-connected";
|
|
126
|
+
clientId?: number | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
'device-disconnected': z.ZodObject<{
|
|
129
|
+
kind: z.ZodLiteral<"device-disconnected">;
|
|
130
|
+
clientId: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
}, "strip", z.ZodTypeAny, {
|
|
132
|
+
kind: "device-disconnected";
|
|
133
|
+
clientId?: number | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
kind: "device-disconnected";
|
|
136
|
+
clientId?: number | undefined;
|
|
137
|
+
}>;
|
|
63
138
|
'nvr-export-started': z.ZodObject<{
|
|
64
139
|
kind: z.ZodLiteral<"nvr-export-started">;
|
|
65
140
|
exportId: z.ZodString;
|
package/dist/events/all.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDeviceEvent = exports.eventsByDeviceType = exports.eventSchemaByKind = exports.eventKindLabels = exports.sEventHeader = exports.sMotionDetected = void 0;
|
|
3
|
+
exports.isDeviceEvent = exports.eventsByDeviceType = exports.eventSchemaByKind = exports.eventKindLabels = exports.sEventHeader = exports.sDeviceDisconnectedEvent = exports.sDeviceConnectedEvent = exports.sMotionDetected = exports.sDeviceCommandTriggered = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const alarm_1 = require("./alarm");
|
|
6
6
|
const camera_1 = require("./camera");
|
|
@@ -11,9 +11,23 @@ const panic_button_1 = require("./panic-button");
|
|
|
11
11
|
const presence_tracker_1 = require("./presence-tracker");
|
|
12
12
|
const reader_1 = require("./reader");
|
|
13
13
|
const nvr_exporter_1 = require("./nvr-exporter");
|
|
14
|
+
exports.sDeviceCommandTriggered = zod_1.z.object({
|
|
15
|
+
kind: zod_1.z.literal('device-command'),
|
|
16
|
+
userId: zod_1.z.string().nonempty().optional(),
|
|
17
|
+
command: zod_1.z.string().nonempty(),
|
|
18
|
+
args: zod_1.z.record(zod_1.z.unknown()),
|
|
19
|
+
});
|
|
14
20
|
exports.sMotionDetected = zod_1.z.object({
|
|
15
21
|
kind: zod_1.z.literal('motion-detected'),
|
|
16
22
|
});
|
|
23
|
+
exports.sDeviceConnectedEvent = zod_1.z.object({
|
|
24
|
+
kind: zod_1.z.literal('device-connected'),
|
|
25
|
+
clientId: zod_1.z.number().int().positive().optional(),
|
|
26
|
+
});
|
|
27
|
+
exports.sDeviceDisconnectedEvent = zod_1.z.object({
|
|
28
|
+
kind: zod_1.z.literal('device-disconnected'),
|
|
29
|
+
clientId: zod_1.z.number().int().positive().optional(),
|
|
30
|
+
});
|
|
17
31
|
exports.sEventHeader = zod_1.z.object({
|
|
18
32
|
id: zod_1.z.string().nonempty(),
|
|
19
33
|
timestamp: zod_1.z.number().int().positive(),
|
|
@@ -65,6 +79,8 @@ exports.eventKindLabels = {
|
|
|
65
79
|
'door-closed': 'Door Closed',
|
|
66
80
|
'nvr-export-started': 'NVR Export Started',
|
|
67
81
|
'nvr-export-deleted': 'NVR Export Deleted',
|
|
82
|
+
'notification-created': 'Notification Created',
|
|
83
|
+
'notification-acknowledged': 'Notification Acknowledged',
|
|
68
84
|
};
|
|
69
85
|
exports.eventSchemaByKind = {
|
|
70
86
|
...alarm_1.alarmEventSchemasByKind,
|
|
@@ -77,6 +93,9 @@ exports.eventSchemaByKind = {
|
|
|
77
93
|
...reader_1.readerEventSchemaByKind,
|
|
78
94
|
...nvr_exporter_1.nvrExporterEventSchemasByKind,
|
|
79
95
|
'motion-detected': exports.sMotionDetected,
|
|
96
|
+
'device-command': exports.sDeviceCommandTriggered,
|
|
97
|
+
'device-connected': exports.sDeviceConnectedEvent,
|
|
98
|
+
'device-disconnected': exports.sDeviceDisconnectedEvent,
|
|
80
99
|
};
|
|
81
100
|
exports.eventsByDeviceType = {
|
|
82
101
|
camera: [
|
package/dist/package.json
CHANGED