@camstack/addon-provider-mqtt-ha 0.1.6 → 0.1.8

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
@@ -34,7 +34,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
36
36
  //#endregion
37
- //#region ../types/dist/event-category-BvOFi6PY.mjs
37
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
38
38
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
39
39
  EventCategory["SystemBoot"] = "system.boot";
40
40
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -113,9 +113,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
113
113
  /**
114
114
  * The node's one-shot runner boot check (D877): planned runners against the
115
115
  * process service, `degraded` when any is failed, refused or missing. The
116
- * alert centre turns it into one alert and a direct critical push.
116
+ * alert centre turns it into one critical alert.
117
117
  */
118
118
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
119
+ /**
120
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
121
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
122
+ * centre sends no notification of its own: Notification Center turns this
123
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
124
+ * system-event kinds, and reconciles from the alerts store because a bus
125
+ * event may be dropped (D8, D11).
126
+ */
127
+ EventCategory["AlertEpisode"] = "alert.episode";
119
128
  EventCategory["AddonError"] = "addon.error";
120
129
  EventCategory["AddonPageReady"] = "addon.page-ready";
121
130
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5440,7 +5449,7 @@ var ZodIssueCode = {
5440
5449
  var ZodFirstPartyTypeKind;
5441
5450
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5442
5451
  //#endregion
5443
- //#region ../types/dist/sleep-BegKjwUu.mjs
5452
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5444
5453
  /**
5445
5454
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5446
5455
  * window to float samples (D455).
@@ -7822,6 +7831,12 @@ function normalizeAddonInitResult(result) {
7822
7831
  if (Array.isArray(result)) return { providers: result };
7823
7832
  return result;
7824
7833
  }
7834
+ /**
7835
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7836
+ * and validates them (`share-token.service.ts` builds its enum from this
7837
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7838
+ */
7839
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7825
7840
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7826
7841
  var PeerBytesTicketSchema = object({
7827
7842
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12487,6 +12502,229 @@ var ConvertResultSchema = object({
12487
12502
  files: array(string()).readonly()
12488
12503
  })).readonly()
12489
12504
  });
