@camstack/addon-notifiers 1.2.19 → 1.2.20

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.
Files changed (3) hide show
  1. package/dist/addon.js +138 -24
  2. package/dist/addon.mjs +138 -24
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -13141,7 +13141,23 @@ var NotificationActionSchema = object({
13141
13141
  * else — see `notification-center/action-token.ts` for what that does and
13142
13142
  * does not buy.
13143
13143
  */
13144
- destructive: boolean().optional()
13144
+ destructive: boolean().optional(),
13145
+ /**
13146
+ * How the tap should REACH the url.
13147
+ *
13148
+ * `navigate` (absent, and every button authored before this field) opens it:
13149
+ * the phone leaves the notification and shows whatever the callback returns.
13150
+ * That is right for a button whose answer the operator wants to read.
13151
+ *
13152
+ * `background` fires it as a POST and stays put. It exists for the buttons
13153
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13154
+ * an answer to the notification, and being thrown into a browser tab to
13155
+ * confirm it costs more attention than the notification did. A backend that
13156
+ * cannot do a background call renders it as an ordinary link (the adapters
13157
+ * fall back rather than dropping the button), so this is a preference, never
13158
+ * a requirement.
13159
+ */
13160
+ mode: _enum(["navigate", "background"]).optional()
13145
13161
  });
