@owine/unifi-protect-mcp 2.6.0 → 2.7.1
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/README.md +1 -1
- package/dist/schemas/cameras.d.ts +137 -0
- package/dist/schemas/cameras.js +69 -0
- package/dist/schemas/common.d.ts +38 -0
- package/dist/schemas/common.js +55 -0
- package/dist/schemas/devices.d.ts +172 -0
- package/dist/schemas/devices.js +60 -0
- package/dist/schemas/misc.d.ts +184 -0
- package/dist/schemas/misc.js +108 -0
- package/dist/tools/arm-profiles.js +5 -1
- package/dist/tools/cameras.js +11 -4
- package/dist/tools/devices.d.ts +1 -0
- package/dist/tools/devices.js +18 -2
- package/dist/tools/files.js +3 -1
- package/dist/tools/liveviews.js +7 -2
- package/dist/tools/subscriptions.js +5 -2
- package/dist/tools/system.js +5 -2
- package/dist/tools/users.js +9 -4
- package/dist/utils/responses.d.ts +1 -0
- package/dist/utils/responses.js +7 -0
- package/dist/utils/safety.d.ts +1 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# UniFi Protect MCP Server
|
|
2
2
|
|
|
3
|
-
An MCP (Model Context Protocol) server that exposes UniFi Protect's Integration REST API as tools for Claude Code and other MCP clients. Aligned with UniFi Protect API **7.1.
|
|
3
|
+
An MCP (Model Context Protocol) server that exposes UniFi Protect's Integration REST API as tools for Claude Code and other MCP clients. Aligned with UniFi Protect API **7.1.60** — 73 tools covering cameras, lights, sensors, chimes, viewers, sirens, fobs, relays, speakers, bridges, link stations, alarm hubs, arm profiles, live views, files, users, NVR status, and WebSocket subscriptions.
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export declare const cameraSchema: import("zod").ZodObject<{
|
|
2
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
4
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
5
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
6
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
7
|
+
activePatrolSlot: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
8
|
+
hasPackageCamera: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
9
|
+
hdrType: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
10
|
+
isMicEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
11
|
+
micVolume: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
12
|
+
videoMode: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
13
|
+
featureFlags: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
14
|
+
hasHdr: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
15
|
+
hasLedStatus: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
16
|
+
hasMic: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
17
|
+
hasSpeaker: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
18
|
+
smartDetectAudioTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
19
|
+
smartDetectTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
20
|
+
supportFullHdSnapshot: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
21
|
+
videoModes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
22
|
+
}, import("zod/v4/core").$loose>>;
|
|
23
|
+
lcdMessage: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
24
|
+
ledSettings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
25
|
+
isEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
26
|
+
floodLed: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
27
|
+
welcomeLed: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
28
|
+
}, import("zod/v4/core").$loose>>;
|
|
29
|
+
osdSettings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
30
|
+
isNameEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
31
|
+
isDateEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
32
|
+
isLogoEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
33
|
+
isDebugEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
34
|
+
overlayLocation: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
35
|
+
}, import("zod/v4/core").$loose>>;
|
|
36
|
+
smartDetectSettings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
37
|
+
objectTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
38
|
+
audioTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
39
|
+
}, import("zod/v4/core").$loose>>;
|
|
40
|
+
}, import("zod/v4/core").$loose>;
|
|
41
|
+
export declare const cameraOutputSchema: {
|
|
42
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
43
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
44
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
45
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
46
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
47
|
+
activePatrolSlot: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
48
|
+
hasPackageCamera: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
49
|
+
hdrType: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
50
|
+
isMicEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
51
|
+
micVolume: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
52
|
+
videoMode: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
53
|
+
featureFlags: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
54
|
+
hasHdr: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
55
|
+
hasLedStatus: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
56
|
+
hasMic: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
57
|
+
hasSpeaker: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
58
|
+
smartDetectAudioTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
59
|
+
smartDetectTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
60
|
+
supportFullHdSnapshot: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
61
|
+
videoModes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
62
|
+
}, import("zod/v4/core").$loose>>;
|
|
63
|
+
lcdMessage: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
64
|
+
ledSettings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
65
|
+
isEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
66
|
+
floodLed: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
67
|
+
welcomeLed: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
68
|
+
}, import("zod/v4/core").$loose>>;
|
|
69
|
+
osdSettings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
70
|
+
isNameEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
71
|
+
isDateEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
72
|
+
isLogoEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
73
|
+
isDebugEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
74
|
+
overlayLocation: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
75
|
+
}, import("zod/v4/core").$loose>>;
|
|
76
|
+
smartDetectSettings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
77
|
+
objectTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
78
|
+
audioTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
79
|
+
}, import("zod/v4/core").$loose>>;
|
|
80
|
+
};
|
|
81
|
+
export declare const cameraListOutputSchema: {
|
|
82
|
+
result: import("zod").ZodArray<import("zod").ZodObject<{
|
|
83
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
84
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
85
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
86
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
87
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
88
|
+
activePatrolSlot: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
89
|
+
hasPackageCamera: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
90
|
+
hdrType: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
91
|
+
isMicEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
92
|
+
micVolume: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
93
|
+
videoMode: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
94
|
+
featureFlags: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
95
|
+
hasHdr: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
96
|
+
hasLedStatus: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
97
|
+
hasMic: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
98
|
+
hasSpeaker: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
99
|
+
smartDetectAudioTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
100
|
+
smartDetectTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
101
|
+
supportFullHdSnapshot: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
102
|
+
videoModes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
103
|
+
}, import("zod/v4/core").$loose>>;
|
|
104
|
+
lcdMessage: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
105
|
+
ledSettings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
106
|
+
isEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
107
|
+
floodLed: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
108
|
+
welcomeLed: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
109
|
+
}, import("zod/v4/core").$loose>>;
|
|
110
|
+
osdSettings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
111
|
+
isNameEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
112
|
+
isDateEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
113
|
+
isLogoEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
114
|
+
isDebugEnabled: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
115
|
+
overlayLocation: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
116
|
+
}, import("zod/v4/core").$loose>>;
|
|
117
|
+
smartDetectSettings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
118
|
+
objectTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
119
|
+
audioTypes: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
120
|
+
}, import("zod/v4/core").$loose>>;
|
|
121
|
+
}, import("zod/v4/core").$loose>>;
|
|
122
|
+
};
|
|
123
|
+
export declare const rtspStreamSchema: import("zod").ZodObject<{
|
|
124
|
+
high: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
125
|
+
medium: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
126
|
+
low: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
127
|
+
package: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
128
|
+
}, import("zod/v4/core").$loose>;
|
|
129
|
+
export declare const rtspStreamOutputSchema: {
|
|
130
|
+
high: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
131
|
+
medium: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
132
|
+
low: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
133
|
+
package: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
134
|
+
};
|
|
135
|
+
export declare const talkbackSessionOutputSchema: {
|
|
136
|
+
url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
137
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.talkbackSessionOutputSchema = exports.rtspStreamOutputSchema = exports.rtspStreamSchema = exports.cameraListOutputSchema = exports.cameraOutputSchema = exports.cameraSchema = void 0;
|
|
4
|
+
const common_js_1 = require("./common.js");
|
|
5
|
+
/**
|
|
6
|
+
* Verified against live UniFi Protect Integration API 7.1.60 (2026-05-15).
|
|
7
|
+
* The Integration API camera object is far smaller than the internal Protect
|
|
8
|
+
* app's camera model — no isRecording/lastMotion/channels/firmwareVersion/etc.
|
|
9
|
+
* `list` and `get-by-id` return the same field set.
|
|
10
|
+
*/
|
|
11
|
+
const featureFlagsSchema = (0, common_js_1.passthroughObject)({
|
|
12
|
+
hasHdr: (0, common_js_1.unknownField)("Supports HDR (boolean)"),
|
|
13
|
+
hasLedStatus: (0, common_js_1.unknownField)("Has a status LED (boolean)"),
|
|
14
|
+
hasMic: (0, common_js_1.unknownField)("Has a microphone (boolean)"),
|
|
15
|
+
hasSpeaker: (0, common_js_1.unknownField)("Has a speaker (boolean)"),
|
|
16
|
+
smartDetectAudioTypes: (0, common_js_1.unknownField)("Supported smart audio-detect types (array of strings)"),
|
|
17
|
+
smartDetectTypes: (0, common_js_1.unknownField)("Supported smart object-detect types (array of strings)"),
|
|
18
|
+
supportFullHdSnapshot: (0, common_js_1.unknownField)("Supports full-HD snapshot (boolean)"),
|
|
19
|
+
videoModes: (0, common_js_1.unknownField)("Supported video modes (array of strings)"),
|
|
20
|
+
});
|
|
21
|
+
const ledSettingsSchema = (0, common_js_1.passthroughObject)({
|
|
22
|
+
isEnabled: (0, common_js_1.unknownField)("Status LED enabled (boolean)"),
|
|
23
|
+
floodLed: (0, common_js_1.unknownField)("Flood LED enabled (boolean)"),
|
|
24
|
+
welcomeLed: (0, common_js_1.unknownField)("Welcome LED enabled (boolean)"),
|
|
25
|
+
});
|
|
26
|
+
const osdSettingsSchema = (0, common_js_1.passthroughObject)({
|
|
27
|
+
isNameEnabled: (0, common_js_1.unknownField)("Overlay camera name (boolean)"),
|
|
28
|
+
isDateEnabled: (0, common_js_1.unknownField)("Overlay date (boolean)"),
|
|
29
|
+
isLogoEnabled: (0, common_js_1.unknownField)("Overlay logo (boolean)"),
|
|
30
|
+
isDebugEnabled: (0, common_js_1.unknownField)("Overlay debug info (boolean)"),
|
|
31
|
+
overlayLocation: (0, common_js_1.nullableString)('OSD position, e.g. "topLeft"'),
|
|
32
|
+
});
|
|
33
|
+
const smartDetectSettingsSchema = (0, common_js_1.passthroughObject)({
|
|
34
|
+
objectTypes: (0, common_js_1.unknownField)("Enabled object-detect types (array of strings)"),
|
|
35
|
+
audioTypes: (0, common_js_1.unknownField)("Enabled audio-detect types (array of strings)"),
|
|
36
|
+
});
|
|
37
|
+
exports.cameraSchema = (0, common_js_1.passthroughObject)({
|
|
38
|
+
id: (0, common_js_1.idField)("Camera ID"),
|
|
39
|
+
mac: (0, common_js_1.nullableString)("MAC address"),
|
|
40
|
+
name: (0, common_js_1.nullableString)("Camera name"),
|
|
41
|
+
modelKey: (0, common_js_1.nullableString)('Always "camera"'),
|
|
42
|
+
state: (0, common_js_1.nullableString)("CONNECTED | DISCONNECTED | ..."),
|
|
43
|
+
activePatrolSlot: (0, common_js_1.unknownField)("Active PTZ patrol slot, or null (number|null)"),
|
|
44
|
+
hasPackageCamera: (0, common_js_1.unknownField)("Has a secondary package camera (boolean)"),
|
|
45
|
+
hdrType: (0, common_js_1.nullableString)('HDR mode, e.g. "auto"'),
|
|
46
|
+
isMicEnabled: (0, common_js_1.unknownField)("Microphone enabled (boolean)"),
|
|
47
|
+
micVolume: (0, common_js_1.unknownField)("Microphone volume 0-100 (number)"),
|
|
48
|
+
videoMode: (0, common_js_1.nullableString)('Video mode, e.g. "default"'),
|
|
49
|
+
featureFlags: featureFlagsSchema.optional(),
|
|
50
|
+
lcdMessage: (0, common_js_1.unknownField)("Doorbell LCD message (object; often empty {})"),
|
|
51
|
+
ledSettings: ledSettingsSchema.optional(),
|
|
52
|
+
osdSettings: osdSettingsSchema.optional(),
|
|
53
|
+
smartDetectSettings: smartDetectSettingsSchema.optional(),
|
|
54
|
+
});
|
|
55
|
+
exports.cameraOutputSchema = { ...exports.cameraSchema.shape };
|
|
56
|
+
exports.cameraListOutputSchema = (0, common_js_1.listResultSchema)(exports.cameraSchema);
|
|
57
|
+
// Verified live (7.1.60): GET /cameras/{id}/rtsps-stream returns an object
|
|
58
|
+
// keyed by quality with RTSPS URLs. Keys absent when no session at that
|
|
59
|
+
// quality. nullableString keeps it null/absent-safe.
|
|
60
|
+
exports.rtspStreamSchema = (0, common_js_1.passthroughObject)({
|
|
61
|
+
high: (0, common_js_1.nullableString)("RTSPS URL for the high-quality stream"),
|
|
62
|
+
medium: (0, common_js_1.nullableString)("RTSPS URL for the medium-quality stream"),
|
|
63
|
+
low: (0, common_js_1.nullableString)("RTSPS URL for the low-quality stream"),
|
|
64
|
+
package: (0, common_js_1.nullableString)("RTSPS URL for the package-camera stream"),
|
|
65
|
+
});
|
|
66
|
+
exports.rtspStreamOutputSchema = { ...exports.rtspStreamSchema.shape };
|
|
67
|
+
exports.talkbackSessionOutputSchema = {
|
|
68
|
+
url: (0, common_js_1.nullableString)("Talkback session URL"),
|
|
69
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Schema primitives for Protect outputSchema declarations.
|
|
4
|
+
*
|
|
5
|
+
* Hard-won rule (verified against live 7.1.60): the UniFi Protect Integration
|
|
6
|
+
* API returns explicit `null` for absent string fields (e.g. a user with no
|
|
7
|
+
* email returns `email: null`, not omitted). `z.string().optional()` permits
|
|
8
|
+
* `undefined` but REJECTS `null`, which fails SDK output validation and breaks
|
|
9
|
+
* the tool call. So:
|
|
10
|
+
*
|
|
11
|
+
* - Only `id` is strictly typed (`z.string()`) — it is always a present,
|
|
12
|
+
* non-null string on every resource, and keeps one real validation guard.
|
|
13
|
+
* - Every other string uses `nullableString()` = string | null | undefined.
|
|
14
|
+
* The LLM still sees "this is a string" in the published schema, but null
|
|
15
|
+
* can never fail validation.
|
|
16
|
+
* - Non-string fields (booleans, numbers, nested objects whose shape we have
|
|
17
|
+
* not verified) use `unknownField()` — name + description published, no
|
|
18
|
+
* runtime type constraint at all.
|
|
19
|
+
* - Every object uses `.passthrough()` so unverified/extra fields flow through.
|
|
20
|
+
*/
|
|
21
|
+
/** Create an object schema with `.passthrough()` to allow unknown fields. */
|
|
22
|
+
export declare function passthroughObject<T extends z.ZodRawShape>(shape: T): z.ZodObject<{ -readonly [P in keyof T]: T[P]; }, z.core.$loose>;
|
|
23
|
+
/**
|
|
24
|
+
* An unverified field: name + description are published to clients, but there
|
|
25
|
+
* is no runtime type constraint (never fails output validation).
|
|
26
|
+
*/
|
|
27
|
+
export declare function unknownField(description: string): z.ZodOptional<z.ZodUnknown>;
|
|
28
|
+
/** The one strictly-typed field: `id` is always a present non-null string. */
|
|
29
|
+
export declare function idField(description?: string): z.ZodOptional<z.ZodString>;
|
|
30
|
+
/**
|
|
31
|
+
* A string field that may be string, null, or absent. Publishes the string
|
|
32
|
+
* type hint to clients while never failing validation on an API null.
|
|
33
|
+
*/
|
|
34
|
+
export declare function nullableString(description: string): z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
/** Output-schema shape for list endpoints that return a top-level array. */
|
|
36
|
+
export declare function listResultSchema<T extends z.ZodTypeAny>(itemSchema: T): {
|
|
37
|
+
result: z.ZodArray<T>;
|
|
38
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.passthroughObject = passthroughObject;
|
|
4
|
+
exports.unknownField = unknownField;
|
|
5
|
+
exports.idField = idField;
|
|
6
|
+
exports.nullableString = nullableString;
|
|
7
|
+
exports.listResultSchema = listResultSchema;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
/**
|
|
10
|
+
* Schema primitives for Protect outputSchema declarations.
|
|
11
|
+
*
|
|
12
|
+
* Hard-won rule (verified against live 7.1.60): the UniFi Protect Integration
|
|
13
|
+
* API returns explicit `null` for absent string fields (e.g. a user with no
|
|
14
|
+
* email returns `email: null`, not omitted). `z.string().optional()` permits
|
|
15
|
+
* `undefined` but REJECTS `null`, which fails SDK output validation and breaks
|
|
16
|
+
* the tool call. So:
|
|
17
|
+
*
|
|
18
|
+
* - Only `id` is strictly typed (`z.string()`) — it is always a present,
|
|
19
|
+
* non-null string on every resource, and keeps one real validation guard.
|
|
20
|
+
* - Every other string uses `nullableString()` = string | null | undefined.
|
|
21
|
+
* The LLM still sees "this is a string" in the published schema, but null
|
|
22
|
+
* can never fail validation.
|
|
23
|
+
* - Non-string fields (booleans, numbers, nested objects whose shape we have
|
|
24
|
+
* not verified) use `unknownField()` — name + description published, no
|
|
25
|
+
* runtime type constraint at all.
|
|
26
|
+
* - Every object uses `.passthrough()` so unverified/extra fields flow through.
|
|
27
|
+
*/
|
|
28
|
+
/** Create an object schema with `.passthrough()` to allow unknown fields. */
|
|
29
|
+
function passthroughObject(shape) {
|
|
30
|
+
return zod_1.z.object(shape).passthrough();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* An unverified field: name + description are published to clients, but there
|
|
34
|
+
* is no runtime type constraint (never fails output validation).
|
|
35
|
+
*/
|
|
36
|
+
function unknownField(description) {
|
|
37
|
+
return zod_1.z.unknown().optional().describe(description);
|
|
38
|
+
}
|
|
39
|
+
/** The one strictly-typed field: `id` is always a present non-null string. */
|
|
40
|
+
function idField(description = "Resource ID") {
|
|
41
|
+
return zod_1.z.string().optional().describe(description);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A string field that may be string, null, or absent. Publishes the string
|
|
45
|
+
* type hint to clients while never failing validation on an API null.
|
|
46
|
+
*/
|
|
47
|
+
function nullableString(description) {
|
|
48
|
+
return zod_1.z.string().nullable().optional().describe(description);
|
|
49
|
+
}
|
|
50
|
+
/** Output-schema shape for list endpoints that return a top-level array. */
|
|
51
|
+
function listResultSchema(itemSchema) {
|
|
52
|
+
return {
|
|
53
|
+
result: zod_1.z.array(itemSchema).describe("Array of items returned by the list endpoint"),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
export declare const lightSchema: import("zod").ZodObject<{
|
|
2
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
4
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
5
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
6
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
7
|
+
}, import("zod/v4/core").$loose>;
|
|
8
|
+
export declare const sensorSchema: import("zod").ZodObject<{
|
|
9
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
10
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
11
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
12
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
13
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
14
|
+
}, import("zod/v4/core").$loose>;
|
|
15
|
+
export declare const chimeSchema: import("zod").ZodObject<{
|
|
16
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
18
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
19
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
20
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
21
|
+
}, import("zod/v4/core").$loose>;
|
|
22
|
+
export declare const viewerSchema: import("zod").ZodObject<{
|
|
23
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
24
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
25
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
26
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
27
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
28
|
+
}, import("zod/v4/core").$loose>;
|
|
29
|
+
export declare const sirenSchema: import("zod").ZodObject<{
|
|
30
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
32
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
33
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
34
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
35
|
+
}, import("zod/v4/core").$loose>;
|
|
36
|
+
export declare const fobSchema: import("zod").ZodObject<{
|
|
37
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
38
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
39
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
40
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
41
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
42
|
+
}, import("zod/v4/core").$loose>;
|
|
43
|
+
export declare const relaySchema: import("zod").ZodObject<{
|
|
44
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
45
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
46
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
47
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
48
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
49
|
+
}, import("zod/v4/core").$loose>;
|
|
50
|
+
export declare const speakerSchema: import("zod").ZodObject<{
|
|
51
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
52
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
53
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
54
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
55
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
56
|
+
}, import("zod/v4/core").$loose>;
|
|
57
|
+
export declare const bridgeSchema: import("zod").ZodObject<{
|
|
58
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
59
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
60
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
61
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
62
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
63
|
+
}, import("zod/v4/core").$loose>;
|
|
64
|
+
export declare const linkStationSchema: import("zod").ZodObject<{
|
|
65
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
66
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
67
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
68
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
69
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
70
|
+
}, import("zod/v4/core").$loose>;
|
|
71
|
+
export declare const alarmHubSchema: import("zod").ZodObject<{
|
|
72
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
73
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
74
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
75
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
76
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
77
|
+
}, import("zod/v4/core").$loose>;
|
|
78
|
+
export declare const DEVICE_SCHEMAS: {
|
|
79
|
+
readonly light: import("zod").ZodObject<{
|
|
80
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
81
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
82
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
83
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
84
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
85
|
+
}, import("zod/v4/core").$loose>;
|
|
86
|
+
readonly sensor: import("zod").ZodObject<{
|
|
87
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
88
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
89
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
90
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
91
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
92
|
+
}, import("zod/v4/core").$loose>;
|
|
93
|
+
readonly chime: import("zod").ZodObject<{
|
|
94
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
95
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
96
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
97
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
98
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
99
|
+
}, import("zod/v4/core").$loose>;
|
|
100
|
+
readonly viewer: import("zod").ZodObject<{
|
|
101
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
102
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
103
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
104
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
105
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
106
|
+
}, import("zod/v4/core").$loose>;
|
|
107
|
+
readonly siren: import("zod").ZodObject<{
|
|
108
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
109
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
110
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
111
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
112
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
113
|
+
}, import("zod/v4/core").$loose>;
|
|
114
|
+
readonly fob: import("zod").ZodObject<{
|
|
115
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
116
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
117
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
118
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
119
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
120
|
+
}, import("zod/v4/core").$loose>;
|
|
121
|
+
readonly relay: import("zod").ZodObject<{
|
|
122
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
123
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
124
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
125
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
126
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
127
|
+
}, import("zod/v4/core").$loose>;
|
|
128
|
+
readonly speaker: import("zod").ZodObject<{
|
|
129
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
130
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
131
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
132
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
133
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
134
|
+
}, import("zod/v4/core").$loose>;
|
|
135
|
+
readonly bridge: import("zod").ZodObject<{
|
|
136
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
137
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
138
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
139
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
140
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
141
|
+
}, import("zod/v4/core").$loose>;
|
|
142
|
+
readonly link_station: import("zod").ZodObject<{
|
|
143
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
144
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
145
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
146
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
147
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
148
|
+
}, import("zod/v4/core").$loose>;
|
|
149
|
+
readonly alarm_hub: import("zod").ZodObject<{
|
|
150
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
151
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
152
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
153
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
154
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
155
|
+
}, import("zod/v4/core").$loose>;
|
|
156
|
+
};
|
|
157
|
+
export declare function itemOutputShape(key: keyof typeof DEVICE_SCHEMAS): {
|
|
158
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
159
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
160
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
161
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
162
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
163
|
+
};
|
|
164
|
+
export declare function listOutputShape(key: keyof typeof DEVICE_SCHEMAS): {
|
|
165
|
+
result: import("zod").ZodArray<import("zod").ZodObject<{
|
|
166
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
167
|
+
modelKey: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
168
|
+
name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
169
|
+
mac: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
170
|
+
state: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
171
|
+
}, import("zod/v4/core").$loose>>;
|
|
172
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEVICE_SCHEMAS = exports.alarmHubSchema = exports.linkStationSchema = exports.bridgeSchema = exports.speakerSchema = exports.relaySchema = exports.fobSchema = exports.sirenSchema = exports.viewerSchema = exports.chimeSchema = exports.sensorSchema = exports.lightSchema = void 0;
|
|
4
|
+
exports.itemOutputShape = itemOutputShape;
|
|
5
|
+
exports.listOutputShape = listOutputShape;
|
|
6
|
+
const common_js_1 = require("./common.js");
|
|
7
|
+
/**
|
|
8
|
+
* UNVERIFIED DOMAINS.
|
|
9
|
+
*
|
|
10
|
+
* The verification console (Protect 7.1.60) has zero instances of any of these
|
|
11
|
+
* device types (lights, sensors, chimes, viewers, sirens, fobs, relays,
|
|
12
|
+
* speakers, bridges, link-stations, alarm-hubs), so their real Integration API
|
|
13
|
+
* response shapes could not be observed.
|
|
14
|
+
*
|
|
15
|
+
* Per the unifi-api-update skill's "soften unverifiable claims" rule, we do NOT
|
|
16
|
+
* assert device-specific field lists here. The schema only types the universal
|
|
17
|
+
* identity fields seen consistently across every *verified* Protect resource
|
|
18
|
+
* (camera, nvr, user): id, modelKey, name, mac, state. `.passthrough()` lets
|
|
19
|
+
* every real (unverified) field through without rejection.
|
|
20
|
+
*
|
|
21
|
+
* When a console with these devices is available, capture live samples and
|
|
22
|
+
* tighten these per the skill (Step 4/5).
|
|
23
|
+
*/
|
|
24
|
+
const unverifiedDeviceSchema = () => (0, common_js_1.passthroughObject)({
|
|
25
|
+
id: (0, common_js_1.idField)("Device ID"),
|
|
26
|
+
modelKey: (0, common_js_1.nullableString)("Resource kind"),
|
|
27
|
+
name: (0, common_js_1.nullableString)("Device name"),
|
|
28
|
+
mac: (0, common_js_1.nullableString)("MAC address"),
|
|
29
|
+
state: (0, common_js_1.nullableString)("CONNECTED | DISCONNECTED | ..."),
|
|
30
|
+
});
|
|
31
|
+
exports.lightSchema = unverifiedDeviceSchema();
|
|
32
|
+
exports.sensorSchema = unverifiedDeviceSchema();
|
|
33
|
+
exports.chimeSchema = unverifiedDeviceSchema();
|
|
34
|
+
exports.viewerSchema = unverifiedDeviceSchema();
|
|
35
|
+
exports.sirenSchema = unverifiedDeviceSchema();
|
|
36
|
+
exports.fobSchema = unverifiedDeviceSchema();
|
|
37
|
+
exports.relaySchema = unverifiedDeviceSchema();
|
|
38
|
+
exports.speakerSchema = unverifiedDeviceSchema();
|
|
39
|
+
exports.bridgeSchema = unverifiedDeviceSchema();
|
|
40
|
+
exports.linkStationSchema = unverifiedDeviceSchema();
|
|
41
|
+
exports.alarmHubSchema = unverifiedDeviceSchema();
|
|
42
|
+
exports.DEVICE_SCHEMAS = {
|
|
43
|
+
light: exports.lightSchema,
|
|
44
|
+
sensor: exports.sensorSchema,
|
|
45
|
+
chime: exports.chimeSchema,
|
|
46
|
+
viewer: exports.viewerSchema,
|
|
47
|
+
siren: exports.sirenSchema,
|
|
48
|
+
fob: exports.fobSchema,
|
|
49
|
+
relay: exports.relaySchema,
|
|
50
|
+
speaker: exports.speakerSchema,
|
|
51
|
+
bridge: exports.bridgeSchema,
|
|
52
|
+
link_station: exports.linkStationSchema,
|
|
53
|
+
alarm_hub: exports.alarmHubSchema,
|
|
54
|
+
};
|
|
55
|
+
function itemOutputShape(key) {
|
|
56
|
+
return { ...exports.DEVICE_SCHEMAS[key].shape };
|
|
57
|
+
}
|
|
58
|
+
function listOutputShape(key) {
|
|
59
|
+
return (0, common_js_1.listResultSchema)(exports.DEVICE_SCHEMAS[key]);
|
|
60
|
+
}
|