@camstack/addon-provider-velux 0.2.128 → 0.2.130

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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-BvOFi6PY.mjs
2
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -78,9 +78,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
78
78
  /**
79
79
  * The node's one-shot runner boot check (D877): planned runners against the
80
80
  * process service, `degraded` when any is failed, refused or missing. The
81
- * alert centre turns it into one alert and a direct critical push.
81
+ * alert centre turns it into one critical alert.
82
82
  */
83
83
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
84
+ /**
85
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
86
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
87
+ * centre sends no notification of its own: Notification Center turns this
88
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
89
+ * system-event kinds, and reconciles from the alerts store because a bus
90
+ * event may be dropped (D8, D11).
91
+ */
92
+ EventCategory["AlertEpisode"] = "alert.episode";
84
93
  EventCategory["AddonError"] = "addon.error";
85
94
  EventCategory["AddonPageReady"] = "addon.page-ready";
86
95
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5405,7 +5414,7 @@ var ZodIssueCode = {
5405
5414
  var ZodFirstPartyTypeKind;
5406
5415
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5407
5416
  //#endregion
5408
- //#region ../types/dist/sleep-BegKjwUu.mjs
5417
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5409
5418
  /**
5410
5419
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5411
5420
  * window to float samples (D455).
@@ -7787,6 +7796,12 @@ function normalizeAddonInitResult(result) {
7787
7796
  if (Array.isArray(result)) return { providers: result };
7788
7797
  return result;
7789
7798
  }
7799
+ /**
7800
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7801
+ * and validates them (`share-token.service.ts` builds its enum from this
7802
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7803
+ */
7804
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7790
7805
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7791
7806
  var PeerBytesTicketSchema = object({
7792
7807
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12466,6 +12481,229 @@ var ConvertResultSchema = object({
12466
12481
  files: array(string()).readonly()
12467
12482
  })).readonly()
12468
12483
  });
