@camstack/types 1.2.300 → 1.2.303
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 +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/automation/recipe.d.ts +2 -2
- package/dist/capabilities/core-blocks.cap.d.ts +17 -17
- package/dist/capabilities/device-admin-link-url.d.ts +2 -2
- package/dist/capabilities/device-admin-link.cap.d.ts +1 -1
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/local-network.cap.d.ts +1 -1
- package/dist/capabilities/notification-output.cap.d.ts +41 -0
- package/dist/capabilities/notification-rules.cap.d.ts +230 -0
- package/dist/device/device-do-actions.d.ts +57 -0
- package/dist/generated/addon-api.d.ts +14 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +545 -23
- package/dist/index.mjs +533 -24
- package/dist/interfaces/config-ui.d.ts +85 -1
- package/dist/notification/alarm-membership.d.ts +9 -0
- package/dist/notification/alarm-profiles.d.ts +5 -4
- package/dist/notification/alarm-settings.d.ts +9 -3
- package/dist/notification/system-event-summary.d.ts +13 -0
- package/dist/{sleep-G4F3X9X_.js → sleep-C3gDpn7G.js} +783 -637
- package/dist/{sleep-CDCONfkt.mjs → sleep-DXKLNFvA.mjs} +783 -637
- package/package.json +1 -1
|
@@ -80,7 +80,7 @@ export interface ConfigSection {
|
|
|
80
80
|
readonly immediate?: boolean;
|
|
81
81
|
readonly fields: readonly ConfigField[];
|
|
82
82
|
}
|
|
83
|
-
export type ConfigField = ConfigTextField | ConfigNumberField | ConfigBooleanField | ConfigSelectField | ConfigMultiSelectField | ConfigTimezoneField | ConfigDateTimeField | ConfigColorField | ConfigPasswordField | ConfigTextAreaField | ConfigSliderField | ConfigTagsField | ConfigGroupField | ConfigSubTabsField | ConfigSeparatorField | ConfigInfoField | ConfigQrCodeField | ConfigObjectArrayField | ConfigEditableArrayField | ConfigModelSelectorField | ConfigStorageLocationField | ConfigProbeField | ConfigButtonField | ConfigPipelineEditorField | ConfigNodeSelectField | ConfigNodeMultiSelectField | ConfigDeviceSelectField | ConfigDeviceMultiSelectField | ConfigWidgetField | ConfigAddonActionSelectField | ConfigAddonActionButtonField | ConfigDeviceActionButtonField;
|
|
83
|
+
export type ConfigField = ConfigTextField | ConfigNumberField | ConfigBooleanField | ConfigSelectField | ConfigMultiSelectField | ConfigTimezoneField | ConfigDateTimeField | ConfigColorField | ConfigPasswordField | ConfigTextAreaField | ConfigSliderField | ConfigTagsField | ConfigScheduleField | ConfigGroupField | ConfigSubTabsField | ConfigSeparatorField | ConfigInfoField | ConfigQrCodeField | ConfigObjectArrayField | ConfigEditableArrayField | ConfigModelSelectorField | ConfigStorageLocationField | ConfigProbeField | ConfigButtonField | ConfigPipelineEditorField | ConfigNodeSelectField | ConfigNodeMultiSelectField | ConfigDeviceSelectField | ConfigDeviceMultiSelectField | ConfigNotificationTargetSelectField | ConfigNotificationTargetMultiSelectField | ConfigWidgetField | ConfigAddonActionSelectField | ConfigAddonActionButtonField | ConfigDeviceActionButtonField;
|
|
84
84
|
/**
|
|
85
85
|
* Per-MODEL applicability of a pipeline-step setting (D214).
|
|
86
86
|
*
|
|
@@ -324,12 +324,31 @@ export interface ConfigBooleanField extends ConfigFieldBase {
|
|
|
324
324
|
export interface ConfigSelectField extends ConfigFieldBase {
|
|
325
325
|
type: 'select';
|
|
326
326
|
options: readonly ConfigOption[];
|
|
327
|
+
/**
|
|
328
|
+
* Key of a sibling stored `string[]` catalog. Each entry becomes an
|
|
329
|
+
* option `{ value, label }` at hydrate time (merged with `options`).
|
|
330
|
+
* Same idea as tags `suggestionsFrom`, for a closed dropdown.
|
|
331
|
+
*/
|
|
332
|
+
optionsFrom?: string;
|
|
327
333
|
dependsOn?: Record<string, unknown>;
|
|
328
334
|
}
|
|
329
335
|
export interface ConfigMultiSelectField extends ConfigFieldBase {
|
|
330
336
|
type: 'multiselect';
|
|
331
337
|
options: readonly ConfigOption[];
|
|
338
|
+
/**
|
|
339
|
+
* Key of a sibling stored `string[]` catalog. Each entry becomes an
|
|
340
|
+
* option `{ value, label }` at hydrate time (merged with `options`).
|
|
341
|
+
* Same idea as tags `suggestionsFrom`, for a closed multi-picker.
|
|
342
|
+
*/
|
|
343
|
+
optionsFrom?: string;
|
|
332
344
|
maxItems?: number;
|
|
345
|
+
/**
|
|
346
|
+
* When true, the operator may commit values that are not in `options`.
|
|
347
|
+
* Default false — closed catalogs stay closed.
|
|
348
|
+
*/
|
|
349
|
+
creatable?: boolean;
|
|
350
|
+
/** Footer label for the “add value” action in the dropdown. Default “Add new…”. */
|
|
351
|
+
createLabel?: string;
|
|
333
352
|
}
|
|
334
353
|
/**
|
|
335
354
|
* Friendly timezone picker. The stored value is an IANA timezone id
|
|
@@ -423,6 +442,23 @@ export interface ConfigDeviceMultiSelectField extends ConfigFieldBase {
|
|
|
423
442
|
*/
|
|
424
443
|
suggestLocation?: string | null;
|
|
425
444
|
}
|
|
445
|
+
/**
|
|
446
|
+
* Pick a SINGLE `notification-output` target from the live catalog
|
|
447
|
+
* (`listTargets`). Stored value is the target id string. Same control the
|
|
448
|
+
* Notification Center editors use — scripts and addon settings must not
|
|
449
|
+
* invent a parallel free-text "target id" field.
|
|
450
|
+
*/
|
|
451
|
+
export interface ConfigNotificationTargetSelectField extends ConfigFieldBase {
|
|
452
|
+
type: 'notification-target-select';
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Pick MULTIPLE `notification-output` targets. Stored value is a `string[]`
|
|
456
|
+
* of target ids.
|
|
457
|
+
*/
|
|
458
|
+
export interface ConfigNotificationTargetMultiSelectField extends ConfigFieldBase {
|
|
459
|
+
type: 'notification-target-multiselect';
|
|
460
|
+
maxItems?: number;
|
|
461
|
+
}
|
|
426
462
|
export interface ConfigPasswordField extends ConfigFieldBase {
|
|
427
463
|
type: 'password';
|
|
428
464
|
showToggle?: boolean;
|
|
@@ -469,7 +505,49 @@ export interface ConfigSliderField extends ConfigFieldBase {
|
|
|
469
505
|
export interface ConfigTagsField extends ConfigFieldBase {
|
|
470
506
|
type: 'tags';
|
|
471
507
|
suggestions?: string[];
|
|
508
|
+
/**
|
|
509
|
+
* Key of a sibling stored value that holds a `string[]` of extra
|
|
510
|
+
* suggestions (e.g. a scrape-filled `channelCatalog`). Merged into
|
|
511
|
+
* `suggestions` at hydrate time so a form can offer a live catalog
|
|
512
|
+
* without baking it into the static schema.
|
|
513
|
+
*/
|
|
514
|
+
suggestionsFrom?: string;
|
|
472
515
|
maxTags?: number;
|
|
516
|
+
/**
|
|
517
|
+
* When true (default for tags fields), the operator may add values outside
|
|
518
|
+
* the suggestion catalog. Set false to restrict to known suggestions only.
|
|
519
|
+
*/
|
|
520
|
+
creatable?: boolean;
|
|
521
|
+
/** Footer label for the “add value” action. Default “Add new…”. */
|
|
522
|
+
createLabel?: string;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Weekly schedule — the same `NcSchedule` editor used by Notification Center.
|
|
526
|
+
* Value shape is {@link NcSchedule} (or `undefined` = always / unset).
|
|
527
|
+
*
|
|
528
|
+
* Two authoring modes, one wire shape:
|
|
529
|
+
* - `windows` (default) — start→end bands ("active WHILE inside")
|
|
530
|
+
* - `times` — one HH:MM per row ("fire AT"), stored as one-minute windows
|
|
531
|
+
*
|
|
532
|
+
* The consumer decides what a window means at evaluation time.
|
|
533
|
+
*/
|
|
534
|
+
export interface ConfigScheduleField extends ConfigFieldBase {
|
|
535
|
+
type: 'schedule';
|
|
536
|
+
/**
|
|
537
|
+
* `windows` — start→end activation bands (default).
|
|
538
|
+
* `times` — punctual send/fire times (single clock per row).
|
|
539
|
+
*/
|
|
540
|
+
mode?: 'windows' | 'times';
|
|
541
|
+
/** Default windows when the store has no value yet. */
|
|
542
|
+
default?: {
|
|
543
|
+
readonly windows: readonly {
|
|
544
|
+
readonly days: readonly number[];
|
|
545
|
+
readonly startMinute: number;
|
|
546
|
+
readonly endMinute: number;
|
|
547
|
+
}[];
|
|
548
|
+
readonly timezone?: string;
|
|
549
|
+
readonly invert?: boolean;
|
|
550
|
+
};
|
|
473
551
|
}
|
|
474
552
|
export interface ConfigGroupField extends ConfigFieldBase {
|
|
475
553
|
type: 'group';
|
|
@@ -914,6 +992,8 @@ export type ConfigFieldWithValue = (ConfigTextField & {
|
|
|
914
992
|
readonly value: unknown;
|
|
915
993
|
}) | (ConfigTagsField & {
|
|
916
994
|
readonly value: unknown;
|
|
995
|
+
}) | (ConfigScheduleField & {
|
|
996
|
+
readonly value: unknown;
|
|
917
997
|
}) | ConfigGroupFieldWithValue | ConfigSubTabsFieldWithValue | ConfigSeparatorField | ConfigInfoField | ConfigQrCodeField | ConfigObjectArrayField | (ConfigEditableArrayField & {
|
|
918
998
|
readonly value: unknown;
|
|
919
999
|
}) | (ConfigModelSelectorField & {
|
|
@@ -932,6 +1012,10 @@ export type ConfigFieldWithValue = (ConfigTextField & {
|
|
|
932
1012
|
readonly value: unknown;
|
|
933
1013
|
}) | (ConfigDeviceMultiSelectField & {
|
|
934
1014
|
readonly value: unknown;
|
|
1015
|
+
}) | (ConfigNotificationTargetSelectField & {
|
|
1016
|
+
readonly value: unknown;
|
|
1017
|
+
}) | (ConfigNotificationTargetMultiSelectField & {
|
|
1018
|
+
readonly value: unknown;
|
|
935
1019
|
}) | ConfigWidgetField | (ConfigAddonActionSelectField & {
|
|
936
1020
|
readonly value: unknown;
|
|
937
1021
|
}) | ConfigAddonActionButtonField | ConfigDeviceActionButtonField;
|
|
@@ -42,6 +42,8 @@ export interface NcAlarmMembershipSubject {
|
|
|
42
42
|
*/
|
|
43
43
|
readonly sequenceActionsOf?: (sequenceId: string) => readonly NcRuleAction[] | undefined;
|
|
44
44
|
}
|
|
45
|
+
/** True when the rule's deviceState gate names any `armed_*` word. */
|
|
46
|
+
export declare function ruleGatedOnArmedState(rule: NcAlarmMembershipSubject): boolean;
|
|
45
47
|
/**
|
|
46
48
|
* A rule belongs to the alarm when its `deviceState` gate names ANY device's
|
|
47
49
|
* `armed_*` word, or an on-match binding pulls the alarm panel's trigger
|
|
@@ -49,6 +51,13 @@ export interface NcAlarmMembershipSubject {
|
|
|
49
51
|
* escalation.
|
|
50
52
|
*/
|
|
51
53
|
export declare function ruleBelongsToAlarm(rule: NcAlarmMembershipSubject): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* A rule gated on `armed_*` auto-triggers the CamStack `alarm-panel` on match
|
|
56
|
+
* — no `onTrigger` sequence required. Sirens are never part of this path.
|
|
57
|
+
* An explicit `alarm-panel.trigger` binding without an armed gate stays
|
|
58
|
+
* explicit actuation only ({@link ruleBelongsToAlarm}).
|
|
59
|
+
*/
|
|
60
|
+
export declare function ruleAutoTriggersAlarm(rule: NcAlarmMembershipSubject): boolean;
|
|
52
61
|
/** Copy the editors show when {@link sensorTransitionNeverFires} is true. */
|
|
53
62
|
export declare const NC_SENSOR_TRANSITION_NEVER_FIRES_WARNING = "This rule belongs to the alarm, and an alarm rule fires only when an opening OPENS. Set to \u201Conly when it clears\u201D, it can never fire.";
|
|
54
63
|
/**
|
|
@@ -14,11 +14,12 @@ import type { NcAlarmSettings } from '../capabilities/notification-rules.cap.js'
|
|
|
14
14
|
/** Stable id of the always-present Default profile (migrated from flat settings). */
|
|
15
15
|
export declare const NC_ALARM_DEFAULT_PROFILE_ID = "default";
|
|
16
16
|
export declare const NC_ALARM_DEFAULT_PROFILE_NAME = "Default";
|
|
17
|
-
/** Stock delays —
|
|
17
|
+
/** Stock delays — re-arm 10 s after trigger (inherited by every mode). */
|
|
18
18
|
export declare const NC_ALARM_SYSTEM_DEFAULT_DELAYS: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
exitDelaySec: number;
|
|
20
|
+
entryDelaySec: number;
|
|
21
|
+
triggeredDurationSec: number;
|
|
22
|
+
postTriggeredAction: "rearmAfter";
|
|
22
23
|
};
|
|
23
24
|
/** Empty memberships + stock delays + no announce targets. */
|
|
24
25
|
export declare function ncAlarmSystemDefaultSettings(): NcAlarmSettings;
|
|
@@ -5,15 +5,21 @@
|
|
|
5
5
|
* The engine and both clients call these; nobody re-implements them. No I/O, no clock.
|
|
6
6
|
*/
|
|
7
7
|
import type { AlarmArmMode } from '../capabilities/alarm-panel.cap.js';
|
|
8
|
-
import { type NcAlarmBlocking, type NcAlarmBlockingEdit, type NcAlarmModeDelays, type NcAlarmModeDelaysEdit, type NcAlarmModeDeviceList, type NcAlarmNonBlocking, type NcAlarmNonBlockingEdit, type NcAlarmSecureOnArmEdit, type NcAlarmSecureOnArmOff, type NcAlarmSettings, type NcAlarmSettingsPatch } from '../capabilities/notification-rules.cap.js';
|
|
8
|
+
import { type NcAlarmBlocking, type NcAlarmBlockingEdit, type NcAlarmModeDelays, type NcAlarmModeDelaysEdit, type NcAlarmModeDeviceList, type NcAlarmNonBlocking, type NcAlarmNonBlockingEdit, type NcAlarmPostTriggeredAction, type NcAlarmSecureOnArmEdit, type NcAlarmSecureOnArmOff, type NcAlarmSettings, type NcAlarmSettingsPatch } from '../capabilities/notification-rules.cap.js';
|
|
9
9
|
export type NcAlarmDelayField = 'exitDelaySec' | 'entryDelaySec' | 'triggeredDurationSec';
|
|
10
10
|
export declare const NC_ALARM_DELAY_FIELDS: readonly NcAlarmDelayField[];
|
|
11
11
|
export type NcAlarmDelaySource = 'mode' | 'default';
|
|
12
|
+
/**
|
|
13
|
+
* Derive the post-triggered action from a stored blob that may predate the field:
|
|
14
|
+
* a positive duration meant re-arm; zero/absent meant stay triggered.
|
|
15
|
+
*/
|
|
16
|
+
export declare function derivePostTriggeredAction(action: NcAlarmPostTriggeredAction | undefined, triggeredDurationSec: number): NcAlarmPostTriggeredAction;
|
|
12
17
|
export interface NcAlarmResolvedDelays {
|
|
13
18
|
readonly exitDelaySec: number;
|
|
14
19
|
readonly entryDelaySec: number;
|
|
15
20
|
readonly triggeredDurationSec: number;
|
|
16
|
-
readonly
|
|
21
|
+
readonly postTriggeredAction: NcAlarmPostTriggeredAction;
|
|
22
|
+
readonly source: Readonly<Record<NcAlarmDelayField | 'postTriggeredAction', NcAlarmDelaySource>>;
|
|
17
23
|
}
|
|
18
24
|
/**
|
|
19
25
|
* A settings answer as it travels on the wire. Clients do not parse answers, so a hub older
|
|
@@ -27,7 +33,7 @@ export type NcAlarmSettingsAnswer = Omit<NcAlarmSettings, 'modeDelays' | 'nonBlo
|
|
|
27
33
|
readonly blocking?: readonly NcAlarmBlocking[];
|
|
28
34
|
readonly secureOnArmOff?: readonly NcAlarmSecureOnArmOff[];
|
|
29
35
|
};
|
|
30
|
-
export type NcAlarmDelaySettings = Pick<NcAlarmSettingsAnswer, NcAlarmDelayField | 'modeDelays'>;
|
|
36
|
+
export type NcAlarmDelaySettings = Pick<NcAlarmSettingsAnswer, NcAlarmDelayField | 'modeDelays' | 'postTriggeredAction'>;
|
|
31
37
|
/** What `mode` actually runs on: its own overrides, the global value for every other field. */
|
|
32
38
|
export declare function resolveModeDelays(settings: NcAlarmDelaySettings, mode: AlarmArmMode): NcAlarmResolvedDelays;
|
|
33
39
|
/**
|
|
@@ -80,6 +80,19 @@ export declare function scheduleForSendTimes(times: readonly NcSummarySendTime[]
|
|
|
80
80
|
* the raw windows and says the summary is sent when each one ENDS.
|
|
81
81
|
*/
|
|
82
82
|
export declare function sendTimesOfSchedule(schedule: NcSchedule): readonly NcSummarySendTime[] | null;
|
|
83
|
+
/**
|
|
84
|
+
* Punctual times for a `mode: 'times'` editor.
|
|
85
|
+
*
|
|
86
|
+
* Exact one-minute windows win. Otherwise each window's END is the fire time
|
|
87
|
+
* (summary delivery fires when a window closes) — so a legacy 17:00→18:00 band
|
|
88
|
+
* authored as a range still opens as a single "At 18:00" row instead of two
|
|
89
|
+
* clocks. `null` only when inverted (cannot map to punctual rows).
|
|
90
|
+
*/
|
|
91
|
+
export declare function sendTimesForEditor(schedule: NcSchedule): {
|
|
92
|
+
readonly times: readonly NcSummarySendTime[];
|
|
93
|
+
/** True when at least one window was longer than one minute. */
|
|
94
|
+
readonly approximated: boolean;
|
|
95
|
+
} | null;
|
|
83
96
|
/**
|
|
84
97
|
* Does a custom BODY carry the summary's content (`{{summaryText}}` or a
|
|
85
98
|
* section variable)? A body that does not would send a summary with nothing
|