12505
+ /**
12506
+ * Zod schemas for persisted record types.
12507
+ *
12508
+ * These schemas serve as the single source of truth for types that are
12509
+ * stored in the settings-store backend and retrieved via tRPC. They
12510
+ * replace the manual TypeScript interfaces with schema-derived types,
12511
+ * enabling runtime validation when reading from the backend.
12512
+ *
12513
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12514
+ * keeps the original name for backward compatibility.
12515
+ */
12516
+ /**
12517
+ * Auth model (v2 — 2026-05-12 caps-only):
12518
+ *
12519
+ * Two principals:
12520
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12521
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12522
+ *
12523
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12524
+ * `super_admin` — collapsed onto the single boolean because every
12525
+ * non-admin caller is governed by the same scope-check rules; the
12526
+ * distinction was only ever used to route role-specific procedures
12527
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12528
+ * with `isAdmin: false` + an explicit scope list.
12529
+ */
12530
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12531
+ var MethodAccessSchema = _enum([
12532
+ "view",
12533
+ "create",
12534
+ "delete"
12535
+ ]);
12536
+ /**
12537
+ * A single scope grant. Three forms — checked in matcher with OR
12538
+ * semantics; the first match decides whether the call passes:
12539
+ *
12540
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12541
+ * cap with the matching `scope` declaration. New caps inherit grants
12542
+ * automatically — adding a device cap to the codebase makes it
12543
+ * reachable to every user with `category:device [...]` without a
12544
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12545
+ *
12546
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12547
+ * useful when an integration needs to interact with one specific
12548
+ * addon's surface regardless of how many caps it exports.
12549
+ *
12550
+ * - `capability` — the most precise form. Single cap name. Use for
12551
+ * integration tokens where you want to grant `addons.installPackage`
12552
+ * and nothing else.
12553
+ *
12554
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12555
+ * "give me everything" escape; there is no wildcard scope.
12556
+ */
12557
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12558
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12559
+ var CapScopeSchema = _enum(["device", "system"]);
12560
+ /**
12561
+ * DeviceSelector (scope model v3 — 2026-08-12).
12562
+ *
12563
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12564
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12565
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12566
+ * AFTER the grant was minted — no re-grant, no re-login.
12567
+ *
12568
+ * - `all` — every device in the deployment. The broad viewer/operator
12569
+ * lever without a `category` grant (a `category` grant also covers device
12570
+ * caps that carry no deviceId; `all` is specifically the device set).
12571
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12572
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12573
+ * is NOT covered until the grant is edited.
12574
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12575
+ * DYNAMIC. A device that changes type, or a new device of the type,
12576
+ * re-resolves on the next request.
12577
+ * - `locations` — every device whose operator-assigned `location` label is
12578
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12579
+ * null/unset location matches NO `locations` selector.
12580
+ */
12581
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12582
+ object({ kind: literal("all") }),
12583
+ object({
12584
+ kind: literal("ids"),
12585
+ ids: array(number().int()).min(1)
12586
+ }),
12587
+ object({
12588
+ kind: literal("types"),
12589
+ types: array(_enum(DeviceType)).min(1)
12590
+ }),
12591
+ object({
12592
+ kind: literal("locations"),
12593
+ locations: array(string().min(1)).min(1)
12594
+ })
12595
+ ]);
12596
+ var DeviceTokenScopeSchema = object({
12597
+ type: literal("device"),
12598
+ /** The device SET this grant covers — resolved against the live fleet. */
12599
+ selector: DeviceSelectorSchema,
12600
+ access: array(MethodAccessSchema).min(1),
12601
+ /**
12602
+ * Whether a grant on a PARENT device transparently covers its accessory
12603
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12604
+ * Direction is parent → children ONLY.
12605
+ *
12606
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12607
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12608
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12609
+ * operator must grant on the child, not inherit from the parent). Set it
12610
+ * explicitly to override that default per grant.
12611
+ */
12612
+ includeLinked: boolean().optional()
12613
+ });
12614
+ /**
12615
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12616
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12617
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12618
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12619
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12620
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12621
+ * migration cannot reach a JWT already in a client's hands; parse-time
12622
+ * migration covers both without a flag day. No cast — the raw object is read
12623
+ * through `Reflect.get` (its static type is `unknown`).
12624
+ */
12625
+ function migrateLegacyTokenScope(raw) {
12626
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12627
+ if (Reflect.get(raw, "type") !== "device") return raw;
12628
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12629
+ const targets = Reflect.get(raw, "targets");
12630
+ if (!Array.isArray(targets)) return raw;
12631
+ return {
12632
+ type: "device",
12633
+ selector: {
12634
+ kind: "ids",
12635
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12636
+ },
12637
+ access: Reflect.get(raw, "access")
12638
+ };
12639
+ }
12640
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12641
+ object({
12642
+ type: literal("category"),
12643
+ target: CapScopeSchema,
12644
+ access: array(MethodAccessSchema).min(1)
12645
+ }),
12646
+ object({
12647
+ type: literal("capability"),
12648
+ target: string(),
12649
+ access: array(MethodAccessSchema).min(1)
12650
+ }),
12651
+ object({
12652
+ type: literal("addon"),
12653
+ target: string(),
12654
+ access: array(MethodAccessSchema).min(1)
12655
+ }),
12656
+ DeviceTokenScopeSchema
12657
+ ]));
12658
+ object({
12659
+ id: string(),
12660
+ username: string(),
12661
+ passwordHash: string(),
12662
+ /**
12663
+ * Admin bypass. When true, the middleware skips the scope-access
12664
+ * check entirely. There is no other axis of privilege; the legacy
12665
+ * role enum collapsed onto this boolean in v2.
12666
+ */
12667
+ isAdmin: boolean().default(false),
12668
+ allowedProviders: AllowedProviderSchema,
12669
+ allowedDevices: AllowedDevicesSchema,
12670
+ /**
12671
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12672
+ * ignored. Non-admins without scopes are locked out of every
12673
+ * protected call.
12674
+ */
12675
+ scopes: array(TokenScopeSchema).default([]),
12676
+ createdAt: number(),
12677
+ updatedAt: number()
12678
+ });
12679
+ object({
12680
+ id: string(),
12681
+ label: string(),
12682
+ isAdmin: boolean().default(false),
12683
+ allowedProviders: AllowedProviderSchema,
12684
+ allowedDevices: AllowedDevicesSchema,
12685
+ tokenHash: string(),
12686
+ tokenPrefix: string(),
12687
+ createdAt: number(),
12688
+ lastUsedAt: number().optional()
12689
+ });
12690
+ object({
12691
+ id: string(),
12692
+ userId: string(),
12693
+ name: string(),
12694
+ tokenHash: string(),
12695
+ tokenPrefix: string(),
12696
+ scopes: array(TokenScopeSchema),
12697
+ expiresAt: number().nullish(),
12698
+ lastUsedAt: number().nullish(),
12699
+ createdAt: number()
12700
+ });
12701
+ /** What a share-view grant lets its holder see. */
12702
+ var ShareViewGrantSchema = object({
12703
+ kind: _enum(SHARE_VIEW_KINDS),
12704
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
12705
+ /** Talk-back, opt-in at mint time; absent means off. */
12706
+ talk: boolean().optional()
12707
+ });
12708
+ var ShareViewScopeSchema = object({
12709
+ type: literal("share-view"),
12710
+ grant: ShareViewGrantSchema
12711
+ });
12712
+ var AddonRoutesScopeSchema = object({
12713
+ type: literal("addon-routes"),
12714
+ access: array(MethodAccessSchema).min(1)
12715
+ });
12716
+ var CredentialScopeSchema = union([
12717
+ literal("*"),
12718
+ ShareViewScopeSchema,
12719
+ AddonRoutesScopeSchema,
12720
+ TokenScopeSchema
12721
+ ]);
12722
+ object({
12723
+ kind: literal("credential"),
12724
+ sub: string().min(1),
12725
+ jti: string().min(16),
12726
+ scopes: array(CredentialScopeSchema).min(1)
12727
+ });
12490
12728
  _enum(["new-session", "step-up"]);
