@camstack/types 1.2.247 → 1.2.249
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/addon.d.ts +1 -1
- package/dist/addon.js +29 -1
- package/dist/addon.mjs +28 -2
- package/dist/capabilities/index.d.ts +1 -1
- package/dist/capabilities/notification-rules.cap.d.ts +1224 -11
- package/dist/capabilities/osd-manager.cap.d.ts +24 -0
- package/dist/device/linked-device-resolve.d.ts +74 -0
- package/dist/generated/addon-api.d.ts +14 -0
- package/dist/generated/collection-array-methods.d.ts +18 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1133 -24
- package/dist/index.mjs +1117 -25
- package/dist/notification/template-vars.d.ts +24 -0
- package/dist/{sleep-9gM_dS-5.js → sleep-CvwUEq16.js} +2 -0
- package/dist/{sleep-PEo0-Fz9.mjs → sleep-pM_J7YnY.mjs} +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-CvwUEq16.js");
|
|
3
3
|
const require_event_category = require("./event-category-BVfsrBYA.js");
|
|
4
4
|
const require_canonical_hash = require("./canonical-hash-CSE4ioRi.js");
|
|
5
5
|
const require_enums = require("./enums.js");
|
|
@@ -16654,6 +16654,7 @@ sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
|
|
|
16654
16654
|
sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
|
|
16655
16655
|
sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
|
|
16656
16656
|
sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
|
|
16657
|
+
sub("cover", "control", "control", "#0ea5e9", "door", "Cover");
|
|
16657
16658
|
sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
|
|
16658
16659
|
sub("siren", "control", "control", "#dc2626", "siren", "Siren");
|
|
16659
16660
|
sub("button", "control", "control", "#10b981", "button", "Button");
|
|
@@ -16998,6 +16999,10 @@ var NcSystemEventKindSchema = zod.z.enum([
|
|
|
16998
16999
|
"alarm-disarmed",
|
|
16999
17000
|
"alarm-arming",
|
|
17000
17001
|
"alarm-arm-refused",
|
|
17002
|
+
"alarm-pending",
|
|
17003
|
+
"alarm-rearmed",
|
|
17004
|
+
"alarm-sensor-bypass",
|
|
17005
|
+
"alarm-check-failed",
|
|
17001
17006
|
"addon-updated",
|
|
17002
17007
|
"server-updated",
|
|
17003
17008
|
"export-completed",
|
|
@@ -17034,9 +17039,13 @@ var NC_AUTHORABLE_SYSTEM_EVENT_KINDS = NcSystemEventKindSchema.options.filter((k
|
|
|
17034
17039
|
*/
|
|
17035
17040
|
var NC_ALARM_SYSTEM_EVENT_KINDS = [
|
|
17036
17041
|
"alarm-arm-refused",
|
|
17042
|
+
"alarm-check-failed",
|
|
17037
17043
|
"alarm-arming",
|
|
17038
17044
|
"alarm-armed",
|
|
17045
|
+
"alarm-pending",
|
|
17039
17046
|
"alarm-triggered",
|
|
17047
|
+
"alarm-rearmed",
|
|
17048
|
+
"alarm-sensor-bypass",
|
|
17040
17049
|
"alarm-disarmed"
|
|
17041
17050
|
];
|
|
17042
17051
|
/**
|
|
@@ -17660,6 +17669,19 @@ var NcMediaFrameSchema = zod.z.enum([
|
|
|
17660
17669
|
"full",
|
|
17661
17670
|
"boxed"
|
|
17662
17671
|
]);
|
|
17672
|
+
/**
|
|
17673
|
+
* How a SENSOR notification shows the cameras that link the sensor.
|
|
17674
|
+
*
|
|
17675
|
+
* `mosaic` — one image composed of every linked camera's photograph, taken at
|
|
17676
|
+
* the trigger. `each` — one image per camera where the target takes several
|
|
17677
|
+
* attachments; a target that takes one keeps the first camera's (the degrade
|
|
17678
|
+
* engine drops the rest by order). Either way ONE notification per event.
|
|
17679
|
+
* Absent = `mosaic`, applied by the Notification Center and deliberately NOT
|
|
17680
|
+
* a Zod default (see NcRulePatchSchema: a default materialises on every
|
|
17681
|
+
* partial patch). Meaningless for a rule whose subject is not a sensor, and a
|
|
17682
|
+
* sensor linked to one camera ships that camera's plain snapshot either way.
|
|
17683
|
+
*/
|
|
17684
|
+
var NcLinkedCameraModeSchema = zod.z.enum(["mosaic", "each"]);
|
|
17663
17685
|
var NcMediaPolicySchema = zod.z.object({
|
|
17664
17686
|
attach: zod.z.enum([
|
|
17665
17687
|
"best",
|
|
@@ -17705,7 +17727,9 @@ var NcMediaPolicySchema = zod.z.object({
|
|
|
17705
17727
|
* A profile that is not assigned falls back to the cheapest, and the render
|
|
17706
17728
|
* reports which one actually ran.
|
|
17707
17729
|
*/
|
|
17708
|
-
profile: require_sleep.CamProfileSchema.optional()
|
|
17730
|
+
profile: require_sleep.CamProfileSchema.optional(),
|
|
17731
|
+
/** See {@link NcLinkedCameraModeSchema}. */
|
|
17732
|
+
linkedCameras: NcLinkedCameraModeSchema.optional()
|
|
17709
17733
|
});
|
|
17710
17734
|
/**
|
|
17711
17735
|
* Cooldown GRANULARITY over the subject's class — how much a fired
|
|
@@ -17826,7 +17850,7 @@ var NcRuleInputSchema = zod.z.object({
|
|
|
17826
17850
|
cooldownSec: 60,
|
|
17827
17851
|
scope: "rule-device"
|
|
17828
17852
|
}),
|
|
17829
|
-
/** `{{var}}`
|
|
17853
|
+
/** `{{var}}` title/body. The variables are declared in `NC_TEMPLATE_VARS` (@camstack/types) and depend on the rule kind — see `templateVarsFor`. */
|
|
17830
17854
|
template: zod.z.object({
|
|
17831
17855
|
title: zod.z.string().max(500).optional(),
|
|
17832
17856
|
body: zod.z.string().max(2e3).optional()
|
|
@@ -18006,6 +18030,33 @@ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
|
|
|
18006
18030
|
throttle: NcThrottleSchema.optional(),
|
|
18007
18031
|
priority: zod.z.number().int().min(1).max(5).optional()
|
|
18008
18032
|
});
|
|
18033
|
+
/**
|
|
18034
|
+
* Optional rule fields an editor may EMPTY on an update.
|
|
18035
|
+
*
|
|
18036
|
+
* `updateRule` merges `{ ...existing, ...patch }`, so an omitted key keeps its
|
|
18037
|
+
* stored value — which is what a partial patch must do, and exactly why a
|
|
18038
|
+
* field emptied in an editor used to survive the save. An editor names here
|
|
18039
|
+
* the keys it AUTHORS and found empty; the store removes them before the
|
|
18040
|
+
* merge. A `schedule` cannot be sent empty at all (`windows.min(1)`), so this
|
|
18041
|
+
* is the only way to remove one.
|
|
18042
|
+
*/
|
|
18043
|
+
var NC_RULE_CLEARABLE_KEYS = [
|
|
18044
|
+
"template",
|
|
18045
|
+
"schedule",
|
|
18046
|
+
"targetUsers",
|
|
18047
|
+
"snoozeOptions",
|
|
18048
|
+
"snoozeAllowGlobal",
|
|
18049
|
+
"waitForEnhancement",
|
|
18050
|
+
"actions",
|
|
18051
|
+
"confirm",
|
|
18052
|
+
"groupIdleSec"
|
|
18053
|
+
];
|
|
18054
|
+
var NcRuleClearableKeySchema = zod.z.enum(NC_RULE_CLEARABLE_KEYS);
|
|
18055
|
+
var NcRuleUpdateInputSchema = zod.z.object({
|
|
18056
|
+
ruleId: zod.z.string(),
|
|
18057
|
+
patch: NcRulePatchSchema,
|
|
18058
|
+
clear: zod.z.array(NcRuleClearableKeySchema).optional()
|
|
18059
|
+
});
|
|
18009
18060
|
/** A persisted rule. */
|
|
18010
18061
|
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
18011
18062
|
id: zod.z.string(),
|
|
@@ -18037,6 +18088,87 @@ var NcTestResultSchema = zod.z.object({
|
|
|
18037
18088
|
className: zod.z.string().optional(),
|
|
18038
18089
|
label: zod.z.string().optional()
|
|
18039
18090
|
});
|
|
18091
|
+
/** The five rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts`
|
|
18092
|
+
* is the same union; the template-vars spec pins the two together. */
|
|
18093
|
+
var NcRuleKindSchema = zod.z.enum([
|
|
18094
|
+
"detection",
|
|
18095
|
+
"sensor",
|
|
18096
|
+
"occupancy",
|
|
18097
|
+
"sound",
|
|
18098
|
+
"system"
|
|
18099
|
+
]);
|
|
18100
|
+
/** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
|
|
18101
|
+
var NcTemplateFamilySchema = zod.z.enum([
|
|
18102
|
+
"rule",
|
|
18103
|
+
"timelapse",
|
|
18104
|
+
"summary"
|
|
18105
|
+
]);
|
|
18106
|
+
/** Which text field of that producer. `previewText` is the timelapse frame
|
|
18107
|
+
* caption, `captionText` the digest mosaic caption — both see fewer vars. */
|
|
18108
|
+
var NcTemplateFieldSchema = zod.z.enum([
|
|
18109
|
+
"title",
|
|
18110
|
+
"body",
|
|
18111
|
+
"previewText",
|
|
18112
|
+
"captionText"
|
|
18113
|
+
]);
|
|
18114
|
+
var NcTemplateVarGroupSchema = zod.z.enum([
|
|
18115
|
+
"subject",
|
|
18116
|
+
"place",
|
|
18117
|
+
"time",
|
|
18118
|
+
"rule",
|
|
18119
|
+
"occupancy",
|
|
18120
|
+
"sound",
|
|
18121
|
+
"sensor",
|
|
18122
|
+
"system",
|
|
18123
|
+
"digest",
|
|
18124
|
+
"ai"
|
|
18125
|
+
]);
|
|
18126
|
+
/**
|
|
18127
|
+
* ONE `{{var}}` a notification template may name.
|
|
18128
|
+
*
|
|
18129
|
+
* `families` / `fields` / `kinds` / `deliveries` / `systemEventKinds` say WHERE
|
|
18130
|
+
* it has a value; absent = no restriction on that axis. `systemEventKinds` is
|
|
18131
|
+
* read only for a `system` rule. `dynamic` declares a FAMILY of names
|
|
18132
|
+
* (`count_<class>`): the descriptor's `name` is the example member.
|
|
18133
|
+
*/
|
|
18134
|
+
var NcTemplateVarDescriptorSchema = zod.z.object({
|
|
18135
|
+
name: zod.z.string().regex(/^\w+$/),
|
|
18136
|
+
label: zod.z.string(),
|
|
18137
|
+
description: zod.z.string().optional(),
|
|
18138
|
+
example: zod.z.string(),
|
|
18139
|
+
group: NcTemplateVarGroupSchema,
|
|
18140
|
+
families: zod.z.array(NcTemplateFamilySchema).min(1),
|
|
18141
|
+
fields: zod.z.array(NcTemplateFieldSchema).optional(),
|
|
18142
|
+
kinds: zod.z.array(NcRuleKindSchema).optional(),
|
|
18143
|
+
deliveries: zod.z.array(NcDeliverySchema).optional(),
|
|
18144
|
+
systemEventKinds: zod.z.array(NcSystemEventKindSchema).optional(),
|
|
18145
|
+
dynamic: zod.z.object({
|
|
18146
|
+
prefix: zod.z.literal("count_"),
|
|
18147
|
+
from: zod.z.literal("classes")
|
|
18148
|
+
}).optional()
|
|
18149
|
+
});
|
|
18150
|
+
/** What an editor knows about the field being edited. */
|
|
18151
|
+
var NcTemplateVarContextSchema = zod.z.object({
|
|
18152
|
+
family: NcTemplateFamilySchema,
|
|
18153
|
+
field: NcTemplateFieldSchema,
|
|
18154
|
+
kind: NcRuleKindSchema.optional(),
|
|
18155
|
+
delivery: NcDeliverySchema.optional(),
|
|
18156
|
+
systemEventKinds: zod.z.array(NcSystemEventKindSchema).optional()
|
|
18157
|
+
});
|
|
18158
|
+
/** Input to `previewTemplate` — the editor's own context, plus the draft text. */
|
|
18159
|
+
var NcTemplatePreviewInputSchema = zod.z.object({
|
|
18160
|
+
context: NcTemplateVarContextSchema,
|
|
18161
|
+
template: zod.z.object({
|
|
18162
|
+
title: zod.z.string().max(500).optional(),
|
|
18163
|
+
body: zod.z.string().max(2e3).optional()
|
|
18164
|
+
})
|
|
18165
|
+
});
|
|
18166
|
+
var NcTemplatePreviewSchema = zod.z.object({
|
|
18167
|
+
title: zod.z.string().nullable(),
|
|
18168
|
+
body: zod.z.string().nullable(),
|
|
18169
|
+
/** Names the template uses that this context never fills — they render empty. */
|
|
18170
|
+
unknown: zod.z.array(zod.z.string())
|
|
18171
|
+
});
|
|
18040
18172
|
var NcConditionDescriptorSchema = zod.z.object({
|
|
18041
18173
|
/** Field id inside `NcConditions` (or `'schedule'` for the rule-level group). */
|
|
18042
18174
|
id: zod.z.string(),
|
|
@@ -18200,6 +18332,14 @@ var NC_CONDITION_CATALOG = [
|
|
|
18200
18332
|
value: "backup-completed",
|
|
18201
18333
|
label: "Backup completed"
|
|
18202
18334
|
},
|
|
18335
|
+
{
|
|
18336
|
+
value: "alarm-arm-refused",
|
|
18337
|
+
label: "Alarm arm refused"
|
|
18338
|
+
},
|
|
18339
|
+
{
|
|
18340
|
+
value: "alarm-check-failed",
|
|
18341
|
+
label: "Alarm check failed (armed anyway)"
|
|
18342
|
+
},
|
|
18203
18343
|
{
|
|
18204
18344
|
value: "alarm-arming",
|
|
18205
18345
|
label: "Alarm arming (exit delay)"
|
|
@@ -18208,10 +18348,22 @@ var NC_CONDITION_CATALOG = [
|
|
|
18208
18348
|
value: "alarm-armed",
|
|
18209
18349
|
label: "Alarm armed"
|
|
18210
18350
|
},
|
|
18351
|
+
{
|
|
18352
|
+
value: "alarm-pending",
|
|
18353
|
+
label: "Alarm entry delay started"
|
|
18354
|
+
},
|
|
18211
18355
|
{
|
|
18212
18356
|
value: "alarm-triggered",
|
|
18213
18357
|
label: "Alarm triggered"
|
|
18214
18358
|
},
|
|
18359
|
+
{
|
|
18360
|
+
value: "alarm-rearmed",
|
|
18361
|
+
label: "Alarm re-armed after siren"
|
|
18362
|
+
},
|
|
18363
|
+
{
|
|
18364
|
+
value: "alarm-sensor-bypass",
|
|
18365
|
+
label: "Alarm sensor bypass"
|
|
18366
|
+
},
|
|
18215
18367
|
{
|
|
18216
18368
|
value: "alarm-disarmed",
|
|
18217
18369
|
label: "Alarm disarmed"
|
|
@@ -18765,8 +18917,22 @@ var NcSnoozeSuppressedSchema = zod.z.object({
|
|
|
18765
18917
|
lastAt: zod.z.number()
|
|
18766
18918
|
});
|
|
18767
18919
|
/**
|
|
18768
|
-
*
|
|
18769
|
-
*
|
|
18920
|
+
* One arm mode's non-blocking list: devices that may be open when that mode
|
|
18921
|
+
* arms, without the arm being refused.
|
|
18922
|
+
*/
|
|
18923
|
+
var NcAlarmNonBlockingSchema = zod.z.object({
|
|
18924
|
+
mode: AlarmArmModeSchema,
|
|
18925
|
+
deviceIds: zod.z.array(zod.z.number().int()).max(200)
|
|
18926
|
+
});
|
|
18927
|
+
/**
|
|
18928
|
+
* The per-mode lists, at most one per mode. Two lists for one mode have no
|
|
18929
|
+
* meaning a reader could agree on (union? the last one?), so they are refused
|
|
18930
|
+
* at the boundary rather than interpreted.
|
|
18931
|
+
*/
|
|
18932
|
+
var NcAlarmNonBlockingListSchema = zod.z.array(NcAlarmNonBlockingSchema).max(8).refine((lists) => new Set(lists.map((l) => l.mode)).size === lists.length, { message: "nonBlocking: at most one list per arm mode" });
|
|
18933
|
+
/**
|
|
18934
|
+
* The three durations the panel's state machine runs on, who hears about its
|
|
18935
|
+
* transitions, and which openings each mode tolerates.
|
|
18770
18936
|
*
|
|
18771
18937
|
* They live on the NOTIFICATION-RULES cap, not on `alarm-panel`, on purpose:
|
|
18772
18938
|
* `alarm-panel` is `deviceNative` and its other provider mirrors somebody
|
|
@@ -18785,21 +18951,39 @@ var NcAlarmSettingsSchema = zod.z.object({
|
|
|
18785
18951
|
* existed, and therefore what an untouched install keeps doing.
|
|
18786
18952
|
*/
|
|
18787
18953
|
triggeredDurationSec: zod.z.number().int().min(0).max(3600),
|
|
18788
|
-
/** Send a notification when a mode takes effect. */
|
|
18789
|
-
announceArm: zod.z.boolean(),
|
|
18790
18954
|
/**
|
|
18791
|
-
*
|
|
18955
|
+
* Deprecated by D630 — every transition is announced. Parsed, never read;
|
|
18956
|
+
* remove after one release. Optional so an older admin's patch (which still
|
|
18957
|
+
* sends it) parses rather than failing the whole save.
|
|
18958
|
+
*/
|
|
18959
|
+
announceArm: zod.z.boolean().optional(),
|
|
18960
|
+
/**
|
|
18961
|
+
* Target ids from `notification-output`: every alarm transition goes here.
|
|
18792
18962
|
*
|
|
18793
|
-
* Explicit rather than "everyone": an
|
|
18963
|
+
* Explicit rather than "everyone": an alarm announcement is a household
|
|
18794
18964
|
* message, and broadcasting it to every configured endpoint (including a
|
|
18795
18965
|
* webhook wired to something else) is not a default anybody would choose.
|
|
18796
|
-
* Empty
|
|
18797
|
-
*
|
|
18966
|
+
* Empty sends nothing, and the server logs that — silence must be
|
|
18967
|
+
* attributable.
|
|
18968
|
+
*/
|
|
18969
|
+
announceTargets: zod.z.array(zod.z.string().min(1)).max(16),
|
|
18970
|
+
/**
|
|
18971
|
+
* Per arm mode, the covered devices whose being OPEN does not refuse the
|
|
18972
|
+
* arm (a window left ajar for the cat under `home`, say). At most one entry
|
|
18973
|
+
* per mode is meaningful. Defaulted to `[]` so a blob stored before D630
|
|
18974
|
+
* parses as "every opening blocks" — the behaviour it was written under.
|
|
18798
18975
|
*/
|
|
18799
|
-
|
|
18976
|
+
nonBlocking: NcAlarmNonBlockingListSchema.default([])
|
|
18800
18977
|
});
|
|
18801
|
-
/**
|
|
18802
|
-
|
|
18978
|
+
/**
|
|
18979
|
+
* Every field optional — a tab edits one control at a time.
|
|
18980
|
+
*
|
|
18981
|
+
* `nonBlocking` is re-declared WITHOUT its default: `.partial()` does not
|
|
18982
|
+
* remove an inner `.default()`, so a patch that never named the field would
|
|
18983
|
+
* parse to `nonBlocking: []` and wipe every mode's list on an unrelated edit
|
|
18984
|
+
* (the same trap {@link NcRulePatchSchema} documents).
|
|
18985
|
+
*/
|
|
18986
|
+
var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({ nonBlocking: NcAlarmNonBlockingListSchema }).partial();
|
|
18803
18987
|
/**
|
|
18804
18988
|
* What one arm mode actually arms, DERIVED from the enabled rules gated on it.
|
|
18805
18989
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
@@ -18844,6 +19028,36 @@ var NcAlarmModeCoverageSchema = zod.z.object({
|
|
|
18844
19028
|
*/
|
|
18845
19029
|
skippedDevices: zod.z.array(NcAlarmSkippedDeviceSchema).default([])
|
|
18846
19030
|
});
|
|
19031
|
+
/** One covered device that reads open, and whether that refuses the arm. */
|
|
19032
|
+
var NcAlarmOpeningSchema = zod.z.object({
|
|
19033
|
+
deviceId: zod.z.number().int(),
|
|
19034
|
+
name: zod.z.string(),
|
|
19035
|
+
/** The device's state word as read (`open`, `unlocked`, …). */
|
|
19036
|
+
state: zod.z.string(),
|
|
19037
|
+
/** False when the mode's non-blocking list names this device. */
|
|
19038
|
+
blocking: zod.z.boolean()
|
|
19039
|
+
});
|
|
19040
|
+
/** A device the panel is currently ignoring, and which side of it it is on. */
|
|
19041
|
+
var NcAlarmExclusionViewSchema = zod.z.object({
|
|
19042
|
+
deviceId: zod.z.number().int(),
|
|
19043
|
+
name: zod.z.string(),
|
|
19044
|
+
phase: zod.z.enum(["open", "closed"])
|
|
19045
|
+
});
|
|
19046
|
+
/** One mode's openings: devices read open, plus those whose state is unknown. */
|
|
19047
|
+
var NcAlarmModeOpeningsSchema = zod.z.object({
|
|
19048
|
+
mode: AlarmArmModeSchema,
|
|
19049
|
+
devices: zod.z.array(NcAlarmOpeningSchema),
|
|
19050
|
+
/** Covered devices whose state could not be read (D49): neither open nor closed. */
|
|
19051
|
+
unknown: zod.z.array(zod.z.number().int())
|
|
19052
|
+
});
|
|
19053
|
+
var NcAlarmLiveSchema = zod.z.object({
|
|
19054
|
+
state: AlarmStateSchema,
|
|
19055
|
+
/** The mode being armed into (exit delay) or held; null when disarmed. */
|
|
19056
|
+
targetMode: AlarmArmModeSchema.nullable(),
|
|
19057
|
+
availableModes: zod.z.array(AlarmArmModeSchema),
|
|
19058
|
+
openings: zod.z.array(NcAlarmModeOpeningsSchema),
|
|
19059
|
+
exclusions: zod.z.array(NcAlarmExclusionViewSchema)
|
|
19060
|
+
});
|
|
18847
19061
|
var NcAlarmConfigSchema = zod.z.object({
|
|
18848
19062
|
/**
|
|
18849
19063
|
* The panel's device id, or null when this install has no panel (the ensure
|
|
@@ -18853,7 +19067,13 @@ var NcAlarmConfigSchema = zod.z.object({
|
|
|
18853
19067
|
*/
|
|
18854
19068
|
deviceId: zod.z.number().int().nullable(),
|
|
18855
19069
|
settings: NcAlarmSettingsSchema,
|
|
18856
|
-
coverage: zod.z.array(NcAlarmModeCoverageSchema)
|
|
19070
|
+
coverage: zod.z.array(NcAlarmModeCoverageSchema),
|
|
19071
|
+
/**
|
|
19072
|
+
* The panel as it is NOW — state, what each mode would find open, what is
|
|
19073
|
+
* excluded. Optional: a panel-less hub answers without it, and a client
|
|
19074
|
+
* must not read its absence as "nothing is open".
|
|
19075
|
+
*/
|
|
19076
|
+
live: NcAlarmLiveSchema.optional()
|
|
18857
19077
|
});
|
|
18858
19078
|
/**
|
|
18859
19079
|
* The most seconds of footage any notification rule may ask a camera to retain.
|
|
@@ -18927,10 +19147,7 @@ var notificationRulesCapability = {
|
|
|
18927
19147
|
auth: "admin",
|
|
18928
19148
|
caller: "required"
|
|
18929
19149
|
}),
|
|
18930
|
-
updateRule: require_sleep.method(zod.z.object({
|
|
18931
|
-
ruleId: zod.z.string(),
|
|
18932
|
-
patch: NcRulePatchSchema
|
|
18933
|
-
}), zod.z.object({ rule: NcRuleSchema }), {
|
|
19150
|
+
updateRule: require_sleep.method(NcRuleUpdateInputSchema, zod.z.object({ rule: NcRuleSchema }), {
|
|
18934
19151
|
kind: "mutation",
|
|
18935
19152
|
auth: "admin",
|
|
18936
19153
|
caller: "required"
|
|
@@ -19018,6 +19235,18 @@ var notificationRulesCapability = {
|
|
|
19018
19235
|
catalog: zod.z.array(NcConditionDescriptorSchema),
|
|
19019
19236
|
taxonomy: NcTaxonomySchema.optional()
|
|
19020
19237
|
})),
|
|
19238
|
+
/** The declared `{{var}}` vocabulary; editors filter it with `templateVarsFor`. */
|
|
19239
|
+
getTemplateCatalog: require_sleep.method(zod.z.object({}), zod.z.object({ vars: zod.z.array(NcTemplateVarDescriptorSchema) })),
|
|
19240
|
+
/**
|
|
19241
|
+
* Render a template with example values, through the hub's text catalog.
|
|
19242
|
+
* Pure: sends nothing. A MUTATION only for transport — a 2.5k-char draft in
|
|
19243
|
+
* a batched GET URL risks length limits — so access stays `view`, the same
|
|
19244
|
+
* as `getTemplateCatalog`.
|
|
19245
|
+
*/
|
|
19246
|
+
previewTemplate: require_sleep.method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
|
|
19247
|
+
kind: "mutation",
|
|
19248
|
+
access: "view"
|
|
19249
|
+
}),
|
|
19021
19250
|
/**
|
|
19022
19251
|
* Queryable delivery history — a read-only view over the durable outbox
|
|
19023
19252
|
* (fired rule, subject summary, target, status, timestamps, error on a
|
|
@@ -19072,7 +19301,10 @@ var notificationRulesCapability = {
|
|
|
19072
19301
|
caller: "required"
|
|
19073
19302
|
}),
|
|
19074
19303
|
/**
|
|
19075
|
-
* The alarm panel's
|
|
19304
|
+
* The alarm panel's settings, what each mode ACTUALLY arms, and — when a
|
|
19305
|
+
* panel exists — its `live` state: current state and target mode, what
|
|
19306
|
+
* each mode would find open (blocking or not, and what is unknown), and
|
|
19307
|
+
* the devices currently excluded.
|
|
19076
19308
|
*
|
|
19077
19309
|
* Coverage is returned by the same call as the settings on purpose: they
|
|
19078
19310
|
* are read together or not at all. An editor that showed the delays
|
|
@@ -19082,7 +19314,9 @@ var notificationRulesCapability = {
|
|
|
19082
19314
|
*/
|
|
19083
19315
|
getAlarmConfig: require_sleep.method(zod.z.object({}), NcAlarmConfigSchema, { auth: "admin" }),
|
|
19084
19316
|
/**
|
|
19085
|
-
* Patch the durations
|
|
19317
|
+
* Patch the settings (durations, recipients, per-mode non-blocking lists;
|
|
19318
|
+
* `announceArm` is accepted and ignored — D630). Returns the WHOLE config,
|
|
19319
|
+
* coverage and `live` included, so a
|
|
19086
19320
|
* client never has to guess what the server settled on — the panel clamps
|
|
19087
19321
|
* and normalises, and a form that re-rendered from its own input would
|
|
19088
19322
|
* show a value the alarm is not using.
|
|
@@ -25315,6 +25549,7 @@ var CAP_TO_KIND = {
|
|
|
25315
25549
|
"enum-sensor": "enum-sensor",
|
|
25316
25550
|
"event-emitter": "device-event",
|
|
25317
25551
|
"lock-control": "lock",
|
|
25552
|
+
cover: "cover",
|
|
25318
25553
|
switch: "switch",
|
|
25319
25554
|
button: "button",
|
|
25320
25555
|
doorbell: "doorbell"
|
|
@@ -42463,9 +42698,8 @@ var DEVICE_STATE_READERS = [
|
|
|
42463
42698
|
field: "state"
|
|
42464
42699
|
},
|
|
42465
42700
|
{
|
|
42466
|
-
cap: "lock",
|
|
42467
|
-
field: "
|
|
42468
|
-
booleanWords: ["locked", "unlocked"]
|
|
42701
|
+
cap: "lock-control",
|
|
42702
|
+
field: "state"
|
|
42469
42703
|
},
|
|
42470
42704
|
{
|
|
42471
42705
|
cap: "contact",
|
|
@@ -44484,6 +44718,97 @@ function resolveContainerPrimaryChild(children, overrideEntityId, containerName)
|
|
|
44484
44718
|
return [...children].toSorted((a, b) => roleRank(a.role) - roleRank(b.role) || namesake(a) - namesake(b) || rank(a.type) - rank(b.type))[0] ?? null;
|
|
44485
44719
|
}
|
|
44486
44720
|
//#endregion
|
|
44721
|
+
//#region src/device/linked-device-resolve.ts
|
|
44722
|
+
/**
|
|
44723
|
+
* Which devices a camera's LINKED set resolves to — the pure rules, with no
|
|
44724
|
+
* store and no provider context.
|
|
44725
|
+
*
|
|
44726
|
+
* They live in `@camstack/types` rather than in the device-manager builtin
|
|
44727
|
+
* because two surfaces need the SAME answer and a second copy would be a
|
|
44728
|
+
* second definition of what a room contains: the hub's boot backfill, and the
|
|
44729
|
+
* admin UI's per-room rebuild. Moving them here also keeps that button a
|
|
44730
|
+
* framework-free change — a new cap method would only reach a node through a
|
|
44731
|
+
* published `@camstack/server` and a restart (D16), which is not what a
|
|
44732
|
+
* convenience button is worth.
|
|
44733
|
+
*/
|
|
44734
|
+
/**
|
|
44735
|
+
* Resolve one candidate id to the ids it should actually contribute to a
|
|
44736
|
+
* linked set: itself, unless it is a CONTAINER, in which case its own
|
|
44737
|
+
* children (recursively expanded the same way — a container-of-containers
|
|
44738
|
+
* is vanishingly unlikely per `DeviceType.Container`'s contract, but this
|
|
44739
|
+
* costs nothing to handle). `visited` guards a pathological parent-cycle in
|
|
44740
|
+
* persisted data from recursing forever; a candidate already on the current
|
|
44741
|
+
* expansion path is dropped rather than re-expanded.
|
|
44742
|
+
*
|
|
44743
|
+
* This is the STRUCTURAL, location-independent way a container's child
|
|
44744
|
+
* becomes reachable: the device-tree "children of the camera" rule and a
|
|
44745
|
+
* persisted manual pick are parentDeviceId chains, never location-based —
|
|
44746
|
+
* a container named there is excluded by expanding into whatever it
|
|
44747
|
+
* actually contains, regardless of what its (or its children's) `location`
|
|
44748
|
+
* column holds.
|
|
44749
|
+
*/
|
|
44750
|
+
function expandContainer(id, byId, byParent, visited, out) {
|
|
44751
|
+
if (visited.has(id)) return;
|
|
44752
|
+
const candidate = byId.get(id);
|
|
44753
|
+
if (!candidate) return;
|
|
44754
|
+
if (candidate.type !== require_sleep.DeviceType.Container) {
|
|
44755
|
+
out.add(id);
|
|
44756
|
+
return;
|
|
44757
|
+
}
|
|
44758
|
+
const nextVisited = new Set(visited);
|
|
44759
|
+
nextVisited.add(id);
|
|
44760
|
+
const primary = resolveContainerPrimaryChild((byParent.get(id) ?? []).map((c) => ({
|
|
44761
|
+
id: c.id,
|
|
44762
|
+
stableId: c.stableId,
|
|
44763
|
+
type: c.type,
|
|
44764
|
+
...c.role !== void 0 && c.role !== null ? { role: c.role } : {},
|
|
44765
|
+
...c.name !== void 0 ? { name: c.name } : {}
|
|
44766
|
+
})), byId.get(id)?.primaryChildEntityId, byId.get(id)?.name);
|
|
44767
|
+
if (primary !== null) expandContainer(primary.id, byId, byParent, nextVisited, out);
|
|
44768
|
+
}
|
|
44769
|
+
/**
|
|
44770
|
+
* What the retired `auto` mode (pre-D356) added beyond the device-tree
|
|
44771
|
+
* children: every non-container candidate sharing the camera's location, a
|
|
44772
|
+
* container child standing in for its container's PRIMARY child.
|
|
44773
|
+
*
|
|
44774
|
+
* Two callers, both WRITERS, never the read path: the one-shot boot backfill
|
|
44775
|
+
* that materialises it into the manual list
|
|
44776
|
+
* (`linked-devices-manual-backfill.ts`), and the admin UI's per-room rebuild.
|
|
44777
|
+
* Both ask "what does this room contain", and a second copy of the answer is
|
|
44778
|
+
* how two surfaces start disagreeing about a room.
|
|
44779
|
+
*
|
|
44780
|
+
* A camera with NO location answers `[]`. A caller that would WRITE that must
|
|
44781
|
+
* refuse instead: emptying a list because nobody set the room is the silent
|
|
44782
|
+
* drop D391 names.
|
|
44783
|
+
*/
|
|
44784
|
+
function legacyAutoLinkIds(params) {
|
|
44785
|
+
const { selfId, selfLocation, candidates } = params;
|
|
44786
|
+
if (selfLocation === null || selfLocation.length === 0) return [];
|
|
44787
|
+
const byId = new Map(candidates.map((c) => [c.id, c]));
|
|
44788
|
+
const byParent = /* @__PURE__ */ new Map();
|
|
44789
|
+
for (const c of candidates) {
|
|
44790
|
+
if (c.parentDeviceId === null) continue;
|
|
44791
|
+
const siblings = byParent.get(c.parentDeviceId);
|
|
44792
|
+
if (siblings) siblings.push(c);
|
|
44793
|
+
else byParent.set(c.parentDeviceId, [c]);
|
|
44794
|
+
}
|
|
44795
|
+
const ids = /* @__PURE__ */ new Set();
|
|
44796
|
+
const expand = (id) => expandContainer(id, byId, byParent, /* @__PURE__ */ new Set(), ids);
|
|
44797
|
+
for (const c of candidates) {
|
|
44798
|
+
if (c.type === require_sleep.DeviceType.Container) continue;
|
|
44799
|
+
if (c.location !== selfLocation) continue;
|
|
44800
|
+
if (c.parentDeviceId === selfId) continue;
|
|
44801
|
+
const parent = c.parentDeviceId !== null ? byId.get(c.parentDeviceId) : void 0;
|
|
44802
|
+
if (parent !== void 0 && parent.type === require_sleep.DeviceType.Container) {
|
|
44803
|
+
expand(parent.id);
|
|
44804
|
+
continue;
|
|
44805
|
+
}
|
|
44806
|
+
ids.add(c.id);
|
|
44807
|
+
}
|
|
44808
|
+
ids.delete(selfId);
|
|
44809
|
+
return [...ids];
|
|
44810
|
+
}
|
|
44811
|
+
//#endregion
|
|
44487
44812
|
//#region src/device/declared-device.ts
|
|
44488
44813
|
/** Marker written to a declared integration's `info`. */
|
|
44489
44814
|
var DECLARED_INTEGRATION_FIXED_KEY = "fixed";
|
|
@@ -52076,6 +52401,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52076
52401
|
addonId: null,
|
|
52077
52402
|
access: "view"
|
|
52078
52403
|
},
|
|
52404
|
+
"notificationRules.getTemplateCatalog": {
|
|
52405
|
+
capName: "notification-rules",
|
|
52406
|
+
capScope: "system",
|
|
52407
|
+
addonId: null,
|
|
52408
|
+
access: "view"
|
|
52409
|
+
},
|
|
52079
52410
|
"notificationRules.listDeviceMutes": {
|
|
52080
52411
|
capName: "notification-rules",
|
|
52081
52412
|
capScope: "system",
|
|
@@ -52094,6 +52425,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
52094
52425
|
addonId: null,
|
|
52095
52426
|
access: "view"
|
|
52096
52427
|
},
|
|
52428
|
+
"notificationRules.previewTemplate": {
|
|
52429
|
+
capName: "notification-rules",
|
|
52430
|
+
capScope: "system",
|
|
52431
|
+
addonId: null,
|
|
52432
|
+
access: "view"
|
|
52433
|
+
},
|
|
52097
52434
|
"notificationRules.resolveArtifactUrl": {
|
|
52098
52435
|
capName: "notification-rules",
|
|
52099
52436
|
capScope: "system",
|
|
@@ -60325,6 +60662,761 @@ function isScheduleActive(schedule, atMs) {
|
|
|
60325
60662
|
return schedule.invert === true ? !inside : inside;
|
|
60326
60663
|
}
|
|
60327
60664
|
//#endregion
|
|
60665
|
+
//#region src/notification/template-vars.ts
|
|
60666
|
+
var RULE_BODY_ONLY = ["body"];
|
|
60667
|
+
var RULE_TEXT = ["title", "body"];
|
|
60668
|
+
var BATTERY = ["device-battery-low", "device-battery-normal"];
|
|
60669
|
+
var CONSUMABLE = ["device-consumable-low", "device-consumable-normal"];
|
|
60670
|
+
var UPDATES = [
|
|
60671
|
+
"addon-update-available",
|
|
60672
|
+
"server-update-available",
|
|
60673
|
+
"wrapper-update-available"
|
|
60674
|
+
];
|
|
60675
|
+
var PACKAGE_UPDATES = ["addon-update-available", "server-update-available"];
|
|
60676
|
+
var ALARM = [
|
|
60677
|
+
"alarm-triggered",
|
|
60678
|
+
"alarm-armed",
|
|
60679
|
+
"alarm-disarmed",
|
|
60680
|
+
"alarm-arming",
|
|
60681
|
+
"alarm-arm-refused"
|
|
60682
|
+
];
|
|
60683
|
+
var COMBINED_ALARM = ["alarm-triggered"];
|
|
60684
|
+
var DEVICE_EVENTS = [
|
|
60685
|
+
"device-online",
|
|
60686
|
+
"device-offline",
|
|
60687
|
+
"device-disabled",
|
|
60688
|
+
"device-enabled",
|
|
60689
|
+
...BATTERY,
|
|
60690
|
+
...CONSUMABLE,
|
|
60691
|
+
"stream-online",
|
|
60692
|
+
"stream-offline",
|
|
60693
|
+
"detection-blind",
|
|
60694
|
+
...ALARM
|
|
60695
|
+
];
|
|
60696
|
+
var NC_TEMPLATE_VARS = [
|
|
60697
|
+
{
|
|
60698
|
+
name: "camera",
|
|
60699
|
+
label: "Camera",
|
|
60700
|
+
example: "Ingresso",
|
|
60701
|
+
group: "subject",
|
|
60702
|
+
families: ["rule", "timelapse"],
|
|
60703
|
+
systemEventKinds: [...DEVICE_EVENTS, "export-completed"]
|
|
60704
|
+
},
|
|
60705
|
+
{
|
|
60706
|
+
name: "class",
|
|
60707
|
+
label: "Detected class",
|
|
60708
|
+
description: "The counted class on an occupancy row (e.g. \"person\"); the detected class elsewhere.",
|
|
60709
|
+
example: "person",
|
|
60710
|
+
group: "subject",
|
|
60711
|
+
families: ["rule"],
|
|
60712
|
+
fields: [...RULE_TEXT],
|
|
60713
|
+
kinds: [
|
|
60714
|
+
"detection",
|
|
60715
|
+
"sensor",
|
|
60716
|
+
"sound",
|
|
60717
|
+
"occupancy",
|
|
60718
|
+
"system"
|
|
60719
|
+
],
|
|
60720
|
+
systemEventKinds: [...COMBINED_ALARM]
|
|
60721
|
+
},
|
|
60722
|
+
{
|
|
60723
|
+
name: "label",
|
|
60724
|
+
label: "Name or plate",
|
|
60725
|
+
description: "Recognised person or read plate; empty otherwise.",
|
|
60726
|
+
example: "Mario",
|
|
60727
|
+
group: "subject",
|
|
60728
|
+
families: ["rule"],
|
|
60729
|
+
fields: [...RULE_TEXT],
|
|
60730
|
+
kinds: ["detection", "system"],
|
|
60731
|
+
systemEventKinds: [...COMBINED_ALARM]
|
|
60732
|
+
},
|
|
60733
|
+
{
|
|
60734
|
+
name: "subject",
|
|
60735
|
+
label: "Subject sentence",
|
|
60736
|
+
description: "Composed in the notification language, e.g. \"person (Mario)\".",
|
|
60737
|
+
example: "persona (Mario)",
|
|
60738
|
+
group: "subject",
|
|
60739
|
+
families: ["rule"],
|
|
60740
|
+
fields: [...RULE_TEXT],
|
|
60741
|
+
kinds: [
|
|
60742
|
+
"detection",
|
|
60743
|
+
"sensor",
|
|
60744
|
+
"sound",
|
|
60745
|
+
"occupancy"
|
|
60746
|
+
]
|
|
60747
|
+
},
|
|
60748
|
+
{
|
|
60749
|
+
name: "confidence",
|
|
60750
|
+
label: "Confidence",
|
|
60751
|
+
example: "87%",
|
|
60752
|
+
group: "subject",
|
|
60753
|
+
families: ["rule"],
|
|
60754
|
+
fields: [...RULE_TEXT],
|
|
60755
|
+
kinds: ["detection", "system"],
|
|
60756
|
+
systemEventKinds: [...COMBINED_ALARM]
|
|
60757
|
+
},
|
|
60758
|
+
{
|
|
60759
|
+
name: "count",
|
|
60760
|
+
label: "Count",
|
|
60761
|
+
description: "Occupancy count, subjects in a grouped notification, or the event count of a system notice.",
|
|
60762
|
+
example: "3",
|
|
60763
|
+
group: "subject",
|
|
60764
|
+
families: ["rule"],
|
|
60765
|
+
fields: [...RULE_TEXT],
|
|
60766
|
+
kinds: [
|
|
60767
|
+
"detection",
|
|
60768
|
+
"occupancy",
|
|
60769
|
+
"system"
|
|
60770
|
+
],
|
|
60771
|
+
systemEventKinds: [
|
|
60772
|
+
"addon-crash-loop",
|
|
60773
|
+
...PACKAGE_UPDATES,
|
|
60774
|
+
"addon-updated"
|
|
60775
|
+
]
|
|
60776
|
+
},
|
|
60777
|
+
{
|
|
60778
|
+
name: "detectionSummary",
|
|
60779
|
+
label: "Detection summary",
|
|
60780
|
+
description: "Class composition, e.g. \"2 persons and 1 car\".",
|
|
60781
|
+
example: "2 persone e 1 auto",
|
|
60782
|
+
group: "subject",
|
|
60783
|
+
families: [
|
|
60784
|
+
"rule",
|
|
60785
|
+
"timelapse",
|
|
60786
|
+
"summary"
|
|
60787
|
+
],
|
|
60788
|
+
fields: [...RULE_TEXT],
|
|
60789
|
+
kinds: ["detection"]
|
|
60790
|
+
},
|
|
60791
|
+
{
|
|
60792
|
+
name: "zones",
|
|
60793
|
+
label: "Zones",
|
|
60794
|
+
example: "Cancello, Vialetto",
|
|
60795
|
+
group: "place",
|
|
60796
|
+
families: ["rule"],
|
|
60797
|
+
fields: [...RULE_TEXT],
|
|
60798
|
+
kinds: ["detection", "system"],
|
|
60799
|
+
systemEventKinds: [...COMBINED_ALARM]
|
|
60800
|
+
},
|
|
60801
|
+
{
|
|
60802
|
+
name: "zone",
|
|
60803
|
+
label: "Zone",
|
|
60804
|
+
example: "Cancello",
|
|
60805
|
+
group: "place",
|
|
60806
|
+
families: ["rule"],
|
|
60807
|
+
fields: [...RULE_TEXT],
|
|
60808
|
+
kinds: [
|
|
60809
|
+
"detection",
|
|
60810
|
+
"occupancy",
|
|
60811
|
+
"system"
|
|
60812
|
+
],
|
|
60813
|
+
systemEventKinds: [...COMBINED_ALARM]
|
|
60814
|
+
},
|
|
60815
|
+
{
|
|
60816
|
+
name: "inZones",
|
|
60817
|
+
label: "\"in <zones>\" fragment",
|
|
60818
|
+
description: "Leading space included; empty when no zone.",
|
|
60819
|
+
example: " in Cancello",
|
|
60820
|
+
group: "place",
|
|
60821
|
+
families: ["rule"],
|
|
60822
|
+
fields: [...RULE_TEXT],
|
|
60823
|
+
kinds: ["detection", "system"],
|
|
60824
|
+
systemEventKinds: [...COMBINED_ALARM]
|
|
60825
|
+
},
|
|
60826
|
+
{
|
|
60827
|
+
name: "scope",
|
|
60828
|
+
label: "Occupancy scope",
|
|
60829
|
+
example: "Cancello",
|
|
60830
|
+
group: "place",
|
|
60831
|
+
families: ["rule"],
|
|
60832
|
+
fields: [...RULE_TEXT],
|
|
60833
|
+
kinds: ["occupancy"]
|
|
60834
|
+
},
|
|
60835
|
+
{
|
|
60836
|
+
name: "time",
|
|
60837
|
+
label: "Time",
|
|
60838
|
+
description: "Hours and minutes, in the notification language.",
|
|
60839
|
+
example: "20:05",
|
|
60840
|
+
group: "time",
|
|
60841
|
+
families: [
|
|
60842
|
+
"rule",
|
|
60843
|
+
"timelapse",
|
|
60844
|
+
"summary"
|
|
60845
|
+
],
|
|
60846
|
+
fields: [...RULE_TEXT]
|
|
60847
|
+
},
|
|
60848
|
+
{
|
|
60849
|
+
name: "rule",
|
|
60850
|
+
label: "Rule name",
|
|
60851
|
+
example: "Ingresso notte",
|
|
60852
|
+
group: "rule",
|
|
60853
|
+
families: [
|
|
60854
|
+
"rule",
|
|
60855
|
+
"timelapse",
|
|
60856
|
+
"summary"
|
|
60857
|
+
]
|
|
60858
|
+
},
|
|
60859
|
+
{
|
|
60860
|
+
name: "from",
|
|
60861
|
+
label: "Window start",
|
|
60862
|
+
example: "07:00",
|
|
60863
|
+
group: "time",
|
|
60864
|
+
families: ["timelapse", "summary"]
|
|
60865
|
+
},
|
|
60866
|
+
{
|
|
60867
|
+
name: "to",
|
|
60868
|
+
label: "Window end",
|
|
60869
|
+
example: "08:00",
|
|
60870
|
+
group: "time",
|
|
60871
|
+
families: ["timelapse", "summary"]
|
|
60872
|
+
},
|
|
60873
|
+
{
|
|
60874
|
+
name: "capacity",
|
|
60875
|
+
label: "Capacity",
|
|
60876
|
+
example: "2",
|
|
60877
|
+
group: "occupancy",
|
|
60878
|
+
families: ["rule"],
|
|
60879
|
+
fields: [...RULE_TEXT],
|
|
60880
|
+
kinds: ["occupancy"]
|
|
60881
|
+
},
|
|
60882
|
+
{
|
|
60883
|
+
name: "op",
|
|
60884
|
+
label: "Occupied / free",
|
|
60885
|
+
example: "occupata",
|
|
60886
|
+
group: "occupancy",
|
|
60887
|
+
families: ["rule"],
|
|
60888
|
+
fields: [...RULE_TEXT],
|
|
60889
|
+
kinds: ["occupancy"]
|
|
60890
|
+
},
|
|
60891
|
+
{
|
|
60892
|
+
name: "sounds",
|
|
60893
|
+
label: "Sounds heard",
|
|
60894
|
+
example: "abbaio, clacson",
|
|
60895
|
+
group: "sound",
|
|
60896
|
+
families: ["rule"],
|
|
60897
|
+
fields: [...RULE_TEXT],
|
|
60898
|
+
kinds: ["sound"]
|
|
60899
|
+
},
|
|
60900
|
+
{
|
|
60901
|
+
name: "hitPercent",
|
|
60902
|
+
label: "Share of the window",
|
|
60903
|
+
description: "Level mode only: percentage of samples above the threshold.",
|
|
60904
|
+
example: "42",
|
|
60905
|
+
group: "sound",
|
|
60906
|
+
families: ["rule"],
|
|
60907
|
+
fields: [...RULE_TEXT],
|
|
60908
|
+
kinds: ["sound"]
|
|
60909
|
+
},
|
|
60910
|
+
{
|
|
60911
|
+
name: "db",
|
|
60912
|
+
label: "Peak level (dBFS)",
|
|
60913
|
+
example: "-18",
|
|
60914
|
+
group: "sound",
|
|
60915
|
+
families: ["rule"],
|
|
60916
|
+
fields: [...RULE_TEXT],
|
|
60917
|
+
kinds: ["sound"]
|
|
60918
|
+
},
|
|
60919
|
+
{
|
|
60920
|
+
name: "eventType",
|
|
60921
|
+
label: "Event type",
|
|
60922
|
+
description: "Raw device event token, e.g. \"press\" or \"open\"; empty when the device sends none.",
|
|
60923
|
+
example: "press",
|
|
60924
|
+
group: "sensor",
|
|
60925
|
+
families: ["rule"],
|
|
60926
|
+
fields: [...RULE_TEXT],
|
|
60927
|
+
kinds: ["sensor"]
|
|
60928
|
+
},
|
|
60929
|
+
{
|
|
60930
|
+
name: "ai",
|
|
60931
|
+
label: "AI sentence",
|
|
60932
|
+
description: "Where the AI description goes; appended on its own line when absent.",
|
|
60933
|
+
example: "Una persona lascia un pacco.",
|
|
60934
|
+
group: "ai",
|
|
60935
|
+
families: ["rule", "summary"],
|
|
60936
|
+
fields: [...RULE_BODY_ONLY],
|
|
60937
|
+
kinds: ["detection", "occupancy"]
|
|
60938
|
+
},
|
|
60939
|
+
{
|
|
60940
|
+
name: "eventKind",
|
|
60941
|
+
label: "Event kind",
|
|
60942
|
+
example: "device-offline",
|
|
60943
|
+
group: "system",
|
|
60944
|
+
families: ["rule"],
|
|
60945
|
+
fields: [...RULE_TEXT],
|
|
60946
|
+
kinds: ["system"]
|
|
60947
|
+
},
|
|
60948
|
+
{
|
|
60949
|
+
name: "deviceName",
|
|
60950
|
+
label: "Device",
|
|
60951
|
+
example: "Ingresso",
|
|
60952
|
+
group: "system",
|
|
60953
|
+
families: ["rule"],
|
|
60954
|
+
fields: [...RULE_TEXT],
|
|
60955
|
+
kinds: ["system"],
|
|
60956
|
+
systemEventKinds: [...DEVICE_EVENTS]
|
|
60957
|
+
},
|
|
60958
|
+
{
|
|
60959
|
+
name: "deviceId",
|
|
60960
|
+
label: "Device id",
|
|
60961
|
+
example: "617",
|
|
60962
|
+
group: "system",
|
|
60963
|
+
families: ["rule"],
|
|
60964
|
+
fields: [...RULE_TEXT],
|
|
60965
|
+
kinds: ["system"],
|
|
60966
|
+
systemEventKinds: [...DEVICE_EVENTS, "export-completed"]
|
|
60967
|
+
},
|
|
60968
|
+
{
|
|
60969
|
+
name: "percentage",
|
|
60970
|
+
label: "Percentage",
|
|
60971
|
+
example: "15",
|
|
60972
|
+
group: "system",
|
|
60973
|
+
families: ["rule"],
|
|
60974
|
+
fields: [...RULE_TEXT],
|
|
60975
|
+
kinds: ["system"],
|
|
60976
|
+
systemEventKinds: [...BATTERY, ...CONSUMABLE]
|
|
60977
|
+
},
|
|
60978
|
+
{
|
|
60979
|
+
name: "item",
|
|
60980
|
+
label: "Consumable",
|
|
60981
|
+
example: "Filtro",
|
|
60982
|
+
group: "system",
|
|
60983
|
+
families: ["rule"],
|
|
60984
|
+
fields: [...RULE_TEXT],
|
|
60985
|
+
kinds: ["system"],
|
|
60986
|
+
systemEventKinds: [...CONSUMABLE]
|
|
60987
|
+
},
|
|
60988
|
+
{
|
|
60989
|
+
name: "profile",
|
|
60990
|
+
label: "Stream profile",
|
|
60991
|
+
example: "high",
|
|
60992
|
+
group: "system",
|
|
60993
|
+
families: ["rule"],
|
|
60994
|
+
fields: [...RULE_TEXT],
|
|
60995
|
+
kinds: ["system"],
|
|
60996
|
+
systemEventKinds: ["stream-online", "stream-offline"]
|
|
60997
|
+
},
|
|
60998
|
+
{
|
|
60999
|
+
name: "node",
|
|
61000
|
+
label: "Node",
|
|
61001
|
+
example: "hub",
|
|
61002
|
+
group: "system",
|
|
61003
|
+
families: ["rule"],
|
|
61004
|
+
fields: [...RULE_TEXT],
|
|
61005
|
+
kinds: ["system"],
|
|
61006
|
+
systemEventKinds: [
|
|
61007
|
+
"node-online",
|
|
61008
|
+
"node-offline",
|
|
61009
|
+
"node-inference-unavailable",
|
|
61010
|
+
"addon-crash-loop",
|
|
61011
|
+
...UPDATES,
|
|
61012
|
+
"addon-updated",
|
|
61013
|
+
"server-updated"
|
|
61014
|
+
]
|
|
61015
|
+
},
|
|
61016
|
+
{
|
|
61017
|
+
name: "nodeId",
|
|
61018
|
+
label: "Node id",
|
|
61019
|
+
example: "hub",
|
|
61020
|
+
group: "system",
|
|
61021
|
+
families: ["rule"],
|
|
61022
|
+
fields: [...RULE_TEXT],
|
|
61023
|
+
kinds: ["system"],
|
|
61024
|
+
systemEventKinds: [
|
|
61025
|
+
"node-online",
|
|
61026
|
+
"node-offline",
|
|
61027
|
+
"node-inference-unavailable",
|
|
61028
|
+
"addon-crash-loop",
|
|
61029
|
+
...UPDATES,
|
|
61030
|
+
"server-updated"
|
|
61031
|
+
]
|
|
61032
|
+
},
|
|
61033
|
+
{
|
|
61034
|
+
name: "devices",
|
|
61035
|
+
label: "Devices",
|
|
61036
|
+
description: "node-inference-unavailable: the affected cameras, comma-joined. Alarm arm / refusal: HOW MANY devices are armed (or open).",
|
|
61037
|
+
example: "Ingresso, Garage",
|
|
61038
|
+
group: "system",
|
|
61039
|
+
families: ["rule"],
|
|
61040
|
+
fields: [...RULE_TEXT],
|
|
61041
|
+
kinds: ["system"],
|
|
61042
|
+
systemEventKinds: [
|
|
61043
|
+
"node-inference-unavailable",
|
|
61044
|
+
"alarm-armed",
|
|
61045
|
+
"alarm-arm-refused"
|
|
61046
|
+
]
|
|
61047
|
+
},
|
|
61048
|
+
{
|
|
61049
|
+
name: "addons",
|
|
61050
|
+
label: "Addons",
|
|
61051
|
+
example: "stream-broker",
|
|
61052
|
+
group: "system",
|
|
61053
|
+
families: ["rule"],
|
|
61054
|
+
fields: [...RULE_TEXT],
|
|
61055
|
+
kinds: ["system"],
|
|
61056
|
+
systemEventKinds: ["addon-crash-loop"]
|
|
61057
|
+
},
|
|
61058
|
+
{
|
|
61059
|
+
name: "minutes",
|
|
61060
|
+
label: "Minutes",
|
|
61061
|
+
example: "12",
|
|
61062
|
+
group: "system",
|
|
61063
|
+
families: ["rule"],
|
|
61064
|
+
fields: [...RULE_TEXT],
|
|
61065
|
+
kinds: ["system"],
|
|
61066
|
+
systemEventKinds: ["detection-blind"]
|
|
61067
|
+
},
|
|
61068
|
+
{
|
|
61069
|
+
name: "package",
|
|
61070
|
+
label: "Package",
|
|
61071
|
+
example: "@camstack/addon-recorder",
|
|
61072
|
+
group: "system",
|
|
61073
|
+
families: ["rule"],
|
|
61074
|
+
fields: [...RULE_TEXT],
|
|
61075
|
+
kinds: ["system"],
|
|
61076
|
+
systemEventKinds: [
|
|
61077
|
+
...UPDATES,
|
|
61078
|
+
"addon-updated",
|
|
61079
|
+
"server-updated"
|
|
61080
|
+
]
|
|
61081
|
+
},
|
|
61082
|
+
{
|
|
61083
|
+
name: "packageName",
|
|
61084
|
+
label: "Package",
|
|
61085
|
+
example: "@camstack/addon-recorder",
|
|
61086
|
+
group: "system",
|
|
61087
|
+
families: ["rule"],
|
|
61088
|
+
fields: [...RULE_TEXT],
|
|
61089
|
+
kinds: ["system"],
|
|
61090
|
+
systemEventKinds: [...PACKAGE_UPDATES, "server-updated"]
|
|
61091
|
+
},
|
|
61092
|
+
{
|
|
61093
|
+
name: "nodes",
|
|
61094
|
+
label: "Nodes",
|
|
61095
|
+
description: "Comma-joined node ids, when an update spans more than one — the single-node case names it through {{nodeId}} instead. `incomingFromUpdateAvailable` (event-intake.ts) fills `nodes` from ONE shared textParams object for both addon- and server-update-available, exactly like packageName/currentVersion/latestVersion/count — only the shipped TEXT (system.server-update-available.body.onNodes) reads it today, but the var is real on both kinds.",
|
|
61096
|
+
example: "hub, little-unraid",
|
|
61097
|
+
group: "system",
|
|
61098
|
+
families: ["rule"],
|
|
61099
|
+
fields: [...RULE_TEXT],
|
|
61100
|
+
kinds: ["system"],
|
|
61101
|
+
systemEventKinds: [...PACKAGE_UPDATES]
|
|
61102
|
+
},
|
|
61103
|
+
{
|
|
61104
|
+
name: "currentVersion",
|
|
61105
|
+
label: "Current version",
|
|
61106
|
+
example: "1.2.377",
|
|
61107
|
+
group: "system",
|
|
61108
|
+
families: ["rule"],
|
|
61109
|
+
fields: [...RULE_TEXT],
|
|
61110
|
+
kinds: ["system"],
|
|
61111
|
+
systemEventKinds: [...UPDATES]
|
|
61112
|
+
},
|
|
61113
|
+
{
|
|
61114
|
+
name: "latestVersion",
|
|
61115
|
+
label: "Latest version",
|
|
61116
|
+
example: "1.2.378",
|
|
61117
|
+
group: "system",
|
|
61118
|
+
families: ["rule"],
|
|
61119
|
+
fields: [...RULE_TEXT],
|
|
61120
|
+
kinds: ["system"],
|
|
61121
|
+
systemEventKinds: [...UPDATES]
|
|
61122
|
+
},
|
|
61123
|
+
{
|
|
61124
|
+
name: "list",
|
|
61125
|
+
label: "Updated packages",
|
|
61126
|
+
description: "One line per package. `incomingFromUpdateAvailable` fills it for addon-/server-update-available too (the SAME shared textParams object as `nodes`) — `system.addon-update-available.body` reads it; `incomingFromAddonUpdates` fills it again, independently, for the completed `addon-updated` event.",
|
|
61127
|
+
example: "recorder, notifiers",
|
|
61128
|
+
group: "system",
|
|
61129
|
+
families: ["rule"],
|
|
61130
|
+
fields: [...RULE_TEXT],
|
|
61131
|
+
kinds: ["system"],
|
|
61132
|
+
systemEventKinds: [...PACKAGE_UPDATES, "addon-updated"]
|
|
61133
|
+
},
|
|
61134
|
+
{
|
|
61135
|
+
name: "fromVersion",
|
|
61136
|
+
label: "From version",
|
|
61137
|
+
example: "1.2.377",
|
|
61138
|
+
group: "system",
|
|
61139
|
+
families: ["rule"],
|
|
61140
|
+
fields: [...RULE_TEXT],
|
|
61141
|
+
kinds: ["system"],
|
|
61142
|
+
systemEventKinds: ["server-updated"]
|
|
61143
|
+
},
|
|
61144
|
+
{
|
|
61145
|
+
name: "toVersion",
|
|
61146
|
+
label: "To version",
|
|
61147
|
+
example: "1.2.378",
|
|
61148
|
+
group: "system",
|
|
61149
|
+
families: ["rule"],
|
|
61150
|
+
fields: [...RULE_TEXT],
|
|
61151
|
+
kinds: ["system"],
|
|
61152
|
+
systemEventKinds: ["server-updated"]
|
|
61153
|
+
},
|
|
61154
|
+
{
|
|
61155
|
+
name: "destinationsOk",
|
|
61156
|
+
label: "Destinations ok",
|
|
61157
|
+
example: "2",
|
|
61158
|
+
group: "system",
|
|
61159
|
+
families: ["rule"],
|
|
61160
|
+
fields: [...RULE_TEXT],
|
|
61161
|
+
kinds: ["system"],
|
|
61162
|
+
systemEventKinds: ["backup-completed"]
|
|
61163
|
+
},
|
|
61164
|
+
{
|
|
61165
|
+
name: "destinationsTotal",
|
|
61166
|
+
label: "Destinations",
|
|
61167
|
+
example: "2",
|
|
61168
|
+
group: "system",
|
|
61169
|
+
families: ["rule"],
|
|
61170
|
+
fields: [...RULE_TEXT],
|
|
61171
|
+
kinds: ["system"],
|
|
61172
|
+
systemEventKinds: ["backup-completed"]
|
|
61173
|
+
},
|
|
61174
|
+
{
|
|
61175
|
+
name: "destinationsFailed",
|
|
61176
|
+
label: "Destinations failed",
|
|
61177
|
+
example: "0",
|
|
61178
|
+
group: "system",
|
|
61179
|
+
families: ["rule"],
|
|
61180
|
+
fields: [...RULE_TEXT],
|
|
61181
|
+
kinds: ["system"],
|
|
61182
|
+
systemEventKinds: ["backup-completed"]
|
|
61183
|
+
},
|
|
61184
|
+
{
|
|
61185
|
+
name: "sizeMB",
|
|
61186
|
+
label: "Size (MB)",
|
|
61187
|
+
example: "412",
|
|
61188
|
+
group: "system",
|
|
61189
|
+
families: ["rule"],
|
|
61190
|
+
fields: [...RULE_TEXT],
|
|
61191
|
+
kinds: ["system"],
|
|
61192
|
+
systemEventKinds: ["backup-completed"]
|
|
61193
|
+
},
|
|
61194
|
+
{
|
|
61195
|
+
name: "backupId",
|
|
61196
|
+
label: "Backup id",
|
|
61197
|
+
example: "bk-20260924",
|
|
61198
|
+
group: "system",
|
|
61199
|
+
families: ["rule"],
|
|
61200
|
+
fields: [...RULE_TEXT],
|
|
61201
|
+
kinds: ["system"],
|
|
61202
|
+
systemEventKinds: ["backup-completed"]
|
|
61203
|
+
},
|
|
61204
|
+
{
|
|
61205
|
+
name: "title",
|
|
61206
|
+
label: "Export title",
|
|
61207
|
+
example: "Ingresso 08:00",
|
|
61208
|
+
group: "system",
|
|
61209
|
+
families: ["rule"],
|
|
61210
|
+
fields: [...RULE_TEXT],
|
|
61211
|
+
kinds: ["system"],
|
|
61212
|
+
systemEventKinds: ["export-completed"]
|
|
61213
|
+
},
|
|
61214
|
+
{
|
|
61215
|
+
name: "exportId",
|
|
61216
|
+
label: "Export id",
|
|
61217
|
+
example: "exp-20260924",
|
|
61218
|
+
group: "system",
|
|
61219
|
+
families: ["rule"],
|
|
61220
|
+
fields: [...RULE_TEXT],
|
|
61221
|
+
kinds: ["system"],
|
|
61222
|
+
systemEventKinds: ["export-completed"]
|
|
61223
|
+
},
|
|
61224
|
+
{
|
|
61225
|
+
name: "bytes",
|
|
61226
|
+
label: "Export size (bytes)",
|
|
61227
|
+
example: "10485760",
|
|
61228
|
+
group: "system",
|
|
61229
|
+
families: ["rule"],
|
|
61230
|
+
fields: [...RULE_TEXT],
|
|
61231
|
+
kinds: ["system"],
|
|
61232
|
+
systemEventKinds: ["export-completed"]
|
|
61233
|
+
},
|
|
61234
|
+
{
|
|
61235
|
+
name: "mode",
|
|
61236
|
+
label: "Alarm mode",
|
|
61237
|
+
example: "away",
|
|
61238
|
+
group: "system",
|
|
61239
|
+
families: ["rule"],
|
|
61240
|
+
fields: [...RULE_TEXT],
|
|
61241
|
+
kinds: ["system"],
|
|
61242
|
+
systemEventKinds: [
|
|
61243
|
+
"alarm-armed",
|
|
61244
|
+
"alarm-arming",
|
|
61245
|
+
"alarm-arm-refused"
|
|
61246
|
+
]
|
|
61247
|
+
},
|
|
61248
|
+
{
|
|
61249
|
+
name: "seconds",
|
|
61250
|
+
label: "Seconds",
|
|
61251
|
+
description: "Arming: the exit delay left. Refusal: how long the retry-to-arm-anyway lasts.",
|
|
61252
|
+
example: "30",
|
|
61253
|
+
group: "system",
|
|
61254
|
+
families: ["rule"],
|
|
61255
|
+
fields: [...RULE_TEXT],
|
|
61256
|
+
kinds: ["system"],
|
|
61257
|
+
systemEventKinds: ["alarm-arming", "alarm-arm-refused"]
|
|
61258
|
+
},
|
|
61259
|
+
{
|
|
61260
|
+
name: "rules",
|
|
61261
|
+
label: "Covering rules",
|
|
61262
|
+
description: "How many enabled rules the armed mode gates.",
|
|
61263
|
+
example: "2",
|
|
61264
|
+
group: "system",
|
|
61265
|
+
families: ["rule"],
|
|
61266
|
+
fields: [...RULE_TEXT],
|
|
61267
|
+
kinds: ["system"],
|
|
61268
|
+
systemEventKinds: ["alarm-armed"]
|
|
61269
|
+
},
|
|
61270
|
+
{
|
|
61271
|
+
name: "names",
|
|
61272
|
+
label: "Device names",
|
|
61273
|
+
description: "Armed: the devices armed. Arming: the devices this mode cannot arm. Refusal: the open sensors.",
|
|
61274
|
+
example: "Ingresso, Garage",
|
|
61275
|
+
group: "system",
|
|
61276
|
+
families: ["rule"],
|
|
61277
|
+
fields: [...RULE_TEXT],
|
|
61278
|
+
kinds: ["system"],
|
|
61279
|
+
systemEventKinds: [
|
|
61280
|
+
"alarm-armed",
|
|
61281
|
+
"alarm-arming",
|
|
61282
|
+
"alarm-arm-refused"
|
|
61283
|
+
]
|
|
61284
|
+
},
|
|
61285
|
+
{
|
|
61286
|
+
name: "skippedNames",
|
|
61287
|
+
label: "Skipped devices",
|
|
61288
|
+
description: "Devices the mode names but cannot arm (muted, detection off, offline).",
|
|
61289
|
+
example: "Garage",
|
|
61290
|
+
group: "system",
|
|
61291
|
+
families: ["rule"],
|
|
61292
|
+
fields: [...RULE_TEXT],
|
|
61293
|
+
kinds: ["system"],
|
|
61294
|
+
systemEventKinds: ["alarm-armed"]
|
|
61295
|
+
},
|
|
61296
|
+
{
|
|
61297
|
+
name: "bypassedNames",
|
|
61298
|
+
label: "Bypassed sensors",
|
|
61299
|
+
description: "Sensors the operator armed around because they were open.",
|
|
61300
|
+
example: "Finestra veranda",
|
|
61301
|
+
group: "system",
|
|
61302
|
+
families: ["rule"],
|
|
61303
|
+
fields: [...RULE_TEXT],
|
|
61304
|
+
kinds: ["system"],
|
|
61305
|
+
systemEventKinds: ["alarm-armed", "alarm-arming"]
|
|
61306
|
+
},
|
|
61307
|
+
{
|
|
61308
|
+
name: "coverage",
|
|
61309
|
+
label: "Coverage %",
|
|
61310
|
+
example: "96",
|
|
61311
|
+
group: "digest",
|
|
61312
|
+
families: ["timelapse"],
|
|
61313
|
+
fields: [...RULE_TEXT]
|
|
61314
|
+
},
|
|
61315
|
+
{
|
|
61316
|
+
name: "events",
|
|
61317
|
+
label: "Events",
|
|
61318
|
+
example: "4",
|
|
61319
|
+
group: "digest",
|
|
61320
|
+
families: ["timelapse", "summary"],
|
|
61321
|
+
fields: [...RULE_TEXT]
|
|
61322
|
+
},
|
|
61323
|
+
{
|
|
61324
|
+
name: "detections",
|
|
61325
|
+
label: "Detections",
|
|
61326
|
+
example: "7",
|
|
61327
|
+
group: "digest",
|
|
61328
|
+
families: ["timelapse", "summary"],
|
|
61329
|
+
fields: [...RULE_TEXT]
|
|
61330
|
+
},
|
|
61331
|
+
{
|
|
61332
|
+
name: "count_person",
|
|
61333
|
+
label: "Count of one class",
|
|
61334
|
+
description: "count_<class>, e.g. count_person, count_car.",
|
|
61335
|
+
example: "3",
|
|
61336
|
+
group: "digest",
|
|
61337
|
+
families: ["timelapse", "summary"],
|
|
61338
|
+
fields: [...RULE_TEXT],
|
|
61339
|
+
dynamic: {
|
|
61340
|
+
prefix: "count_",
|
|
61341
|
+
from: "classes"
|
|
61342
|
+
}
|
|
61343
|
+
},
|
|
61344
|
+
{
|
|
61345
|
+
name: "cameras",
|
|
61346
|
+
label: "Cameras",
|
|
61347
|
+
example: "3",
|
|
61348
|
+
group: "digest",
|
|
61349
|
+
families: ["summary"],
|
|
61350
|
+
fields: [...RULE_TEXT]
|
|
61351
|
+
},
|
|
61352
|
+
{
|
|
61353
|
+
name: "matched",
|
|
61354
|
+
label: "Matched events",
|
|
61355
|
+
example: "12",
|
|
61356
|
+
group: "digest",
|
|
61357
|
+
families: ["summary"],
|
|
61358
|
+
fields: [...RULE_TEXT]
|
|
61359
|
+
},
|
|
61360
|
+
{
|
|
61361
|
+
name: "shown",
|
|
61362
|
+
label: "Events shown",
|
|
61363
|
+
example: "9",
|
|
61364
|
+
group: "digest",
|
|
61365
|
+
families: ["summary"],
|
|
61366
|
+
fields: [...RULE_TEXT]
|
|
61367
|
+
},
|
|
61368
|
+
{
|
|
61369
|
+
name: "total",
|
|
61370
|
+
label: "Events total",
|
|
61371
|
+
example: "12",
|
|
61372
|
+
group: "digest",
|
|
61373
|
+
families: ["summary"],
|
|
61374
|
+
fields: [...RULE_TEXT]
|
|
61375
|
+
}
|
|
61376
|
+
];
|
|
61377
|
+
/** The caption fields see a fixed, smaller vocabulary (`timelapsePreviewText`,
|
|
61378
|
+
* `summaryCaptionText`). Declared here rather than as `fields` on every
|
|
61379
|
+
* descriptor so the whole rule stays in one line of code. */
|
|
61380
|
+
var CAPTION_VARS = {
|
|
61381
|
+
previewText: [
|
|
61382
|
+
"camera",
|
|
61383
|
+
"rule",
|
|
61384
|
+
"from",
|
|
61385
|
+
"to"
|
|
61386
|
+
],
|
|
61387
|
+
captionText: [
|
|
61388
|
+
"rule",
|
|
61389
|
+
"from",
|
|
61390
|
+
"to"
|
|
61391
|
+
]
|
|
61392
|
+
};
|
|
61393
|
+
function onAxis(declared, asked) {
|
|
61394
|
+
return declared === void 0 || asked === void 0 || declared.includes(asked);
|
|
61395
|
+
}
|
|
61396
|
+
function onSystemAxis(d, ctx) {
|
|
61397
|
+
if (ctx.kind !== "system" || d.systemEventKinds === void 0) return true;
|
|
61398
|
+
const asked = ctx.systemEventKinds ?? [];
|
|
61399
|
+
return asked.length === 0 || asked.some((k) => d.systemEventKinds?.includes(k) === true);
|
|
61400
|
+
}
|
|
61401
|
+
/**
|
|
61402
|
+
* The variables that have a value in `ctx`, in catalog order. Pure.
|
|
61403
|
+
*
|
|
61404
|
+
* `ctx` is trusted, typed input — untrusted input (a served/RPC boundary) is
|
|
61405
|
+
* validated once against {@link NcTemplateVarContextSchema} at the cap/bridge
|
|
61406
|
+
* boundary, not re-parsed on every call here (Task 4).
|
|
61407
|
+
*/
|
|
61408
|
+
function templateVarsFor(ctx) {
|
|
61409
|
+
if (ctx.field === "previewText" || ctx.field === "captionText") {
|
|
61410
|
+
const allowed = CAPTION_VARS[ctx.field];
|
|
61411
|
+
return NC_TEMPLATE_VARS.filter((d) => d.families.includes(ctx.family) && allowed.includes(d.name) && d.dynamic === void 0);
|
|
61412
|
+
}
|
|
61413
|
+
return NC_TEMPLATE_VARS.filter((d) => d.families.includes(ctx.family) && onAxis(d.fields, ctx.field) && onAxis(d.kinds, ctx.kind) && onAxis(d.deliveries, ctx.delivery) && onSystemAxis(d, ctx));
|
|
61414
|
+
}
|
|
61415
|
+
/** True when `name` is supplied in `ctx`, dynamic families (`count_<class>`) included. */
|
|
61416
|
+
function isKnownTemplateVar(name, ctx) {
|
|
61417
|
+
return templateVarsFor(ctx).some((d) => d.dynamic !== void 0 ? name.startsWith(d.dynamic.prefix) && name.length > d.dynamic.prefix.length : d.name === name);
|
|
61418
|
+
}
|
|
61419
|
+
//#endregion
|
|
60328
61420
|
//#region src/notification/system-event-filters.ts
|
|
60329
61421
|
/** Every filter, for the callers that must cover all four (guards, tests). */
|
|
60330
61422
|
var NC_SYSTEM_EVENT_FILTER_KEYS = [
|
|
@@ -63931,6 +65023,7 @@ exports.NC_HISTORY_LIMIT_DEFAULT = NC_HISTORY_LIMIT_DEFAULT;
|
|
|
63931
65023
|
exports.NC_HISTORY_LIMIT_MAX = NC_HISTORY_LIMIT_MAX;
|
|
63932
65024
|
exports.NC_MAX_PER_TRACK_IMMEDIATE = NC_MAX_PER_TRACK_IMMEDIATE;
|
|
63933
65025
|
exports.NC_OCCUPANCY_DEFAULTS = NC_OCCUPANCY_DEFAULTS;
|
|
65026
|
+
exports.NC_RULE_CLEARABLE_KEYS = NC_RULE_CLEARABLE_KEYS;
|
|
63934
65027
|
exports.NC_RULE_EDITOR_SECTION_ORDER = NC_RULE_EDITOR_SECTION_ORDER;
|
|
63935
65028
|
exports.NC_RULE_KIND_SPECS = NC_RULE_KIND_SPECS;
|
|
63936
65029
|
exports.NC_RULE_SECTIONS = NC_RULE_SECTIONS;
|
|
@@ -63938,6 +65031,7 @@ exports.NC_SNOOZE_MAX_MINUTES = NC_SNOOZE_MAX_MINUTES;
|
|
|
63938
65031
|
exports.NC_SYSTEM_DELIVERY = NC_SYSTEM_DELIVERY;
|
|
63939
65032
|
exports.NC_SYSTEM_EVENT_FILTER_KEYS = NC_SYSTEM_EVENT_FILTER_KEYS;
|
|
63940
65033
|
exports.NC_TAXONOMY = NC_TAXONOMY;
|
|
65034
|
+
exports.NC_TEMPLATE_VARS = NC_TEMPLATE_VARS;
|
|
63941
65035
|
exports.NETWORK_LINK_TYPES = NETWORK_LINK_TYPES;
|
|
63942
65036
|
exports.NETWORK_LINK_UNKNOWN = NETWORK_LINK_UNKNOWN;
|
|
63943
65037
|
exports.NativeCropBboxSchema = NativeCropBboxSchema;
|
|
@@ -63983,6 +65077,7 @@ exports.NcHistoryFilterSchema = NcHistoryFilterSchema;
|
|
|
63983
65077
|
exports.NcHistoryRecordKindSchema = NcHistoryRecordKindSchema;
|
|
63984
65078
|
exports.NcHistoryStatusSchema = NcHistoryStatusSchema;
|
|
63985
65079
|
exports.NcHistorySubjectSchema = NcHistorySubjectSchema;
|
|
65080
|
+
exports.NcLinkedCameraModeSchema = NcLinkedCameraModeSchema;
|
|
63986
65081
|
exports.NcMediaFrameSchema = NcMediaFrameSchema;
|
|
63987
65082
|
exports.NcMediaPolicySchema = NcMediaPolicySchema;
|
|
63988
65083
|
exports.NcOccupancyConditionSchema = NcOccupancyConditionSchema;
|
|
@@ -63990,11 +65085,14 @@ exports.NcPlateMatcherSchema = NcPlateMatcherSchema;
|
|
|
63990
65085
|
exports.NcRuleActionSchema = NcRuleActionSchema;
|
|
63991
65086
|
exports.NcRuleActionSequenceSchema = NcRuleActionSequenceSchema;
|
|
63992
65087
|
exports.NcRuleActionsSchema = NcRuleActionsSchema;
|
|
65088
|
+
exports.NcRuleClearableKeySchema = NcRuleClearableKeySchema;
|
|
63993
65089
|
exports.NcRuleInputSchema = NcRuleInputSchema;
|
|
65090
|
+
exports.NcRuleKindSchema = NcRuleKindSchema;
|
|
63994
65091
|
exports.NcRuleNotificationButtonSchema = NcRuleNotificationButtonSchema;
|
|
63995
65092
|
exports.NcRulePatchSchema = NcRulePatchSchema;
|
|
63996
65093
|
exports.NcRuleSchema = NcRuleSchema;
|
|
63997
65094
|
exports.NcRuleTargetSchema = NcRuleTargetSchema;
|
|
65095
|
+
exports.NcRuleUpdateInputSchema = NcRuleUpdateInputSchema;
|
|
63998
65096
|
exports.NcSceneConditionSchema = NcSceneConditionSchema;
|
|
63999
65097
|
exports.NcScheduleSchema = NcScheduleSchema;
|
|
64000
65098
|
exports.NcScheduleWindowSchema = NcScheduleWindowSchema;
|
|
@@ -64006,6 +65104,13 @@ exports.NcSystemEventConditionSchema = NcSystemEventConditionSchema;
|
|
|
64006
65104
|
exports.NcSystemEventKindSchema = NcSystemEventKindSchema;
|
|
64007
65105
|
exports.NcTaxonomyEntrySchema = NcTaxonomyEntrySchema;
|
|
64008
65106
|
exports.NcTaxonomySchema = NcTaxonomySchema;
|
|
65107
|
+
exports.NcTemplateFamilySchema = NcTemplateFamilySchema;
|
|
65108
|
+
exports.NcTemplateFieldSchema = NcTemplateFieldSchema;
|
|
65109
|
+
exports.NcTemplatePreviewInputSchema = NcTemplatePreviewInputSchema;
|
|
65110
|
+
exports.NcTemplatePreviewSchema = NcTemplatePreviewSchema;
|
|
65111
|
+
exports.NcTemplateVarContextSchema = NcTemplateVarContextSchema;
|
|
65112
|
+
exports.NcTemplateVarDescriptorSchema = NcTemplateVarDescriptorSchema;
|
|
65113
|
+
exports.NcTemplateVarGroupSchema = NcTemplateVarGroupSchema;
|
|
64009
65114
|
exports.NcTestResultSchema = NcTestResultSchema;
|
|
64010
65115
|
exports.NcThrottleGranularitySchema = NcThrottleGranularitySchema;
|
|
64011
65116
|
exports.NcThrottleSchema = NcThrottleSchema;
|
|
@@ -64649,6 +65754,7 @@ exports.evictionPolicyForMode = evictionPolicyForMode;
|
|
|
64649
65754
|
exports.evictionPolicyOfLocation = evictionPolicyOfLocation;
|
|
64650
65755
|
exports.expandAudioChunkToF32le = require_sleep.expandAudioChunkToF32le;
|
|
64651
65756
|
exports.expandCapMethods = require_sleep.expandCapMethods;
|
|
65757
|
+
exports.expandContainer = expandContainer;
|
|
64652
65758
|
exports.exportSubjectOf = exportSubjectOf;
|
|
64653
65759
|
exports.extractNestedAddonId = extractNestedAddonId;
|
|
64654
65760
|
exports.extractSourceInfoFromMetadata = extractSourceInfoFromMetadata;
|
|
@@ -64705,6 +65811,7 @@ exports.isEvent = require_sleep.isEvent;
|
|
|
64705
65811
|
exports.isEventOwnerType = isEventOwnerType;
|
|
64706
65812
|
exports.isFirstLevelMacroClass = isFirstLevelMacroClass;
|
|
64707
65813
|
exports.isIsolatedBuiltin = isIsolatedBuiltin;
|
|
65814
|
+
exports.isKnownTemplateVar = isKnownTemplateVar;
|
|
64708
65815
|
exports.isLocationEnabled = isLocationEnabled;
|
|
64709
65816
|
exports.isMediaOwnerType = isMediaOwnerType;
|
|
64710
65817
|
exports.isNode = isNode;
|
|
@@ -64724,6 +65831,7 @@ exports.jobKindSchema = jobKindSchema;
|
|
|
64724
65831
|
exports.kebabToCamel = kebabToCamel;
|
|
64725
65832
|
exports.knownValues = knownValues;
|
|
64726
65833
|
exports.lawnMowerControlCapability = lawnMowerControlCapability;
|
|
65834
|
+
exports.legacyAutoLinkIds = legacyAutoLinkIds;
|
|
64727
65835
|
exports.legacyModeOf = legacyModeOf;
|
|
64728
65836
|
exports.lifecycleJobSchema = lifecycleJobSchema;
|
|
64729
65837
|
exports.lifecycleJobScopeSchema = lifecycleJobScopeSchema;
|
|
@@ -64943,6 +66051,7 @@ exports.taskLogEntrySchema = taskLogEntrySchema;
|
|
|
64943
66051
|
exports.taskPhaseSchema = taskPhaseSchema;
|
|
64944
66052
|
exports.taskTargetSchema = taskTargetSchema;
|
|
64945
66053
|
exports.temperatureSensorCapability = temperatureSensorCapability;
|
|
66054
|
+
exports.templateVarsFor = templateVarsFor;
|
|
64946
66055
|
exports.terminalSessionCapability = terminalSessionCapability;
|
|
64947
66056
|
exports.textToHtml = textToHtml;
|
|
64948
66057
|
exports.timeOfDayToMinutes = timeOfDayToMinutes;
|