@camstack/addon-provider-reolink 1.2.189 → 1.2.191

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
@@ -28,7 +28,7 @@ import { URL as URL$1 } from "url";
28
28
  import { spawn as spawn$1 } from "node:child_process";
29
29
  import os, { tmpdir } from "node:os";
30
30
  import { createReadStream } from "node:fs";
31
- //#region ../types/dist/event-category-BvOFi6PY.mjs
31
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
32
32
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
33
33
  EventCategory["SystemBoot"] = "system.boot";
34
34
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -107,9 +107,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
107
107
  /**
108
108
  * The node's one-shot runner boot check (D877): planned runners against the
109
109
  * process service, `degraded` when any is failed, refused or missing. The
110
- * alert centre turns it into one alert and a direct critical push.
110
+ * alert centre turns it into one critical alert.
111
111
  */
112
112
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
113
+ /**
114
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
115
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
116
+ * centre sends no notification of its own: Notification Center turns this
117
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
118
+ * system-event kinds, and reconciles from the alerts store because a bus
119
+ * event may be dropped (D8, D11).
120
+ */
121
+ EventCategory["AlertEpisode"] = "alert.episode";
113
122
  EventCategory["AddonError"] = "addon.error";
114
123
  EventCategory["AddonPageReady"] = "addon.page-ready";
115
124
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5434,7 +5443,7 @@ var ZodIssueCode = {
5434
5443
  var ZodFirstPartyTypeKind;
5435
5444
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5436
5445
  //#endregion
5437
- //#region ../types/dist/sleep-BegKjwUu.mjs
5446
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5438
5447
  /**
5439
5448
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5440
5449
  * window to float samples (D455).
@@ -7820,6 +7829,12 @@ function normalizeAddonInitResult(result) {
7820
7829
  if (Array.isArray(result)) return { providers: result };
7821
7830
  return result;
7822
7831
  }
7832
+ /**
7833
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7834
+ * and validates them (`share-token.service.ts` builds its enum from this
7835
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7836
+ */
7837
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7823
7838
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7824
7839
  var PeerBytesTicketSchema = object({
7825
7840
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -13099,6 +13114,229 @@ var ConvertResultSchema = object({
13099
13114
  files: array(string()).readonly()
13100
13115
  })).readonly()
13101
13116
  });