12491
12729
  /** The languages the hub's app landing pages are written in (D858). */
12492
12730
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13203,7 +13441,14 @@ var AlertSeveritySchema = _enum([
13203
13441
  ]);
13204
13442
  var AlertActionSchema = object({
13205
13443
  label: string(),
13206
- href: string().optional()
13444
+ href: string().optional(),
13445
+ /**
13446
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13447
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13448
+ * start) — the browser must leave the SPA with a full navigation, because
13449
+ * the SPA has no such route and would bounce to the home page.
13450
+ */
13451
+ navigation: _enum(["app", "server"]).optional()
13207
13452
  });
13208
13453
  var AlertStatusSchema = _enum([
13209
13454
  "active",
@@ -41936,6 +42181,9 @@ var NcSystemEventKindSchema = _enum([
41936
42181
  "server-updated",
41937
42182
  "export-completed",
41938
42183
  "backup-completed",
42184
+ "alert-critical",
42185
+ "alert-error",
42186
+ "alert-critical-resolved",
41939
42187
  "camera-online",
41940
42188
  "camera-offline",
41941
42189
  "camera-disabled",
@@ -43971,202 +44219,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
43971
44219
  auth: "admin"
43972
44220
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
43973
44221
  /**
43974
- * Zod schemas for persisted record types.
43975
- *
43976
- * These schemas serve as the single source of truth for types that are
43977
- * stored in the settings-store backend and retrieved via tRPC. They
43978
- * replace the manual TypeScript interfaces with schema-derived types,
43979
- * enabling runtime validation when reading from the backend.
43980
- *
43981
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
43982
- * keeps the original name for backward compatibility.
43983
- */
43984
- /**
43985
- * Auth model (v2 — 2026-05-12 caps-only):
43986
- *
43987
- * Two principals:
43988
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
43989
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
43990
- *
43991
- * No role enum. There used to be `viewer / agent / scoped` and earlier
43992
- * `super_admin` — collapsed onto the single boolean because every
43993
- * non-admin caller is governed by the same scope-check rules; the
43994
- * distinction was only ever used to route role-specific procedures
43995
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
43996
- * with `isAdmin: false` + an explicit scope list.
43997
- */
43998
- /** Per-method access flavour. Materialised on every cap method via codegen. */
43999
- var MethodAccessSchema = _enum([
44000
- "view",
44001
- "create",
44002
- "delete"
44003
- ]);
44004
- /**
44005
- * A single scope grant. Three forms — checked in matcher with OR
44006
- * semantics; the first match decides whether the call passes:
44007
- *
44008
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44009
- * cap with the matching `scope` declaration. New caps inherit grants
44010
- * automatically — adding a device cap to the codebase makes it
44011
- * reachable to every user with `category:device [...]` without a
44012
- * re-grant. Use this for "family viewer" / "operator" tiers.
44013
- *
44014
- * - `addon` — every cap that ships inside a given addon id. Niche;
44015
- * useful when an integration needs to interact with one specific
44016
- * addon's surface regardless of how many caps it exports.
44017
- *
44018
- * - `capability` — the most precise form. Single cap name. Use for
44019
- * integration tokens where you want to grant `addons.installPackage`
44020
- * and nothing else.
44021
- *
44022
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44023
- * "give me everything" escape; there is no wildcard scope.
44024
- */
44025
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44026
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44027
- var CapScopeSchema = _enum(["device", "system"]);
44028
- /**
44029
- * DeviceSelector (scope model v3 — 2026-08-12).
44030
- *
44031
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44032
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44033
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44034
- * AFTER the grant was minted — no re-grant, no re-login.
44035
- *
44036
- * - `all` — every device in the deployment. The broad viewer/operator
44037
- * lever without a `category` grant (a `category` grant also covers device
44038
- * caps that carry no deviceId; `all` is specifically the device set).
44039
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44040
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44041
- * is NOT covered until the grant is edited.
44042
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44043
- * DYNAMIC. A device that changes type, or a new device of the type,
44044
- * re-resolves on the next request.
44045
- * - `locations` — every device whose operator-assigned `location` label is
44046
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44047
- * null/unset location matches NO `locations` selector.
44048
- */
44049
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44050
- object({ kind: literal("all") }),
44051
- object({
44052
- kind: literal("ids"),
44053
- ids: array(number().int()).min(1)
44054
- }),
44055
- object({
44056
- kind: literal("types"),
44057
- types: array(_enum(DeviceType)).min(1)
44058
- }),
44059
- object({
44060
- kind: literal("locations"),
44061
- locations: array(string().min(1)).min(1)
44062
- })
44063
- ]);
44064
- var DeviceTokenScopeSchema = object({
44065
- type: literal("device"),
44066
- /** The device SET this grant covers — resolved against the live fleet. */
44067
- selector: DeviceSelectorSchema,
44068
- access: array(MethodAccessSchema).min(1),
44069
- /**
44070
- * Whether a grant on a PARENT device transparently covers its accessory
44071
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44072
- * Direction is parent → children ONLY.
44073
- *
44074
- * Absent → the matcher DERIVES it from the access flavour: `view`
44075
- * inherits (a camera viewer sees the camera's accessories), `create` /
44076
- * `delete` do NOT (actuating/removing a child is an explicit act the
44077
- * operator must grant on the child, not inherit from the parent). Set it
44078
- * explicitly to override that default per grant.
44079
- */
44080
- includeLinked: boolean().optional()
44081
- });
44082
- /**
44083
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44084
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44085
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44086
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44087
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44088
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44089
- * migration cannot reach a JWT already in a client's hands; parse-time
44090
- * migration covers both without a flag day. No cast — the raw object is read
44091
- * through `Reflect.get` (its static type is `unknown`).
44092
- */
44093
- function migrateLegacyTokenScope(raw) {
44094
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44095
- if (Reflect.get(raw, "type") !== "device") return raw;
44096
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44097
- const targets = Reflect.get(raw, "targets");
44098
- if (!Array.isArray(targets)) return raw;
44099
- return {
44100
- type: "device",
44101
- selector: {
44102
- kind: "ids",
44103
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44104
- },
44105
- access: Reflect.get(raw, "access")
44106
- };
44107
- }
44108
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44109
- object({
44110
- type: literal("category"),
44111
- target: CapScopeSchema,
44112
- access: array(MethodAccessSchema).min(1)
44113
- }),
44114
- object({
44115
- type: literal("capability"),
44116
- target: string(),
44117
- access: array(MethodAccessSchema).min(1)
44118
- }),
44119
- object({
44120
- type: literal("addon"),
44121
- target: string(),
44122
- access: array(MethodAccessSchema).min(1)
44123
- }),
44124
- DeviceTokenScopeSchema
44125
- ]));
44126
- object({
44127
- id: string(),
44128
- username: string(),
44129
- passwordHash: string(),
44130
- /**
44131
- * Admin bypass. When true, the middleware skips the scope-access
44132
- * check entirely. There is no other axis of privilege; the legacy
44133
- * role enum collapsed onto this boolean in v2.
44134
- */
44135
- isAdmin: boolean().default(false),
44136
- allowedProviders: AllowedProviderSchema,
44137
- allowedDevices: AllowedDevicesSchema,
44138
- /**
44139
- * Scopes granted to this user. Admins bypass; their `scopes` is
44140
- * ignored. Non-admins without scopes are locked out of every
44141
- * protected call.
44142
- */
44143
- scopes: array(TokenScopeSchema).default([]),
44144
- createdAt: number(),
44145
- updatedAt: number()
44146
- });
44147
- object({
44148
- id: string(),
44149
- label: string(),
44150
- isAdmin: boolean().default(false),
44151
- allowedProviders: AllowedProviderSchema,
44152
- allowedDevices: AllowedDevicesSchema,
44153
- tokenHash: string(),
44154
- tokenPrefix: string(),
44155
- createdAt: number(),
44156
- lastUsedAt: number().optional()
44157
- });
44158
- object({
44159
- id: string(),
44160
- userId: string(),
44161
- name: string(),
44162
- tokenHash: string(),
44163
- tokenPrefix: string(),
44164
- scopes: array(TokenScopeSchema),
44165
- expiresAt: number().nullish(),
44166
- lastUsedAt: number().nullish(),
44167
- createdAt: number()
44168
- });
44169
- /**
44170
44222
  * `oauth-integration` — a collection cap by which an addon declares
44171
44223
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44172
44224
  * Each provider returns a static descriptor; the core enumerates them
@@ -51012,7 +51064,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51012
51064
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51013
51065
  kind: "mutation",
51014
51066
  auth: "admin"
51015
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51067
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51068
+ clear: boolean(),
51069
+ repointLocationId: string().optional()
51070
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51016
51071
  kind: "mutation",
51017
51072
  auth: "admin"
51018
51073
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -55268,6 +55323,11 @@ onStatusChanged: { data: object({
55268
55323
  *
55269
55324
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55270
55325
  * provider refreshes the slice on an interval and eagerly after commands.
55326
+ *
55327
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55328
+ * nullable: `null` means "not known right now" (the appliance has not said,
55329
+ * the link is down, or the description does not carry it) and is never
55330
+ * rendered or exported as `false` / `0`. `availability` says why.
55271
55331
  */