12484
+ /**
12485
+ * Zod schemas for persisted record types.
12486
+ *
12487
+ * These schemas serve as the single source of truth for types that are
12488
+ * stored in the settings-store backend and retrieved via tRPC. They
12489
+ * replace the manual TypeScript interfaces with schema-derived types,
12490
+ * enabling runtime validation when reading from the backend.
12491
+ *
12492
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12493
+ * keeps the original name for backward compatibility.
12494
+ */
12495
+ /**
12496
+ * Auth model (v2 — 2026-05-12 caps-only):
12497
+ *
12498
+ * Two principals:
12499
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12500
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12501
+ *
12502
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12503
+ * `super_admin` — collapsed onto the single boolean because every
12504
+ * non-admin caller is governed by the same scope-check rules; the
12505
+ * distinction was only ever used to route role-specific procedures
12506
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12507
+ * with `isAdmin: false` + an explicit scope list.
12508
+ */
12509
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12510
+ var MethodAccessSchema = _enum([
12511
+ "view",
12512
+ "create",
12513
+ "delete"
12514
+ ]);
12515
+ /**
12516
+ * A single scope grant. Three forms — checked in matcher with OR
12517
+ * semantics; the first match decides whether the call passes:
12518
+ *
12519
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12520
+ * cap with the matching `scope` declaration. New caps inherit grants
12521
+ * automatically — adding a device cap to the codebase makes it
12522
+ * reachable to every user with `category:device [...]` without a
12523
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12524
+ *
12525
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12526
+ * useful when an integration needs to interact with one specific
12527
+ * addon's surface regardless of how many caps it exports.
12528
+ *
12529
+ * - `capability` — the most precise form. Single cap name. Use for
12530
+ * integration tokens where you want to grant `addons.installPackage`
12531
+ * and nothing else.
12532
+ *
12533
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12534
+ * "give me everything" escape; there is no wildcard scope.
12535
+ */
12536
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12537
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12538
+ var CapScopeSchema = _enum(["device", "system"]);
12539
+ /**
12540
+ * DeviceSelector (scope model v3 — 2026-08-12).
12541
+ *
12542
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12543
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12544
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12545
+ * AFTER the grant was minted — no re-grant, no re-login.
12546
+ *
12547
+ * - `all` — every device in the deployment. The broad viewer/operator
12548
+ * lever without a `category` grant (a `category` grant also covers device
12549
+ * caps that carry no deviceId; `all` is specifically the device set).
12550
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12551
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12552
+ * is NOT covered until the grant is edited.
12553
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12554
+ * DYNAMIC. A device that changes type, or a new device of the type,
12555
+ * re-resolves on the next request.
12556
+ * - `locations` — every device whose operator-assigned `location` label is
12557
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12558
+ * null/unset location matches NO `locations` selector.
12559
+ */
12560
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12561
+ object({ kind: literal("all") }),
12562
+ object({
12563
+ kind: literal("ids"),
12564
+ ids: array(number().int()).min(1)
12565
+ }),
12566
+ object({
12567
+ kind: literal("types"),
12568
+ types: array(_enum(DeviceType)).min(1)
12569
+ }),
12570
+ object({
12571
+ kind: literal("locations"),
12572
+ locations: array(string().min(1)).min(1)
12573
+ })
12574
+ ]);
12575
+ var DeviceTokenScopeSchema = object({
12576
+ type: literal("device"),
12577
+ /** The device SET this grant covers — resolved against the live fleet. */
12578
+ selector: DeviceSelectorSchema,
12579
+ access: array(MethodAccessSchema).min(1),
12580
+ /**
12581
+ * Whether a grant on a PARENT device transparently covers its accessory
12582
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12583
+ * Direction is parent → children ONLY.
12584
+ *
12585
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12586
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12587
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12588
+ * operator must grant on the child, not inherit from the parent). Set it
12589
+ * explicitly to override that default per grant.
12590
+ */
12591
+ includeLinked: boolean().optional()
12592
+ });
12593
+ /**
12594
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12595
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12596
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12597
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12598
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12599
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12600
+ * migration cannot reach a JWT already in a client's hands; parse-time
12601
+ * migration covers both without a flag day. No cast — the raw object is read
12602
+ * through `Reflect.get` (its static type is `unknown`).
12603
+ */
12604
+ function migrateLegacyTokenScope(raw) {
12605
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12606
+ if (Reflect.get(raw, "type") !== "device") return raw;
12607
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12608
+ const targets = Reflect.get(raw, "targets");
12609
+ if (!Array.isArray(targets)) return raw;
12610
+ return {
12611
+ type: "device",
12612
+ selector: {
12613
+ kind: "ids",
12614
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12615
+ },
12616
+ access: Reflect.get(raw, "access")
12617
+ };
12618
+ }
12619
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12620
+ object({
12621
+ type: literal("category"),
12622
+ target: CapScopeSchema,
12623
+ access: array(MethodAccessSchema).min(1)
12624
+ }),
12625
+ object({
12626
+ type: literal("capability"),
12627
+ target: string(),
12628
+ access: array(MethodAccessSchema).min(1)
12629
+ }),
12630
+ object({
12631
+ type: literal("addon"),
12632
+ target: string(),
12633
+ access: array(MethodAccessSchema).min(1)
12634
+ }),
12635
+ DeviceTokenScopeSchema
12636
+ ]));
12637
+ object({
12638
+ id: string(),
12639
+ username: string(),
12640
+ passwordHash: string(),
12641
+ /**
12642
+ * Admin bypass. When true, the middleware skips the scope-access
12643
+ * check entirely. There is no other axis of privilege; the legacy
12644
+ * role enum collapsed onto this boolean in v2.
12645
+ */
12646
+ isAdmin: boolean().default(false),
12647
+ allowedProviders: AllowedProviderSchema,
12648
+ allowedDevices: AllowedDevicesSchema,
12649
+ /**
12650
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12651
+ * ignored. Non-admins without scopes are locked out of every
12652
+ * protected call.
12653
+ */
12654
+ scopes: array(TokenScopeSchema).default([]),
12655
+ createdAt: number(),
12656
+ updatedAt: number()
12657
+ });
12658
+ object({
12659
+ id: string(),
12660
+ label: string(),
12661
+ isAdmin: boolean().default(false),
12662
+ allowedProviders: AllowedProviderSchema,
12663
+ allowedDevices: AllowedDevicesSchema,
12664
+ tokenHash: string(),
12665
+ tokenPrefix: string(),
12666
+ createdAt: number(),
12667
+ lastUsedAt: number().optional()
12668
+ });
12669
+ object({
12670
+ id: string(),
12671
+ userId: string(),
12672
+ name: string(),
12673
+ tokenHash: string(),
12674
+ tokenPrefix: string(),
12675
+ scopes: array(TokenScopeSchema),
12676
+ expiresAt: number().nullish(),
12677
+ lastUsedAt: number().nullish(),
12678
+ createdAt: number()
12679
+ });
12680
+ /** What a share-view grant lets its holder see. */
12681
+ var ShareViewGrantSchema = object({
12682
+ kind: _enum(SHARE_VIEW_KINDS),
12683
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
12684
+ /** Talk-back, opt-in at mint time; absent means off. */
12685
+ talk: boolean().optional()
12686
+ });
12687
+ var ShareViewScopeSchema = object({
12688
+ type: literal("share-view"),
12689
+ grant: ShareViewGrantSchema
12690
+ });
12691
+ var AddonRoutesScopeSchema = object({
12692
+ type: literal("addon-routes"),
12693
+ access: array(MethodAccessSchema).min(1)
12694
+ });
12695
+ var CredentialScopeSchema = union([
12696
+ literal("*"),
12697
+ ShareViewScopeSchema,
12698
+ AddonRoutesScopeSchema,
12699
+ TokenScopeSchema
12700
+ ]);
12701
+ object({
12702
+ kind: literal("credential"),
12703
+ sub: string().min(1),
12704
+ jti: string().min(16),
12705
+ scopes: array(CredentialScopeSchema).min(1)
12706
+ });
12469
12707
  _enum(["new-session", "step-up"]);