13117
+ /**
13118
+ * Zod schemas for persisted record types.
13119
+ *
13120
+ * These schemas serve as the single source of truth for types that are
13121
+ * stored in the settings-store backend and retrieved via tRPC. They
13122
+ * replace the manual TypeScript interfaces with schema-derived types,
13123
+ * enabling runtime validation when reading from the backend.
13124
+ *
13125
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
13126
+ * keeps the original name for backward compatibility.
13127
+ */
13128
+ /**
13129
+ * Auth model (v2 — 2026-05-12 caps-only):
13130
+ *
13131
+ * Two principals:
13132
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
13133
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
13134
+ *
13135
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
13136
+ * `super_admin` — collapsed onto the single boolean because every
13137
+ * non-admin caller is governed by the same scope-check rules; the
13138
+ * distinction was only ever used to route role-specific procedures
13139
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
13140
+ * with `isAdmin: false` + an explicit scope list.
13141
+ */
13142
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
13143
+ var MethodAccessSchema = _enum([
13144
+ "view",
13145
+ "create",
13146
+ "delete"
13147
+ ]);
13148
+ /**
13149
+ * A single scope grant. Three forms — checked in matcher with OR
13150
+ * semantics; the first match decides whether the call passes:
13151
+ *
13152
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
13153
+ * cap with the matching `scope` declaration. New caps inherit grants
13154
+ * automatically — adding a device cap to the codebase makes it
13155
+ * reachable to every user with `category:device [...]` without a
13156
+ * re-grant. Use this for "family viewer" / "operator" tiers.
13157
+ *
13158
+ * - `addon` — every cap that ships inside a given addon id. Niche;
13159
+ * useful when an integration needs to interact with one specific
13160
+ * addon's surface regardless of how many caps it exports.
13161
+ *
13162
+ * - `capability` — the most precise form. Single cap name. Use for
13163
+ * integration tokens where you want to grant `addons.installPackage`
13164
+ * and nothing else.
13165
+ *
13166
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
13167
+ * "give me everything" escape; there is no wildcard scope.
13168
+ */
13169
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
13170
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
13171
+ var CapScopeSchema = _enum(["device", "system"]);
13172
+ /**
13173
+ * DeviceSelector (scope model v3 — 2026-08-12).
13174
+ *
13175
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
13176
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
13177
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
13178
+ * AFTER the grant was minted — no re-grant, no re-login.
13179
+ *
13180
+ * - `all` — every device in the deployment. The broad viewer/operator
13181
+ * lever without a `category` grant (a `category` grant also covers device
13182
+ * caps that carry no deviceId; `all` is specifically the device set).
13183
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
13184
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
13185
+ * is NOT covered until the grant is edited.
13186
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
13187
+ * DYNAMIC. A device that changes type, or a new device of the type,
13188
+ * re-resolves on the next request.
13189
+ * - `locations` — every device whose operator-assigned `location` label is
13190
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
13191
+ * null/unset location matches NO `locations` selector.
13192
+ */
13193
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
13194
+ object({ kind: literal("all") }),
13195
+ object({
13196
+ kind: literal("ids"),
13197
+ ids: array(number().int()).min(1)
13198
+ }),
13199
+ object({
13200
+ kind: literal("types"),
13201
+ types: array(_enum(DeviceType)).min(1)
13202
+ }),
13203
+ object({
13204
+ kind: literal("locations"),
13205
+ locations: array(string().min(1)).min(1)
13206
+ })
13207
+ ]);
13208
+ var DeviceTokenScopeSchema = object({
13209
+ type: literal("device"),
13210
+ /** The device SET this grant covers — resolved against the live fleet. */
13211
+ selector: DeviceSelectorSchema,
13212
+ access: array(MethodAccessSchema).min(1),
13213
+ /**
13214
+ * Whether a grant on a PARENT device transparently covers its accessory
13215
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
13216
+ * Direction is parent → children ONLY.
13217
+ *
13218
+ * Absent → the matcher DERIVES it from the access flavour: `view`
13219
+ * inherits (a camera viewer sees the camera's accessories), `create` /
13220
+ * `delete` do NOT (actuating/removing a child is an explicit act the
13221
+ * operator must grant on the child, not inherit from the parent). Set it
13222
+ * explicitly to override that default per grant.
13223
+ */
13224
+ includeLinked: boolean().optional()
13225
+ });
13226
+ /**
13227
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
13228
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
13229
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
13230
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
13231
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
13232
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
13233
+ * migration cannot reach a JWT already in a client's hands; parse-time
13234
+ * migration covers both without a flag day. No cast — the raw object is read
13235
+ * through `Reflect.get` (its static type is `unknown`).
13236
+ */
13237
+ function migrateLegacyTokenScope(raw) {
13238
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
13239
+ if (Reflect.get(raw, "type") !== "device") return raw;
13240
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
13241
+ const targets = Reflect.get(raw, "targets");
13242
+ if (!Array.isArray(targets)) return raw;
13243
+ return {
13244
+ type: "device",
13245
+ selector: {
13246
+ kind: "ids",
13247
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
13248
+ },
13249
+ access: Reflect.get(raw, "access")
13250
+ };
13251
+ }
13252
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
13253
+ object({
13254
+ type: literal("category"),
13255
+ target: CapScopeSchema,
13256
+ access: array(MethodAccessSchema).min(1)
13257
+ }),
13258
+ object({
13259
+ type: literal("capability"),
13260
+ target: string(),
13261
+ access: array(MethodAccessSchema).min(1)
13262
+ }),
13263
+ object({
13264
+ type: literal("addon"),
13265
+ target: string(),
13266
+ access: array(MethodAccessSchema).min(1)
13267
+ }),
13268
+ DeviceTokenScopeSchema
13269
+ ]));
13270
+ object({
13271
+ id: string(),
13272
+ username: string(),
13273
+ passwordHash: string(),
13274
+ /**
13275
+ * Admin bypass. When true, the middleware skips the scope-access
13276
+ * check entirely. There is no other axis of privilege; the legacy
13277
+ * role enum collapsed onto this boolean in v2.
13278
+ */
13279
+ isAdmin: boolean().default(false),
13280
+ allowedProviders: AllowedProviderSchema,
13281
+ allowedDevices: AllowedDevicesSchema,
13282
+ /**
13283
+ * Scopes granted to this user. Admins bypass; their `scopes` is
13284
+ * ignored. Non-admins without scopes are locked out of every
13285
+ * protected call.
13286
+ */
13287
+ scopes: array(TokenScopeSchema).default([]),
13288
+ createdAt: number(),
13289
+ updatedAt: number()
13290
+ });
13291
+ object({
13292
+ id: string(),
13293
+ label: string(),
13294
+ isAdmin: boolean().default(false),
13295
+ allowedProviders: AllowedProviderSchema,
13296
+ allowedDevices: AllowedDevicesSchema,
13297
+ tokenHash: string(),
13298
+ tokenPrefix: string(),
13299
+ createdAt: number(),
13300
+ lastUsedAt: number().optional()
13301
+ });
13302
+ object({
13303
+ id: string(),
13304
+ userId: string(),
13305
+ name: string(),
13306
+ tokenHash: string(),
13307
+ tokenPrefix: string(),
13308
+ scopes: array(TokenScopeSchema),
13309
+ expiresAt: number().nullish(),
13310
+ lastUsedAt: number().nullish(),
13311
+ createdAt: number()
13312
+ });
13313
+ /** What a share-view grant lets its holder see. */
13314
+ var ShareViewGrantSchema = object({
13315
+ kind: _enum(SHARE_VIEW_KINDS),
13316
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
13317
+ /** Talk-back, opt-in at mint time; absent means off. */
13318
+ talk: boolean().optional()
13319
+ });
13320
+ var ShareViewScopeSchema = object({
13321
+ type: literal("share-view"),
13322
+ grant: ShareViewGrantSchema
13323
+ });
13324
+ var AddonRoutesScopeSchema = object({
13325
+ type: literal("addon-routes"),
13326
+ access: array(MethodAccessSchema).min(1)
13327
+ });
13328
+ var CredentialScopeSchema = union([
13329
+ literal("*"),
13330
+ ShareViewScopeSchema,
13331
+ AddonRoutesScopeSchema,
13332
+ TokenScopeSchema
13333
+ ]);
13334
+ object({
13335
+ kind: literal("credential"),
13336
+ sub: string().min(1),
13337
+ jti: string().min(16),
13338
+ scopes: array(CredentialScopeSchema).min(1)
13339
+ });
13102
13340
  _enum(["new-session", "step-up"]);