55272
55332
  var DishwasherStateSchema = _enum([
55273
55333
  "idle",
@@ -55277,43 +55337,155 @@ var DishwasherStateSchema = _enum([
55277
55337
  "error",
55278
55338
  "unavailable"
55279
55339
  ]);
55340
+ /**
55341
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55342
+ * view for compact surfaces; this is what the appliance said.
55343
+ */
55344
+ var DishwasherOperationStateSchema = _enum([
55345
+ "Inactive",
55346
+ "Ready",
55347
+ "DelayedStart",
55348
+ "Run",
55349
+ "Pause",
55350
+ "ActionRequired",
55351
+ "Finished",
55352
+ "Error",
55353
+ "Aborting"
55354
+ ]);
55355
+ /**
55356
+ * Why fields may be `null`:
55357
+ * - `available` — the link is up and the description is loaded;
55358
+ * - `offline` — the local link is down (values are unknown, not last-known);
55359
+ * - `description-missing` — the link is up but the appliance's description could not
55360
+ * be loaded, so its values cannot be decoded.
55361
+ */
55362
+ var DishwasherAvailabilitySchema = _enum([
55363
+ "available",
55364
+ "offline",
55365
+ "description-missing"
55366
+ ]);
55280
55367
  var DishwasherConsumableLevelSchema = _enum([
55281
55368
  "ok",
55282
55369
  "low",
55283
55370
  "empty"
55284
55371
  ]);
55285
55372
  var DishwasherStatusSchema = object({
55373
+ availability: DishwasherAvailabilitySchema,
55374
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55286
55375
  state: DishwasherStateSchema,
55287
- /** Active program id/name, or null when none selected / unknown. */
55376
+ /** The appliance's operation state as reported; null when not known. */
55377
+ operationState: DishwasherOperationStateSchema.nullable(),
55378
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55288
55379
  program: string().nullable(),
55289
- /** Program tokens the hardware accepts — drives the UI selector. */
55380
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55381
+ selectedProgram: string().nullable(),
55382
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55290
55383
  availablePrograms: array(string()),
55291
- /** Minutes remaining on the active cycle, or null when not running. */
55292
- remainingMinutes: number().int().nonnegative().nullable(),
55384
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55385
+ remainingSeconds: number().int().nonnegative().nullable(),
55386
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55387
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55293
55388
  /** Cycle completion 0..100, or null when not applicable. */
55294
55389
  progressPercent: number().min(0).max(100).nullable(),
55295
- /** True when the door is reported open. */
55296
- doorOpen: boolean(),
55297
- /** True when remote start is allowed (door closed, power on, etc.). */
55298
- remoteStartAllowed: boolean(),
55299
- /** Main power / switched-on state. */
55300
- powerOn: boolean(),
55390
+ /** True when the door is reported open; null when the door state is not known. */
55391
+ doorOpen: boolean().nullable(),
55392
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55393
+ doorLocked: boolean().nullable(),
55394
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55395
+ remoteStartAllowed: boolean().nullable(),
55396
+ /** True when the appliance accepts remote control now; null when not known. */
55397
+ remoteControlActive: boolean().nullable(),
55398
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55399
+ localControlActive: boolean().nullable(),
55400
+ /** Main power / switched-on state; null when not known. */
55401
+ powerOn: boolean().nullable(),
55402
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55403
+ powerState: string().nullable(),
55301
55404
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
55302
55405
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55303
- halfLoad: boolean(),
55304
- hygienePlus: boolean(),
55406
+ /** Option states: null when the appliance does not expose the option or has not said. */
55407
+ halfLoad: boolean().nullable(),
55408
+ hygienePlus: boolean().nullable(),
55305
55409
  /** Extra dry option when the appliance exposes it. */
55306
- extraDry: boolean(),
55410
+ extraDry: boolean().nullable(),
55307
55411
  /** Intensive zone (lower basket) when the appliance exposes it. */
55308
- intensiveZone: boolean(),
55412
+ intensiveZone: boolean().nullable(),
55309
55413
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55310
- varioSpeedPlus: boolean(),
55311
- /** Child lock (controls disabled on the appliance). */
55312
- childLock: boolean(),
55414
+ varioSpeedPlus: boolean().nullable(),
55415
+ /** Child lock (controls disabled on the appliance); null when not known. */
55416
+ childLock: boolean().nullable(),
55417
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55418
+ activeEvents: array(string()),
55419
+ /** Numeric error code when the appliance reports one; null otherwise. */
55313
55420
  errorCode: number().nullable(),
55421
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55314
55422
  errorLabel: string().nullable(),
55423
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55315
55424
  lastFetchedAt: number()
55316
55425
  });
55426
+ var DeviceIdSchema = number().int().nonnegative();
55427
+ /** A value a program option or setting can take. */
55428
+ var DishwasherValueSchema = union([
55429
+ boolean(),
55430
+ string(),
55431
+ number()
55432
+ ]);
55433
+ var DishwasherAccessSchema = _enum([
55434
+ "none",
55435
+ "read",
55436
+ "readWrite",
55437
+ "writeOnly",
55438
+ "readStatic"
55439
+ ]);
55440
+ /**
55441
+ * One option or setting the appliance declares, with the constraints its description
55442
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55443
+ */
55444
+ var DishwasherOptionDescriptorSchema = object({
55445
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55446
+ key: string(),
55447
+ /** Last segment of the key, for display. */
55448
+ name: string(),
55449
+ type: _enum([
55450
+ "boolean",
55451
+ "number",
55452
+ "enum",
55453
+ "string"
55454
+ ]),
55455
+ access: DishwasherAccessSchema,
55456
+ /** The appliance reports this entity as currently available. */
55457
+ available: boolean(),
55458
+ /** Unit the description declares for a number; null when it declares none. */
55459
+ unit: string().nullable(),
55460
+ min: number().nullable(),
55461
+ max: number().nullable(),
55462
+ step: number().nullable(),
55463
+ /** Allowed members of an enum; null for other types. */
55464
+ enumValues: array(string()).nullable(),
55465
+ defaultValue: DishwasherValueSchema.nullable()
55466
+ });
55467
+ var DishwasherProgramSchema = object({
55468
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
55469
+ key: string(),
55470
+ name: string(),
55471
+ /** The appliance currently offers this program. */
55472
+ available: boolean(),
55473
+ /** The options this program lists, with the program-level access / availability / default. */
55474
+ options: array(DishwasherOptionDescriptorSchema)
55475
+ });
55476
+ var DishwasherOptionsSchema = object({
55477
+ availability: DishwasherAvailabilitySchema,
55478
+ /** What the appliance can be told to do, from the commands its description declares. */
55479
+ supportsStart: boolean(),
55480
+ supportsPause: boolean(),
55481
+ supportsResume: boolean(),
55482
+ supportsStop: boolean(),
55483
+ supportsPower: boolean(),
55484
+ /** Every program the description lists, with its options. */
55485
+ programs: array(DishwasherProgramSchema),
55486
+ /** Every option and setting entity the description lists (programs reference these by key). */
55487
+ options: array(DishwasherOptionDescriptorSchema)
55488
+ });
55317
55489
  var dishwasherCapability = {
55318
55490
  name: "dishwasher",
55319
55491
  scope: "device",
@@ -55321,86 +55493,102 @@ var dishwasherCapability = {
55321
55493
  mode: "singleton",
55322
55494
  deviceTypes: [DeviceType.Dishwasher],
55323
55495
  methods: {
55324
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55496
+ /**
55497
+ * Start a program. Without `program` the selected one starts. `options` are
55498
+ * option feature keys; each is checked against the program's constraints.
55499
+ */
55500
+ start: method(object({
55501
+ deviceId: DeviceIdSchema,
55502
+ program: string().min(1).optional(),
55503
+ options: record(string(), DishwasherValueSchema).optional()
55504
+ }), _void(), {
55325
55505
  kind: "mutation",
55326
55506
  auth: "protected"
55327
55507
  }),
55328
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55508
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55329
55509
  kind: "mutation",
55330
55510
  auth: "protected"
55331
55511
  }),
55332
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55512
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
55513
+ kind: "mutation",
55514
+ auth: "protected"
55515
+ }),
55516
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55333
55517
  kind: "mutation",
55334
55518
  auth: "protected"
55335
55519
  }),
