@camstack/addon-import-alexa 0.2.129 → 0.2.131

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.
Files changed (3) hide show
  1. package/dist/addon.js +493 -240
  2. package/dist/addon.mjs +493 -240
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
38
38
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
39
39
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
40
40
  //#endregion
41
- //#region ../types/dist/event-category-BvOFi6PY.mjs
41
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
42
42
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
43
43
  EventCategory["SystemBoot"] = "system.boot";
44
44
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -117,9 +117,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
117
117
  /**
118
118
  * The node's one-shot runner boot check (D877): planned runners against the
119
119
  * process service, `degraded` when any is failed, refused or missing. The
120
- * alert centre turns it into one alert and a direct critical push.
120
+ * alert centre turns it into one critical alert.
121
121
  */
122
122
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
123
+ /**
124
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
125
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
126
+ * centre sends no notification of its own: Notification Center turns this
127
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
128
+ * system-event kinds, and reconciles from the alerts store because a bus
129
+ * event may be dropped (D8, D11).
130
+ */
131
+ EventCategory["AlertEpisode"] = "alert.episode";
123
132
  EventCategory["AddonError"] = "addon.error";
124
133
  EventCategory["AddonPageReady"] = "addon.page-ready";
125
134
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5577,7 +5586,7 @@ var ZodIssueCode = {
5577
5586
  var ZodFirstPartyTypeKind;
5578
5587
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5579
5588
  //#endregion
5580
- //#region ../types/dist/sleep-BegKjwUu.mjs
5589
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5581
5590
  /**
5582
5591
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5583
5592
  * window to float samples (D455).
@@ -7959,6 +7968,12 @@ function normalizeAddonInitResult(result) {
7959
7968
  if (Array.isArray(result)) return { providers: result };
7960
7969
  return result;
7961
7970
  }
7971
+ /**
7972
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7973
+ * and validates them (`share-token.service.ts` builds its enum from this
7974
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7975
+ */
7976
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7962
7977
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7963
7978
  var PeerBytesTicketSchema = object({
7964
7979
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12941,6 +12956,229 @@ var ConvertResultSchema = object({
12941
12956
  files: array(string()).readonly()
12942
12957
  })).readonly()
12943
12958
  });
