@camstack/types 0.1.40 → 0.1.42
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/base-addon.d.ts +12 -0
- package/dist/addon/base-addon.d.ts.map +1 -1
- package/dist/addon/durable-state.d.ts +33 -0
- package/dist/addon/durable-state.d.ts.map +1 -0
- package/dist/capabilities/accessories.cap.d.ts +56 -8
- package/dist/capabilities/accessories.cap.d.ts.map +1 -1
- package/dist/capabilities/advanced-notifier.cap.d.ts +4 -0
- package/dist/capabilities/advanced-notifier.cap.d.ts.map +1 -1
- package/dist/capabilities/air-quality-sensor.cap.d.ts +56 -0
- package/dist/capabilities/air-quality-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/alarm-panel.cap.d.ts +154 -0
- package/dist/capabilities/alarm-panel.cap.d.ts.map +1 -0
- package/dist/capabilities/ambient-light-sensor.cap.d.ts +39 -0
- package/dist/capabilities/ambient-light-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/automation-control.cap.d.ts +65 -0
- package/dist/capabilities/automation-control.cap.d.ts.map +1 -0
- package/dist/capabilities/battery.cap.d.ts +30 -1
- package/dist/capabilities/battery.cap.d.ts.map +1 -1
- package/dist/capabilities/binary.cap.d.ts +40 -0
- package/dist/capabilities/binary.cap.d.ts.map +1 -0
- package/dist/capabilities/brightness.cap.d.ts +3 -2
- package/dist/capabilities/brightness.cap.d.ts.map +1 -1
- package/dist/capabilities/broker.cap.d.ts +291 -0
- package/dist/capabilities/broker.cap.d.ts.map +1 -0
- package/dist/capabilities/button.cap.d.ts +27 -0
- package/dist/capabilities/button.cap.d.ts.map +1 -0
- package/dist/capabilities/camera-credentials.cap.d.ts +1 -0
- package/dist/capabilities/camera-credentials.cap.d.ts.map +1 -1
- package/dist/capabilities/camera-streams.cap.d.ts +147 -10
- package/dist/capabilities/camera-streams.cap.d.ts.map +1 -1
- package/dist/capabilities/capability-definition.d.ts +15 -0
- package/dist/capabilities/capability-definition.d.ts.map +1 -1
- package/dist/capabilities/carbon-monoxide.cap.d.ts +33 -0
- package/dist/capabilities/carbon-monoxide.cap.d.ts.map +1 -0
- package/dist/capabilities/climate-control.cap.d.ts +183 -0
- package/dist/capabilities/climate-control.cap.d.ts.map +1 -0
- package/dist/capabilities/color.cap.d.ts +186 -0
- package/dist/capabilities/color.cap.d.ts.map +1 -0
- package/dist/capabilities/connectivity.cap.d.ts +37 -0
- package/dist/capabilities/connectivity.cap.d.ts.map +1 -0
- package/dist/capabilities/consumables.cap.d.ts +105 -0
- package/dist/capabilities/consumables.cap.d.ts.map +1 -0
- package/dist/capabilities/contact.cap.d.ts +41 -0
- package/dist/capabilities/contact.cap.d.ts.map +1 -0
- package/dist/capabilities/control.cap.d.ts +167 -0
- package/dist/capabilities/control.cap.d.ts.map +1 -0
- package/dist/capabilities/cover.cap.d.ts +104 -0
- package/dist/capabilities/cover.cap.d.ts.map +1 -0
- package/dist/capabilities/custom-actions.d.ts +6 -0
- package/dist/capabilities/custom-actions.d.ts.map +1 -1
- package/dist/capabilities/decoder.cap.d.ts +1 -1
- package/dist/capabilities/device-adoption.cap.d.ts +203 -0
- package/dist/capabilities/device-adoption.cap.d.ts.map +1 -0
- package/dist/capabilities/device-discovery.cap.d.ts +44 -143
- package/dist/capabilities/device-discovery.cap.d.ts.map +1 -1
- package/dist/capabilities/device-manager.cap.d.ts +469 -0
- package/dist/capabilities/device-manager.cap.d.ts.map +1 -1
- package/dist/capabilities/device-ops.cap.d.ts +30 -0
- package/dist/capabilities/device-ops.cap.d.ts.map +1 -1
- package/dist/capabilities/device-provider.cap.d.ts +36 -0
- package/dist/capabilities/device-provider.cap.d.ts.map +1 -1
- package/dist/capabilities/device-status.cap.d.ts +1 -0
- package/dist/capabilities/device-status.cap.d.ts.map +1 -1
- package/dist/capabilities/doorbell.cap.d.ts +1 -0
- package/dist/capabilities/doorbell.cap.d.ts.map +1 -1
- package/dist/capabilities/enum-sensor.cap.d.ts +60 -0
- package/dist/capabilities/enum-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/event-emitter.cap.d.ts +79 -0
- package/dist/capabilities/event-emitter.cap.d.ts.map +1 -0
- package/dist/capabilities/fan-control.cap.d.ts +100 -0
- package/dist/capabilities/fan-control.cap.d.ts.map +1 -0
- package/dist/capabilities/feature-probe.cap.d.ts +1 -0
- package/dist/capabilities/feature-probe.cap.d.ts.map +1 -1
- package/dist/capabilities/filesystem-browse.cap.d.ts +39 -0
- package/dist/capabilities/filesystem-browse.cap.d.ts.map +1 -0
- package/dist/capabilities/flood.cap.d.ts +37 -0
- package/dist/capabilities/flood.cap.d.ts.map +1 -0
- package/dist/capabilities/gas.cap.d.ts +34 -0
- package/dist/capabilities/gas.cap.d.ts.map +1 -0
- package/dist/capabilities/humidifier.cap.d.ts +82 -0
- package/dist/capabilities/humidifier.cap.d.ts.map +1 -0
- package/dist/capabilities/humidity-sensor.cap.d.ts +43 -0
- package/dist/capabilities/humidity-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/image.cap.d.ts +44 -0
- package/dist/capabilities/image.cap.d.ts.map +1 -0
- package/dist/capabilities/index.d.ts +97 -12
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/integrations.cap.d.ts +12 -0
- package/dist/capabilities/integrations.cap.d.ts.map +1 -1
- package/dist/capabilities/intercom.cap.d.ts +49 -9
- package/dist/capabilities/intercom.cap.d.ts.map +1 -1
- package/dist/capabilities/lawn-mower-control.cap.d.ts +83 -0
- package/dist/capabilities/lawn-mower-control.cap.d.ts.map +1 -0
- package/dist/capabilities/lock-control.cap.d.ts +92 -0
- package/dist/capabilities/lock-control.cap.d.ts.map +1 -0
- package/dist/capabilities/media-player.cap.d.ts +201 -0
- package/dist/capabilities/media-player.cap.d.ts.map +1 -0
- package/dist/capabilities/motion-trigger.cap.d.ts +1 -0
- package/dist/capabilities/motion-trigger.cap.d.ts.map +1 -1
- package/dist/capabilities/motion-zones.cap.d.ts +1 -0
- package/dist/capabilities/motion-zones.cap.d.ts.map +1 -1
- package/dist/capabilities/native-object-detection.cap.d.ts +1 -0
- package/dist/capabilities/native-object-detection.cap.d.ts.map +1 -1
- package/dist/capabilities/network-quality.cap.d.ts +5 -0
- package/dist/capabilities/network-quality.cap.d.ts.map +1 -1
- package/dist/capabilities/notifier.cap.d.ts +173 -0
- package/dist/capabilities/notifier.cap.d.ts.map +1 -0
- package/dist/capabilities/numeric-sensor.cap.d.ts +52 -0
- package/dist/capabilities/numeric-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/osd.cap.d.ts +1 -0
- package/dist/capabilities/osd.cap.d.ts.map +1 -1
- package/dist/capabilities/pipeline-analytics.cap.d.ts +69 -22
- package/dist/capabilities/pipeline-analytics.cap.d.ts.map +1 -1
- package/dist/capabilities/pipeline-executor.cap.d.ts +2 -2
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +1 -1
- package/dist/capabilities/pipeline-runner.cap.d.ts +2 -2
- package/dist/capabilities/platform-probe.cap.d.ts +25 -0
- package/dist/capabilities/platform-probe.cap.d.ts.map +1 -1
- package/dist/capabilities/power-meter.cap.d.ts +65 -0
- package/dist/capabilities/power-meter.cap.d.ts.map +1 -0
- package/dist/capabilities/presence.cap.d.ts +79 -0
- package/dist/capabilities/presence.cap.d.ts.map +1 -0
- package/dist/capabilities/pressure-sensor.cap.d.ts +43 -0
- package/dist/capabilities/pressure-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/privacy-mask.cap.d.ts +1 -0
- package/dist/capabilities/privacy-mask.cap.d.ts.map +1 -1
- package/dist/capabilities/ptz-autotrack.cap.d.ts +1 -0
- package/dist/capabilities/ptz-autotrack.cap.d.ts.map +1 -1
- package/dist/capabilities/ptz.cap.d.ts +1 -0
- package/dist/capabilities/ptz.cap.d.ts.map +1 -1
- package/dist/capabilities/reboot.cap.d.ts +1 -0
- package/dist/capabilities/reboot.cap.d.ts.map +1 -1
- package/dist/capabilities/recording.cap.d.ts +367 -32
- package/dist/capabilities/recording.cap.d.ts.map +1 -1
- package/dist/capabilities/restreamer.cap.d.ts +2 -2
- package/dist/capabilities/schemas/orchestrator-metrics.d.ts +2 -2
- package/dist/capabilities/schemas/streaming-shared.d.ts +64 -1
- package/dist/capabilities/schemas/streaming-shared.d.ts.map +1 -1
- package/dist/capabilities/script-runner.cap.d.ts +62 -0
- package/dist/capabilities/script-runner.cap.d.ts.map +1 -0
- package/dist/capabilities/settings-store.cap.d.ts +25 -0
- package/dist/capabilities/settings-store.cap.d.ts.map +1 -1
- package/dist/capabilities/smoke.cap.d.ts +38 -0
- package/dist/capabilities/smoke.cap.d.ts.map +1 -0
- package/dist/capabilities/snapshot-provider.cap.d.ts +1 -1
- package/dist/capabilities/snapshot.cap.d.ts +1 -0
- package/dist/capabilities/snapshot.cap.d.ts.map +1 -1
- package/dist/capabilities/storage-evictable.cap.d.ts +54 -0
- package/dist/capabilities/storage-evictable.cap.d.ts.map +1 -0
- package/dist/capabilities/storage-provider.cap.d.ts +46 -186
- package/dist/capabilities/storage-provider.cap.d.ts.map +1 -1
- package/dist/capabilities/storage.cap.d.ts +41 -226
- package/dist/capabilities/storage.cap.d.ts.map +1 -1
- package/dist/capabilities/stream-broker.cap.d.ts +323 -25
- package/dist/capabilities/stream-broker.cap.d.ts.map +1 -1
- package/dist/capabilities/stream-catalog.cap.d.ts +3 -0
- package/dist/capabilities/stream-catalog.cap.d.ts.map +1 -1
- package/dist/capabilities/stream-params.cap.d.ts +27 -26
- package/dist/capabilities/stream-params.cap.d.ts.map +1 -1
- package/dist/capabilities/switch.cap.d.ts +1 -0
- package/dist/capabilities/switch.cap.d.ts.map +1 -1
- package/dist/capabilities/tamper.cap.d.ts +33 -0
- package/dist/capabilities/tamper.cap.d.ts.map +1 -0
- package/dist/capabilities/temperature-sensor.cap.d.ts +51 -0
- package/dist/capabilities/temperature-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/update.cap.d.ts +49 -0
- package/dist/capabilities/update.cap.d.ts.map +1 -0
- package/dist/capabilities/vacuum-control.cap.d.ts +229 -0
- package/dist/capabilities/vacuum-control.cap.d.ts.map +1 -0
- package/dist/capabilities/valve.cap.d.ts +93 -0
- package/dist/capabilities/valve.cap.d.ts.map +1 -0
- package/dist/capabilities/vibration.cap.d.ts +33 -0
- package/dist/capabilities/vibration.cap.d.ts.map +1 -0
- package/dist/capabilities/videoclips.cap.d.ts +77 -0
- package/dist/capabilities/videoclips.cap.d.ts.map +1 -0
- package/dist/capabilities/water-heater.cap.d.ts +78 -0
- package/dist/capabilities/water-heater.cap.d.ts.map +1 -0
- package/dist/capabilities/weather.cap.d.ts +76 -0
- package/dist/capabilities/weather.cap.d.ts.map +1 -0
- package/dist/capabilities/webrtc-session.cap.d.ts +95 -1
- package/dist/capabilities/webrtc-session.cap.d.ts.map +1 -1
- package/dist/constants.d.ts +0 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/device/base-device-provider.d.ts +11 -0
- package/dist/device/base-device-provider.d.ts.map +1 -1
- package/dist/device/base-device.d.ts +52 -0
- package/dist/device/base-device.d.ts.map +1 -1
- package/dist/device/device-context.d.ts +29 -0
- package/dist/device/device-context.d.ts.map +1 -1
- package/dist/device/device-link-transform.d.ts +6 -0
- package/dist/device/device-link-transform.d.ts.map +1 -0
- package/dist/device/device-management.d.ts +116 -4
- package/dist/device/device-management.d.ts.map +1 -1
- package/dist/device/device-type.d.ts +214 -3
- package/dist/device/device-type.d.ts.map +1 -1
- package/dist/device/device.d.ts +25 -0
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/index.d.ts +5 -1
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/path-util.d.ts +13 -0
- package/dist/device/path-util.d.ts.map +1 -0
- package/dist/device/schema-fields.d.ts +12 -0
- package/dist/device/schema-fields.d.ts.map +1 -0
- package/dist/device/source-info.d.ts +87 -0
- package/dist/device/source-info.d.ts.map +1 -0
- package/dist/device/system-mirror.d.ts +6 -2
- package/dist/device/system-mirror.d.ts.map +1 -1
- package/dist/encode-profile.d.ts +126 -0
- package/dist/encode-profile.d.ts.map +1 -0
- package/dist/enums/event-category.d.ts +64 -6
- package/dist/enums/event-category.d.ts.map +1 -1
- package/dist/generated/addon-api.d.ts +12722 -8080
- package/dist/generated/addon-api.d.ts.map +1 -1
- package/dist/generated/cap-status-types.d.ts +85 -1
- package/dist/generated/cap-status-types.d.ts.map +1 -1
- package/dist/generated/capability-router-map.d.ts +139 -7
- package/dist/generated/capability-router-map.d.ts.map +1 -1
- package/dist/generated/device-local-state.d.ts +117 -0
- package/dist/generated/device-local-state.d.ts.map +1 -1
- package/dist/generated/device-proxy.d.ts +126 -5
- package/dist/generated/device-proxy.d.ts.map +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts.map +1 -1
- package/dist/generated/provider-kind-map.d.ts +1 -1
- package/dist/generated/provider-kind-map.d.ts.map +1 -1
- package/dist/generated/system-proxy.d.ts +10 -8
- package/dist/generated/system-proxy.d.ts.map +1 -1
- package/dist/{index-C2zzIDdX.mjs → index-BxWo3b49.mjs} +4714 -1113
- package/dist/index-BxWo3b49.mjs.map +1 -0
- package/dist/{index-DnpdVFKv.js → index-CGMPfVaT.js} +4321 -720
- package/dist/index-CGMPfVaT.js.map +1 -0
- package/dist/index.d.ts +22 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1384 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1698 -430
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/addon-data-plane.d.ts +76 -0
- package/dist/interfaces/addon-data-plane.d.ts.map +1 -0
- package/dist/interfaces/addon.d.ts +60 -0
- package/dist/interfaces/addon.d.ts.map +1 -1
- package/dist/interfaces/advanced-notifier.d.ts +4 -0
- package/dist/interfaces/advanced-notifier.d.ts.map +1 -1
- package/dist/interfaces/capability.d.ts +42 -1
- package/dist/interfaces/capability.d.ts.map +1 -1
- package/dist/interfaces/config-ui.d.ts +70 -6
- package/dist/interfaces/config-ui.d.ts.map +1 -1
- package/dist/interfaces/device-capabilities/camera.d.ts +2 -1
- package/dist/interfaces/device-capabilities/camera.d.ts.map +1 -1
- package/dist/interfaces/event-bus.d.ts +49 -3
- package/dist/interfaces/event-bus.d.ts.map +1 -1
- package/dist/interfaces/kernel-abstractions.d.ts +10 -1
- package/dist/interfaces/kernel-abstractions.d.ts.map +1 -1
- package/dist/interfaces/network-quality.d.ts +8 -0
- package/dist/interfaces/network-quality.d.ts.map +1 -1
- package/dist/interfaces/pipeline-executor-capability.d.ts +2 -2
- package/dist/interfaces/pipeline-orchestrator-capability.d.ts +2 -1
- package/dist/interfaces/pipeline-orchestrator-capability.d.ts.map +1 -1
- package/dist/interfaces/pipeline-runner-capability.d.ts +7 -0
- package/dist/interfaces/pipeline-runner-capability.d.ts.map +1 -1
- package/dist/interfaces/recording-config-migrate.d.ts +13 -0
- package/dist/interfaces/recording-config-migrate.d.ts.map +1 -0
- package/dist/interfaces/recording-config.d.ts +209 -0
- package/dist/interfaces/recording-config.d.ts.map +1 -0
- package/dist/interfaces/rtp-egress.d.ts +2 -3
- package/dist/interfaces/rtp-egress.d.ts.map +1 -1
- package/dist/interfaces/storage-location-declaration.d.ts +34 -0
- package/dist/interfaces/storage-location-declaration.d.ts.map +1 -0
- package/dist/interfaces/storage-location.d.ts +19 -74
- package/dist/interfaces/storage-location.d.ts.map +1 -1
- package/dist/interfaces/storage.d.ts +15 -4
- package/dist/interfaces/storage.d.ts.map +1 -1
- package/dist/interfaces/stream-broker.d.ts +18 -3
- package/dist/interfaces/stream-broker.d.ts.map +1 -1
- package/dist/interfaces/timezones.d.ts +59 -0
- package/dist/interfaces/timezones.d.ts.map +1 -0
- package/dist/node.d.ts +3 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +50 -8
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +51 -9
- package/dist/node.mjs.map +1 -1
- package/dist/storage/filesystem-storage-provider.d.ts +2 -1
- package/dist/storage/filesystem-storage-provider.d.ts.map +1 -1
- package/dist/stream-selection.d.ts +85 -0
- package/dist/stream-selection.d.ts.map +1 -0
- package/dist/types/detection.d.ts +3 -3
- package/dist/types/io.d.ts +1 -1
- package/dist/types/io.d.ts.map +1 -1
- package/dist/util/location-match.d.ts +15 -0
- package/dist/util/location-match.d.ts.map +1 -0
- package/dist/utils/canonical-hash.d.ts +20 -0
- package/dist/utils/canonical-hash.d.ts.map +1 -0
- package/dist/utils/export-reconciler.d.ts +101 -0
- package/dist/utils/export-reconciler.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +36 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/capabilities/recording-engine.cap.d.ts +0 -477
- package/dist/capabilities/recording-engine.cap.d.ts.map +0 -1
- package/dist/index-C2zzIDdX.mjs.map +0 -1
- package/dist/index-DnpdVFKv.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
import type { DeviceType } from './device-type.js';
|
|
3
3
|
import type { IDevice } from './device.js';
|
|
4
|
+
import type { SourceInfo } from './source-info.js';
|
|
4
5
|
export interface DeviceManualCreation {
|
|
5
6
|
getChildCreationSchema(type: DeviceType): z.ZodObject<z.core.$ZodLooseShape>;
|
|
6
7
|
createDevice(type: DeviceType, config: unknown): Promise<IDevice>;
|
|
@@ -14,6 +15,10 @@ export interface DiscoveredDevice {
|
|
|
14
15
|
readonly type: DeviceType;
|
|
15
16
|
readonly suggestedName: string;
|
|
16
17
|
readonly prefilledConfig: Record<string, unknown>;
|
|
18
|
+
/** Optional upstream-system identity + rendering envelope. See
|
|
19
|
+
* `SourceInfo`. Providers populate this when discovery already knows
|
|
20
|
+
* the upstream identity / unit / deviceClass (HA-style discovery). */
|
|
21
|
+
readonly sourceInfo?: SourceInfo;
|
|
17
22
|
}
|
|
18
23
|
export interface SavedDevice {
|
|
19
24
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
@@ -56,10 +61,9 @@ export interface SavedDevice {
|
|
|
56
61
|
*/
|
|
57
62
|
/**
|
|
58
63
|
* Free-form device metadata — hardware identity + driver-populated
|
|
59
|
-
* facts the operator can both read and edit.
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* matter id, ONVIF profile token, …) don't require schema changes.
|
|
64
|
+
* facts the operator can both read and edit. Stored as a single JSON
|
|
65
|
+
* blob so future fields (HA matter id, ONVIF profile token, …) don't
|
|
66
|
+
* require schema changes.
|
|
63
67
|
*
|
|
64
68
|
* Conventional keys (drivers should populate when known):
|
|
65
69
|
* - `manufacturer` e.g. 'Reolink'
|
|
@@ -74,6 +78,62 @@ export interface SavedDevice {
|
|
|
74
78
|
* `ipAddress`, `apiPort`, …). All values must be JSON-serializable.
|
|
75
79
|
*/
|
|
76
80
|
export type DeviceMetadata = Record<string, unknown>;
|
|
81
|
+
/** One child-placement directive on a container's `childLayout`. The child is
|
|
82
|
+
* identified by its accessory `stableIdSuffix` (the key the provider passes to
|
|
83
|
+
* `getAccessoryChildren()`), which is re-sync stable. Children NOT listed here
|
|
84
|
+
* render in the plain Overview list as today; listed children are grouped into
|
|
85
|
+
* collapsible accordion sections in the UI (built in a follow-up task). */
|
|
86
|
+
export interface ChildLayoutEntry {
|
|
87
|
+
readonly childKey: string;
|
|
88
|
+
readonly section: string;
|
|
89
|
+
readonly order?: number;
|
|
90
|
+
/** Section-level default-collapsed hint: when true, the accordion section this
|
|
91
|
+
* entry belongs to renders closed by default. The section is treated as
|
|
92
|
+
* collapsed if ANY of its entries sets `collapsed: true`; consistent values
|
|
93
|
+
* across a section's entries are recommended but not enforced. Absent ⇒ open
|
|
94
|
+
* by default. */
|
|
95
|
+
readonly collapsed?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export type ChildLayout = readonly ChildLayoutEntry[];
|
|
98
|
+
/** One end of a device link: a single field on a source device's capability,
|
|
99
|
+
* addressed by the source's re-sync-stable accessory `stableIdSuffix`
|
|
100
|
+
* (`sourceKey`) — NOT a raw numeric id — so the link survives a re-sync. The
|
|
101
|
+
* source must be a sibling accessory under the SAME parent container as the
|
|
102
|
+
* target device; resolution is `${parentStableId}-${sourceKey}` (cross-parent
|
|
103
|
+
* links are out of scope and resolve to no source). */
|
|
104
|
+
export interface DeviceLinkSource {
|
|
105
|
+
readonly sourceKey: string;
|
|
106
|
+
readonly cap: string;
|
|
107
|
+
readonly fieldPath: string;
|
|
108
|
+
}
|
|
109
|
+
/** The target field a link writes: a dot-path into the target cap's status. */
|
|
110
|
+
export interface DeviceLinkTarget {
|
|
111
|
+
readonly cap: string;
|
|
112
|
+
readonly fieldPath: string;
|
|
113
|
+
/** Optional grouping key for array-of-items target caps (consumables); P2. */
|
|
114
|
+
readonly itemKey?: string;
|
|
115
|
+
}
|
|
116
|
+
/** Optional value transform applied to the resolved source value. */
|
|
117
|
+
export type DeviceLinkTransform = {
|
|
118
|
+
readonly kind: 'identity';
|
|
119
|
+
} | {
|
|
120
|
+
readonly kind: 'enum-map';
|
|
121
|
+
readonly mapping: Record<string, string | number | boolean>;
|
|
122
|
+
readonly fallback?: string | number | boolean;
|
|
123
|
+
} | {
|
|
124
|
+
readonly kind: 'linear';
|
|
125
|
+
readonly scale: number;
|
|
126
|
+
readonly offset: number;
|
|
127
|
+
readonly clamp?: readonly [number, number];
|
|
128
|
+
};
|
|
129
|
+
/** One operator-authored cross-device field wiring, persisted on the TARGET. */
|
|
130
|
+
export interface DeviceLink {
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly source: DeviceLinkSource;
|
|
133
|
+
readonly target: DeviceLinkTarget;
|
|
134
|
+
readonly transform?: DeviceLinkTransform;
|
|
135
|
+
}
|
|
136
|
+
export type DeviceLinks = readonly DeviceLink[];
|
|
77
137
|
export interface DeviceMeta {
|
|
78
138
|
readonly id: number;
|
|
79
139
|
readonly stableId: string;
|
|
@@ -85,6 +145,38 @@ export interface DeviceMeta {
|
|
|
85
145
|
readonly parentDeviceId: number | null;
|
|
86
146
|
/** Hardware + identity blob; null when nothing has been populated yet. */
|
|
87
147
|
readonly metadata: DeviceMetadata | null;
|
|
148
|
+
/** Optional upstream-system identity + rendering envelope. See
|
|
149
|
+
* `SourceInfo`. Persisted under `metadata.sourceInfo` — this field
|
|
150
|
+
* is the typed projection callers consume directly. `BaseDevice`
|
|
151
|
+
* re-extracts via `extractSourceInfoFromMetadata()` for its own
|
|
152
|
+
* getter; kernel-side reader populates this from the same path. */
|
|
153
|
+
readonly sourceInfo?: SourceInfo;
|
|
154
|
+
/** Owning integration id, stamped at create — used by the core to
|
|
155
|
+
* cascade-delete an integration's devices. Optional: only present
|
|
156
|
+
* when the device was created through an integration (e.g. HA). */
|
|
157
|
+
readonly integrationId?: string;
|
|
158
|
+
/** Optional soft-link to another device id (peer of integrationId).
|
|
159
|
+
* Set at create; inert today — reserved for the Container→child
|
|
160
|
+
* passthrough. Nullable: an explicit null means "unlinked". */
|
|
161
|
+
readonly linkDeviceId?: number | null;
|
|
162
|
+
/** Durable primary-child override for a CONTAINER device, keyed on the
|
|
163
|
+
* chosen child's re-sync/rename-stable `entityId` (its `sourceInfo.id`,
|
|
164
|
+
* falling back to `stableId`). Unlike the numeric `linkDeviceId`, this
|
|
165
|
+
* survives a re-sync that reallocates the child's numeric id or renames
|
|
166
|
+
* its row. `null` explicitly clears the override → priority default.
|
|
167
|
+
* Absent ⇒ no override has ever been set. */
|
|
168
|
+
readonly primaryChildEntityId?: string | null;
|
|
169
|
+
/** Container-level layout hint: assigns specific child/accessory devices to
|
|
170
|
+
* named accordion sections (with optional intra-section order). Each entry's
|
|
171
|
+
* `childKey` is the child's re-sync-stable accessory `stableIdSuffix`. Set at
|
|
172
|
+
* create, persisted, projected, and preserved across re-register/restore —
|
|
173
|
+
* same lifecycle as `primaryChildEntityId`. Absent ⇒ no layout declared (all
|
|
174
|
+
* children render in the plain Overview list). */
|
|
175
|
+
readonly childLayout?: ChildLayout;
|
|
176
|
+
/** Operator-authored cross-device field wirings (source field → this device's
|
|
177
|
+
* cap field). Same create/persist/project/restore lifecycle as `childLayout`.
|
|
178
|
+
* Absent ⇒ no links. Overlaid onto the target cap's `getStatus` at read time. */
|
|
179
|
+
readonly deviceLinks?: DeviceLinks;
|
|
88
180
|
}
|
|
89
181
|
/**
|
|
90
182
|
* Initial meta a provider supplies on `onCreateDevice`. Differs
|
|
@@ -95,6 +187,26 @@ export interface InitialDeviceMeta {
|
|
|
95
187
|
readonly type: DeviceType;
|
|
96
188
|
readonly name: string;
|
|
97
189
|
readonly location?: string | null;
|
|
190
|
+
/** Semantic role string (`DeviceRole`) — stamped at create for
|
|
191
|
+
* accessory children (e.g. 'numeric-sensor', 'binary-sensor').
|
|
192
|
+
* Optional: only set when the device is an accessory with a known role. */
|
|
193
|
+
readonly role?: string;
|
|
194
|
+
/** Owning integration id, stamped at create — used by the core to
|
|
195
|
+
* cascade-delete an integration's devices. Optional: only set when
|
|
196
|
+
* the device is being created through an integration. */
|
|
197
|
+
readonly integrationId?: string;
|
|
198
|
+
/** Optional soft-link to another device id (peer of integrationId).
|
|
199
|
+
* Set at create; inert today — reserved for the Container→child
|
|
200
|
+
* passthrough. Nullable: an explicit null means "unlinked". */
|
|
201
|
+
readonly linkDeviceId?: number | null;
|
|
202
|
+
/** Container-level layout hint set at create — assigns specific
|
|
203
|
+
* child/accessory devices to named accordion sections (with optional order).
|
|
204
|
+
* Mirrors `DeviceMeta.childLayout`; persisted, projected, and preserved
|
|
205
|
+
* across re-register/restore. Optional: only set for CONTAINER devices that
|
|
206
|
+
* declare a layout. */
|
|
207
|
+
readonly childLayout?: ChildLayout;
|
|
208
|
+
/** Cross-device field wirings set at create. Mirrors `DeviceMeta.deviceLinks`. */
|
|
209
|
+
readonly deviceLinks?: DeviceLinks;
|
|
98
210
|
}
|
|
99
211
|
/**
|
|
100
212
|
* Single-call payload returned by `BaseDeviceProvider.onCreateDevice`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-management.d.ts","sourceRoot":"","sources":["../../src/device/device-management.ts"],"names":[],"mappings":"AA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AC,MAAM,EAAE,OAAO,CAAC,CAAA;IACxC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CACnE"}
|
|
@@ -7,11 +7,85 @@ export declare enum DeviceType {
|
|
|
7
7
|
Sensor = "sensor",
|
|
8
8
|
Thermostat = "thermostat",
|
|
9
9
|
Button = "button",
|
|
10
|
-
Generic
|
|
10
|
+
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
11
|
+
* event vocabulary verbatim (no normalization). Installed with the
|
|
12
|
+
* `event-emitter` cap. Sources: HA `event.*` entities (structured) and
|
|
13
|
+
* HA bus events (e.g. `zha_event`, generic). */
|
|
14
|
+
EventEmitter = "event-emitter",
|
|
15
|
+
/** Firmware/software update entity — current vs available version,
|
|
16
|
+
* updatable flag, update state, and an install action. Installed with
|
|
17
|
+
* the `update` cap. Sources: Homematic firmware-update channels (and
|
|
18
|
+
* reusable by other providers, e.g. HA `update.*` entities). */
|
|
19
|
+
Update = "update",
|
|
20
|
+
Generic = "generic",
|
|
21
|
+
/** Generic notification delivery target (HA `notify.<service>`, future
|
|
22
|
+
* Telegram / Discord / ntfy / SMTP, …). One device per delivery
|
|
23
|
+
* endpoint; the `notifier` cap defines the send surface. */
|
|
24
|
+
Notifier = "notifier",
|
|
25
|
+
/** Pre-recorded action sequence with optional parameters
|
|
26
|
+
* (HA `script.*`). Runnable via `script-runner` cap. */
|
|
27
|
+
Script = "script",
|
|
28
|
+
/** Automation rule (HA `automation.*`) — enable/disable + manual
|
|
29
|
+
* trigger surface exposed via `automation-control` cap. */
|
|
30
|
+
Automation = "automation",
|
|
31
|
+
/** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
|
|
32
|
+
Lock = "lock",
|
|
33
|
+
/** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
|
|
34
|
+
* `valve.*`). `cover` cap with sub-roles for variant. */
|
|
35
|
+
Cover = "cover",
|
|
36
|
+
/** Pipe / water / gas valve with open/close/stop and optional
|
|
37
|
+
* position (HA `valve.*`). `valve` cap — a cover-sibling actuator
|
|
38
|
+
* modelled on the same open/closed lifecycle. */
|
|
39
|
+
Valve = "valve",
|
|
40
|
+
/** Humidifier / dehumidifier with on/off + target humidity + mode
|
|
41
|
+
* (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
|
|
42
|
+
* modelled on the same target / mode lifecycle. */
|
|
43
|
+
Humidifier = "humidifier",
|
|
44
|
+
/** Water heater / boiler with target temperature + operation mode +
|
|
45
|
+
* away mode (HA `water_heater.*`). `water-heater` cap — a
|
|
46
|
+
* climate-family actuator. */
|
|
47
|
+
WaterHeater = "water-heater",
|
|
48
|
+
/** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
|
|
49
|
+
Fan = "fan",
|
|
50
|
+
/** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
|
|
51
|
+
* the camera surface — those use `Camera`. `media-player` cap. */
|
|
52
|
+
MediaPlayer = "media-player",
|
|
53
|
+
/** Security panel / alarm system (HA `alarm_control_panel.*`).
|
|
54
|
+
* `alarm-panel` cap. */
|
|
55
|
+
AlarmPanel = "alarm-panel",
|
|
56
|
+
/** Generic user-settable input (HA `number` / `input_number` / `select`
|
|
57
|
+
* / `input_select` / `text` / `input_text` / `input_datetime`).
|
|
58
|
+
* Sub-type via `DeviceRole`: NumericControl / SelectControl /
|
|
59
|
+
* TextControl / DateTimeControl. */
|
|
60
|
+
Control = "control",
|
|
61
|
+
/** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
|
|
62
|
+
* `presence` cap. */
|
|
63
|
+
Presence = "presence",
|
|
64
|
+
/** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
|
|
65
|
+
* `weather` cap. */
|
|
66
|
+
Weather = "weather",
|
|
67
|
+
/** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
|
|
68
|
+
Vacuum = "vacuum",
|
|
69
|
+
/** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
|
|
70
|
+
* `lawn-mower-control` cap. */
|
|
71
|
+
LawnMower = "lawn-mower",
|
|
72
|
+
/** Physical HA device group — parent container for entity-children
|
|
73
|
+
* adopted from a single HA device entry. Not renderable as a
|
|
74
|
+
* standalone device; exists only to anchor child entities. */
|
|
75
|
+
Container = "container",
|
|
76
|
+
/** Single still-image entity (HA `image.*`). Read-only display of an
|
|
77
|
+
* `entity_picture` signed URL the browser loads directly. `image` cap. */
|
|
78
|
+
Image = "image"
|
|
11
79
|
}
|
|
12
80
|
export declare enum DeviceFeature {
|
|
13
81
|
BatteryOperated = "battery-operated",
|
|
14
82
|
Rebootable = "rebootable",
|
|
83
|
+
/**
|
|
84
|
+
* Device supports an on-demand re-sync of its derived spec with its
|
|
85
|
+
* upstream source — drives the generic Re-sync button. The owning
|
|
86
|
+
* provider implements the action via the `device-adoption.resync` cap.
|
|
87
|
+
*/
|
|
88
|
+
Resyncable = "resyncable",
|
|
15
89
|
NativeSnapshot = "native-snapshot",
|
|
16
90
|
DoorbellButton = "doorbell-button",
|
|
17
91
|
TwoWayAudio = "two-way-audio",
|
|
@@ -36,7 +110,88 @@ export declare enum DeviceFeature {
|
|
|
36
110
|
* fast scalar without binding fetch), notifier rules, and `listAll`
|
|
37
111
|
* filters that want "all devices with on-motion behaviour".
|
|
38
112
|
*/
|
|
39
|
-
MotionTrigger = "motion-trigger"
|
|
113
|
+
MotionTrigger = "motion-trigger",
|
|
114
|
+
/** Light supports rgb-triplet color via `color` cap. */
|
|
115
|
+
LightColorRgb = "light-color-rgb",
|
|
116
|
+
/** Light supports HSV color via `color` cap. */
|
|
117
|
+
LightColorHsv = "light-color-hsv",
|
|
118
|
+
/** Light supports color-temperature (mired) via `color` cap. */
|
|
119
|
+
LightColorMired = "light-color-mired",
|
|
120
|
+
/** Thermostat supports a `heat_cool` dual setpoint (targetLow +
|
|
121
|
+
* targetHigh). Gates the range slider UI. */
|
|
122
|
+
ClimateDualSetpoint = "climate-dual-setpoint",
|
|
123
|
+
/** Thermostat exposes target humidity and/or current humidity
|
|
124
|
+
* readings. Gates the humidity controls. */
|
|
125
|
+
ClimateHumidity = "climate-humidity",
|
|
126
|
+
/** Thermostat exposes a fan-mode selector. */
|
|
127
|
+
ClimateFanMode = "climate-fan-mode",
|
|
128
|
+
/** Thermostat exposes preset modes (eco / away / sleep / vendor). */
|
|
129
|
+
ClimatePreset = "climate-preset",
|
|
130
|
+
/** Cover exposes intermediate position control (0..100). Gates the
|
|
131
|
+
* position slider UI. */
|
|
132
|
+
CoverPositionable = "cover-positionable",
|
|
133
|
+
/** Cover exposes slat-tilt control. Gates the tilt slider UI. */
|
|
134
|
+
CoverTilt = "cover-tilt",
|
|
135
|
+
/** Valve exposes intermediate position control (0..100). Gates the
|
|
136
|
+
* position slider / drag surface UI. */
|
|
137
|
+
ValvePositionable = "valve-positionable",
|
|
138
|
+
/** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
|
|
139
|
+
FanSpeed = "fan-speed",
|
|
140
|
+
/** Fan exposes a preset mode selector. */
|
|
141
|
+
FanPreset = "fan-preset",
|
|
142
|
+
/** Fan exposes blade direction (forward/reverse) — typical of
|
|
143
|
+
* ceiling fans. */
|
|
144
|
+
FanDirection = "fan-direction",
|
|
145
|
+
/** Fan exposes an oscillation toggle. */
|
|
146
|
+
FanOscillating = "fan-oscillating",
|
|
147
|
+
/** Lock requires a PIN code on lock/unlock. Gates the code-entry
|
|
148
|
+
* field on the UI lock-controls panel. */
|
|
149
|
+
LockPinRequired = "lock-pin-required",
|
|
150
|
+
/** Lock supports a latch-release ("open door") action distinct from
|
|
151
|
+
* unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
|
|
152
|
+
* `supported_features`. Gates the Open Door button in the UI. */
|
|
153
|
+
LockOpen = "lock-open",
|
|
154
|
+
/** Media player exposes a seek-to-position surface. */
|
|
155
|
+
MediaPlayerSeek = "media-player-seek",
|
|
156
|
+
/** Media player exposes a volume-level setter. */
|
|
157
|
+
MediaPlayerVolume = "media-player-volume",
|
|
158
|
+
/** Media player exposes a mute toggle distinct from volume=0. */
|
|
159
|
+
MediaPlayerMute = "media-player-mute",
|
|
160
|
+
/** Media player exposes a shuffle toggle. */
|
|
161
|
+
MediaPlayerShuffle = "media-player-shuffle",
|
|
162
|
+
/** Media player exposes a repeat mode (off / all / one). */
|
|
163
|
+
MediaPlayerRepeat = "media-player-repeat",
|
|
164
|
+
/** Media player exposes a source / input selector. */
|
|
165
|
+
MediaPlayerSelectSource = "media-player-select-source",
|
|
166
|
+
/** Media player exposes a play-arbitrary-media surface (URL / id). */
|
|
167
|
+
MediaPlayerPlayMedia = "media-player-play-media",
|
|
168
|
+
/** Media player exposes next-track. */
|
|
169
|
+
MediaPlayerNext = "media-player-next",
|
|
170
|
+
/** Media player exposes previous-track. */
|
|
171
|
+
MediaPlayerPrevious = "media-player-previous",
|
|
172
|
+
/** Media player exposes stop distinct from pause. */
|
|
173
|
+
MediaPlayerStop = "media-player-stop",
|
|
174
|
+
/** Alarm panel requires a PIN code on arm/disarm. */
|
|
175
|
+
AlarmPinRequired = "alarm-pin-required",
|
|
176
|
+
/** Presence device carries GPS coordinates (lat/lng/accuracy) in
|
|
177
|
+
* addition to a textual location. */
|
|
178
|
+
PresenceGps = "presence-gps",
|
|
179
|
+
/** Notifier accepts an inline / URL image attachment. */
|
|
180
|
+
NotifierImage = "notifier-image",
|
|
181
|
+
/** Notifier accepts a priority hint (high/normal/low). */
|
|
182
|
+
NotifierPriority = "notifier-priority",
|
|
183
|
+
/** Notifier accepts a free-form `data` payload for platform-specific
|
|
184
|
+
* fields. */
|
|
185
|
+
NotifierData = "notifier-data",
|
|
186
|
+
/** Notifier supports interactive action buttons / callbacks. */
|
|
187
|
+
NotifierActions = "notifier-actions",
|
|
188
|
+
/** Notifier supports per-call recipient targeting (multi-user). */
|
|
189
|
+
NotifierRecipients = "notifier-recipients",
|
|
190
|
+
/** Script runner accepts a variables map on each run invocation. */
|
|
191
|
+
ScriptVariables = "script-variables",
|
|
192
|
+
/** Automation `trigger` accepts a skipCondition flag — fires the
|
|
193
|
+
* automation's actions while bypassing its condition block. */
|
|
194
|
+
AutomationSkipCondition = "automation-skip-condition"
|
|
40
195
|
}
|
|
41
196
|
export declare enum ChargingStatus {
|
|
42
197
|
ChargingDC = "charging-dc",
|
|
@@ -63,6 +218,62 @@ export declare enum DeviceRole {
|
|
|
63
218
|
Autotrack = "autotrack",
|
|
64
219
|
Nightvision = "nightvision",
|
|
65
220
|
PrivacyMask = "privacy-mask",
|
|
66
|
-
Doorbell = "doorbell"
|
|
221
|
+
Doorbell = "doorbell",
|
|
222
|
+
/** Virtual HA toggle (input_boolean.*) — distinguishable from a
|
|
223
|
+
* real Switch device for UI rendering / export adapters. */
|
|
224
|
+
BinaryHelper = "binary-helper",
|
|
225
|
+
/** Generic motion / occupancy / moving event source. Distinct from
|
|
226
|
+
* the camera accessory PirSensor role: that one is a camera child;
|
|
227
|
+
* this is a standalone HA / 3rd-party motion sensor. */
|
|
228
|
+
MotionSensor = "motion-sensor",
|
|
229
|
+
ContactSensor = "contact-sensor",
|
|
230
|
+
LeakSensor = "leak-sensor",
|
|
231
|
+
SmokeSensor = "smoke-sensor",
|
|
232
|
+
COSensor = "co-sensor",
|
|
233
|
+
GasSensor = "gas-sensor",
|
|
234
|
+
TamperSensor = "tamper-sensor",
|
|
235
|
+
VibrationSensor = "vibration-sensor",
|
|
236
|
+
ConnectivitySensor = "connectivity-sensor",
|
|
237
|
+
SoundSensor = "sound-sensor",
|
|
238
|
+
/** Fallback for `binary_sensor` without a known `device_class`. */
|
|
239
|
+
BinarySensor = "binary-sensor",
|
|
240
|
+
TemperatureSensor = "temperature-sensor",
|
|
241
|
+
HumiditySensor = "humidity-sensor",
|
|
242
|
+
AmbientLightSensor = "ambient-light-sensor",
|
|
243
|
+
PressureSensor = "pressure-sensor",
|
|
244
|
+
PowerSensor = "power-sensor",
|
|
245
|
+
EnergySensor = "energy-sensor",
|
|
246
|
+
VoltageSensor = "voltage-sensor",
|
|
247
|
+
CurrentSensor = "current-sensor",
|
|
248
|
+
AirQualitySensor = "air-quality-sensor",
|
|
249
|
+
/** Battery level (numeric % via `sensor` OR low-bool via
|
|
250
|
+
* `binary_sensor` — the cap distinguishes via the value type). */
|
|
251
|
+
BatterySensor = "battery-sensor",
|
|
252
|
+
/** Fallback for `sensor` numeric without a known `device_class`. */
|
|
253
|
+
NumericSensor = "numeric-sensor",
|
|
254
|
+
/** String / enum state (HA `sensor` with `state_class: enum` or
|
|
255
|
+
* `attributes.options`). */
|
|
256
|
+
EnumSensor = "enum-sensor",
|
|
257
|
+
/** Date / timestamp state (HA `sensor` with `device_class: timestamp`
|
|
258
|
+
* or `date`). The slice carries the raw ISO string verbatim (hosted on
|
|
259
|
+
* the `enum-sensor` cap); the UI renders it locale-formatted. */
|
|
260
|
+
DateTimeSensor = "datetime-sensor",
|
|
261
|
+
/** Last-resort fallback when nothing else matches. */
|
|
262
|
+
GenericSensor = "generic-sensor",
|
|
263
|
+
NumericControl = "numeric-control",
|
|
264
|
+
SelectControl = "select-control",
|
|
265
|
+
TextControl = "text-control",
|
|
266
|
+
DateTimeControl = "datetime-control",
|
|
267
|
+
/** Mobile push notifier (HA `notify.mobile_app_*`) — supports
|
|
268
|
+
* rich features (image, priority, channel routing). */
|
|
269
|
+
MobilePushNotifier = "mobile-push-notifier",
|
|
270
|
+
/** Chat / messaging service (HA `notify.telegram_*`,
|
|
271
|
+
* `notify.discord_*`, etc.). */
|
|
272
|
+
MessagingNotifier = "messaging-notifier",
|
|
273
|
+
/** Email-based delivery (HA `notify.smtp`, etc.). */
|
|
274
|
+
EmailNotifier = "email-notifier",
|
|
275
|
+
/** Fallback when the notifier service name doesn't match a known
|
|
276
|
+
* pattern. */
|
|
277
|
+
GenericNotifier = "generic-notifier"
|
|
67
278
|
}
|
|
68
279
|
//# sourceMappingURL=device-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-type.d.ts","sourceRoot":"","sources":["../../src/device/device-type.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"device-type.d.ts","sourceRoot":"","sources":["../../src/device/device-type.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB;;;qDAGiD;IACjD,YAAY,kBAAkB;IAC9B;;;qEAGiE;IACjE,MAAM,WAAW;IACjB,OAAO,YAAY;IAGnB;;iEAE6D;IAC7D,QAAQ,aAAkB;IAC1B;6DACyD;IACzD,MAAM,WAAkB;IACxB;gEAC4D;IAC5D,UAAU,eAAkB;IAC5B,kEAAkE;IAClE,IAAI,SAAkB;IACtB;8DAC0D;IAC1D,KAAK,UAAkB;IACvB;;sDAEkD;IAClD,KAAK,UAAkB;IACvB;;wDAEoD;IACpD,UAAU,eAAkB;IAC5B;;mCAE+B;IAC/B,WAAW,iBAAmB;IAC9B,wEAAwE;IACxE,GAAG,QAAkB;IACrB;uEACmE;IACnE,WAAW,iBAAmB;IAC9B;6BACyB;IACzB,UAAU,gBAAmB;IAC7B;;;yCAGqC;IACrC,OAAO,YAAkB;IACzB;0BACsB;IACtB,QAAQ,aAAkB;IAC1B;yBACqB;IACrB,OAAO,YAAkB;IACzB,kEAAkE;IAClE,MAAM,WAAkB;IACxB;oCACgC;IAChC,SAAS,eAAmB;IAC5B;;mEAE+D;IAC/D,SAAS,cAAkB;IAC3B;+EAC2E;IAC3E,KAAK,UAAkB;CACxB;AAED,oBAAY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AsD;IACtD,aAAa,mBAAwB;IAGrC,cAAc,oBAAwB;IACtC,aAAa,mBAAwB;IACrC,WAAW,iBAAwB;IACnC,eAAe,qBAAwB;IAGvC;4DACwD;IACxD,kBAAkB,yBAAyB;IAC3C;qCACiC;IACjC,iBAAiB,uBAAwB;IACzC,qDAAqD;IACrD,aAAa,mBAAwB;IACrC;mBACe;IACf,eAAe,qBAAwB;CACxC"}
|
package/dist/device/device.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { DeviceType, DeviceFeature, DeviceRole } from './device-type.js';
|
|
|
3
3
|
import type { DeviceConfig } from './device-config.js';
|
|
4
4
|
import type { DeviceContext } from './device-context.js';
|
|
5
5
|
import type { ConfigUISchemaWithValues } from '../interfaces/config-ui.js';
|
|
6
|
+
import type { RawStateResult } from '../capabilities/device-ops.cap.js';
|
|
7
|
+
import type { IDeviceRuntimeState } from './device-runtime-state.js';
|
|
6
8
|
export interface IDevice {
|
|
7
9
|
/** Progressive, system-wide unique numeric id. Assigned by the hub's
|
|
8
10
|
* `device-manager` at `allocateDeviceId` time, injected through
|
|
@@ -55,6 +57,16 @@ export interface IDevice {
|
|
|
55
57
|
readonly features: readonly DeviceFeature[];
|
|
56
58
|
readonly config: DeviceConfig<z.ZodObject<z.core.$ZodLooseShape>>;
|
|
57
59
|
readonly ctx: DeviceContext;
|
|
60
|
+
/**
|
|
61
|
+
* Kernel-managed per-device runtime-state surface (cap-keyed slices:
|
|
62
|
+
* `device-status`, `feature-probe`, `battery`, …). Present on every
|
|
63
|
+
* `BaseDevice` subclass; optional here because a handful of direct
|
|
64
|
+
* `IDevice` implementors (legacy Onvif/Frigate camera classes) predate
|
|
65
|
+
* the runtime-state machinery and don't carry one. Consumers that read
|
|
66
|
+
* it (e.g. the device-manager's `probed`-flag derivation) tolerate
|
|
67
|
+
* `undefined` as "no slice".
|
|
68
|
+
*/
|
|
69
|
+
readonly runtimeState?: IDeviceRuntimeState;
|
|
58
70
|
removeDevice(): Promise<void>;
|
|
59
71
|
/**
|
|
60
72
|
* Set the device's online flag. Called by `BaseDeviceProvider` after
|
|
@@ -83,5 +95,18 @@ export interface IDevice {
|
|
|
83
95
|
* `config.setAll(patch)` so drivers opt in only when they need reshape.
|
|
84
96
|
*/
|
|
85
97
|
applySettingsPatch(patch: Record<string, unknown>): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Invoke a device custom action registered via `registerDeviceAction`.
|
|
100
|
+
* Validates input against the action's spec, then runs its handler.
|
|
101
|
+
* Throws on an unknown action. The device equivalent of an addon
|
|
102
|
+
* customAction; dispatched cross-process via `device-ops.runAction`.
|
|
103
|
+
*/
|
|
104
|
+
runDeviceAction(action: string, input: unknown): Promise<unknown>;
|
|
105
|
+
/**
|
|
106
|
+
* Optional: return this device's RAW upstream state (cached provider
|
|
107
|
+
* values) as a display-safe `{ source, data }` blob, or `null`/absent
|
|
108
|
+
* when none. Surfaced via `device-ops.getRawState` in the State panel.
|
|
109
|
+
*/
|
|
110
|
+
getRawState?(): Promise<RawStateResult | null>;
|
|
86
111
|
}
|
|
87
112
|
//# sourceMappingURL=device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/device/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/device/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA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AAI,CAAC,CAAA;IAE7B;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAA;IAEjC;;;;;;;;;;OAUG;IACH,mBAAmB,IAAI,wBAAwB,CAAA;IAE/C;;;;;;OAMG;IACH,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjE;;;;;OAKG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEjE;;;;OAIG;IACH,WAAW,CAAC,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;CAC/C"}
|
package/dist/device/index.d.ts
CHANGED
|
@@ -11,10 +11,14 @@ export type { IDevice } from './device.js';
|
|
|
11
11
|
export { DEVICE_PROFILES, BATTERY_DEVICE_PROFILE, deviceMatchesProfile, resolveDeviceProfile, } from './device-profile.js';
|
|
12
12
|
export type { DeviceProfile, DeviceProfileMatch, DeviceProfileDefaults, PipelinePhaseMode, } from './device-profile.js';
|
|
13
13
|
export type { ICameraDevice, StreamSourceEntry } from './camera-device.js';
|
|
14
|
-
export type { DeviceManualCreation, DeviceDiscovery, DiscoveredDevice, SavedDevice, DeviceMeta, InitialDeviceMeta, CreateDeviceSpec } from './device-management.js';
|
|
14
|
+
export type { DeviceManualCreation, DeviceDiscovery, DiscoveredDevice, SavedDevice, DeviceMeta, InitialDeviceMeta, CreateDeviceSpec, ChildLayout, ChildLayoutEntry, DeviceLinkSource, DeviceLinkTarget, DeviceLinkTransform, DeviceLink, DeviceLinks } from './device-management.js';
|
|
15
15
|
export { zodEntriesToConfigUI } from './zod-to-config-ui.js';
|
|
16
16
|
export type { DeviceConfigEntry } from './zod-to-config-ui.js';
|
|
17
17
|
export { createRuntimeStateBridge } from './runtime-state-helpers.js';
|
|
18
18
|
export type { RuntimeStateBridge } from './runtime-state-helpers.js';
|
|
19
19
|
export type { IDeviceRuntimeState, Snapshot as RuntimeStateSnapshot } from './device-runtime-state.js';
|
|
20
|
+
export { getByPath, setByPath } from './path-util.js';
|
|
21
|
+
export { applyTransform } from './device-link-transform.js';
|
|
22
|
+
export { enumerateSchemaFields } from './schema-fields.js';
|
|
23
|
+
export type { WireableField } from './schema-fields.js';
|
|
20
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/device/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxF,OAAO,EACL,aAAa,EAAE,eAAe,EAAE,iBAAiB,EACjD,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAChI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrI,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC/E,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACpH,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EACL,eAAe,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,oBAAoB,GACpF,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAC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a,EAAE,kBAAkB,EAAE,qBAAqB,EACxD,iBAAiB,GAClB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC1E,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpR,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,YAAY,EAAE,mBAAmB,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACtG,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Read a dot-path (`a.b.c`) out of an object. Returns `undefined` for any
|
|
2
|
+
* missing/non-object segment — never throws. */
|
|
3
|
+
export declare function getByPath(obj: unknown, path: string): unknown;
|
|
4
|
+
/** Immutably set a dot-path on an object, returning a new object. Intermediate
|
|
5
|
+
* objects are created when a segment is missing or null. Arrays are NOT
|
|
6
|
+
* traversed (P1 has no array-index syntax — see `itemKey` grouping in P2): if a
|
|
7
|
+
* segment resolves to an array it is replaced by a fresh object, so the array
|
|
8
|
+
* is discarded — the only caller (`mergeLinkedStatus`) re-validates the result
|
|
9
|
+
* with the target cap's Zod schema and rejects a malformed overlay.
|
|
10
|
+
* The return type `T` preserves the OUTER shape; the rewritten key is not
|
|
11
|
+
* narrowed, so callers should re-validate against the status schema. */
|
|
12
|
+
export declare function setByPath<T extends Record<string, unknown>>(obj: T, path: string, value: unknown): T;
|
|
13
|
+
//# sourceMappingURL=path-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-util.d.ts","sourceRoot":"","sources":["../../src/device/path-util.ts"],"names":[],"mappings":"AAKA;iDACiD;AACjD,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQ7D;AAED;;;;;;;yEAOyE;AACzE,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzD,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,CAAC,CAWH"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface WireableField {
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly kind: 'string' | 'number' | 'boolean' | 'enum';
|
|
5
|
+
readonly enumValues?: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
/** Walk a cap status schema into flat wireable leaf fields (dotted paths).
|
|
8
|
+
* Recurses into nested ZodObject (unwrapping nullable/optional/default first),
|
|
9
|
+
* so fields with null live values are still offered. Arrays / unknown shapes
|
|
10
|
+
* are skipped — never throws. */
|
|
11
|
+
export declare function enumerateSchemaFields(schema: z.ZodType, prefix?: string): readonly WireableField[];
|
|
12
|
+
//# sourceMappingURL=schema-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-fields.d.ts","sourceRoot":"","sources":["../../src/device/schema-fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;IACvD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACxC;AAqBD;;;kCAGkC;AAClC,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,SAAK,GAAG,SAAS,aAAa,EAAE,CAa9F"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Identity envelope for a device's upstream-system metadata.
|
|
4
|
+
*
|
|
5
|
+
* Two jobs:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Dispatch key.** `id` is the natural identifier the SOURCE system
|
|
8
|
+
* uses to address this device (HA `entity_id`, Reolink MAC, ONVIF
|
|
9
|
+
* WS-Discovery endpoint UUID, …). Provider code keeps a
|
|
10
|
+
* `Map<sourceInfo.id, IDevice>` to route inbound push events in O(1)
|
|
11
|
+
* without round-tripping through `stableId` / `id` mappings.
|
|
12
|
+
*
|
|
13
|
+
* 2. **Stability bridge.** `uniqueId` is the *immutable* upstream id when
|
|
14
|
+
* one exists (HA `entity.unique_id`, Reolink MAC again — same as `id`
|
|
15
|
+
* for vendors where MAC is the natural key). For systems where the
|
|
16
|
+
* live dispatch key can be renamed (HA `entity_id` can be edited),
|
|
17
|
+
* providers detect renames by matching `uniqueId` and patch `id`
|
|
18
|
+
* in-place so dispatch keeps working.
|
|
19
|
+
*
|
|
20
|
+
* **Rendering metadata is NOT stored here.** Display fields (`unit`,
|
|
21
|
+
* `precision`) live in the cap STATUS SLICE so they flow live with every
|
|
22
|
+
* state push and are the single source of truth. The `device_class` tag is
|
|
23
|
+
* an HA-specific input that is consumed at the discovery boundary
|
|
24
|
+
* (`ha-domain-mapping`) to derive the CamStack `DeviceRole`; it is never
|
|
25
|
+
* stored after that point.
|
|
26
|
+
*
|
|
27
|
+
* The `raw` escape hatch carries provider-specific attributes that don't
|
|
28
|
+
* fit the structured slots (HA `attributes` whitelist, Reolink `deviceCache`
|
|
29
|
+
* details, …). Providers control what lands here.
|
|
30
|
+
*/
|
|
31
|
+
export declare const SourceInfoSchema: z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
system: z.ZodString;
|
|
34
|
+
uniqueId: z.ZodOptional<z.ZodString>;
|
|
35
|
+
raw: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type SourceInfo = z.infer<typeof SourceInfoSchema>;
|
|
38
|
+
/**
|
|
39
|
+
* Build the synthetic SourceInfo every existing provider falls back to
|
|
40
|
+
* when no upstream value has been persisted. Keeps non-migrated providers
|
|
41
|
+
* (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
|
|
42
|
+
* changes — `id` reuses the CamStack stableId, `system` reuses the addon
|
|
43
|
+
* id. Real upstream identity replaces this once a provider migrates and
|
|
44
|
+
* calls `updateSourceInfo()` with concrete values.
|
|
45
|
+
*/
|
|
46
|
+
export declare function synthesizeSourceInfo(input: {
|
|
47
|
+
stableId: string;
|
|
48
|
+
addonId: string;
|
|
49
|
+
}): SourceInfo;
|
|
50
|
+
/**
|
|
51
|
+
* Shallow-merge a partial patch over a prior SourceInfo. `undefined`
|
|
52
|
+
* patch values are ignored (no field clobber); to clear a field
|
|
53
|
+
* explicitly, providers omit it from the patch and rebuild from scratch
|
|
54
|
+
* via `updateSourceInfo({})` cycles — uncommon enough that we don't
|
|
55
|
+
* bother with a `null`-means-delete sentinel.
|
|
56
|
+
*
|
|
57
|
+
* The `raw` field is also shallow-merged: passing `raw: { foo: 1 }`
|
|
58
|
+
* merges over existing `raw` keys instead of replacing the whole bag.
|
|
59
|
+
*/
|
|
60
|
+
export declare function mergeSourceInfo(prev: SourceInfo, patch: Partial<SourceInfo>): SourceInfo;
|
|
61
|
+
/**
|
|
62
|
+
* Coerce common unit-of-measurement string variants to a canonical form
|
|
63
|
+
* so the UI's display templates can rely on stable strings. Pure
|
|
64
|
+
* passthrough for unknown units — kept conservative on purpose, the goal
|
|
65
|
+
* is to normalise the long tail of HA `unit_of_measurement` values that
|
|
66
|
+
* have multiple historical spellings (`'°C'` vs `'C'` vs `'celsius'`).
|
|
67
|
+
*
|
|
68
|
+
* Extend the map as we encounter real-world data. Returning the raw
|
|
69
|
+
* input for unknown values is intentional: providers should never
|
|
70
|
+
* lose information silently here.
|
|
71
|
+
*/
|
|
72
|
+
export declare function normalizeUnit(raw: string | null | undefined): string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Key under which `SourceInfo` lives inside `DeviceMeta.metadata`. The
|
|
75
|
+
* blob is a free-form `Record<string, unknown>` shared with hardware-
|
|
76
|
+
* identity fields (`manufacturer`, `model`, `firmware`, …); SourceInfo
|
|
77
|
+
* lives under a single nested key to keep it composable with those.
|
|
78
|
+
*/
|
|
79
|
+
export declare const SOURCE_INFO_METADATA_KEY = "sourceInfo";
|
|
80
|
+
/**
|
|
81
|
+
* Extract a SourceInfo from a `DeviceMeta.metadata` blob, validating
|
|
82
|
+
* with Zod. Returns `null` when the blob is missing or the nested
|
|
83
|
+
* `sourceInfo` key fails validation — callers fall back to the
|
|
84
|
+
* synthetic default in that case (see `synthesizeSourceInfo`).
|
|
85
|
+
*/
|
|
86
|
+
export declare function extractSourceInfoFromMetadata(metadata: Record<string, unknown> | null | undefined): SourceInfo | null;
|
|
87
|
+
//# sourceMappingURL=source-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-info.d.ts","sourceRoot":"","sources":["../../src/device/source-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,gBAAgB;;;;;iBAiB3B,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,GAAG,UAAU,CAKb;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAWxF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAsChF;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,eAAe,CAAA;AAEpD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GACnD,UAAU,GAAG,IAAI,CAOnB"}
|