@camstack/addon-post-analysis 1.2.274 → 1.2.275

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.
@@ -5390,7 +5390,7 @@ var ZodIssueCode = {
5390
5390
  var ZodFirstPartyTypeKind;
5391
5391
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5392
5392
  //#endregion
5393
- //#region ../types/dist/sleep-PEo0-Fz9.mjs
5393
+ //#region ../types/dist/sleep-pM_J7YnY.mjs
5394
5394
  /**
5395
5395
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5396
5396
  * window to float samples (D455).
@@ -17432,6 +17432,7 @@ sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
17432
17432
  sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
17433
17433
  sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
17434
17434
  sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
17435
+ sub("cover", "control", "control", "#0ea5e9", "door", "Cover");
17435
17436
  sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
17436
17437
  sub("siren", "control", "control", "#dc2626", "siren", "Siren");
17437
17438
  sub("button", "control", "control", "#10b981", "button", "Button");
@@ -17757,6 +17758,10 @@ var NcSystemEventKindSchema = _enum([
17757
17758
  "alarm-disarmed",
17758
17759
  "alarm-arming",
17759
17760
  "alarm-arm-refused",
17761
+ "alarm-pending",
17762
+ "alarm-rearmed",
17763
+ "alarm-sensor-bypass",
17764
+ "alarm-check-failed",
17760
17765
  "addon-updated",
17761
17766
  "server-updated",
17762
17767
  "export-completed",
@@ -17788,9 +17793,13 @@ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.h
17788
17793
  */
17789
17794
  var NC_ALARM_SYSTEM_EVENT_KINDS = [
17790
17795
  "alarm-arm-refused",
17796
+ "alarm-check-failed",
17791
17797
  "alarm-arming",
17792
17798
  "alarm-armed",
17799
+ "alarm-pending",
17793
17800
  "alarm-triggered",
17801
+ "alarm-rearmed",
17802
+ "alarm-sensor-bypass",
17794
17803
  "alarm-disarmed"
17795
17804
  ];
17796
17805
  /**
@@ -18388,6 +18397,19 @@ var NcMediaFrameSchema = _enum([
18388
18397
  "full",
18389
18398
  "boxed"
18390
18399
  ]);
18400
+ /**
18401
+ * How a SENSOR notification shows the cameras that link the sensor.
18402
+ *
18403
+ * `mosaic` — one image composed of every linked camera's photograph, taken at
18404
+ * the trigger. `each` — one image per camera where the target takes several
18405
+ * attachments; a target that takes one keeps the first camera's (the degrade
18406
+ * engine drops the rest by order). Either way ONE notification per event.
18407
+ * Absent = `mosaic`, applied by the Notification Center and deliberately NOT
18408
+ * a Zod default (see NcRulePatchSchema: a default materialises on every
18409
+ * partial patch). Meaningless for a rule whose subject is not a sensor, and a
18410
+ * sensor linked to one camera ships that camera's plain snapshot either way.
18411
+ */
18412
+ var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
18391
18413
  var NcMediaPolicySchema = object({
18392
18414
  attach: _enum([
18393
18415
  "best",
@@ -18433,7 +18455,9 @@ var NcMediaPolicySchema = object({
18433
18455
  * A profile that is not assigned falls back to the cheapest, and the render
18434
18456
  * reports which one actually ran.
18435
18457
  */
18436
- profile: CamProfileSchema.optional()
18458
+ profile: CamProfileSchema.optional(),
18459
+ /** See {@link NcLinkedCameraModeSchema}. */
18460
+ linkedCameras: NcLinkedCameraModeSchema.optional()
18437
18461
  });
18438
18462
  /**
18439
18463
  * Cooldown GRANULARITY over the subject's class — how much a fired
@@ -18553,7 +18577,7 @@ var NcRuleInputSchema = object({
18553
18577
  cooldownSec: 60,
18554
18578
  scope: "rule-device"
18555
18579
  }),
18556
- /** `{{var}}` templating over camera/class/label/zones/confidence/time. */
18580
+ /** `{{var}}` title/body. The variables are declared in `NC_TEMPLATE_VARS` (@camstack/types) and depend on the rule kind — see `templateVarsFor`. */
18557
18581
  template: object({
18558
18582
  title: string().max(500).optional(),
18559
18583
  body: string().max(2e3).optional()
@@ -18733,6 +18757,22 @@ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
18733
18757
  throttle: NcThrottleSchema.optional(),
18734
18758
  priority: number().int().min(1).max(5).optional()
18735
18759
  });
18760
+ var NcRuleClearableKeySchema = _enum([
18761
+ "template",
18762
+ "schedule",
18763
+ "targetUsers",
18764
+ "snoozeOptions",
18765
+ "snoozeAllowGlobal",
18766
+ "waitForEnhancement",
18767
+ "actions",
18768
+ "confirm",
18769
+ "groupIdleSec"
18770
+ ]);
18771
+ var NcRuleUpdateInputSchema = object({
18772
+ ruleId: string(),
18773
+ patch: NcRulePatchSchema,
18774
+ clear: array(NcRuleClearableKeySchema).optional()
18775
+ });
18736
18776
  /** A persisted rule. */
18737
18777
  var NcRuleSchema = NcRuleInputSchema.extend({
18738
18778
  id: string(),
@@ -18764,6 +18804,85 @@ var NcTestResultSchema = object({
18764
18804
  className: string().optional(),
18765
18805
  label: string().optional()
18766
18806
  });
18807
+ /** The five rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts`
18808
+ * is the same union; the template-vars spec pins the two together. */
18809
+ var NcRuleKindSchema = _enum([
18810
+ "detection",
18811
+ "sensor",
18812
+ "occupancy",
18813
+ "sound",
18814
+ "system"
18815
+ ]);
18816
+ /** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
18817
+ var NcTemplateFamilySchema = _enum([
18818
+ "rule",
18819
+ "timelapse",
18820
+ "summary"
18821
+ ]);
18822
+ /** Which text field of that producer. `previewText` is the timelapse frame
18823
+ * caption, `captionText` the digest mosaic caption — both see fewer vars. */
18824
+ var NcTemplateFieldSchema = _enum([
18825
+ "title",
18826
+ "body",
18827
+ "previewText",
18828
+ "captionText"
18829
+ ]);
18830
+ var NcTemplateVarGroupSchema = _enum([
18831
+ "subject",
18832
+ "place",
18833
+ "time",
18834
+ "rule",
18835
+ "occupancy",
18836
+ "sound",
18837
+ "sensor",
18838
+ "system",
18839
+ "digest",
18840
+ "ai"
18841
+ ]);
18842
+ /**
18843
+ * ONE `{{var}}` a notification template may name.
18844
+ *
18845
+ * `families` / `fields` / `kinds` / `deliveries` / `systemEventKinds` say WHERE
18846
+ * it has a value; absent = no restriction on that axis. `systemEventKinds` is
18847
+ * read only for a `system` rule. `dynamic` declares a FAMILY of names
18848
+ * (`count_<class>`): the descriptor's `name` is the example member.
18849
+ */
18850
+ var NcTemplateVarDescriptorSchema = object({
18851
+ name: string().regex(/^\w+$/),
18852
+ label: string(),
18853
+ description: string().optional(),
18854
+ example: string(),
18855
+ group: NcTemplateVarGroupSchema,
18856
+ families: array(NcTemplateFamilySchema).min(1),
18857
+ fields: array(NcTemplateFieldSchema).optional(),
18858
+ kinds: array(NcRuleKindSchema).optional(),
18859
+ deliveries: array(NcDeliverySchema).optional(),
18860
+ systemEventKinds: array(NcSystemEventKindSchema).optional(),
18861
+ dynamic: object({
18862
+ prefix: literal("count_"),
18863
+ from: literal("classes")
18864
+ }).optional()
18865
+ });
18866
+ /** Input to `previewTemplate` — the editor's own context, plus the draft text. */
18867
+ var NcTemplatePreviewInputSchema = object({
18868
+ context: object({
18869
+ family: NcTemplateFamilySchema,
18870
+ field: NcTemplateFieldSchema,
18871
+ kind: NcRuleKindSchema.optional(),
18872
+ delivery: NcDeliverySchema.optional(),
18873
+ systemEventKinds: array(NcSystemEventKindSchema).optional()
18874
+ }),
18875
+ template: object({
18876
+ title: string().max(500).optional(),
18877
+ body: string().max(2e3).optional()
18878
+ })
18879
+ });
18880
+ var NcTemplatePreviewSchema = object({
18881
+ title: string().nullable(),
18882
+ body: string().nullable(),
18883
+ /** Names the template uses that this context never fills — they render empty. */
18884
+ unknown: array(string())
18885
+ });
18767
18886
  var NcConditionDescriptorSchema = object({
18768
18887
  /** Field id inside `NcConditions` (or `'schedule'` for the rule-level group). */
18769
18888
  id: string(),
@@ -18927,6 +19046,14 @@ var NC_CONDITION_CATALOG = [
18927
19046
  value: "backup-completed",
18928
19047
  label: "Backup completed"
18929
19048
  },
19049
+ {
19050
+ value: "alarm-arm-refused",
19051
+ label: "Alarm arm refused"
19052
+ },
19053
+ {
19054
+ value: "alarm-check-failed",
19055
+ label: "Alarm check failed (armed anyway)"
19056
+ },
18930
19057
  {
18931
19058
  value: "alarm-arming",
18932
19059
  label: "Alarm arming (exit delay)"
@@ -18935,10 +19062,22 @@ var NC_CONDITION_CATALOG = [
18935
19062
  value: "alarm-armed",
18936
19063
  label: "Alarm armed"
18937
19064
  },
19065
+ {
19066
+ value: "alarm-pending",
19067
+ label: "Alarm entry delay started"
19068
+ },
18938
19069
  {
18939
19070
  value: "alarm-triggered",
18940
19071
  label: "Alarm triggered"
18941
19072
  },
19073
+ {
19074
+ value: "alarm-rearmed",
19075
+ label: "Alarm re-armed after siren"
19076
+ },
19077
+ {
19078
+ value: "alarm-sensor-bypass",
19079
+ label: "Alarm sensor bypass"
19080
+ },
18942
19081
  {
18943
19082
  value: "alarm-disarmed",
18944
19083
  label: "Alarm disarmed"
@@ -19489,8 +19628,17 @@ var NcSnoozeSuppressedSchema = object({
19489
19628
  lastAt: number()
19490
19629
  });
19491
19630
  /**
19492
- * The three durations the panel's state machine runs on, plus who hears about
19493
- * an arm.
19631
+ * The per-mode lists, at most one per mode. Two lists for one mode have no
19632
+ * meaning a reader could agree on (union? the last one?), so they are refused
19633
+ * at the boundary rather than interpreted.
19634
+ */
19635
+ var NcAlarmNonBlockingListSchema = array(object({
19636
+ mode: AlarmArmModeSchema,
19637
+ deviceIds: array(number().int()).max(200)
19638
+ })).max(8).refine((lists) => new Set(lists.map((l) => l.mode)).size === lists.length, { message: "nonBlocking: at most one list per arm mode" });
19639
+ /**
19640
+ * The three durations the panel's state machine runs on, who hears about its
19641
+ * transitions, and which openings each mode tolerates.
19494
19642
  *
19495
19643
  * They live on the NOTIFICATION-RULES cap, not on `alarm-panel`, on purpose:
19496
19644
  * `alarm-panel` is `deviceNative` and its other provider mirrors somebody
@@ -19509,21 +19657,39 @@ var NcAlarmSettingsSchema = object({
19509
19657
  * existed, and therefore what an untouched install keeps doing.
19510
19658
  */
19511
19659
  triggeredDurationSec: number().int().min(0).max(3600),
19512
- /** Send a notification when a mode takes effect. */
19513
- announceArm: boolean(),
19514
19660
  /**
19515
- * Where that notification goes. Target ids from `notification-output`.
19661
+ * Deprecated by D630 — every transition is announced. Parsed, never read;
19662
+ * remove after one release. Optional so an older admin's patch (which still
19663
+ * sends it) parses rather than failing the whole save.
19664
+ */
19665
+ announceArm: boolean().optional(),
19666
+ /**
19667
+ * Target ids from `notification-output`: every alarm transition goes here.
19516
19668
  *
19517
- * Explicit rather than "everyone": an arm announcement is a household
19669
+ * Explicit rather than "everyone": an alarm announcement is a household
19518
19670
  * message, and broadcasting it to every configured endpoint (including a
19519
19671
  * webhook wired to something else) is not a default anybody would choose.
19520
- * Empty with `announceArm: true` sends nothing, and the server logs that —
19521
- * silence must be attributable.
19672
+ * Empty sends nothing, and the server logs that — silence must be
19673
+ * attributable.
19522
19674
  */
19523
- announceTargets: array(string().min(1)).max(16)
19675
+ announceTargets: array(string().min(1)).max(16),
19676
+ /**
19677
+ * Per arm mode, the covered devices whose being OPEN does not refuse the
19678
+ * arm (a window left ajar for the cat under `home`, say). At most one entry
19679
+ * per mode is meaningful. Defaulted to `[]` so a blob stored before D630
19680
+ * parses as "every opening blocks" — the behaviour it was written under.
19681
+ */
19682
+ nonBlocking: NcAlarmNonBlockingListSchema.default([])
19524
19683
  });
19525
- /** Every field optional — a tab edits one control at a time. */
19526
- var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
19684
+ /**
19685
+ * Every field optional — a tab edits one control at a time.
19686
+ *
19687
+ * `nonBlocking` is re-declared WITHOUT its default: `.partial()` does not
19688
+ * remove an inner `.default()`, so a patch that never named the field would
19689
+ * parse to `nonBlocking: []` and wipe every mode's list on an unrelated edit
19690
+ * (the same trap {@link NcRulePatchSchema} documents).
19691
+ */
19692
+ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({ nonBlocking: NcAlarmNonBlockingListSchema }).partial();
19527
19693
  /**
19528
19694
  * What one arm mode actually arms, DERIVED from the enabled rules gated on it.
19529
19695
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
@@ -19568,6 +19734,36 @@ var NcAlarmModeCoverageSchema = object({
19568
19734
  */
19569
19735
  skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
19570
19736
  });
19737
+ /** One covered device that reads open, and whether that refuses the arm. */
19738
+ var NcAlarmOpeningSchema = object({
19739
+ deviceId: number().int(),
19740
+ name: string(),
19741
+ /** The device's state word as read (`open`, `unlocked`, …). */
19742
+ state: string(),
19743
+ /** False when the mode's non-blocking list names this device. */
19744
+ blocking: boolean()
19745
+ });
19746
+ /** A device the panel is currently ignoring, and which side of it it is on. */
19747
+ var NcAlarmExclusionViewSchema = object({
19748
+ deviceId: number().int(),
19749
+ name: string(),
19750
+ phase: _enum(["open", "closed"])
19751
+ });
19752
+ /** One mode's openings: devices read open, plus those whose state is unknown. */
19753
+ var NcAlarmModeOpeningsSchema = object({
19754
+ mode: AlarmArmModeSchema,
19755
+ devices: array(NcAlarmOpeningSchema),
19756
+ /** Covered devices whose state could not be read (D49): neither open nor closed. */
19757
+ unknown: array(number().int())
19758
+ });
19759
+ var NcAlarmLiveSchema = object({
19760
+ state: AlarmStateSchema,
19761
+ /** The mode being armed into (exit delay) or held; null when disarmed. */
19762
+ targetMode: AlarmArmModeSchema.nullable(),
19763
+ availableModes: array(AlarmArmModeSchema),
19764
+ openings: array(NcAlarmModeOpeningsSchema),
19765
+ exclusions: array(NcAlarmExclusionViewSchema)
19766
+ });
19571
19767
  var NcAlarmConfigSchema = object({
19572
19768
  /**
19573
19769
  * The panel's device id, or null when this install has no panel (the ensure
@@ -19577,7 +19773,13 @@ var NcAlarmConfigSchema = object({
19577
19773
  */
19578
19774
  deviceId: number().int().nullable(),
19579
19775
  settings: NcAlarmSettingsSchema,
19580
- coverage: array(NcAlarmModeCoverageSchema)
19776
+ coverage: array(NcAlarmModeCoverageSchema),
19777
+ /**
19778
+ * The panel as it is NOW — state, what each mode would find open, what is
19779
+ * excluded. Optional: a panel-less hub answers without it, and a client
19780
+ * must not read its absence as "nothing is open".
19781
+ */
19782
+ live: NcAlarmLiveSchema.optional()
19581
19783
  });
19582
19784
  /**
19583
19785
  * ONE rule's demand on ONE camera's clip ring.
@@ -19633,10 +19835,7 @@ var notificationRulesCapability = {
19633
19835
  auth: "admin",
19634
19836
  caller: "required"
19635
19837
  }),
19636
- updateRule: method(object({
19637
- ruleId: string(),
19638
- patch: NcRulePatchSchema
19639
- }), object({ rule: NcRuleSchema }), {
19838
+ updateRule: method(NcRuleUpdateInputSchema, object({ rule: NcRuleSchema }), {
19640
19839
  kind: "mutation",
19641
19840
  auth: "admin",
19642
19841
  caller: "required"
@@ -19724,6 +19923,18 @@ var notificationRulesCapability = {
19724
19923
  catalog: array(NcConditionDescriptorSchema),
19725
19924
  taxonomy: NcTaxonomySchema.optional()
19726
19925
  })),
19926
+ /** The declared `{{var}}` vocabulary; editors filter it with `templateVarsFor`. */
19927
+ getTemplateCatalog: method(object({}), object({ vars: array(NcTemplateVarDescriptorSchema) })),
19928
+ /**
19929
+ * Render a template with example values, through the hub's text catalog.
19930
+ * Pure: sends nothing. A MUTATION only for transport — a 2.5k-char draft in
19931
+ * a batched GET URL risks length limits — so access stays `view`, the same
19932
+ * as `getTemplateCatalog`.
19933
+ */
19934
+ previewTemplate: method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
19935
+ kind: "mutation",
19936
+ access: "view"
19937
+ }),
19727
19938
  /**
19728
19939
  * Queryable delivery history — a read-only view over the durable outbox
19729
19940
  * (fired rule, subject summary, target, status, timestamps, error on a
@@ -19778,7 +19989,10 @@ var notificationRulesCapability = {
19778
19989
  caller: "required"
19779
19990
  }),
19780
19991
  /**
19781
- * The alarm panel's durations, plus what each mode ACTUALLY arms.
19992
+ * The alarm panel's settings, what each mode ACTUALLY arms, and — when a
19993
+ * panel exists — its `live` state: current state and target mode, what
19994
+ * each mode would find open (blocking or not, and what is unknown), and
19995
+ * the devices currently excluded.
19782
19996
  *
19783
19997
  * Coverage is returned by the same call as the settings on purpose: they
19784
19998
  * are read together or not at all. An editor that showed the delays
@@ -19788,7 +20002,9 @@ var notificationRulesCapability = {
19788
20002
  */
19789
20003
  getAlarmConfig: method(object({}), NcAlarmConfigSchema, { auth: "admin" }),
19790
20004
  /**
19791
- * Patch the durations. Returns the WHOLE config, coverage included, so a
20005
+ * Patch the settings (durations, recipients, per-mode non-blocking lists;
20006
+ * `announceArm` is accepted and ignored — D630). Returns the WHOLE config,
20007
+ * coverage and `live` included, so a
19792
20008
  * client never has to guess what the server settled on — the panel clamps
19793
20009
  * and normalises, and a form that re-rendered from its own input would
19794
20010
  * show a value the alarm is not using.
@@ -24938,6 +25154,7 @@ var CAP_TO_KIND = {
24938
25154
  "enum-sensor": "enum-sensor",
24939
25155
  "event-emitter": "device-event",
24940
25156
  "lock-control": "lock",
25157
+ cover: "cover",
24941
25158
  switch: "switch",
24942
25159
  button: "button",
24943
25160
  doorbell: "doorbell"
@@ -38221,9 +38438,8 @@ var DEVICE_STATE_READERS = [
38221
38438
  field: "state"
38222
38439
  },
38223
38440
  {
38224
- cap: "lock",
38225
- field: "locked",
38226
- booleanWords: ["locked", "unlocked"]
38441
+ cap: "lock-control",
38442
+ field: "state"
38227
38443
  },
38228
38444
  {
38229
38445
  cap: "contact",
@@ -44313,6 +44529,12 @@ Object.freeze({
44313
44529
  addonId: null,
44314
44530
  access: "view"
44315
44531
  },
44532
+ "notificationRules.getTemplateCatalog": {
44533
+ capName: "notification-rules",
44534
+ capScope: "system",
44535
+ addonId: null,
44536
+ access: "view"
44537
+ },
44316
44538
  "notificationRules.listDeviceMutes": {
44317
44539
  capName: "notification-rules",
44318
44540
  capScope: "system",
@@ -44331,6 +44553,12 @@ Object.freeze({
44331
44553
  addonId: null,
44332
44554
  access: "view"
44333
44555
  },
44556
+ "notificationRules.previewTemplate": {
44557
+ capName: "notification-rules",
44558
+ capScope: "system",
44559
+ addonId: null,
44560
+ access: "view"
44561
+ },
44334
44562
  "notificationRules.resolveArtifactUrl": {
44335
44563
  capName: "notification-rules",
44336
44564
  capScope: "system",
@@ -49978,6 +50206,759 @@ function isScheduleActive(schedule, atMs) {
49978
50206
  }
49979
50207
  return schedule.invert === true ? !inside : inside;
49980
50208
  }
50209
+ var RULE_BODY_ONLY = ["body"];
50210
+ var RULE_TEXT = ["title", "body"];
50211
+ var BATTERY = ["device-battery-low", "device-battery-normal"];
50212
+ var CONSUMABLE = ["device-consumable-low", "device-consumable-normal"];
50213
+ var UPDATES = [
50214
+ "addon-update-available",
50215
+ "server-update-available",
50216
+ "wrapper-update-available"
50217
+ ];
50218
+ var PACKAGE_UPDATES = ["addon-update-available", "server-update-available"];
50219
+ var ALARM = [
50220
+ "alarm-triggered",
50221
+ "alarm-armed",
50222
+ "alarm-disarmed",
50223
+ "alarm-arming",
50224
+ "alarm-arm-refused"
50225
+ ];
50226
+ var COMBINED_ALARM = ["alarm-triggered"];
50227
+ var DEVICE_EVENTS = [
50228
+ "device-online",
50229
+ "device-offline",
50230
+ "device-disabled",
50231
+ "device-enabled",
50232
+ ...BATTERY,
50233
+ ...CONSUMABLE,
50234
+ "stream-online",
50235
+ "stream-offline",
50236
+ "detection-blind",
50237
+ ...ALARM
50238
+ ];
50239
+ var NC_TEMPLATE_VARS = [
50240
+ {
50241
+ name: "camera",
50242
+ label: "Camera",
50243
+ example: "Ingresso",
50244
+ group: "subject",
50245
+ families: ["rule", "timelapse"],
50246
+ systemEventKinds: [...DEVICE_EVENTS, "export-completed"]
50247
+ },
50248
+ {
50249
+ name: "class",
50250
+ label: "Detected class",
50251
+ description: "The counted class on an occupancy row (e.g. \"person\"); the detected class elsewhere.",
50252
+ example: "person",
50253
+ group: "subject",
50254
+ families: ["rule"],
50255
+ fields: [...RULE_TEXT],
50256
+ kinds: [
50257
+ "detection",
50258
+ "sensor",
50259
+ "sound",
50260
+ "occupancy",
50261
+ "system"
50262
+ ],
50263
+ systemEventKinds: [...COMBINED_ALARM]
50264
+ },
50265
+ {
50266
+ name: "label",
50267
+ label: "Name or plate",
50268
+ description: "Recognised person or read plate; empty otherwise.",
50269
+ example: "Mario",
50270
+ group: "subject",
50271
+ families: ["rule"],
50272
+ fields: [...RULE_TEXT],
50273
+ kinds: ["detection", "system"],
50274
+ systemEventKinds: [...COMBINED_ALARM]
50275
+ },
50276
+ {
50277
+ name: "subject",
50278
+ label: "Subject sentence",
50279
+ description: "Composed in the notification language, e.g. \"person (Mario)\".",
50280
+ example: "persona (Mario)",
50281
+ group: "subject",
50282
+ families: ["rule"],
50283
+ fields: [...RULE_TEXT],
50284
+ kinds: [
50285
+ "detection",
50286
+ "sensor",
50287
+ "sound",
50288
+ "occupancy"
50289
+ ]
50290
+ },
50291
+ {
50292
+ name: "confidence",
50293
+ label: "Confidence",
50294
+ example: "87%",
50295
+ group: "subject",
50296
+ families: ["rule"],
50297
+ fields: [...RULE_TEXT],
50298
+ kinds: ["detection", "system"],
50299
+ systemEventKinds: [...COMBINED_ALARM]
50300
+ },
50301
+ {
50302
+ name: "count",
50303
+ label: "Count",
50304
+ description: "Occupancy count, subjects in a grouped notification, or the event count of a system notice.",
50305
+ example: "3",
50306
+ group: "subject",
50307
+ families: ["rule"],
50308
+ fields: [...RULE_TEXT],
50309
+ kinds: [
50310
+ "detection",
50311
+ "occupancy",
50312
+ "system"
50313
+ ],
50314
+ systemEventKinds: [
50315
+ "addon-crash-loop",
50316
+ ...PACKAGE_UPDATES,
50317
+ "addon-updated"
50318
+ ]
50319
+ },
50320
+ {
50321
+ name: "detectionSummary",
50322
+ label: "Detection summary",
50323
+ description: "Class composition, e.g. \"2 persons and 1 car\".",
50324
+ example: "2 persone e 1 auto",
50325
+ group: "subject",
50326
+ families: [
50327
+ "rule",
50328
+ "timelapse",
50329
+ "summary"
50330
+ ],
50331
+ fields: [...RULE_TEXT],
50332
+ kinds: ["detection"]
50333
+ },
50334
+ {
50335
+ name: "zones",
50336
+ label: "Zones",
50337
+ example: "Cancello, Vialetto",
50338
+ group: "place",
50339
+ families: ["rule"],
50340
+ fields: [...RULE_TEXT],
50341
+ kinds: ["detection", "system"],
50342
+ systemEventKinds: [...COMBINED_ALARM]
50343
+ },
50344
+ {
50345
+ name: "zone",
50346
+ label: "Zone",
50347
+ example: "Cancello",
50348
+ group: "place",
50349
+ families: ["rule"],
50350
+ fields: [...RULE_TEXT],
50351
+ kinds: [
50352
+ "detection",
50353
+ "occupancy",
50354
+ "system"
50355
+ ],
50356
+ systemEventKinds: [...COMBINED_ALARM]
50357
+ },
50358
+ {
50359
+ name: "inZones",
50360
+ label: "\"in <zones>\" fragment",
50361
+ description: "Leading space included; empty when no zone.",
50362
+ example: " in Cancello",
50363
+ group: "place",
50364
+ families: ["rule"],
50365
+ fields: [...RULE_TEXT],
50366
+ kinds: ["detection", "system"],
50367
+ systemEventKinds: [...COMBINED_ALARM]
50368
+ },
50369
+ {
50370
+ name: "scope",
50371
+ label: "Occupancy scope",
50372
+ example: "Cancello",
50373
+ group: "place",
50374
+ families: ["rule"],
50375
+ fields: [...RULE_TEXT],
50376
+ kinds: ["occupancy"]
50377
+ },
50378
+ {
50379
+ name: "time",
50380
+ label: "Time",
50381
+ description: "Hours and minutes, in the notification language.",
50382
+ example: "20:05",
50383
+ group: "time",
50384
+ families: [
50385
+ "rule",
50386
+ "timelapse",
50387
+ "summary"
50388
+ ],
50389
+ fields: [...RULE_TEXT]
50390
+ },
50391
+ {
50392
+ name: "rule",
50393
+ label: "Rule name",
50394
+ example: "Ingresso notte",
50395
+ group: "rule",
50396
+ families: [
50397
+ "rule",
50398
+ "timelapse",
50399
+ "summary"
50400
+ ]
50401
+ },
50402
+ {
50403
+ name: "from",
50404
+ label: "Window start",
50405
+ example: "07:00",
50406
+ group: "time",
50407
+ families: ["timelapse", "summary"]
50408
+ },
50409
+ {
50410
+ name: "to",
50411
+ label: "Window end",
50412
+ example: "08:00",
50413
+ group: "time",
50414
+ families: ["timelapse", "summary"]
50415
+ },
50416
+ {
50417
+ name: "capacity",
50418
+ label: "Capacity",
50419
+ example: "2",
50420
+ group: "occupancy",
50421
+ families: ["rule"],
50422
+ fields: [...RULE_TEXT],
50423
+ kinds: ["occupancy"]
50424
+ },
50425
+ {
50426
+ name: "op",
50427
+ label: "Occupied / free",
50428
+ example: "occupata",
50429
+ group: "occupancy",
50430
+ families: ["rule"],
50431
+ fields: [...RULE_TEXT],
50432
+ kinds: ["occupancy"]
50433
+ },
50434
+ {
50435
+ name: "sounds",
50436
+ label: "Sounds heard",
50437
+ example: "abbaio, clacson",
50438
+ group: "sound",
50439
+ families: ["rule"],
50440
+ fields: [...RULE_TEXT],
50441
+ kinds: ["sound"]
50442
+ },
50443
+ {
50444
+ name: "hitPercent",
50445
+ label: "Share of the window",
50446
+ description: "Level mode only: percentage of samples above the threshold.",
50447
+ example: "42",
50448
+ group: "sound",
50449
+ families: ["rule"],
50450
+ fields: [...RULE_TEXT],
50451
+ kinds: ["sound"]
50452
+ },
50453
+ {
50454
+ name: "db",
50455
+ label: "Peak level (dBFS)",
50456
+ example: "-18",
50457
+ group: "sound",
50458
+ families: ["rule"],
50459
+ fields: [...RULE_TEXT],
50460
+ kinds: ["sound"]
50461
+ },
50462
+ {
50463
+ name: "eventType",
50464
+ label: "Event type",
50465
+ description: "Raw device event token, e.g. \"press\" or \"open\"; empty when the device sends none.",
50466
+ example: "press",
50467
+ group: "sensor",
50468
+ families: ["rule"],
50469
+ fields: [...RULE_TEXT],
50470
+ kinds: ["sensor"]
50471
+ },
50472
+ {
50473
+ name: "ai",
50474
+ label: "AI sentence",
50475
+ description: "Where the AI description goes; appended on its own line when absent.",
50476
+ example: "Una persona lascia un pacco.",
50477
+ group: "ai",
50478
+ families: ["rule", "summary"],
50479
+ fields: [...RULE_BODY_ONLY],
50480
+ kinds: ["detection", "occupancy"]
50481
+ },
50482
+ {
50483
+ name: "eventKind",
50484
+ label: "Event kind",
50485
+ example: "device-offline",
50486
+ group: "system",
50487
+ families: ["rule"],
50488
+ fields: [...RULE_TEXT],
50489
+ kinds: ["system"]
50490
+ },
50491
+ {
50492
+ name: "deviceName",
50493
+ label: "Device",
50494
+ example: "Ingresso",
50495
+ group: "system",
50496
+ families: ["rule"],
50497
+ fields: [...RULE_TEXT],
50498
+ kinds: ["system"],
50499
+ systemEventKinds: [...DEVICE_EVENTS]
50500
+ },
50501
+ {
50502
+ name: "deviceId",
50503
+ label: "Device id",
50504
+ example: "617",
50505
+ group: "system",
50506
+ families: ["rule"],
50507
+ fields: [...RULE_TEXT],
50508
+ kinds: ["system"],
50509
+ systemEventKinds: [...DEVICE_EVENTS, "export-completed"]
50510
+ },
50511
+ {
50512
+ name: "percentage",
50513
+ label: "Percentage",
50514
+ example: "15",
50515
+ group: "system",
50516
+ families: ["rule"],
50517
+ fields: [...RULE_TEXT],
50518
+ kinds: ["system"],
50519
+ systemEventKinds: [...BATTERY, ...CONSUMABLE]
50520
+ },
50521
+ {
50522
+ name: "item",
50523
+ label: "Consumable",
50524
+ example: "Filtro",
50525
+ group: "system",
50526
+ families: ["rule"],
50527
+ fields: [...RULE_TEXT],
50528
+ kinds: ["system"],
50529
+ systemEventKinds: [...CONSUMABLE]
50530
+ },
50531
+ {
50532
+ name: "profile",
50533
+ label: "Stream profile",
50534
+ example: "high",
50535
+ group: "system",
50536
+ families: ["rule"],
50537
+ fields: [...RULE_TEXT],
50538
+ kinds: ["system"],
50539
+ systemEventKinds: ["stream-online", "stream-offline"]
50540
+ },
50541
+ {
50542
+ name: "node",
50543
+ label: "Node",
50544
+ example: "hub",
50545
+ group: "system",
50546
+ families: ["rule"],
50547
+ fields: [...RULE_TEXT],
50548
+ kinds: ["system"],
50549
+ systemEventKinds: [
50550
+ "node-online",
50551
+ "node-offline",
50552
+ "node-inference-unavailable",
50553
+ "addon-crash-loop",
50554
+ ...UPDATES,
50555
+ "addon-updated",
50556
+ "server-updated"
50557
+ ]
50558
+ },
50559
+ {
50560
+ name: "nodeId",
50561
+ label: "Node id",
50562
+ example: "hub",
50563
+ group: "system",
50564
+ families: ["rule"],
50565
+ fields: [...RULE_TEXT],
50566
+ kinds: ["system"],
50567
+ systemEventKinds: [
50568
+ "node-online",
50569
+ "node-offline",
50570
+ "node-inference-unavailable",
50571
+ "addon-crash-loop",
50572
+ ...UPDATES,
50573
+ "server-updated"
50574
+ ]
50575
+ },
50576
+ {
50577
+ name: "devices",
50578
+ label: "Devices",
50579
+ description: "node-inference-unavailable: the affected cameras, comma-joined. Alarm arm / refusal: HOW MANY devices are armed (or open).",
50580
+ example: "Ingresso, Garage",
50581
+ group: "system",
50582
+ families: ["rule"],
50583
+ fields: [...RULE_TEXT],
50584
+ kinds: ["system"],
50585
+ systemEventKinds: [
50586
+ "node-inference-unavailable",
50587
+ "alarm-armed",
50588
+ "alarm-arm-refused"
50589
+ ]
50590
+ },
50591
+ {
50592
+ name: "addons",
50593
+ label: "Addons",
50594
+ example: "stream-broker",
50595
+ group: "system",
50596
+ families: ["rule"],
50597
+ fields: [...RULE_TEXT],
50598
+ kinds: ["system"],
50599
+ systemEventKinds: ["addon-crash-loop"]
50600
+ },
50601
+ {
50602
+ name: "minutes",
50603
+ label: "Minutes",
50604
+ example: "12",
50605
+ group: "system",
50606
+ families: ["rule"],
50607
+ fields: [...RULE_TEXT],
50608
+ kinds: ["system"],
50609
+ systemEventKinds: ["detection-blind"]
50610
+ },
50611
+ {
50612
+ name: "package",
50613
+ label: "Package",
50614
+ example: "@camstack/addon-recorder",
50615
+ group: "system",
50616
+ families: ["rule"],
50617
+ fields: [...RULE_TEXT],
50618
+ kinds: ["system"],
50619
+ systemEventKinds: [
50620
+ ...UPDATES,
50621
+ "addon-updated",
50622
+ "server-updated"
50623
+ ]
50624
+ },
50625
+ {
50626
+ name: "packageName",
50627
+ label: "Package",
50628
+ example: "@camstack/addon-recorder",
50629
+ group: "system",
50630
+ families: ["rule"],
50631
+ fields: [...RULE_TEXT],
50632
+ kinds: ["system"],
50633
+ systemEventKinds: [...PACKAGE_UPDATES, "server-updated"]
50634
+ },
50635
+ {
50636
+ name: "nodes",
50637
+ label: "Nodes",
50638
+ 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.",
50639
+ example: "hub, little-unraid",
50640
+ group: "system",
50641
+ families: ["rule"],
50642
+ fields: [...RULE_TEXT],
50643
+ kinds: ["system"],
50644
+ systemEventKinds: [...PACKAGE_UPDATES]
50645
+ },
50646
+ {
50647
+ name: "currentVersion",
50648
+ label: "Current version",
50649
+ example: "1.2.377",
50650
+ group: "system",
50651
+ families: ["rule"],
50652
+ fields: [...RULE_TEXT],
50653
+ kinds: ["system"],
50654
+ systemEventKinds: [...UPDATES]
50655
+ },
50656
+ {
50657
+ name: "latestVersion",
50658
+ label: "Latest version",
50659
+ example: "1.2.378",
50660
+ group: "system",
50661
+ families: ["rule"],
50662
+ fields: [...RULE_TEXT],
50663
+ kinds: ["system"],
50664
+ systemEventKinds: [...UPDATES]
50665
+ },
50666
+ {
50667
+ name: "list",
50668
+ label: "Updated packages",
50669
+ 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.",
50670
+ example: "recorder, notifiers",
50671
+ group: "system",
50672
+ families: ["rule"],
50673
+ fields: [...RULE_TEXT],
50674
+ kinds: ["system"],
50675
+ systemEventKinds: [...PACKAGE_UPDATES, "addon-updated"]
50676
+ },
50677
+ {
50678
+ name: "fromVersion",
50679
+ label: "From version",
50680
+ example: "1.2.377",
50681
+ group: "system",
50682
+ families: ["rule"],
50683
+ fields: [...RULE_TEXT],
50684
+ kinds: ["system"],
50685
+ systemEventKinds: ["server-updated"]
50686
+ },
50687
+ {
50688
+ name: "toVersion",
50689
+ label: "To version",
50690
+ example: "1.2.378",
50691
+ group: "system",
50692
+ families: ["rule"],
50693
+ fields: [...RULE_TEXT],
50694
+ kinds: ["system"],
50695
+ systemEventKinds: ["server-updated"]
50696
+ },
50697
+ {
50698
+ name: "destinationsOk",
50699
+ label: "Destinations ok",
50700
+ example: "2",
50701
+ group: "system",
50702
+ families: ["rule"],
50703
+ fields: [...RULE_TEXT],
50704
+ kinds: ["system"],
50705
+ systemEventKinds: ["backup-completed"]
50706
+ },
50707
+ {
50708
+ name: "destinationsTotal",
50709
+ label: "Destinations",
50710
+ example: "2",
50711
+ group: "system",
50712
+ families: ["rule"],
50713
+ fields: [...RULE_TEXT],
50714
+ kinds: ["system"],
50715
+ systemEventKinds: ["backup-completed"]
50716
+ },
50717
+ {
50718
+ name: "destinationsFailed",
50719
+ label: "Destinations failed",
50720
+ example: "0",
50721
+ group: "system",
50722
+ families: ["rule"],
50723
+ fields: [...RULE_TEXT],
50724
+ kinds: ["system"],
50725
+ systemEventKinds: ["backup-completed"]
50726
+ },
50727
+ {
50728
+ name: "sizeMB",
50729
+ label: "Size (MB)",
50730
+ example: "412",
50731
+ group: "system",
50732
+ families: ["rule"],
50733
+ fields: [...RULE_TEXT],
50734
+ kinds: ["system"],
50735
+ systemEventKinds: ["backup-completed"]
50736
+ },
50737
+ {
50738
+ name: "backupId",
50739
+ label: "Backup id",
50740
+ example: "bk-20260924",
50741
+ group: "system",
50742
+ families: ["rule"],
50743
+ fields: [...RULE_TEXT],
50744
+ kinds: ["system"],
50745
+ systemEventKinds: ["backup-completed"]
50746
+ },
50747
+ {
50748
+ name: "title",
50749
+ label: "Export title",
50750
+ example: "Ingresso 08:00",
50751
+ group: "system",
50752
+ families: ["rule"],
50753
+ fields: [...RULE_TEXT],
50754
+ kinds: ["system"],
50755
+ systemEventKinds: ["export-completed"]
50756
+ },
50757
+ {
50758
+ name: "exportId",
50759
+ label: "Export id",
50760
+ example: "exp-20260924",
50761
+ group: "system",
50762
+ families: ["rule"],
50763
+ fields: [...RULE_TEXT],
50764
+ kinds: ["system"],
50765
+ systemEventKinds: ["export-completed"]
50766
+ },
50767
+ {
50768
+ name: "bytes",
50769
+ label: "Export size (bytes)",
50770
+ example: "10485760",
50771
+ group: "system",
50772
+ families: ["rule"],
50773
+ fields: [...RULE_TEXT],
50774
+ kinds: ["system"],
50775
+ systemEventKinds: ["export-completed"]
50776
+ },
50777
+ {
50778
+ name: "mode",
50779
+ label: "Alarm mode",
50780
+ example: "away",
50781
+ group: "system",
50782
+ families: ["rule"],
50783
+ fields: [...RULE_TEXT],
50784
+ kinds: ["system"],
50785
+ systemEventKinds: [
50786
+ "alarm-armed",
50787
+ "alarm-arming",
50788
+ "alarm-arm-refused"
50789
+ ]
50790
+ },
50791
+ {
50792
+ name: "seconds",
50793
+ label: "Seconds",
50794
+ description: "Arming: the exit delay left. Refusal: how long the retry-to-arm-anyway lasts.",
50795
+ example: "30",
50796
+ group: "system",
50797
+ families: ["rule"],
50798
+ fields: [...RULE_TEXT],
50799
+ kinds: ["system"],
50800
+ systemEventKinds: ["alarm-arming", "alarm-arm-refused"]
50801
+ },
50802
+ {
50803
+ name: "rules",
50804
+ label: "Covering rules",
50805
+ description: "How many enabled rules the armed mode gates.",
50806
+ example: "2",
50807
+ group: "system",
50808
+ families: ["rule"],
50809
+ fields: [...RULE_TEXT],
50810
+ kinds: ["system"],
50811
+ systemEventKinds: ["alarm-armed"]
50812
+ },
50813
+ {
50814
+ name: "names",
50815
+ label: "Device names",
50816
+ description: "Armed: the devices armed. Arming: the devices this mode cannot arm. Refusal: the open sensors.",
50817
+ example: "Ingresso, Garage",
50818
+ group: "system",
50819
+ families: ["rule"],
50820
+ fields: [...RULE_TEXT],
50821
+ kinds: ["system"],
50822
+ systemEventKinds: [
50823
+ "alarm-armed",
50824
+ "alarm-arming",
50825
+ "alarm-arm-refused"
50826
+ ]
50827
+ },
50828
+ {
50829
+ name: "skippedNames",
50830
+ label: "Skipped devices",
50831
+ description: "Devices the mode names but cannot arm (muted, detection off, offline).",
50832
+ example: "Garage",
50833
+ group: "system",
50834
+ families: ["rule"],
50835
+ fields: [...RULE_TEXT],
50836
+ kinds: ["system"],
50837
+ systemEventKinds: ["alarm-armed"]
50838
+ },
50839
+ {
50840
+ name: "bypassedNames",
50841
+ label: "Bypassed sensors",
50842
+ description: "Sensors the operator armed around because they were open.",
50843
+ example: "Finestra veranda",
50844
+ group: "system",
50845
+ families: ["rule"],
50846
+ fields: [...RULE_TEXT],
50847
+ kinds: ["system"],
50848
+ systemEventKinds: ["alarm-armed", "alarm-arming"]
50849
+ },
50850
+ {
50851
+ name: "coverage",
50852
+ label: "Coverage %",
50853
+ example: "96",
50854
+ group: "digest",
50855
+ families: ["timelapse"],
50856
+ fields: [...RULE_TEXT]
50857
+ },
50858
+ {
50859
+ name: "events",
50860
+ label: "Events",
50861
+ example: "4",
50862
+ group: "digest",
50863
+ families: ["timelapse", "summary"],
50864
+ fields: [...RULE_TEXT]
50865
+ },
50866
+ {
50867
+ name: "detections",
50868
+ label: "Detections",
50869
+ example: "7",
50870
+ group: "digest",
50871
+ families: ["timelapse", "summary"],
50872
+ fields: [...RULE_TEXT]
50873
+ },
50874
+ {
50875
+ name: "count_person",
50876
+ label: "Count of one class",
50877
+ description: "count_<class>, e.g. count_person, count_car.",
50878
+ example: "3",
50879
+ group: "digest",
50880
+ families: ["timelapse", "summary"],
50881
+ fields: [...RULE_TEXT],
50882
+ dynamic: {
50883
+ prefix: "count_",
50884
+ from: "classes"
50885
+ }
50886
+ },
50887
+ {
50888
+ name: "cameras",
50889
+ label: "Cameras",
50890
+ example: "3",
50891
+ group: "digest",
50892
+ families: ["summary"],
50893
+ fields: [...RULE_TEXT]
50894
+ },
50895
+ {
50896
+ name: "matched",
50897
+ label: "Matched events",
50898
+ example: "12",
50899
+ group: "digest",
50900
+ families: ["summary"],
50901
+ fields: [...RULE_TEXT]
50902
+ },
50903
+ {
50904
+ name: "shown",
50905
+ label: "Events shown",
50906
+ example: "9",
50907
+ group: "digest",
50908
+ families: ["summary"],
50909
+ fields: [...RULE_TEXT]
50910
+ },
50911
+ {
50912
+ name: "total",
50913
+ label: "Events total",
50914
+ example: "12",
50915
+ group: "digest",
50916
+ families: ["summary"],
50917
+ fields: [...RULE_TEXT]
50918
+ }
50919
+ ];
50920
+ /** The caption fields see a fixed, smaller vocabulary (`timelapsePreviewText`,
50921
+ * `summaryCaptionText`). Declared here rather than as `fields` on every
50922
+ * descriptor so the whole rule stays in one line of code. */
50923
+ var CAPTION_VARS = {
50924
+ previewText: [
50925
+ "camera",
50926
+ "rule",
50927
+ "from",
50928
+ "to"
50929
+ ],
50930
+ captionText: [
50931
+ "rule",
50932
+ "from",
50933
+ "to"
50934
+ ]
50935
+ };
50936
+ function onAxis(declared, asked) {
50937
+ return declared === void 0 || asked === void 0 || declared.includes(asked);
50938
+ }
50939
+ function onSystemAxis(d, ctx) {
50940
+ if (ctx.kind !== "system" || d.systemEventKinds === void 0) return true;
50941
+ const asked = ctx.systemEventKinds ?? [];
50942
+ return asked.length === 0 || asked.some((k) => d.systemEventKinds?.includes(k) === true);
50943
+ }
50944
+ /**
50945
+ * The variables that have a value in `ctx`, in catalog order. Pure.
50946
+ *
50947
+ * `ctx` is trusted, typed input — untrusted input (a served/RPC boundary) is
50948
+ * validated once against {@link NcTemplateVarContextSchema} at the cap/bridge
50949
+ * boundary, not re-parsed on every call here (Task 4).
50950
+ */
50951
+ function templateVarsFor(ctx) {
50952
+ if (ctx.field === "previewText" || ctx.field === "captionText") {
50953
+ const allowed = CAPTION_VARS[ctx.field];
50954
+ return NC_TEMPLATE_VARS.filter((d) => d.families.includes(ctx.family) && allowed.includes(d.name) && d.dynamic === void 0);
50955
+ }
50956
+ 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));
50957
+ }
50958
+ /** True when `name` is supplied in `ctx`, dynamic families (`count_<class>`) included. */
50959
+ function isKnownTemplateVar(name, ctx) {
50960
+ return templateVarsFor(ctx).some((d) => d.dynamic !== void 0 ? name.startsWith(d.dynamic.prefix) && name.length > d.dynamic.prefix.length : d.name === name);
50961
+ }
49981
50962
  /**
49982
50963
  * Does `filter` say anything about `kind`?
49983
50964
  *
@@ -51188,6 +52169,12 @@ Object.defineProperty(exports, "NC_TAXONOMY", {
51188
52169
  return NC_TAXONOMY;
51189
52170
  }
51190
52171
  });
52172
+ Object.defineProperty(exports, "NC_TEMPLATE_VARS", {
52173
+ enumerable: true,
52174
+ get: function() {
52175
+ return NC_TEMPLATE_VARS;
52176
+ }
52177
+ });
51191
52178
  Object.defineProperty(exports, "NcConditionDescriptorSchema", {
51192
52179
  enumerable: true,
51193
52180
  get: function() {
@@ -51218,6 +52205,12 @@ Object.defineProperty(exports, "NcRuleTargetSchema", {
51218
52205
  return NcRuleTargetSchema;
51219
52206
  }
51220
52207
  });
52208
+ Object.defineProperty(exports, "NcRuleUpdateInputSchema", {
52209
+ enumerable: true,
52210
+ get: function() {
52211
+ return NcRuleUpdateInputSchema;
52212
+ }
52213
+ });
51221
52214
  Object.defineProperty(exports, "NcScheduleSchema", {
51222
52215
  enumerable: true,
51223
52216
  get: function() {
@@ -51254,6 +52247,24 @@ Object.defineProperty(exports, "NcTaxonomySchema", {
51254
52247
  return NcTaxonomySchema;
51255
52248
  }
51256
52249
  });
52250
+ Object.defineProperty(exports, "NcTemplatePreviewInputSchema", {
52251
+ enumerable: true,
52252
+ get: function() {
52253
+ return NcTemplatePreviewInputSchema;
52254
+ }
52255
+ });
52256
+ Object.defineProperty(exports, "NcTemplatePreviewSchema", {
52257
+ enumerable: true,
52258
+ get: function() {
52259
+ return NcTemplatePreviewSchema;
52260
+ }
52261
+ });
52262
+ Object.defineProperty(exports, "NcTemplateVarDescriptorSchema", {
52263
+ enumerable: true,
52264
+ get: function() {
52265
+ return NcTemplateVarDescriptorSchema;
52266
+ }
52267
+ });
51257
52268
  Object.defineProperty(exports, "OpsLogEntrySchema", {
51258
52269
  enumerable: true,
51259
52270
  get: function() {
@@ -51518,6 +52529,12 @@ Object.defineProperty(exports, "isEventOwnerType", {
51518
52529
  return isEventOwnerType;
51519
52530
  }
51520
52531
  });
52532
+ Object.defineProperty(exports, "isKnownTemplateVar", {
52533
+ enumerable: true,
52534
+ get: function() {
52535
+ return isKnownTemplateVar;
52536
+ }
52537
+ });
51521
52538
  Object.defineProperty(exports, "isMediaOwnerType", {
51522
52539
  enumerable: true,
51523
52540
  get: function() {
@@ -51680,6 +52697,12 @@ Object.defineProperty(exports, "systemEventFilterApplies", {
51680
52697
  return systemEventFilterApplies;
51681
52698
  }
51682
52699
  });
52700
+ Object.defineProperty(exports, "templateVarsFor", {
52701
+ enumerable: true,
52702
+ get: function() {
52703
+ return templateVarsFor;
52704
+ }
52705
+ });
51683
52706
  Object.defineProperty(exports, "unknown", {
51684
52707
  enumerable: true,
51685
52708
  get: function() {