@camstack/types 1.2.583 → 1.2.584
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/CHANGELOG.md +6 -0
- package/dist/capabilities/hero-layout.cap.d.ts +1 -0
- package/dist/device/hero/hero-row.d.ts +1 -0
- package/dist/index.js +36 -11
- package/dist/index.mjs +36 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.584] - 2026-11-16
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- A device row says when its primary control is gated (read-only)
|
|
15
|
+
|
|
10
16
|
## [1.2.583] - 2026-11-16
|
|
11
17
|
|
|
12
18
|
### Changed
|
|
@@ -738,6 +738,7 @@ export declare const heroLayoutCapability: {
|
|
|
738
738
|
}, z.core.$strip>;
|
|
739
739
|
valueArg: z.ZodString;
|
|
740
740
|
}, z.core.$strip>], "kind">>;
|
|
741
|
+
primaryGated: z.ZodOptional<z.ZodBoolean>;
|
|
741
742
|
timedRun: z.ZodNullable<z.ZodObject<{
|
|
742
743
|
id: z.ZodEnum<{
|
|
743
744
|
"timed-run.cancel": "timed-run.cancel";
|
|
@@ -234,6 +234,7 @@ export declare const HeroRowModelSchema: z.ZodObject<{
|
|
|
234
234
|
}, z.core.$strip>;
|
|
235
235
|
valueArg: z.ZodString;
|
|
236
236
|
}, z.core.$strip>], "kind">>;
|
|
237
|
+
primaryGated: z.ZodOptional<z.ZodBoolean>;
|
|
237
238
|
timedRun: z.ZodNullable<z.ZodObject<{
|
|
238
239
|
id: z.ZodEnum<{
|
|
239
240
|
"timed-run.cancel": "timed-run.cancel";
|
package/dist/index.js
CHANGED
|
@@ -65211,6 +65211,12 @@ var HeroRowModelSchema = zod.z.object({
|
|
|
65211
65211
|
/** `null` = the type has no inline control, or the caller may not act on it. */
|
|
65212
65212
|
primary: HeroControlSchema.nullable(),
|
|
65213
65213
|
/**
|
|
65214
|
+
* `true` when the primary exists but the model gates it (the caller may not act): the
|
|
65215
|
+
* row is read-only and a client draws no control, not a fallback. `false` = nothing
|
|
65216
|
+
* covers the type yet. Absent = an older server.
|
|
65217
|
+
*/
|
|
65218
|
+
primaryGated: zod.z.boolean().optional(),
|
|
65219
|
+
/**
|
|
65214
65220
|
* Beside `primary` when the device offers a timed run: Run while idle, Stop
|
|
65215
65221
|
* while armed. `null` when there is no slot, or the caller may not act.
|
|
65216
65222
|
*/
|
|
@@ -65265,26 +65271,44 @@ function primaryOf(model) {
|
|
|
65265
65271
|
const named = ROW_PRIMARY_BY_TYPE[model.type];
|
|
65266
65272
|
if (named !== void 0) {
|
|
65267
65273
|
const found = extraOf(model, named);
|
|
65268
|
-
if (found !== null) return
|
|
65274
|
+
if (found !== null) return {
|
|
65275
|
+
control: found,
|
|
65276
|
+
gated: false
|
|
65277
|
+
};
|
|
65269
65278
|
}
|
|
65270
65279
|
const power = model.ownPower;
|
|
65271
65280
|
if (power !== null) {
|
|
65272
|
-
if (model.gated.includes("own-power")) return
|
|
65281
|
+
if (model.gated.includes("own-power")) return {
|
|
65282
|
+
control: null,
|
|
65283
|
+
gated: true
|
|
65284
|
+
};
|
|
65273
65285
|
return {
|
|
65274
|
-
|
|
65275
|
-
|
|
65276
|
-
|
|
65277
|
-
|
|
65278
|
-
|
|
65279
|
-
|
|
65286
|
+
control: {
|
|
65287
|
+
kind: "toggle",
|
|
65288
|
+
id: "own-power",
|
|
65289
|
+
label: power.turnOn.label,
|
|
65290
|
+
on: power.on,
|
|
65291
|
+
turnOn: power.turnOn,
|
|
65292
|
+
turnOff: power.turnOff
|
|
65293
|
+
},
|
|
65294
|
+
gated: false
|
|
65280
65295
|
};
|
|
65281
65296
|
}
|
|
65282
65297
|
for (const row of model.rows) {
|
|
65283
65298
|
const control = row.controls[0];
|
|
65284
65299
|
if (control === void 0) continue;
|
|
65285
|
-
return model.gated.includes(row.id) ?
|
|
65300
|
+
return model.gated.includes(row.id) ? {
|
|
65301
|
+
control: null,
|
|
65302
|
+
gated: true
|
|
65303
|
+
} : {
|
|
65304
|
+
control,
|
|
65305
|
+
gated: false
|
|
65306
|
+
};
|
|
65286
65307
|
}
|
|
65287
|
-
return
|
|
65308
|
+
return {
|
|
65309
|
+
control: null,
|
|
65310
|
+
gated: false
|
|
65311
|
+
};
|
|
65288
65312
|
}
|
|
65289
65313
|
/**
|
|
65290
65314
|
* The extras of a type, by control id, in the order they are drawn. The ids are the
|
|
@@ -65351,7 +65375,7 @@ function timedRunOf(model) {
|
|
|
65351
65375
|
}
|
|
65352
65376
|
function projectDeviceRow(model) {
|
|
65353
65377
|
const trailing = trailingOf(model);
|
|
65354
|
-
const primary = primaryOf(model);
|
|
65378
|
+
const { control: primary, gated: primaryGated } = primaryOf(model);
|
|
65355
65379
|
return {
|
|
65356
65380
|
deviceId: model.deviceId,
|
|
65357
65381
|
name: model.name,
|
|
@@ -65362,6 +65386,7 @@ function projectDeviceRow(model) {
|
|
|
65362
65386
|
scene: model.scene,
|
|
65363
65387
|
statusLine: statusLineOf(model, trailing),
|
|
65364
65388
|
primary,
|
|
65389
|
+
primaryGated,
|
|
65365
65390
|
timedRun: timedRunOf(model),
|
|
65366
65391
|
extras: extrasOf(model, primary),
|
|
65367
65392
|
trailing,
|
package/dist/index.mjs
CHANGED
|
@@ -65210,6 +65210,12 @@ var HeroRowModelSchema = z.object({
|
|
|
65210
65210
|
/** `null` = the type has no inline control, or the caller may not act on it. */
|
|
65211
65211
|
primary: HeroControlSchema.nullable(),
|
|
65212
65212
|
/**
|
|
65213
|
+
* `true` when the primary exists but the model gates it (the caller may not act): the
|
|
65214
|
+
* row is read-only and a client draws no control, not a fallback. `false` = nothing
|
|
65215
|
+
* covers the type yet. Absent = an older server.
|
|
65216
|
+
*/
|
|
65217
|
+
primaryGated: z.boolean().optional(),
|
|
65218
|
+
/**
|
|
65213
65219
|
* Beside `primary` when the device offers a timed run: Run while idle, Stop
|
|
65214
65220
|
* while armed. `null` when there is no slot, or the caller may not act.
|
|
65215
65221
|
*/
|
|
@@ -65264,26 +65270,44 @@ function primaryOf(model) {
|
|
|
65264
65270
|
const named = ROW_PRIMARY_BY_TYPE[model.type];
|
|
65265
65271
|
if (named !== void 0) {
|
|
65266
65272
|
const found = extraOf(model, named);
|
|
65267
|
-
if (found !== null) return
|
|
65273
|
+
if (found !== null) return {
|
|
65274
|
+
control: found,
|
|
65275
|
+
gated: false
|
|
65276
|
+
};
|
|
65268
65277
|
}
|
|
65269
65278
|
const power = model.ownPower;
|
|
65270
65279
|
if (power !== null) {
|
|
65271
|
-
if (model.gated.includes("own-power")) return
|
|
65280
|
+
if (model.gated.includes("own-power")) return {
|
|
65281
|
+
control: null,
|
|
65282
|
+
gated: true
|
|
65283
|
+
};
|
|
65272
65284
|
return {
|
|
65273
|
-
|
|
65274
|
-
|
|
65275
|
-
|
|
65276
|
-
|
|
65277
|
-
|
|
65278
|
-
|
|
65285
|
+
control: {
|
|
65286
|
+
kind: "toggle",
|
|
65287
|
+
id: "own-power",
|
|
65288
|
+
label: power.turnOn.label,
|
|
65289
|
+
on: power.on,
|
|
65290
|
+
turnOn: power.turnOn,
|
|
65291
|
+
turnOff: power.turnOff
|
|
65292
|
+
},
|
|
65293
|
+
gated: false
|
|
65279
65294
|
};
|
|
65280
65295
|
}
|
|
65281
65296
|
for (const row of model.rows) {
|
|
65282
65297
|
const control = row.controls[0];
|
|
65283
65298
|
if (control === void 0) continue;
|
|
65284
|
-
return model.gated.includes(row.id) ?
|
|
65299
|
+
return model.gated.includes(row.id) ? {
|
|
65300
|
+
control: null,
|
|
65301
|
+
gated: true
|
|
65302
|
+
} : {
|
|
65303
|
+
control,
|
|
65304
|
+
gated: false
|
|
65305
|
+
};
|
|
65285
65306
|
}
|
|
65286
|
-
return
|
|
65307
|
+
return {
|
|
65308
|
+
control: null,
|
|
65309
|
+
gated: false
|
|
65310
|
+
};
|
|
65287
65311
|
}
|
|
65288
65312
|
/**
|
|
65289
65313
|
* The extras of a type, by control id, in the order they are drawn. The ids are the
|
|
@@ -65350,7 +65374,7 @@ function timedRunOf(model) {
|
|
|
65350
65374
|
}
|
|
65351
65375
|
function projectDeviceRow(model) {
|
|
65352
65376
|
const trailing = trailingOf(model);
|
|
65353
|
-
const primary = primaryOf(model);
|
|
65377
|
+
const { control: primary, gated: primaryGated } = primaryOf(model);
|
|
65354
65378
|
return {
|
|
65355
65379
|
deviceId: model.deviceId,
|
|
65356
65380
|
name: model.name,
|
|
@@ -65361,6 +65385,7 @@ function projectDeviceRow(model) {
|
|
|
65361
65385
|
scene: model.scene,
|
|
65362
65386
|
statusLine: statusLineOf(model, trailing),
|
|
65363
65387
|
primary,
|
|
65388
|
+
primaryGated,
|
|
65364
65389
|
timedRun: timedRunOf(model),
|
|
65365
65390
|
extras: extrasOf(model, primary),
|
|
65366
65391
|
trailing,
|