@camstack/addon-provider-dreame 0.2.135 → 0.2.137

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
@@ -44,7 +44,7 @@ let net = require("net");
44
44
  net = __toESM(net, 1);
45
45
  let zlib = require("zlib");
46
46
  zlib = __toESM(zlib, 1);
47
- //#region ../types/dist/event-category-BvOFi6PY.mjs
47
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
48
48
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
49
49
  EventCategory["SystemBoot"] = "system.boot";
50
50
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -123,9 +123,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
123
123
  /**
124
124
  * The node's one-shot runner boot check (D877): planned runners against the
125
125
  * process service, `degraded` when any is failed, refused or missing. The
126
- * alert centre turns it into one alert and a direct critical push.
126
+ * alert centre turns it into one critical alert.
127
127
  */
128
128
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
129
+ /**
130
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
131
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
132
+ * centre sends no notification of its own: Notification Center turns this
133
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
134
+ * system-event kinds, and reconciles from the alerts store because a bus
135
+ * event may be dropped (D8, D11).
136
+ */
137
+ EventCategory["AlertEpisode"] = "alert.episode";
129
138
  EventCategory["AddonError"] = "addon.error";
130
139
  EventCategory["AddonPageReady"] = "addon.page-ready";
131
140
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5450,7 +5459,7 @@ var ZodIssueCode$1 = {
5450
5459
  var ZodFirstPartyTypeKind$1;
5451
5460
  ZodFirstPartyTypeKind$1 || (ZodFirstPartyTypeKind$1 = {});
5452
5461
  //#endregion
5453
- //#region ../types/dist/sleep-BegKjwUu.mjs
5462
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5454
5463
  /**
5455
5464
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5456
5465
  * window to float samples (D455).
@@ -7832,6 +7841,12 @@ function normalizeAddonInitResult(result) {
7832
7841
  if (Array.isArray(result)) return { providers: result };
7833
7842
  return result;
7834
7843
  }
7844
+ /**
7845
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7846
+ * and validates them (`share-token.service.ts` builds its enum from this
7847
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7848
+ */
7849
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7835
7850
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7836
7851
  var PeerBytesTicketSchema = object({
7837
7852
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12511,6 +12526,229 @@ var ConvertResultSchema = object({
12511
12526
  files: array(string()).readonly()
12512
12527
  })).readonly()
12513
12528
  });