12470
12708
  /** The languages the hub's app landing pages are written in (D858). */
12471
12709
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13182,7 +13420,14 @@ var AlertSeveritySchema = _enum([
13182
13420
  ]);
13183
13421
  var AlertActionSchema = object({
13184
13422
  label: string(),
13185
- href: string().optional()
13423
+ href: string().optional(),
13424
+ /**
13425
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13426
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13427
+ * start) — the browser must leave the SPA with a full navigation, because
13428
+ * the SPA has no such route and would bounce to the home page.
13429
+ */
13430
+ navigation: _enum(["app", "server"]).optional()
13186
13431
  });
13187
13432
  var AlertStatusSchema = _enum([
13188
13433
  "active",
@@ -42011,6 +42256,9 @@ var NcSystemEventKindSchema = _enum([
42011
42256
  "server-updated",
42012
42257
  "export-completed",
42013
42258
  "backup-completed",
42259
+ "alert-critical",
42260
+ "alert-error",
42261
+ "alert-critical-resolved",
42014
42262
  "camera-online",
42015
42263
  "camera-offline",
42016
42264
  "camera-disabled",
@@ -44046,202 +44294,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44046
44294
  auth: "admin"
44047
44295
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44048
44296
  /**
44049
- * Zod schemas for persisted record types.
44050
- *
44051
- * These schemas serve as the single source of truth for types that are
44052
- * stored in the settings-store backend and retrieved via tRPC. They
44053
- * replace the manual TypeScript interfaces with schema-derived types,
44054
- * enabling runtime validation when reading from the backend.
44055
- *
44056
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44057
- * keeps the original name for backward compatibility.
44058
- */
44059
- /**
44060
- * Auth model (v2 — 2026-05-12 caps-only):
44061
- *
44062
- * Two principals:
44063
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44064
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44065
- *
44066
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44067
- * `super_admin` — collapsed onto the single boolean because every
44068
- * non-admin caller is governed by the same scope-check rules; the
44069
- * distinction was only ever used to route role-specific procedures
44070
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44071
- * with `isAdmin: false` + an explicit scope list.
44072
- */
44073
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44074
- var MethodAccessSchema = _enum([
44075
- "view",
44076
- "create",
44077
- "delete"
44078
- ]);
44079
- /**
44080
- * A single scope grant. Three forms — checked in matcher with OR
44081
- * semantics; the first match decides whether the call passes:
44082
- *
44083
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44084
- * cap with the matching `scope` declaration. New caps inherit grants
44085
- * automatically — adding a device cap to the codebase makes it
44086
- * reachable to every user with `category:device [...]` without a
44087
- * re-grant. Use this for "family viewer" / "operator" tiers.
44088
- *
44089
- * - `addon` — every cap that ships inside a given addon id. Niche;
44090
- * useful when an integration needs to interact with one specific
44091
- * addon's surface regardless of how many caps it exports.
44092
- *
44093
- * - `capability` — the most precise form. Single cap name. Use for
44094
- * integration tokens where you want to grant `addons.installPackage`
44095
- * and nothing else.
44096
- *
44097
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44098
- * "give me everything" escape; there is no wildcard scope.
44099
- */
44100
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44101
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44102
- var CapScopeSchema = _enum(["device", "system"]);
44103
- /**
44104
- * DeviceSelector (scope model v3 — 2026-08-12).
44105
- *
44106
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44107
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44108
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44109
- * AFTER the grant was minted — no re-grant, no re-login.
44110
- *
44111
- * - `all` — every device in the deployment. The broad viewer/operator
44112
- * lever without a `category` grant (a `category` grant also covers device
44113
- * caps that carry no deviceId; `all` is specifically the device set).
44114
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44115
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44116
- * is NOT covered until the grant is edited.
44117
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44118
- * DYNAMIC. A device that changes type, or a new device of the type,
44119
- * re-resolves on the next request.
44120
- * - `locations` — every device whose operator-assigned `location` label is
44121
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44122
- * null/unset location matches NO `locations` selector.
44123
- */
44124
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44125
- object({ kind: literal("all") }),
44126
- object({
44127
- kind: literal("ids"),
44128
- ids: array(number().int()).min(1)
44129
- }),
44130
- object({
44131
- kind: literal("types"),
44132
- types: array(_enum(DeviceType)).min(1)
44133
- }),
44134
- object({
44135
- kind: literal("locations"),
44136
- locations: array(string().min(1)).min(1)
44137
- })
44138
- ]);
44139
- var DeviceTokenScopeSchema = object({
44140
- type: literal("device"),
44141
- /** The device SET this grant covers — resolved against the live fleet. */
44142
- selector: DeviceSelectorSchema,
44143
- access: array(MethodAccessSchema).min(1),
44144
- /**
44145
- * Whether a grant on a PARENT device transparently covers its accessory
44146
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44147
- * Direction is parent → children ONLY.
44148
- *
44149
- * Absent → the matcher DERIVES it from the access flavour: `view`
44150
- * inherits (a camera viewer sees the camera's accessories), `create` /
44151
- * `delete` do NOT (actuating/removing a child is an explicit act the
44152
- * operator must grant on the child, not inherit from the parent). Set it
44153
- * explicitly to override that default per grant.
44154
- */
44155
- includeLinked: boolean().optional()
44156
- });
44157
- /**
44158
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44159
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44160
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44161
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44162
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44163
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44164
- * migration cannot reach a JWT already in a client's hands; parse-time
44165
- * migration covers both without a flag day. No cast — the raw object is read
44166
- * through `Reflect.get` (its static type is `unknown`).
44167
- */
44168
- function migrateLegacyTokenScope(raw) {
44169
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44170
- if (Reflect.get(raw, "type") !== "device") return raw;
44171
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44172
- const targets = Reflect.get(raw, "targets");
44173
- if (!Array.isArray(targets)) return raw;
44174
- return {
44175
- type: "device",
44176
- selector: {
44177
- kind: "ids",
44178
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44179
- },
44180
- access: Reflect.get(raw, "access")
44181
- };
44182
- }
44183
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44184
- object({
44185
- type: literal("category"),
44186
- target: CapScopeSchema,
44187
- access: array(MethodAccessSchema).min(1)
44188
- }),
44189
- object({
44190
- type: literal("capability"),
44191
- target: string(),
44192
- access: array(MethodAccessSchema).min(1)
44193
- }),
44194
- object({
44195
- type: literal("addon"),
44196
- target: string(),
44197
- access: array(MethodAccessSchema).min(1)
44198
- }),
44199
- DeviceTokenScopeSchema
44200
- ]));
44201
- object({
44202
- id: string(),
44203
- username: string(),
44204
- passwordHash: string(),
44205
- /**
44206
- * Admin bypass. When true, the middleware skips the scope-access
44207
- * check entirely. There is no other axis of privilege; the legacy
44208
- * role enum collapsed onto this boolean in v2.
44209
- */
44210
- isAdmin: boolean().default(false),
44211
- allowedProviders: AllowedProviderSchema,
44212
- allowedDevices: AllowedDevicesSchema,
44213
- /**
44214
- * Scopes granted to this user. Admins bypass; their `scopes` is
44215
- * ignored. Non-admins without scopes are locked out of every
44216
- * protected call.
44217
- */
44218
- scopes: array(TokenScopeSchema).default([]),
44219
- createdAt: number(),
44220
- updatedAt: number()
44221
- });
44222
- object({
44223
- id: string(),
44224
- label: string(),
44225
- isAdmin: boolean().default(false),
44226
- allowedProviders: AllowedProviderSchema,
44227
- allowedDevices: AllowedDevicesSchema,
44228
- tokenHash: string(),
44229
- tokenPrefix: string(),
44230
- createdAt: number(),
44231
- lastUsedAt: number().optional()
44232
- });
44233
- object({
44234
- id: string(),
44235
- userId: string(),
44236
- name: string(),
44237
- tokenHash: string(),
44238
- tokenPrefix: string(),
44239
- scopes: array(TokenScopeSchema),
44240
- expiresAt: number().nullish(),
44241
- lastUsedAt: number().nullish(),
44242
- createdAt: number()
44243
- });
44244
- /**
44245
44297
  * `oauth-integration` — a collection cap by which an addon declares
44246
44298
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44247
44299
  * Each provider returns a static descriptor; the core enumerates them
@@ -51087,7 +51139,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51087
51139
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51088
51140
  kind: "mutation",
51089
51141
  auth: "admin"
51090
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51142
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51143
+ clear: boolean(),
51144
+ repointLocationId: string().optional()
51145
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51091
51146
  kind: "mutation",
51092
51147
  auth: "admin"
51093
51148
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -55343,6 +55398,11 @@ onStatusChanged: { data: object({
55343
55398
  *
55344
55399
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55345
55400
  * provider refreshes the slice on an interval and eagerly after commands.
55401
+ *
55402
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55403
+ * nullable: `null` means "not known right now" (the appliance has not said,
55404
+ * the link is down, or the description does not carry it) and is never
55405
+ * rendered or exported as `false` / `0`. `availability` says why.
55346
55406
  */
