@camstack/addon-provider-wyze 0.2.140 → 0.2.142

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
@@ -10,7 +10,7 @@ import { getCACertificates, setDefaultCACertificates } from "node:tls";
10
10
  //#region \0rolldown/runtime.js
11
11
  var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
12
12
  //#endregion
13
- //#region ../types/dist/event-category-BvOFi6PY.mjs
13
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
14
14
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
15
15
  EventCategory["SystemBoot"] = "system.boot";
16
16
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -89,9 +89,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
89
89
  /**
90
90
  * The node's one-shot runner boot check (D877): planned runners against the
91
91
  * process service, `degraded` when any is failed, refused or missing. The
92
- * alert centre turns it into one alert and a direct critical push.
92
+ * alert centre turns it into one critical alert.
93
93
  */
94
94
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
95
+ /**
96
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
97
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
98
+ * centre sends no notification of its own: Notification Center turns this
99
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
100
+ * system-event kinds, and reconciles from the alerts store because a bus
101
+ * event may be dropped (D8, D11).
102
+ */
103
+ EventCategory["AlertEpisode"] = "alert.episode";
95
104
  EventCategory["AddonError"] = "addon.error";
96
105
  EventCategory["AddonPageReady"] = "addon.page-ready";
97
106
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5416,7 +5425,7 @@ var ZodIssueCode = {
5416
5425
  var ZodFirstPartyTypeKind;
5417
5426
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5418
5427
  //#endregion
5419
- //#region ../types/dist/sleep-BegKjwUu.mjs
5428
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5420
5429
  /**
5421
5430
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5422
5431
  * window to float samples (D455).
@@ -7798,6 +7807,12 @@ function normalizeAddonInitResult(result) {
7798
7807
  if (Array.isArray(result)) return { providers: result };
7799
7808
  return result;
7800
7809
  }
7810
+ /**
7811
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7812
+ * and validates them (`share-token.service.ts` builds its enum from this
7813
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7814
+ */
7815
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7801
7816
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7802
7817
  var PeerBytesTicketSchema = object({
7803
7818
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12497,6 +12512,229 @@ var ConvertResultSchema = object({
12497
12512
  files: array(string()).readonly()
12498
12513
  })).readonly()
12499
12514
  });