12529
+ /**
12530
+ * Zod schemas for persisted record types.
12531
+ *
12532
+ * These schemas serve as the single source of truth for types that are
12533
+ * stored in the settings-store backend and retrieved via tRPC. They
12534
+ * replace the manual TypeScript interfaces with schema-derived types,
12535
+ * enabling runtime validation when reading from the backend.
12536
+ *
12537
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12538
+ * keeps the original name for backward compatibility.
12539
+ */
12540
+ /**
12541
+ * Auth model (v2 — 2026-05-12 caps-only):
12542
+ *
12543
+ * Two principals:
12544
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12545
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12546
+ *
12547
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12548
+ * `super_admin` — collapsed onto the single boolean because every
12549
+ * non-admin caller is governed by the same scope-check rules; the
12550
+ * distinction was only ever used to route role-specific procedures
12551
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12552
+ * with `isAdmin: false` + an explicit scope list.
12553
+ */
12554
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12555
+ var MethodAccessSchema = _enum([
12556
+ "view",
12557
+ "create",
12558
+ "delete"
12559
+ ]);
12560
+ /**
12561
+ * A single scope grant. Three forms — checked in matcher with OR
12562
+ * semantics; the first match decides whether the call passes:
12563
+ *
12564
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12565
+ * cap with the matching `scope` declaration. New caps inherit grants
12566
+ * automatically — adding a device cap to the codebase makes it
12567
+ * reachable to every user with `category:device [...]` without a
12568
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12569
+ *
12570
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12571
+ * useful when an integration needs to interact with one specific
12572
+ * addon's surface regardless of how many caps it exports.
12573
+ *
12574
+ * - `capability` — the most precise form. Single cap name. Use for
12575
+ * integration tokens where you want to grant `addons.installPackage`
12576
+ * and nothing else.
12577
+ *
12578
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12579
+ * "give me everything" escape; there is no wildcard scope.
12580
+ */
12581
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12582
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12583
+ var CapScopeSchema = _enum(["device", "system"]);
12584
+ /**
12585
+ * DeviceSelector (scope model v3 — 2026-08-12).
12586
+ *
12587
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12588
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12589
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12590
+ * AFTER the grant was minted — no re-grant, no re-login.
12591
+ *
12592
+ * - `all` — every device in the deployment. The broad viewer/operator
12593
+ * lever without a `category` grant (a `category` grant also covers device
12594
+ * caps that carry no deviceId; `all` is specifically the device set).
12595
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12596
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12597
+ * is NOT covered until the grant is edited.
12598
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12599
+ * DYNAMIC. A device that changes type, or a new device of the type,
12600
+ * re-resolves on the next request.
12601
+ * - `locations` — every device whose operator-assigned `location` label is
12602
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12603
+ * null/unset location matches NO `locations` selector.
12604
+ */
12605
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12606
+ object({ kind: literal("all") }),
12607
+ object({
12608
+ kind: literal("ids"),
12609
+ ids: array(number().int()).min(1)
12610
+ }),
12611
+ object({
12612
+ kind: literal("types"),
12613
+ types: array(_enum(DeviceType)).min(1)
12614
+ }),
12615
+ object({
12616
+ kind: literal("locations"),
12617
+ locations: array(string().min(1)).min(1)
12618
+ })
12619
+ ]);
12620
+ var DeviceTokenScopeSchema = object({
12621
+ type: literal("device"),
12622
+ /** The device SET this grant covers — resolved against the live fleet. */
12623
+ selector: DeviceSelectorSchema,
12624
+ access: array(MethodAccessSchema).min(1),
12625
+ /**
12626
+ * Whether a grant on a PARENT device transparently covers its accessory
12627
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12628
+ * Direction is parent → children ONLY.
12629
+ *
12630
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12631
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12632
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12633
+ * operator must grant on the child, not inherit from the parent). Set it
12634
+ * explicitly to override that default per grant.
12635
+ */
12636
+ includeLinked: boolean().optional()
12637
+ });
12638
+ /**
12639
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12640
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12641
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12642
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12643
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12644
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12645
+ * migration cannot reach a JWT already in a client's hands; parse-time
12646
+ * migration covers both without a flag day. No cast — the raw object is read
12647
+ * through `Reflect.get` (its static type is `unknown`).
12648
+ */
12649
+ function migrateLegacyTokenScope(raw) {
12650
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12651
+ if (Reflect.get(raw, "type") !== "device") return raw;
12652
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12653
+ const targets = Reflect.get(raw, "targets");
12654
+ if (!Array.isArray(targets)) return raw;
12655
+ return {
12656
+ type: "device",
12657
+ selector: {
12658
+ kind: "ids",
12659
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12660
+ },
12661
+ access: Reflect.get(raw, "access")
12662
+ };
12663
+ }
12664
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12665
+ object({
12666
+ type: literal("category"),
12667
+ target: CapScopeSchema,
12668
+ access: array(MethodAccessSchema).min(1)
12669
+ }),
12670
+ object({
12671
+ type: literal("capability"),
12672
+ target: string(),
12673
+ access: array(MethodAccessSchema).min(1)
12674
+ }),
12675
+ object({
12676
+ type: literal("addon"),
12677
+ target: string(),
12678
+ access: array(MethodAccessSchema).min(1)
12679
+ }),
12680
+ DeviceTokenScopeSchema
12681
+ ]));
12682
+ object({
12683
+ id: string(),
12684
+ username: string(),
12685
+ passwordHash: string(),
12686
+ /**
12687
+ * Admin bypass. When true, the middleware skips the scope-access
12688
+ * check entirely. There is no other axis of privilege; the legacy
12689
+ * role enum collapsed onto this boolean in v2.
12690
+ */
12691
+ isAdmin: boolean().default(false),
12692
+ allowedProviders: AllowedProviderSchema,
12693
+ allowedDevices: AllowedDevicesSchema,
12694
+ /**
12695
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12696
+ * ignored. Non-admins without scopes are locked out of every
12697
+ * protected call.
12698
+ */
12699
+ scopes: array(TokenScopeSchema).default([]),
12700
+ createdAt: number(),
12701
+ updatedAt: number()
12702
+ });
12703
+ object({
12704
+ id: string(),
12705
+ label: string(),
12706
+ isAdmin: boolean().default(false),
12707
+ allowedProviders: AllowedProviderSchema,
12708
+ allowedDevices: AllowedDevicesSchema,
12709
+ tokenHash: string(),
12710
+ tokenPrefix: string(),
12711
+ createdAt: number(),
12712
+ lastUsedAt: number().optional()
12713
+ });
12714
+ object({
12715
+ id: string(),
12716
+ userId: string(),
12717
+ name: string(),
12718
+ tokenHash: string(),
12719
+ tokenPrefix: string(),
12720
+ scopes: array(TokenScopeSchema),
12721
+ expiresAt: number().nullish(),
12722
+ lastUsedAt: number().nullish(),
12723
+ createdAt: number()
12724
+ });
12725
+ /** What a share-view grant lets its holder see. */
12726
+ var ShareViewGrantSchema = object({
12727
+ kind: _enum(SHARE_VIEW_KINDS),
12728
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
12729
+ /** Talk-back, opt-in at mint time; absent means off. */
12730
+ talk: boolean().optional()
12731
+ });
12732
+ var ShareViewScopeSchema = object({
12733
+ type: literal("share-view"),
12734
+ grant: ShareViewGrantSchema
12735
+ });
12736
+ var AddonRoutesScopeSchema = object({
12737
+ type: literal("addon-routes"),
12738
+ access: array(MethodAccessSchema).min(1)
12739
+ });
12740
+ var CredentialScopeSchema = union([
12741
+ literal("*"),
12742
+ ShareViewScopeSchema,
12743
+ AddonRoutesScopeSchema,
12744
+ TokenScopeSchema
12745
+ ]);
12746
+ object({
12747
+ kind: literal("credential"),
12748
+ sub: string().min(1),
12749
+ jti: string().min(16),
12750
+ scopes: array(CredentialScopeSchema).min(1)
12751
+ });
12514
12752
  _enum(["new-session", "step-up"]);