13103
13341
  /** The languages the hub's app landing pages are written in (D858). */
13104
13342
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13815,7 +14053,14 @@ var AlertSeveritySchema = _enum([
13815
14053
  ]);
13816
14054
  var AlertActionSchema = object({
13817
14055
  label: string(),
13818
- href: string().optional()
14056
+ href: string().optional(),
14057
+ /**
14058
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
14059
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
14060
+ * start) — the browser must leave the SPA with a full navigation, because
14061
+ * the SPA has no such route and would bounce to the home page.
14062
+ */
14063
+ navigation: _enum(["app", "server"]).optional()
13819
14064
  });
13820
14065
  var AlertStatusSchema = _enum([
13821
14066
  "active",
@@ -42684,6 +42929,9 @@ var NcSystemEventKindSchema = _enum([
42684
42929
  "server-updated",
42685
42930
  "export-completed",
42686
42931
  "backup-completed",
42932
+ "alert-critical",
42933
+ "alert-error",
42934
+ "alert-critical-resolved",
42687
42935
  "camera-online",
42688
42936
  "camera-offline",
42689
42937
  "camera-disabled",
@@ -44719,202 +44967,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44719
44967
  auth: "admin"
44720
44968
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44721
44969
  /**
44722
- * Zod schemas for persisted record types.
44723
- *
44724
- * These schemas serve as the single source of truth for types that are
44725
- * stored in the settings-store backend and retrieved via tRPC. They
44726
- * replace the manual TypeScript interfaces with schema-derived types,
44727
- * enabling runtime validation when reading from the backend.
44728
- *
44729
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44730
- * keeps the original name for backward compatibility.
44731
- */
44732
- /**
44733
- * Auth model (v2 — 2026-05-12 caps-only):
44734
- *
44735
- * Two principals:
44736
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44737
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44738
- *
44739
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44740
- * `super_admin` — collapsed onto the single boolean because every
44741
- * non-admin caller is governed by the same scope-check rules; the
44742
- * distinction was only ever used to route role-specific procedures
44743
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44744
- * with `isAdmin: false` + an explicit scope list.
44745
- */
44746
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44747
- var MethodAccessSchema = _enum([
44748
- "view",
44749
- "create",
44750
- "delete"
44751
- ]);
44752
- /**
44753
- * A single scope grant. Three forms — checked in matcher with OR
44754
- * semantics; the first match decides whether the call passes:
44755
- *
44756
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44757
- * cap with the matching `scope` declaration. New caps inherit grants
44758
- * automatically — adding a device cap to the codebase makes it
44759
- * reachable to every user with `category:device [...]` without a
44760
- * re-grant. Use this for "family viewer" / "operator" tiers.
44761
- *
44762
- * - `addon` — every cap that ships inside a given addon id. Niche;
44763
- * useful when an integration needs to interact with one specific
44764
- * addon's surface regardless of how many caps it exports.
44765
- *
44766
- * - `capability` — the most precise form. Single cap name. Use for
44767
- * integration tokens where you want to grant `addons.installPackage`
44768
- * and nothing else.
44769
- *
44770
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44771
- * "give me everything" escape; there is no wildcard scope.
44772
- */
44773
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44774
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44775
- var CapScopeSchema = _enum(["device", "system"]);
44776
- /**
44777
- * DeviceSelector (scope model v3 — 2026-08-12).
44778
- *
44779
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44780
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44781
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44782
- * AFTER the grant was minted — no re-grant, no re-login.
44783
- *
44784
- * - `all` — every device in the deployment. The broad viewer/operator
44785
- * lever without a `category` grant (a `category` grant also covers device
44786
- * caps that carry no deviceId; `all` is specifically the device set).
44787
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44788
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44789
- * is NOT covered until the grant is edited.
44790
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44791
- * DYNAMIC. A device that changes type, or a new device of the type,
44792
- * re-resolves on the next request.
44793
- * - `locations` — every device whose operator-assigned `location` label is
44794
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44795
- * null/unset location matches NO `locations` selector.
44796
- */
44797
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44798
- object({ kind: literal("all") }),
44799
- object({
44800
- kind: literal("ids"),
44801
- ids: array(number().int()).min(1)
44802
- }),
44803
- object({
44804
- kind: literal("types"),
44805
- types: array(_enum(DeviceType)).min(1)
44806
- }),
44807
- object({
44808
- kind: literal("locations"),
44809
- locations: array(string().min(1)).min(1)
44810
- })
44811
- ]);
44812
- var DeviceTokenScopeSchema = object({
44813
- type: literal("device"),
44814
- /** The device SET this grant covers — resolved against the live fleet. */
44815
- selector: DeviceSelectorSchema,
44816
- access: array(MethodAccessSchema).min(1),
44817
- /**
44818
- * Whether a grant on a PARENT device transparently covers its accessory
44819
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44820
- * Direction is parent → children ONLY.
44821
- *
44822
- * Absent → the matcher DERIVES it from the access flavour: `view`
44823
- * inherits (a camera viewer sees the camera's accessories), `create` /
44824
- * `delete` do NOT (actuating/removing a child is an explicit act the
44825
- * operator must grant on the child, not inherit from the parent). Set it
44826
- * explicitly to override that default per grant.
44827
- */
44828
- includeLinked: boolean().optional()
44829
- });
44830
- /**
44831
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44832
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44833
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44834
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44835
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44836
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44837
- * migration cannot reach a JWT already in a client's hands; parse-time
44838
- * migration covers both without a flag day. No cast — the raw object is read
44839
- * through `Reflect.get` (its static type is `unknown`).
44840
- */
44841
- function migrateLegacyTokenScope(raw) {
44842
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44843
- if (Reflect.get(raw, "type") !== "device") return raw;
44844
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44845
- const targets = Reflect.get(raw, "targets");
44846
- if (!Array.isArray(targets)) return raw;
44847
- return {
44848
- type: "device",
44849
- selector: {
44850
- kind: "ids",
44851
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44852
- },
44853
- access: Reflect.get(raw, "access")
44854
- };
44855
- }
44856
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44857
- object({
44858
- type: literal("category"),
44859
- target: CapScopeSchema,
44860
- access: array(MethodAccessSchema).min(1)
44861
- }),
44862
- object({
44863
- type: literal("capability"),
44864
- target: string(),
44865
- access: array(MethodAccessSchema).min(1)
44866
- }),
44867
- object({
44868
- type: literal("addon"),
44869
- target: string(),
44870
- access: array(MethodAccessSchema).min(1)
44871
- }),
44872
- DeviceTokenScopeSchema
44873
- ]));
44874
- object({
44875
- id: string(),
44876
- username: string(),
44877
- passwordHash: string(),
44878
- /**
44879
- * Admin bypass. When true, the middleware skips the scope-access
44880
- * check entirely. There is no other axis of privilege; the legacy
44881
- * role enum collapsed onto this boolean in v2.
44882
- */
44883
- isAdmin: boolean().default(false),
44884
- allowedProviders: AllowedProviderSchema,
44885
- allowedDevices: AllowedDevicesSchema,
44886
- /**
44887
- * Scopes granted to this user. Admins bypass; their `scopes` is
44888
- * ignored. Non-admins without scopes are locked out of every
44889
- * protected call.
44890
- */
44891
- scopes: array(TokenScopeSchema).default([]),
44892
- createdAt: number(),
44893
- updatedAt: number()
44894
- });
44895
- object({
44896
- id: string(),
44897
- label: string(),
44898
- isAdmin: boolean().default(false),
44899
- allowedProviders: AllowedProviderSchema,
44900
- allowedDevices: AllowedDevicesSchema,
44901
- tokenHash: string(),
44902
- tokenPrefix: string(),
44903
- createdAt: number(),
44904
- lastUsedAt: number().optional()
44905
- });
44906
- object({
44907
- id: string(),
44908
- userId: string(),
44909
- name: string(),
44910
- tokenHash: string(),
44911
- tokenPrefix: string(),
44912
- scopes: array(TokenScopeSchema),
44913
- expiresAt: number().nullish(),
44914
- lastUsedAt: number().nullish(),
44915
- createdAt: number()
44916
- });
44917
- /**
44918
44970
  * `oauth-integration` — a collection cap by which an addon declares
44919
44971
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44920
44972
  * Each provider returns a static descriptor; the core enumerates them
@@ -51864,7 +51916,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51864
51916
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51865
51917
  kind: "mutation",
51866
51918
  auth: "admin"
51867
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51919
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51920
+ clear: boolean(),
51921
+ repointLocationId: string().optional()
51922
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51868
51923
  kind: "mutation",
51869
51924
  auth: "admin"
51870
51925
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -56538,6 +56593,11 @@ onStatusChanged: { data: object({
56538
56593
  *
56539
56594
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
56540
56595
  * provider refreshes the slice on an interval and eagerly after commands.
56596
+ *
56597
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
56598
+ * nullable: `null` means "not known right now" (the appliance has not said,
56599
+ * the link is down, or the description does not carry it) and is never
56600
+ * rendered or exported as `false` / `0`. `availability` says why.
56541
56601
  */
