@camstack/types 1.2.395 → 1.2.397
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/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/capabilities/notification-rules.cap.d.ts +46 -0
- package/dist/capabilities/osd-manager.cap.d.ts +12 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +236 -4
- package/dist/client.mjs +232 -5
- package/dist/enums/event-category.d.ts +8 -0
- package/dist/enums.js +1 -1
- package/dist/enums.mjs +1 -1
- package/dist/{event-category-DOl51-Ij.mjs → event-category-7pZEBmVg.mjs} +8 -0
- package/dist/{event-category-eSqkye-K.js → event-category-kpu1bZMs.js} +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +247 -3
- package/dist/index.mjs +241 -4
- package/dist/interfaces/event-bus.d.ts +19 -0
- package/dist/notification/system-event-classes.d.ts +73 -0
- package/dist/{sleep-Re8daN0Y.js → sleep-Bo7fq491.js} +1 -1
- package/dist/{sleep-_sV1BE2f.mjs → sleep-CueztlR1.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1122,6 +1122,25 @@ export interface EventCatalog {
|
|
|
1122
1122
|
nodeId?: string;
|
|
1123
1123
|
locationName?: string;
|
|
1124
1124
|
};
|
|
1125
|
+
'notification.rule-broken': {
|
|
1126
|
+
ruleId: string;
|
|
1127
|
+
/** `null` when the row was too broken to say. */
|
|
1128
|
+
ruleName: string | null;
|
|
1129
|
+
/** The first reason; `reasons` carries them all. */
|
|
1130
|
+
reason: 'unparseable' | 'device-deleted' | 'target-deleted';
|
|
1131
|
+
reasons: readonly {
|
|
1132
|
+
code: 'unparseable' | 'device-deleted' | 'target-deleted';
|
|
1133
|
+
/** Device ids (decimal) or target ids; empty for `unparseable`. */
|
|
1134
|
+
ids: readonly string[];
|
|
1135
|
+
/** The first schema issue, for `unparseable`. */
|
|
1136
|
+
detail?: string;
|
|
1137
|
+
}[];
|
|
1138
|
+
offendingIds: readonly string[];
|
|
1139
|
+
};
|
|
1140
|
+
'notification.rule-repaired': {
|
|
1141
|
+
ruleId: string;
|
|
1142
|
+
ruleName: string | null;
|
|
1143
|
+
};
|
|
1125
1144
|
'recording.segment.written': {
|
|
1126
1145
|
deviceId: number;
|
|
1127
1146
|
path?: string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* D906 — system events that come in PAIRS are one CLASS: a "went bad" edge and
|
|
3
|
+
* a "came back" edge of the same condition (a stream offline / back online, a
|
|
4
|
+
* recording stalled / writing again, a rule broken / repaired).
|
|
5
|
+
*
|
|
6
|
+
* Nothing new is STORED: a rule keeps listing edge kinds, and a class is the
|
|
7
|
+
* set of its edges. What the class decides:
|
|
8
|
+
*
|
|
9
|
+
* - an IMMEDIATE system rule that selects a class is told about BOTH edges.
|
|
10
|
+
* A stored instant rule listing only one edge of a class is read as the
|
|
11
|
+
* whole class (`withSystemEventClasses`) — the operator asked for both
|
|
12
|
+
* fronts, and a rule that heard "offline" and never "back online" left
|
|
13
|
+
* every outage open-ended on the phone.
|
|
14
|
+
* - a SCHEDULED STATE SUMMARY (`systemEventDelivery.mode: 'summary'`) reads a
|
|
15
|
+
* class as a SNAPSHOT of the bad state at the scheduled time — never edges,
|
|
16
|
+
* never recoveries — so it is NOT widened. The summary already reports a
|
|
17
|
+
* state per kind group regardless of which edge was selected (D647).
|
|
18
|
+
*
|
|
19
|
+
* One-edge kinds (a node restarting, an update available, a backup done, the
|
|
20
|
+
* alarm's transitions) stay single. Pure.
|
|
21
|
+
*/
|
|
22
|
+
import type { NcSystemEventCondition, NcSystemEventDelivery, NcSystemEventKind } from '../capabilities/notification-rules.cap.js';
|
|
23
|
+
import { type NcSystemEventFamily } from './system-event-families.js';
|
|
24
|
+
export interface NcSystemEventClassSpec {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly family: NcSystemEventFamily;
|
|
27
|
+
/** The editor's one checkbox. */
|
|
28
|
+
readonly label: string;
|
|
29
|
+
/** The edges into the bad state. */
|
|
30
|
+
readonly bad: readonly NcSystemEventKind[];
|
|
31
|
+
/** The edges out of it. */
|
|
32
|
+
readonly recovery: readonly NcSystemEventKind[];
|
|
33
|
+
/** What the class means on a SCHEDULED summary: the bad state, as a list. */
|
|
34
|
+
readonly snapshotLabel: string;
|
|
35
|
+
/**
|
|
36
|
+
* The state-summary section that snapshots the bad state, or `null` when the
|
|
37
|
+
* summary has no source for this class (it then reports nothing for it).
|
|
38
|
+
*/
|
|
39
|
+
readonly snapshotSection: string | null;
|
|
40
|
+
}
|
|
41
|
+
export declare const NC_SYSTEM_EVENT_CLASS_SPECS: readonly NcSystemEventClassSpec[];
|
|
42
|
+
/** Every edge of a class: what an instant rule selecting it listens to. */
|
|
43
|
+
export declare function systemEventClassKinds(spec: NcSystemEventClassSpec): readonly NcSystemEventKind[];
|
|
44
|
+
/** The class a kind belongs to, or `undefined` for a one-edge kind. */
|
|
45
|
+
export declare function systemEventClassOf(kind: string): NcSystemEventClassSpec | undefined;
|
|
46
|
+
/** Is this kind a RECOVERY edge of some class? */
|
|
47
|
+
export declare function isSystemEventRecoveryKind(kind: string): boolean;
|
|
48
|
+
/** The classes of ONE family, for that family's editor. */
|
|
49
|
+
export declare function systemEventClassesFor(family: NcSystemEventFamily): readonly NcSystemEventClassSpec[];
|
|
50
|
+
/**
|
|
51
|
+
* A kind list with the OTHER front of every class it touches: a bad edge
|
|
52
|
+
* brings the class's recovery, a recovery brings the class's bad edges. A
|
|
53
|
+
* sibling bad edge is never added by a bad edge — a rule on
|
|
54
|
+
* `storage-location-critical` does not start hearing `storage-location-low`.
|
|
55
|
+
* Input order is kept, each added edge right after the kind that brought it.
|
|
56
|
+
* Kinds of no class (and legacy names) pass through.
|
|
57
|
+
*/
|
|
58
|
+
export declare function expandSystemEventClasses(kinds: readonly NcSystemEventKind[]): NcSystemEventKind[];
|
|
59
|
+
/** The part of a rule {@link withSystemEventClasses} reads. */
|
|
60
|
+
export interface NcSystemEventClassSubject {
|
|
61
|
+
readonly delivery: string;
|
|
62
|
+
readonly conditions: {
|
|
63
|
+
readonly systemEvent?: NcSystemEventCondition;
|
|
64
|
+
};
|
|
65
|
+
readonly systemEventDelivery?: NcSystemEventDelivery;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* An INSTANT system rule with each class it touches completed with both edges;
|
|
69
|
+
* the rule itself (same object) when there is nothing to add, a summary rule,
|
|
70
|
+
* or a rule spanning families (`mixed` stays read-only, D637). A copy, never a
|
|
71
|
+
* mutation.
|
|
72
|
+
*/
|
|
73
|
+
export declare function withSystemEventClasses<T extends NcSystemEventClassSubject>(rule: T): T;
|