12515
12753
  /** The languages the hub's app landing pages are written in (D858). */
12516
12754
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13227,7 +13465,14 @@ var AlertSeveritySchema = _enum([
13227
13465
  ]);
13228
13466
  var AlertActionSchema = object({
13229
13467
  label: string(),
13230
- href: string().optional()
13468
+ href: string().optional(),
13469
+ /**
13470
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13471
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13472
+ * start) — the browser must leave the SPA with a full navigation, because
13473
+ * the SPA has no such route and would bounce to the home page.
13474
+ */
13475
+ navigation: _enum(["app", "server"]).optional()
13231
13476
  });
13232
13477
  var AlertStatusSchema = _enum([
13233
13478
  "active",
@@ -41972,6 +42217,9 @@ var NcSystemEventKindSchema = _enum([
41972
42217
  "server-updated",
41973
42218
  "export-completed",
41974
42219
  "backup-completed",
42220
+ "alert-critical",
42221
+ "alert-error",
42222
+ "alert-critical-resolved",
41975
42223
  "camera-online",
41976
42224
  "camera-offline",
41977
42225
  "camera-disabled",
@@ -44007,202 +44255,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44007
44255
  auth: "admin"
44008
44256
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44009
44257
  /**
44010
- * Zod schemas for persisted record types.
44011
- *
44012
- * These schemas serve as the single source of truth for types that are
44013
- * stored in the settings-store backend and retrieved via tRPC. They
44014
- * replace the manual TypeScript interfaces with schema-derived types,
44015
- * enabling runtime validation when reading from the backend.
44016
- *
44017
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44018
- * keeps the original name for backward compatibility.
44019
- */
44020
- /**
44021
- * Auth model (v2 — 2026-05-12 caps-only):
44022
- *
44023
- * Two principals:
44024
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44025
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44026
- *
44027
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44028
- * `super_admin` — collapsed onto the single boolean because every
44029
- * non-admin caller is governed by the same scope-check rules; the
44030
- * distinction was only ever used to route role-specific procedures
44031
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44032
- * with `isAdmin: false` + an explicit scope list.
44033
- */
44034
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44035
- var MethodAccessSchema = _enum([
44036
- "view",
44037
- "create",
44038
- "delete"
44039
- ]);
44040
- /**
44041
- * A single scope grant. Three forms — checked in matcher with OR
44042
- * semantics; the first match decides whether the call passes:
44043
- *
44044
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44045
- * cap with the matching `scope` declaration. New caps inherit grants
44046
- * automatically — adding a device cap to the codebase makes it
44047
- * reachable to every user with `category:device [...]` without a
44048
- * re-grant. Use this for "family viewer" / "operator" tiers.
44049
- *
44050
- * - `addon` — every cap that ships inside a given addon id. Niche;
44051
- * useful when an integration needs to interact with one specific
44052
- * addon's surface regardless of how many caps it exports.
44053
- *
44054
- * - `capability` — the most precise form. Single cap name. Use for
44055
- * integration tokens where you want to grant `addons.installPackage`
44056
- * and nothing else.
44057
- *
44058
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44059
- * "give me everything" escape; there is no wildcard scope.
44060
- */
44061
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44062
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44063
- var CapScopeSchema = _enum(["device", "system"]);
44064
- /**
44065
- * DeviceSelector (scope model v3 — 2026-08-12).
44066
- *
44067
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44068
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44069
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44070
- * AFTER the grant was minted — no re-grant, no re-login.
44071
- *
44072
- * - `all` — every device in the deployment. The broad viewer/operator
44073
- * lever without a `category` grant (a `category` grant also covers device
44074
- * caps that carry no deviceId; `all` is specifically the device set).
44075
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44076
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44077
- * is NOT covered until the grant is edited.
44078
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44079
- * DYNAMIC. A device that changes type, or a new device of the type,
44080
- * re-resolves on the next request.
44081
- * - `locations` — every device whose operator-assigned `location` label is
44082
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44083
- * null/unset location matches NO `locations` selector.
44084
- */
44085
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44086
- object({ kind: literal("all") }),
44087
- object({
44088
- kind: literal("ids"),
44089
- ids: array(number().int()).min(1)
44090
- }),
44091
- object({
44092
- kind: literal("types"),
44093
- types: array(_enum(DeviceType)).min(1)
44094
- }),
44095
- object({
44096
- kind: literal("locations"),
44097
- locations: array(string().min(1)).min(1)
44098
- })
44099
- ]);
44100
- var DeviceTokenScopeSchema = object({
44101
- type: literal("device"),
44102
- /** The device SET this grant covers — resolved against the live fleet. */
44103
- selector: DeviceSelectorSchema,
44104
- access: array(MethodAccessSchema).min(1),
44105
- /**
44106
- * Whether a grant on a PARENT device transparently covers its accessory
44107
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44108
- * Direction is parent → children ONLY.
44109
- *
44110
- * Absent → the matcher DERIVES it from the access flavour: `view`
44111
- * inherits (a camera viewer sees the camera's accessories), `create` /
44112
- * `delete` do NOT (actuating/removing a child is an explicit act the
44113
- * operator must grant on the child, not inherit from the parent). Set it
44114
- * explicitly to override that default per grant.
44115
- */
44116
- includeLinked: boolean().optional()
44117
- });
44118
- /**
44119
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44120
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44121
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44122
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44123
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44124
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44125
- * migration cannot reach a JWT already in a client's hands; parse-time
44126
- * migration covers both without a flag day. No cast — the raw object is read
44127
- * through `Reflect.get` (its static type is `unknown`).
44128
- */
44129
- function migrateLegacyTokenScope(raw) {
44130
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44131
- if (Reflect.get(raw, "type") !== "device") return raw;
44132
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44133
- const targets = Reflect.get(raw, "targets");
44134
- if (!Array.isArray(targets)) return raw;
44135
- return {
44136
- type: "device",
44137
- selector: {
44138
- kind: "ids",
44139
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44140
- },
44141
- access: Reflect.get(raw, "access")
44142
- };
44143
- }
44144
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44145
- object({
44146
- type: literal("category"),
44147
- target: CapScopeSchema,
44148
- access: array(MethodAccessSchema).min(1)
44149
- }),
44150
- object({
44151
- type: literal("capability"),
44152
- target: string(),
44153
- access: array(MethodAccessSchema).min(1)
44154
- }),
44155
- object({
44156
- type: literal("addon"),
44157
- target: string(),
44158
- access: array(MethodAccessSchema).min(1)
44159
- }),
44160
- DeviceTokenScopeSchema
44161
- ]));
44162
- object({
44163
- id: string(),
44164
- username: string(),
44165
- passwordHash: string(),
44166
- /**
44167
- * Admin bypass. When true, the middleware skips the scope-access
44168
- * check entirely. There is no other axis of privilege; the legacy
44169
- * role enum collapsed onto this boolean in v2.
44170
- */
44171
- isAdmin: boolean().default(false),
44172
- allowedProviders: AllowedProviderSchema,
44173
- allowedDevices: AllowedDevicesSchema,
44174
- /**
44175
- * Scopes granted to this user. Admins bypass; their `scopes` is
44176
- * ignored. Non-admins without scopes are locked out of every
44177
- * protected call.
44178
- */
44179
- scopes: array(TokenScopeSchema).default([]),
44180
- createdAt: number(),
44181
- updatedAt: number()
44182
- });
44183
- object({
44184
- id: string(),
44185
- label: string(),
44186
- isAdmin: boolean().default(false),
44187
- allowedProviders: AllowedProviderSchema,
44188
- allowedDevices: AllowedDevicesSchema,
44189
- tokenHash: string(),
44190
- tokenPrefix: string(),
44191
- createdAt: number(),
44192
- lastUsedAt: number().optional()
44193
- });
44194
- object({
44195
- id: string(),
44196
- userId: string(),
44197
- name: string(),
44198
- tokenHash: string(),
44199
- tokenPrefix: string(),
44200
- scopes: array(TokenScopeSchema),
44201
- expiresAt: number().nullish(),
44202
- lastUsedAt: number().nullish(),
44203
- createdAt: number()
44204
- });
44205
- /**
44206
44258
  * `oauth-integration` — a collection cap by which an addon declares
44207
44259
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44208
44260
  * Each provider returns a static descriptor; the core enumerates them
@@ -51048,7 +51100,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51048
51100
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51049
51101
  kind: "mutation",
51050
51102
  auth: "admin"
51051
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51103
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51104
+ clear: boolean(),
51105
+ repointLocationId: string().optional()
51106
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51052
51107
  kind: "mutation",
51053
51108
  auth: "admin"
51054
51109
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -55329,6 +55384,11 @@ onStatusChanged: { data: object({
55329
55384
  *
55330
55385
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55331
55386
  * provider refreshes the slice on an interval and eagerly after commands.
55387
+ *
55388
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55389
+ * nullable: `null` means "not known right now" (the appliance has not said,
55390
+ * the link is down, or the description does not carry it) and is never
55391
+ * rendered or exported as `false` / `0`. `availability` says why.
55332
55392
  */