12515
+ /**
12516
+ * Zod schemas for persisted record types.
12517
+ *
12518
+ * These schemas serve as the single source of truth for types that are
12519
+ * stored in the settings-store backend and retrieved via tRPC. They
12520
+ * replace the manual TypeScript interfaces with schema-derived types,
12521
+ * enabling runtime validation when reading from the backend.
12522
+ *
12523
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12524
+ * keeps the original name for backward compatibility.
12525
+ */
12526
+ /**
12527
+ * Auth model (v2 — 2026-05-12 caps-only):
12528
+ *
12529
+ * Two principals:
12530
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12531
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12532
+ *
12533
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12534
+ * `super_admin` — collapsed onto the single boolean because every
12535
+ * non-admin caller is governed by the same scope-check rules; the
12536
+ * distinction was only ever used to route role-specific procedures
12537
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12538
+ * with `isAdmin: false` + an explicit scope list.
12539
+ */
12540
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12541
+ var MethodAccessSchema = _enum([
12542
+ "view",
12543
+ "create",
12544
+ "delete"
12545
+ ]);
12546
+ /**
12547
+ * A single scope grant. Three forms — checked in matcher with OR
12548
+ * semantics; the first match decides whether the call passes:
12549
+ *
12550
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12551
+ * cap with the matching `scope` declaration. New caps inherit grants
12552
+ * automatically — adding a device cap to the codebase makes it
12553
+ * reachable to every user with `category:device [...]` without a
12554
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12555
+ *
12556
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12557
+ * useful when an integration needs to interact with one specific
12558
+ * addon's surface regardless of how many caps it exports.
12559
+ *
12560
+ * - `capability` — the most precise form. Single cap name. Use for
12561
+ * integration tokens where you want to grant `addons.installPackage`
12562
+ * and nothing else.
12563
+ *
12564
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12565
+ * "give me everything" escape; there is no wildcard scope.
12566
+ */
12567
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12568
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12569
+ var CapScopeSchema = _enum(["device", "system"]);
12570
+ /**
12571
+ * DeviceSelector (scope model v3 — 2026-08-12).
12572
+ *
12573
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12574
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12575
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12576
+ * AFTER the grant was minted — no re-grant, no re-login.
12577
+ *
12578
+ * - `all` — every device in the deployment. The broad viewer/operator
12579
+ * lever without a `category` grant (a `category` grant also covers device
12580
+ * caps that carry no deviceId; `all` is specifically the device set).
12581
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12582
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12583
+ * is NOT covered until the grant is edited.
12584
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12585
+ * DYNAMIC. A device that changes type, or a new device of the type,
12586
+ * re-resolves on the next request.
12587
+ * - `locations` — every device whose operator-assigned `location` label is
12588
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12589
+ * null/unset location matches NO `locations` selector.
12590
+ */
12591
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12592
+ object({ kind: literal("all") }),
12593
+ object({
12594
+ kind: literal("ids"),
12595
+ ids: array(number().int()).min(1)
12596
+ }),
12597
+ object({
12598
+ kind: literal("types"),
12599
+ types: array(_enum(DeviceType)).min(1)
12600
+ }),
12601
+ object({
12602
+ kind: literal("locations"),
12603
+ locations: array(string().min(1)).min(1)
12604
+ })
12605
+ ]);
12606
+ var DeviceTokenScopeSchema = object({
12607
+ type: literal("device"),
12608
+ /** The device SET this grant covers — resolved against the live fleet. */
12609
+ selector: DeviceSelectorSchema,
12610
+ access: array(MethodAccessSchema).min(1),
12611
+ /**
12612
+ * Whether a grant on a PARENT device transparently covers its accessory
12613
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12614
+ * Direction is parent → children ONLY.
12615
+ *
12616
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12617
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12618
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12619
+ * operator must grant on the child, not inherit from the parent). Set it
12620
+ * explicitly to override that default per grant.
12621
+ */
12622
+ includeLinked: boolean().optional()
12623
+ });
12624
+ /**
12625
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12626
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12627
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12628
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12629
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12630
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12631
+ * migration cannot reach a JWT already in a client's hands; parse-time
12632
+ * migration covers both without a flag day. No cast — the raw object is read
12633
+ * through `Reflect.get` (its static type is `unknown`).
12634
+ */
12635
+ function migrateLegacyTokenScope(raw) {
12636
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12637
+ if (Reflect.get(raw, "type") !== "device") return raw;
12638
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12639
+ const targets = Reflect.get(raw, "targets");
12640
+ if (!Array.isArray(targets)) return raw;
12641
+ return {
12642
+ type: "device",
12643
+ selector: {
12644
+ kind: "ids",
12645
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12646
+ },
12647
+ access: Reflect.get(raw, "access")
12648
+ };
12649
+ }
12650
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12651
+ object({
12652
+ type: literal("category"),
12653
+ target: CapScopeSchema,
12654
+ access: array(MethodAccessSchema).min(1)
12655
+ }),
12656
+ object({
12657
+ type: literal("capability"),
12658
+ target: string(),
12659
+ access: array(MethodAccessSchema).min(1)
12660
+ }),
12661
+ object({
12662
+ type: literal("addon"),
12663
+ target: string(),
12664
+ access: array(MethodAccessSchema).min(1)
12665
+ }),
12666
+ DeviceTokenScopeSchema
12667
+ ]));
12668
+ object({
12669
+ id: string(),
12670
+ username: string(),
12671
+ passwordHash: string(),
12672
+ /**
12673
+ * Admin bypass. When true, the middleware skips the scope-access
12674
+ * check entirely. There is no other axis of privilege; the legacy
12675
+ * role enum collapsed onto this boolean in v2.
12676
+ */
12677
+ isAdmin: boolean().default(false),
12678
+ allowedProviders: AllowedProviderSchema,
12679
+ allowedDevices: AllowedDevicesSchema,
12680
+ /**
12681
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12682
+ * ignored. Non-admins without scopes are locked out of every
12683
+ * protected call.
12684
+ */
12685
+ scopes: array(TokenScopeSchema).default([]),
12686
+ createdAt: number(),
12687
+ updatedAt: number()
12688
+ });
12689
+ object({
12690
+ id: string(),
12691
+ label: string(),
12692
+ isAdmin: boolean().default(false),
12693
+ allowedProviders: AllowedProviderSchema,
12694
+ allowedDevices: AllowedDevicesSchema,
12695
+ tokenHash: string(),
12696
+ tokenPrefix: string(),
12697
+ createdAt: number(),
12698
+ lastUsedAt: number().optional()
12699
+ });
12700
+ object({
12701
+ id: string(),
12702
+ userId: string(),
12703
+ name: string(),
12704
+ tokenHash: string(),
12705
+ tokenPrefix: string(),
12706
+ scopes: array(TokenScopeSchema),
12707
+ expiresAt: number().nullish(),
12708
+ lastUsedAt: number().nullish(),
12709
+ createdAt: number()
12710
+ });
12711
+ /** What a share-view grant lets its holder see. */
12712
+ var ShareViewGrantSchema = object({
12713
+ kind: _enum(SHARE_VIEW_KINDS),
12714
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
12715
+ /** Talk-back, opt-in at mint time; absent means off. */
12716
+ talk: boolean().optional()
12717
+ });
12718
+ var ShareViewScopeSchema = object({
12719
+ type: literal("share-view"),
12720
+ grant: ShareViewGrantSchema
12721
+ });
12722
+ var AddonRoutesScopeSchema = object({
12723
+ type: literal("addon-routes"),
12724
+ access: array(MethodAccessSchema).min(1)
12725
+ });
12726
+ var CredentialScopeSchema = union([
12727
+ literal("*"),
12728
+ ShareViewScopeSchema,
12729
+ AddonRoutesScopeSchema,
12730
+ TokenScopeSchema
12731
+ ]);
12732
+ object({
12733
+ kind: literal("credential"),
12734
+ sub: string().min(1),
12735
+ jti: string().min(16),
12736
+ scopes: array(CredentialScopeSchema).min(1)
12737
+ });
12500
12738
  _enum(["new-session", "step-up"]);