55520
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55336
55521
  setProgram: method(object({
55337
- deviceId: number().int().nonnegative(),
55522
+ deviceId: DeviceIdSchema,
55338
55523
  program: string().min(1)
55339
55524
  }), _void(), {
55340
55525
  kind: "mutation",
55341
55526
  auth: "protected"
55342
55527
  }),
55343
55528
  setPower: method(object({
55344
- deviceId: number().int().nonnegative(),
55529
+ deviceId: DeviceIdSchema,
55345
55530
  on: boolean()
55346
55531
  }), _void(), {
55347
55532
  kind: "mutation",
55348
55533
  auth: "protected"
55349
55534
  }),
55350
55535
  setHalfLoad: method(object({
55351
- deviceId: number().int().nonnegative(),
55536
+ deviceId: DeviceIdSchema,
55352
55537
  on: boolean()
55353
55538
  }), _void(), {
55354
55539
  kind: "mutation",
55355
55540
  auth: "protected"
55356
55541
  }),
55357
55542
  setHygienePlus: method(object({
55358
- deviceId: number().int().nonnegative(),
55543
+ deviceId: DeviceIdSchema,
55359
55544
  on: boolean()
55360
55545
  }), _void(), {
55361
55546
  kind: "mutation",
55362
55547
  auth: "protected"
55363
55548
  }),