12959
+ /**
12960
+ * Zod schemas for persisted record types.
12961
+ *
12962
+ * These schemas serve as the single source of truth for types that are
12963
+ * stored in the settings-store backend and retrieved via tRPC. They
12964
+ * replace the manual TypeScript interfaces with schema-derived types,
12965
+ * enabling runtime validation when reading from the backend.
12966
+ *
12967
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12968
+ * keeps the original name for backward compatibility.
12969
+ */
12970
+ /**
12971
+ * Auth model (v2 — 2026-05-12 caps-only):
12972
+ *
12973
+ * Two principals:
12974
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12975
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12976
+ *
12977
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12978
+ * `super_admin` — collapsed onto the single boolean because every
12979
+ * non-admin caller is governed by the same scope-check rules; the
12980
+ * distinction was only ever used to route role-specific procedures
12981
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12982
+ * with `isAdmin: false` + an explicit scope list.
12983
+ */
12984
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12985
+ var MethodAccessSchema = _enum([
12986
+ "view",
12987
+ "create",
12988
+ "delete"
12989
+ ]);
12990
+ /**
12991
+ * A single scope grant. Three forms — checked in matcher with OR
12992
+ * semantics; the first match decides whether the call passes:
12993
+ *
12994
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12995
+ * cap with the matching `scope` declaration. New caps inherit grants
12996
+ * automatically — adding a device cap to the codebase makes it
12997
+ * reachable to every user with `category:device [...]` without a
12998
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12999
+ *
13000
+ * - `addon` — every cap that ships inside a given addon id. Niche;
13001
+ * useful when an integration needs to interact with one specific
13002
+ * addon's surface regardless of how many caps it exports.
13003
+ *
13004
+ * - `capability` — the most precise form. Single cap name. Use for
13005
+ * integration tokens where you want to grant `addons.installPackage`
13006
+ * and nothing else.
13007
+ *
13008
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
13009
+ * "give me everything" escape; there is no wildcard scope.
13010
+ */
13011
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
13012
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
13013
+ var CapScopeSchema = _enum(["device", "system"]);
13014
+ /**
13015
+ * DeviceSelector (scope model v3 — 2026-08-12).
13016
+ *
13017
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
13018
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
13019
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
13020
+ * AFTER the grant was minted — no re-grant, no re-login.
13021
+ *
13022
+ * - `all` — every device in the deployment. The broad viewer/operator
13023
+ * lever without a `category` grant (a `category` grant also covers device
13024
+ * caps that carry no deviceId; `all` is specifically the device set).
13025
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
13026
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
13027
+ * is NOT covered until the grant is edited.
13028
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
13029
+ * DYNAMIC. A device that changes type, or a new device of the type,
13030
+ * re-resolves on the next request.
13031
+ * - `locations` — every device whose operator-assigned `location` label is
13032
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
13033
+ * null/unset location matches NO `locations` selector.
13034
+ */
13035
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
13036
+ object({ kind: literal("all") }),
13037
+ object({
13038
+ kind: literal("ids"),
13039
+ ids: array(number().int()).min(1)
13040
+ }),
13041
+ object({
13042
+ kind: literal("types"),
13043
+ types: array(_enum(DeviceType)).min(1)
13044
+ }),
13045
+ object({
13046
+ kind: literal("locations"),
13047
+ locations: array(string().min(1)).min(1)
13048
+ })
13049
+ ]);
13050
+ var DeviceTokenScopeSchema = object({
13051
+ type: literal("device"),
13052
+ /** The device SET this grant covers — resolved against the live fleet. */
13053
+ selector: DeviceSelectorSchema,
13054
+ access: array(MethodAccessSchema).min(1),
13055
+ /**
13056
+ * Whether a grant on a PARENT device transparently covers its accessory
13057
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
13058
+ * Direction is parent → children ONLY.
13059
+ *
13060
+ * Absent → the matcher DERIVES it from the access flavour: `view`
13061
+ * inherits (a camera viewer sees the camera's accessories), `create` /
13062
+ * `delete` do NOT (actuating/removing a child is an explicit act the
13063
+ * operator must grant on the child, not inherit from the parent). Set it
13064
+ * explicitly to override that default per grant.
13065
+ */
13066
+ includeLinked: boolean().optional()
13067
+ });
13068
+ /**
13069
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
13070
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
13071
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
13072
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
13073
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
13074
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
13075
+ * migration cannot reach a JWT already in a client's hands; parse-time
13076
+ * migration covers both without a flag day. No cast — the raw object is read
13077
+ * through `Reflect.get` (its static type is `unknown`).
13078
+ */
13079
+ function migrateLegacyTokenScope(raw) {
13080
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
13081
+ if (Reflect.get(raw, "type") !== "device") return raw;
13082
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
13083
+ const targets = Reflect.get(raw, "targets");
13084
+ if (!Array.isArray(targets)) return raw;
13085
+ return {
13086
+ type: "device",
13087
+ selector: {
13088
+ kind: "ids",
13089
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
13090
+ },
13091
+ access: Reflect.get(raw, "access")
13092
+ };
13093
+ }
13094
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
13095
+ object({
13096
+ type: literal("category"),
13097
+ target: CapScopeSchema,
13098
+ access: array(MethodAccessSchema).min(1)
13099
+ }),
13100
+ object({
13101
+ type: literal("capability"),
13102
+ target: string(),
13103
+ access: array(MethodAccessSchema).min(1)
13104
+ }),
13105
+ object({
13106
+ type: literal("addon"),
13107
+ target: string(),
13108
+ access: array(MethodAccessSchema).min(1)
13109
+ }),
13110
+ DeviceTokenScopeSchema
13111
+ ]));
13112
+ object({
13113
+ id: string(),
13114
+ username: string(),
13115
+ passwordHash: string(),
13116
+ /**
13117
+ * Admin bypass. When true, the middleware skips the scope-access
13118
+ * check entirely. There is no other axis of privilege; the legacy
13119
+ * role enum collapsed onto this boolean in v2.
13120
+ */
13121
+ isAdmin: boolean().default(false),
13122
+ allowedProviders: AllowedProviderSchema,
13123
+ allowedDevices: AllowedDevicesSchema,
13124
+ /**
13125
+ * Scopes granted to this user. Admins bypass; their `scopes` is
13126
+ * ignored. Non-admins without scopes are locked out of every
13127
+ * protected call.
13128
+ */
13129
+ scopes: array(TokenScopeSchema).default([]),
13130
+ createdAt: number(),
13131
+ updatedAt: number()
13132
+ });
13133
+ object({
13134
+ id: string(),
13135
+ label: string(),
13136
+ isAdmin: boolean().default(false),
13137
+ allowedProviders: AllowedProviderSchema,
13138
+ allowedDevices: AllowedDevicesSchema,
13139
+ tokenHash: string(),
13140
+ tokenPrefix: string(),
13141
+ createdAt: number(),
13142
+ lastUsedAt: number().optional()
13143
+ });
13144
+ object({
13145
+ id: string(),
13146
+ userId: string(),
13147
+ name: string(),
13148
+ tokenHash: string(),
13149
+ tokenPrefix: string(),
13150
+ scopes: array(TokenScopeSchema),
13151
+ expiresAt: number().nullish(),
13152
+ lastUsedAt: number().nullish(),
13153
+ createdAt: number()
13154
+ });
13155
+ /** What a share-view grant lets its holder see. */
13156
+ var ShareViewGrantSchema = object({
13157
+ kind: _enum(SHARE_VIEW_KINDS),
13158
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
13159
+ /** Talk-back, opt-in at mint time; absent means off. */
13160
+ talk: boolean().optional()
13161
+ });
13162
+ var ShareViewScopeSchema = object({
13163
+ type: literal("share-view"),
13164
+ grant: ShareViewGrantSchema
13165
+ });
13166
+ var AddonRoutesScopeSchema = object({
13167
+ type: literal("addon-routes"),
13168
+ access: array(MethodAccessSchema).min(1)
13169
+ });
13170
+ var CredentialScopeSchema = union([
13171
+ literal("*"),
13172
+ ShareViewScopeSchema,
13173
+ AddonRoutesScopeSchema,
13174
+ TokenScopeSchema
13175
+ ]);
13176
+ object({
13177
+ kind: literal("credential"),
13178
+ sub: string().min(1),
13179
+ jti: string().min(16),
13180
+ scopes: array(CredentialScopeSchema).min(1)
13181
+ });
12944
13182
  _enum(["new-session", "step-up"]);