12501
12739
  /** The languages the hub's app landing pages are written in (D858). */
12502
12740
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13213,7 +13451,14 @@ var AlertSeveritySchema = _enum([
13213
13451
  ]);
13214
13452
  var AlertActionSchema = object({
13215
13453
  label: string(),
13216
- href: string().optional()
13454
+ href: string().optional(),
13455
+ /**
13456
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13457
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13458
+ * start) — the browser must leave the SPA with a full navigation, because
13459
+ * the SPA has no such route and would bounce to the home page.
13460
+ */
13461
+ navigation: _enum(["app", "server"]).optional()
13217
13462
  });
13218
13463
  var AlertStatusSchema = _enum([
13219
13464
  "active",
@@ -41946,6 +42191,9 @@ var NcSystemEventKindSchema = _enum([
41946
42191
  "server-updated",
41947
42192
  "export-completed",
41948
42193
  "backup-completed",
42194
+ "alert-critical",
42195
+ "alert-error",
42196
+ "alert-critical-resolved",
41949
42197
  "camera-online",
41950
42198
  "camera-offline",
41951
42199
  "camera-disabled",
@@ -43981,202 +44229,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
43981
44229
  auth: "admin"
43982
44230
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
43983
44231
  /**
43984
- * Zod schemas for persisted record types.
43985
- *
43986
- * These schemas serve as the single source of truth for types that are
43987
- * stored in the settings-store backend and retrieved via tRPC. They
43988
- * replace the manual TypeScript interfaces with schema-derived types,
43989
- * enabling runtime validation when reading from the backend.
43990
- *
43991
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
43992
- * keeps the original name for backward compatibility.
43993
- */
43994
- /**
43995
- * Auth model (v2 — 2026-05-12 caps-only):
43996
- *
43997
- * Two principals:
43998
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
43999
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44000
- *
44001
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44002
- * `super_admin` — collapsed onto the single boolean because every
44003
- * non-admin caller is governed by the same scope-check rules; the
44004
- * distinction was only ever used to route role-specific procedures
44005
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44006
- * with `isAdmin: false` + an explicit scope list.
44007
- */
44008
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44009
- var MethodAccessSchema = _enum([
44010
- "view",
44011
- "create",
44012
- "delete"
44013
- ]);
44014
- /**
44015
- * A single scope grant. Three forms — checked in matcher with OR
44016
- * semantics; the first match decides whether the call passes:
44017
- *
44018
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44019
- * cap with the matching `scope` declaration. New caps inherit grants
44020
- * automatically — adding a device cap to the codebase makes it
44021
- * reachable to every user with `category:device [...]` without a
44022
- * re-grant. Use this for "family viewer" / "operator" tiers.
44023
- *
44024
- * - `addon` — every cap that ships inside a given addon id. Niche;
44025
- * useful when an integration needs to interact with one specific
44026
- * addon's surface regardless of how many caps it exports.
44027
- *
44028
- * - `capability` — the most precise form. Single cap name. Use for
44029
- * integration tokens where you want to grant `addons.installPackage`
44030
- * and nothing else.
44031
- *
44032
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44033
- * "give me everything" escape; there is no wildcard scope.
44034
- */
44035
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44036
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44037
- var CapScopeSchema = _enum(["device", "system"]);
44038
- /**
44039
- * DeviceSelector (scope model v3 — 2026-08-12).
44040
- *
44041
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44042
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44043
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44044
- * AFTER the grant was minted — no re-grant, no re-login.
44045
- *
44046
- * - `all` — every device in the deployment. The broad viewer/operator
44047
- * lever without a `category` grant (a `category` grant also covers device
44048
- * caps that carry no deviceId; `all` is specifically the device set).
44049
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44050
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44051
- * is NOT covered until the grant is edited.
44052
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44053
- * DYNAMIC. A device that changes type, or a new device of the type,
44054
- * re-resolves on the next request.
44055
- * - `locations` — every device whose operator-assigned `location` label is
44056
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44057
- * null/unset location matches NO `locations` selector.
44058
- */
44059
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44060
- object({ kind: literal("all") }),
44061
- object({
44062
- kind: literal("ids"),
44063
- ids: array(number().int()).min(1)
44064
- }),
44065
- object({
44066
- kind: literal("types"),
44067
- types: array(_enum(DeviceType)).min(1)
44068
- }),
44069
- object({
44070
- kind: literal("locations"),
44071
- locations: array(string().min(1)).min(1)
44072
- })
44073
- ]);
44074
- var DeviceTokenScopeSchema = object({
44075
- type: literal("device"),
44076
- /** The device SET this grant covers — resolved against the live fleet. */
44077
- selector: DeviceSelectorSchema,
44078
- access: array(MethodAccessSchema).min(1),
44079
- /**
44080
- * Whether a grant on a PARENT device transparently covers its accessory
44081
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44082
- * Direction is parent → children ONLY.
44083
- *
44084
- * Absent → the matcher DERIVES it from the access flavour: `view`
44085
- * inherits (a camera viewer sees the camera's accessories), `create` /
44086
- * `delete` do NOT (actuating/removing a child is an explicit act the
44087
- * operator must grant on the child, not inherit from the parent). Set it
44088
- * explicitly to override that default per grant.
44089
- */
44090
- includeLinked: boolean().optional()
44091
- });
44092
- /**
44093
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44094
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44095
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44096
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44097
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44098
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44099
- * migration cannot reach a JWT already in a client's hands; parse-time
44100
- * migration covers both without a flag day. No cast — the raw object is read
44101
- * through `Reflect.get` (its static type is `unknown`).
44102
- */
44103
- function migrateLegacyTokenScope(raw) {
44104
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44105
- if (Reflect.get(raw, "type") !== "device") return raw;
44106
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44107
- const targets = Reflect.get(raw, "targets");
44108
- if (!Array.isArray(targets)) return raw;
44109
- return {
44110
- type: "device",
44111
- selector: {
44112
- kind: "ids",
44113
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44114
- },
44115
- access: Reflect.get(raw, "access")
44116
- };
44117
- }
44118
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44119
- object({
44120
- type: literal("category"),
44121
- target: CapScopeSchema,
44122
- access: array(MethodAccessSchema).min(1)
44123
- }),
44124
- object({
44125
- type: literal("capability"),
44126
- target: string(),
44127
- access: array(MethodAccessSchema).min(1)
44128
- }),
44129
- object({
44130
- type: literal("addon"),
44131
- target: string(),
44132
- access: array(MethodAccessSchema).min(1)
44133
- }),
44134
- DeviceTokenScopeSchema
44135
- ]));
44136
- object({
44137
- id: string(),
44138
- username: string(),
44139
- passwordHash: string(),
44140
- /**
44141
- * Admin bypass. When true, the middleware skips the scope-access
44142
- * check entirely. There is no other axis of privilege; the legacy
44143
- * role enum collapsed onto this boolean in v2.
44144
- */
44145
- isAdmin: boolean().default(false),
44146
- allowedProviders: AllowedProviderSchema,
44147
- allowedDevices: AllowedDevicesSchema,
44148
- /**
44149
- * Scopes granted to this user. Admins bypass; their `scopes` is
44150
- * ignored. Non-admins without scopes are locked out of every
44151
- * protected call.
44152
- */
44153
- scopes: array(TokenScopeSchema).default([]),
44154
- createdAt: number(),
44155
- updatedAt: number()
44156
- });
44157
- object({
44158
- id: string(),
44159
- label: string(),
44160
- isAdmin: boolean().default(false),
44161
- allowedProviders: AllowedProviderSchema,
44162
- allowedDevices: AllowedDevicesSchema,
44163
- tokenHash: string(),
44164
- tokenPrefix: string(),
44165
- createdAt: number(),
44166
- lastUsedAt: number().optional()
44167
- });
44168
- object({
44169
- id: string(),
44170
- userId: string(),
44171
- name: string(),
44172
- tokenHash: string(),
44173
- tokenPrefix: string(),
44174
- scopes: array(TokenScopeSchema),
44175
- expiresAt: number().nullish(),
44176
- lastUsedAt: number().nullish(),
44177
- createdAt: number()
44178
- });
44179
- /**
44180
44232
  * `oauth-integration` — a collection cap by which an addon declares
44181
44233
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44182
44234
  * Each provider returns a static descriptor; the core enumerates them
@@ -51126,7 +51178,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51126
51178
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51127
51179
  kind: "mutation",
51128
51180
  auth: "admin"
51129
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51181
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51182
+ clear: boolean(),
51183
+ repointLocationId: string().optional()
51184
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51130
51185
  kind: "mutation",
51131
51186
  auth: "admin"
51132
51187
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -55390,6 +55445,11 @@ onStatusChanged: { data: object({
55390
55445
  *
55391
55446
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55392
55447
  * provider refreshes the slice on an interval and eagerly after commands.
55448
+ *
55449
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55450
+ * nullable: `null` means "not known right now" (the appliance has not said,
55451
+ * the link is down, or the description does not carry it) and is never
55452
+ * rendered or exported as `false` / `0`. `availability` says why.
55393
55453
  */
