@camstack/addon-static-turn 1.2.14 → 1.2.15

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.
@@ -12951,7 +12951,23 @@ var NotificationActionSchema = object({
12951
12951
  * else — see `notification-center/action-token.ts` for what that does and
12952
12952
  * does not buy.
12953
12953
  */
12954
- destructive: boolean().optional()
12954
+ destructive: boolean().optional(),
12955
+ /**
12956
+ * How the tap should REACH the url.
12957
+ *
12958
+ * `navigate` (absent, and every button authored before this field) opens it:
12959
+ * the phone leaves the notification and shows whatever the callback returns.
12960
+ * That is right for a button whose answer the operator wants to read.
12961
+ *
12962
+ * `background` fires it as a POST and stays put. It exists for the buttons
12963
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
12964
+ * an answer to the notification, and being thrown into a browser tab to
12965
+ * confirm it costs more attention than the notification did. A backend that
12966
+ * cannot do a background call renders it as an ordinary link (the adapters
12967
+ * fall back rather than dropping the button), so this is a preference, never
12968
+ * a requirement.
12969
+ */
12970
+ mode: _enum(["navigate", "background"]).optional()
12955
12971
  });
12956
12972
  /**
12957
12973
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13952,6 +13968,9 @@ var NcSystemEventConditionSchema = object({
13952
13968
  nodeIds: array(string().min(1)).min(1).optional(),
13953
13969
  packageNames: array(string().min(1)).min(1).optional()
13954
13970
  });
13971
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
13972
+ * outage the operator asked for once and forgot. */
13973
+ var NC_SNOOZE_MAX_MINUTES = 1440;
13955
13974
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
13956
13975
  var NcScheduleSchema = object({
13957
13976
  windows: array(object({
@@ -14328,15 +14347,15 @@ var NcConditionsSchema = object({
14328
14347
  * (an `immediate` rule naming an `audio-*` class, one notification per
14329
14348
  * classified sample) stays exactly as it was for rules that already use it.
14330
14349
  *
14331
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14332
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14333
- * (`camstack/src/data/notification-center.ts`, guarded by
14334
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14350
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14351
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14352
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14353
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14335
14354
  * condition fields it does not know when a rule is saved from the phone.
14336
14355
  * Publishing an editor for a condition the app cannot round-trip is how an
14337
- * operator loses a rule's conditions by opening it — so the descriptor, the
14338
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14339
- * does an audio rule become authorable.
14356
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14357
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14358
+ * follows here.
14340
14359
  */
14341
14360
  audio: NcAudioConditionSchema.optional()
14342
14361
  });
@@ -14572,6 +14591,30 @@ var NcRuleInputSchema = object({
14572
14591
  */
14573
14592
  snoozeAllowGlobal: boolean().optional(),
14574
14593
  /**
14594
+ * The snooze durations THIS rule's notification offers as buttons, in
14595
+ * minutes.
14596
+ *
14597
+ * Three states, and all three are distinct — which is exactly why this is
14598
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14599
+ * addon cap path (three production failures in one day), so a schema default
14600
+ * would collapse the first two:
14601
+ *
14602
+ * | value | meaning |
14603
+ * | --- | --- |
14604
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14605
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14606
+ * | a list | these choices, de-duplicated and sorted, at most four |
14607
+ *
14608
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14609
+ * three buttons in total) and a rule that spent it all on snooze choices
14610
+ * would push its own tap-through actions off the notification.
14611
+ *
14612
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14613
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14614
+ * window from anywhere (D133).
14615
+ */
14616
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14617
+ /**
14575
14618
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14576
14619
  *
14577
14620
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14671,6 +14714,7 @@ var NcConditionDescriptorSchema = object({
14671
14714
  "device",
14672
14715
  "package",
14673
14716
  "occupancy",
14717
+ "audio",
14674
14718
  "system"
14675
14719
  ]),
14676
14720
  label: string(),
@@ -14689,6 +14733,7 @@ var NcConditionDescriptorSchema = object({
14689
14733
  "crossingSelect",
14690
14734
  "polygonDraw",
14691
14735
  "occupancy",
14736
+ "audio",
14692
14737
  "deviceState",
14693
14738
  "systemEvent"
14694
14739
  ]),
@@ -14840,7 +14885,20 @@ var NcSnoozeInputSchema = object({
14840
14885
  ruleId: string().optional(),
14841
14886
  /** Required when `scope: 'device'`. */
14842
14887
  deviceId: number().int().optional(),
14843
- durationMinutes: number().int().min(1).max(1440),
14888
+ /**
14889
+ * Narrow the window to these subject classes — "the cat, not the person".
14890
+ *
14891
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
14892
+ * what every window authored before this field meant, so no persisted row
14893
+ * changes meaning and no client has to learn anything to keep working.
14894
+ *
14895
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
14896
+ * cross rules (D133): the operator points at a camera and a kind of thing,
14897
+ * not at whichever of their four rules happened to produce the notification
14898
+ * they are dismissing.
14899
+ */
14900
+ classes: array(string().min(1)).min(1).optional(),
14901
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
14844
14902
  /**
14845
14903
  * Silence this for EVERY recipient, not just the caller. Permission is
14846
14904
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -14865,6 +14923,10 @@ var NcSnoozeSchema = object({
14865
14923
  scope: NcSnoozeScopeSchema,
14866
14924
  ruleId: string().optional(),
14867
14925
  deviceId: number().int().optional(),
14926
+ /** Subject classes this window covers. ABSENT = every class — see
14927
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
14928
+ * no SQLite column: nothing queries a window by class. */
14929
+ classes: array(string().min(1)).min(1).optional(),
14868
14930
  startedAt: number(),
14869
14931
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
14870
14932
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -30460,6 +30522,7 @@ Object.freeze({
30460
30522
  "network-access": "ingress",
30461
30523
  "smtp-provider": "email"
30462
30524
  });
30525
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30463
30526
  new Set(["devices", "classes"]);
30464
30527
  /**
30465
30528
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -12950,7 +12950,23 @@ var NotificationActionSchema = object({
12950
12950
  * else — see `notification-center/action-token.ts` for what that does and
12951
12951
  * does not buy.
12952
12952
  */
12953
- destructive: boolean().optional()
12953
+ destructive: boolean().optional(),
12954
+ /**
12955
+ * How the tap should REACH the url.
12956
+ *
12957
+ * `navigate` (absent, and every button authored before this field) opens it:
12958
+ * the phone leaves the notification and shows whatever the callback returns.
12959
+ * That is right for a button whose answer the operator wants to read.
12960
+ *
12961
+ * `background` fires it as a POST and stays put. It exists for the buttons
12962
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
12963
+ * an answer to the notification, and being thrown into a browser tab to
12964
+ * confirm it costs more attention than the notification did. A backend that
12965
+ * cannot do a background call renders it as an ordinary link (the adapters
12966
+ * fall back rather than dropping the button), so this is a preference, never
12967
+ * a requirement.
12968
+ */
12969
+ mode: _enum(["navigate", "background"]).optional()
12954
12970
  });
12955
12971
  /**
12956
12972
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13951,6 +13967,9 @@ var NcSystemEventConditionSchema = object({
13951
13967
  nodeIds: array(string().min(1)).min(1).optional(),
13952
13968
  packageNames: array(string().min(1)).min(1).optional()
13953
13969
  });
13970
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
13971
+ * outage the operator asked for once and forgot. */
13972
+ var NC_SNOOZE_MAX_MINUTES = 1440;
13954
13973
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
13955
13974
  var NcScheduleSchema = object({
13956
13975
  windows: array(object({
@@ -14327,15 +14346,15 @@ var NcConditionsSchema = object({
14327
14346
  * (an `immediate` rule naming an `audio-*` class, one notification per
14328
14347
  * classified sample) stays exactly as it was for rules that already use it.
14329
14348
  *
14330
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14331
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14332
- * (`camstack/src/data/notification-center.ts`, guarded by
14333
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14349
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14350
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14351
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14352
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14334
14353
  * condition fields it does not know when a rule is saved from the phone.
14335
14354
  * Publishing an editor for a condition the app cannot round-trip is how an
14336
- * operator loses a rule's conditions by opening it — so the descriptor, the
14337
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14338
- * does an audio rule become authorable.
14355
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14356
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14357
+ * follows here.
14339
14358
  */
14340
14359
  audio: NcAudioConditionSchema.optional()
14341
14360
  });
@@ -14571,6 +14590,30 @@ var NcRuleInputSchema = object({
14571
14590
  */
14572
14591
  snoozeAllowGlobal: boolean().optional(),
14573
14592
  /**
14593
+ * The snooze durations THIS rule's notification offers as buttons, in
14594
+ * minutes.
14595
+ *
14596
+ * Three states, and all three are distinct — which is exactly why this is
14597
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14598
+ * addon cap path (three production failures in one day), so a schema default
14599
+ * would collapse the first two:
14600
+ *
14601
+ * | value | meaning |
14602
+ * | --- | --- |
14603
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14604
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14605
+ * | a list | these choices, de-duplicated and sorted, at most four |
14606
+ *
14607
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14608
+ * three buttons in total) and a rule that spent it all on snooze choices
14609
+ * would push its own tap-through actions off the notification.
14610
+ *
14611
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14612
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14613
+ * window from anywhere (D133).
14614
+ */
14615
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14616
+ /**
14574
14617
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14575
14618
  *
14576
14619
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14670,6 +14713,7 @@ var NcConditionDescriptorSchema = object({
14670
14713
  "device",
14671
14714
  "package",
14672
14715
  "occupancy",
14716
+ "audio",
14673
14717
  "system"
14674
14718
  ]),
14675
14719
  label: string(),
@@ -14688,6 +14732,7 @@ var NcConditionDescriptorSchema = object({
14688
14732
  "crossingSelect",
14689
14733
  "polygonDraw",
14690
14734
  "occupancy",
14735
+ "audio",
14691
14736
  "deviceState",
14692
14737
  "systemEvent"
14693
14738
  ]),
@@ -14839,7 +14884,20 @@ var NcSnoozeInputSchema = object({
14839
14884
  ruleId: string().optional(),
14840
14885
  /** Required when `scope: 'device'`. */
14841
14886
  deviceId: number().int().optional(),
14842
- durationMinutes: number().int().min(1).max(1440),
14887
+ /**
14888
+ * Narrow the window to these subject classes — "the cat, not the person".
14889
+ *
14890
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
14891
+ * what every window authored before this field meant, so no persisted row
14892
+ * changes meaning and no client has to learn anything to keep working.
14893
+ *
14894
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
14895
+ * cross rules (D133): the operator points at a camera and a kind of thing,
14896
+ * not at whichever of their four rules happened to produce the notification
14897
+ * they are dismissing.
14898
+ */
14899
+ classes: array(string().min(1)).min(1).optional(),
14900
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
14843
14901
  /**
14844
14902
  * Silence this for EVERY recipient, not just the caller. Permission is
14845
14903
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -14864,6 +14922,10 @@ var NcSnoozeSchema = object({
14864
14922
  scope: NcSnoozeScopeSchema,
14865
14923
  ruleId: string().optional(),
14866
14924
  deviceId: number().int().optional(),
14925
+ /** Subject classes this window covers. ABSENT = every class — see
14926
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
14927
+ * no SQLite column: nothing queries a window by class. */
14928
+ classes: array(string().min(1)).min(1).optional(),
14867
14929
  startedAt: number(),
14868
14930
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
14869
14931
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -30459,6 +30521,7 @@ Object.freeze({
30459
30521
  "network-access": "ingress",
30460
30522
  "smtp-provider": "email"
30461
30523
  });
30524
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30462
30525
  new Set(["devices", "classes"]);
30463
30526
  /**
30464
30527
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-static-turn",
3
- "version": "1.2.14",
3
+ "version": "1.2.15",
4
4
  "description": "Static / self-hosted (coturn) TURN provider for CamStack",
5
5
  "keywords": [
6
6
  "camstack",