55364
55549
  setExtraDry: method(object({
55365
- deviceId: number().int().nonnegative(),
55550
+ deviceId: DeviceIdSchema,
55366
55551
  on: boolean()
55367
55552
  }), _void(), {
55368
55553
  kind: "mutation",
55369
55554
  auth: "protected"
55370
55555
  }),
55371
55556
  setIntensiveZone: method(object({
55372
- deviceId: number().int().nonnegative(),
55557
+ deviceId: DeviceIdSchema,
55373
55558
  on: boolean()
55374
55559
  }), _void(), {
55375
55560
  kind: "mutation",
55376
55561
  auth: "protected"
55377
55562
  }),
55378
55563
  setVarioSpeedPlus: method(object({
55379
- deviceId: number().int().nonnegative(),
55564
+ deviceId: DeviceIdSchema,
55380
55565
  on: boolean()
55381
55566
  }), _void(), {
55382
55567
  kind: "mutation",
55383
55568
  auth: "protected"
55384
55569
  }),
55385
55570
  setChildLock: method(object({
55386
- deviceId: number().int().nonnegative(),
55571
+ deviceId: DeviceIdSchema,
55387
55572
  on: boolean()
55388
55573
  }), _void(), {
55389
55574
  kind: "mutation",
55390
55575
  auth: "protected"
55391
55576
  }),