12945
13183
  /** The languages the hub's app landing pages are written in (D858). */
12946
13184
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13676,7 +13914,14 @@ var AlertSeveritySchema = _enum([
13676
13914
  ]);
13677
13915
  var AlertActionSchema = object({
13678
13916
  label: string(),
13679
- href: string().optional()
13917
+ href: string().optional(),
13918
+ /**
13919
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13920
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13921
+ * start) — the browser must leave the SPA with a full navigation, because
13922
+ * the SPA has no such route and would bounce to the home page.
13923
+ */
13924
+ navigation: _enum(["app", "server"]).optional()
13680
13925
  });
13681
13926
  var AlertStatusSchema = _enum([
13682
13927
  "active",
@@ -42458,6 +42703,9 @@ var NcSystemEventKindSchema = _enum([
42458
42703
  "server-updated",
42459
42704
  "export-completed",
42460
42705
  "backup-completed",
42706
+ "alert-critical",
42707
+ "alert-error",
42708
+ "alert-critical-resolved",
42461
42709
  "camera-online",
42462
42710
  "camera-offline",
42463
42711
  "camera-disabled",
@@ -44493,202 +44741,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44493
44741
  auth: "admin"
44494
44742
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44495
44743
  /**
44496
- * Zod schemas for persisted record types.
44497
- *
44498
- * These schemas serve as the single source of truth for types that are
44499
- * stored in the settings-store backend and retrieved via tRPC. They
44500
- * replace the manual TypeScript interfaces with schema-derived types,
44501
- * enabling runtime validation when reading from the backend.
44502
- *
44503
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44504
- * keeps the original name for backward compatibility.
44505
- */
44506
- /**
44507
- * Auth model (v2 — 2026-05-12 caps-only):
44508
- *
44509
- * Two principals:
44510
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44511
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44512
- *
44513
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44514
- * `super_admin` — collapsed onto the single boolean because every
44515
- * non-admin caller is governed by the same scope-check rules; the
44516
- * distinction was only ever used to route role-specific procedures
44517
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44518
- * with `isAdmin: false` + an explicit scope list.
44519
- */
44520
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44521
- var MethodAccessSchema = _enum([
44522
- "view",
44523
- "create",
44524
- "delete"
44525
- ]);
44526
- /**
44527
- * A single scope grant. Three forms — checked in matcher with OR
44528
- * semantics; the first match decides whether the call passes:
44529
- *
44530
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44531
- * cap with the matching `scope` declaration. New caps inherit grants
44532
- * automatically — adding a device cap to the codebase makes it
44533
- * reachable to every user with `category:device [...]` without a
44534
- * re-grant. Use this for "family viewer" / "operator" tiers.
44535
- *
44536
- * - `addon` — every cap that ships inside a given addon id. Niche;
44537
- * useful when an integration needs to interact with one specific
44538
- * addon's surface regardless of how many caps it exports.
44539
- *
44540
- * - `capability` — the most precise form. Single cap name. Use for
44541
- * integration tokens where you want to grant `addons.installPackage`
44542
- * and nothing else.
44543
- *
44544
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44545
- * "give me everything" escape; there is no wildcard scope.
44546
- */
44547
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44548
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44549
- var CapScopeSchema = _enum(["device", "system"]);
44550
- /**
44551
- * DeviceSelector (scope model v3 — 2026-08-12).
44552
- *
44553
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44554
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44555
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44556
- * AFTER the grant was minted — no re-grant, no re-login.
44557
- *
44558
- * - `all` — every device in the deployment. The broad viewer/operator
44559
- * lever without a `category` grant (a `category` grant also covers device
44560
- * caps that carry no deviceId; `all` is specifically the device set).
44561
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44562
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44563
- * is NOT covered until the grant is edited.
44564
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44565
- * DYNAMIC. A device that changes type, or a new device of the type,
44566
- * re-resolves on the next request.
44567
- * - `locations` — every device whose operator-assigned `location` label is
44568
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44569
- * null/unset location matches NO `locations` selector.
44570
- */
44571
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44572
- object({ kind: literal("all") }),
44573
- object({
44574
- kind: literal("ids"),
44575
- ids: array(number().int()).min(1)
44576
- }),
44577
- object({
44578
- kind: literal("types"),
44579
- types: array(_enum(DeviceType)).min(1)
44580
- }),
44581
- object({
44582
- kind: literal("locations"),
44583
- locations: array(string().min(1)).min(1)
44584
- })
44585
- ]);
44586
- var DeviceTokenScopeSchema = object({
44587
- type: literal("device"),
44588
- /** The device SET this grant covers — resolved against the live fleet. */
44589
- selector: DeviceSelectorSchema,
44590
- access: array(MethodAccessSchema).min(1),
44591
- /**
44592
- * Whether a grant on a PARENT device transparently covers its accessory
44593
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44594
- * Direction is parent → children ONLY.
44595
- *
44596
- * Absent → the matcher DERIVES it from the access flavour: `view`
44597
- * inherits (a camera viewer sees the camera's accessories), `create` /
44598
- * `delete` do NOT (actuating/removing a child is an explicit act the
44599
- * operator must grant on the child, not inherit from the parent). Set it
44600
- * explicitly to override that default per grant.
44601
- */
44602
- includeLinked: boolean().optional()
44603
- });
44604
- /**
44605
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44606
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44607
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44608
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44609
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44610
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44611
- * migration cannot reach a JWT already in a client's hands; parse-time
44612
- * migration covers both without a flag day. No cast — the raw object is read
44613
- * through `Reflect.get` (its static type is `unknown`).
44614
- */
44615
- function migrateLegacyTokenScope(raw) {
44616
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44617
- if (Reflect.get(raw, "type") !== "device") return raw;
44618
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44619
- const targets = Reflect.get(raw, "targets");
44620
- if (!Array.isArray(targets)) return raw;
44621
- return {
44622
- type: "device",
44623
- selector: {
44624
- kind: "ids",
44625
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44626
- },
44627
- access: Reflect.get(raw, "access")
44628
- };
44629
- }
44630
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44631
- object({
44632
- type: literal("category"),
44633
- target: CapScopeSchema,
44634
- access: array(MethodAccessSchema).min(1)
44635
- }),
44636
- object({
44637
- type: literal("capability"),
44638
- target: string(),
44639
- access: array(MethodAccessSchema).min(1)
44640
- }),
44641
- object({
44642
- type: literal("addon"),
44643
- target: string(),
44644
- access: array(MethodAccessSchema).min(1)
44645
- }),
44646
- DeviceTokenScopeSchema
44647
- ]));
44648
- object({
44649
- id: string(),
44650
- username: string(),
44651
- passwordHash: string(),
44652
- /**
44653
- * Admin bypass. When true, the middleware skips the scope-access
44654
- * check entirely. There is no other axis of privilege; the legacy
44655
- * role enum collapsed onto this boolean in v2.
44656
- */
44657
- isAdmin: boolean().default(false),
44658
- allowedProviders: AllowedProviderSchema,
44659
- allowedDevices: AllowedDevicesSchema,
44660
- /**
44661
- * Scopes granted to this user. Admins bypass; their `scopes` is
44662
- * ignored. Non-admins without scopes are locked out of every
44663
- * protected call.
44664
- */
44665
- scopes: array(TokenScopeSchema).default([]),
44666
- createdAt: number(),
44667
- updatedAt: number()
44668
- });
44669
- object({
44670
- id: string(),
44671
- label: string(),
44672
- isAdmin: boolean().default(false),
44673
- allowedProviders: AllowedProviderSchema,
44674
- allowedDevices: AllowedDevicesSchema,
44675
- tokenHash: string(),
44676
- tokenPrefix: string(),
44677
- createdAt: number(),
44678
- lastUsedAt: number().optional()
44679
- });
44680
- object({
44681
- id: string(),
44682
- userId: string(),
44683
- name: string(),
44684
- tokenHash: string(),
44685
- tokenPrefix: string(),
44686
- scopes: array(TokenScopeSchema),
44687
- expiresAt: number().nullish(),
44688
- lastUsedAt: number().nullish(),
44689
- createdAt: number()
44690
- });
44691
- /**
44692
44744
  * `oauth-integration` — a collection cap by which an addon declares
44693
44745
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44694
44746
  * Each provider returns a static descriptor; the core enumerates them
@@ -51534,7 +51586,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51534
51586
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51535
51587
  kind: "mutation",
51536
51588
  auth: "admin"
51537
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51589
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51590
+ clear: boolean(),
51591
+ repointLocationId: string().optional()
51592
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51538
51593
  kind: "mutation",
51539
51594
  auth: "admin"
51540
51595
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -55807,6 +55862,11 @@ onStatusChanged: { data: object({
55807
55862
  *
55808
55863
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55809
55864
  * provider refreshes the slice on an interval and eagerly after commands.
55865
+ *
55866
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55867
+ * nullable: `null` means "not known right now" (the appliance has not said,
55868
+ * the link is down, or the description does not carry it) and is never
55869
+ * rendered or exported as `false` / `0`. `availability` says why.
55810
55870
  */