55333
55393
  var DishwasherStateSchema = _enum([
55334
55394
  "idle",
@@ -55338,43 +55398,155 @@ var DishwasherStateSchema = _enum([
55338
55398
  "error",
55339
55399
  "unavailable"
55340
55400
  ]);
55401
+ /**
55402
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55403
+ * view for compact surfaces; this is what the appliance said.
55404
+ */
55405
+ var DishwasherOperationStateSchema = _enum([
55406
+ "Inactive",
55407
+ "Ready",
55408
+ "DelayedStart",
55409
+ "Run",
55410
+ "Pause",
55411
+ "ActionRequired",
55412
+ "Finished",
55413
+ "Error",
55414
+ "Aborting"
55415
+ ]);
55416
+ /**
55417
+ * Why fields may be `null`:
55418
+ * - `available` — the link is up and the description is loaded;
55419
+ * - `offline` — the local link is down (values are unknown, not last-known);
55420
+ * - `description-missing` — the link is up but the appliance's description could not
55421
+ * be loaded, so its values cannot be decoded.
55422
+ */
55423
+ var DishwasherAvailabilitySchema = _enum([
55424
+ "available",
55425
+ "offline",
55426
+ "description-missing"
55427
+ ]);
55341
55428
  var DishwasherConsumableLevelSchema = _enum([
55342
55429
  "ok",
55343
55430
  "low",
55344
55431
  "empty"
55345
55432
  ]);
55346
55433
  var DishwasherStatusSchema = object({
55434
+ availability: DishwasherAvailabilitySchema,
55435
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55347
55436
  state: DishwasherStateSchema,
55348
- /** Active program id/name, or null when none selected / unknown. */
55437
+ /** The appliance's operation state as reported; null when not known. */
55438
+ operationState: DishwasherOperationStateSchema.nullable(),
55439
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55349
55440
  program: string().nullable(),
55350
- /** Program tokens the hardware accepts — drives the UI selector. */
55441
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55442
+ selectedProgram: string().nullable(),
55443
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55351
55444
  availablePrograms: array(string()),
55352
- /** Minutes remaining on the active cycle, or null when not running. */
55353
- remainingMinutes: number().int().nonnegative().nullable(),
55445
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55446
+ remainingSeconds: number().int().nonnegative().nullable(),
55447
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55448
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55354
55449
  /** Cycle completion 0..100, or null when not applicable. */
55355
55450
  progressPercent: number().min(0).max(100).nullable(),
55356
- /** True when the door is reported open. */
55357
- doorOpen: boolean(),
55358
- /** True when remote start is allowed (door closed, power on, etc.). */
55359
- remoteStartAllowed: boolean(),
55360
- /** Main power / switched-on state. */
55361
- powerOn: boolean(),
55451
+ /** True when the door is reported open; null when the door state is not known. */
55452
+ doorOpen: boolean().nullable(),
55453
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55454
+ doorLocked: boolean().nullable(),
55455
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55456
+ remoteStartAllowed: boolean().nullable(),
55457
+ /** True when the appliance accepts remote control now; null when not known. */
55458
+ remoteControlActive: boolean().nullable(),
55459
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55460
+ localControlActive: boolean().nullable(),
55461
+ /** Main power / switched-on state; null when not known. */
55462
+ powerOn: boolean().nullable(),
55463
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55464
+ powerState: string().nullable(),
55362
55465
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
55363
55466
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55364
- halfLoad: boolean(),
55365
- hygienePlus: boolean(),
55467
+ /** Option states: null when the appliance does not expose the option or has not said. */
55468
+ halfLoad: boolean().nullable(),
55469
+ hygienePlus: boolean().nullable(),
55366
55470
  /** Extra dry option when the appliance exposes it. */
55367
- extraDry: boolean(),
55471
+ extraDry: boolean().nullable(),
55368
55472
  /** Intensive zone (lower basket) when the appliance exposes it. */
55369
- intensiveZone: boolean(),
55473
+ intensiveZone: boolean().nullable(),
55370
55474
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55371
- varioSpeedPlus: boolean(),
55372
- /** Child lock (controls disabled on the appliance). */
55373
- childLock: boolean(),
55475
+ varioSpeedPlus: boolean().nullable(),
55476
+ /** Child lock (controls disabled on the appliance); null when not known. */
55477
+ childLock: boolean().nullable(),
55478
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55479
+ activeEvents: array(string()),
55480
+ /** Numeric error code when the appliance reports one; null otherwise. */
55374
55481
  errorCode: number().nullable(),
55482
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55375
55483
  errorLabel: string().nullable(),
55484
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55376
55485
  lastFetchedAt: number()
55377
55486
  });
55487
+ var DeviceIdSchema = number().int().nonnegative();
55488
+ /** A value a program option or setting can take. */
55489
+ var DishwasherValueSchema = union([
55490
+ boolean(),
55491
+ string(),
55492
+ number()
55493
+ ]);
55494
+ var DishwasherAccessSchema = _enum([
55495
+ "none",
55496
+ "read",
55497
+ "readWrite",
55498
+ "writeOnly",
55499
+ "readStatic"
55500
+ ]);
55501
+ /**
55502
+ * One option or setting the appliance declares, with the constraints its description
55503
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55504
+ */
55505
+ var DishwasherOptionDescriptorSchema = object({
55506
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55507
+ key: string(),
55508
+ /** Last segment of the key, for display. */
55509
+ name: string(),
55510
+ type: _enum([
55511
+ "boolean",
55512
+ "number",
55513
+ "enum",
55514
+ "string"
55515
+ ]),
55516
+ access: DishwasherAccessSchema,
55517
+ /** The appliance reports this entity as currently available. */
55518
+ available: boolean(),
55519
+ /** Unit the description declares for a number; null when it declares none. */
55520
+ unit: string().nullable(),
55521
+ min: number().nullable(),
55522
+ max: number().nullable(),
55523
+ step: number().nullable(),
55524
+ /** Allowed members of an enum; null for other types. */
55525
+ enumValues: array(string()).nullable(),
55526
+ defaultValue: DishwasherValueSchema.nullable()
55527
+ });
55528
+ var DishwasherProgramSchema = object({
55529
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
55530
+ key: string(),
55531
+ name: string(),
55532
+ /** The appliance currently offers this program. */
55533
+ available: boolean(),
55534
+ /** The options this program lists, with the program-level access / availability / default. */
55535
+ options: array(DishwasherOptionDescriptorSchema)
55536
+ });
55537
+ var DishwasherOptionsSchema = object({
55538
+ availability: DishwasherAvailabilitySchema,
55539
+ /** What the appliance can be told to do, from the commands its description declares. */
55540
+ supportsStart: boolean(),
55541
+ supportsPause: boolean(),
55542
+ supportsResume: boolean(),
55543
+ supportsStop: boolean(),
55544
+ supportsPower: boolean(),
55545
+ /** Every program the description lists, with its options. */
55546
+ programs: array(DishwasherProgramSchema),
55547
+ /** Every option and setting entity the description lists (programs reference these by key). */
55548
+ options: array(DishwasherOptionDescriptorSchema)
55549
+ });
55378
55550
  var dishwasherCapability = {
55379
55551
  name: "dishwasher",
55380
55552
  scope: "device",
@@ -55382,86 +55554,102 @@ var dishwasherCapability = {
55382
55554
  mode: "singleton",
55383
55555
  deviceTypes: [DeviceType.Dishwasher],
55384
55556
  methods: {
55385
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55557
+ /**
55558
+ * Start a program. Without `program` the selected one starts. `options` are
55559
+ * option feature keys; each is checked against the program's constraints.
55560
+ */
55561
+ start: method(object({
55562
+ deviceId: DeviceIdSchema,
55563
+ program: string().min(1).optional(),
55564
+ options: record(string(), DishwasherValueSchema).optional()
55565
+ }), _void(), {
55386
55566
  kind: "mutation",
55387
55567
  auth: "protected"
55388
55568
  }),
55389
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55569
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55390
55570
  kind: "mutation",
55391
55571
  auth: "protected"
55392
55572
  }),
55393
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55573
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
55574
+ kind: "mutation",
55575
+ auth: "protected"
55576
+ }),
55577
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55394
55578
  kind: "mutation",
55395
55579
  auth: "protected"
55396
55580
  }),