13146
13162
  /**
13147
13163
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14156,6 +14172,9 @@ var NcSystemEventConditionSchema = object({
14156
14172
  nodeIds: array(string().min(1)).min(1).optional(),
14157
14173
  packageNames: array(string().min(1)).min(1).optional()
14158
14174
  });
14175
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14176
+ * outage the operator asked for once and forgot. */
14177
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14159
14178
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14160
14179
  var NcScheduleSchema = object({
14161
14180
  windows: array(object({
@@ -14532,15 +14551,15 @@ var NcConditionsSchema = object({
14532
14551
  * (an `immediate` rule naming an `audio-*` class, one notification per
14533
14552
  * classified sample) stays exactly as it was for rules that already use it.
14534
14553
  *
14535
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14536
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14537
- * (`camstack/src/data/notification-center.ts`, guarded by
14538
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14554
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14555
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14556
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14557
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14539
14558
  * condition fields it does not know when a rule is saved from the phone.
14540
14559
  * Publishing an editor for a condition the app cannot round-trip is how an
14541
- * operator loses a rule's conditions by opening it — so the descriptor, the
14542
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14543
- * does an audio rule become authorable.
14560
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14561
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14562
+ * follows here.
14544
14563
  */
14545
14564
  audio: NcAudioConditionSchema.optional()
14546
14565
  });
@@ -14776,6 +14795,30 @@ var NcRuleInputSchema = object({
14776
14795
  */
14777
14796
  snoozeAllowGlobal: boolean().optional(),
14778
14797
  /**
14798
+ * The snooze durations THIS rule's notification offers as buttons, in
14799
+ * minutes.
14800
+ *
14801
+ * Three states, and all three are distinct — which is exactly why this is
14802
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14803
+ * addon cap path (three production failures in one day), so a schema default
14804
+ * would collapse the first two:
14805
+ *
14806
+ * | value | meaning |
14807
+ * | --- | --- |
14808
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14809
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14810
+ * | a list | these choices, de-duplicated and sorted, at most four |
14811
+ *
14812
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14813
+ * three buttons in total) and a rule that spent it all on snooze choices
14814
+ * would push its own tap-through actions off the notification.
14815
+ *
14816
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14817
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14818
+ * window from anywhere (D133).
14819
+ */
14820
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14821
+ /**
14779
14822
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14780
14823
  *
14781
14824
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14875,6 +14918,7 @@ var NcConditionDescriptorSchema = object({
14875
14918
  "device",
14876
14919
  "package",
14877
14920
  "occupancy",
14921
+ "audio",
14878
14922
  "system"
14879
14923
  ]),
14880
14924
  label: string(),
@@ -14893,6 +14937,7 @@ var NcConditionDescriptorSchema = object({
14893
14937
  "crossingSelect",
14894
14938
  "polygonDraw",
14895
14939
  "occupancy",
14940
+ "audio",
14896
14941
  "deviceState",
14897
14942
  "systemEvent"
14898
14943
  ]),
@@ -15044,7 +15089,20 @@ var NcSnoozeInputSchema = object({
15044
15089
  ruleId: string().optional(),
15045
15090
  /** Required when `scope: 'device'`. */
15046
15091
  deviceId: number().int().optional(),
15047
- durationMinutes: number().int().min(1).max(1440),
15092
+ /**
15093
+ * Narrow the window to these subject classes — "the cat, not the person".
15094
+ *
15095
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15096
+ * what every window authored before this field meant, so no persisted row
15097
+ * changes meaning and no client has to learn anything to keep working.
15098
+ *
15099
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15100
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15101
+ * not at whichever of their four rules happened to produce the notification
15102
+ * they are dismissing.
15103
+ */
15104
+ classes: array(string().min(1)).min(1).optional(),
15105
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15048
15106
  /**
15049
15107
  * Silence this for EVERY recipient, not just the caller. Permission is
15050
15108
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15069,6 +15127,10 @@ var NcSnoozeSchema = object({
15069
15127
  scope: NcSnoozeScopeSchema,
15070
15128
  ruleId: string().optional(),
15071
15129
  deviceId: number().int().optional(),
15130
+ /** Subject classes this window covers. ABSENT = every class — see
15131
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15132
+ * no SQLite column: nothing queries a window by class. */
15133
+ classes: array(string().min(1)).min(1).optional(),
15072
15134
  startedAt: number(),
15073
15135
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15074
15136
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -30641,6 +30703,7 @@ Object.freeze({
30641
30703
  "network-access": "ingress",
30642
30704
  "smtp-provider": "email"
30643
30705
  });
30706
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30644
30707
  new Set(["devices", "classes"]);
30645
30708
  /** Strip a small, safe subset of Markdown down to plain text. */
30646
30709
  function markdownToText(md) {
@@ -32221,11 +32284,24 @@ function nativePriority$1(prepared) {
32221
32284
  }
32222
32285
  function viewActions(prepared) {
32223
32286
  const out = [];
32224
- for (const action of prepared.actions.slice(0, MAX_ACTIONS$1)) if (action.url !== void 0 && action.url.length > 0) out.push({
32225
- action: "view",
32226
- label: action.label,
32227
- url: action.url
32228
- });
32287
+ for (const action of prepared.actions.slice(0, MAX_ACTIONS$1)) {
32288
+ if (action.url === void 0 || action.url.length === 0) continue;
32289
+ if (action.mode === "background") {
32290
+ out.push({
32291
+ action: "http",
32292
+ label: action.label,
32293
+ url: action.url,
32294
+ method: "POST",
32295
+ clear: true
32296
+ });
32297
+ continue;
32298
+ }
32299
+ out.push({
32300
+ action: "view",
32301
+ label: action.label,
32302
+ url: action.url
32303
+ });
32304
+ }
32229
32305
  return out;
32230
32306
  }
32231
32307
  /** The single attachment (caps.max = 1), if any. */
@@ -32280,7 +32356,7 @@ function buildUploadRequest(config, prepared, attachment) {
32280
32356
  if (tags.length > 0) headers["x-tags"] = tags.join(",");
32281
32357
  if (prepared.clickUrl !== null) headers["x-click"] = prepared.clickUrl;
32282
32358
  if (attachment.name !== void 0) headers["x-filename"] = attachment.name;
32283
- if (actions.length > 0) headers["x-actions"] = actions.map((a) => `view, ${a.label}, ${a.url}`).join("; ");
32359
+ if (actions.length > 0) headers["x-actions"] = actions.map((a) => a.action === "http" ? `http, ${a.label}, ${a.url}, method=POST, clear=true` : `view, ${a.label}, ${a.url}`).join("; ");
32284
32360
  return {
32285
32361
  url: `${serverUrl}/${topic}`,
32286
32362
  method: "PUT",
@@ -33539,17 +33615,46 @@ function userIdsFrom(config) {
33539
33615
  if (typeof raw === "string") return raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
33540
33616
  return [];
33541
33617
  }
33618
+ /**
33619
+ * How a `BACKGROUND_CALL` names its request: `METHOD::url`.
33620
+ *
33621
+ * The whole reason the type exists here: a "silence this for 30 minutes"
33622
+ * button that opens a browser tab has already cost more attention than the
33623
+ * notification it was dismissing. `BACKGROUND_CALL` fires the callback and
33624
+ * leaves the phone where it is.
33625
+ */
33626
+ var BACKGROUND_CALL_PREFIX = "POST::";
33542
33627
  function actionsFor(prepared) {
33543
33628
  const out = [];
33544
- for (const action of prepared.actions.slice(0, MAX_ACTIONS)) if (action.url !== void 0 && action.url.length > 0) out.push({
33545
- type: "NAVIGATE",
33546
- title: action.label,
33547
- value: action.url
33548
- });
33549
- else out.push({
33550
- type: "OPEN_NOTIFICATION",
33551
- title: action.label
33552
- });
33629
+ for (const action of prepared.actions.slice(0, MAX_ACTIONS)) {
33630
+ const decoration = {
33631
+ ...action.destructive !== void 0 ? { destructive: action.destructive } : {},
33632
+ ...action.icon !== void 0 ? { icon: action.icon } : {}
33633
+ };
33634
+ if (action.url === void 0 || action.url.length === 0) {
33635
+ out.push({
33636
+ type: "OPEN_NOTIFICATION",
33637
+ title: action.label,
33638
+ ...decoration
33639
+ });
33640
+ continue;
33641
+ }
33642
+ if (action.mode === "background") {
33643
+ out.push({
33644
+ type: "BACKGROUND_CALL",
33645
+ title: action.label,
33646
+ value: `${BACKGROUND_CALL_PREFIX}${action.url}`,
33647
+ ...decoration
33648
+ });
33649
+ continue;
33650
+ }
33651
+ out.push({
33652
+ type: "NAVIGATE",
33653
+ title: action.label,
33654
+ value: action.url,
33655
+ ...decoration
33656
+ });
33657
+ }
33553
33658
  return out;
33554
33659
  }
33555
33660
  function attachmentsFor(prepared) {
@@ -33715,6 +33820,15 @@ var zentikAdapter = {
33715
33820
  ],
33716
33821
  format: ["text"],
33717
33822
  clickUrl: true,
33823
+ /**
33824
+ * `NotificationActionDto.icon` is a documented field, so the engine hands
33825
+ * the icon over instead of stripping it centrally. What Zentik's client
33826
+ * DRAWS for a given name is not documented — so the intent name travels
33827
+ * verbatim, exactly as the webhook kind forwards it, and a name the app
33828
+ * does not know renders as no icon rather than as a wrong one. This is a
33829
+ * pass-through claim, not a rendering claim.
33830
+ */
33831
+ actionIcons: true,
33718
33832
  sound: true,
33719
33833
  ttl: true,
33720
33834
  bodyMaxLen: BODY_MAX_LEN
package/dist/addon.mjs CHANGED
@@ -13114,7 +13114,23 @@ var NotificationActionSchema = object({
13114
13114
  * else — see `notification-center/action-token.ts` for what that does and
13115
13115
  * does not buy.
13116
13116
  */
13117
- destructive: boolean().optional()
13117
+ destructive: boolean().optional(),
13118
+ /**
13119
+ * How the tap should REACH the url.
13120
+ *
13121
+ * `navigate` (absent, and every button authored before this field) opens it:
13122
+ * the phone leaves the notification and shows whatever the callback returns.
13123
+ * That is right for a button whose answer the operator wants to read.
13124
+ *
13125
+ * `background` fires it as a POST and stays put. It exists for the buttons
13126
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13127
+ * an answer to the notification, and being thrown into a browser tab to
13128
+ * confirm it costs more attention than the notification did. A backend that
13129
+ * cannot do a background call renders it as an ordinary link (the adapters
13130
+ * fall back rather than dropping the button), so this is a preference, never
13131
+ * a requirement.
13132
+ */
13133
+ mode: _enum(["navigate", "background"]).optional()
13118
13134
  });
13119
13135
  /**
13120
13136
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14129,6 +14145,9 @@ var NcSystemEventConditionSchema = object({
14129
14145
  nodeIds: array(string().min(1)).min(1).optional(),
14130
14146
  packageNames: array(string().min(1)).min(1).optional()
14131
14147
  });
14148
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14149
+ * outage the operator asked for once and forgot. */
14150
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14132
14151
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14133
14152
  var NcScheduleSchema = object({
14134
14153
  windows: array(object({
@@ -14505,15 +14524,15 @@ var NcConditionsSchema = object({
14505
14524
  * (an `immediate` rule naming an `audio-*` class, one notification per
14506
14525
  * classified sample) stays exactly as it was for rules that already use it.
14507
14526
  *
14508
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14509
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14510
- * (`camstack/src/data/notification-center.ts`, guarded by
14511
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14527
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14528
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14529
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14530
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14512
14531
  * condition fields it does not know when a rule is saved from the phone.
14513
14532
  * Publishing an editor for a condition the app cannot round-trip is how an
14514
- * operator loses a rule's conditions by opening it — so the descriptor, the
14515
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14516
- * does an audio rule become authorable.
14533
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14534
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14535
+ * follows here.
14517
14536
  */
14518
14537
  audio: NcAudioConditionSchema.optional()
14519
14538
  });
@@ -14749,6 +14768,30 @@ var NcRuleInputSchema = object({
14749
14768
  */
14750
14769
  snoozeAllowGlobal: boolean().optional(),
14751
14770
  /**
14771
+ * The snooze durations THIS rule's notification offers as buttons, in
14772
+ * minutes.
14773
+ *
14774
+ * Three states, and all three are distinct — which is exactly why this is
14775
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14776
+ * addon cap path (three production failures in one day), so a schema default
14777
+ * would collapse the first two:
14778
+ *
14779
+ * | value | meaning |
14780
+ * | --- | --- |
14781
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14782
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14783
+ * | a list | these choices, de-duplicated and sorted, at most four |
14784
+ *
14785
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14786
+ * three buttons in total) and a rule that spent it all on snooze choices
14787
+ * would push its own tap-through actions off the notification.
14788
+ *
14789
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14790
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14791
+ * window from anywhere (D133).
14792
+ */
14793
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14794
+ /**
14752
14795
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14753
14796
  *
14754
14797
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14848,6 +14891,7 @@ var NcConditionDescriptorSchema = object({
14848
14891
  "device",
14849
14892
  "package",
14850
14893
  "occupancy",
14894
+ "audio",
14851
14895
  "system"
14852
14896
  ]),
14853
14897
  label: string(),
@@ -14866,6 +14910,7 @@ var NcConditionDescriptorSchema = object({
14866
14910
  "crossingSelect",
14867
14911
  "polygonDraw",
14868
14912
  "occupancy",
14913
+ "audio",
14869
14914
  "deviceState",
14870
14915
  "systemEvent"
14871
14916
  ]),
@@ -15017,7 +15062,20 @@ var NcSnoozeInputSchema = object({
15017
15062
  ruleId: string().optional(),
15018
15063
  /** Required when `scope: 'device'`. */
15019
15064
  deviceId: number().int().optional(),
15020
- durationMinutes: number().int().min(1).max(1440),
15065
+ /**
15066
+ * Narrow the window to these subject classes — "the cat, not the person".
15067
+ *
15068
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15069
+ * what every window authored before this field meant, so no persisted row
15070
+ * changes meaning and no client has to learn anything to keep working.
15071
+ *
15072
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15073
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15074
+ * not at whichever of their four rules happened to produce the notification
15075
+ * they are dismissing.
15076
+ */
15077
+ classes: array(string().min(1)).min(1).optional(),
15078
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15021
15079
  /**
15022
15080
  * Silence this for EVERY recipient, not just the caller. Permission is
15023
15081
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15042,6 +15100,10 @@ var NcSnoozeSchema = object({
15042
15100
  scope: NcSnoozeScopeSchema,
15043
15101
  ruleId: string().optional(),
15044
15102
  deviceId: number().int().optional(),
15103
+ /** Subject classes this window covers. ABSENT = every class — see
15104
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15105
+ * no SQLite column: nothing queries a window by class. */
15106
+ classes: array(string().min(1)).min(1).optional(),
15045
15107
  startedAt: number(),
15046
15108
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15047
15109
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -30614,6 +30676,7 @@ Object.freeze({
30614
30676
  "network-access": "ingress",
30615
30677
  "smtp-provider": "email"
30616
30678
  });
30679
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30617
30680
  new Set(["devices", "classes"]);
30618
30681
  /** Strip a small, safe subset of Markdown down to plain text. */
30619
30682
  function markdownToText(md) {
@@ -32194,11 +32257,24 @@ function nativePriority$1(prepared) {
32194
32257
  }
32195
32258
  function viewActions(prepared) {
32196
32259
  const out = [];
32197
- for (const action of prepared.actions.slice(0, MAX_ACTIONS$1)) if (action.url !== void 0 && action.url.length > 0) out.push({
32198
- action: "view",
32199
- label: action.label,
32200
- url: action.url
32201
- });
32260
+ for (const action of prepared.actions.slice(0, MAX_ACTIONS$1)) {
32261
+ if (action.url === void 0 || action.url.length === 0) continue;
32262
+ if (action.mode === "background") {
32263
+ out.push({
32264
+ action: "http",
32265
+ label: action.label,
32266
+ url: action.url,
32267
+ method: "POST",
32268
+ clear: true
32269
+ });
32270
+ continue;
32271
+ }
32272
+ out.push({
32273
+ action: "view",
32274
+ label: action.label,
32275
+ url: action.url
32276
+ });
32277
+ }
32202
32278
  return out;
32203
32279
  }
32204
32280
  /** The single attachment (caps.max = 1), if any. */
@@ -32253,7 +32329,7 @@ function buildUploadRequest(config, prepared, attachment) {
32253
32329
  if (tags.length > 0) headers["x-tags"] = tags.join(",");
32254
32330
  if (prepared.clickUrl !== null) headers["x-click"] = prepared.clickUrl;
32255
32331
  if (attachment.name !== void 0) headers["x-filename"] = attachment.name;
32256
- if (actions.length > 0) headers["x-actions"] = actions.map((a) => `view, ${a.label}, ${a.url}`).join("; ");
32332
+ if (actions.length > 0) headers["x-actions"] = actions.map((a) => a.action === "http" ? `http, ${a.label}, ${a.url}, method=POST, clear=true` : `view, ${a.label}, ${a.url}`).join("; ");
32257
32333
  return {
32258
32334
  url: `${serverUrl}/${topic}`,
32259
32335
  method: "PUT",
@@ -33512,17 +33588,46 @@ function userIdsFrom(config) {
33512
33588
  if (typeof raw === "string") return raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
33513
33589
  return [];
33514
33590
  }
33591
+ /**
33592
+ * How a `BACKGROUND_CALL` names its request: `METHOD::url`.
33593
+ *
33594
+ * The whole reason the type exists here: a "silence this for 30 minutes"
33595
+ * button that opens a browser tab has already cost more attention than the
33596
+ * notification it was dismissing. `BACKGROUND_CALL` fires the callback and
33597
+ * leaves the phone where it is.
33598
+ */
33599
+ var BACKGROUND_CALL_PREFIX = "POST::";
33515
33600
  function actionsFor(prepared) {
33516
33601
  const out = [];
33517
- for (const action of prepared.actions.slice(0, MAX_ACTIONS)) if (action.url !== void 0 && action.url.length > 0) out.push({
33518
- type: "NAVIGATE",
33519
- title: action.label,
33520
- value: action.url
33521
- });
33522
- else out.push({
33523
- type: "OPEN_NOTIFICATION",
33524
- title: action.label
33525
- });
33602
+ for (const action of prepared.actions.slice(0, MAX_ACTIONS)) {
33603
+ const decoration = {
33604
+ ...action.destructive !== void 0 ? { destructive: action.destructive } : {},
33605
+ ...action.icon !== void 0 ? { icon: action.icon } : {}
33606
+ };
33607
+ if (action.url === void 0 || action.url.length === 0) {
33608
+ out.push({
33609
+ type: "OPEN_NOTIFICATION",
33610
+ title: action.label,
33611
+ ...decoration
33612
+ });
33613
+ continue;
33614
+ }
33615
+ if (action.mode === "background") {
33616
+ out.push({
33617
+ type: "BACKGROUND_CALL",
33618
+ title: action.label,
33619
+ value: `${BACKGROUND_CALL_PREFIX}${action.url}`,
33620
+ ...decoration
33621
+ });
33622
+ continue;
33623
+ }
33624
+ out.push({
33625
+ type: "NAVIGATE",
33626
+ title: action.label,
33627
+ value: action.url,
33628
+ ...decoration
33629
+ });
33630
+ }
33526
33631
  return out;
33527
33632
  }
33528
33633
  function attachmentsFor(prepared) {
@@ -33688,6 +33793,15 @@ var zentikAdapter = {
33688
33793
  ],
33689
33794
  format: ["text"],
33690
33795
  clickUrl: true,
33796
+ /**
33797
+ * `NotificationActionDto.icon` is a documented field, so the engine hands
33798
+ * the icon over instead of stripping it centrally. What Zentik's client
33799
+ * DRAWS for a given name is not documented — so the intent name travels
33800
+ * verbatim, exactly as the webhook kind forwards it, and a name the app
33801
+ * does not know renders as no icon rather than as a wrong one. This is a
33802
+ * pass-through claim, not a rendering claim.
33803
+ */
33804
+ actionIcons: true,
33691
33805
  sound: true,
33692
33806
  ttl: true,
33693
33807
  bodyMaxLen: BODY_MAX_LEN
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-notifiers",
3
- "version": "1.2.19",
3
+ "version": "1.2.20",
4
4
  "description": "System notifiers addon for CamStack — a `notification-output` collection provider hosting per-kind notifier adapters (ntfy, pushover, gotify, telegram, discord, webhook, zentik).",
5
5
  "keywords": [
6
6
  "camstack",