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