55811
55871
  var DishwasherStateSchema = _enum([
55812
55872
  "idle",
@@ -55816,43 +55876,155 @@ var DishwasherStateSchema = _enum([
55816
55876
  "error",
55817
55877
  "unavailable"
55818
55878
  ]);
55879
+ /**
55880
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55881
+ * view for compact surfaces; this is what the appliance said.
55882
+ */
55883
+ var DishwasherOperationStateSchema = _enum([
55884
+ "Inactive",
55885
+ "Ready",
55886
+ "DelayedStart",
55887
+ "Run",
55888
+ "Pause",
55889
+ "ActionRequired",
55890
+ "Finished",
55891
+ "Error",
55892
+ "Aborting"
55893
+ ]);
55894
+ /**
55895
+ * Why fields may be `null`:
55896
+ * - `available` — the link is up and the description is loaded;
55897
+ * - `offline` — the local link is down (values are unknown, not last-known);
55898
+ * - `description-missing` — the link is up but the appliance's description could not
55899
+ * be loaded, so its values cannot be decoded.
55900
+ */
55901
+ var DishwasherAvailabilitySchema = _enum([
55902
+ "available",
55903
+ "offline",
55904
+ "description-missing"
55905
+ ]);
55819
55906
  var DishwasherConsumableLevelSchema = _enum([
55820
55907
  "ok",
55821
55908
  "low",
55822
55909
  "empty"
55823
55910
  ]);
55824
55911
  var DishwasherStatusSchema = object({
55912
+ availability: DishwasherAvailabilitySchema,
55913
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55825
55914
  state: DishwasherStateSchema,
55826
- /** Active program id/name, or null when none selected / unknown. */
55915
+ /** The appliance's operation state as reported; null when not known. */
55916
+ operationState: DishwasherOperationStateSchema.nullable(),
55917
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55827
55918
  program: string().nullable(),
55828
- /** Program tokens the hardware accepts — drives the UI selector. */
55919
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55920
+ selectedProgram: string().nullable(),
55921
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55829
55922
  availablePrograms: array(string()),
55830
- /** Minutes remaining on the active cycle, or null when not running. */
55831
- remainingMinutes: number().int().nonnegative().nullable(),
55923
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55924
+ remainingSeconds: number().int().nonnegative().nullable(),
55925
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55926
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55832
55927
  /** Cycle completion 0..100, or null when not applicable. */
55833
55928
  progressPercent: number().min(0).max(100).nullable(),
55834
- /** True when the door is reported open. */
55835
- doorOpen: boolean(),
55836
- /** True when remote start is allowed (door closed, power on, etc.). */
55837
- remoteStartAllowed: boolean(),
55838
- /** Main power / switched-on state. */
55839
- powerOn: boolean(),
55929
+ /** True when the door is reported open; null when the door state is not known. */
55930
+ doorOpen: boolean().nullable(),
55931
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55932
+ doorLocked: boolean().nullable(),
55933
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55934
+ remoteStartAllowed: boolean().nullable(),
55935
+ /** True when the appliance accepts remote control now; null when not known. */
55936
+ remoteControlActive: boolean().nullable(),
55937
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55938
+ localControlActive: boolean().nullable(),
55939
+ /** Main power / switched-on state; null when not known. */
55940
+ powerOn: boolean().nullable(),
55941
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55942
+ powerState: string().nullable(),
55840
55943
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
55841
55944
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55842
- halfLoad: boolean(),
55843
- hygienePlus: boolean(),
55945
+ /** Option states: null when the appliance does not expose the option or has not said. */
55946
+ halfLoad: boolean().nullable(),
55947
+ hygienePlus: boolean().nullable(),
55844
55948
  /** Extra dry option when the appliance exposes it. */
55845
- extraDry: boolean(),
55949
+ extraDry: boolean().nullable(),
55846
55950
  /** Intensive zone (lower basket) when the appliance exposes it. */
55847
- intensiveZone: boolean(),
55951
+ intensiveZone: boolean().nullable(),
55848
55952
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55849
- varioSpeedPlus: boolean(),
55850
- /** Child lock (controls disabled on the appliance). */
55851
- childLock: boolean(),
55953
+ varioSpeedPlus: boolean().nullable(),
55954
+ /** Child lock (controls disabled on the appliance); null when not known. */
55955
+ childLock: boolean().nullable(),
55956
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55957
+ activeEvents: array(string()),
55958
+ /** Numeric error code when the appliance reports one; null otherwise. */
55852
55959
  errorCode: number().nullable(),
55960
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55853
55961
  errorLabel: string().nullable(),
55962
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55854
55963
  lastFetchedAt: number()
55855
55964
  });
55965
+ var DeviceIdSchema = number().int().nonnegative();
55966
+ /** A value a program option or setting can take. */
55967
+ var DishwasherValueSchema = union([
55968
+ boolean(),
55969
+ string(),
55970
+ number()
55971
+ ]);
55972
+ var DishwasherAccessSchema = _enum([
55973
+ "none",
55974
+ "read",
55975
+ "readWrite",
55976
+ "writeOnly",
55977
+ "readStatic"
55978
+ ]);
55979
+ /**
55980
+ * One option or setting the appliance declares, with the constraints its description
55981
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55982
+ */
55983
+ var DishwasherOptionDescriptorSchema = object({
55984
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55985
+ key: string(),
55986
+ /** Last segment of the key, for display. */
55987
+ name: string(),
55988
+ type: _enum([
55989
+ "boolean",
55990
+ "number",
55991
+ "enum",
55992
+ "string"
55993
+ ]),
55994
+ access: DishwasherAccessSchema,
55995
+ /** The appliance reports this entity as currently available. */
55996
+ available: boolean(),
55997
+ /** Unit the description declares for a number; null when it declares none. */
55998
+ unit: string().nullable(),
55999
+ min: number().nullable(),
56000
+ max: number().nullable(),
56001
+ step: number().nullable(),
56002
+ /** Allowed members of an enum; null for other types. */
56003
+ enumValues: array(string()).nullable(),
56004
+ defaultValue: DishwasherValueSchema.nullable()
56005
+ });
56006
+ var DishwasherProgramSchema = object({
56007
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
56008
+ key: string(),
56009
+ name: string(),
56010
+ /** The appliance currently offers this program. */
56011
+ available: boolean(),
56012
+ /** The options this program lists, with the program-level access / availability / default. */
56013
+ options: array(DishwasherOptionDescriptorSchema)
56014
+ });
56015
+ var DishwasherOptionsSchema = object({
56016
+ availability: DishwasherAvailabilitySchema,
56017
+ /** What the appliance can be told to do, from the commands its description declares. */
56018
+ supportsStart: boolean(),
56019
+ supportsPause: boolean(),
56020
+ supportsResume: boolean(),
56021
+ supportsStop: boolean(),
56022
+ supportsPower: boolean(),
56023
+ /** Every program the description lists, with its options. */
56024
+ programs: array(DishwasherProgramSchema),
56025
+ /** Every option and setting entity the description lists (programs reference these by key). */
56026
+ options: array(DishwasherOptionDescriptorSchema)
56027
+ });
55856
56028
  var dishwasherCapability = {
55857
56029
  name: "dishwasher",
55858
56030
  scope: "device",
@@ -55860,86 +56032,102 @@ var dishwasherCapability = {
55860
56032
  mode: "singleton",
55861
56033
  deviceTypes: [DeviceType.Dishwasher],
55862
56034
  methods: {
55863
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56035
+ /**
56036
+ * Start a program. Without `program` the selected one starts. `options` are
56037
+ * option feature keys; each is checked against the program's constraints.
56038
+ */
56039
+ start: method(object({
56040
+ deviceId: DeviceIdSchema,
56041
+ program: string().min(1).optional(),
56042
+ options: record(string(), DishwasherValueSchema).optional()
56043
+ }), _void(), {
55864
56044
  kind: "mutation",
55865
56045
  auth: "protected"
55866
56046
  }),
55867
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56047
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55868
56048
  kind: "mutation",
55869
56049
  auth: "protected"
55870
56050
  }),
55871
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56051
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
56052
+ kind: "mutation",
56053
+ auth: "protected"
56054
+ }),
56055
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55872
56056
  kind: "mutation",
55873
56057
  auth: "protected"
55874
56058
  }),