55347
55407
  var DishwasherStateSchema = _enum([
55348
55408
  "idle",
@@ -55352,43 +55412,155 @@ var DishwasherStateSchema = _enum([
55352
55412
  "error",
55353
55413
  "unavailable"
55354
55414
  ]);
55415
+ /**
55416
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55417
+ * view for compact surfaces; this is what the appliance said.
55418
+ */
55419
+ var DishwasherOperationStateSchema = _enum([
55420
+ "Inactive",
55421
+ "Ready",
55422
+ "DelayedStart",
55423
+ "Run",
55424
+ "Pause",
55425
+ "ActionRequired",
55426
+ "Finished",
55427
+ "Error",
55428
+ "Aborting"
55429
+ ]);
55430
+ /**
55431
+ * Why fields may be `null`:
55432
+ * - `available` — the link is up and the description is loaded;
55433
+ * - `offline` — the local link is down (values are unknown, not last-known);
55434
+ * - `description-missing` — the link is up but the appliance's description could not
55435
+ * be loaded, so its values cannot be decoded.
55436
+ */
55437
+ var DishwasherAvailabilitySchema = _enum([
55438
+ "available",
55439
+ "offline",
55440
+ "description-missing"
55441
+ ]);
55355
55442
  var DishwasherConsumableLevelSchema = _enum([
55356
55443
  "ok",
55357
55444
  "low",
55358
55445
  "empty"
55359
55446
  ]);
55360
55447
  var DishwasherStatusSchema = object({
55448
+ availability: DishwasherAvailabilitySchema,
55449
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55361
55450
  state: DishwasherStateSchema,
55362
- /** Active program id/name, or null when none selected / unknown. */
55451
+ /** The appliance's operation state as reported; null when not known. */
55452
+ operationState: DishwasherOperationStateSchema.nullable(),
55453
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55363
55454
  program: string().nullable(),
55364
- /** Program tokens the hardware accepts — drives the UI selector. */
55455
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55456
+ selectedProgram: string().nullable(),
55457
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55365
55458
  availablePrograms: array(string()),
55366
- /** Minutes remaining on the active cycle, or null when not running. */
55367
- remainingMinutes: number().int().nonnegative().nullable(),
55459
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55460
+ remainingSeconds: number().int().nonnegative().nullable(),
55461
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55462
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55368
55463
  /** Cycle completion 0..100, or null when not applicable. */
55369
55464
  progressPercent: number().min(0).max(100).nullable(),
55370
- /** True when the door is reported open. */
55371
- doorOpen: boolean(),
55372
- /** True when remote start is allowed (door closed, power on, etc.). */
55373
- remoteStartAllowed: boolean(),
55374
- /** Main power / switched-on state. */
55375
- powerOn: boolean(),
55465
+ /** True when the door is reported open; null when the door state is not known. */
55466
+ doorOpen: boolean().nullable(),
55467
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55468
+ doorLocked: boolean().nullable(),
55469
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55470
+ remoteStartAllowed: boolean().nullable(),
55471
+ /** True when the appliance accepts remote control now; null when not known. */
55472
+ remoteControlActive: boolean().nullable(),
55473
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55474
+ localControlActive: boolean().nullable(),
55475
+ /** Main power / switched-on state; null when not known. */
55476
+ powerOn: boolean().nullable(),
55477
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55478
+ powerState: string().nullable(),
55376
55479
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
55377
55480
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55378
- halfLoad: boolean(),
55379
- hygienePlus: boolean(),
55481
+ /** Option states: null when the appliance does not expose the option or has not said. */
55482
+ halfLoad: boolean().nullable(),
55483
+ hygienePlus: boolean().nullable(),
55380
55484
  /** Extra dry option when the appliance exposes it. */
55381
- extraDry: boolean(),
55485
+ extraDry: boolean().nullable(),
55382
55486
  /** Intensive zone (lower basket) when the appliance exposes it. */
55383
- intensiveZone: boolean(),
55487
+ intensiveZone: boolean().nullable(),
55384
55488
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55385
- varioSpeedPlus: boolean(),
55386
- /** Child lock (controls disabled on the appliance). */
55387
- childLock: boolean(),
55489
+ varioSpeedPlus: boolean().nullable(),
55490
+ /** Child lock (controls disabled on the appliance); null when not known. */
55491
+ childLock: boolean().nullable(),
55492
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55493
+ activeEvents: array(string()),
55494
+ /** Numeric error code when the appliance reports one; null otherwise. */
55388
55495
  errorCode: number().nullable(),
55496
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55389
55497
  errorLabel: string().nullable(),
55498
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55390
55499
  lastFetchedAt: number()
55391
55500
  });
55501
+ var DeviceIdSchema = number().int().nonnegative();
55502
+ /** A value a program option or setting can take. */
55503
+ var DishwasherValueSchema = union([
55504
+ boolean(),
55505
+ string(),
55506
+ number()
55507
+ ]);
55508
+ var DishwasherAccessSchema = _enum([
55509
+ "none",
55510
+ "read",
55511
+ "readWrite",
55512
+ "writeOnly",
55513
+ "readStatic"
55514
+ ]);
55515
+ /**
55516
+ * One option or setting the appliance declares, with the constraints its description
55517
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55518
+ */
55519
+ var DishwasherOptionDescriptorSchema = object({
55520
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55521
+ key: string(),
55522
+ /** Last segment of the key, for display. */
55523
+ name: string(),
55524
+ type: _enum([
55525
+ "boolean",
55526
+ "number",
55527
+ "enum",
55528
+ "string"
55529
+ ]),
55530
+ access: DishwasherAccessSchema,
55531
+ /** The appliance reports this entity as currently available. */
55532
+ available: boolean(),
55533
+ /** Unit the description declares for a number; null when it declares none. */
55534
+ unit: string().nullable(),
55535
+ min: number().nullable(),
55536
+ max: number().nullable(),
55537
+ step: number().nullable(),
55538
+ /** Allowed members of an enum; null for other types. */
55539
+ enumValues: array(string()).nullable(),
55540
+ defaultValue: DishwasherValueSchema.nullable()
55541
+ });
55542
+ var DishwasherProgramSchema = object({
55543
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
55544
+ key: string(),
55545
+ name: string(),
55546
+ /** The appliance currently offers this program. */
55547
+ available: boolean(),
55548
+ /** The options this program lists, with the program-level access / availability / default. */
55549
+ options: array(DishwasherOptionDescriptorSchema)
55550
+ });
55551
+ var DishwasherOptionsSchema = object({
55552
+ availability: DishwasherAvailabilitySchema,
55553
+ /** What the appliance can be told to do, from the commands its description declares. */
55554
+ supportsStart: boolean(),
55555
+ supportsPause: boolean(),
55556
+ supportsResume: boolean(),
55557
+ supportsStop: boolean(),
55558
+ supportsPower: boolean(),
55559
+ /** Every program the description lists, with its options. */
55560
+ programs: array(DishwasherProgramSchema),
55561
+ /** Every option and setting entity the description lists (programs reference these by key). */
55562
+ options: array(DishwasherOptionDescriptorSchema)
55563
+ });
55392
55564
  var dishwasherCapability = {
55393
55565
  name: "dishwasher",
55394
55566
  scope: "device",
@@ -55396,86 +55568,102 @@ var dishwasherCapability = {
55396
55568
  mode: "singleton",
55397
55569
  deviceTypes: [DeviceType.Dishwasher],
55398
55570
  methods: {
55399
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55571
+ /**
55572
+ * Start a program. Without `program` the selected one starts. `options` are
55573
+ * option feature keys; each is checked against the program's constraints.
55574
+ */
55575
+ start: method(object({
55576
+ deviceId: DeviceIdSchema,
55577
+ program: string().min(1).optional(),
55578
+ options: record(string(), DishwasherValueSchema).optional()
55579
+ }), _void(), {
55400
55580
  kind: "mutation",
55401
55581
  auth: "protected"
55402
55582
  }),
55403
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55583
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55404
55584
  kind: "mutation",
55405
55585
  auth: "protected"
55406
55586
  }),
55407
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55587
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
55588
+ kind: "mutation",
55589
+ auth: "protected"
55590
+ }),
55591
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55408
55592
  kind: "mutation",
55409
55593
  auth: "protected"
55410
55594
  }),
