@camstack/types 1.2.530 → 1.2.532

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-CqsZMKxq.js");
2
+ const require_sleep = require("./sleep-ComzlWyT.js");
3
3
  const require_event_category = require("./event-category-BC4RRerT.js");
4
4
  const require_device_type = require("./device-type-BaYa0UGS.js");
5
5
  const require_composition = require("./composition-BjHGoicU.js");
@@ -7295,18 +7295,6 @@ var StorageLocationSchema = zod.z.object({
7295
7295
  createdAt: zod.z.number(),
7296
7296
  updatedAt: zod.z.number()
7297
7297
  });
7298
- /**
7299
- * The retired `isDefault` key, DECLARED rather than dropped.
7300
- *
7301
- * A key removed from a non-strict `z.object` is stripped in silence (D380,
7302
- * D381): a reader that still needs the old value gets `undefined` and cannot
7303
- * tell "absent" from "never sent". The one reader that legitimately needs it —
7304
- * the location store's boot migration, which turns the old default flag into
7305
- * the `enabled` write set — parses THIS schema against the raw row instead, so
7306
- * the migration is explicit and the live schema stays clean. Nothing else in
7307
- * the repo may read it; `scripts/check-no-storage-default.ts` enforces that.
7308
- */
7309
- var LegacyStorageLocationDefaultSchema = zod.z.object({ isDefault: zod.z.boolean().optional() });
7310
7298
  function isLocationEnabled(location) {
7311
7299
  return mayWriteToLocation({
7312
7300
  ...location,
@@ -39864,7 +39852,14 @@ var CalendarInfoSchema = zod.z.object({
39864
39852
  id: zod.z.string().min(1),
39865
39853
  name: zod.z.string().min(1),
39866
39854
  source: CalendarSourceKindSchema,
39867
- enabled: zod.z.boolean()
39855
+ enabled: zod.z.boolean(),
39856
+ /**
39857
+ * The `integration-instances` record that owns this calendar (the record the switch writes).
39858
+ * Every source stamps it from the record it read the calendar from, so a consumer joins on
39859
+ * it instead of rebuilding an id from form values. Optional on the wire so a source addon
39860
+ * that predates the field still lists its calendars: such a row simply has no switch.
39861
+ */
39862
+ instanceId: zod.z.string().min(1).optional()
39868
39863
  });
39869
39864
  /**
39870
39865
  * Time contract of {@link CalendarEvent}.
@@ -43056,8 +43051,12 @@ var RemoteSequenceSourceSchema = zod.z.object({
43056
43051
  var RemoteIrSourceSchema = zod.z.object({
43057
43052
  ...sourceBase,
43058
43053
  kind: zod.z.literal("ir"),
43059
- /** The `ir-transmitter` device the code is sent through. */
43060
- transmitterId: zod.z.number().int().nonnegative(),
43054
+ /**
43055
+ * The `ir-transmitter` device the code is sent through. Absent = the remote's
43056
+ * `defaultTransmitterId` at run time (a source stored before this field was
43057
+ * optional keeps the emitter it names).
43058
+ */
43059
+ transmitterId: zod.z.number().int().nonnegative().optional(),
43061
43060
  /** The code itself; whether a transmitter could send it is `irSourceProblem`. */
43062
43061
  payload: IrPayloadSchema
43063
43062
  });
@@ -56056,7 +56055,7 @@ var imageSettingsCapability = {
56056
56055
  *
56057
56056
  * Phase E of the API consolidation: previously a hand-written core
56058
56057
  * router. Cap conversion lets `useIntegrationsList`,
56059
- * `useIntegrationsCreate`, `useIntegrationsTestConnection` and
56058
+ * `useIntegrationsTestConnection` and
56060
56059
  * friends flow through the same codegen pipeline as every other cap.
56061
56060
  */
56062
56061
  var IntegrationWithStateSchema = zod.z.object({
@@ -56142,7 +56141,7 @@ var AvailableIntegrationTypeSchema = zod.z.object({
56142
56141
  *
56143
56142
  * - `validated` — a provider-declared test ran and the remote ACCEPTED.
56144
56143
  * - `rejected` — a provider-declared test ran and the remote REFUSED.
56145
- * The only status that blocks `integrations.create`.
56144
+ * The only status that blocks `integrationInstances.createInstance`.
56146
56145
  * - `inconclusive` — a test IS declared but could not complete (timeout,
56147
56146
  * DNS, 5xx). Nothing was observed; not a failure.
56148
56147
  * - `unsupported` — this integration declares NO test. Nothing was
@@ -56172,16 +56171,6 @@ var TestConnectionResultSchema = zod.z.object({
56172
56171
  /** Human detail from a `validated` result ("3 devices on this account"). */
56173
56172
  detail: zod.z.string().optional()
56174
56173
  });
56175
- var CreateIntegrationInputSchema = zod.z.object({
56176
- addonId: zod.z.string(),
56177
- name: zod.z.string(),
56178
- info: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
56179
- /** `stableId` of the discovery candidate the form was seeded from (D984). */
56180
- originStableId: zod.z.string().optional(),
56181
- settings: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
56182
- /** The instance kind being created, for a provider with several; omitted = its only testable kind. */
56183
- kind: zod.z.string().min(1).optional()
56184
- });
56185
56174
  var UpdateIntegrationInputSchema = zod.z.object({
56186
56175
  id: zod.z.string(),
56187
56176
  name: zod.z.string().optional(),
@@ -56205,10 +56194,6 @@ var integrationsCapability = {
56205
56194
  list: require_sleep.method(zod.z.void(), zod.z.array(IntegrationWithStateSchema)),
56206
56195
  get: require_sleep.method(zod.z.object({ id: zod.z.string() }), IntegrationWithStateSchema),
56207
56196
  getByAddonId: require_sleep.method(zod.z.object({ addonId: zod.z.string() }), IntegrationLiteSchema.nullable()),
56208
- create: require_sleep.method(CreateIntegrationInputSchema, IntegrationLiteSchema, {
56209
- kind: "mutation",
56210
- auth: "admin"
56211
- }),
56212
56197
  update: require_sleep.method(UpdateIntegrationInputSchema, IntegrationLiteSchema, {
56213
56198
  kind: "mutation",
56214
56199
  auth: "admin"
@@ -56436,7 +56421,15 @@ var integrationInstancesCapability = {
56436
56421
  * registry row of an instance that brings devices, so discovery stops offering a candidate
56437
56422
  * that already has its integration (D984). Ignored by an instance with no registry row.
56438
56423
  */
56439
- originStableId: zod.z.string().min(1).optional()
56424
+ originStableId: zod.z.string().min(1).optional(),
56425
+ /**
56426
+ * The seed variant: the HUB or an addon states the integration it owns (a fixed builtin's
56427
+ * row, a migration's row), not an operator creating one. It brings the registry `info`
56428
+ * (`{ fixed: true }`), makes the row whatever the kind's role, and is accepted only from a
56429
+ * caller the transport stamped as the addon itself (`callerAddonId`): an admin session
56430
+ * cannot send it, and the wizard never does. `values` are the settings it is seeded with.
56431
+ */
56432
+ seed: zod.z.object({ info: zod.z.record(zod.z.string(), zod.z.unknown()) }).optional()
56440
56433
  }), zod.z.object({ id: zod.z.string() }), {
56441
56434
  kind: "mutation",
56442
56435
  auth: "admin"
@@ -81811,8 +81804,6 @@ var RemoteCustomButtonSchema = zod.z.object({
81811
81804
  /** What the operator calls it, and what a voice command may name. */
81812
81805
  name: zod.z.string().min(1).max(60)
81813
81806
  });
81814
- var REMOTE_POWER_MODES = ["toggle", "discrete"];
81815
- var RemotePowerModeSchema = zod.z.enum(REMOTE_POWER_MODES);
81816
81807
  var MAX_REMOTE_BINDINGS = 200;
81817
81808
  var MAX_REMOTE_CUSTOM_BUTTONS = 100;
81818
81809
  /**
@@ -81895,7 +81886,6 @@ var RemoteConfigSchema = zod.z.object({
81895
81886
  sources: zod.z.array(RemoteSourceSchema).max(200).default([]),
81896
81887
  /** The pause between two steps of a source: the television's receiver, not a repeat. */
81897
81888
  stepDelayMs: zod.z.number().int().min(100).max(REMOTE_STEP_DELAY_MAX_MS).default(500),
81898
- power: zod.z.object({ mode: RemotePowerModeSchema }),
81899
81889
  /**
81900
81890
  * READ-ONLY: sources a stored configuration carries that no longer parse,
81901
81891
  * left out of `sources` with the reason (`readStoredRemoteConfig`). Never
@@ -82002,8 +81992,7 @@ var EMPTY_REMOTE_CONFIG = {
82002
81992
  bindings: {},
82003
81993
  customButtons: [],
82004
81994
  sources: [],
82005
- stepDelayMs: 500,
82006
- power: { mode: "discrete" }
81995
+ stepDelayMs: 500
82007
81996
  };
82008
81997
  /**
82009
81998
  * What the remote last SENT and therefore guesses about a device that does not
@@ -82078,6 +82067,11 @@ var RemoteLayoutButtonSchema = zod.z.object({
82078
82067
  /** Absent = the plain rendering every layout had before shapes existed. */
82079
82068
  shape: RemoteButtonShapeSchema.optional(),
82080
82069
  tone: RemoteButtonToneSchema.optional(),
82070
+ /**
82071
+ * Draw the label on a colour-toned key. A colour key shows only its colour
82072
+ * by default; a remote whose plastic prints letters on them (A B C D) sets it.
82073
+ */
82074
+ showLegend: zod.z.boolean().optional(),
82081
82075
  /** The group this button belongs to; it must lie inside that group's rectangle. */
82082
82076
  groupId: zod.z.string().min(1).max(40).optional()
82083
82077
  });
@@ -82237,7 +82231,6 @@ var RemoteBoundCommandSchema = zod.z.object({
82237
82231
  });
82238
82232
  var RemoteCommandListSchema = zod.z.object({
82239
82233
  layoutTemplateId: zod.z.string().nullable(),
82240
- power: zod.z.object({ mode: RemotePowerModeSchema }),
82241
82234
  /** Only the roles that are BOUND — the ones a press can reach. */
82242
82235
  commands: zod.z.array(RemoteBoundCommandSchema),
82243
82236
  /** The sources the operator declared; empty when none (planning#460). */
@@ -82249,6 +82242,7 @@ var RemoteCommandListSchema = zod.z.object({
82249
82242
  * `unbound-step`: a step of the source has no binding (named in `step`).
82250
82243
  * `press-timeout`: a press never finished within the bound, so it was given up
82251
82244
  * and the device's later presses are not held behind it.
82245
+ * `no-transmitter`: an infrared source names no emitter and the remote has no default one.
82252
82246
  */
82253
82247
  var REMOTE_REFUSAL_REASONS = [
82254
82248
  "no-remote",
@@ -82257,7 +82251,8 @@ var REMOTE_REFUSAL_REASONS = [
82257
82251
  "unknown-source",
82258
82252
  "unbound-step",
82259
82253
  "undeclared-channel",
82260
- "press-timeout"
82254
+ "press-timeout",
82255
+ "no-transmitter"
82261
82256
  ];
82262
82257
  var RemoteRefusalReasonSchema = zod.z.enum(REMOTE_REFUSAL_REASONS);
82263
82258
  var RemoteSendResultSchema = zod.z.discriminatedUnion("status", [
@@ -82401,7 +82396,8 @@ var RemoteComponentButtonSchema = zod.z.object({
82401
82396
  icon: zod.z.string().min(1).max(60).optional(),
82402
82397
  label: zod.z.string().min(1).max(40).optional(),
82403
82398
  shape: RemoteButtonShapeSchema.optional(),
82404
- tone: RemoteButtonToneSchema.optional()
82399
+ tone: RemoteButtonToneSchema.optional(),
82400
+ showLegend: zod.z.boolean().optional()
82405
82401
  });
82406
82402
  var RemoteLayoutComponentSchema = zod.z.object({
82407
82403
  id: zod.z.string().max(80).regex(COMPONENT_ID_RE, { message: "<namespace>:<name>, lowercase" }),
@@ -93068,6 +93064,18 @@ function fillWidthScale(layout, component) {
93068
93064
  function titleOf(title) {
93069
93065
  return title === void 0 ? {} : { title };
93070
93066
  }
93067
+ /** The label (and whether it shows on a colour key) a component button is inserted with. */
93068
+ function legendOf(spec, legends) {
93069
+ const legend = legends?.[spec.idSuffix];
93070
+ if (legend !== void 0) return {
93071
+ label: legend,
93072
+ showLegend: true
93073
+ };
93074
+ return {
93075
+ ...spec.label === void 0 ? {} : { label: spec.label },
93076
+ ...spec.showLegend === void 0 ? {} : { showLegend: spec.showLegend }
93077
+ };
93078
+ }
93071
93079
  function slug$1(value) {
93072
93080
  return (value.includes(":") ? value.slice(value.indexOf(":") + 1) : value).replace(/[^a-z0-9_-]/g, "-").slice(0, 16);
93073
93081
  }
@@ -93124,7 +93132,7 @@ function insertComponent(layout, component, at, options = {}) {
93124
93132
  ...rect,
93125
93133
  role: spec.role,
93126
93134
  ...spec.icon === void 0 ? {} : { icon: spec.icon },
93127
- ...spec.label === void 0 ? {} : { label: spec.label },
93135
+ ...legendOf(spec, options.legends),
93128
93136
  ...spec.shape === void 0 ? {} : { shape: spec.shape },
93129
93137
  ...spec.tone === void 0 ? {} : { tone: spec.tone },
93130
93138
  ...groupId === null ? {} : { groupId }
@@ -93585,11 +93593,8 @@ function smartIrDraft(table, target, options = {}) {
93585
93593
  const find = (name) => commands.find((c) => c.group === "command" && c.name === name);
93586
93594
  const on = find("on");
93587
93595
  const off = find("off");
93588
- let mode = "discrete";
93589
- if (on !== void 0 && off !== void 0 && sameTrain(on, off)) {
93590
- mode = "toggle";
93591
- bindings["power"] = bindingOf(on);
93592
- } else {
93596
+ if (on !== void 0 && off !== void 0 && sameTrain(on, off)) bindings["power"] = bindingOf(on);
93597
+ else {
93593
93598
  if (on !== void 0) bindings["power_on"] = bindingOf(on);
93594
93599
  if (off !== void 0) bindings["power_off"] = bindingOf(off);
93595
93600
  }
@@ -93605,15 +93610,11 @@ function smartIrDraft(table, target, options = {}) {
93605
93610
  name: command.name,
93606
93611
  reason: `duplicate of the ${role} button already bound`
93607
93612
  });
93608
- else {
93609
- bindings[role] = bindingOf(command);
93610
- if (role === "power") mode = "toggle";
93611
- }
93613
+ else bindings[role] = bindingOf(command);
93612
93614
  }
93613
93615
  return {
93614
93616
  bindings,
93615
93617
  customButtons,
93616
- power: { mode },
93617
93618
  skipped
93618
93619
  };
93619
93620
  }
@@ -107385,13 +107386,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
107385
107386
  access: "create",
107386
107387
  role: "admin"
107387
107388
  },
107388
- "integrations.create": {
107389
- capName: "integrations",
107390
- capScope: "system",
107391
- addonId: null,
107392
- access: "create",
107393
- role: "admin"
107394
- },
107395
107389
  "integrations.delete": {
107396
107390
  capName: "integrations",
107397
107391
  capScope: "system",
@@ -120938,7 +120932,6 @@ function createSystemProxy(api) {
120938
120932
  list: (input) => dispatch("integrations", "list", "query", input),
120939
120933
  get: (input) => dispatch("integrations", "get", "query", input),
120940
120934
  getByAddonId: (input) => dispatch("integrations", "getByAddonId", "query", input),
120941
- create: (input) => dispatch("integrations", "create", "mutation", input),
120942
120935
  update: (input) => dispatch("integrations", "update", "mutation", input),
120943
120936
  delete: (input) => dispatch("integrations", "delete", "mutation", input),
120944
120937
  getAvailableTypes: (input) => dispatch("integrations", "getAvailableTypes", "query", input)
@@ -133563,7 +133556,6 @@ exports.CoreBlockSourceSchema = CoreBlockSourceSchema;
133563
133556
  exports.CoreBlockStatusSchema = CoreBlockStatusSchema;
133564
133557
  exports.CoverStateSchema = CoverStateSchema;
133565
133558
  exports.CoverStatusSchema = CoverStatusSchema;
133566
- exports.CreateIntegrationInputSchema = CreateIntegrationInputSchema;
133567
133559
  exports.CreateUserInputSchema = CreateUserInputSchema;
133568
133560
  exports.CredentialScopeSchema = CredentialScopeSchema;
133569
133561
  exports.CredentialTokenClaimsSchema = CredentialTokenClaimsSchema;
@@ -134131,7 +134123,6 @@ exports.LedgerWalkSkipCountsSchema = LedgerWalkSkipCountsSchema;
134131
134123
  exports.LedgerWalkSkipReasonSchema = LedgerWalkSkipReasonSchema;
134132
134124
  exports.LegacyAutomationRecipeSchema = LegacyAutomationRecipeSchema;
134133
134125
  exports.LegacyConditionSchema = LegacyConditionSchema;
134134
- exports.LegacyStorageLocationDefaultSchema = LegacyStorageLocationDefaultSchema;
134135
134126
  exports.LegacyTriggerSchema = LegacyTriggerSchema;
134136
134127
  exports.LinkedDeviceSchema = LinkedDeviceSchema;
134137
134128
  exports.LinkedDevicesModeSchema = LinkedDevicesModeSchema;
@@ -134866,7 +134857,6 @@ exports.REMOTE_GROUP_FRAMES = REMOTE_GROUP_FRAMES;
134866
134857
  exports.REMOTE_KNOWN_ROLES = REMOTE_KNOWN_ROLES;
134867
134858
  exports.REMOTE_MAX_REPEAT = REMOTE_MAX_REPEAT;
134868
134859
  exports.REMOTE_MEDIA_COMMANDS = REMOTE_MEDIA_COMMANDS;
134869
- exports.REMOTE_POWER_MODES = REMOTE_POWER_MODES;
134870
134860
  exports.REMOTE_REFUSAL_REASONS = REMOTE_REFUSAL_REASONS;
134871
134861
  exports.REMOTE_ROLE_VOCABULARY = REMOTE_ROLE_VOCABULARY;
134872
134862
  exports.REMOTE_SOURCE_KINDS = REMOTE_SOURCE_KINDS;
@@ -135007,7 +134997,6 @@ exports.RemoteLayoutGroupSchema = RemoteLayoutGroupSchema;
135007
134997
  exports.RemoteLayoutPayloadSchema = RemoteLayoutPayloadSchema;
135008
134998
  exports.RemoteMediaCommandResultSchema = RemoteMediaCommandResultSchema;
135009
134999
  exports.RemoteMediaCommandSchema = RemoteMediaCommandSchema;
135010
- exports.RemotePowerModeSchema = RemotePowerModeSchema;
135011
135000
  exports.RemoteRefusalReasonSchema = RemoteRefusalReasonSchema;
135012
135001
  exports.RemoteRefusedSourceSchema = RemoteRefusedSourceSchema;
135013
135002
  exports.RemoteRoleSchema = RemoteRoleSchema;