@camstack/types 1.1.8 → 1.1.10
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.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/addon-routes.cap.d.ts +4 -0
- package/dist/capabilities/addons.cap.d.ts +4 -0
- package/dist/capabilities/auth-provider.cap.d.ts +4 -0
- package/dist/capabilities/capability-definition.d.ts +59 -0
- package/dist/capabilities/climate-control.cap.d.ts +21 -0
- package/dist/capabilities/device-adoption.cap.d.ts +4 -0
- package/dist/capabilities/device-manager.cap.d.ts +4 -0
- package/dist/capabilities/index.d.ts +263 -265
- package/dist/capabilities/integrations.cap.d.ts +4 -0
- package/dist/capabilities/local-network.cap.d.ts +4 -0
- package/dist/capabilities/log-destination.cap.d.ts +4 -0
- package/dist/capabilities/network-quality.cap.d.ts +4 -0
- package/dist/capabilities/nodes.cap.d.ts +4 -0
- package/dist/capabilities/restreamer.cap.d.ts +4 -0
- package/dist/capabilities/snapshot-provider.cap.d.ts +4 -0
- package/dist/capabilities/streaming-engine.cap.d.ts +4 -0
- package/dist/capabilities/system.cap.d.ts +4 -0
- package/dist/capabilities/toast.cap.d.ts +4 -0
- package/dist/capabilities/webrtc-session.cap.d.ts +4 -0
- package/dist/capabilities/webrtc.cap.d.ts +4 -0
- package/dist/device/base-device.d.ts +8 -1
- package/dist/device/device-management.d.ts +8 -0
- package/dist/device/device-type.d.ts +19 -1
- package/dist/generated/addon-api.d.ts +12107 -12049
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/index.js +7296 -7186
- package/dist/index.mjs +7296 -7187
- package/dist/{sleep-DVmKHFGi.mjs → sleep-B3AOslwX.mjs} +33 -1
- package/dist/{sleep-Chb7wz4V.js → sleep-CKc4LLbD.js} +38 -0
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-CKc4LLbD.js");
|
|
3
3
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
4
4
|
exports.BaseAddon = require_sleep.BaseAddon;
|
|
5
5
|
exports.DATAPLANE_SECRET_HEADER = require_sleep.DATAPLANE_SECRET_HEADER;
|
package/dist/addon.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as ReadinessRegistry, C as asJsonObject, O as parseJsonUnknown, P as scopeKey, T as asString, a as adminUiCapability, b as DeviceType, gt as DisposerChain, ht as EventCategory, i as deviceOpsCapability, j as ReadinessTimeoutError, k as DATAPLANE_SECRET_HEADER, o as createDeviceProxy, ot as BaseAddon, p as expandCapMethods, st as normalizeAddonInitResult, t as sleep, ut as emitReadiness } from "./sleep-B3AOslwX.mjs";
|
|
2
2
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
3
3
|
export { BaseAddon, DATAPLANE_SECRET_HEADER, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, ReadinessTimeoutError, adminUiCapability, asJsonObject, asString, createDeviceProxy, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, normalizeAddonInitResult, parseJsonUnknown, scopeKey, sleep };
|
|
@@ -80,6 +80,10 @@ export declare const addonRoutesCapability: {
|
|
|
80
80
|
contentType: z.ZodOptional<z.ZodString>;
|
|
81
81
|
}, z.core.$strip>, "mutation">;
|
|
82
82
|
};
|
|
83
|
+
/** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
|
|
84
|
+
readonly mount: {
|
|
85
|
+
readonly kind: "skip";
|
|
86
|
+
};
|
|
83
87
|
};
|
|
84
88
|
export type IAddonRoutesProvider = InferProvider<typeof addonRoutesCapability>;
|
|
85
89
|
export { InvokeRequestSchema, InvokeReplyEnvelopeSchema };
|
|
@@ -780,6 +780,10 @@ export declare const addonsCapability: {
|
|
|
780
780
|
scope: z.ZodOptional<z.ZodString>;
|
|
781
781
|
}, z.core.$strip>, "subscription">;
|
|
782
782
|
};
|
|
783
|
+
/** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
|
|
784
|
+
readonly mount: {
|
|
785
|
+
readonly kind: "service-backed";
|
|
786
|
+
};
|
|
783
787
|
};
|
|
784
788
|
export type IAddonsProvider = InferProvider<typeof addonsCapability>;
|
|
785
789
|
export { AddonListItemSchema, InstalledPackageSchema, PackageUpdateSchema, PackageVersionInfoSchema, SearchResultSchema, AutoUpdateSettingsSchema, AddonAutoUpdateSchema, LogStreamEntrySchema, CustomActionInputSchema, LogLevelSchema, ChannelSchema, ChannelWithInheritSchema, UpdateFrameworkPackageResultSchema, FrameworkPackageStatusSchema, BulkUpdateItemStatusSchema, BulkUpdateItemSchema, BulkUpdatePhaseSchema, BulkUpdateStateSchema, };
|
|
@@ -43,6 +43,10 @@ export declare const authProviderCapability: {
|
|
|
43
43
|
isAdmin: z.ZodDefault<z.ZodBoolean>;
|
|
44
44
|
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
45
45
|
};
|
|
46
|
+
/** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
|
|
47
|
+
readonly mount: {
|
|
48
|
+
readonly kind: "skip";
|
|
49
|
+
};
|
|
46
50
|
};
|
|
47
51
|
export type IAuthProvider = InferProvider<typeof authProviderCapability>;
|
|
48
52
|
export { AuthResultSchema };
|
|
@@ -393,7 +393,66 @@ export interface CapabilityDefinition<TName extends string = string, TMethods ex
|
|
|
393
393
|
* non-singleton caps.
|
|
394
394
|
*/
|
|
395
395
|
readonly preferredProvider?: string;
|
|
396
|
+
/**
|
|
397
|
+
* Declarative mount hint read by the runtime cap-router builder
|
|
398
|
+
* (`@camstack/system` `buildCapRouters`). It encodes HOW the hub
|
|
399
|
+
* resolves the provider object the cap's tRPC router calls — the same
|
|
400
|
+
* decision that the codegen `generate-cap-mounts.ts` baked into
|
|
401
|
+
* `generated-cap-mounts.ts` at build time, lifted onto the cap def so a
|
|
402
|
+
* cap change ships via the framework plugin (`@camstack/types` +
|
|
403
|
+
* `@camstack/system`) without a `@camstack/server` rebuild (BIG PLAN 2).
|
|
404
|
+
*
|
|
405
|
+
* When omitted, the builder derives the mount from the cap's
|
|
406
|
+
* `scope` / `mode` / `deviceNative` exactly as the codegen did
|
|
407
|
+
* (see {@link resolveCapMount}):
|
|
408
|
+
* - `deviceNative: true` → `{ kind: 'device-native' }`
|
|
409
|
+
* - `mode: 'collection'` → `{ kind: 'collection' }` (array-output
|
|
410
|
+
* methods auto-detected → concat fan-out)
|
|
411
|
+
* - otherwise (singleton / per-node) → `{ kind: 'singleton' }`
|
|
412
|
+
*
|
|
413
|
+
* Set it EXPLICITLY only for caps whose resolution is NOT derivable from
|
|
414
|
+
* scope/mode — the handful that today live as hand-written overrides in
|
|
415
|
+
* `trpc.router.ts`:
|
|
416
|
+
* - `{ kind: 'service-backed' }` — the provider is built on the hub
|
|
417
|
+
* from backend services (`system`, `nodes`, `integrations`,
|
|
418
|
+
* `addons`, `network-quality`, `toast`). The builder does NOT
|
|
419
|
+
* resolve these; the server supplies a provider factory by cap name
|
|
420
|
+
* to `buildCapRouters` via its `serviceProviders` map. Keeps backend
|
|
421
|
+
* composition out of `@camstack/system` (the self-sufficiency
|
|
422
|
+
* invariant) while still mounting the route generically.
|
|
423
|
+
* - `{ kind: 'hub-only' }` — single-node cap; the remote-proxy leg is
|
|
424
|
+
* short-circuited to `null` (agents are not addressable). Used by
|
|
425
|
+
* `local-network`.
|
|
426
|
+
* - `{ kind: 'custom' }` — resolution needs app-specific logic the
|
|
427
|
+
* generic builder cannot model (probe-then-fan-out, per-request
|
|
428
|
+
* relay enrichment). The server keeps a hand-written override for
|
|
429
|
+
* these (`snapshot-provider`, `webrtc-session`); the builder leaves
|
|
430
|
+
* the slot empty for the override to fill via spread precedence.
|
|
431
|
+
* - `{ kind: 'skip' }` — never mounted (legacy provider shapes that
|
|
432
|
+
* predate the `InferProvider` contract — `addon-routes`,
|
|
433
|
+
* `auth-provider`, `log-destination`, `restreamer`,
|
|
434
|
+
* `streaming-engine`, `webrtc`). Mirrors the old `LEGACY_SHAPE_SKIP`
|
|
435
|
+
* set.
|
|
436
|
+
*/
|
|
437
|
+
readonly mount?: CapabilityMountHint;
|
|
396
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* Mount-resolution kinds for {@link CapabilityDefinition.mount}. See the
|
|
441
|
+
* field doc for when to use each. `singleton` / `collection` /
|
|
442
|
+
* `device-native` are the auto-derivable defaults; the rest are explicit
|
|
443
|
+
* opt-ins for caps that today need a hand-written override.
|
|
444
|
+
*/
|
|
445
|
+
export type CapabilityMountKind = 'singleton' | 'collection' | 'device-native' | 'service-backed' | 'hub-only' | 'custom' | 'skip';
|
|
446
|
+
export interface CapabilityMountHint {
|
|
447
|
+
readonly kind: CapabilityMountKind;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Resolve the EFFECTIVE mount hint for a cap — the explicit `mount` when
|
|
451
|
+
* present, else the scope/mode/deviceNative-derived default. Single source
|
|
452
|
+
* of truth shared by the runtime builder and any codegen that needs the
|
|
453
|
+
* same classification, so the two can never disagree.
|
|
454
|
+
*/
|
|
455
|
+
export declare function resolveCapMount(def: CapabilityDefinition): CapabilityMountHint;
|
|
397
456
|
/** Contract for the three methods added by `exposesDeviceSettings: true`. */
|
|
398
457
|
export interface DeviceSettingsContribution {
|
|
399
458
|
readonly getDeviceSettingsContribution: (input: {
|
|
@@ -24,6 +24,13 @@ import { DeviceType } from '../device/device-type.js';
|
|
|
24
24
|
* - `ClimateHumidity` — currentHumidity / targetHumidity surfaces
|
|
25
25
|
* - `ClimateFanMode` — fan-mode selector
|
|
26
26
|
* - `ClimatePreset` — preset selector
|
|
27
|
+
* - `ClimateSwingVertical` — vertical louver swing toggle
|
|
28
|
+
* - `ClimateSwingHorizontal` — horizontal louver swing toggle
|
|
29
|
+
*
|
|
30
|
+
* Swing is modelled as two INDEPENDENT booleans (vertical / horizontal),
|
|
31
|
+
* each actionable on its own and each gated by its own `DeviceFeature`
|
|
32
|
+
* so the UI shows only the axes a given device supports. This is generic
|
|
33
|
+
* — any climate device (not just Gree) can advertise either / both axes.
|
|
27
34
|
*/
|
|
28
35
|
export declare const HvacModeSchema: z.ZodEnum<{
|
|
29
36
|
auto: "auto";
|
|
@@ -64,6 +71,8 @@ export declare const ClimateControlStatusSchema: z.ZodObject<{
|
|
|
64
71
|
targetHumidity: z.ZodNullable<z.ZodNumber>;
|
|
65
72
|
currentTemp: z.ZodNullable<z.ZodNumber>;
|
|
66
73
|
currentHumidity: z.ZodNullable<z.ZodNumber>;
|
|
74
|
+
swingVertical: z.ZodNullable<z.ZodBoolean>;
|
|
75
|
+
swingHorizontal: z.ZodNullable<z.ZodBoolean>;
|
|
67
76
|
lastFetchedAt: z.ZodNumber;
|
|
68
77
|
}, z.core.$strip>;
|
|
69
78
|
export type ClimateControlStatus = z.infer<typeof ClimateControlStatusSchema>;
|
|
@@ -107,6 +116,14 @@ export declare const climateControlCapability: {
|
|
|
107
116
|
deviceId: z.ZodNumber;
|
|
108
117
|
targetHumidity: z.ZodNumber;
|
|
109
118
|
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
119
|
+
readonly setSwingVertical: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
120
|
+
deviceId: z.ZodNumber;
|
|
121
|
+
on: z.ZodBoolean;
|
|
122
|
+
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
123
|
+
readonly setSwingHorizontal: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
124
|
+
deviceId: z.ZodNumber;
|
|
125
|
+
on: z.ZodBoolean;
|
|
126
|
+
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
110
127
|
};
|
|
111
128
|
readonly status: {
|
|
112
129
|
readonly schema: z.ZodObject<{
|
|
@@ -138,6 +155,8 @@ export declare const climateControlCapability: {
|
|
|
138
155
|
targetHumidity: z.ZodNullable<z.ZodNumber>;
|
|
139
156
|
currentTemp: z.ZodNullable<z.ZodNumber>;
|
|
140
157
|
currentHumidity: z.ZodNullable<z.ZodNumber>;
|
|
158
|
+
swingVertical: z.ZodNullable<z.ZodBoolean>;
|
|
159
|
+
swingHorizontal: z.ZodNullable<z.ZodBoolean>;
|
|
141
160
|
lastFetchedAt: z.ZodNumber;
|
|
142
161
|
}, z.core.$strip>;
|
|
143
162
|
readonly kind: "push";
|
|
@@ -176,6 +195,8 @@ export declare const climateControlCapability: {
|
|
|
176
195
|
targetHumidity: z.ZodNullable<z.ZodNumber>;
|
|
177
196
|
currentTemp: z.ZodNullable<z.ZodNumber>;
|
|
178
197
|
currentHumidity: z.ZodNullable<z.ZodNumber>;
|
|
198
|
+
swingVertical: z.ZodNullable<z.ZodBoolean>;
|
|
199
|
+
swingHorizontal: z.ZodNullable<z.ZodBoolean>;
|
|
179
200
|
lastFetchedAt: z.ZodNumber;
|
|
180
201
|
}, z.core.$strip>;
|
|
181
202
|
};
|
|
@@ -112,10 +112,12 @@ export declare const ReleaseInputSchema: z.ZodObject<{
|
|
|
112
112
|
}, z.core.$strip>;
|
|
113
113
|
export declare const ResyncInputSchema: z.ZodObject<{
|
|
114
114
|
camDeviceId: z.ZodNumber;
|
|
115
|
+
resetToSource: z.ZodOptional<z.ZodBoolean>;
|
|
115
116
|
}, z.core.$strip>;
|
|
116
117
|
export declare const ResyncResultSchema: z.ZodObject<{
|
|
117
118
|
changed: z.ZodBoolean;
|
|
118
119
|
rebuiltChildren: z.ZodNumber;
|
|
120
|
+
removedChildren: z.ZodOptional<z.ZodNumber>;
|
|
119
121
|
}, z.core.$strip>;
|
|
120
122
|
export declare const deviceAdoptionCapability: {
|
|
121
123
|
readonly name: "device-adoption";
|
|
@@ -192,9 +194,11 @@ export declare const deviceAdoptionCapability: {
|
|
|
192
194
|
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
193
195
|
readonly resync: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
194
196
|
camDeviceId: z.ZodNumber;
|
|
197
|
+
resetToSource: z.ZodOptional<z.ZodBoolean>;
|
|
195
198
|
}, z.core.$strip>, z.ZodObject<{
|
|
196
199
|
changed: z.ZodBoolean;
|
|
197
200
|
rebuiltChildren: z.ZodNumber;
|
|
201
|
+
removedChildren: z.ZodOptional<z.ZodNumber>;
|
|
198
202
|
}, z.core.$strip>, "mutation">;
|
|
199
203
|
};
|
|
200
204
|
};
|
|
@@ -107,6 +107,7 @@ export declare const DeviceMetaSchema: z.ZodObject<{
|
|
|
107
107
|
addonId: z.ZodString;
|
|
108
108
|
type: z.ZodString;
|
|
109
109
|
name: z.ZodString;
|
|
110
|
+
userNamed: z.ZodOptional<z.ZodBoolean>;
|
|
110
111
|
location: z.ZodNullable<z.ZodString>;
|
|
111
112
|
disabled: z.ZodBoolean;
|
|
112
113
|
parentDeviceId: z.ZodNullable<z.ZodNumber>;
|
|
@@ -231,6 +232,7 @@ export declare const deviceManagerCapability: {
|
|
|
231
232
|
addonId: z.ZodString;
|
|
232
233
|
type: z.ZodString;
|
|
233
234
|
name: z.ZodString;
|
|
235
|
+
userNamed: z.ZodOptional<z.ZodBoolean>;
|
|
234
236
|
location: z.ZodNullable<z.ZodString>;
|
|
235
237
|
disabled: z.ZodBoolean;
|
|
236
238
|
parentDeviceId: z.ZodNullable<z.ZodNumber>;
|
|
@@ -1135,9 +1137,11 @@ export declare const deviceManagerCapability: {
|
|
|
1135
1137
|
*/
|
|
1136
1138
|
readonly adoptionResync: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
1137
1139
|
camDeviceId: z.ZodNumber;
|
|
1140
|
+
resetToSource: z.ZodOptional<z.ZodBoolean>;
|
|
1138
1141
|
}, z.core.$strip>, z.ZodObject<{
|
|
1139
1142
|
changed: z.ZodBoolean;
|
|
1140
1143
|
rebuiltChildren: z.ZodNumber;
|
|
1144
|
+
removedChildren: z.ZodOptional<z.ZodNumber>;
|
|
1141
1145
|
}, z.core.$strip>, "mutation">;
|
|
1142
1146
|
/**
|
|
1143
1147
|
* Test a field value on an existing device (e.g. probe an RTSP URL).
|