55595
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55411
55596
  setProgram: method(object({
55412
- deviceId: number().int().nonnegative(),
55597
+ deviceId: DeviceIdSchema,
55413
55598
  program: string().min(1)
55414
55599
  }), _void(), {
55415
55600
  kind: "mutation",
55416
55601
  auth: "protected"
55417
55602
  }),
55418
55603
  setPower: method(object({
55419
- deviceId: number().int().nonnegative(),
55604
+ deviceId: DeviceIdSchema,
55420
55605
  on: boolean()
55421
55606
  }), _void(), {
55422
55607
  kind: "mutation",
55423
55608
  auth: "protected"
55424
55609
  }),
55425
55610
  setHalfLoad: method(object({
55426
- deviceId: number().int().nonnegative(),
55611
+ deviceId: DeviceIdSchema,
55427
55612
  on: boolean()
55428
55613
  }), _void(), {
55429
55614
  kind: "mutation",
55430
55615
  auth: "protected"
55431
55616
  }),
55432
55617
  setHygienePlus: method(object({
55433
- deviceId: number().int().nonnegative(),
55618
+ deviceId: DeviceIdSchema,
55434
55619
  on: boolean()
55435
55620
  }), _void(), {
55436
55621
  kind: "mutation",
55437
55622
  auth: "protected"
55438
55623
  }),