56542
56602
  var DishwasherStateSchema = _enum([
56543
56603
  "idle",
@@ -56547,43 +56607,155 @@ var DishwasherStateSchema = _enum([
56547
56607
  "error",
56548
56608
  "unavailable"
56549
56609
  ]);
56610
+ /**
56611
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
56612
+ * view for compact surfaces; this is what the appliance said.
56613
+ */
56614
+ var DishwasherOperationStateSchema = _enum([
56615
+ "Inactive",
56616
+ "Ready",
56617
+ "DelayedStart",
56618
+ "Run",
56619
+ "Pause",
56620
+ "ActionRequired",
56621
+ "Finished",
56622
+ "Error",
56623
+ "Aborting"
56624
+ ]);
56625
+ /**
56626
+ * Why fields may be `null`:
56627
+ * - `available` — the link is up and the description is loaded;
56628
+ * - `offline` — the local link is down (values are unknown, not last-known);
56629
+ * - `description-missing` — the link is up but the appliance's description could not
56630
+ * be loaded, so its values cannot be decoded.
56631
+ */
56632
+ var DishwasherAvailabilitySchema = _enum([
56633
+ "available",
56634
+ "offline",
56635
+ "description-missing"
56636
+ ]);
56550
56637
  var DishwasherConsumableLevelSchema = _enum([
56551
56638
  "ok",
56552
56639
  "low",
56553
56640
  "empty"
56554
56641
  ]);
56555
56642
  var DishwasherStatusSchema = object({
56643
+ availability: DishwasherAvailabilitySchema,
56644
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
56556
56645
  state: DishwasherStateSchema,
56557
- /** Active program id/name, or null when none selected / unknown. */
56646
+ /** The appliance's operation state as reported; null when not known. */
56647
+ operationState: DishwasherOperationStateSchema.nullable(),
56648
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
56558
56649
  program: string().nullable(),
56559
- /** Program tokens the hardware accepts — drives the UI selector. */
56650
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
56651
+ selectedProgram: string().nullable(),
56652
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
56560
56653
  availablePrograms: array(string()),
56561
- /** Minutes remaining on the active cycle, or null when not running. */
56562
- remainingMinutes: number().int().nonnegative().nullable(),
56654
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
56655
+ remainingSeconds: number().int().nonnegative().nullable(),
56656
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
56657
+ delayedStartSeconds: number().int().nonnegative().nullable(),
56563
56658
  /** Cycle completion 0..100, or null when not applicable. */
56564
56659
  progressPercent: number().min(0).max(100).nullable(),
56565
- /** True when the door is reported open. */
56566
- doorOpen: boolean(),
56567
- /** True when remote start is allowed (door closed, power on, etc.). */
56568
- remoteStartAllowed: boolean(),
56569
- /** Main power / switched-on state. */
56570
- powerOn: boolean(),
56660
+ /** True when the door is reported open; null when the door state is not known. */
56661
+ doorOpen: boolean().nullable(),
56662
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
56663
+ doorLocked: boolean().nullable(),
56664
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
56665
+ remoteStartAllowed: boolean().nullable(),
56666
+ /** True when the appliance accepts remote control now; null when not known. */
56667
+ remoteControlActive: boolean().nullable(),
56668
+ /** True while somebody operates the appliance at its panel; null when not reported. */
56669
+ localControlActive: boolean().nullable(),
56670
+ /** Main power / switched-on state; null when not known. */
56671
+ powerOn: boolean().nullable(),
56672
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
56673
+ powerState: string().nullable(),
56571
56674
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
56572
56675
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
56573
- halfLoad: boolean(),
56574
- hygienePlus: boolean(),
56676
+ /** Option states: null when the appliance does not expose the option or has not said. */
56677
+ halfLoad: boolean().nullable(),
56678
+ hygienePlus: boolean().nullable(),
56575
56679
  /** Extra dry option when the appliance exposes it. */
56576
- extraDry: boolean(),
56680
+ extraDry: boolean().nullable(),
56577
56681
  /** Intensive zone (lower basket) when the appliance exposes it. */
56578
- intensiveZone: boolean(),
56682
+ intensiveZone: boolean().nullable(),
56579
56683
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
56580
- varioSpeedPlus: boolean(),
56581
- /** Child lock (controls disabled on the appliance). */
56582
- childLock: boolean(),
56684
+ varioSpeedPlus: boolean().nullable(),
56685
+ /** Child lock (controls disabled on the appliance); null when not known. */
56686
+ childLock: boolean().nullable(),
56687
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
56688
+ activeEvents: array(string()),
56689
+ /** Numeric error code when the appliance reports one; null otherwise. */
56583
56690
  errorCode: number().nullable(),
56691
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
56584
56692
  errorLabel: string().nullable(),
56693
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
56585
56694
  lastFetchedAt: number()
56586
56695
  });
56696
+ var DeviceIdSchema = number().int().nonnegative();
56697
+ /** A value a program option or setting can take. */
56698
+ var DishwasherValueSchema = union([
56699
+ boolean(),
56700
+ string(),
56701
+ number()
56702
+ ]);
56703
+ var DishwasherAccessSchema = _enum([
56704
+ "none",
56705
+ "read",
56706
+ "readWrite",
56707
+ "writeOnly",
56708
+ "readStatic"
56709
+ ]);
56710
+ /**
56711
+ * One option or setting the appliance declares, with the constraints its description
56712
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
56713
+ */
56714
+ var DishwasherOptionDescriptorSchema = object({
56715
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
56716
+ key: string(),
56717
+ /** Last segment of the key, for display. */
56718
+ name: string(),
56719
+ type: _enum([
56720
+ "boolean",
56721
+ "number",
56722
+ "enum",
56723
+ "string"
56724
+ ]),
56725
+ access: DishwasherAccessSchema,
56726
+ /** The appliance reports this entity as currently available. */
56727
+ available: boolean(),
56728
+ /** Unit the description declares for a number; null when it declares none. */
56729
+ unit: string().nullable(),
56730
+ min: number().nullable(),
56731
+ max: number().nullable(),
56732
+ step: number().nullable(),
56733
+ /** Allowed members of an enum; null for other types. */
56734
+ enumValues: array(string()).nullable(),
56735
+ defaultValue: DishwasherValueSchema.nullable()
56736
+ });
56737
+ var DishwasherProgramSchema = object({
56738
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
56739
+ key: string(),
56740
+ name: string(),
56741
+ /** The appliance currently offers this program. */
56742
+ available: boolean(),
56743
+ /** The options this program lists, with the program-level access / availability / default. */
56744
+ options: array(DishwasherOptionDescriptorSchema)
56745
+ });
56746
+ var DishwasherOptionsSchema = object({
56747
+ availability: DishwasherAvailabilitySchema,
56748
+ /** What the appliance can be told to do, from the commands its description declares. */
56749
+ supportsStart: boolean(),
56750
+ supportsPause: boolean(),
56751
+ supportsResume: boolean(),
56752
+ supportsStop: boolean(),
56753
+ supportsPower: boolean(),
56754
+ /** Every program the description lists, with its options. */
56755
+ programs: array(DishwasherProgramSchema),
56756
+ /** Every option and setting entity the description lists (programs reference these by key). */
56757
+ options: array(DishwasherOptionDescriptorSchema)
56758
+ });
56587
56759
  var dishwasherCapability = {
56588
56760
  name: "dishwasher",
56589
56761
  scope: "device",
@@ -56591,86 +56763,102 @@ var dishwasherCapability = {
56591
56763
  mode: "singleton",
56592
56764
  deviceTypes: [DeviceType.Dishwasher],
56593
56765
  methods: {
56594
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56766
+ /**
56767
+ * Start a program. Without `program` the selected one starts. `options` are
56768
+ * option feature keys; each is checked against the program's constraints.
56769
+ */
56770
+ start: method(object({
56771
+ deviceId: DeviceIdSchema,
56772
+ program: string().min(1).optional(),
56773
+ options: record(string(), DishwasherValueSchema).optional()
56774
+ }), _void(), {
56595
56775
  kind: "mutation",
56596
56776
  auth: "protected"
56597
56777
  }),
56598
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56778
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
56599
56779
  kind: "mutation",
56600
56780
  auth: "protected"
56601
56781
  }),
56602
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56782
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
56783
+ kind: "mutation",
56784
+ auth: "protected"
56785
+ }),
56786
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
56603
56787
  kind: "mutation",
56604
56788
  auth: "protected"
56605
56789
  }),