55394
55454
  var DishwasherStateSchema = _enum([
55395
55455
  "idle",
@@ -55399,43 +55459,155 @@ var DishwasherStateSchema = _enum([
55399
55459
  "error",
55400
55460
  "unavailable"
55401
55461
  ]);
55462
+ /**
55463
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55464
+ * view for compact surfaces; this is what the appliance said.
55465
+ */
55466
+ var DishwasherOperationStateSchema = _enum([
55467
+ "Inactive",
55468
+ "Ready",
55469
+ "DelayedStart",
55470
+ "Run",
55471
+ "Pause",
55472
+ "ActionRequired",
55473
+ "Finished",
55474
+ "Error",
55475
+ "Aborting"
55476
+ ]);
55477
+ /**
55478
+ * Why fields may be `null`:
55479
+ * - `available` — the link is up and the description is loaded;
55480
+ * - `offline` — the local link is down (values are unknown, not last-known);
55481
+ * - `description-missing` — the link is up but the appliance's description could not
55482
+ * be loaded, so its values cannot be decoded.
55483
+ */
55484
+ var DishwasherAvailabilitySchema = _enum([
55485
+ "available",
55486
+ "offline",
55487
+ "description-missing"
55488
+ ]);
55402
55489
  var DishwasherConsumableLevelSchema = _enum([
55403
55490
  "ok",
55404
55491
  "low",
55405
55492
  "empty"
55406
55493
  ]);
55407
55494
  var DishwasherStatusSchema = object({
55495
+ availability: DishwasherAvailabilitySchema,
55496
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55408
55497
  state: DishwasherStateSchema,
55409
- /** Active program id/name, or null when none selected / unknown. */
55498
+ /** The appliance's operation state as reported; null when not known. */
55499
+ operationState: DishwasherOperationStateSchema.nullable(),
55500
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55410
55501
  program: string().nullable(),
55411
- /** Program tokens the hardware accepts — drives the UI selector. */
55502
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55503
+ selectedProgram: string().nullable(),
55504
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55412
55505
  availablePrograms: array(string()),
55413
- /** Minutes remaining on the active cycle, or null when not running. */
55414
- remainingMinutes: number().int().nonnegative().nullable(),
55506
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55507
+ remainingSeconds: number().int().nonnegative().nullable(),
55508
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55509
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55415
55510
  /** Cycle completion 0..100, or null when not applicable. */
55416
55511
  progressPercent: number().min(0).max(100).nullable(),
55417
- /** True when the door is reported open. */
55418
- doorOpen: boolean(),
55419
- /** True when remote start is allowed (door closed, power on, etc.). */
55420
- remoteStartAllowed: boolean(),
55421
- /** Main power / switched-on state. */
55422
- powerOn: boolean(),
55512
+ /** True when the door is reported open; null when the door state is not known. */
55513
+ doorOpen: boolean().nullable(),
55514
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55515
+ doorLocked: boolean().nullable(),
55516
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55517
+ remoteStartAllowed: boolean().nullable(),
55518
+ /** True when the appliance accepts remote control now; null when not known. */
55519
+ remoteControlActive: boolean().nullable(),
55520
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55521
+ localControlActive: boolean().nullable(),
55522
+ /** Main power / switched-on state; null when not known. */
55523
+ powerOn: boolean().nullable(),
55524
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55525
+ powerState: string().nullable(),
55423
55526
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
55424
55527
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55425
- halfLoad: boolean(),
55426
- hygienePlus: boolean(),
55528
+ /** Option states: null when the appliance does not expose the option or has not said. */
55529
+ halfLoad: boolean().nullable(),
55530
+ hygienePlus: boolean().nullable(),
55427
55531
  /** Extra dry option when the appliance exposes it. */
55428
- extraDry: boolean(),
55532
+ extraDry: boolean().nullable(),
55429
55533
  /** Intensive zone (lower basket) when the appliance exposes it. */
55430
- intensiveZone: boolean(),
55534
+ intensiveZone: boolean().nullable(),
55431
55535
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55432
- varioSpeedPlus: boolean(),
55433
- /** Child lock (controls disabled on the appliance). */
55434
- childLock: boolean(),
55536
+ varioSpeedPlus: boolean().nullable(),
55537
+ /** Child lock (controls disabled on the appliance); null when not known. */
55538
+ childLock: boolean().nullable(),
55539
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55540
+ activeEvents: array(string()),
55541
+ /** Numeric error code when the appliance reports one; null otherwise. */
55435
55542
  errorCode: number().nullable(),
55543
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55436
55544
  errorLabel: string().nullable(),
55545
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55437
55546
  lastFetchedAt: number()
55438
55547
  });
55548
+ var DeviceIdSchema = number().int().nonnegative();
55549
+ /** A value a program option or setting can take. */
55550
+ var DishwasherValueSchema = union([
55551
+ boolean(),
55552
+ string(),
55553
+ number()
55554
+ ]);
55555
+ var DishwasherAccessSchema = _enum([
55556
+ "none",
55557
+ "read",
55558
+ "readWrite",
55559
+ "writeOnly",
55560
+ "readStatic"
55561
+ ]);
55562
+ /**
55563
+ * One option or setting the appliance declares, with the constraints its description
55564
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55565
+ */
55566
+ var DishwasherOptionDescriptorSchema = object({
55567
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55568
+ key: string(),
55569
+ /** Last segment of the key, for display. */
55570
+ name: string(),
55571
+ type: _enum([
55572
+ "boolean",
55573
+ "number",
55574
+ "enum",
55575
+ "string"
55576
+ ]),
55577
+ access: DishwasherAccessSchema,
55578
+ /** The appliance reports this entity as currently available. */
55579
+ available: boolean(),
55580
+ /** Unit the description declares for a number; null when it declares none. */
55581
+ unit: string().nullable(),
55582
+ min: number().nullable(),
55583
+ max: number().nullable(),
55584
+ step: number().nullable(),
55585
+ /** Allowed members of an enum; null for other types. */
55586
+ enumValues: array(string()).nullable(),
55587
+ defaultValue: DishwasherValueSchema.nullable()
55588
+ });
55589
+ var DishwasherProgramSchema = object({
55590
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
55591
+ key: string(),
55592
+ name: string(),
55593
+ /** The appliance currently offers this program. */
55594
+ available: boolean(),
55595
+ /** The options this program lists, with the program-level access / availability / default. */
55596
+ options: array(DishwasherOptionDescriptorSchema)
55597
+ });
55598
+ var DishwasherOptionsSchema = object({
55599
+ availability: DishwasherAvailabilitySchema,
55600
+ /** What the appliance can be told to do, from the commands its description declares. */
55601
+ supportsStart: boolean(),
55602
+ supportsPause: boolean(),
55603
+ supportsResume: boolean(),
55604
+ supportsStop: boolean(),
55605
+ supportsPower: boolean(),
55606
+ /** Every program the description lists, with its options. */
55607
+ programs: array(DishwasherProgramSchema),
55608
+ /** Every option and setting entity the description lists (programs reference these by key). */
55609
+ options: array(DishwasherOptionDescriptorSchema)
55610
+ });
55439
55611
  var dishwasherCapability = {
55440
55612
  name: "dishwasher",
55441
55613
  scope: "device",
@@ -55443,86 +55615,102 @@ var dishwasherCapability = {
55443
55615
  mode: "singleton",
55444
55616
  deviceTypes: [DeviceType.Dishwasher],
55445
55617
  methods: {
55446
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55618
+ /**
55619
+ * Start a program. Without `program` the selected one starts. `options` are
55620
+ * option feature keys; each is checked against the program's constraints.
55621
+ */
55622
+ start: method(object({
55623
+ deviceId: DeviceIdSchema,
55624
+ program: string().min(1).optional(),
55625
+ options: record(string(), DishwasherValueSchema).optional()
55626
+ }), _void(), {
55447
55627
  kind: "mutation",
55448
55628
  auth: "protected"
55449
55629
  }),
55450
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55630
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55451
55631
  kind: "mutation",
55452
55632
  auth: "protected"
55453
55633
  }),
55454
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55634
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
55635
+ kind: "mutation",
55636
+ auth: "protected"
55637
+ }),
55638
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55455
55639
  kind: "mutation",
55456
55640
  auth: "protected"
55457
55641
  }),