55439
55624
  setExtraDry: method(object({
55440
- deviceId: number().int().nonnegative(),
55625
+ deviceId: DeviceIdSchema,
55441
55626
  on: boolean()
55442
55627
  }), _void(), {
55443
55628
  kind: "mutation",
55444
55629
  auth: "protected"
55445
55630
  }),
55446
55631
  setIntensiveZone: method(object({
55447
- deviceId: number().int().nonnegative(),
55632
+ deviceId: DeviceIdSchema,
55448
55633
  on: boolean()
55449
55634
  }), _void(), {
55450
55635
  kind: "mutation",
55451
55636
  auth: "protected"
55452
55637
  }),
55453
55638
  setVarioSpeedPlus: method(object({
55454
- deviceId: number().int().nonnegative(),
55639
+ deviceId: DeviceIdSchema,
55455
55640
  on: boolean()
55456
55641
  }), _void(), {
55457
55642
  kind: "mutation",
55458
55643
  auth: "protected"
55459
55644
  }),
55460
55645
  setChildLock: method(object({
55461
- deviceId: number().int().nonnegative(),
55646
+ deviceId: DeviceIdSchema,
55462
55647
  on: boolean()
55463
55648
  }), _void(), {
55464
55649
  kind: "mutation",
55465
55650
  auth: "protected"
55466
55651
  }),
