@camstack/types 1.2.612 → 1.2.613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/capabilities/notification-rules.cap.d.ts +12 -0
- package/dist/client.js +9 -0
- package/dist/client.mjs +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -0
- package/dist/index.mjs +18 -0
- package/dist/notification/alert-episode.d.ts +15 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.613] - 2026-11-20
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Alert episodes carry the alert's whole action, and notification rules gain offerAlertAction
|
|
15
|
+
|
|
10
16
|
## [1.2.612] - 2026-11-20
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -1589,6 +1589,7 @@ export declare const NcRuleInputSchema: z.ZodObject<{
|
|
|
1589
1589
|
groupingSec: z.ZodOptional<z.ZodNumber>;
|
|
1590
1590
|
groupWithinSec: z.ZodOptional<z.ZodNumber>;
|
|
1591
1591
|
askVerdict: z.ZodOptional<z.ZodBoolean>;
|
|
1592
|
+
offerAlertAction: z.ZodOptional<z.ZodBoolean>;
|
|
1592
1593
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1593
1594
|
}, z.core.$strip>;
|
|
1594
1595
|
export type NcRuleInput = z.infer<typeof NcRuleInputSchema>;
|
|
@@ -1770,6 +1771,7 @@ export declare const NcRulePatchSchema: z.ZodObject<{
|
|
|
1770
1771
|
groupingSec: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
1771
1772
|
groupWithinSec: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
1772
1773
|
askVerdict: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
1774
|
+
offerAlertAction: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
1773
1775
|
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
1774
1776
|
disabledTargetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1775
1777
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2180,6 +2182,7 @@ export declare const NcRuleUpdateInputSchema: z.ZodObject<{
|
|
|
2180
2182
|
groupingSec: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
2181
2183
|
groupWithinSec: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
2182
2184
|
askVerdict: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
2185
|
+
offerAlertAction: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
2183
2186
|
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
2184
2187
|
disabledTargetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2185
2188
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2786,6 +2789,7 @@ export declare const NcRuleSchema: z.ZodObject<{
|
|
|
2786
2789
|
groupingSec: z.ZodOptional<z.ZodNumber>;
|
|
2787
2790
|
groupWithinSec: z.ZodOptional<z.ZodNumber>;
|
|
2788
2791
|
askVerdict: z.ZodOptional<z.ZodBoolean>;
|
|
2792
|
+
offerAlertAction: z.ZodOptional<z.ZodBoolean>;
|
|
2789
2793
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2790
2794
|
id: z.ZodString;
|
|
2791
2795
|
createdBy: z.ZodString;
|
|
@@ -4994,6 +4998,7 @@ export declare const notificationRulesCapability: {
|
|
|
4994
4998
|
groupingSec: z.ZodOptional<z.ZodNumber>;
|
|
4995
4999
|
groupWithinSec: z.ZodOptional<z.ZodNumber>;
|
|
4996
5000
|
askVerdict: z.ZodOptional<z.ZodBoolean>;
|
|
5001
|
+
offerAlertAction: z.ZodOptional<z.ZodBoolean>;
|
|
4997
5002
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4998
5003
|
id: z.ZodString;
|
|
4999
5004
|
createdBy: z.ZodString;
|
|
@@ -5372,6 +5377,7 @@ export declare const notificationRulesCapability: {
|
|
|
5372
5377
|
groupingSec: z.ZodOptional<z.ZodNumber>;
|
|
5373
5378
|
groupWithinSec: z.ZodOptional<z.ZodNumber>;
|
|
5374
5379
|
askVerdict: z.ZodOptional<z.ZodBoolean>;
|
|
5380
|
+
offerAlertAction: z.ZodOptional<z.ZodBoolean>;
|
|
5375
5381
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5376
5382
|
id: z.ZodString;
|
|
5377
5383
|
createdBy: z.ZodString;
|
|
@@ -5748,6 +5754,7 @@ export declare const notificationRulesCapability: {
|
|
|
5748
5754
|
groupingSec: z.ZodOptional<z.ZodNumber>;
|
|
5749
5755
|
groupWithinSec: z.ZodOptional<z.ZodNumber>;
|
|
5750
5756
|
askVerdict: z.ZodOptional<z.ZodBoolean>;
|
|
5757
|
+
offerAlertAction: z.ZodOptional<z.ZodBoolean>;
|
|
5751
5758
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5752
5759
|
}, z.core.$strip>;
|
|
5753
5760
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -6118,6 +6125,7 @@ export declare const notificationRulesCapability: {
|
|
|
6118
6125
|
groupingSec: z.ZodOptional<z.ZodNumber>;
|
|
6119
6126
|
groupWithinSec: z.ZodOptional<z.ZodNumber>;
|
|
6120
6127
|
askVerdict: z.ZodOptional<z.ZodBoolean>;
|
|
6128
|
+
offerAlertAction: z.ZodOptional<z.ZodBoolean>;
|
|
6121
6129
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6122
6130
|
id: z.ZodString;
|
|
6123
6131
|
createdBy: z.ZodString;
|
|
@@ -6276,6 +6284,7 @@ export declare const notificationRulesCapability: {
|
|
|
6276
6284
|
groupingSec: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
6277
6285
|
groupWithinSec: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
6278
6286
|
askVerdict: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
6287
|
+
offerAlertAction: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
6279
6288
|
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
6280
6289
|
disabledTargetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6281
6290
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -6880,6 +6889,7 @@ export declare const notificationRulesCapability: {
|
|
|
6880
6889
|
groupingSec: z.ZodOptional<z.ZodNumber>;
|
|
6881
6890
|
groupWithinSec: z.ZodOptional<z.ZodNumber>;
|
|
6882
6891
|
askVerdict: z.ZodOptional<z.ZodBoolean>;
|
|
6892
|
+
offerAlertAction: z.ZodOptional<z.ZodBoolean>;
|
|
6883
6893
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6884
6894
|
id: z.ZodString;
|
|
6885
6895
|
createdBy: z.ZodString;
|
|
@@ -7373,6 +7383,7 @@ export declare const notificationRulesCapability: {
|
|
|
7373
7383
|
groupingSec: z.ZodOptional<z.ZodNumber>;
|
|
7374
7384
|
groupWithinSec: z.ZodOptional<z.ZodNumber>;
|
|
7375
7385
|
askVerdict: z.ZodOptional<z.ZodBoolean>;
|
|
7386
|
+
offerAlertAction: z.ZodOptional<z.ZodBoolean>;
|
|
7376
7387
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7377
7388
|
}, z.core.$strip>;
|
|
7378
7389
|
lookbackMinutes: z.ZodDefault<z.ZodNumber>;
|
|
@@ -7768,6 +7779,7 @@ export declare const notificationRulesCapability: {
|
|
|
7768
7779
|
groupingSec: z.ZodOptional<z.ZodNumber>;
|
|
7769
7780
|
groupWithinSec: z.ZodOptional<z.ZodNumber>;
|
|
7770
7781
|
askVerdict: z.ZodOptional<z.ZodBoolean>;
|
|
7782
|
+
offerAlertAction: z.ZodOptional<z.ZodBoolean>;
|
|
7771
7783
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7772
7784
|
}, z.core.$strip>;
|
|
7773
7785
|
}, z.core.$strip>, z.ZodObject<{
|
package/dist/client.js
CHANGED
|
@@ -24695,6 +24695,15 @@ var NcRuleInputSchema = zod.z.object({
|
|
|
24695
24695
|
*/
|
|
24696
24696
|
askVerdict: zod.z.boolean().optional(),
|
|
24697
24697
|
/**
|
|
24698
|
+
* An ALERT notification (`alert-critical`, `alert-error`, device attention)
|
|
24699
|
+
* carries the alert's own action — an open-URL button and, for an `invoke`
|
|
24700
|
+
* action, a token-authed button that runs it. Absent and `true` mean ON;
|
|
24701
|
+
* `false` switches it off for this rule. `.optional()`, never `.default()`
|
|
24702
|
+
* (a Zod default does not run on the addon cap path), so a rule authored
|
|
24703
|
+
* before this field keeps the action.
|
|
24704
|
+
*/
|
|
24705
|
+
offerAlertAction: zod.z.boolean().optional(),
|
|
24706
|
+
/**
|
|
24698
24707
|
* Operator tags (D1054), kept on the rule like a core block's. Absent = no
|
|
24699
24708
|
* tags. `.optional()`, never `.default()`: a partial `updateRule` patch that
|
|
24700
24709
|
* does not name `tags` keeps the stored ones (the store merges), and an
|
package/dist/client.mjs
CHANGED
|
@@ -24694,6 +24694,15 @@ var NcRuleInputSchema = z.object({
|
|
|
24694
24694
|
*/
|
|
24695
24695
|
askVerdict: z.boolean().optional(),
|
|
24696
24696
|
/**
|
|
24697
|
+
* An ALERT notification (`alert-critical`, `alert-error`, device attention)
|
|
24698
|
+
* carries the alert's own action — an open-URL button and, for an `invoke`
|
|
24699
|
+
* action, a token-authed button that runs it. Absent and `true` mean ON;
|
|
24700
|
+
* `false` switches it off for this rule. `.optional()`, never `.default()`
|
|
24701
|
+
* (a Zod default does not run on the addon cap path), so a rule authored
|
|
24702
|
+
* before this field keeps the action.
|
|
24703
|
+
*/
|
|
24704
|
+
offerAlertAction: z.boolean().optional(),
|
|
24705
|
+
/**
|
|
24697
24706
|
* Operator tags (D1054), kept on the rule like a core block's. Absent = no
|
|
24698
24707
|
* tags. `.optional()`, never `.default()`: a partial `updateRule` patch that
|
|
24699
24708
|
* does not name `tags` keeps the stored ones (the store merges), and an
|
package/dist/index.d.ts
CHANGED
|
@@ -407,7 +407,7 @@ export { alarmPatchLanded, applyBlockingEdit, applyModeDelaysEdits, applyModeDev
|
|
|
407
407
|
export { activateAlarmProfile, alarmProfileById, cloneAlarmSettings, createAlarmProfile, deleteAlarmProfile, ensureAlarmProfiles, isDefaultAlarmProfileId, NC_ALARM_DEFAULT_PROFILE_ID, NC_ALARM_DEFAULT_PROFILE_NAME, NC_ALARM_SYSTEM_DEFAULT_DELAYS, ncAlarmSystemDefaultSettings, type NcAlarmProfileCreateSource, type NcAlarmProfileRecord, type NcAlarmProfilesMutationResult, type NcAlarmProfilesRefuseReason, type NcAlarmProfilesState, renameAlarmProfile, syncActiveAlarmProfileSettings, } from './notification/alarm-profiles.js';
|
|
408
408
|
export { NC_SENSOR_RAISED_FIELD_BY_KIND, NC_SENSOR_TRANSITION_KINDS, NC_SENSOR_TRANSITION_UNSUPPORTED_REASON, sensorRaisedOf, sensorTransitionOffered, } from './notification/sensor-raised.js';
|
|
409
409
|
export { NC_SENSOR_TRANSITION_MEANINGS, sensorTransitionMeaning, type NcSensorTransitionLocale, type NcSensorTransitionMeaning, type NcSensorTransitionPhrase, } from './notification/sensor-transition-meanings.js';
|
|
410
|
-
export { alertEpisodeId, alertEpisodeKind, alertEpisodePayload, alertNodeId, deviceAttentionKind, isAlertEpisodeOpen, isAlertEpisodeSeverity, parseAlertEpisodePayload, AlertEpisodePayloadSchema, type AlertEpisodePayload, type AlertEpisodePhase, } from './notification/alert-episode.js';
|
|
410
|
+
export { alertEpisodeId, alertEpisodeKind, alertEpisodePayload, alertNodeId, deviceAttentionKind, isAlertEpisodeOpen, isAlertEpisodeSeverity, parseAlertEpisodePayload, AlertEpisodePayloadSchema, type AlertEpisodeAction, type AlertEpisodePayload, type AlertEpisodePhase, } from './notification/alert-episode.js';
|
|
411
411
|
export { NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS, NC_TEMPLATE_VARS, isHeldBackTemplateVar, isKnownTemplateVar, servedTemplateVars, templateVarDeliveryApplies, templateVarKindApplies, templateVarSystemEventApplies, templateVarsFor, } from './notification/template-vars.js';
|
|
412
412
|
export { NC_SYSTEM_EVENT_FILTER_KEYS, type NcSystemEventFilterKey, systemEventFilterApplies, systemEventFilterAppliesToAnyKind, } from './notification/system-event-filters.js';
|
|
413
413
|
export { describeSystemEventFamilyProblem, isSystemEventFamily, NC_SYSTEM_EVENT_CONDITION_FILTER_KEYS, NC_SYSTEM_EVENT_FAMILIES, NC_SYSTEM_EVENT_FAMILY, NC_SYSTEM_EVENT_FAMILY_FILTERS, NC_SYSTEM_EVENT_KIND_GROUP_SPECS, type NcSystemEventConditionFilterKey, type NcSystemEventFamily, type NcSystemEventFamilyProblem, type NcSystemEventFamilyVerdict, type NcSystemEventKindGroupSpec, systemEventFamilyOf, systemEventFamilyProblems, systemEventKindNamesOf, systemEventKindsOfFamily, } from './notification/system-event-families.js';
|
package/dist/index.js
CHANGED
|
@@ -83651,6 +83651,15 @@ var NcRuleInputSchema = zod.z.object({
|
|
|
83651
83651
|
*/
|
|
83652
83652
|
askVerdict: zod.z.boolean().optional(),
|
|
83653
83653
|
/**
|
|
83654
|
+
* An ALERT notification (`alert-critical`, `alert-error`, device attention)
|
|
83655
|
+
* carries the alert's own action — an open-URL button and, for an `invoke`
|
|
83656
|
+
* action, a token-authed button that runs it. Absent and `true` mean ON;
|
|
83657
|
+
* `false` switches it off for this rule. `.optional()`, never `.default()`
|
|
83658
|
+
* (a Zod default does not run on the addon cap path), so a rule authored
|
|
83659
|
+
* before this field keeps the action.
|
|
83660
|
+
*/
|
|
83661
|
+
offerAlertAction: zod.z.boolean().optional(),
|
|
83662
|
+
/**
|
|
83654
83663
|
* Operator tags (D1054), kept on the rule like a core block's. Absent = no
|
|
83655
83664
|
* tags. `.optional()`, never `.default()`: a partial `updateRule` patch that
|
|
83656
83665
|
* does not name `tags` keeps the stored ones (the store merges), and an
|
|
@@ -143265,6 +143274,14 @@ var AlertEpisodePayloadSchema = zod.z.object({
|
|
|
143265
143274
|
nodeId: zod.z.string().optional(),
|
|
143266
143275
|
/** The alert's own action link (where the operator acts on it), when it has one. */
|
|
143267
143276
|
actionUrl: zod.z.string().optional(),
|
|
143277
|
+
/**
|
|
143278
|
+
* The alert's WHOLE action — label, link, navigation and `invoke` — on a
|
|
143279
|
+
* raised episode, so a notification can offer it (an absolute open-URL
|
|
143280
|
+
* button, a token-authed invoke button). `actionUrl` stays for the
|
|
143281
|
+
* `{{actionUrl}}` template variable. Additive: an episode published before
|
|
143282
|
+
* this field has none.
|
|
143283
|
+
*/
|
|
143284
|
+
action: AlertActionSchema.optional(),
|
|
143268
143285
|
/** A device fault episode: every active fault (`metadata.faults`), principal first. */
|
|
143269
143286
|
faults: zod.z.array(DeviceFaultSchema).optional(),
|
|
143270
143287
|
at: zod.z.number()
|
|
@@ -143338,6 +143355,7 @@ function alertEpisodePayload(alert, phase, at) {
|
|
|
143338
143355
|
} : {},
|
|
143339
143356
|
...nodeId !== void 0 ? { nodeId } : {},
|
|
143340
143357
|
...alert.action?.href !== void 0 ? { actionUrl: alert.action.href } : {},
|
|
143358
|
+
...phase === "raised" && alert.action !== void 0 ? { action: alert.action } : {},
|
|
143341
143359
|
...faults !== void 0 ? { faults } : {},
|
|
143342
143360
|
at
|
|
143343
143361
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -83650,6 +83650,15 @@ var NcRuleInputSchema = z.object({
|
|
|
83650
83650
|
*/
|
|
83651
83651
|
askVerdict: z.boolean().optional(),
|
|
83652
83652
|
/**
|
|
83653
|
+
* An ALERT notification (`alert-critical`, `alert-error`, device attention)
|
|
83654
|
+
* carries the alert's own action — an open-URL button and, for an `invoke`
|
|
83655
|
+
* action, a token-authed button that runs it. Absent and `true` mean ON;
|
|
83656
|
+
* `false` switches it off for this rule. `.optional()`, never `.default()`
|
|
83657
|
+
* (a Zod default does not run on the addon cap path), so a rule authored
|
|
83658
|
+
* before this field keeps the action.
|
|
83659
|
+
*/
|
|
83660
|
+
offerAlertAction: z.boolean().optional(),
|
|
83661
|
+
/**
|
|
83653
83662
|
* Operator tags (D1054), kept on the rule like a core block's. Absent = no
|
|
83654
83663
|
* tags. `.optional()`, never `.default()`: a partial `updateRule` patch that
|
|
83655
83664
|
* does not name `tags` keeps the stored ones (the store merges), and an
|
|
@@ -143264,6 +143273,14 @@ var AlertEpisodePayloadSchema = z.object({
|
|
|
143264
143273
|
nodeId: z.string().optional(),
|
|
143265
143274
|
/** The alert's own action link (where the operator acts on it), when it has one. */
|
|
143266
143275
|
actionUrl: z.string().optional(),
|
|
143276
|
+
/**
|
|
143277
|
+
* The alert's WHOLE action — label, link, navigation and `invoke` — on a
|
|
143278
|
+
* raised episode, so a notification can offer it (an absolute open-URL
|
|
143279
|
+
* button, a token-authed invoke button). `actionUrl` stays for the
|
|
143280
|
+
* `{{actionUrl}}` template variable. Additive: an episode published before
|
|
143281
|
+
* this field has none.
|
|
143282
|
+
*/
|
|
143283
|
+
action: AlertActionSchema.optional(),
|
|
143267
143284
|
/** A device fault episode: every active fault (`metadata.faults`), principal first. */
|
|
143268
143285
|
faults: z.array(DeviceFaultSchema).optional(),
|
|
143269
143286
|
at: z.number()
|
|
@@ -143337,6 +143354,7 @@ function alertEpisodePayload(alert, phase, at) {
|
|
|
143337
143354
|
} : {},
|
|
143338
143355
|
...nodeId !== void 0 ? { nodeId } : {},
|
|
143339
143356
|
...alert.action?.href !== void 0 ? { actionUrl: alert.action.href } : {},
|
|
143357
|
+
...phase === "raised" && alert.action !== void 0 ? { action: alert.action } : {},
|
|
143340
143358
|
...faults !== void 0 ? { faults } : {},
|
|
143341
143359
|
at
|
|
143342
143360
|
};
|
|
@@ -42,6 +42,19 @@ export declare const AlertEpisodePayloadSchema: z.ZodObject<{
|
|
|
42
42
|
sourceId: z.ZodOptional<z.ZodString>;
|
|
43
43
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
44
44
|
actionUrl: z.ZodOptional<z.ZodString>;
|
|
45
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
label: z.ZodString;
|
|
47
|
+
href: z.ZodOptional<z.ZodString>;
|
|
48
|
+
invoke: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
addonId: z.ZodString;
|
|
50
|
+
action: z.ZodString;
|
|
51
|
+
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
navigation: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
app: "app";
|
|
55
|
+
server: "server";
|
|
56
|
+
}>>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
45
58
|
faults: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
46
59
|
code: z.ZodString;
|
|
47
60
|
label: z.ZodString;
|
|
@@ -53,6 +66,8 @@ export declare const AlertEpisodePayloadSchema: z.ZodObject<{
|
|
|
53
66
|
at: z.ZodNumber;
|
|
54
67
|
}, z.core.$strip>;
|
|
55
68
|
export type AlertEpisodePayload = z.infer<typeof AlertEpisodePayloadSchema>;
|
|
69
|
+
/** The alert's own action, as an episode carries it. */
|
|
70
|
+
export type AlertEpisodeAction = NonNullable<AlertEpisodePayload['action']>;
|
|
56
71
|
/** The payload of an `alert.episode` event's `data`, or `null` when it is not one. */
|
|
57
72
|
export declare function parseAlertEpisodePayload(data: unknown): AlertEpisodePayload | null;
|
|
58
73
|
/** An episode is closed once its alert is completed or dismissed. */
|