56790
+ /** Select (not start) a program; refused when the appliance does not offer it. */
56606
56791
  setProgram: method(object({
56607
- deviceId: number().int().nonnegative(),
56792
+ deviceId: DeviceIdSchema,
56608
56793
  program: string().min(1)
56609
56794
  }), _void(), {
56610
56795
  kind: "mutation",
56611
56796
  auth: "protected"
56612
56797
  }),
56613
56798
  setPower: method(object({
56614
- deviceId: number().int().nonnegative(),
56799
+ deviceId: DeviceIdSchema,
56615
56800
  on: boolean()
56616
56801
  }), _void(), {
56617
56802
  kind: "mutation",
56618
56803
  auth: "protected"
56619
56804
  }),
56620
56805
  setHalfLoad: method(object({
56621
- deviceId: number().int().nonnegative(),
56806
+ deviceId: DeviceIdSchema,
56622
56807
  on: boolean()
56623
56808
  }), _void(), {
56624
56809
  kind: "mutation",
56625
56810
  auth: "protected"
56626
56811
  }),
56627
56812
  setHygienePlus: method(object({
56628
- deviceId: number().int().nonnegative(),
56813
+ deviceId: DeviceIdSchema,
56629
56814
  on: boolean()
56630
56815
  }), _void(), {
56631
56816
  kind: "mutation",
56632
56817
  auth: "protected"
56633
56818
  }),
