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