@camstack/types 1.2.296 → 1.2.298
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 -1
- package/dist/addon.mjs +2 -1
- package/dist/capabilities/calendar-source.cap.d.ts +75 -0
- package/dist/capabilities/calendars.cap.d.ts +68 -0
- package/dist/capabilities/index.d.ts +8 -2
- package/dist/capabilities/notification-rules.cap.d.ts +619 -0
- package/dist/generated/addon-api.d.ts +80 -0
- package/dist/generated/capability-router-map.d.ts +10 -4
- package/dist/generated/collection-array-methods.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +451 -0
- package/dist/index.mjs +426 -1
- package/dist/notification/alarm-profiles.d.ts +70 -0
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alarm configuration profiles — named snapshots of {@link NcAlarmSettings}.
|
|
3
|
+
*
|
|
4
|
+
* One active profile globally (not per arm mode): summer vs winter is a whole
|
|
5
|
+
* membership set, and arm decisions always read the flat settings the active
|
|
6
|
+
* profile last applied. Pure functions only — no I/O, no clock.
|
|
7
|
+
*
|
|
8
|
+
* Create without a source → system defaults (empty memberships, stock delays).
|
|
9
|
+
* Create with `cloneFromId` → a copy of that profile's settings.
|
|
10
|
+
* The Default profile always exists after {@link ensureAlarmProfiles}; it cannot
|
|
11
|
+
* be deleted. Switching active applies that profile's blob for arm decisions.
|
|
12
|
+
*/
|
|
13
|
+
import type { NcAlarmSettings } from '../capabilities/notification-rules.cap.js';
|
|
14
|
+
/** Stable id of the always-present Default profile (migrated from flat settings). */
|
|
15
|
+
export declare const NC_ALARM_DEFAULT_PROFILE_ID = "default";
|
|
16
|
+
export declare const NC_ALARM_DEFAULT_PROFILE_NAME = "Default";
|
|
17
|
+
/** Stock delays — same numbers the panel shipped with before any editor existed. */
|
|
18
|
+
export declare const NC_ALARM_SYSTEM_DEFAULT_DELAYS: {
|
|
19
|
+
readonly exitDelaySec: 30;
|
|
20
|
+
readonly entryDelaySec: 20;
|
|
21
|
+
readonly triggeredDurationSec: 0;
|
|
22
|
+
};
|
|
23
|
+
/** Empty memberships + stock delays + no announce targets. */
|
|
24
|
+
export declare function ncAlarmSystemDefaultSettings(): NcAlarmSettings;
|
|
25
|
+
export interface NcAlarmProfileRecord {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly settings: NcAlarmSettings;
|
|
29
|
+
}
|
|
30
|
+
export interface NcAlarmProfilesState {
|
|
31
|
+
readonly activeId: string;
|
|
32
|
+
readonly profiles: readonly NcAlarmProfileRecord[];
|
|
33
|
+
}
|
|
34
|
+
export type NcAlarmProfileCreateSource = {
|
|
35
|
+
readonly kind: 'defaults';
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: 'clone';
|
|
38
|
+
readonly fromId: string;
|
|
39
|
+
};
|
|
40
|
+
export type NcAlarmProfilesMutationResult = {
|
|
41
|
+
readonly kind: 'ok';
|
|
42
|
+
readonly state: NcAlarmProfilesState;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'refused';
|
|
45
|
+
readonly reason: NcAlarmProfilesRefuseReason;
|
|
46
|
+
readonly detail?: string;
|
|
47
|
+
};
|
|
48
|
+
export type NcAlarmProfilesRefuseReason = 'not-found' | 'name-empty' | 'name-taken' | 'cannot-delete-default' | 'cannot-rename-default-id' | 'clone-source-missing';
|
|
49
|
+
export declare function isDefaultAlarmProfileId(id: string): boolean;
|
|
50
|
+
/** Deep-enough copy of a settings blob (arrays replaced, never mutated). */
|
|
51
|
+
export declare function cloneAlarmSettings(settings: NcAlarmSettings): NcAlarmSettings;
|
|
52
|
+
/**
|
|
53
|
+
* Seed Default from the panel's current flat settings when no profiles exist yet
|
|
54
|
+
* (first boot after this feature, or a wiped profiles key).
|
|
55
|
+
*/
|
|
56
|
+
export declare function ensureAlarmProfiles(state: NcAlarmProfilesState | null | undefined, currentSettings: NcAlarmSettings): NcAlarmProfilesState;
|
|
57
|
+
export declare function createAlarmProfile(state: NcAlarmProfilesState, input: {
|
|
58
|
+
readonly name: string;
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly source: NcAlarmProfileCreateSource;
|
|
61
|
+
}): NcAlarmProfilesMutationResult;
|
|
62
|
+
export declare function renameAlarmProfile(state: NcAlarmProfilesState, input: {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly name: string;
|
|
65
|
+
}): NcAlarmProfilesMutationResult;
|
|
66
|
+
export declare function deleteAlarmProfile(state: NcAlarmProfilesState, id: string): NcAlarmProfilesMutationResult;
|
|
67
|
+
export declare function activateAlarmProfile(state: NcAlarmProfilesState, id: string): NcAlarmProfilesMutationResult;
|
|
68
|
+
/** Persist the live flat settings into the active profile's blob. */
|
|
69
|
+
export declare function syncActiveAlarmProfileSettings(state: NcAlarmProfilesState, settings: NcAlarmSettings): NcAlarmProfilesState;
|
|
70
|
+
export declare function alarmProfileById(state: NcAlarmProfilesState, id: string): NcAlarmProfileRecord | undefined;
|