@camstack/types 0.1.40 → 0.1.41
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/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 +93 -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 +238 -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 +31 -186
- package/dist/capabilities/storage-provider.cap.d.ts.map +1 -1
- package/dist/capabilities/storage.cap.d.ts +35 -226
- package/dist/capabilities/storage.cap.d.ts.map +1 -1
- package/dist/capabilities/stream-broker.cap.d.ts +309 -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/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 +12345 -8129
- 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 +133 -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 +124 -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 +9 -7
- package/dist/generated/system-proxy.d.ts.map +1 -1
- package/dist/{index-DnpdVFKv.js → index-BSA_TBea.js} +4170 -728
- package/dist/index-BSA_TBea.js.map +1 -0
- package/dist/{index-C2zzIDdX.mjs → index-Bpj3ScIH.mjs} +4563 -1121
- package/dist/index-Bpj3ScIH.mjs.map +1 -0
- package/dist/index.d.ts +21 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1323 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1637 -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.d.ts +91 -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 +18 -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
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type InferProvider } from './capability-definition.js';
|
|
3
|
+
import { DeviceType } from '../device/device-type.js';
|
|
4
|
+
/**
|
|
5
|
+
* Unified user-settable input cap. Models HA's `number` /
|
|
6
|
+
* `input_number` / `select` / `input_select` / `text` / `input_text`
|
|
7
|
+
* / `input_datetime` domains as a single device-scoped cap on
|
|
8
|
+
* `DeviceType.Control`.
|
|
9
|
+
*
|
|
10
|
+
* The slice is a discriminated union over four `kind` values that
|
|
11
|
+
* mirror the corresponding `DeviceRole` sub-roles
|
|
12
|
+
* (NumericControl / SelectControl / TextControl / DateTimeControl)
|
|
13
|
+
* — the device's `role` and the slice's `kind` are populated in
|
|
14
|
+
* lockstep at materialisation time. The UI reads `device.role`
|
|
15
|
+
* (or equivalently the slice's `kind`) to render the correct input
|
|
16
|
+
* widget (slider / dropdown / text field / date picker).
|
|
17
|
+
*
|
|
18
|
+
* The `select` branch carries its `options` list IN THE SLICE
|
|
19
|
+
* (not in `sourceInfo`) because HA `select.*` entities can update
|
|
20
|
+
* their options dynamically at runtime — the slice is the live
|
|
21
|
+
* source of truth. Numeric `unit`/`min`/`max`/`step` also live IN
|
|
22
|
+
* THE SLICE — populated live from the upstream source on each state
|
|
23
|
+
* push (HA `attributes.unit_of_measurement` / `min` / `max` /
|
|
24
|
+
* `step`). The slice is the single source of truth; there is no
|
|
25
|
+
* separate `sourceInfo` or device-config blob for these values.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ControlKindSchema: z.ZodEnum<{
|
|
28
|
+
text: "text";
|
|
29
|
+
select: "select";
|
|
30
|
+
datetime: "datetime";
|
|
31
|
+
numeric: "numeric";
|
|
32
|
+
}>;
|
|
33
|
+
export type ControlKind = z.infer<typeof ControlKindSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* Status slice — flat object (the framework's `runtimeState` contract
|
|
36
|
+
* requires a `ZodObject`, not a discriminated union). The `kind`
|
|
37
|
+
* field discriminates the value type at the type level via the
|
|
38
|
+
* `ControlNumericValue` / `ControlStringValue` aliases; consumers
|
|
39
|
+
* narrow with a kind check.
|
|
40
|
+
*
|
|
41
|
+
* The `value` field is typed as `number | string`:
|
|
42
|
+
* - `kind === 'numeric'` → `value` is `number`
|
|
43
|
+
* - `kind === 'select' | 'text' | 'datetime'` → `value` is `string`
|
|
44
|
+
*
|
|
45
|
+
* The `options` array is populated only when `kind === 'select'`
|
|
46
|
+
* (empty array for the other kinds). It lives in the slice because
|
|
47
|
+
* HA `select.*` entities may update their options at runtime.
|
|
48
|
+
*
|
|
49
|
+
* The `unit`/`min`/`max`/`step` fields are meaningful for
|
|
50
|
+
* `kind === 'numeric'` and are absent (undefined) for all other
|
|
51
|
+
* kinds. They are populated live from HA attributes on each state
|
|
52
|
+
* push — consistent with `options` and the sensor-unit approach.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ControlStatusSchema: z.ZodObject<{
|
|
55
|
+
kind: z.ZodEnum<{
|
|
56
|
+
text: "text";
|
|
57
|
+
select: "select";
|
|
58
|
+
datetime: "datetime";
|
|
59
|
+
numeric: "numeric";
|
|
60
|
+
}>;
|
|
61
|
+
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
62
|
+
options: z.ZodArray<z.ZodString>;
|
|
63
|
+
lastChangedAt: z.ZodNumber;
|
|
64
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
65
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
precision: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
70
|
+
date: "date";
|
|
71
|
+
datetime: "datetime";
|
|
72
|
+
time: "time";
|
|
73
|
+
}>>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type ControlStatus = z.infer<typeof ControlStatusSchema>;
|
|
76
|
+
declare const ControlSetValueInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
77
|
+
kind: z.ZodLiteral<"numeric">;
|
|
78
|
+
value: z.ZodNumber;
|
|
79
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
80
|
+
kind: z.ZodLiteral<"select">;
|
|
81
|
+
value: z.ZodString;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
kind: z.ZodLiteral<"text">;
|
|
84
|
+
value: z.ZodString;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
kind: z.ZodLiteral<"datetime">;
|
|
87
|
+
value: z.ZodString;
|
|
88
|
+
}, z.core.$strip>], "kind">;
|
|
89
|
+
export type ControlSetValueInput = z.infer<typeof ControlSetValueInputSchema>;
|
|
90
|
+
export declare const controlCapability: {
|
|
91
|
+
readonly name: "control";
|
|
92
|
+
readonly scope: "device";
|
|
93
|
+
readonly deviceNative: true;
|
|
94
|
+
readonly mode: "singleton";
|
|
95
|
+
readonly deviceTypes: readonly [DeviceType.Control];
|
|
96
|
+
readonly methods: {
|
|
97
|
+
readonly setValue: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
98
|
+
deviceId: z.ZodNumber;
|
|
99
|
+
control: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
100
|
+
kind: z.ZodLiteral<"numeric">;
|
|
101
|
+
value: z.ZodNumber;
|
|
102
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
+
kind: z.ZodLiteral<"select">;
|
|
104
|
+
value: z.ZodString;
|
|
105
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
106
|
+
kind: z.ZodLiteral<"text">;
|
|
107
|
+
value: z.ZodString;
|
|
108
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
+
kind: z.ZodLiteral<"datetime">;
|
|
110
|
+
value: z.ZodString;
|
|
111
|
+
}, z.core.$strip>], "kind">;
|
|
112
|
+
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
113
|
+
};
|
|
114
|
+
readonly status: {
|
|
115
|
+
readonly schema: z.ZodObject<{
|
|
116
|
+
kind: z.ZodEnum<{
|
|
117
|
+
text: "text";
|
|
118
|
+
select: "select";
|
|
119
|
+
datetime: "datetime";
|
|
120
|
+
numeric: "numeric";
|
|
121
|
+
}>;
|
|
122
|
+
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
123
|
+
options: z.ZodArray<z.ZodString>;
|
|
124
|
+
lastChangedAt: z.ZodNumber;
|
|
125
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
126
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
precision: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
131
|
+
date: "date";
|
|
132
|
+
datetime: "datetime";
|
|
133
|
+
time: "time";
|
|
134
|
+
}>>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
readonly kind: "push";
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Runtime-state slice — mirrored by the kernel. UI widgets (slider /
|
|
140
|
+
* dropdown / text field / date picker) read the slice's discriminant
|
|
141
|
+
* and value directly without polling the provider.
|
|
142
|
+
*/
|
|
143
|
+
readonly runtimeState: z.ZodObject<{
|
|
144
|
+
kind: z.ZodEnum<{
|
|
145
|
+
text: "text";
|
|
146
|
+
select: "select";
|
|
147
|
+
datetime: "datetime";
|
|
148
|
+
numeric: "numeric";
|
|
149
|
+
}>;
|
|
150
|
+
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
151
|
+
options: z.ZodArray<z.ZodString>;
|
|
152
|
+
lastChangedAt: z.ZodNumber;
|
|
153
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
154
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
precision: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
date: "date";
|
|
160
|
+
datetime: "datetime";
|
|
161
|
+
time: "time";
|
|
162
|
+
}>>;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
};
|
|
165
|
+
export type IControlProvider = InferProvider<typeof controlCapability>;
|
|
166
|
+
export {};
|
|
167
|
+
//# sourceMappingURL=control.cap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.cap.d.ts","sourceRoot":"","sources":["../../src/capabilities/control.cap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAErD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,eAAO,MAAM,iBAAiB;;;;;EAAoD,CAAA;AAClF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;iBAkC9B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,QAAA,MAAM,0BAA0B;;;;;;;;;;;;2BAK9B,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoB5B;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;CAEoC,CAAA;AAEzC,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type InferProvider } from './capability-definition.js';
|
|
3
|
+
import { DeviceType } from '../device/device-type.js';
|
|
4
|
+
/**
|
|
5
|
+
* Window covering / blinds / garage door / valve cap. Models HA
|
|
6
|
+
* `cover.*` entities — anything that moves between an open and a
|
|
7
|
+
* closed state with optional intermediate positioning and tilt.
|
|
8
|
+
*
|
|
9
|
+
* State follows HA's canonical lifecycle: `open` / `opening` /
|
|
10
|
+
* `closing` / `closed` / `stopped`. `position` (0 closed, 100 open)
|
|
11
|
+
* and `tiltPosition` are nullable — some shutters only support
|
|
12
|
+
* full open/close, some Venetian blinds add tilt but no slat
|
|
13
|
+
* positioning, garage doors are usually positionless. Providers
|
|
14
|
+
* populate only what the hardware reports.
|
|
15
|
+
*
|
|
16
|
+
* The cap intentionally does NOT split tilt into a sibling cap:
|
|
17
|
+
* physical hardware that has tilt always has the main position
|
|
18
|
+
* surface too, so the coupling stays inside one slice + one method
|
|
19
|
+
* group rather than spreading across two registrations.
|
|
20
|
+
*
|
|
21
|
+
* Sub-surface gating paired with `DeviceFeature` flags:
|
|
22
|
+
* - `CoverPositionable` — intermediate `position` slider
|
|
23
|
+
* - `CoverTilt` — slat-tilt slider
|
|
24
|
+
*/
|
|
25
|
+
export declare const CoverStateSchema: z.ZodEnum<{
|
|
26
|
+
open: "open";
|
|
27
|
+
stopped: "stopped";
|
|
28
|
+
opening: "opening";
|
|
29
|
+
closing: "closing";
|
|
30
|
+
closed: "closed";
|
|
31
|
+
}>;
|
|
32
|
+
export type CoverState = z.infer<typeof CoverStateSchema>;
|
|
33
|
+
export declare const CoverStatusSchema: z.ZodObject<{
|
|
34
|
+
state: z.ZodEnum<{
|
|
35
|
+
open: "open";
|
|
36
|
+
stopped: "stopped";
|
|
37
|
+
opening: "opening";
|
|
38
|
+
closing: "closing";
|
|
39
|
+
closed: "closed";
|
|
40
|
+
}>;
|
|
41
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
42
|
+
tiltPosition: z.ZodNullable<z.ZodNumber>;
|
|
43
|
+
lastChangedAt: z.ZodNumber;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type CoverStatus = z.infer<typeof CoverStatusSchema>;
|
|
46
|
+
export declare const coverCapability: {
|
|
47
|
+
readonly name: "cover";
|
|
48
|
+
readonly scope: "device";
|
|
49
|
+
readonly deviceNative: true;
|
|
50
|
+
readonly mode: "singleton";
|
|
51
|
+
readonly deviceTypes: readonly [DeviceType.Cover];
|
|
52
|
+
readonly methods: {
|
|
53
|
+
readonly open: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
54
|
+
deviceId: z.ZodNumber;
|
|
55
|
+
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
56
|
+
readonly close: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
57
|
+
deviceId: z.ZodNumber;
|
|
58
|
+
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
59
|
+
readonly stop: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
60
|
+
deviceId: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
62
|
+
readonly setPosition: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
63
|
+
deviceId: z.ZodNumber;
|
|
64
|
+
position: z.ZodNumber;
|
|
65
|
+
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
66
|
+
readonly setTiltPosition: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
67
|
+
deviceId: z.ZodNumber;
|
|
68
|
+
tiltPosition: z.ZodNumber;
|
|
69
|
+
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
70
|
+
};
|
|
71
|
+
readonly status: {
|
|
72
|
+
readonly schema: z.ZodObject<{
|
|
73
|
+
state: z.ZodEnum<{
|
|
74
|
+
open: "open";
|
|
75
|
+
stopped: "stopped";
|
|
76
|
+
opening: "opening";
|
|
77
|
+
closing: "closing";
|
|
78
|
+
closed: "closed";
|
|
79
|
+
}>;
|
|
80
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
81
|
+
tiltPosition: z.ZodNullable<z.ZodNumber>;
|
|
82
|
+
lastChangedAt: z.ZodNumber;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
readonly kind: "push";
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Runtime-state slice — mirrored by the kernel. UI controls watch
|
|
88
|
+
* the slice for live position changes during a move.
|
|
89
|
+
*/
|
|
90
|
+
readonly runtimeState: z.ZodObject<{
|
|
91
|
+
state: z.ZodEnum<{
|
|
92
|
+
open: "open";
|
|
93
|
+
stopped: "stopped";
|
|
94
|
+
opening: "opening";
|
|
95
|
+
closing: "closing";
|
|
96
|
+
closed: "closed";
|
|
97
|
+
}>;
|
|
98
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
99
|
+
tiltPosition: z.ZodNullable<z.ZodNumber>;
|
|
100
|
+
lastChangedAt: z.ZodNumber;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
};
|
|
103
|
+
export type ICoverProvider = InferProvider<typeof coverCapability>;
|
|
104
|
+
//# sourceMappingURL=cover.cap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cover.cap.d.ts","sourceRoot":"","sources":["../../src/capabilities/cover.cap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAErD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,eAAO,MAAM,gBAAgB;;;;;;EAM3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAU5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2C1B;;;OAGG;;;;;;;;;;;;;CAEoC,CAAA;AAEzC,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC,OAAO,eAAe,CAAC,CAAA"}
|
|
@@ -44,4 +44,10 @@ export interface CustomActionOptions<TKind extends 'query' | 'mutation' | 'subsc
|
|
|
44
44
|
export declare function customAction<TIn extends z.ZodType, TOut extends z.ZodType, TKind extends 'query' | 'mutation' | 'subscription' = 'query', TAuth extends CapabilityMethodAuth = 'protected'>(input: TIn, output: TOut, options?: CustomActionOptions<TKind, TAuth>): CustomActionSpec<TIn, TOut, TKind, TAuth, {
|
|
45
45
|
readonly kind: 'system';
|
|
46
46
|
}>;
|
|
47
|
+
export declare function deviceCustomAction<TIn extends z.ZodType, TOut extends z.ZodType, TKind extends 'query' | 'mutation' | 'subscription' = 'query', TAuth extends CapabilityMethodAuth = 'protected'>(input: TIn, output: TOut, options?: Omit<CustomActionOptions<TKind, TAuth>, 'scope'> & {
|
|
48
|
+
readonly deviceTypes?: readonly DeviceType[];
|
|
49
|
+
}): CustomActionSpec<TIn, TOut, TKind, TAuth, {
|
|
50
|
+
readonly kind: 'device';
|
|
51
|
+
readonly deviceTypes?: readonly DeviceType[];
|
|
52
|
+
}>;
|
|
47
53
|
//# sourceMappingURL=custom-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-actions.d.ts","sourceRoot":"","sources":["../../src/capabilities/custom-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEtE,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,CAAA;AAE7E,MAAM,WAAW,gBAAgB,CAC/B,GAAG,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,EACjC,IAAI,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,EAClC,KAAK,SAAS,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,EAC3F,KAAK,SAAS,oBAAoB,GAAG,oBAAoB,EACzD,MAAM,SAAS,iBAAiB,GAAG,iBAAiB;IAEpD,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CA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"video";
|
|
95
|
+
audio: "audio";
|
|
96
96
|
}>;
|
|
97
97
|
data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
|
|
98
98
|
pts: z.ZodNumber;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type InferProvider } from './capability-definition.js';
|
|
3
|
+
/**
|
|
4
|
+
* `device-adoption` — generic discovery + adoption surface,
|
|
5
|
+
* system-scoped singleton. The de-HA-ified successor to `ha-discovery`:
|
|
6
|
+
* keyed by `integrationId` (the addon resolves integrationId → broker
|
|
7
|
+
* internally) rather than a connection-specific `brokerId`, and it
|
|
8
|
+
* REUSES the shared `DiscoveredChildDevice` candidate type from
|
|
9
|
+
* `device-discovery.cap.ts` so a single shared adoption panel renders
|
|
10
|
+
* any integration's candidate tree.
|
|
11
|
+
*
|
|
12
|
+
* UI flow (Integrations page → integration detail):
|
|
13
|
+
* 1. `listCandidates({integrationId, page, pageSize, filter})` →
|
|
14
|
+
* paginated candidate list, each row collapsed.
|
|
15
|
+
* 2. User expands a row → `getCandidate({integrationId,
|
|
16
|
+
* childNativeId})` returns the single candidate (with its nested
|
|
17
|
+
* `children`) for the accordion render.
|
|
18
|
+
* 3. User clicks "Adopt" on one or more candidates →
|
|
19
|
+
* `adopt({integrationId, childNativeIds, perCandidate?})`
|
|
20
|
+
* materialises one parent CamStack device per candidate plus its
|
|
21
|
+
* accessory children. `perCandidate[childNativeId]` carries an
|
|
22
|
+
* optional display-name override + a `hiddenChildIds` pre-hide set
|
|
23
|
+
* (the parent's `accessories.hiddenChildIds` gates UI visibility).
|
|
24
|
+
* 4. User clicks "Release" → `release({integrationId, camDeviceId})`
|
|
25
|
+
* removes the parent + every child from the kernel registry.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Provider-declared discovery *granularity* filter (the keystone of the
|
|
29
|
+
* single-entity-import design). A provider advertises which discovery
|
|
30
|
+
* granularities it supports via `listCandidateFilters`; the operator picks
|
|
31
|
+
* one and it is passed back as the opaque `filter` string on
|
|
32
|
+
* `listCandidates`/`adopt`.
|
|
33
|
+
*
|
|
34
|
+
* - **`id`** is provider-defined and OPAQUE to the cap + UI layers — only the
|
|
35
|
+
* declaring provider interprets it. The reserved id `'devices'` is the
|
|
36
|
+
* universal default (every provider's current behavior IS the `devices`
|
|
37
|
+
* filter). A provider that declares no filters is treated as a single
|
|
38
|
+
* implicit `{ id:'devices', label:'Devices', isDefault:true }`.
|
|
39
|
+
* - **`label`** is the human label for the UI selector.
|
|
40
|
+
* - **`isDefault`** marks the default filter; exactly one SHOULD be default.
|
|
41
|
+
*/
|
|
42
|
+
export declare const AdoptionFilterSchema: z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
label: z.ZodString;
|
|
45
|
+
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type AdoptionFilter = z.infer<typeof AdoptionFilterSchema>;
|
|
48
|
+
/**
|
|
49
|
+
* Candidate-list TEXT/query filter. Mirrors the prior `ha-discovery` filter,
|
|
50
|
+
* de-HA-ified — `area` / `manufacturer` stay free-form strings so any
|
|
51
|
+
* integration can populate them from its own metadata. Distinct from the
|
|
52
|
+
* granularity `AdoptionFilter` above: this narrows the candidate set within a
|
|
53
|
+
* chosen granularity, whereas the granularity `filter` selects WHAT a
|
|
54
|
+
* candidate is (a device vs an entity).
|
|
55
|
+
*/
|
|
56
|
+
export declare const CandidateQueryFilterSchema: z.ZodObject<{
|
|
57
|
+
search: z.ZodOptional<z.ZodString>;
|
|
58
|
+
area: z.ZodOptional<z.ZodString>;
|
|
59
|
+
manufacturer: z.ZodOptional<z.ZodString>;
|
|
60
|
+
adoptedOnly: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
unadoptedOnly: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export declare const ListCandidatesInputSchema: z.ZodObject<{
|
|
64
|
+
integrationId: z.ZodString;
|
|
65
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
66
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
67
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
68
|
+
filterText: z.ZodOptional<z.ZodObject<{
|
|
69
|
+
search: z.ZodOptional<z.ZodString>;
|
|
70
|
+
area: z.ZodOptional<z.ZodString>;
|
|
71
|
+
manufacturer: z.ZodOptional<z.ZodString>;
|
|
72
|
+
adoptedOnly: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
unadoptedOnly: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const ListCandidatesOutputSchema: z.ZodObject<{
|
|
77
|
+
candidates: z.ZodReadonly<z.ZodArray<z.ZodType<import("./device-discovery.cap.js").DiscoveredChildDevice, unknown, z.core.$ZodTypeInternals<import("./device-discovery.cap.js").DiscoveredChildDevice, unknown>>>>;
|
|
78
|
+
totalCount: z.ZodNumber;
|
|
79
|
+
page: z.ZodNumber;
|
|
80
|
+
pageSize: z.ZodNumber;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export declare const GetCandidateInputSchema: z.ZodObject<{
|
|
83
|
+
integrationId: z.ZodString;
|
|
84
|
+
childNativeId: z.ZodString;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export declare const AdoptionStatusSchema: z.ZodObject<{
|
|
87
|
+
lastDiscoveryAt: z.ZodNullable<z.ZodNumber>;
|
|
88
|
+
candidateCount: z.ZodNumber;
|
|
89
|
+
adoptedCount: z.ZodNumber;
|
|
90
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export declare const AdoptInputSchema: z.ZodObject<{
|
|
93
|
+
integrationId: z.ZodString;
|
|
94
|
+
childNativeIds: z.ZodArray<z.ZodString>;
|
|
95
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
96
|
+
importLocations: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
perCandidate: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
98
|
+
name: z.ZodOptional<z.ZodString>;
|
|
99
|
+
hiddenChildIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
|
+
}, z.core.$strip>>>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export declare const AdoptResultSchema: z.ZodObject<{
|
|
103
|
+
adopted: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
104
|
+
childNativeId: z.ZodString;
|
|
105
|
+
parentDeviceId: z.ZodNumber;
|
|
106
|
+
accessoryDeviceIds: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
107
|
+
}, z.core.$strip>>>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
export declare const ReleaseInputSchema: z.ZodObject<{
|
|
110
|
+
integrationId: z.ZodString;
|
|
111
|
+
camDeviceId: z.ZodNumber;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export declare const ResyncInputSchema: z.ZodObject<{
|
|
114
|
+
camDeviceId: z.ZodNumber;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export declare const ResyncResultSchema: z.ZodObject<{
|
|
117
|
+
changed: z.ZodBoolean;
|
|
118
|
+
rebuiltChildren: z.ZodNumber;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export declare const deviceAdoptionCapability: {
|
|
121
|
+
readonly name: "device-adoption";
|
|
122
|
+
readonly scope: "system";
|
|
123
|
+
readonly mode: "singleton";
|
|
124
|
+
readonly status: {
|
|
125
|
+
readonly schema: z.ZodObject<{
|
|
126
|
+
lastDiscoveryAt: z.ZodNullable<z.ZodNumber>;
|
|
127
|
+
candidateCount: z.ZodNumber;
|
|
128
|
+
adoptedCount: z.ZodNumber;
|
|
129
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
readonly kind: "poll";
|
|
132
|
+
};
|
|
133
|
+
readonly methods: {
|
|
134
|
+
readonly listCandidateFilters: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
135
|
+
integrationId: z.ZodString;
|
|
136
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
137
|
+
filters: z.ZodArray<z.ZodObject<{
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
label: z.ZodString;
|
|
140
|
+
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
}, z.core.$strip>>;
|
|
142
|
+
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
143
|
+
readonly listCandidates: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
144
|
+
integrationId: z.ZodString;
|
|
145
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
146
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
147
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
148
|
+
filterText: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
search: z.ZodOptional<z.ZodString>;
|
|
150
|
+
area: z.ZodOptional<z.ZodString>;
|
|
151
|
+
manufacturer: z.ZodOptional<z.ZodString>;
|
|
152
|
+
adoptedOnly: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
+
unadoptedOnly: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
}, z.core.$strip>>;
|
|
155
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
156
|
+
candidates: z.ZodReadonly<z.ZodArray<z.ZodType<import("./device-discovery.cap.js").DiscoveredChildDevice, unknown, z.core.$ZodTypeInternals<import("./device-discovery.cap.js").DiscoveredChildDevice, unknown>>>>;
|
|
157
|
+
totalCount: z.ZodNumber;
|
|
158
|
+
page: z.ZodNumber;
|
|
159
|
+
pageSize: z.ZodNumber;
|
|
160
|
+
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
161
|
+
readonly getCandidate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
162
|
+
integrationId: z.ZodString;
|
|
163
|
+
childNativeId: z.ZodString;
|
|
164
|
+
}, z.core.$strip>, z.ZodNullable<z.ZodType<import("./device-discovery.cap.js").DiscoveredChildDevice, unknown, z.core.$ZodTypeInternals<import("./device-discovery.cap.js").DiscoveredChildDevice, unknown>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
165
|
+
readonly refresh: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
166
|
+
integrationId: z.ZodString;
|
|
167
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
168
|
+
lastDiscoveryAt: z.ZodNullable<z.ZodNumber>;
|
|
169
|
+
candidateCount: z.ZodNumber;
|
|
170
|
+
adoptedCount: z.ZodNumber;
|
|
171
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
172
|
+
}, z.core.$strip>, "mutation">;
|
|
173
|
+
readonly adopt: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
174
|
+
integrationId: z.ZodString;
|
|
175
|
+
childNativeIds: z.ZodArray<z.ZodString>;
|
|
176
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
177
|
+
importLocations: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
+
perCandidate: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
179
|
+
name: z.ZodOptional<z.ZodString>;
|
|
180
|
+
hiddenChildIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
181
|
+
}, z.core.$strip>>>;
|
|
182
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
183
|
+
adopted: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
184
|
+
childNativeId: z.ZodString;
|
|
185
|
+
parentDeviceId: z.ZodNumber;
|
|
186
|
+
accessoryDeviceIds: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
|
|
187
|
+
}, z.core.$strip>>>;
|
|
188
|
+
}, z.core.$strip>, "mutation">;
|
|
189
|
+
readonly release: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
190
|
+
integrationId: z.ZodString;
|
|
191
|
+
camDeviceId: z.ZodNumber;
|
|
192
|
+
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
193
|
+
readonly resync: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
194
|
+
camDeviceId: z.ZodNumber;
|
|
195
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
196
|
+
changed: z.ZodBoolean;
|
|
197
|
+
rebuiltChildren: z.ZodNumber;
|
|
198
|
+
}, z.core.$strip>, "mutation">;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
export type IDeviceAdoptionProvider = InferProvider<typeof deviceAdoptionCapability>;
|
|
202
|
+
export type AdoptionStatus = z.infer<typeof AdoptionStatusSchema>;
|
|
203
|
+
//# sourceMappingURL=device-adoption.cap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-adoption.cap.d.ts","sourceRoot":"","sources":["../../src/capabilities/device-adoption.cap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAGlG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;;;iBAWrC,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;iBAiBpC,CAAA;AACF,eAAO,MAAM,0BAA0B;;;;;iBAKrC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;iBAS/B,CAAA;AASF,eAAO,MAAM,gBAAgB;;;;;;;;;iBAqB3B,CAAA;AACF,eAAO,MAAM,iBAAiB;;;;;;iBAQ5B,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;iBAK7B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;iBAM5B,CAAA;AACF,eAAO,MAAM,kBAAkB;;;iBAK7B,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBI,CAAA;AAEzC,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACpF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|