56634
56819
  setExtraDry: method(object({
56635
- deviceId: number().int().nonnegative(),
56820
+ deviceId: DeviceIdSchema,
56636
56821
  on: boolean()
56637
56822
  }), _void(), {
56638
56823
  kind: "mutation",
56639
56824
  auth: "protected"
56640
56825
  }),
56641
56826
  setIntensiveZone: method(object({
56642
- deviceId: number().int().nonnegative(),
56827
+ deviceId: DeviceIdSchema,
56643
56828
  on: boolean()
56644
56829
  }), _void(), {
56645
56830
  kind: "mutation",
56646
56831
  auth: "protected"
56647
56832
  }),
56648
56833
  setVarioSpeedPlus: method(object({
56649
- deviceId: number().int().nonnegative(),
56834
+ deviceId: DeviceIdSchema,
56650
56835
  on: boolean()
56651
56836
  }), _void(), {
56652
56837
  kind: "mutation",
56653
56838
  auth: "protected"
56654
56839
  }),
56655
56840
  setChildLock: method(object({
56656
- deviceId: number().int().nonnegative(),
56841
+ deviceId: DeviceIdSchema,
56657
56842
  on: boolean()
56658
56843
  }), _void(), {
56659
56844
  kind: "mutation",
56660
56845
  auth: "protected"
56661
56846
  }),