56059
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55875
56060
  setProgram: method(object({
55876
- deviceId: number().int().nonnegative(),
56061
+ deviceId: DeviceIdSchema,
55877
56062
  program: string().min(1)
55878
56063
  }), _void(), {
55879
56064
  kind: "mutation",
55880
56065
  auth: "protected"
55881
56066
  }),
55882
56067
  setPower: method(object({
55883
- deviceId: number().int().nonnegative(),
56068
+ deviceId: DeviceIdSchema,
55884
56069
  on: boolean()
55885
56070
  }), _void(), {
55886
56071
  kind: "mutation",
55887
56072
  auth: "protected"
55888
56073
  }),
55889
56074
  setHalfLoad: method(object({
55890
- deviceId: number().int().nonnegative(),
56075
+ deviceId: DeviceIdSchema,
55891
56076
  on: boolean()
55892
56077
  }), _void(), {
55893
56078
  kind: "mutation",
55894
56079
  auth: "protected"
55895
56080
  }),
55896
56081
  setHygienePlus: method(object({
55897
- deviceId: number().int().nonnegative(),
56082
+ deviceId: DeviceIdSchema,
55898
56083
  on: boolean()
55899
56084
  }), _void(), {
55900
56085
  kind: "mutation",
55901
56086
  auth: "protected"
55902
56087
  }),
