@camstack/types 1.2.298 → 1.2.299
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/capabilities/calendars.cap.d.ts +52 -13
- package/dist/capabilities/core-blocks.cap.d.ts +166 -7
- package/dist/capabilities/index.d.ts +4 -4
- package/dist/capabilities/notification-rules.cap.d.ts +972 -120
- package/dist/device/block-declared-devices.d.ts +65 -0
- package/dist/device/device-do-actions.d.ts +33 -0
- package/dist/device/index.d.ts +2 -0
- package/dist/generated/addon-api.d.ts +60 -4
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +3 -3
- package/dist/i18n/event-kind-labels.d.ts +35 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8836 -7842
- package/dist/index.mjs +8809 -7842
- package/dist/notification/alarm-membership.d.ts +17 -7
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper for core-block scripts that declare devices on the shared Blocks
|
|
3
|
+
* integration and optionally expose them to exporters.
|
|
4
|
+
*
|
|
5
|
+
* Blocks cannot mint their own integration (D97). They reconcile onto the
|
|
6
|
+
* hub-owned `Blocks` integration (`core-blocks`) and own devices under
|
|
7
|
+
* `ctx.id` (`core-block-<uuid>`). Exporters never scan — after reconcile,
|
|
8
|
+
* call {@link exposeBlockDevices} for each exporter that should publish.
|
|
9
|
+
*
|
|
10
|
+
* Usage inside a block:
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import {
|
|
14
|
+
* DeviceType,
|
|
15
|
+
* BaseDevice,
|
|
16
|
+
* reconcileBlockDevices,
|
|
17
|
+
* exposeBlockDevices,
|
|
18
|
+
* type AddonContext,
|
|
19
|
+
* } from '@camstack/types'
|
|
20
|
+
*
|
|
21
|
+
* class WanAlertSensor extends BaseDevice {}
|
|
22
|
+
*
|
|
23
|
+
* export default async function block(ctx: AddonContext) {
|
|
24
|
+
* const { devices } = await reconcileBlockDevices(ctx, {
|
|
25
|
+
* devices: [{
|
|
26
|
+
* stableId: 'wan-alert',
|
|
27
|
+
* name: 'WAN alert',
|
|
28
|
+
* type: DeviceType.Sensor,
|
|
29
|
+
* DeviceClass: WanAlertSensor,
|
|
30
|
+
* }],
|
|
31
|
+
* })
|
|
32
|
+
* await exposeBlockDevices(ctx, {
|
|
33
|
+
* deviceIds: devices.map((d) => d.deviceId),
|
|
34
|
+
* exporterAddonIds: ['provider-homeassistant'],
|
|
35
|
+
* })
|
|
36
|
+
* return () => undefined
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
import type { AddonContext } from '../interfaces/addon.js';
|
|
41
|
+
import { type DeclarationPlacement, type DeclaredDevicesResult, type DeviceDeclaration } from './declared-device.js';
|
|
42
|
+
export interface ReconcileBlockDevicesInput {
|
|
43
|
+
readonly devices: readonly DeviceDeclaration[];
|
|
44
|
+
/** Defaults to hub placement. */
|
|
45
|
+
readonly placement?: DeclarationPlacement;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Reconcile the block's declared devices onto the shared Blocks integration.
|
|
49
|
+
* Uses `ctx.id` as the owning addon id — never a fictional `ctx.addonId`.
|
|
50
|
+
*
|
|
51
|
+
* When the Blocks integration is not ready yet, returns `owned: false` with
|
|
52
|
+
* empty devices so the next converge (or the next boot tick) can retry —
|
|
53
|
+
* same discipline as declaring before `armBlocksIntegration` lands.
|
|
54
|
+
*/
|
|
55
|
+
export declare function reconcileBlockDevices(ctx: AddonContext, input: ReconcileBlockDevicesInput): Promise<DeclaredDevicesResult>;
|
|
56
|
+
export interface ExposeBlockDevicesInput {
|
|
57
|
+
readonly deviceIds: readonly number[];
|
|
58
|
+
/** Exporter addon ids (e.g. `provider-homeassistant`, `export-hap`). */
|
|
59
|
+
readonly exporterAddonIds: readonly string[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Opt-in expose for each device × exporter. Idempotent per pair.
|
|
63
|
+
* Failures are logged per device and do not abort the rest (D391).
|
|
64
|
+
*/
|
|
65
|
+
export declare function exposeBlockDevices(ctx: AddonContext, input: ExposeBlockDevicesInput): Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** One operator-facing action that becomes a cap method call. */
|
|
2
|
+
export interface DeviceDoAction {
|
|
3
|
+
/** Stable id for the select value, e.g. `switch.on`. */
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/** Human label shown in the picker. */
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly cap: string;
|
|
8
|
+
readonly method: string;
|
|
9
|
+
readonly args?: Readonly<Record<string, unknown>>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The curated catalogue. Order is the order the select draws.
|
|
13
|
+
* Args are baked in so the authoring UI never asks for JSON for these.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEVICE_DO_ACTIONS: readonly DeviceDoAction[];
|
|
16
|
+
/** True when METHOD_ACCESS_MAP still exposes this cap.method as actuatable. */
|
|
17
|
+
export declare function isDoActionActuatable(action: DeviceDoAction): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Actions offered for a device that binds the given caps.
|
|
20
|
+
*
|
|
21
|
+
* Only catalogue entries whose cap is bound AND still actuatable in
|
|
22
|
+
* METHOD_ACCESS_MAP. Empty bindings → empty list (pick a device first).
|
|
23
|
+
*/
|
|
24
|
+
export declare function actionsForBoundCaps(boundCaps: readonly string[]): readonly DeviceDoAction[];
|
|
25
|
+
/** The whole catalogue (still actuatable) — for a `{$var}` automation target. */
|
|
26
|
+
export declare function allDoActions(): readonly DeviceDoAction[];
|
|
27
|
+
/**
|
|
28
|
+
* Match a saved wire step to a catalogue entry, or null when it is outside
|
|
29
|
+
* the catalogue (legacy / custom). Args must agree when the entry bakes them.
|
|
30
|
+
*/
|
|
31
|
+
export declare function matchDoAction(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined): DeviceDoAction | null;
|
|
32
|
+
/** Select value for a saved step: catalogue id, or a synthetic custom key. */
|
|
33
|
+
export declare function doActionSelectValue(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined): string;
|
package/dist/device/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export { DEVICE_RESTORE_RETRY_CONCURRENCY, DEVICE_RESTORE_RETRY_DELAYS_MS, Devic
|
|
|
8
8
|
export type { ICameraDevice, StreamSourceEntry } from './camera-device.js';
|
|
9
9
|
export type { DeclarationPlacement, DeclaredDeviceOutcome, DeclaredDevicePorts, DeclaredDeviceRow, DeclaredDevicesResult, DeclaredDevicesSpec, DeclaredIntegrationRow, DeviceDeclaration, } from './declared-device.js';
|
|
10
10
|
export { DECLARED_DEVICE_SWEEP_LIMIT, DECLARED_INTEGRATION_FIXED_KEY, DeclaredDevices, declarationOwnerNodeId, } from './declared-device.js';
|
|
11
|
+
export type { ExposeBlockDevicesInput, ReconcileBlockDevicesInput, } from './block-declared-devices.js';
|
|
12
|
+
export { exposeBlockDevices, reconcileBlockDevices } from './block-declared-devices.js';
|
|
11
13
|
export type { IDevice } from './device.js';
|
|
12
14
|
export { DeviceConfig } from './device-config.js';
|
|
13
15
|
export type { DeviceConstructor, DeviceContext, DeviceManagerApi, IDeviceRegistry, IDeviceRegistryReader, } from './device-context.js';
|
|
@@ -1221,11 +1221,18 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
1221
1221
|
output: z.infer<typeof calendarsCapability.methods.listEvents.output>;
|
|
1222
1222
|
meta: object;
|
|
1223
1223
|
}>;
|
|
1224
|
-
|
|
1224
|
+
getPreferences: TRPCQueryProcedure<{
|
|
1225
1225
|
input: {
|
|
1226
|
-
|
|
1227
|
-
}
|
|
1228
|
-
output: z.infer<typeof calendarsCapability.methods.
|
|
1226
|
+
[x: string]: unknown;
|
|
1227
|
+
} & z.input<typeof calendarsCapability.methods.getPreferences.input>;
|
|
1228
|
+
output: z.infer<typeof calendarsCapability.methods.getPreferences.output>;
|
|
1229
|
+
meta: object;
|
|
1230
|
+
}>;
|
|
1231
|
+
setCalendarPreference: TRPCMutationProcedure<{
|
|
1232
|
+
input: {
|
|
1233
|
+
[x: string]: unknown;
|
|
1234
|
+
} & z.input<typeof calendarsCapability.methods.setCalendarPreference.input>;
|
|
1235
|
+
output: z.infer<typeof calendarsCapability.methods.setCalendarPreference.output>;
|
|
1229
1236
|
meta: object;
|
|
1230
1237
|
}>;
|
|
1231
1238
|
}>>;
|
|
@@ -1642,6 +1649,20 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
1642
1649
|
output: z.infer<typeof coreBlocksCapability.methods.compile.output>;
|
|
1643
1650
|
meta: object;
|
|
1644
1651
|
}>;
|
|
1652
|
+
getBlockSettings: TRPCQueryProcedure<{
|
|
1653
|
+
input: {
|
|
1654
|
+
[x: string]: unknown;
|
|
1655
|
+
} & z.input<typeof coreBlocksCapability.methods.getBlockSettings.input>;
|
|
1656
|
+
output: z.infer<typeof coreBlocksCapability.methods.getBlockSettings.output>;
|
|
1657
|
+
meta: object;
|
|
1658
|
+
}>;
|
|
1659
|
+
updateBlockSettings: TRPCMutationProcedure<{
|
|
1660
|
+
input: {
|
|
1661
|
+
[x: string]: unknown;
|
|
1662
|
+
} & z.input<typeof coreBlocksCapability.methods.updateBlockSettings.input>;
|
|
1663
|
+
output: z.infer<typeof coreBlocksCapability.methods.updateBlockSettings.output>;
|
|
1664
|
+
meta: object;
|
|
1665
|
+
}>;
|
|
1645
1666
|
getTypeDefs: TRPCQueryProcedure<{
|
|
1646
1667
|
input: {
|
|
1647
1668
|
[x: string]: unknown;
|
|
@@ -5063,6 +5084,41 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
5063
5084
|
output: z.infer<typeof notificationRulesCapability.methods.setRuleEnabled.output>;
|
|
5064
5085
|
meta: object;
|
|
5065
5086
|
}>;
|
|
5087
|
+
listSequences: TRPCQueryProcedure<{
|
|
5088
|
+
input: {
|
|
5089
|
+
[x: string]: unknown;
|
|
5090
|
+
} & z.input<typeof notificationRulesCapability.methods.listSequences.input>;
|
|
5091
|
+
output: z.infer<typeof notificationRulesCapability.methods.listSequences.output>;
|
|
5092
|
+
meta: object;
|
|
5093
|
+
}>;
|
|
5094
|
+
getSequence: TRPCQueryProcedure<{
|
|
5095
|
+
input: {
|
|
5096
|
+
[x: string]: unknown;
|
|
5097
|
+
} & z.input<typeof notificationRulesCapability.methods.getSequence.input>;
|
|
5098
|
+
output: z.infer<typeof notificationRulesCapability.methods.getSequence.output>;
|
|
5099
|
+
meta: object;
|
|
5100
|
+
}>;
|
|
5101
|
+
createSequence: TRPCMutationProcedure<{
|
|
5102
|
+
input: {
|
|
5103
|
+
[x: string]: unknown;
|
|
5104
|
+
} & z.input<typeof notificationRulesCapability.methods.createSequence.input>;
|
|
5105
|
+
output: z.infer<typeof notificationRulesCapability.methods.createSequence.output>;
|
|
5106
|
+
meta: object;
|
|
5107
|
+
}>;
|
|
5108
|
+
updateSequence: TRPCMutationProcedure<{
|
|
5109
|
+
input: {
|
|
5110
|
+
[x: string]: unknown;
|
|
5111
|
+
} & z.input<typeof notificationRulesCapability.methods.updateSequence.input>;
|
|
5112
|
+
output: z.infer<typeof notificationRulesCapability.methods.updateSequence.output>;
|
|
5113
|
+
meta: object;
|
|
5114
|
+
}>;
|
|
5115
|
+
deleteSequence: TRPCMutationProcedure<{
|
|
5116
|
+
input: {
|
|
5117
|
+
[x: string]: unknown;
|
|
5118
|
+
} & z.input<typeof notificationRulesCapability.methods.deleteSequence.input>;
|
|
5119
|
+
output: z.infer<typeof notificationRulesCapability.methods.deleteSequence.output>;
|
|
5120
|
+
meta: object;
|
|
5121
|
+
}>;
|
|
5066
5122
|
getClipRetentionAsks: TRPCQueryProcedure<{
|
|
5067
5123
|
input: {
|
|
5068
5124
|
[x: string]: unknown;
|
|
@@ -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: 1219 method paths across 165 capabilities.
|
|
10
10
|
*/
|
|
11
11
|
import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
|
|
12
12
|
export interface MethodAccessRecord {
|
|
@@ -65,9 +65,9 @@ export interface SystemProxy {
|
|
|
65
65
|
readonly audioCodec: Pick<InferProvider<typeof audioCodecCapability>, 'listSupportedCodecs' | 'canHandle' | 'createDecodeSession' | 'createEncodeSession' | 'closeSession' | 'pushEncodedFrame' | 'pullPcm' | 'pushPcm' | 'pullEncoded' | 'flushEncode' | 'listActiveSessions'>;
|
|
66
66
|
readonly backup: Pick<InferProvider<typeof backupCapability>, 'listDestinations' | 'trigger' | 'listRuns' | 'cancel' | 'list' | 'listLocations' | 'getEntries' | 'restore' | 'delete' | 'listArchives' | 'upsertDestinationPolicy' | 'previewSchedule' | 'listSchedules' | 'upsertSchedule' | 'deleteSchedule'>;
|
|
67
67
|
readonly broker: Pick<InferProvider<typeof brokerCapability>, 'list' | 'get' | 'listProviders' | 'add' | 'remove' | 'testConnection' | 'getSettings' | 'setSettings' | 'getBrokerConfig' | 'getSettingsSchema' | 'testSettings' | 'publish' | 'subscribe' | 'unsubscribe' | 'getState' | 'getStatus'>;
|
|
68
|
-
readonly calendars: Pick<InferProvider<typeof calendarsCapability>, 'listCalendars' | 'listEvents' | '
|
|
68
|
+
readonly calendars: Pick<InferProvider<typeof calendarsCapability>, 'listCalendars' | 'listEvents' | 'getPreferences' | 'setCalendarPreference'>;
|
|
69
69
|
readonly connectionTest: Pick<InferProvider<typeof connectionTestCapability>, 'testSettings' | 'describeTest'>;
|
|
70
|
-
readonly coreBlocks: Pick<InferProvider<typeof coreBlocksCapability>, 'list' | 'get' | 'create' | 'update' | 'delete' | 'setEnabled' | 'restart' | 'compile' | 'getTypeDefs' | 'createComposition' | 'updateComposition' | 'getComposition' | 'listCompositions' | 'getCustomization' | 'listComposableCaps' | 'validateComposition'>;
|
|
70
|
+
readonly coreBlocks: Pick<InferProvider<typeof coreBlocksCapability>, 'list' | 'get' | 'create' | 'update' | 'delete' | 'setEnabled' | 'restart' | 'compile' | 'getBlockSettings' | 'updateBlockSettings' | 'getTypeDefs' | 'createComposition' | 'updateComposition' | 'getComposition' | 'listCompositions' | 'getCustomization' | 'listComposableCaps' | 'validateComposition'>;
|
|
71
71
|
readonly decoder: Pick<InferProvider<typeof decoderCapability>, 'supportsCodec' | 'getInfo' | 'createSession' | 'destroySession' | 'pushPacket' | 'openStream' | 'pullFrames' | 'pullHandles' | 'getFrame' | 'getShmStats' | 'updateConfig' | 'getStats' | 'listActiveSessions' | 'reprobeHwaccel'>;
|
|
72
72
|
readonly deviceAdoption: Pick<InferProvider<typeof deviceAdoptionCapability>, 'listCandidateFilters' | 'listCandidates' | 'getCandidate' | 'refresh' | 'adopt' | 'release' | 'resync'>;
|
|
73
73
|
readonly deviceExport: Pick<InferProvider<typeof deviceExportCapability>, 'getStatus' | 'listSupportedDeviceKinds' | 'listExposedDevices' | 'exposeDevice' | 'unexposeDevice'>;
|
|
@@ -85,7 +85,7 @@ export interface SystemProxy {
|
|
|
85
85
|
readonly networkQuality: Pick<InferProvider<typeof networkQualityCapability>, 'getAllStats'>;
|
|
86
86
|
readonly nodes: Pick<InferProvider<typeof nodesCapability>, 'topology' | 'directory' | 'deployAddon' | 'undeployAddon' | 'restartAddon' | 'restartProcess' | 'restartNode' | 'shutdownNode' | 'renameNode' | 'clusterAddonStatus' | 'getCapUsageGraph' | 'getNodeAddons' | 'setProcessLogLevel' | 'executeQuery'>;
|
|
87
87
|
readonly notificationOutput: Pick<InferProvider<typeof notificationOutputCapability>, 'listTargetKinds' | 'listTargets' | 'discoverTargets' | 'send' | 'testTarget' | 'upsertTarget' | 'deleteTarget' | 'setTargetEnabled'>;
|
|
88
|
-
readonly notificationRules: Pick<InferProvider<typeof notificationRulesCapability>, 'listRules' | 'getRule' | 'createRule' | 'updateRule' | 'deleteRule' | 'setRuleEnabled' | 'getClipRetentionAsks' | 'listDeviceMutes' | 'testRule' | 'previewStateSummary' | 'getConditionCatalog' | 'getTemplateCatalog' | 'previewTemplate' | 'getHistory' | 'getRuleLastRuns' | 'resolveArtifactUrl' | 'listSnoozes' | 'createSnooze' | 'cancelSnooze' | 'getAlarmConfig' | 'setAlarmConfig' | 'createAlarmProfile' | 'renameAlarmProfile' | 'deleteAlarmProfile' | 'activateAlarmProfile' | 'getAlarmSensors'>;
|
|
88
|
+
readonly notificationRules: Pick<InferProvider<typeof notificationRulesCapability>, 'listRules' | 'getRule' | 'createRule' | 'updateRule' | 'deleteRule' | 'setRuleEnabled' | 'listSequences' | 'getSequence' | 'createSequence' | 'updateSequence' | 'deleteSequence' | 'getClipRetentionAsks' | 'listDeviceMutes' | 'testRule' | 'previewStateSummary' | 'getConditionCatalog' | 'getTemplateCatalog' | 'previewTemplate' | 'getHistory' | 'getRuleLastRuns' | 'resolveArtifactUrl' | 'listSnoozes' | 'createSnooze' | 'cancelSnooze' | 'getAlarmConfig' | 'setAlarmConfig' | 'createAlarmProfile' | 'renameAlarmProfile' | 'deleteAlarmProfile' | 'activateAlarmProfile' | 'getAlarmSensors'>;
|
|
89
89
|
readonly osdManager: Pick<InferProvider<typeof osdManagerCapability>, 'getConditionSupport' | 'copyDeviceConfiguration' | 'listTemplates' | 'upsertTemplate' | 'deleteTemplate'>;
|
|
90
90
|
readonly pipelineExecutor: Pick<InferProvider<typeof pipelineExecutorCapability>, 'getAvailableEngines' | 'getSelectedEngine' | 'getDefaultSteps' | 'getEngineProvisioning' | 'getVideoPipelineSteps' | 'setVideoPipelineSteps' | 'clearDeviceOverrides' | 'getInferenceDeviceHealth' | 'rearmInferenceDevice' | 'getSchema' | 'getGlobalSteps' | 'getGlobalPipelineConfig' | 'getOrchestratorConfigSchema' | 'validatePipeline' | 'listTemplates' | 'saveTemplate' | 'updateTemplate' | 'deleteTemplate' | 'getCapabilities' | 'getAddonModels' | 'downloadModel' | 'deleteModel' | 'cacheFrameInPool' | 'inferCached' | 'uncacheFrame' | 'getEffectiveTuning' | 'listLoadedEngines' | 'spinEngine' | 'killEngine' | 'listReferenceImages' | 'getReferenceImage' | 'getReferenceAudioFiles' | 'getReferenceAudio' | 'getAudioCapabilities' | 'runAudioTest' | 'getDetectionConfigSchema'>;
|
|
91
91
|
readonly pipelineOrchestrator: Pick<InferProvider<typeof pipelineOrchestratorCapability>, 'requestOccupancyLook' | 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'rebalance' | 'getPipelineAssignments' | 'getAgentLoad' | 'getClusterModelChoice' | 'getGlobalMetrics' | 'getCapabilityBindings' | 'setCapabilityBinding' | 'getIngestOwner' | 'getAudioNodeLoad' | 'getAudioAssignments' | 'getAgentSettings' | 'listAgentSettings' | 'removeAgentSettings' | 'setAgentMaxCameras' | 'setAgentDetectWeight' | 'setAgentCapabilities' | 'setAgentDecodeLimits' | 'setAgentReachableHost' | 'setAgentInferenceDevices' | 'getNodeInferenceDevices' | 'resetNodePipelineDefaults' | 'getCameraStatuses' | 'setCameraSensors' | 'reconcileFromDisk' | 'getReconcileFromDiskStatus' | 'listTemplates' | 'saveTemplate' | 'updateTemplate' | 'deleteTemplate'>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ONE dictionary of human labels for event kinds (detection macros/subs,
|
|
3
|
+
* sensors, audio macros, …) — the same vocabulary the viewer filters and the
|
|
4
|
+
* notification centre speak (R7).
|
|
5
|
+
*
|
|
6
|
+
* Wire ids stay raw (`cat`, `animal`, `audio-dog`). What a human reads is a
|
|
7
|
+
* label, and a surface that translates on its own is a surface that disagrees
|
|
8
|
+
* with the next one. Admin UI, viewer and NC resolve through {@link eventKindLabel}.
|
|
9
|
+
*
|
|
10
|
+
* Keys match {@link EVENT_TAXONOMY}. An OPEN kind (a custom model class) falls
|
|
11
|
+
* back to the raw word — never an exception, never an empty chip.
|
|
12
|
+
*/
|
|
13
|
+
/** A label in every locale both editors and the hub ship. */
|
|
14
|
+
export interface EventKindLabel {
|
|
15
|
+
readonly en: string;
|
|
16
|
+
readonly it: string;
|
|
17
|
+
}
|
|
18
|
+
/** The locales a {@link EventKindLabel} carries. */
|
|
19
|
+
export type EventKindLabelLocale = keyof EventKindLabel;
|
|
20
|
+
/**
|
|
21
|
+
* Every kind the dictionary answers for. Order is stable; the set is held to
|
|
22
|
+
* {@link EVENT_TAXONOMY} by the spec.
|
|
23
|
+
*/
|
|
24
|
+
export declare const EVENT_KIND_LABEL_KEYS: readonly ["motion", "audio", "person", "vehicle", "animal", "package", "sensor", "control", "car", "truck", "bus", "motorcycle", "bicycle", "airplane", "boat", "train", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "package-delivered", "package-picked-up", "contact", "motion-sensor", "smoke", "flood", "gas", "carbon-monoxide", "vibration", "tamper", "presence", "enum-sensor", "device-event", "lock", "cover", "switch", "siren", "button", "doorbell", "audio-speech", "audio-scream", "audio-crying", "audio-laughter", "audio-music", "audio-dog", "audio-cat", "audio-bird", "audio-animal", "audio-alarm", "audio-doorbell", "audio-glass_breaking", "audio-gunshot", "audio-vehicle", "audio-siren", "audio-fire", "audio-water", "audio-wind", "audio-door", "audio-footsteps", "audio-crowd", "audio-telephone", "audio-engine", "audio-tools", "audio-silence"];
|
|
25
|
+
/** A key {@link EVENT_KIND_LABELS} answers for. */
|
|
26
|
+
export type EventKindLabelKey = (typeof EVENT_KIND_LABEL_KEYS)[number];
|
|
27
|
+
export declare const EVENT_KIND_LABELS: Readonly<Record<EventKindLabelKey, EventKindLabel>>;
|
|
28
|
+
/** Is `key` one the dictionary answers for? An own key only — never `toString`. */
|
|
29
|
+
export declare function isEventKindLabelKey(key: string): key is EventKindLabelKey;
|
|
30
|
+
/**
|
|
31
|
+
* The human label of an event kind in `locale`, or the word itself when the
|
|
32
|
+
* dictionary does not know it. Never throws. Case/whitespace normalised so a
|
|
33
|
+
* pipeline that emitted `Cat` still finds `cat`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function eventKindLabel(kind: string, locale: EventKindLabelLocale): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -170,12 +170,16 @@ export { CONTAINER_CHILD_PRIORITY, type ContainerChildRef, resolveContainerPrima
|
|
|
170
170
|
export { expandContainer, legacyAutoLinkIds, type LinkCandidate, } from './device/linked-device-resolve.js';
|
|
171
171
|
export type { DeclarationPlacement, DeclaredDeviceOutcome, DeclaredDevicePorts, DeclaredDeviceRow, DeclaredDevicesResult, DeclaredDevicesSpec, DeclaredIntegrationRow, DeviceDeclaration, } from './device/declared-device.js';
|
|
172
172
|
export { DECLARED_DEVICE_SWEEP_LIMIT, DECLARED_INTEGRATION_FIXED_KEY, DeclaredDevices, declarationOwnerNodeId, } from './device/declared-device.js';
|
|
173
|
+
export type { ExposeBlockDevicesInput, ReconcileBlockDevicesInput, } from './device/block-declared-devices.js';
|
|
174
|
+
export { exposeBlockDevices, reconcileBlockDevices } from './device/block-declared-devices.js';
|
|
173
175
|
export type { IDevice } from './device/device.js';
|
|
174
176
|
export type { DeviceBinding, DeviceBindingEntry } from './device/device-binding.js';
|
|
175
177
|
export { DeviceConfig } from './device/device-config.js';
|
|
176
178
|
export type { DeviceConstructor, DeviceContext, DeviceManagerApi, IDeviceRegistry, IDeviceRegistryReader, } from './device/device-context.js';
|
|
177
179
|
export type { AccessoryControlInput, AccessoryControlKind, AccessoryControlPick, DeviceControlKind, SensorMapping, } from './device/device-control-resolution.js';
|
|
178
180
|
export { DEVICE_TYPE_CONTROL_KIND, hasMotionTrigger, isNode, MOTION_TRIGGER_FEATURE, pickAccessoryControl, resolveDeviceControlKind, resolveMutate, SENSOR_FEATURES, SENSOR_MAP, } from './device/device-control-resolution.js';
|
|
181
|
+
export type { DeviceDoAction } from './device/device-do-actions.js';
|
|
182
|
+
export { actionsForBoundCaps, allDoActions, DEVICE_DO_ACTIONS, doActionSelectValue, isDoActionActuatable, matchDoAction, } from './device/device-do-actions.js';
|
|
179
183
|
export type { ChildLayout, ChildLayoutEntry, CreateDeviceSpec, DeviceCapDisplayOverride, DeviceDiscovery, DeviceDisplayOverride, DeviceManualCreation, DeviceMeta, DiscoveredDevice, InitialDeviceMeta, RoleDisplayDefault, SavedDevice, } from './device/device-management.js';
|
|
180
184
|
export type { DeviceProfile, DeviceProfileDefaults, DeviceProfileMatch, PipelinePhaseMode, } from './device/device-profile.js';
|
|
181
185
|
export { BATTERY_DEVICE_PROFILE, DEVICE_PROFILES, deviceMatchesProfile, resolveDeviceProfile, } from './device/device-profile.js';
|
|
@@ -251,6 +255,8 @@ export { NC_SERVER_PACKAGE_NAME, NC_UPDATE_EVENT_PACKAGE_NAMES, type NcInstalled
|
|
|
251
255
|
export type { TimelapseCadencePair, TimelapsePreviewMode, TimelapseRule, TimelapseRuleInput, TimelapseRulePatch, TimelapseTemplate, } from './notification/timelapse-rule.js';
|
|
252
256
|
export type { StateLabel, StateLabelKey, StateLabelLocale } from './i18n/state-labels.js';
|
|
253
257
|
export { isStateLabelKey, STATE_LABEL_KEYS, STATE_LABELS, stateLabel, } from './i18n/state-labels.js';
|
|
258
|
+
export type { EventKindLabel, EventKindLabelKey, EventKindLabelLocale, } from './i18n/event-kind-labels.js';
|
|
259
|
+
export { EVENT_KIND_LABEL_KEYS, EVENT_KIND_LABELS, eventKindLabel, isEventKindLabelKey, } from './i18n/event-kind-labels.js';
|
|
254
260
|
export { assertTimelapseCadences, DEFAULT_TIMELAPSE_PREVIEW_TEXT, readTimelapseGeneratedAt, TIMELAPSE_DENSE_FLOOR_SEC, TimelapseRuleInputSchema, TimelapseRulePatchSchema, TimelapseRuleSchema, TimelapseTemplateSchema, } from './notification/timelapse-rule.js';
|
|
255
261
|
export { CLUSTER_MODEL_SCOPED_STEPS, CLUSTER_MODEL_SECTION_ID, CLUSTER_STEP_SETTING_FIELDS, type ClusterModelScopedStep, type ClusterStepModels, type ClusterStepSettingField, type ClusterStepSettings, clusterModelSettingKey, clusterStepSettingFieldsFor, clusterStepSettingKey, DEFAULT_CLUSTER_STEP_MODELS, DEFAULT_CLUSTER_STEP_SETTINGS, DEFAULT_MIN_LANDMARK_FACE_SIZE_PX, type HydratedClusterSection, type HydratedClusterView, interpretStoredClusterModel, type InvalidClusterStepModelEntry, invalidClusterStepModelEntries, isClusterScopedStep, overlayClusterStepSettings, pickClusterStepModels, pickClusterStepSettings, pickInvalidClusterStepModels, readClusterStepModels, readClusterStepSettings, resolveClusterStepModelId, type StepModelScope, type StoredClusterModelInterpretation, } from './pipeline/cluster-model-scope.js';
|
|
256
262
|
export { CAMERA_SENSORS_NOT_LOADED, CAMERA_SENSORS_SETTINGS_KEY, CAMERA_TRIGGER, type CameraSensorAttachment, CameraSensorAttachmentSchema, type CameraSensorRef, CameraSensorRefSchema, cameraSensorRefKey, type CameraSensorsConfig, CameraSensorsConfigSchema, type CameraOwnMotion, CameraOwnMotionSchema, type CameraRawLevel, CameraRawLevelSchema, type CameraSensorEntry, CameraSensorEntrySchema, type CameraSensorMode, CameraSensorModeSchema, type CameraSensorsNotEnforced, CameraSensorsNotEnforcedSchema, type CameraSensorsNotForwarded, CameraSensorsNotForwardedSchema, type CameraSensorsStatus, CameraSensorsStatusSchema, DEFAULT_CAMERA_SENSOR_MODE, MAX_CAMERA_SENSORS, type MotionTriggeredBy, type MotionTriggeredByReading, MotionTriggeredBySchema, readMotionTriggeredBy, } from './pipeline/camera-sensors.js';
|