55581
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55397
55582
  setProgram: method(object({
55398
- deviceId: number().int().nonnegative(),
55583
+ deviceId: DeviceIdSchema,
55399
55584
  program: string().min(1)
55400
55585
  }), _void(), {
55401
55586
  kind: "mutation",
55402
55587
  auth: "protected"
55403
55588
  }),
55404
55589
  setPower: method(object({
55405
- deviceId: number().int().nonnegative(),
55590
+ deviceId: DeviceIdSchema,
55406
55591
  on: boolean()
55407
55592
  }), _void(), {
55408
55593
  kind: "mutation",
55409
55594
  auth: "protected"
55410
55595
  }),
55411
55596
  setHalfLoad: method(object({
55412
- deviceId: number().int().nonnegative(),
55597
+ deviceId: DeviceIdSchema,
55413
55598
  on: boolean()
55414
55599
  }), _void(), {
55415
55600
  kind: "mutation",
55416
55601
  auth: "protected"
55417
55602
  }),
55418
55603
  setHygienePlus: 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
  setExtraDry: 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
  setIntensiveZone: 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
  setVarioSpeedPlus: 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
  setChildLock: 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
  }),
55638
+ /**
55639
+ * Write any option or setting by feature key. Refused when the description does
55640
+ * not list it, it is not writable or not available now, or the value is outside
55641
+ * its declared range / members.
55642
+ */
55453
55643
  setOption: method(object({
55454
- deviceId: number().int().nonnegative(),
55644
+ deviceId: DeviceIdSchema,
55455
55645
  key: string().min(1),
55456
- value: union([
55457
- boolean(),
55458
- string(),
55459
- number()
55460
- ])
55646
+ value: DishwasherValueSchema
55461
55647
  }), _void(), {
55462
55648
  kind: "mutation",
55463
55649
  auth: "protected"
55464
- })
55650
+ }),
55651
+ /** What this appliance can do, from its own description — the UI is derived from it. */
55652
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55465
55653
  },