55642
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55458
55643
  setProgram: method(object({
55459
- deviceId: number().int().nonnegative(),
55644
+ deviceId: DeviceIdSchema,
55460
55645
  program: string().min(1)
55461
55646
  }), _void(), {
55462
55647
  kind: "mutation",
55463
55648
  auth: "protected"
55464
55649
  }),
55465
55650
  setPower: method(object({
55466
- deviceId: number().int().nonnegative(),
55651
+ deviceId: DeviceIdSchema,
55467
55652
  on: boolean()
55468
55653
  }), _void(), {
55469
55654
  kind: "mutation",
55470
55655
  auth: "protected"
55471
55656
  }),
55472
55657
  setHalfLoad: method(object({
55473
- deviceId: number().int().nonnegative(),
55658
+ deviceId: DeviceIdSchema,
55474
55659
  on: boolean()
55475
55660
  }), _void(), {
55476
55661
  kind: "mutation",
55477
55662
  auth: "protected"
55478
55663
  }),
55479
55664
  setHygienePlus: method(object({
55480
- deviceId: number().int().nonnegative(),
55665
+ deviceId: DeviceIdSchema,
55481
55666
  on: boolean()
55482
55667
  }), _void(), {
55483
55668
  kind: "mutation",
55484
55669
  auth: "protected"
55485
55670
  }),