55577
+ /**
55578
+ * Write any option or setting by feature key. Refused when the description does
55579
+ * not list it, it is not writable or not available now, or the value is outside
55580
+ * its declared range / members.
55581
+ */
55392
55582
  setOption: method(object({
55393
- deviceId: number().int().nonnegative(),
55583
+ deviceId: DeviceIdSchema,
55394
55584
  key: string().min(1),
55395
- value: union([
55396
- boolean(),
55397
- string(),
55398
- number()
55399
- ])
55585
+ value: DishwasherValueSchema
55400
55586
  }), _void(), {
55401
55587
  kind: "mutation",
55402
55588
  auth: "protected"
55403
- })
55589
+ }),
55590
+ /** What this appliance can do, from its own description — the UI is derived from it. */
55591
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55404
55592
  },
55405
55593
  status: {
55406
55594
  schema: DishwasherStatusSchema,
@@ -69349,6 +69537,12 @@ Object.freeze({
69349
69537
  addonId: null,
69350
69538
  access: "view"
69351
69539
  },
69540
+ "dishwasher.getOptions": {
69541
+ capName: "dishwasher",
69542
+ capScope: "device",
69543
+ addonId: null,
69544
+ access: "view"
69545
+ },
69352
69546
  "dishwasher.getStatus": {
69353
69547
  capName: "dishwasher",
69354
69548
  capScope: "device",
@@ -69361,6 +69555,12 @@ Object.freeze({
69361
69555
  addonId: null,
69362
69556
  access: "create"
69363
69557
  },
69558
+ "dishwasher.resume": {
69559
+ capName: "dishwasher",
69560
+ capScope: "device",
69561
+ addonId: null,
69562
+ access: "create"
69563
+ },
69364
69564
  "dishwasher.setChildLock": {
69365
69565
  capName: "dishwasher",
69366
69566
  capScope: "device",
@@ -73861,6 +74061,12 @@ Object.freeze({
73861
74061
  addonId: null,
73862
74062
  access: "view"
73863
74063
  },
74064
+ "storageMigration.moverClearance": {
74065
+ capName: "storage-migration",
74066
+ capScope: "system",
74067
+ addonId: null,
74068
+ access: "view"
74069
+ },
73864
74070
  "storageMigration.movers": {
73865
74071
  capName: "storage-migration",
73866
74072
  capScope: "system",
@@ -76054,6 +76260,11 @@ Object.freeze({
76054
76260
  form: "single",
76055
76261
  optional: false
76056
76262
  }],
76263
+ "dishwasher.getOptions": [{
76264
+ name: "deviceId",
76265
+ form: "single",
76266
+ optional: false
76267
+ }],
76057
76268
  "dishwasher.getStatus": [{
76058
76269
  name: "deviceId",
76059
76270
  form: "single",
@@ -76064,6 +76275,11 @@ Object.freeze({
76064
76275
  form: "single",
76065
76276
  optional: false
76066
76277
  }],
76278
+ "dishwasher.resume": [{
76279
+ name: "deviceId",
76280
+ form: "single",
76281
+ optional: false
76282
+ }],
76067
76283
  "dishwasher.setChildLock": [{
76068
76284
  name: "deviceId",
76069
76285
  form: "single",
@@ -78150,6 +78366,9 @@ new Map(Object.entries({
78150
78366
  "wrapper-update-available": "system",
78151
78367
  "backup-completed": "system",
78152
78368
  "export-completed": "system",
78369
+ "alert-critical": "system",
78370
+ "alert-error": "system",
78371
+ "alert-critical-resolved": "system",
78153
78372
  "storage-location-low": "system",
78154
78373
  "storage-location-critical": "system",
78155
78374
  "storage-location-ok": "system",
@@ -78274,6 +78493,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
78274
78493
  "storage-location-ok"
78275
78494
  ]
78276
78495
  },
78496
+ {
78497
+ id: "alerts",
78498
+ family: "system",
78499
+ label: "Alerts",
78500
+ kinds: [
78501
+ "alert-critical",
78502
+ "alert-error",
78503
+ "alert-critical-resolved"
78504
+ ]
78505
+ },
78277
78506
  {
78278
78507
  id: "alarm",
78279
78508
  family: "alarm",
@@ -78318,6 +78547,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
78318
78547
  return [[descriptor.kind, field]];
78319
78548
  })));
78320
78549
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
78550
+ object({
78551
+ phase: _enum(["raised", "resolved"]),
78552
+ episodeId: string().min(1),
78553
+ alertId: string().min(1),
78554
+ severity: AlertSeveritySchema,
78555
+ category: string(),
78556
+ title: string(),
78557
+ message: string(),
78558
+ sourceType: string().optional(),
78559
+ sourceId: string().optional(),
78560
+ nodeId: string().optional(),
78561
+ /** The alert's own action link (where the operator acts on it), when it has one. */
78562
+ actionUrl: string().optional(),
78563
+ at: number()
78564
+ });
78321
78565
  var RULE_BODY_ONLY = ["body"];
78322
78566
  var RULE_TEXT = ["title", "body"];
78323
78567
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -78327,6 +78571,11 @@ var TANK = [
78327
78571
  "device-tank-full",
78328
78572
  "device-tank-normal"
78329
78573
  ];
78574
+ var ALERT_EPISODE = [
78575
+ "alert-critical",
78576
+ "alert-error",
78577
+ "alert-critical-resolved"
78578
+ ];
78330
78579
  var UPDATES = [
78331
78580
  "addon-update-available",
78332
78581
  "server-update-available",
@@ -78519,14 +78768,14 @@ var STATE_SUMMARY_VARS = [
78519
78768
  ([...RULE_TEXT], [...CONSUMABLE]),
78520
78769
  ([...RULE_TEXT], [...TANK]),
78521
78770
  [...RULE_TEXT],
78522
- ([...RULE_TEXT], [...UPDATES]),
78523
- ([...RULE_TEXT], [...UPDATES]),
78524
- [...RULE_TEXT],
78771
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78772
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78525
78773
  [...RULE_TEXT],
78526
78774
  [...RULE_TEXT],
78527
78775
  [...RULE_TEXT],
78528
78776
  [...RULE_TEXT],
78529
78777
  [...RULE_TEXT],
78778
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78530
78779
  [...RULE_TEXT],
78531
78780
  [...RULE_TEXT],
78532
78781
  [...RULE_TEXT],
@@ -78544,7 +78793,11 @@ var STATE_SUMMARY_VARS = [
78544
78793
  [...RULE_TEXT],
78545
78794
  [...RULE_TEXT],
78546
78795
  [...RULE_TEXT],
78547
- [...RULE_TEXT],
78796
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78797
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78798
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78799
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78800
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78548
78801
  [...RULE_TEXT],
78549
78802
  [...RULE_TEXT],
78550
78803
  [...RULE_TEXT],