55903
56088
  setExtraDry: method(object({
55904
- deviceId: number().int().nonnegative(),
56089
+ deviceId: DeviceIdSchema,
55905
56090
  on: boolean()
55906
56091
  }), _void(), {
55907
56092
  kind: "mutation",
55908
56093
  auth: "protected"
55909
56094
  }),
55910
56095
  setIntensiveZone: method(object({
55911
- deviceId: number().int().nonnegative(),
56096
+ deviceId: DeviceIdSchema,
55912
56097
  on: boolean()
55913
56098
  }), _void(), {
55914
56099
  kind: "mutation",
55915
56100
  auth: "protected"
55916
56101
  }),
55917
56102
  setVarioSpeedPlus: method(object({
55918
- deviceId: number().int().nonnegative(),
56103
+ deviceId: DeviceIdSchema,
55919
56104
  on: boolean()
55920
56105
  }), _void(), {
55921
56106
  kind: "mutation",
55922
56107
  auth: "protected"
55923
56108
  }),
55924
56109
  setChildLock: method(object({
55925
- deviceId: number().int().nonnegative(),
56110
+ deviceId: DeviceIdSchema,
55926
56111
  on: boolean()
55927
56112
  }), _void(), {
55928
56113
  kind: "mutation",
55929
56114
  auth: "protected"
55930
56115
  }),