55486
55671
  setExtraDry: method(object({
55487
- deviceId: number().int().nonnegative(),
55672
+ deviceId: DeviceIdSchema,
55488
55673
  on: boolean()
55489
55674
  }), _void(), {
55490
55675
  kind: "mutation",
55491
55676
  auth: "protected"
55492
55677
  }),
55493
55678
  setIntensiveZone: method(object({
55494
- deviceId: number().int().nonnegative(),
55679
+ deviceId: DeviceIdSchema,
55495
55680
  on: boolean()
55496
55681
  }), _void(), {
55497
55682
  kind: "mutation",
55498
55683
  auth: "protected"
55499
55684
  }),
55500
55685
  setVarioSpeedPlus: method(object({
55501
- deviceId: number().int().nonnegative(),
55686
+ deviceId: DeviceIdSchema,
55502
55687
  on: boolean()
55503
55688
  }), _void(), {
55504
55689
  kind: "mutation",
55505
55690
  auth: "protected"
55506
55691
  }),
55507
55692
  setChildLock: method(object({
55508
- deviceId: number().int().nonnegative(),
55693
+ deviceId: DeviceIdSchema,
55509
55694
  on: boolean()
55510
55695
  }), _void(), {
55511
55696
  kind: "mutation",
55512
55697
  auth: "protected"
55513
55698
  }),
