@camstack/types 1.2.89 → 1.2.91
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/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export type * from './interfaces/ffmpeg.js';
|
|
|
54
54
|
export type * from './interfaces/frame-handle.js';
|
|
55
55
|
export type * from './interfaces/inference-capabilities.js';
|
|
56
56
|
export type * from './interfaces/inference-engine.js';
|
|
57
|
-
export type {
|
|
57
|
+
export type { CreateIntegrationInput, IIntegrationRegistry, Integration, } from './interfaces/integration-registry.js';
|
|
58
58
|
export type * from './interfaces/kernel-abstractions.js';
|
|
59
59
|
export type * from './interfaces/lifecycle.js';
|
|
60
60
|
export type * from './interfaces/logging.js';
|
|
@@ -8,24 +8,6 @@ export interface Integration {
|
|
|
8
8
|
readonly createdAt: number;
|
|
9
9
|
readonly updatedAt: number;
|
|
10
10
|
}
|
|
11
|
-
/** Persisted device */
|
|
12
|
-
export interface PersistedDevice {
|
|
13
|
-
readonly id: string;
|
|
14
|
-
readonly integrationId: string;
|
|
15
|
-
readonly stableId: string;
|
|
16
|
-
readonly type: string;
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly enabled: boolean;
|
|
19
|
-
readonly info: Readonly<Record<string, unknown>>;
|
|
20
|
-
readonly createdAt: number;
|
|
21
|
-
readonly updatedAt: number;
|
|
22
|
-
}
|
|
23
|
-
/** Setting entry with typed value */
|
|
24
|
-
export interface TypedSetting {
|
|
25
|
-
readonly key: string;
|
|
26
|
-
readonly value: string;
|
|
27
|
-
readonly valueType: 'string' | 'number' | 'boolean' | 'json';
|
|
28
|
-
}
|
|
29
11
|
/** Input for creating an integration */
|
|
30
12
|
export interface CreateIntegrationInput {
|
|
31
13
|
readonly addonId: string;
|
|
@@ -34,25 +16,18 @@ export interface CreateIntegrationInput {
|
|
|
34
16
|
readonly info?: Record<string, unknown>;
|
|
35
17
|
readonly settings?: Record<string, unknown>;
|
|
36
18
|
}
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
readonly stableId: string;
|
|
50
|
-
readonly type: string;
|
|
51
|
-
readonly name: string;
|
|
52
|
-
readonly info?: Record<string, unknown>;
|
|
53
|
-
readonly settings?: Record<string, unknown>;
|
|
54
|
-
}
|
|
55
|
-
/** Registry interface for managing integrations and devices */
|
|
19
|
+
/**
|
|
20
|
+
* The integration store.
|
|
21
|
+
*
|
|
22
|
+
* It carried a device half until 2026-08-19 — `createDevice`, `listCameras`,
|
|
23
|
+
* `setDeviceSetting` and a `dev_NNNN` id-space — declared on this interface,
|
|
24
|
+
* implemented over two SQLite tables, wrapped by the visibility filter, and
|
|
25
|
+
* called by nothing. Both tables held 0 rows against 974 live devices. The
|
|
26
|
+
* device authority is the `device-manager` capability
|
|
27
|
+
* ([D183](../../decisions/adr-0183-code-that-is-deleted-takes-its-tables-with-it.md));
|
|
28
|
+
* this interface is integrations only, and adding a device method back means
|
|
29
|
+
* creating a second authority.
|
|
30
|
+
*/
|
|
56
31
|
export interface IIntegrationRegistry {
|
|
57
32
|
createIntegration(input: CreateIntegrationInput): Promise<Integration>;
|
|
58
33
|
getIntegration(id: string): Promise<Integration | null>;
|
|
@@ -63,14 +38,4 @@ export interface IIntegrationRegistry {
|
|
|
63
38
|
getIntegrationSettings(integrationId: string): Promise<Record<string, unknown>>;
|
|
64
39
|
setIntegrationSetting(integrationId: string, key: string, value: unknown): Promise<void>;
|
|
65
40
|
setIntegrationSettings(integrationId: string, settings: Record<string, unknown>): Promise<void>;
|
|
66
|
-
createDevice(input: CreateDeviceInput): Promise<PersistedDevice>;
|
|
67
|
-
getDevice(id: string): Promise<PersistedDevice | null>;
|
|
68
|
-
getDeviceByStableId(stableId: string): Promise<PersistedDevice | null>;
|
|
69
|
-
listDevices(integrationId?: string): Promise<readonly PersistedDevice[]>;
|
|
70
|
-
listCameras(): Promise<readonly PersistedDevice[]>;
|
|
71
|
-
updateDevice(id: string, updates: Partial<Pick<PersistedDevice, 'name' | 'enabled' | 'info'>>): Promise<PersistedDevice | null>;
|
|
72
|
-
deleteDevice(id: string): Promise<boolean>;
|
|
73
|
-
getDeviceSettings(deviceId: string): Promise<Record<string, unknown>>;
|
|
74
|
-
setDeviceSetting(deviceId: string, key: string, value: unknown): Promise<void>;
|
|
75
|
-
setDeviceSettings(deviceId: string, settings: Record<string, unknown>): Promise<void>;
|
|
76
41
|
}
|
|
@@ -50,9 +50,16 @@
|
|
|
50
50
|
* strings verbatim, the viewer maps the ids onto its `v2.nc.rules.*` i18n keys
|
|
51
51
|
* and falls back to them.
|
|
52
52
|
*
|
|
53
|
-
* The admin UI
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* BOTH EDITORS IMPORT THIS FILE. The admin UI kept a pinned local copy while
|
|
54
|
+
* Phase 1 shipped; it was deleted in Phase 3 once the MF question was actually
|
|
55
|
+
* answered rather than assumed. The admin UI is the module-federation HOST
|
|
56
|
+
* (`packages/addon-admin-ui/vite.config.ts`: `federation({ name:
|
|
57
|
+
* 'admin_ui_host', … shared: { '@camstack/types': { …, import: typesEsm } } })`)
|
|
58
|
+
* — it PROVIDES the singleton, bundled from the workspace at build time, and
|
|
59
|
+
* never consumes one from a server closure. The lag is real for addon widget
|
|
60
|
+
* REMOTES, which declare the same package `import: false`
|
|
61
|
+
* (`packages/addon-benchmark/vite.config.ts`) and therefore read whatever the
|
|
62
|
+
* host loaded; nothing in this file is consumed that way. See
|
|
56
63
|
* `docs/design/2026-08-19-viewer-notification-rule-parity.md` §3 and Phase 3.
|
|
57
64
|
*/
|
|
58
65
|
import { type NcAudioCondition, type NcConditions, type NcDelivery, type NcOccupancyCondition } from '../capabilities/notification-rules.cap.js';
|
|
@@ -138,6 +145,17 @@ export declare function isSystemDelivery(delivery: string): boolean;
|
|
|
138
145
|
export interface NcRuleConditionsSubject {
|
|
139
146
|
readonly occupancy?: unknown;
|
|
140
147
|
readonly audio?: unknown;
|
|
148
|
+
/**
|
|
149
|
+
* EVERY OTHER CONDITION, admitted explicitly.
|
|
150
|
+
*
|
|
151
|
+
* Without it the two named keys make this a "weak type", and TypeScript's
|
|
152
|
+
* excess-property check then rejects `{ classes: ['person'] }` written INLINE
|
|
153
|
+
* while accepting the identical value read out of a variable. Both editors
|
|
154
|
+
* write such literals — seeds, specs, the admin's section tests — so the
|
|
155
|
+
* classifier's own shape has to say "the rest of the conditions ride along and
|
|
156
|
+
* I do not read them" rather than let it depend on where the value came from.
|
|
157
|
+
*/
|
|
158
|
+
readonly [conditionId: string]: unknown;
|
|
141
159
|
}
|
|
142
160
|
/** Every authored condition, keyed by descriptor id — same reasoning as above. */
|
|
143
161
|
export type NcAuthoredConditions = Readonly<Record<string, unknown>>;
|