55466
55654
  status: {
55467
55655
  schema: DishwasherStatusSchema,
@@ -69558,6 +69746,12 @@ Object.freeze({
69558
69746
  addonId: null,
69559
69747
  access: "view"
69560
69748
  },
69749
+ "dishwasher.getOptions": {
69750
+ capName: "dishwasher",
69751
+ capScope: "device",
69752
+ addonId: null,
69753
+ access: "view"
69754
+ },
69561
69755
  "dishwasher.getStatus": {
69562
69756
  capName: "dishwasher",
69563
69757
  capScope: "device",
@@ -69570,6 +69764,12 @@ Object.freeze({
69570
69764
  addonId: null,
69571
69765
  access: "create"
69572
69766
  },
69767
+ "dishwasher.resume": {
69768
+ capName: "dishwasher",
69769
+ capScope: "device",
69770
+ addonId: null,
69771
+ access: "create"
69772
+ },
69573
69773
  "dishwasher.setChildLock": {
69574
69774
  capName: "dishwasher",
69575
69775
  capScope: "device",
@@ -74070,6 +74270,12 @@ Object.freeze({
74070
74270
  addonId: null,
74071
74271
  access: "view"
74072
74272
  },
74273
+ "storageMigration.moverClearance": {
74274
+ capName: "storage-migration",
74275
+ capScope: "system",
74276
+ addonId: null,
74277
+ access: "view"
74278
+ },
74073
74279
  "storageMigration.movers": {
74074
74280
  capName: "storage-migration",
74075
74281
  capScope: "system",
@@ -76263,6 +76469,11 @@ Object.freeze({
76263
76469
  form: "single",
76264
76470
  optional: false
76265
76471
  }],
76472
+ "dishwasher.getOptions": [{
76473
+ name: "deviceId",
76474
+ form: "single",
76475
+ optional: false
76476
+ }],
76266
76477
  "dishwasher.getStatus": [{
76267
76478
  name: "deviceId",
76268
76479
  form: "single",
@@ -76273,6 +76484,11 @@ Object.freeze({
76273
76484
  form: "single",
76274
76485
  optional: false
76275
76486
  }],
76487
+ "dishwasher.resume": [{
76488
+ name: "deviceId",
76489
+ form: "single",
76490
+ optional: false
76491
+ }],
76276
76492
  "dishwasher.setChildLock": [{
76277
76493
  name: "deviceId",
76278
76494
  form: "single",
@@ -78359,6 +78575,9 @@ new Map(Object.entries({
78359
78575
  "wrapper-update-available": "system",
78360
78576
  "backup-completed": "system",
78361
78577
  "export-completed": "system",
78578
+ "alert-critical": "system",
78579
+ "alert-error": "system",
78580
+ "alert-critical-resolved": "system",
78362
78581
  "storage-location-low": "system",
78363
78582
  "storage-location-critical": "system",
78364
78583
  "storage-location-ok": "system",
@@ -78483,6 +78702,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
78483
78702
  "storage-location-ok"
78484
78703
  ]
78485
78704
  },
78705
+ {
78706
+ id: "alerts",
78707
+ family: "system",
78708
+ label: "Alerts",
78709
+ kinds: [
78710
+ "alert-critical",
78711
+ "alert-error",
78712
+ "alert-critical-resolved"
78713
+ ]
78714
+ },
78486
78715
  {
78487
78716
  id: "alarm",
78488
78717
  family: "alarm",
@@ -78527,6 +78756,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
78527
78756
  return [[descriptor.kind, field]];
78528
78757
  })));
78529
78758
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
78759
+ object({
78760
+ phase: _enum(["raised", "resolved"]),
78761
+ episodeId: string().min(1),
78762
+ alertId: string().min(1),
78763
+ severity: AlertSeveritySchema,
78764
+ category: string(),
78765
+ title: string(),
78766
+ message: string(),
78767
+ sourceType: string().optional(),
78768
+ sourceId: string().optional(),
78769
+ nodeId: string().optional(),
78770
+ /** The alert's own action link (where the operator acts on it), when it has one. */
78771
+ actionUrl: string().optional(),
78772
+ at: number()
78773
+ });
78530
78774
  var RULE_BODY_ONLY = ["body"];
78531
78775
  var RULE_TEXT = ["title", "body"];
78532
78776
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -78536,6 +78780,11 @@ var TANK = [
78536
78780
  "device-tank-full",
78537
78781
  "device-tank-normal"
78538
78782
  ];
78783
+ var ALERT_EPISODE = [
78784
+ "alert-critical",
78785
+ "alert-error",
78786
+ "alert-critical-resolved"
78787
+ ];
78539
78788
  var UPDATES = [
78540
78789
  "addon-update-available",
78541
78790
  "server-update-available",
@@ -78728,14 +78977,14 @@ var STATE_SUMMARY_VARS = [
78728
78977
  ([...RULE_TEXT], [...CONSUMABLE]),
78729
78978
  ([...RULE_TEXT], [...TANK]),
78730
78979
  [...RULE_TEXT],
78731
- ([...RULE_TEXT], [...UPDATES]),
78732
- ([...RULE_TEXT], [...UPDATES]),
78733
- [...RULE_TEXT],
78980
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78981
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78734
78982
  [...RULE_TEXT],
78735
78983
  [...RULE_TEXT],
78736
78984
  [...RULE_TEXT],
78737
78985
  [...RULE_TEXT],
78738
78986
  [...RULE_TEXT],
78987
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78739
78988
  [...RULE_TEXT],
78740
78989
  [...RULE_TEXT],
78741
78990
  [...RULE_TEXT],
@@ -78753,7 +79002,11 @@ var STATE_SUMMARY_VARS = [
78753
79002
  [...RULE_TEXT],
78754
79003
  [...RULE_TEXT],
78755
79004
  [...RULE_TEXT],
78756
- [...RULE_TEXT],
79005
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79006
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79007
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79008
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79009
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78757
79010
  [...RULE_TEXT],
78758
79011
  [...RULE_TEXT],
78759
79012
  [...RULE_TEXT],