55699
+ /**
55700
+ * Write any option or setting by feature key. Refused when the description does
55701
+ * not list it, it is not writable or not available now, or the value is outside
55702
+ * its declared range / members.
55703
+ */
55514
55704
  setOption: method(object({
55515
- deviceId: number().int().nonnegative(),
55705
+ deviceId: DeviceIdSchema,
55516
55706
  key: string().min(1),
55517
- value: union([
55518
- boolean(),
55519
- string(),
55520
- number()
55521
- ])
55707
+ value: DishwasherValueSchema
55522
55708
  }), _void(), {
55523
55709
  kind: "mutation",
55524
55710
  auth: "protected"
55525
- })
55711
+ }),
55712
+ /** What this appliance can do, from its own description — the UI is derived from it. */
55713
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55526
55714
  },
55527
55715
  status: {
55528
55716
  schema: DishwasherStatusSchema,
@@ -69471,6 +69659,12 @@ Object.freeze({
69471
69659
  addonId: null,
69472
69660
  access: "view"
69473
69661
  },
69662
+ "dishwasher.getOptions": {
69663
+ capName: "dishwasher",
69664
+ capScope: "device",
69665
+ addonId: null,
69666
+ access: "view"
69667
+ },
69474
69668
  "dishwasher.getStatus": {
69475
69669
  capName: "dishwasher",
69476
69670
  capScope: "device",
@@ -69483,6 +69677,12 @@ Object.freeze({
69483
69677
  addonId: null,
69484
69678
  access: "create"
69485
69679
  },
69680
+ "dishwasher.resume": {
69681
+ capName: "dishwasher",
69682
+ capScope: "device",
69683
+ addonId: null,
69684
+ access: "create"
69685
+ },
69486
69686
  "dishwasher.setChildLock": {
69487
69687
  capName: "dishwasher",
69488
69688
  capScope: "device",
@@ -73983,6 +74183,12 @@ Object.freeze({
73983
74183
  addonId: null,
73984
74184
  access: "view"
73985
74185
  },
74186
+ "storageMigration.moverClearance": {
74187
+ capName: "storage-migration",
74188
+ capScope: "system",
74189
+ addonId: null,
74190
+ access: "view"
74191
+ },
73986
74192
  "storageMigration.movers": {
73987
74193
  capName: "storage-migration",
73988
74194
  capScope: "system",
@@ -76176,6 +76382,11 @@ Object.freeze({
76176
76382
  form: "single",
76177
76383
  optional: false
76178
76384
  }],
76385
+ "dishwasher.getOptions": [{
76386
+ name: "deviceId",
76387
+ form: "single",
76388
+ optional: false
76389
+ }],
76179
76390
  "dishwasher.getStatus": [{
76180
76391
  name: "deviceId",
76181
76392
  form: "single",
@@ -76186,6 +76397,11 @@ Object.freeze({
76186
76397
  form: "single",
76187
76398
  optional: false
76188
76399
  }],
76400
+ "dishwasher.resume": [{
76401
+ name: "deviceId",
76402
+ form: "single",
76403
+ optional: false
76404
+ }],
76189
76405
  "dishwasher.setChildLock": [{
76190
76406
  name: "deviceId",
76191
76407
  form: "single",
@@ -78272,6 +78488,9 @@ new Map(Object.entries({
78272
78488
  "wrapper-update-available": "system",
78273
78489
  "backup-completed": "system",
78274
78490
  "export-completed": "system",
78491
+ "alert-critical": "system",
78492
+ "alert-error": "system",
78493
+ "alert-critical-resolved": "system",
78275
78494
  "storage-location-low": "system",
78276
78495
  "storage-location-critical": "system",
78277
78496
  "storage-location-ok": "system",
@@ -78396,6 +78615,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
78396
78615
  "storage-location-ok"
78397
78616
  ]
78398
78617
  },
78618
+ {
78619
+ id: "alerts",
78620
+ family: "system",
78621
+ label: "Alerts",
78622
+ kinds: [
78623
+ "alert-critical",
78624
+ "alert-error",
78625
+ "alert-critical-resolved"
78626
+ ]
78627
+ },
78399
78628
  {
78400
78629
  id: "alarm",
78401
78630
  family: "alarm",
@@ -78440,6 +78669,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
78440
78669
  return [[descriptor.kind, field]];
78441
78670
  })));
78442
78671
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
78672
+ object({
78673
+ phase: _enum(["raised", "resolved"]),
78674
+ episodeId: string().min(1),
78675
+ alertId: string().min(1),
78676
+ severity: AlertSeveritySchema,
78677
+ category: string(),
78678
+ title: string(),
78679
+ message: string(),
78680
+ sourceType: string().optional(),
78681
+ sourceId: string().optional(),
78682
+ nodeId: string().optional(),
78683
+ /** The alert's own action link (where the operator acts on it), when it has one. */
78684
+ actionUrl: string().optional(),
78685
+ at: number()
78686
+ });
78443
78687
  var RULE_BODY_ONLY = ["body"];
78444
78688
  var RULE_TEXT = ["title", "body"];
78445
78689
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -78449,6 +78693,11 @@ var TANK = [
78449
78693
  "device-tank-full",
78450
78694
  "device-tank-normal"
78451
78695
  ];
78696
+ var ALERT_EPISODE = [
78697
+ "alert-critical",
78698
+ "alert-error",
78699
+ "alert-critical-resolved"
78700
+ ];
78452
78701
  var UPDATES = [
78453
78702
  "addon-update-available",
78454
78703
  "server-update-available",
@@ -78641,14 +78890,14 @@ var STATE_SUMMARY_VARS = [
78641
78890
  ([...RULE_TEXT], [...CONSUMABLE]),
78642
78891
  ([...RULE_TEXT], [...TANK]),
78643
78892
  [...RULE_TEXT],
78644
- ([...RULE_TEXT], [...UPDATES]),
78645
- ([...RULE_TEXT], [...UPDATES]),
78646
- [...RULE_TEXT],
78893
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78894
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78647
78895
  [...RULE_TEXT],
78648
78896
  [...RULE_TEXT],
78649
78897
  [...RULE_TEXT],
78650
78898
  [...RULE_TEXT],
78651
78899
  [...RULE_TEXT],
78900
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78652
78901
  [...RULE_TEXT],
78653
78902
  [...RULE_TEXT],
78654
78903
  [...RULE_TEXT],
@@ -78666,7 +78915,11 @@ var STATE_SUMMARY_VARS = [
78666
78915
  [...RULE_TEXT],
78667
78916
  [...RULE_TEXT],
78668
78917
  [...RULE_TEXT],
78669
- [...RULE_TEXT],
78918
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78919
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78920
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78921
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78922
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78670
78923
  [...RULE_TEXT],
78671
78924
  [...RULE_TEXT],
78672
78925
  [...RULE_TEXT],