56847
+ /**
56848
+ * Write any option or setting by feature key. Refused when the description does
56849
+ * not list it, it is not writable or not available now, or the value is outside
56850
+ * its declared range / members.
56851
+ */
56662
56852
  setOption: method(object({
56663
- deviceId: number().int().nonnegative(),
56853
+ deviceId: DeviceIdSchema,
56664
56854
  key: string().min(1),
56665
- value: union([
56666
- boolean(),
56667
- string(),
56668
- number()
56669
- ])
56855
+ value: DishwasherValueSchema
56670
56856
  }), _void(), {
56671
56857
  kind: "mutation",
56672
56858
  auth: "protected"
56673
- })
56859
+ }),
56860
+ /** What this appliance can do, from its own description — the UI is derived from it. */
56861
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
56674
56862
  },
56675
56863
  status: {
56676
56864
  schema: DishwasherStatusSchema,
@@ -71204,6 +71392,12 @@ Object.freeze({
71204
71392
  addonId: null,
71205
71393
  access: "view"
71206
71394
  },
71395
+ "dishwasher.getOptions": {
71396
+ capName: "dishwasher",
71397
+ capScope: "device",
71398
+ addonId: null,
71399
+ access: "view"
71400
+ },
71207
71401
  "dishwasher.getStatus": {
71208
71402
  capName: "dishwasher",
71209
71403
  capScope: "device",
@@ -71216,6 +71410,12 @@ Object.freeze({
71216
71410
  addonId: null,
71217
71411
  access: "create"
71218
71412
  },
71413
+ "dishwasher.resume": {
71414
+ capName: "dishwasher",
71415
+ capScope: "device",
71416
+ addonId: null,
71417
+ access: "create"
71418
+ },
71219
71419
  "dishwasher.setChildLock": {
71220
71420
  capName: "dishwasher",
71221
71421
  capScope: "device",
@@ -75716,6 +75916,12 @@ Object.freeze({
75716
75916
  addonId: null,
75717
75917
  access: "view"
75718
75918
  },
75919
+ "storageMigration.moverClearance": {
75920
+ capName: "storage-migration",
75921
+ capScope: "system",
75922
+ addonId: null,
75923
+ access: "view"
75924
+ },
75719
75925
  "storageMigration.movers": {
75720
75926
  capName: "storage-migration",
75721
75927
  capScope: "system",
@@ -78061,6 +78267,11 @@ Object.freeze({
78061
78267
  form: "single",
78062
78268
  optional: false
78063
78269
  }],
78270
+ "dishwasher.getOptions": [{
78271
+ name: "deviceId",
78272
+ form: "single",
78273
+ optional: false
78274
+ }],
78064
78275
  "dishwasher.getStatus": [{
78065
78276
  name: "deviceId",
78066
78277
  form: "single",
@@ -78071,6 +78282,11 @@ Object.freeze({
78071
78282
  form: "single",
78072
78283
  optional: false
78073
78284
  }],
78285
+ "dishwasher.resume": [{
78286
+ name: "deviceId",
78287
+ form: "single",
78288
+ optional: false
78289
+ }],
78074
78290
  "dishwasher.setChildLock": [{
78075
78291
  name: "deviceId",
78076
78292
  form: "single",
@@ -80157,6 +80373,9 @@ new Map(Object.entries({
80157
80373
  "wrapper-update-available": "system",
80158
80374
  "backup-completed": "system",
80159
80375
  "export-completed": "system",
80376
+ "alert-critical": "system",
80377
+ "alert-error": "system",
80378
+ "alert-critical-resolved": "system",
80160
80379
  "storage-location-low": "system",
80161
80380
  "storage-location-critical": "system",
80162
80381
  "storage-location-ok": "system",
@@ -80281,6 +80500,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
80281
80500
  "storage-location-ok"
80282
80501
  ]
80283
80502
  },
80503
+ {
80504
+ id: "alerts",
80505
+ family: "system",
80506
+ label: "Alerts",
80507
+ kinds: [
80508
+ "alert-critical",
80509
+ "alert-error",
80510
+ "alert-critical-resolved"
80511
+ ]
80512
+ },
80284
80513
  {
80285
80514
  id: "alarm",
80286
80515
  family: "alarm",
@@ -80325,6 +80554,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
80325
80554
  return [[descriptor.kind, field]];
80326
80555
  })));
80327
80556
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
80557
+ object({
80558
+ phase: _enum(["raised", "resolved"]),
80559
+ episodeId: string().min(1),
80560
+ alertId: string().min(1),
80561
+ severity: AlertSeveritySchema,
80562
+ category: string(),
80563
+ title: string(),
80564
+ message: string(),
80565
+ sourceType: string().optional(),
80566
+ sourceId: string().optional(),
80567
+ nodeId: string().optional(),
80568
+ /** The alert's own action link (where the operator acts on it), when it has one. */
80569
+ actionUrl: string().optional(),
80570
+ at: number()
80571
+ });
80328
80572
  var RULE_BODY_ONLY = ["body"];
80329
80573
  var RULE_TEXT = ["title", "body"];
80330
80574
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -80334,6 +80578,11 @@ var TANK = [
80334
80578
  "device-tank-full",
80335
80579
  "device-tank-normal"
80336
80580
  ];
80581
+ var ALERT_EPISODE = [
80582
+ "alert-critical",
80583
+ "alert-error",
80584
+ "alert-critical-resolved"
80585
+ ];
80337
80586
  var UPDATES = [
80338
80587
  "addon-update-available",
80339
80588
  "server-update-available",
@@ -80526,14 +80775,14 @@ var STATE_SUMMARY_VARS = [
80526
80775
  ([...RULE_TEXT], [...CONSUMABLE]),
80527
80776
  ([...RULE_TEXT], [...TANK]),
80528
80777
  [...RULE_TEXT],
80529
- ([...RULE_TEXT], [...UPDATES]),
80530
- ([...RULE_TEXT], [...UPDATES]),
80531
- [...RULE_TEXT],
80778
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
80779
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
80532
80780
  [...RULE_TEXT],
80533
80781
  [...RULE_TEXT],
80534
80782
  [...RULE_TEXT],
80535
80783
  [...RULE_TEXT],
80536
80784
  [...RULE_TEXT],
80785
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80537
80786
  [...RULE_TEXT],
80538
80787
  [...RULE_TEXT],
80539
80788
  [...RULE_TEXT],
@@ -80551,7 +80800,11 @@ var STATE_SUMMARY_VARS = [
80551
80800
  [...RULE_TEXT],
80552
80801
  [...RULE_TEXT],
80553
80802
  [...RULE_TEXT],
80554
- [...RULE_TEXT],
80803
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80804
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80805
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80806
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80807
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80555
80808
  [...RULE_TEXT],
80556
80809
  [...RULE_TEXT],
80557
80810
  [...RULE_TEXT],