55652
+ /**
55653
+ * Write any option or setting by feature key. Refused when the description does
55654
+ * not list it, it is not writable or not available now, or the value is outside
55655
+ * its declared range / members.
55656
+ */
55467
55657
  setOption: method(object({
55468
- deviceId: number().int().nonnegative(),
55658
+ deviceId: DeviceIdSchema,
55469
55659
  key: string().min(1),
55470
- value: union([
55471
- boolean(),
55472
- string(),
55473
- number()
55474
- ])
55660
+ value: DishwasherValueSchema
55475
55661
  }), _void(), {
55476
55662
  kind: "mutation",
55477
55663
  auth: "protected"
55478
- })
55664
+ }),
55665
+ /** What this appliance can do, from its own description — the UI is derived from it. */
55666
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55479
55667
  },
55480
55668
  status: {
55481
55669
  schema: DishwasherStatusSchema,
@@ -69424,6 +69612,12 @@ Object.freeze({
69424
69612
  addonId: null,
69425
69613
  access: "view"
69426
69614
  },
69615
+ "dishwasher.getOptions": {
69616
+ capName: "dishwasher",
69617
+ capScope: "device",
69618
+ addonId: null,
69619
+ access: "view"
69620
+ },
69427
69621
  "dishwasher.getStatus": {
69428
69622
  capName: "dishwasher",
69429
69623
  capScope: "device",
@@ -69436,6 +69630,12 @@ Object.freeze({
69436
69630
  addonId: null,
69437
69631
  access: "create"
69438
69632
  },
69633
+ "dishwasher.resume": {
69634
+ capName: "dishwasher",
69635
+ capScope: "device",
69636
+ addonId: null,
69637
+ access: "create"
69638
+ },
69439
69639
  "dishwasher.setChildLock": {
69440
69640
  capName: "dishwasher",
69441
69641
  capScope: "device",
@@ -73936,6 +74136,12 @@ Object.freeze({
73936
74136
  addonId: null,
73937
74137
  access: "view"
73938
74138
  },
74139
+ "storageMigration.moverClearance": {
74140
+ capName: "storage-migration",
74141
+ capScope: "system",
74142
+ addonId: null,
74143
+ access: "view"
74144
+ },
73939
74145
  "storageMigration.movers": {
73940
74146
  capName: "storage-migration",
73941
74147
  capScope: "system",
@@ -76129,6 +76335,11 @@ Object.freeze({
76129
76335
  form: "single",
76130
76336
  optional: false
76131
76337
  }],
76338
+ "dishwasher.getOptions": [{
76339
+ name: "deviceId",
76340
+ form: "single",
76341
+ optional: false
76342
+ }],
76132
76343
  "dishwasher.getStatus": [{
76133
76344
  name: "deviceId",
76134
76345
  form: "single",
@@ -76139,6 +76350,11 @@ Object.freeze({
76139
76350
  form: "single",
76140
76351
  optional: false
76141
76352
  }],
76353
+ "dishwasher.resume": [{
76354
+ name: "deviceId",
76355
+ form: "single",
76356
+ optional: false
76357
+ }],
76142
76358
  "dishwasher.setChildLock": [{
76143
76359
  name: "deviceId",
76144
76360
  form: "single",
@@ -78225,6 +78441,9 @@ new Map(Object.entries({
78225
78441
  "wrapper-update-available": "system",
78226
78442
  "backup-completed": "system",
78227
78443
  "export-completed": "system",
78444
+ "alert-critical": "system",
78445
+ "alert-error": "system",
78446
+ "alert-critical-resolved": "system",
78228
78447
  "storage-location-low": "system",
78229
78448
  "storage-location-critical": "system",
78230
78449
  "storage-location-ok": "system",
@@ -78349,6 +78568,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
78349
78568
  "storage-location-ok"
78350
78569
  ]
78351
78570
  },
78571
+ {
78572
+ id: "alerts",
78573
+ family: "system",
78574
+ label: "Alerts",
78575
+ kinds: [
78576
+ "alert-critical",
78577
+ "alert-error",
78578
+ "alert-critical-resolved"
78579
+ ]
78580
+ },
78352
78581
  {
78353
78582
  id: "alarm",
78354
78583
  family: "alarm",
@@ -78393,6 +78622,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
78393
78622
  return [[descriptor.kind, field]];
78394
78623
  })));
78395
78624
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
78625
+ object({
78626
+ phase: _enum(["raised", "resolved"]),
78627
+ episodeId: string().min(1),
78628
+ alertId: string().min(1),
78629
+ severity: AlertSeveritySchema,
78630
+ category: string(),
78631
+ title: string(),
78632
+ message: string(),
78633
+ sourceType: string().optional(),
78634
+ sourceId: string().optional(),
78635
+ nodeId: string().optional(),
78636
+ /** The alert's own action link (where the operator acts on it), when it has one. */
78637
+ actionUrl: string().optional(),
78638
+ at: number()
78639
+ });
78396
78640
  var RULE_BODY_ONLY = ["body"];
78397
78641
  var RULE_TEXT = ["title", "body"];
78398
78642
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -78402,6 +78646,11 @@ var TANK = [
78402
78646
  "device-tank-full",
78403
78647
  "device-tank-normal"
78404
78648
  ];
78649
+ var ALERT_EPISODE = [
78650
+ "alert-critical",
78651
+ "alert-error",
78652
+ "alert-critical-resolved"
78653
+ ];
78405
78654
  var UPDATES = [
78406
78655
  "addon-update-available",
78407
78656
  "server-update-available",
@@ -78594,14 +78843,14 @@ var STATE_SUMMARY_VARS = [
78594
78843
  ([...RULE_TEXT], [...CONSUMABLE]),
78595
78844
  ([...RULE_TEXT], [...TANK]),
78596
78845
  [...RULE_TEXT],
78597
- ([...RULE_TEXT], [...UPDATES]),
78598
- ([...RULE_TEXT], [...UPDATES]),
78599
- [...RULE_TEXT],
78846
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78847
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78600
78848
  [...RULE_TEXT],
78601
78849
  [...RULE_TEXT],
78602
78850
  [...RULE_TEXT],
78603
78851
  [...RULE_TEXT],
78604
78852
  [...RULE_TEXT],
78853
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78605
78854
  [...RULE_TEXT],
78606
78855
  [...RULE_TEXT],
78607
78856
  [...RULE_TEXT],
@@ -78619,7 +78868,11 @@ var STATE_SUMMARY_VARS = [
78619
78868
  [...RULE_TEXT],
78620
78869
  [...RULE_TEXT],
78621
78870
  [...RULE_TEXT],
78622
- [...RULE_TEXT],
78871
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78872
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78873
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78874
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78875
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78623
78876
  [...RULE_TEXT],
78624
78877
  [...RULE_TEXT],
78625
78878
  [...RULE_TEXT],