@awarevue/api-types 1.0.70 → 1.0.72
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.
|
@@ -49,17 +49,19 @@ export type AlarmBehavior = z.infer<typeof sAlarmBehavior>;
|
|
|
49
49
|
export type AlarmAutomationLevel = z.infer<typeof sAlarmAutomationLevel>;
|
|
50
50
|
export type AlarmAutomationMetadata = z.infer<typeof sAlarmAutomationMetadata>;
|
|
51
51
|
export declare const isAlarmAutomationMetadata: (metadata: unknown) => metadata is AlarmAutomationMetadata;
|
|
52
|
-
export declare const formatByDeviceAutomationCode: (deviceId: string) => string;
|
|
53
|
-
export declare const formatByTypeAutomationCode: (eventKind: DeviceEvent["kind"]) => string;
|
|
52
|
+
export declare const formatByDeviceAutomationCode: (eventKind: DeviceEvent["kind"], deviceId: string) => string;
|
|
53
|
+
export declare const formatByTypeAutomationCode: (eventKind: DeviceEvent["kind"], deviceType: DeviceType) => string;
|
|
54
54
|
export declare const isByDeviceAutomationCode: (code: string) => boolean;
|
|
55
55
|
export declare const isByTypeAutomationCode: (code: string) => boolean;
|
|
56
56
|
export type ParsedByDeviceAutomationCode = {
|
|
57
57
|
type: 'by-device';
|
|
58
58
|
value: string;
|
|
59
|
+
eventKind: DeviceEvent['kind'];
|
|
59
60
|
};
|
|
60
61
|
export type ParsedByTypeAutomationCode = {
|
|
61
62
|
type: 'by-type';
|
|
62
|
-
value:
|
|
63
|
+
value: DeviceType;
|
|
64
|
+
eventKind: DeviceEvent['kind'];
|
|
63
65
|
};
|
|
64
66
|
export type ParsedAlarmAutomationCode = ParsedByDeviceAutomationCode | ParsedByTypeAutomationCode;
|
|
65
67
|
export declare const parseAlarmAutomationCode: (code: string) => ParsedAlarmAutomationCode | null;
|
package/dist/alarm-automation.js
CHANGED
|
@@ -29,12 +29,12 @@ exports.isAlarmAutomationMetadata = isAlarmAutomationMetadata;
|
|
|
29
29
|
// Alarm assigns automation rules with code that is either:
|
|
30
30
|
// [by-event]:[event-kind]
|
|
31
31
|
// [by-device]:[device-id]
|
|
32
|
-
const formatByDeviceAutomationCode = (deviceId) => {
|
|
33
|
-
return `by-device:${deviceId}`;
|
|
32
|
+
const formatByDeviceAutomationCode = (eventKind, deviceId) => {
|
|
33
|
+
return `by-device:${deviceId}:${eventKind}`;
|
|
34
34
|
};
|
|
35
35
|
exports.formatByDeviceAutomationCode = formatByDeviceAutomationCode;
|
|
36
|
-
const formatByTypeAutomationCode = (eventKind) => {
|
|
37
|
-
return `by-
|
|
36
|
+
const formatByTypeAutomationCode = (eventKind, deviceType) => {
|
|
37
|
+
return `by-type:${deviceType}:${eventKind}`;
|
|
38
38
|
};
|
|
39
39
|
exports.formatByTypeAutomationCode = formatByTypeAutomationCode;
|
|
40
40
|
const isByDeviceAutomationCode = (code) => {
|
|
@@ -47,15 +47,25 @@ const isByTypeAutomationCode = (code) => {
|
|
|
47
47
|
exports.isByTypeAutomationCode = isByTypeAutomationCode;
|
|
48
48
|
const parseAlarmAutomationCode = (code) => {
|
|
49
49
|
if ((0, exports.isByDeviceAutomationCode)(code)) {
|
|
50
|
+
const parts = code.replace('by-device:', '').split(':');
|
|
51
|
+
if (parts.length !== 2) {
|
|
52
|
+
return null; // Invalid format
|
|
53
|
+
}
|
|
50
54
|
return {
|
|
51
55
|
type: 'by-device',
|
|
52
|
-
value:
|
|
56
|
+
value: parts[0], // deviceId
|
|
57
|
+
eventKind: parts[1], // eventKind
|
|
53
58
|
};
|
|
54
59
|
}
|
|
55
60
|
if ((0, exports.isByTypeAutomationCode)(code)) {
|
|
61
|
+
const parts = code.replace('by-type:', '').split(':');
|
|
62
|
+
if (parts.length !== 2) {
|
|
63
|
+
return null; // Invalid format
|
|
64
|
+
}
|
|
56
65
|
return {
|
|
57
66
|
type: 'by-type',
|
|
58
|
-
value:
|
|
67
|
+
value: parts[0], // deviceType
|
|
68
|
+
eventKind: parts[1], // eventKind
|
|
59
69
|
};
|
|
60
70
|
}
|
|
61
71
|
return null;
|
package/dist/device/server.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ import { LayoutDto } from '../layout';
|
|
|
8
8
|
import { ViewDto } from '../view';
|
|
9
9
|
import { RoleDto, UserDto } from '../user';
|
|
10
10
|
import { ModuleConfig, ModuleConfigMetadata } from '../module-config';
|
|
11
|
-
import { AccessControlCapabilityReport } from '
|
|
12
|
-
import { SecurityLevelDto } from '
|
|
11
|
+
import { AccessControlCapabilityReport } from '../agent-communication';
|
|
12
|
+
import { SecurityLevelDto } from '../security-level';
|
|
13
13
|
export declare const SERVER = "server";
|
|
14
14
|
export interface RunMacro {
|
|
15
15
|
command: 'server.run-macro';
|
package/dist/package.json
CHANGED