@camstack/types 1.2.415 → 1.2.416
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capabilities/customize-catalog.d.ts +26 -0
- package/dist/capabilities/customize-spec.d.ts +6 -1
- package/dist/capabilities/doorbell.cap.d.ts +1 -0
- package/dist/capabilities/running-state.cap.d.ts +1 -0
- package/dist/composition/customize/override-draft.d.ts +10 -0
- package/dist/generated/customize-catalog.d.ts +48 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +87 -17
- package/dist/index.mjs +87 -17
- package/package.json +7 -2
|
@@ -5,10 +5,35 @@
|
|
|
5
5
|
import type { DeviceType } from '../device/device-type.js';
|
|
6
6
|
import type { CameraSensorCustomizeMode, CustomizeApplyAuthority, CustomizeApplyMode, CustomizeCardinality, CustomizeCompanion, CustomizeEventEdge, CustomizeSourceReport, CustomizeValueKind } from './customize-spec.js';
|
|
7
7
|
export type CustomizeCatalogValueKind = 'boolean' | 'number' | 'string' | 'enum';
|
|
8
|
+
export type CustomizeCatalogTransform = {
|
|
9
|
+
readonly kind: 'identity';
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: 'invert';
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'threshold';
|
|
14
|
+
readonly comparisons: readonly ('gte' | 'lte')[];
|
|
15
|
+
readonly comparison: 'gte' | 'lte';
|
|
16
|
+
readonly defaultThreshold: number;
|
|
17
|
+
readonly defaultStartDwellMs: number;
|
|
18
|
+
readonly defaultStopDwellMs: number;
|
|
19
|
+
readonly thresholdUnit?: string;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: 'linear';
|
|
22
|
+
readonly defaultScale: number;
|
|
23
|
+
readonly defaultOffset: number;
|
|
24
|
+
readonly clampMin?: number;
|
|
25
|
+
readonly clampMax?: number;
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: 'enum-map';
|
|
28
|
+
readonly outputValues: readonly string[];
|
|
29
|
+
readonly unmapped: string | null;
|
|
30
|
+
};
|
|
8
31
|
export interface CustomizeCatalogSource {
|
|
9
32
|
readonly kind: string;
|
|
10
33
|
readonly valueKinds?: readonly CustomizeValueKind[];
|
|
11
34
|
readonly transformKinds: readonly string[];
|
|
35
|
+
/** Every declared parameter, including its default. The editor reads only this. */
|
|
36
|
+
readonly transforms: readonly CustomizeCatalogTransform[];
|
|
12
37
|
readonly requiredUnit?: string;
|
|
13
38
|
}
|
|
14
39
|
export interface CustomizeCatalogLiteral {
|
|
@@ -47,6 +72,7 @@ export interface CustomizeCatalogTarget {
|
|
|
47
72
|
readonly applyAuthority?: CustomizeApplyAuthority;
|
|
48
73
|
readonly eventName?: string;
|
|
49
74
|
readonly edges?: readonly CustomizeEventEdge[];
|
|
75
|
+
readonly defaultEdge?: CustomizeEventEdge;
|
|
50
76
|
readonly timestampPath?: string;
|
|
51
77
|
readonly counterPath?: string;
|
|
52
78
|
readonly highWater?: 'composer-advance';
|
|
@@ -59,9 +59,12 @@ export interface IdentityTransformSpec {
|
|
|
59
59
|
export interface InvertTransformSpec {
|
|
60
60
|
readonly kind: 'invert';
|
|
61
61
|
}
|
|
62
|
+
export type ThresholdComparison = 'gte' | 'lte';
|
|
62
63
|
export interface ThresholdTransformSpec {
|
|
63
64
|
readonly kind: 'threshold';
|
|
64
|
-
|
|
65
|
+
/** Comparisons the editor may offer. `comparison` is the default. */
|
|
66
|
+
readonly comparisons: readonly ThresholdComparison[];
|
|
67
|
+
readonly comparison: ThresholdComparison;
|
|
65
68
|
readonly defaultThreshold: number;
|
|
66
69
|
readonly defaultStartDwellMs: number;
|
|
67
70
|
readonly defaultStopDwellMs: number;
|
|
@@ -180,7 +183,9 @@ export interface EventCustomizeTargetBase extends CustomizeTargetBase {
|
|
|
180
183
|
*/
|
|
181
184
|
export interface PulseEventCustomizeTarget extends EventCustomizeTargetBase {
|
|
182
185
|
readonly shape: 'pulse';
|
|
186
|
+
/** Edges the editor may offer. `defaultEdge` is the one a new pulse starts on. */
|
|
183
187
|
readonly edges: readonly CustomizeEventEdge[];
|
|
188
|
+
readonly defaultEdge: CustomizeEventEdge;
|
|
184
189
|
readonly timestampPath: string;
|
|
185
190
|
readonly counterPath: string;
|
|
186
191
|
/** The composer already tracks this path's advance (D670). */
|
|
@@ -97,6 +97,7 @@ export declare const doorbellCapability: {
|
|
|
97
97
|
};
|
|
98
98
|
readonly eventName: 'onPressed';
|
|
99
99
|
readonly edges: readonly ["rising"];
|
|
100
|
+
readonly defaultEdge: 'rising';
|
|
100
101
|
readonly timestampPath: 'lastPressedAt';
|
|
101
102
|
readonly counterPath: 'pressCountSinceStart';
|
|
102
103
|
readonly highWater: 'composer-advance';
|
|
@@ -102,6 +102,7 @@ export declare const runningStateCapability: {
|
|
|
102
102
|
readonly requiredUnit: 'W';
|
|
103
103
|
readonly transforms: readonly [{
|
|
104
104
|
readonly kind: 'threshold';
|
|
105
|
+
readonly comparisons: readonly ["gte", "lte"];
|
|
105
106
|
readonly comparison: 'gte';
|
|
106
107
|
readonly defaultThreshold: 5;
|
|
107
108
|
readonly defaultStartDwellMs: 30000;
|
|
@@ -149,6 +149,11 @@ export declare const PulseOverrideDraftSchema: z.ZodObject<{
|
|
|
149
149
|
targetId: z.ZodString;
|
|
150
150
|
enabled: z.ZodBoolean;
|
|
151
151
|
debounceMs: z.ZodNumber;
|
|
152
|
+
edges: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
153
|
+
button: "button";
|
|
154
|
+
"native-event": "native-event";
|
|
155
|
+
rising: "rising";
|
|
156
|
+
}>>>;
|
|
152
157
|
sources: z.ZodArray<z.ZodObject<{
|
|
153
158
|
addonId: z.ZodString;
|
|
154
159
|
stableId: z.ZodString;
|
|
@@ -267,6 +272,11 @@ export declare const OverrideDraftSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
267
272
|
targetId: z.ZodString;
|
|
268
273
|
enabled: z.ZodBoolean;
|
|
269
274
|
debounceMs: z.ZodNumber;
|
|
275
|
+
edges: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
276
|
+
button: "button";
|
|
277
|
+
"native-event": "native-event";
|
|
278
|
+
rising: "rising";
|
|
279
|
+
}>>>;
|
|
270
280
|
sources: z.ZodArray<z.ZodObject<{
|
|
271
281
|
addonId: z.ZodString;
|
|
272
282
|
stableId: z.ZodString;
|
|
@@ -27,6 +27,15 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
27
27
|
readonly kind: 'field';
|
|
28
28
|
readonly valueKinds: readonly ["number", "string"];
|
|
29
29
|
readonly transformKinds: readonly ["identity", "linear"];
|
|
30
|
+
readonly transforms: readonly [{
|
|
31
|
+
readonly kind: 'identity';
|
|
32
|
+
}, {
|
|
33
|
+
readonly kind: 'linear';
|
|
34
|
+
readonly defaultScale: 1;
|
|
35
|
+
readonly defaultOffset: 0;
|
|
36
|
+
readonly clampMin: 0;
|
|
37
|
+
readonly clampMax: 100;
|
|
38
|
+
}];
|
|
30
39
|
}];
|
|
31
40
|
readonly sourceReport: {
|
|
32
41
|
readonly status: 'assignment-status';
|
|
@@ -99,6 +108,15 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
99
108
|
readonly sources: readonly [{
|
|
100
109
|
readonly kind: 'numeric';
|
|
101
110
|
readonly transformKinds: readonly ["identity", "linear"];
|
|
111
|
+
readonly transforms: readonly [{
|
|
112
|
+
readonly kind: 'identity';
|
|
113
|
+
}, {
|
|
114
|
+
readonly kind: 'linear';
|
|
115
|
+
readonly defaultScale: 1;
|
|
116
|
+
readonly defaultOffset: 0;
|
|
117
|
+
readonly clampMin: 0;
|
|
118
|
+
readonly clampMax: 100;
|
|
119
|
+
}];
|
|
102
120
|
}];
|
|
103
121
|
}, {
|
|
104
122
|
readonly path: 'remaining.value';
|
|
@@ -107,6 +125,9 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
107
125
|
readonly sources: readonly [{
|
|
108
126
|
readonly kind: 'numeric';
|
|
109
127
|
readonly transformKinds: readonly ["identity"];
|
|
128
|
+
readonly transforms: readonly [{
|
|
129
|
+
readonly kind: 'identity';
|
|
130
|
+
}];
|
|
110
131
|
}];
|
|
111
132
|
readonly literals: readonly [{
|
|
112
133
|
readonly path: 'remaining.unit';
|
|
@@ -120,6 +141,11 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
120
141
|
readonly sources: readonly [{
|
|
121
142
|
readonly kind: 'enum';
|
|
122
143
|
readonly transformKinds: readonly ["enum-map"];
|
|
144
|
+
readonly transforms: readonly [{
|
|
145
|
+
readonly kind: 'enum-map';
|
|
146
|
+
readonly outputValues: readonly ["ok", "low", "empty", "full", "replace"];
|
|
147
|
+
readonly unmapped: null;
|
|
148
|
+
}];
|
|
123
149
|
}];
|
|
124
150
|
}];
|
|
125
151
|
readonly traits: readonly [{
|
|
@@ -155,9 +181,11 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
155
181
|
readonly sources: readonly [{
|
|
156
182
|
readonly kind: 'binary';
|
|
157
183
|
readonly transformKinds: readonly [];
|
|
184
|
+
readonly transforms: readonly [];
|
|
158
185
|
}, {
|
|
159
186
|
readonly kind: 'switch';
|
|
160
187
|
readonly transformKinds: readonly [];
|
|
188
|
+
readonly transforms: readonly [];
|
|
161
189
|
}];
|
|
162
190
|
readonly sourceReport: {
|
|
163
191
|
readonly status: 'assignment-status';
|
|
@@ -170,6 +198,7 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
170
198
|
readonly eventName: 'onPressed';
|
|
171
199
|
readonly combine: 'any';
|
|
172
200
|
readonly edges: readonly ["rising"];
|
|
201
|
+
readonly defaultEdge: 'rising';
|
|
173
202
|
readonly timestampPath: 'lastPressedAt';
|
|
174
203
|
readonly counterPath: 'pressCountSinceStart';
|
|
175
204
|
readonly highWater: 'composer-advance';
|
|
@@ -199,9 +228,11 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
199
228
|
readonly sources: readonly [{
|
|
200
229
|
readonly kind: 'binary';
|
|
201
230
|
readonly transformKinds: readonly [];
|
|
231
|
+
readonly transforms: readonly [];
|
|
202
232
|
}, {
|
|
203
233
|
readonly kind: 'switch';
|
|
204
234
|
readonly transformKinds: readonly [];
|
|
235
|
+
readonly transforms: readonly [];
|
|
205
236
|
}];
|
|
206
237
|
readonly sourceReport: {
|
|
207
238
|
readonly status: 'assignment-status';
|
|
@@ -248,13 +279,30 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
248
279
|
readonly sources: readonly [{
|
|
249
280
|
readonly kind: 'switch';
|
|
250
281
|
readonly transformKinds: readonly ["identity"];
|
|
282
|
+
readonly transforms: readonly [{
|
|
283
|
+
readonly kind: 'identity';
|
|
284
|
+
}];
|
|
251
285
|
}, {
|
|
252
286
|
readonly kind: 'binary';
|
|
253
287
|
readonly transformKinds: readonly ["identity", "invert"];
|
|
288
|
+
readonly transforms: readonly [{
|
|
289
|
+
readonly kind: 'identity';
|
|
290
|
+
}, {
|
|
291
|
+
readonly kind: 'invert';
|
|
292
|
+
}];
|
|
254
293
|
}, {
|
|
255
294
|
readonly kind: 'numeric';
|
|
256
295
|
readonly requiredUnit: 'W';
|
|
257
296
|
readonly transformKinds: readonly ["threshold"];
|
|
297
|
+
readonly transforms: readonly [{
|
|
298
|
+
readonly kind: 'threshold';
|
|
299
|
+
readonly comparisons: readonly ["gte", "lte"];
|
|
300
|
+
readonly comparison: 'gte';
|
|
301
|
+
readonly defaultThreshold: 5;
|
|
302
|
+
readonly defaultStartDwellMs: 30000;
|
|
303
|
+
readonly defaultStopDwellMs: 180000;
|
|
304
|
+
readonly thresholdUnit: 'W';
|
|
305
|
+
}];
|
|
258
306
|
}];
|
|
259
307
|
readonly sourceReport: {
|
|
260
308
|
readonly status: 'assignment-status';
|
package/dist/index.d.ts
CHANGED
|
@@ -258,10 +258,10 @@ export { isRestoredCap, RESTORED_CAP_NAMES, RUNTIME_STATE_POLICY, runtimeStatePo
|
|
|
258
258
|
export { BucketAccumulator, bucketStartOf, type ClosedHistoryBucket, HISTORY_BUCKET_MS, MAX_REQUEUED_BUCKETS_PER_SERIES, } from './history/bucket-accumulator.js';
|
|
259
259
|
export { HISTORY_CATALOG, HISTORY_ITEM_CATALOG, HISTORY_NONE_CAPS, historyFieldsFor, } from './generated/history-catalog.js';
|
|
260
260
|
export { CAP_CUSTOMIZE_CATALOG } from './generated/customize-catalog.js';
|
|
261
|
-
export type { CustomizeCatalog, CustomizeCatalogAdvancedParameter, CustomizeCatalogField, CustomizeCatalogSource, CustomizeCatalogTarget, } from './capabilities/customize-catalog.js';
|
|
261
|
+
export type { CustomizeCatalog, CustomizeCatalogAdvancedParameter, CustomizeCatalogField, CustomizeCatalogSource, CustomizeCatalogTarget, CustomizeCatalogTransform, } from './capabilities/customize-catalog.js';
|
|
262
262
|
export { compositionFillStatus, decodeCompositionToCards, formulaProblem, primaryCapForRole, problemsBlockSave, } from './composition/cards/index.js';
|
|
263
263
|
export type { CompositionFillStatus } from './composition/cards/index.js';
|
|
264
|
-
export type { CapabilityCustomizeSpec, CapabilityCustomizeTarget, CustomizeCardinality, EventCustomizeTarget, PulseEventCustomizeTarget, SpanEventCustomizeTarget, } from './capabilities/customize-spec.js';
|
|
264
|
+
export type { CapabilityCustomizeSpec, CapabilityCustomizeTarget, CustomizeCardinality, CustomizeEventEdge, EventCustomizeTarget, PulseEventCustomizeTarget, SpanEventCustomizeTarget, } from './capabilities/customize-spec.js';
|
|
265
265
|
export { CustomizeAssignmentStatusSchema, OverrideDraftSchema, type CustomizeAssignmentStatus, type OverrideDraft, } from './composition/customize/override-draft.js';
|
|
266
266
|
export { compileScalarOverride, type ScalarCompileInput, type ScalarValueKind, } from './composition/customize/scalar-compile.js';
|
|
267
267
|
export { decodeScalarOverride, type ScalarDecoded, type ScalarDecodeInput, } from './composition/customize/scalar-decode.js';
|
package/dist/index.js
CHANGED
|
@@ -63383,6 +63383,7 @@ var doorbellCustomize = {
|
|
|
63383
63383
|
applyAuthority: { kind: "composition-claim" },
|
|
63384
63384
|
eventName: "onPressed",
|
|
63385
63385
|
edges: ["rising"],
|
|
63386
|
+
defaultEdge: "rising",
|
|
63386
63387
|
timestampPath: "lastPressedAt",
|
|
63387
63388
|
counterPath: "pressCountSinceStart",
|
|
63388
63389
|
highWater: "composer-advance",
|
|
@@ -70616,6 +70617,7 @@ var runningCustomize = {
|
|
|
70616
70617
|
requiredUnit: "W",
|
|
70617
70618
|
transforms: [{
|
|
70618
70619
|
kind: "threshold",
|
|
70620
|
+
comparisons: ["gte", "lte"],
|
|
70619
70621
|
comparison: "gte",
|
|
70620
70622
|
defaultThreshold: 5,
|
|
70621
70623
|
defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
|
|
@@ -78116,7 +78118,14 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78116
78118
|
sources: [{
|
|
78117
78119
|
kind: "field",
|
|
78118
78120
|
valueKinds: ["number", "string"],
|
|
78119
|
-
transformKinds: ["identity", "linear"]
|
|
78121
|
+
transformKinds: ["identity", "linear"],
|
|
78122
|
+
transforms: [{ kind: "identity" }, {
|
|
78123
|
+
kind: "linear",
|
|
78124
|
+
defaultScale: 1,
|
|
78125
|
+
defaultOffset: 0,
|
|
78126
|
+
clampMin: 0,
|
|
78127
|
+
clampMax: 100
|
|
78128
|
+
}]
|
|
78120
78129
|
}],
|
|
78121
78130
|
sourceReport: { status: "assignment-status" },
|
|
78122
78131
|
advancedExpression: true,
|
|
@@ -78231,7 +78240,14 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78231
78240
|
nullable: true,
|
|
78232
78241
|
sources: [{
|
|
78233
78242
|
kind: "numeric",
|
|
78234
|
-
transformKinds: ["identity", "linear"]
|
|
78243
|
+
transformKinds: ["identity", "linear"],
|
|
78244
|
+
transforms: [{ kind: "identity" }, {
|
|
78245
|
+
kind: "linear",
|
|
78246
|
+
defaultScale: 1,
|
|
78247
|
+
defaultOffset: 0,
|
|
78248
|
+
clampMin: 0,
|
|
78249
|
+
clampMax: 100
|
|
78250
|
+
}]
|
|
78235
78251
|
}]
|
|
78236
78252
|
},
|
|
78237
78253
|
{
|
|
@@ -78240,7 +78256,8 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78240
78256
|
nullable: true,
|
|
78241
78257
|
sources: [{
|
|
78242
78258
|
kind: "numeric",
|
|
78243
|
-
transformKinds: ["identity"]
|
|
78259
|
+
transformKinds: ["identity"],
|
|
78260
|
+
transforms: [{ kind: "identity" }]
|
|
78244
78261
|
}],
|
|
78245
78262
|
literals: [{
|
|
78246
78263
|
path: "remaining.unit",
|
|
@@ -78264,7 +78281,18 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78264
78281
|
],
|
|
78265
78282
|
sources: [{
|
|
78266
78283
|
kind: "enum",
|
|
78267
|
-
transformKinds: ["enum-map"]
|
|
78284
|
+
transformKinds: ["enum-map"],
|
|
78285
|
+
transforms: [{
|
|
78286
|
+
kind: "enum-map",
|
|
78287
|
+
outputValues: [
|
|
78288
|
+
"ok",
|
|
78289
|
+
"low",
|
|
78290
|
+
"empty",
|
|
78291
|
+
"full",
|
|
78292
|
+
"replace"
|
|
78293
|
+
],
|
|
78294
|
+
unmapped: null
|
|
78295
|
+
}]
|
|
78268
78296
|
}]
|
|
78269
78297
|
}
|
|
78270
78298
|
],
|
|
@@ -78309,10 +78337,12 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78309
78337
|
vocabularyEvent: "onPressed",
|
|
78310
78338
|
sources: [{
|
|
78311
78339
|
kind: "binary",
|
|
78312
|
-
transformKinds: []
|
|
78340
|
+
transformKinds: [],
|
|
78341
|
+
transforms: []
|
|
78313
78342
|
}, {
|
|
78314
78343
|
kind: "switch",
|
|
78315
|
-
transformKinds: []
|
|
78344
|
+
transformKinds: [],
|
|
78345
|
+
transforms: []
|
|
78316
78346
|
}],
|
|
78317
78347
|
sourceReport: { status: "assignment-status" },
|
|
78318
78348
|
advancedExpression: true,
|
|
@@ -78321,6 +78351,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78321
78351
|
eventName: "onPressed",
|
|
78322
78352
|
combine: "any",
|
|
78323
78353
|
edges: ["rising"],
|
|
78354
|
+
defaultEdge: "rising",
|
|
78324
78355
|
timestampPath: "lastPressedAt",
|
|
78325
78356
|
counterPath: "pressCountSinceStart",
|
|
78326
78357
|
highWater: "composer-advance",
|
|
@@ -78349,10 +78380,12 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78349
78380
|
vocabularyEvent: "onMotionChanged",
|
|
78350
78381
|
sources: [{
|
|
78351
78382
|
kind: "binary",
|
|
78352
|
-
transformKinds: []
|
|
78383
|
+
transformKinds: [],
|
|
78384
|
+
transforms: []
|
|
78353
78385
|
}, {
|
|
78354
78386
|
kind: "switch",
|
|
78355
|
-
transformKinds: []
|
|
78387
|
+
transformKinds: [],
|
|
78388
|
+
transforms: []
|
|
78356
78389
|
}],
|
|
78357
78390
|
sourceReport: { status: "assignment-status" },
|
|
78358
78391
|
advancedExpression: false,
|
|
@@ -78412,16 +78445,27 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78412
78445
|
sources: [
|
|
78413
78446
|
{
|
|
78414
78447
|
kind: "switch",
|
|
78415
|
-
transformKinds: ["identity"]
|
|
78448
|
+
transformKinds: ["identity"],
|
|
78449
|
+
transforms: [{ kind: "identity" }]
|
|
78416
78450
|
},
|
|
78417
78451
|
{
|
|
78418
78452
|
kind: "binary",
|
|
78419
|
-
transformKinds: ["identity", "invert"]
|
|
78453
|
+
transformKinds: ["identity", "invert"],
|
|
78454
|
+
transforms: [{ kind: "identity" }, { kind: "invert" }]
|
|
78420
78455
|
},
|
|
78421
78456
|
{
|
|
78422
78457
|
kind: "numeric",
|
|
78423
78458
|
requiredUnit: "W",
|
|
78424
|
-
transformKinds: ["threshold"]
|
|
78459
|
+
transformKinds: ["threshold"],
|
|
78460
|
+
transforms: [{
|
|
78461
|
+
kind: "threshold",
|
|
78462
|
+
comparisons: ["gte", "lte"],
|
|
78463
|
+
comparison: "gte",
|
|
78464
|
+
defaultThreshold: 5,
|
|
78465
|
+
defaultStartDwellMs: 3e4,
|
|
78466
|
+
defaultStopDwellMs: 18e4,
|
|
78467
|
+
thresholdUnit: "W"
|
|
78468
|
+
}]
|
|
78425
78469
|
}
|
|
78426
78470
|
],
|
|
78427
78471
|
sourceReport: {
|
|
@@ -78609,13 +78653,16 @@ function compilePulseOverride(input) {
|
|
|
78609
78653
|
const timestampPath = target.timestampPath;
|
|
78610
78654
|
const counterPath = target.counterPath;
|
|
78611
78655
|
if (timestampPath === void 0 || counterPath === void 0 || !isIdentifier(timestampPath) || !isIdentifier(counterPath)) return fail$2("path");
|
|
78612
|
-
|
|
78656
|
+
const edges = chosenEdges(input.draft.edges, target);
|
|
78657
|
+
if (edges === null) return fail$2("edge");
|
|
78613
78658
|
const pairs = pairSources(input);
|
|
78614
78659
|
if (!pairs.ok) return pairs;
|
|
78615
78660
|
if (pairs.value.length === 0) return fail$2("sources");
|
|
78616
78661
|
const debounce = unsignedToken(input.draft.debounceMs);
|
|
78617
78662
|
if (debounce === null) return fail$2("debounce");
|
|
78618
78663
|
const ordered = pairs.value.toSorted((a, b) => pairKey(a).localeCompare(pairKey(b)));
|
|
78664
|
+
const calls = edgeCalls(edges, ordered.length, debounce);
|
|
78665
|
+
if (calls === null) return fail$2("edge");
|
|
78619
78666
|
return {
|
|
78620
78667
|
ok: true,
|
|
78621
78668
|
value: {
|
|
@@ -78623,7 +78670,7 @@ function compilePulseOverride(input) {
|
|
|
78623
78670
|
cap: input.draft.cap,
|
|
78624
78671
|
enabled: input.draft.enabled,
|
|
78625
78672
|
fields: {
|
|
78626
|
-
[timestampPath]: expression(pulseExpr(
|
|
78673
|
+
[timestampPath]: expression(pulseExpr(calls), pulseBindings(ordered)),
|
|
78627
78674
|
[counterPath]: expression(`count(${timestampPath})`, { [timestampPath]: fromRead(input.device, input.draft.cap, timestampPath) })
|
|
78628
78675
|
}
|
|
78629
78676
|
}
|
|
@@ -78677,10 +78724,28 @@ function pairSources(input) {
|
|
|
78677
78724
|
function pairKey(pair) {
|
|
78678
78725
|
return `${pair.source.addonId}/${pair.source.stableId}#${pair.source.cap}#${pair.source.fieldPath}`;
|
|
78679
78726
|
}
|
|
78680
|
-
function
|
|
78681
|
-
const
|
|
78682
|
-
|
|
78683
|
-
|
|
78727
|
+
function chosenEdges(draftEdges, target) {
|
|
78728
|
+
const allowed = target.edges ?? [];
|
|
78729
|
+
const chosen = draftEdges ?? (target.defaultEdge !== void 0 ? [target.defaultEdge] : []);
|
|
78730
|
+
if (chosen.length === 0) return null;
|
|
78731
|
+
if (chosen.some((edge) => !allowed.includes(edge))) return null;
|
|
78732
|
+
return chosen;
|
|
78733
|
+
}
|
|
78734
|
+
function edgeCalls(edges, count, debounce) {
|
|
78735
|
+
const calls = [];
|
|
78736
|
+
for (let index = 0; index < count; index += 1) for (const edge of edges) {
|
|
78737
|
+
const call = edgeCall(edge, index, debounce);
|
|
78738
|
+
if (call === null) return null;
|
|
78739
|
+
calls.push(call);
|
|
78740
|
+
}
|
|
78741
|
+
return calls;
|
|
78742
|
+
}
|
|
78743
|
+
function edgeCall(edge, index, debounce) {
|
|
78744
|
+
if (edge === "rising") return `rose(active${index}, changed${index}, ${debounce})`;
|
|
78745
|
+
return null;
|
|
78746
|
+
}
|
|
78747
|
+
function pulseExpr(calls) {
|
|
78748
|
+
return `latest(${calls.join(", ")})`;
|
|
78684
78749
|
}
|
|
78685
78750
|
function pulseBindings(pairs) {
|
|
78686
78751
|
const bindings = {};
|
|
@@ -103259,6 +103324,11 @@ var PulseOverrideDraftSchema = zod.z.object({
|
|
|
103259
103324
|
targetId: zod.z.string().min(1),
|
|
103260
103325
|
enabled: zod.z.boolean(),
|
|
103261
103326
|
debounceMs: zod.z.number().nonnegative(),
|
|
103327
|
+
edges: zod.z.array(zod.z.enum([
|
|
103328
|
+
"rising",
|
|
103329
|
+
"button",
|
|
103330
|
+
"native-event"
|
|
103331
|
+
])).min(1).optional(),
|
|
103262
103332
|
sources: zod.z.array(OverrideSourceSchema).min(1)
|
|
103263
103333
|
});
|
|
103264
103334
|
var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: zod.z.enum([
|
package/dist/index.mjs
CHANGED
|
@@ -63382,6 +63382,7 @@ var doorbellCustomize = {
|
|
|
63382
63382
|
applyAuthority: { kind: "composition-claim" },
|
|
63383
63383
|
eventName: "onPressed",
|
|
63384
63384
|
edges: ["rising"],
|
|
63385
|
+
defaultEdge: "rising",
|
|
63385
63386
|
timestampPath: "lastPressedAt",
|
|
63386
63387
|
counterPath: "pressCountSinceStart",
|
|
63387
63388
|
highWater: "composer-advance",
|
|
@@ -70615,6 +70616,7 @@ var runningCustomize = {
|
|
|
70615
70616
|
requiredUnit: "W",
|
|
70616
70617
|
transforms: [{
|
|
70617
70618
|
kind: "threshold",
|
|
70619
|
+
comparisons: ["gte", "lte"],
|
|
70618
70620
|
comparison: "gte",
|
|
70619
70621
|
defaultThreshold: 5,
|
|
70620
70622
|
defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
|
|
@@ -78115,7 +78117,14 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78115
78117
|
sources: [{
|
|
78116
78118
|
kind: "field",
|
|
78117
78119
|
valueKinds: ["number", "string"],
|
|
78118
|
-
transformKinds: ["identity", "linear"]
|
|
78120
|
+
transformKinds: ["identity", "linear"],
|
|
78121
|
+
transforms: [{ kind: "identity" }, {
|
|
78122
|
+
kind: "linear",
|
|
78123
|
+
defaultScale: 1,
|
|
78124
|
+
defaultOffset: 0,
|
|
78125
|
+
clampMin: 0,
|
|
78126
|
+
clampMax: 100
|
|
78127
|
+
}]
|
|
78119
78128
|
}],
|
|
78120
78129
|
sourceReport: { status: "assignment-status" },
|
|
78121
78130
|
advancedExpression: true,
|
|
@@ -78230,7 +78239,14 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78230
78239
|
nullable: true,
|
|
78231
78240
|
sources: [{
|
|
78232
78241
|
kind: "numeric",
|
|
78233
|
-
transformKinds: ["identity", "linear"]
|
|
78242
|
+
transformKinds: ["identity", "linear"],
|
|
78243
|
+
transforms: [{ kind: "identity" }, {
|
|
78244
|
+
kind: "linear",
|
|
78245
|
+
defaultScale: 1,
|
|
78246
|
+
defaultOffset: 0,
|
|
78247
|
+
clampMin: 0,
|
|
78248
|
+
clampMax: 100
|
|
78249
|
+
}]
|
|
78234
78250
|
}]
|
|
78235
78251
|
},
|
|
78236
78252
|
{
|
|
@@ -78239,7 +78255,8 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78239
78255
|
nullable: true,
|
|
78240
78256
|
sources: [{
|
|
78241
78257
|
kind: "numeric",
|
|
78242
|
-
transformKinds: ["identity"]
|
|
78258
|
+
transformKinds: ["identity"],
|
|
78259
|
+
transforms: [{ kind: "identity" }]
|
|
78243
78260
|
}],
|
|
78244
78261
|
literals: [{
|
|
78245
78262
|
path: "remaining.unit",
|
|
@@ -78263,7 +78280,18 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78263
78280
|
],
|
|
78264
78281
|
sources: [{
|
|
78265
78282
|
kind: "enum",
|
|
78266
|
-
transformKinds: ["enum-map"]
|
|
78283
|
+
transformKinds: ["enum-map"],
|
|
78284
|
+
transforms: [{
|
|
78285
|
+
kind: "enum-map",
|
|
78286
|
+
outputValues: [
|
|
78287
|
+
"ok",
|
|
78288
|
+
"low",
|
|
78289
|
+
"empty",
|
|
78290
|
+
"full",
|
|
78291
|
+
"replace"
|
|
78292
|
+
],
|
|
78293
|
+
unmapped: null
|
|
78294
|
+
}]
|
|
78267
78295
|
}]
|
|
78268
78296
|
}
|
|
78269
78297
|
],
|
|
@@ -78308,10 +78336,12 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78308
78336
|
vocabularyEvent: "onPressed",
|
|
78309
78337
|
sources: [{
|
|
78310
78338
|
kind: "binary",
|
|
78311
|
-
transformKinds: []
|
|
78339
|
+
transformKinds: [],
|
|
78340
|
+
transforms: []
|
|
78312
78341
|
}, {
|
|
78313
78342
|
kind: "switch",
|
|
78314
|
-
transformKinds: []
|
|
78343
|
+
transformKinds: [],
|
|
78344
|
+
transforms: []
|
|
78315
78345
|
}],
|
|
78316
78346
|
sourceReport: { status: "assignment-status" },
|
|
78317
78347
|
advancedExpression: true,
|
|
@@ -78320,6 +78350,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78320
78350
|
eventName: "onPressed",
|
|
78321
78351
|
combine: "any",
|
|
78322
78352
|
edges: ["rising"],
|
|
78353
|
+
defaultEdge: "rising",
|
|
78323
78354
|
timestampPath: "lastPressedAt",
|
|
78324
78355
|
counterPath: "pressCountSinceStart",
|
|
78325
78356
|
highWater: "composer-advance",
|
|
@@ -78348,10 +78379,12 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78348
78379
|
vocabularyEvent: "onMotionChanged",
|
|
78349
78380
|
sources: [{
|
|
78350
78381
|
kind: "binary",
|
|
78351
|
-
transformKinds: []
|
|
78382
|
+
transformKinds: [],
|
|
78383
|
+
transforms: []
|
|
78352
78384
|
}, {
|
|
78353
78385
|
kind: "switch",
|
|
78354
|
-
transformKinds: []
|
|
78386
|
+
transformKinds: [],
|
|
78387
|
+
transforms: []
|
|
78355
78388
|
}],
|
|
78356
78389
|
sourceReport: { status: "assignment-status" },
|
|
78357
78390
|
advancedExpression: false,
|
|
@@ -78411,16 +78444,27 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
78411
78444
|
sources: [
|
|
78412
78445
|
{
|
|
78413
78446
|
kind: "switch",
|
|
78414
|
-
transformKinds: ["identity"]
|
|
78447
|
+
transformKinds: ["identity"],
|
|
78448
|
+
transforms: [{ kind: "identity" }]
|
|
78415
78449
|
},
|
|
78416
78450
|
{
|
|
78417
78451
|
kind: "binary",
|
|
78418
|
-
transformKinds: ["identity", "invert"]
|
|
78452
|
+
transformKinds: ["identity", "invert"],
|
|
78453
|
+
transforms: [{ kind: "identity" }, { kind: "invert" }]
|
|
78419
78454
|
},
|
|
78420
78455
|
{
|
|
78421
78456
|
kind: "numeric",
|
|
78422
78457
|
requiredUnit: "W",
|
|
78423
|
-
transformKinds: ["threshold"]
|
|
78458
|
+
transformKinds: ["threshold"],
|
|
78459
|
+
transforms: [{
|
|
78460
|
+
kind: "threshold",
|
|
78461
|
+
comparisons: ["gte", "lte"],
|
|
78462
|
+
comparison: "gte",
|
|
78463
|
+
defaultThreshold: 5,
|
|
78464
|
+
defaultStartDwellMs: 3e4,
|
|
78465
|
+
defaultStopDwellMs: 18e4,
|
|
78466
|
+
thresholdUnit: "W"
|
|
78467
|
+
}]
|
|
78424
78468
|
}
|
|
78425
78469
|
],
|
|
78426
78470
|
sourceReport: {
|
|
@@ -78608,13 +78652,16 @@ function compilePulseOverride(input) {
|
|
|
78608
78652
|
const timestampPath = target.timestampPath;
|
|
78609
78653
|
const counterPath = target.counterPath;
|
|
78610
78654
|
if (timestampPath === void 0 || counterPath === void 0 || !isIdentifier(timestampPath) || !isIdentifier(counterPath)) return fail$2("path");
|
|
78611
|
-
|
|
78655
|
+
const edges = chosenEdges(input.draft.edges, target);
|
|
78656
|
+
if (edges === null) return fail$2("edge");
|
|
78612
78657
|
const pairs = pairSources(input);
|
|
78613
78658
|
if (!pairs.ok) return pairs;
|
|
78614
78659
|
if (pairs.value.length === 0) return fail$2("sources");
|
|
78615
78660
|
const debounce = unsignedToken(input.draft.debounceMs);
|
|
78616
78661
|
if (debounce === null) return fail$2("debounce");
|
|
78617
78662
|
const ordered = pairs.value.toSorted((a, b) => pairKey(a).localeCompare(pairKey(b)));
|
|
78663
|
+
const calls = edgeCalls(edges, ordered.length, debounce);
|
|
78664
|
+
if (calls === null) return fail$2("edge");
|
|
78618
78665
|
return {
|
|
78619
78666
|
ok: true,
|
|
78620
78667
|
value: {
|
|
@@ -78622,7 +78669,7 @@ function compilePulseOverride(input) {
|
|
|
78622
78669
|
cap: input.draft.cap,
|
|
78623
78670
|
enabled: input.draft.enabled,
|
|
78624
78671
|
fields: {
|
|
78625
|
-
[timestampPath]: expression(pulseExpr(
|
|
78672
|
+
[timestampPath]: expression(pulseExpr(calls), pulseBindings(ordered)),
|
|
78626
78673
|
[counterPath]: expression(`count(${timestampPath})`, { [timestampPath]: fromRead(input.device, input.draft.cap, timestampPath) })
|
|
78627
78674
|
}
|
|
78628
78675
|
}
|
|
@@ -78676,10 +78723,28 @@ function pairSources(input) {
|
|
|
78676
78723
|
function pairKey(pair) {
|
|
78677
78724
|
return `${pair.source.addonId}/${pair.source.stableId}#${pair.source.cap}#${pair.source.fieldPath}`;
|
|
78678
78725
|
}
|
|
78679
|
-
function
|
|
78680
|
-
const
|
|
78681
|
-
|
|
78682
|
-
|
|
78726
|
+
function chosenEdges(draftEdges, target) {
|
|
78727
|
+
const allowed = target.edges ?? [];
|
|
78728
|
+
const chosen = draftEdges ?? (target.defaultEdge !== void 0 ? [target.defaultEdge] : []);
|
|
78729
|
+
if (chosen.length === 0) return null;
|
|
78730
|
+
if (chosen.some((edge) => !allowed.includes(edge))) return null;
|
|
78731
|
+
return chosen;
|
|
78732
|
+
}
|
|
78733
|
+
function edgeCalls(edges, count, debounce) {
|
|
78734
|
+
const calls = [];
|
|
78735
|
+
for (let index = 0; index < count; index += 1) for (const edge of edges) {
|
|
78736
|
+
const call = edgeCall(edge, index, debounce);
|
|
78737
|
+
if (call === null) return null;
|
|
78738
|
+
calls.push(call);
|
|
78739
|
+
}
|
|
78740
|
+
return calls;
|
|
78741
|
+
}
|
|
78742
|
+
function edgeCall(edge, index, debounce) {
|
|
78743
|
+
if (edge === "rising") return `rose(active${index}, changed${index}, ${debounce})`;
|
|
78744
|
+
return null;
|
|
78745
|
+
}
|
|
78746
|
+
function pulseExpr(calls) {
|
|
78747
|
+
return `latest(${calls.join(", ")})`;
|
|
78683
78748
|
}
|
|
78684
78749
|
function pulseBindings(pairs) {
|
|
78685
78750
|
const bindings = {};
|
|
@@ -103258,6 +103323,11 @@ var PulseOverrideDraftSchema = z.object({
|
|
|
103258
103323
|
targetId: z.string().min(1),
|
|
103259
103324
|
enabled: z.boolean(),
|
|
103260
103325
|
debounceMs: z.number().nonnegative(),
|
|
103326
|
+
edges: z.array(z.enum([
|
|
103327
|
+
"rising",
|
|
103328
|
+
"button",
|
|
103329
|
+
"native-event"
|
|
103330
|
+
])).min(1).optional(),
|
|
103261
103331
|
sources: z.array(OverrideSourceSchema).min(1)
|
|
103262
103332
|
});
|
|
103263
103333
|
var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: z.enum([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/types",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.416",
|
|
4
4
|
"description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -13,7 +13,12 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "https://github.com/camstack/server"
|
|
16
|
+
"url": "https://github.com/camstack/server.git",
|
|
17
|
+
"directory": "packages/types"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://camstack-docs.zentik.app",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/camstack/server/issues"
|
|
17
22
|
},
|
|
18
23
|
"main": "./dist/index.js",
|
|
19
24
|
"module": "./dist/index.mjs",
|