@camstack/types 1.2.247 → 1.2.249
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.d.ts +1 -1
- package/dist/addon.js +29 -1
- package/dist/addon.mjs +28 -2
- package/dist/capabilities/index.d.ts +1 -1
- package/dist/capabilities/notification-rules.cap.d.ts +1224 -11
- package/dist/capabilities/osd-manager.cap.d.ts +24 -0
- package/dist/device/linked-device-resolve.d.ts +74 -0
- package/dist/generated/addon-api.d.ts +14 -0
- package/dist/generated/collection-array-methods.d.ts +18 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1133 -24
- package/dist/index.mjs +1117 -25
- package/dist/notification/template-vars.d.ts +24 -0
- package/dist/{sleep-9gM_dS-5.js → sleep-CvwUEq16.js} +2 -0
- package/dist/{sleep-PEo0-Fz9.mjs → sleep-pM_J7YnY.mjs} +2 -0
- package/package.json +1 -1
|
@@ -168,6 +168,10 @@ export declare const OsdSlotBindingSchema: z.ZodObject<{
|
|
|
168
168
|
"alarm-disarmed": "alarm-disarmed";
|
|
169
169
|
"alarm-arming": "alarm-arming";
|
|
170
170
|
"alarm-arm-refused": "alarm-arm-refused";
|
|
171
|
+
"alarm-pending": "alarm-pending";
|
|
172
|
+
"alarm-rearmed": "alarm-rearmed";
|
|
173
|
+
"alarm-sensor-bypass": "alarm-sensor-bypass";
|
|
174
|
+
"alarm-check-failed": "alarm-check-failed";
|
|
171
175
|
"addon-updated": "addon-updated";
|
|
172
176
|
"server-updated": "server-updated";
|
|
173
177
|
"export-completed": "export-completed";
|
|
@@ -339,6 +343,10 @@ export declare const OsdSlotViewSchema: z.ZodObject<{
|
|
|
339
343
|
"alarm-disarmed": "alarm-disarmed";
|
|
340
344
|
"alarm-arming": "alarm-arming";
|
|
341
345
|
"alarm-arm-refused": "alarm-arm-refused";
|
|
346
|
+
"alarm-pending": "alarm-pending";
|
|
347
|
+
"alarm-rearmed": "alarm-rearmed";
|
|
348
|
+
"alarm-sensor-bypass": "alarm-sensor-bypass";
|
|
349
|
+
"alarm-check-failed": "alarm-check-failed";
|
|
342
350
|
"addon-updated": "addon-updated";
|
|
343
351
|
"server-updated": "server-updated";
|
|
344
352
|
"export-completed": "export-completed";
|
|
@@ -582,6 +590,10 @@ export declare const osdManagerCapability: {
|
|
|
582
590
|
"alarm-disarmed": "alarm-disarmed";
|
|
583
591
|
"alarm-arming": "alarm-arming";
|
|
584
592
|
"alarm-arm-refused": "alarm-arm-refused";
|
|
593
|
+
"alarm-pending": "alarm-pending";
|
|
594
|
+
"alarm-rearmed": "alarm-rearmed";
|
|
595
|
+
"alarm-sensor-bypass": "alarm-sensor-bypass";
|
|
596
|
+
"alarm-check-failed": "alarm-check-failed";
|
|
585
597
|
"addon-updated": "addon-updated";
|
|
586
598
|
"server-updated": "server-updated";
|
|
587
599
|
"export-completed": "export-completed";
|
|
@@ -842,6 +854,10 @@ export declare const osdManagerCapability: {
|
|
|
842
854
|
"alarm-disarmed": "alarm-disarmed";
|
|
843
855
|
"alarm-arming": "alarm-arming";
|
|
844
856
|
"alarm-arm-refused": "alarm-arm-refused";
|
|
857
|
+
"alarm-pending": "alarm-pending";
|
|
858
|
+
"alarm-rearmed": "alarm-rearmed";
|
|
859
|
+
"alarm-sensor-bypass": "alarm-sensor-bypass";
|
|
860
|
+
"alarm-check-failed": "alarm-check-failed";
|
|
845
861
|
"addon-updated": "addon-updated";
|
|
846
862
|
"server-updated": "server-updated";
|
|
847
863
|
"export-completed": "export-completed";
|
|
@@ -1012,6 +1028,10 @@ export declare const osdManagerCapability: {
|
|
|
1012
1028
|
"alarm-disarmed": "alarm-disarmed";
|
|
1013
1029
|
"alarm-arming": "alarm-arming";
|
|
1014
1030
|
"alarm-arm-refused": "alarm-arm-refused";
|
|
1031
|
+
"alarm-pending": "alarm-pending";
|
|
1032
|
+
"alarm-rearmed": "alarm-rearmed";
|
|
1033
|
+
"alarm-sensor-bypass": "alarm-sensor-bypass";
|
|
1034
|
+
"alarm-check-failed": "alarm-check-failed";
|
|
1015
1035
|
"addon-updated": "addon-updated";
|
|
1016
1036
|
"server-updated": "server-updated";
|
|
1017
1037
|
"export-completed": "export-completed";
|
|
@@ -1214,6 +1234,10 @@ export declare const osdManagerCapability: {
|
|
|
1214
1234
|
"alarm-disarmed": "alarm-disarmed";
|
|
1215
1235
|
"alarm-arming": "alarm-arming";
|
|
1216
1236
|
"alarm-arm-refused": "alarm-arm-refused";
|
|
1237
|
+
"alarm-pending": "alarm-pending";
|
|
1238
|
+
"alarm-rearmed": "alarm-rearmed";
|
|
1239
|
+
"alarm-sensor-bypass": "alarm-sensor-bypass";
|
|
1240
|
+
"alarm-check-failed": "alarm-check-failed";
|
|
1217
1241
|
"addon-updated": "addon-updated";
|
|
1218
1242
|
"server-updated": "server-updated";
|
|
1219
1243
|
"export-completed": "export-completed";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which devices a camera's LINKED set resolves to — the pure rules, with no
|
|
3
|
+
* store and no provider context.
|
|
4
|
+
*
|
|
5
|
+
* They live in `@camstack/types` rather than in the device-manager builtin
|
|
6
|
+
* because two surfaces need the SAME answer and a second copy would be a
|
|
7
|
+
* second definition of what a room contains: the hub's boot backfill, and the
|
|
8
|
+
* admin UI's per-room rebuild. Moving them here also keeps that button a
|
|
9
|
+
* framework-free change — a new cap method would only reach a node through a
|
|
10
|
+
* published `@camstack/server` and a restart (D16), which is not what a
|
|
11
|
+
* convenience button is worth.
|
|
12
|
+
*/
|
|
13
|
+
import { DeviceType } from './device-type.js';
|
|
14
|
+
/** The device fields the pure resolver consumes (subset of `DeviceInfo`). */
|
|
15
|
+
export interface LinkCandidate {
|
|
16
|
+
readonly id: number;
|
|
17
|
+
readonly parentDeviceId: number | null;
|
|
18
|
+
readonly location: string | null;
|
|
19
|
+
readonly type: DeviceType;
|
|
20
|
+
/**
|
|
21
|
+
* The child identity a container's stored pick is matched against. A NOT
|
|
22
|
+
* NULL column, so `slim` carries it — which is the whole reason the pick is
|
|
23
|
+
* keyed on it (see `ContainerChildRef.stableId`).
|
|
24
|
+
*/
|
|
25
|
+
readonly stableId: string;
|
|
26
|
+
/** The container's own operator pick, when one was made. */
|
|
27
|
+
readonly primaryChildEntityId?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* The child's `DeviceRole`. Ranked ABOVE `type` when a container picks the
|
|
30
|
+
* child it stands for, because `DeviceType` cannot tell a door contact from a
|
|
31
|
+
* battery reading — Home Assistant maps both to `Sensor`. A first-class meta
|
|
32
|
+
* column, so `slim` carries it.
|
|
33
|
+
*/
|
|
34
|
+
readonly role?: string | null | undefined;
|
|
35
|
+
/** Operator-facing name — used for the namesake tiebreak. Also a column. */
|
|
36
|
+
readonly name?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolve one candidate id to the ids it should actually contribute to a
|
|
40
|
+
* linked set: itself, unless it is a CONTAINER, in which case its own
|
|
41
|
+
* children (recursively expanded the same way — a container-of-containers
|
|
42
|
+
* is vanishingly unlikely per `DeviceType.Container`'s contract, but this
|
|
43
|
+
* costs nothing to handle). `visited` guards a pathological parent-cycle in
|
|
44
|
+
* persisted data from recursing forever; a candidate already on the current
|
|
45
|
+
* expansion path is dropped rather than re-expanded.
|
|
46
|
+
*
|
|
47
|
+
* This is the STRUCTURAL, location-independent way a container's child
|
|
48
|
+
* becomes reachable: the device-tree "children of the camera" rule and a
|
|
49
|
+
* persisted manual pick are parentDeviceId chains, never location-based —
|
|
50
|
+
* a container named there is excluded by expanding into whatever it
|
|
51
|
+
* actually contains, regardless of what its (or its children's) `location`
|
|
52
|
+
* column holds.
|
|
53
|
+
*/
|
|
54
|
+
export declare function expandContainer(id: number, byId: ReadonlyMap<number, LinkCandidate>, byParent: ReadonlyMap<number, readonly LinkCandidate[]>, visited: ReadonlySet<number>, out: Set<number>): void;
|
|
55
|
+
/**
|
|
56
|
+
* What the retired `auto` mode (pre-D356) added beyond the device-tree
|
|
57
|
+
* children: every non-container candidate sharing the camera's location, a
|
|
58
|
+
* container child standing in for its container's PRIMARY child.
|
|
59
|
+
*
|
|
60
|
+
* Two callers, both WRITERS, never the read path: the one-shot boot backfill
|
|
61
|
+
* that materialises it into the manual list
|
|
62
|
+
* (`linked-devices-manual-backfill.ts`), and the admin UI's per-room rebuild.
|
|
63
|
+
* Both ask "what does this room contain", and a second copy of the answer is
|
|
64
|
+
* how two surfaces start disagreeing about a room.
|
|
65
|
+
*
|
|
66
|
+
* A camera with NO location answers `[]`. A caller that would WRITE that must
|
|
67
|
+
* refuse instead: emptying a list because nobody set the room is the silent
|
|
68
|
+
* drop D391 names.
|
|
69
|
+
*/
|
|
70
|
+
export declare function legacyAutoLinkIds(params: {
|
|
71
|
+
readonly selfId: number;
|
|
72
|
+
readonly selfLocation: string | null;
|
|
73
|
+
readonly candidates: readonly LinkCandidate[];
|
|
74
|
+
}): readonly number[];
|
|
@@ -4875,6 +4875,20 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
4875
4875
|
output: z.infer<typeof notificationRulesCapability.methods.getConditionCatalog.output>;
|
|
4876
4876
|
meta: object;
|
|
4877
4877
|
}>;
|
|
4878
|
+
getTemplateCatalog: TRPCQueryProcedure<{
|
|
4879
|
+
input: {
|
|
4880
|
+
[x: string]: unknown;
|
|
4881
|
+
} & z.input<typeof notificationRulesCapability.methods.getTemplateCatalog.input>;
|
|
4882
|
+
output: z.infer<typeof notificationRulesCapability.methods.getTemplateCatalog.output>;
|
|
4883
|
+
meta: object;
|
|
4884
|
+
}>;
|
|
4885
|
+
previewTemplate: TRPCMutationProcedure<{
|
|
4886
|
+
input: {
|
|
4887
|
+
[x: string]: unknown;
|
|
4888
|
+
} & z.input<typeof notificationRulesCapability.methods.previewTemplate.input>;
|
|
4889
|
+
output: z.infer<typeof notificationRulesCapability.methods.previewTemplate.output>;
|
|
4890
|
+
meta: object;
|
|
4891
|
+
}>;
|
|
4878
4892
|
getHistory: TRPCQueryProcedure<{
|
|
4879
4893
|
input: {
|
|
4880
4894
|
[x: string]: unknown;
|
|
@@ -17,3 +17,21 @@ export declare const COLLECTION_ARRAY_METHODS: Readonly<Record<string, readonly
|
|
|
17
17
|
* `isCollectionArrayMethod(capDefsByName.get(capName), method)`.
|
|
18
18
|
*/
|
|
19
19
|
export declare function isCollectionArrayMethodName(capName: string, method: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Per capability, the methods declared `optionalMethod` — the ones whose
|
|
22
|
+
* ABSENCE on a provider is a fact about that provider, not a bug.
|
|
23
|
+
*
|
|
24
|
+
* Coverage: 1 caps, 4 methods.
|
|
25
|
+
*/
|
|
26
|
+
export declare const PROVIDER_OPTIONAL_METHODS: Readonly<Record<string, readonly string[]>>;
|
|
27
|
+
/**
|
|
28
|
+
* True when `method` on cap `capName` is declared `optionalMethod`.
|
|
29
|
+
*
|
|
30
|
+
* `providerOptional` used to be a TYPE-only flag: it made the method optional
|
|
31
|
+
* on `InferProvider` and nothing read it at runtime, so a source that
|
|
32
|
+
* honestly did not implement one produced `INTERNAL_SERVER_ERROR` — the same
|
|
33
|
+
* signature as a method somebody forgot. Measured on the live hub 2026-09-24:
|
|
34
|
+
* `videoclips.getPlaybackOptions` at the recorder's `analytics` source, a
|
|
35
|
+
* time WINDOW with no file behind it, threw on every player open.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isProviderOptionalMethodName(capName: string, method: string): boolean;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* scope+access check inside `protectedProcedure` (see
|
|
7
7
|
* `server/backend/src/api/trpc/trpc.middleware.ts`).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 1172 method paths across 160 capabilities.
|
|
10
10
|
*/
|
|
11
11
|
import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
|
|
12
12
|
export interface MethodAccessRecord {
|
package/dist/index.d.ts
CHANGED
|
@@ -157,6 +157,7 @@ export type { BatteryPresence, BatteryPresenceInput } from './device/battery-pre
|
|
|
157
157
|
export { BATTERY_UNREACHABLE_AFTER_MS, deriveBatteryPresence, isBatteryPresenceFault, } from './device/battery-presence.js';
|
|
158
158
|
export type { ICameraDevice, StreamSourceEntry } from './device/camera-device.js';
|
|
159
159
|
export { CONTAINER_CHILD_PRIORITY, type ContainerChildRef, resolveContainerPrimaryChild, } from './device/container-primary-child.js';
|
|
160
|
+
export { expandContainer, legacyAutoLinkIds, type LinkCandidate, } from './device/linked-device-resolve.js';
|
|
160
161
|
export type { DeclarationPlacement, DeclaredDeviceOutcome, DeclaredDevicePorts, DeclaredDeviceRow, DeclaredDevicesResult, DeclaredDevicesSpec, DeclaredIntegrationRow, DeviceDeclaration, } from './device/declared-device.js';
|
|
161
162
|
export { DECLARED_DEVICE_SWEEP_LIMIT, DECLARED_INTEGRATION_FIXED_KEY, DeclaredDevices, declarationOwnerNodeId, } from './device/declared-device.js';
|
|
162
163
|
export type { IDevice } from './device/device.js';
|
|
@@ -227,6 +228,7 @@ export { type PreparedAction, type PreparedAttachment, type PreparedNotification
|
|
|
227
228
|
export { htmlToText, markdownToHtmlLite, markdownToText, type NotificationFormat as NotificationBodyFormat, resolveFormat, textToHtml, transcodeBody, } from './notification/format-transcode.js';
|
|
228
229
|
export { conditionExclusionReason, conditionVisibleForKind, defaultDeliveryForSection, droppedConditionsForKind, isAudioRule, isOccupancyRule, isSystemDelivery, NC_AUDIO_SEED, NC_OCCUPANCY_DEFAULTS, NC_RULE_EDITOR_SECTION_ORDER, NC_RULE_KIND_SPECS, NC_RULE_SECTIONS, NC_SYSTEM_DELIVERY, type NcDroppedCondition, type NcKindVisibilitySubject, type NcRuleEditorSection, type NcRuleEditorSectionKey, type NcRuleKind, type NcRuleKindSpec, type NcRuleOwningSectionKey, type NcRuleSection, type NcRuleSectionKey, type NcRuleSectionSubject, type NcRuleSeed, parseRuleSection, ruleEditorSectionsForKind, ruleKindOf, ruleKindSpec, ruleMatchesSection, ruleSection, ruleSectionOf, ruleSeedForSection, } from './notification/rule-kinds.js';
|
|
229
230
|
export { isScheduleActive } from './notification/schedule.js';
|
|
231
|
+
export { NC_TEMPLATE_VARS, isKnownTemplateVar, templateVarsFor, } from './notification/template-vars.js';
|
|
230
232
|
export { NC_SYSTEM_EVENT_FILTER_KEYS, type NcSystemEventFilterKey, systemEventFilterApplies, systemEventFilterAppliesToAnyKind, } from './notification/system-event-filters.js';
|
|
231
233
|
export type { TimelapseCadencePair, TimelapsePreviewMode, TimelapseRule, TimelapseRuleInput, TimelapseRulePatch, TimelapseTemplate, } from './notification/timelapse-rule.js';
|
|
232
234
|
export { assertTimelapseCadences, DEFAULT_TIMELAPSE_PREVIEW_TEXT, readTimelapseGeneratedAt, TIMELAPSE_DENSE_FLOOR_SEC, TimelapseRuleInputSchema, TimelapseRulePatchSchema, TimelapseRuleSchema, TimelapseTemplateSchema, } from './notification/timelapse-rule.js';
|