56116
+ /**
56117
+ * Write any option or setting by feature key. Refused when the description does
56118
+ * not list it, it is not writable or not available now, or the value is outside
56119
+ * its declared range / members.
56120
+ */
55931
56121
  setOption: method(object({
55932
- deviceId: number().int().nonnegative(),
56122
+ deviceId: DeviceIdSchema,
55933
56123
  key: string().min(1),
55934
- value: union([
55935
- boolean(),
55936
- string(),
55937
- number()
55938
- ])
56124
+ value: DishwasherValueSchema
55939
56125
  }), _void(), {
55940
56126
  kind: "mutation",
55941
56127
  auth: "protected"
55942
- })
56128
+ }),
56129
+ /** What this appliance can do, from its own description — the UI is derived from it. */
56130
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55943
56131
  },
55944
56132
  status: {
55945
56133
  schema: DishwasherStatusSchema,
@@ -69888,6 +70076,12 @@ Object.freeze({
69888
70076
  addonId: null,
69889
70077
  access: "view"
69890
70078
  },
70079
+ "dishwasher.getOptions": {
70080
+ capName: "dishwasher",
70081
+ capScope: "device",
70082
+ addonId: null,
70083
+ access: "view"
70084
+ },
69891
70085
  "dishwasher.getStatus": {
69892
70086
  capName: "dishwasher",
69893
70087
  capScope: "device",
@@ -69900,6 +70094,12 @@ Object.freeze({
69900
70094
  addonId: null,
69901
70095
  access: "create"
69902
70096
  },
70097
+ "dishwasher.resume": {
70098
+ capName: "dishwasher",
70099
+ capScope: "device",
70100
+ addonId: null,
70101
+ access: "create"
70102
+ },
69903
70103
  "dishwasher.setChildLock": {
69904
70104
  capName: "dishwasher",
69905
70105
  capScope: "device",
@@ -74400,6 +74600,12 @@ Object.freeze({
74400
74600
  addonId: null,
74401
74601
  access: "view"
74402
74602
  },
74603
+ "storageMigration.moverClearance": {
74604
+ capName: "storage-migration",
74605
+ capScope: "system",
74606
+ addonId: null,
74607
+ access: "view"
74608
+ },
74403
74609
  "storageMigration.movers": {
74404
74610
  capName: "storage-migration",
74405
74611
  capScope: "system",
@@ -76593,6 +76799,11 @@ Object.freeze({
76593
76799
  form: "single",
76594
76800
  optional: false
76595
76801
  }],
76802
+ "dishwasher.getOptions": [{
76803
+ name: "deviceId",
76804
+ form: "single",
76805
+ optional: false
76806
+ }],
76596
76807
  "dishwasher.getStatus": [{
76597
76808
  name: "deviceId",
76598
76809
  form: "single",
@@ -76603,6 +76814,11 @@ Object.freeze({
76603
76814
  form: "single",
76604
76815
  optional: false
76605
76816
  }],
76817
+ "dishwasher.resume": [{
76818
+ name: "deviceId",
76819
+ form: "single",
76820
+ optional: false
76821
+ }],
76606
76822
  "dishwasher.setChildLock": [{
76607
76823
  name: "deviceId",
76608
76824
  form: "single",
@@ -78689,6 +78905,9 @@ new Map(Object.entries({
78689
78905
  "wrapper-update-available": "system",
78690
78906
  "backup-completed": "system",
78691
78907
  "export-completed": "system",
78908
+ "alert-critical": "system",
78909
+ "alert-error": "system",
78910
+ "alert-critical-resolved": "system",
78692
78911
  "storage-location-low": "system",
78693
78912
  "storage-location-critical": "system",
78694
78913
  "storage-location-ok": "system",
@@ -78813,6 +79032,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
78813
79032
  "storage-location-ok"
78814
79033
  ]
78815
79034
  },
79035
+ {
79036
+ id: "alerts",
79037
+ family: "system",
79038
+ label: "Alerts",
79039
+ kinds: [
79040
+ "alert-critical",
79041
+ "alert-error",
79042
+ "alert-critical-resolved"
79043
+ ]
79044
+ },
78816
79045
  {
78817
79046
  id: "alarm",
78818
79047
  family: "alarm",
@@ -78857,6 +79086,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
78857
79086
  return [[descriptor.kind, field]];
78858
79087
  })));
78859
79088
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
79089
+ object({
79090
+ phase: _enum(["raised", "resolved"]),
79091
+ episodeId: string().min(1),
79092
+ alertId: string().min(1),
79093
+ severity: AlertSeveritySchema,
79094
+ category: string(),
79095
+ title: string(),
79096
+ message: string(),
79097
+ sourceType: string().optional(),
79098
+ sourceId: string().optional(),
79099
+ nodeId: string().optional(),
79100
+ /** The alert's own action link (where the operator acts on it), when it has one. */
79101
+ actionUrl: string().optional(),
79102
+ at: number()
79103
+ });
78860
79104
  var RULE_BODY_ONLY = ["body"];
78861
79105
  var RULE_TEXT = ["title", "body"];
78862
79106
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -78866,6 +79110,11 @@ var TANK = [
78866
79110
  "device-tank-full",
78867
79111
  "device-tank-normal"
78868
79112
  ];
79113
+ var ALERT_EPISODE = [
79114
+ "alert-critical",
79115
+ "alert-error",
79116
+ "alert-critical-resolved"
79117
+ ];
78869
79118
  var UPDATES = [
78870
79119
  "addon-update-available",
78871
79120
  "server-update-available",
@@ -79058,14 +79307,14 @@ var STATE_SUMMARY_VARS = [
79058
79307
  ([...RULE_TEXT], [...CONSUMABLE]),
79059
79308
  ([...RULE_TEXT], [...TANK]),
79060
79309
  [...RULE_TEXT],
79061
- ([...RULE_TEXT], [...UPDATES]),
79062
- ([...RULE_TEXT], [...UPDATES]),
79063
- [...RULE_TEXT],
79310
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79311
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79064
79312
  [...RULE_TEXT],
79065
79313
  [...RULE_TEXT],
79066
79314
  [...RULE_TEXT],
79067
79315
  [...RULE_TEXT],
79068
79316
  [...RULE_TEXT],
79317
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79069
79318
  [...RULE_TEXT],
79070
79319
  [...RULE_TEXT],
79071
79320
  [...RULE_TEXT],
@@ -79083,7 +79332,11 @@ var STATE_SUMMARY_VARS = [
79083
79332
  [...RULE_TEXT],
79084
79333
  [...RULE_TEXT],
79085
79334
  [...RULE_TEXT],
79086
- [...RULE_TEXT],
79335
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79336
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79337
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79338
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79339
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79087
79340
  [...RULE_TEXT],
79088
79341
  [...RULE_TEXT],
79089
79342
  [...RULE_TEXT],