@camstack/addon-export-hap 1.2.25 → 1.2.26

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.
@@ -13768,7 +13768,23 @@ var NotificationActionSchema = object({
13768
13768
  * else — see `notification-center/action-token.ts` for what that does and
13769
13769
  * does not buy.
13770
13770
  */
13771
- destructive: boolean().optional()
13771
+ destructive: boolean().optional(),
13772
+ /**
13773
+ * How the tap should REACH the url.
13774
+ *
13775
+ * `navigate` (absent, and every button authored before this field) opens it:
13776
+ * the phone leaves the notification and shows whatever the callback returns.
13777
+ * That is right for a button whose answer the operator wants to read.
13778
+ *
13779
+ * `background` fires it as a POST and stays put. It exists for the buttons
13780
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13781
+ * an answer to the notification, and being thrown into a browser tab to
13782
+ * confirm it costs more attention than the notification did. A backend that
13783
+ * cannot do a background call renders it as an ordinary link (the adapters
13784
+ * fall back rather than dropping the button), so this is a preference, never
13785
+ * a requirement.
13786
+ */
13787
+ mode: _enum(["navigate", "background"]).optional()
13772
13788
  });
13773
13789
  /**
13774
13790
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14769,6 +14785,9 @@ var NcSystemEventConditionSchema = object({
14769
14785
  nodeIds: array(string().min(1)).min(1).optional(),
14770
14786
  packageNames: array(string().min(1)).min(1).optional()
14771
14787
  });
14788
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14789
+ * outage the operator asked for once and forgot. */
14790
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14772
14791
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14773
14792
  var NcScheduleSchema = object({
14774
14793
  windows: array(object({
@@ -15145,15 +15164,15 @@ var NcConditionsSchema = object({
15145
15164
  * (an `immediate` rule naming an `audio-*` class, one notification per
15146
15165
  * classified sample) stays exactly as it was for rules that already use it.
15147
15166
  *
15148
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
15149
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
15150
- * (`camstack/src/data/notification-center.ts`, guarded by
15151
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
15167
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
15168
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
15169
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
15170
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
15152
15171
  * condition fields it does not know when a rule is saved from the phone.
15153
15172
  * Publishing an editor for a condition the app cannot round-trip is how an
15154
- * operator loses a rule's conditions by opening it — so the descriptor, the
15155
- * admin widget and the viewer mirror land together (P2 + P3), and only then
15156
- * does an audio rule become authorable.
15173
+ * operator loses a rule's conditions by opening it — so the viewer mirror
15174
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
15175
+ * follows here.
15157
15176
  */
15158
15177
  audio: NcAudioConditionSchema.optional()
15159
15178
  });
@@ -15389,6 +15408,30 @@ var NcRuleInputSchema = object({
15389
15408
  */
15390
15409
  snoozeAllowGlobal: boolean().optional(),
15391
15410
  /**
15411
+ * The snooze durations THIS rule's notification offers as buttons, in
15412
+ * minutes.
15413
+ *
15414
+ * Three states, and all three are distinct — which is exactly why this is
15415
+ * `.optional()` and never `.default()`. A Zod default does not run on the
15416
+ * addon cap path (three production failures in one day), so a schema default
15417
+ * would collapse the first two:
15418
+ *
15419
+ * | value | meaning |
15420
+ * | --- | --- |
15421
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
15422
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
15423
+ * | a list | these choices, de-duplicated and sorted, at most four |
15424
+ *
15425
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
15426
+ * three buttons in total) and a rule that spent it all on snooze choices
15427
+ * would push its own tap-through actions off the notification.
15428
+ *
15429
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
15430
+ * that arms the panel, is exempt automatically and cannot be silenced by a
15431
+ * window from anywhere (D133).
15432
+ */
15433
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
15434
+ /**
15392
15435
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
15393
15436
  *
15394
15437
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -15488,6 +15531,7 @@ var NcConditionDescriptorSchema = object({
15488
15531
  "device",
15489
15532
  "package",
15490
15533
  "occupancy",
15534
+ "audio",
15491
15535
  "system"
15492
15536
  ]),
15493
15537
  label: string(),
@@ -15506,6 +15550,7 @@ var NcConditionDescriptorSchema = object({
15506
15550
  "crossingSelect",
15507
15551
  "polygonDraw",
15508
15552
  "occupancy",
15553
+ "audio",
15509
15554
  "deviceState",
15510
15555
  "systemEvent"
15511
15556
  ]),
@@ -15657,7 +15702,20 @@ var NcSnoozeInputSchema = object({
15657
15702
  ruleId: string().optional(),
15658
15703
  /** Required when `scope: 'device'`. */
15659
15704
  deviceId: number().int().optional(),
15660
- durationMinutes: number().int().min(1).max(1440),
15705
+ /**
15706
+ * Narrow the window to these subject classes — "the cat, not the person".
15707
+ *
15708
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15709
+ * what every window authored before this field meant, so no persisted row
15710
+ * changes meaning and no client has to learn anything to keep working.
15711
+ *
15712
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15713
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15714
+ * not at whichever of their four rules happened to produce the notification
15715
+ * they are dismissing.
15716
+ */
15717
+ classes: array(string().min(1)).min(1).optional(),
15718
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15661
15719
  /**
15662
15720
  * Silence this for EVERY recipient, not just the caller. Permission is
15663
15721
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15682,6 +15740,10 @@ var NcSnoozeSchema = object({
15682
15740
  scope: NcSnoozeScopeSchema,
15683
15741
  ruleId: string().optional(),
15684
15742
  deviceId: number().int().optional(),
15743
+ /** Subject classes this window covers. ABSENT = every class — see
15744
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15745
+ * no SQLite column: nothing queries a window by class. */
15746
+ classes: array(string().min(1)).min(1).optional(),
15685
15747
  startedAt: number(),
15686
15748
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15687
15749
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -31254,6 +31316,7 @@ Object.freeze({
31254
31316
  "network-access": "ingress",
31255
31317
  "smtp-provider": "email"
31256
31318
  });
31319
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
31257
31320
  new Set(["devices", "classes"]);
31258
31321
  /**
31259
31322
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -13756,7 +13756,23 @@ var NotificationActionSchema = object({
13756
13756
  * else — see `notification-center/action-token.ts` for what that does and
13757
13757
  * does not buy.
13758
13758
  */
13759
- destructive: boolean().optional()
13759
+ destructive: boolean().optional(),
13760
+ /**
13761
+ * How the tap should REACH the url.
13762
+ *
13763
+ * `navigate` (absent, and every button authored before this field) opens it:
13764
+ * the phone leaves the notification and shows whatever the callback returns.
13765
+ * That is right for a button whose answer the operator wants to read.
13766
+ *
13767
+ * `background` fires it as a POST and stays put. It exists for the buttons
13768
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13769
+ * an answer to the notification, and being thrown into a browser tab to
13770
+ * confirm it costs more attention than the notification did. A backend that
13771
+ * cannot do a background call renders it as an ordinary link (the adapters
13772
+ * fall back rather than dropping the button), so this is a preference, never
13773
+ * a requirement.
13774
+ */
13775
+ mode: _enum(["navigate", "background"]).optional()
13760
13776
  });
13761
13777
  /**
13762
13778
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14757,6 +14773,9 @@ var NcSystemEventConditionSchema = object({
14757
14773
  nodeIds: array(string().min(1)).min(1).optional(),
14758
14774
  packageNames: array(string().min(1)).min(1).optional()
14759
14775
  });
14776
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14777
+ * outage the operator asked for once and forgot. */
14778
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14760
14779
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14761
14780
  var NcScheduleSchema = object({
14762
14781
  windows: array(object({
@@ -15133,15 +15152,15 @@ var NcConditionsSchema = object({
15133
15152
  * (an `immediate` rule naming an `audio-*` class, one notification per
15134
15153
  * classified sample) stays exactly as it was for rules that already use it.
15135
15154
  *
15136
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
15137
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
15138
- * (`camstack/src/data/notification-center.ts`, guarded by
15139
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
15155
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
15156
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
15157
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
15158
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
15140
15159
  * condition fields it does not know when a rule is saved from the phone.
15141
15160
  * Publishing an editor for a condition the app cannot round-trip is how an
15142
- * operator loses a rule's conditions by opening it — so the descriptor, the
15143
- * admin widget and the viewer mirror land together (P2 + P3), and only then
15144
- * does an audio rule become authorable.
15161
+ * operator loses a rule's conditions by opening it — so the viewer mirror
15162
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
15163
+ * follows here.
15145
15164
  */
15146
15165
  audio: NcAudioConditionSchema.optional()
15147
15166
  });
@@ -15377,6 +15396,30 @@ var NcRuleInputSchema = object({
15377
15396
  */
15378
15397
  snoozeAllowGlobal: boolean().optional(),
15379
15398
  /**
15399
+ * The snooze durations THIS rule's notification offers as buttons, in
15400
+ * minutes.
15401
+ *
15402
+ * Three states, and all three are distinct — which is exactly why this is
15403
+ * `.optional()` and never `.default()`. A Zod default does not run on the
15404
+ * addon cap path (three production failures in one day), so a schema default
15405
+ * would collapse the first two:
15406
+ *
15407
+ * | value | meaning |
15408
+ * | --- | --- |
15409
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
15410
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
15411
+ * | a list | these choices, de-duplicated and sorted, at most four |
15412
+ *
15413
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
15414
+ * three buttons in total) and a rule that spent it all on snooze choices
15415
+ * would push its own tap-through actions off the notification.
15416
+ *
15417
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
15418
+ * that arms the panel, is exempt automatically and cannot be silenced by a
15419
+ * window from anywhere (D133).
15420
+ */
15421
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
15422
+ /**
15380
15423
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
15381
15424
  *
15382
15425
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -15476,6 +15519,7 @@ var NcConditionDescriptorSchema = object({
15476
15519
  "device",
15477
15520
  "package",
15478
15521
  "occupancy",
15522
+ "audio",
15479
15523
  "system"
15480
15524
  ]),
15481
15525
  label: string(),
@@ -15494,6 +15538,7 @@ var NcConditionDescriptorSchema = object({
15494
15538
  "crossingSelect",
15495
15539
  "polygonDraw",
15496
15540
  "occupancy",
15541
+ "audio",
15497
15542
  "deviceState",
15498
15543
  "systemEvent"
15499
15544
  ]),
@@ -15645,7 +15690,20 @@ var NcSnoozeInputSchema = object({
15645
15690
  ruleId: string().optional(),
15646
15691
  /** Required when `scope: 'device'`. */
15647
15692
  deviceId: number().int().optional(),
15648
- durationMinutes: number().int().min(1).max(1440),
15693
+ /**
15694
+ * Narrow the window to these subject classes — "the cat, not the person".
15695
+ *
15696
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15697
+ * what every window authored before this field meant, so no persisted row
15698
+ * changes meaning and no client has to learn anything to keep working.
15699
+ *
15700
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15701
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15702
+ * not at whichever of their four rules happened to produce the notification
15703
+ * they are dismissing.
15704
+ */
15705
+ classes: array(string().min(1)).min(1).optional(),
15706
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15649
15707
  /**
15650
15708
  * Silence this for EVERY recipient, not just the caller. Permission is
15651
15709
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15670,6 +15728,10 @@ var NcSnoozeSchema = object({
15670
15728
  scope: NcSnoozeScopeSchema,
15671
15729
  ruleId: string().optional(),
15672
15730
  deviceId: number().int().optional(),
15731
+ /** Subject classes this window covers. ABSENT = every class — see
15732
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15733
+ * no SQLite column: nothing queries a window by class. */
15734
+ classes: array(string().min(1)).min(1).optional(),
15673
15735
  startedAt: number(),
15674
15736
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15675
15737
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -31242,6 +31304,7 @@ Object.freeze({
31242
31304
  "network-access": "ingress",
31243
31305
  "smtp-provider": "email"
31244
31306
  });
31307
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
31245
31308
  new Set(["devices", "classes"]);
31246
31309
  /**
31247
31310
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-hap",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "description": "HomeKit (HAP) bridge exporter for CamStack devices. Publishes a bridged accessory per exposed device — MotionSensor in this MVP; Camera/Doorbell/Switch/Light follow.",
5
5
  "keywords": [
6
6
  "camstack",