@camstack/addon-provider-tuya 0.2.127 → 0.2.129

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
@@ -819,7 +819,7 @@ async function discoverDevices(options = {}, binder = createDgramBinder()) {
819
819
  return [...byId.values()];
820
820
  }
821
821
  //#endregion
822
- //#region ../types/dist/event-category-BvOFi6PY.mjs
822
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
823
823
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
824
824
  EventCategory["SystemBoot"] = "system.boot";
825
825
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -898,9 +898,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
898
898
  /**
899
899
  * The node's one-shot runner boot check (D877): planned runners against the
900
900
  * process service, `degraded` when any is failed, refused or missing. The
901
- * alert centre turns it into one alert and a direct critical push.
901
+ * alert centre turns it into one critical alert.
902
902
  */
903
903
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
904
+ /**
905
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
906
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
907
+ * centre sends no notification of its own: Notification Center turns this
908
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
909
+ * system-event kinds, and reconciles from the alerts store because a bus
910
+ * event may be dropped (D8, D11).
911
+ */
912
+ EventCategory["AlertEpisode"] = "alert.episode";
904
913
  EventCategory["AddonError"] = "addon.error";
905
914
  EventCategory["AddonPageReady"] = "addon.page-ready";
906
915
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -6225,7 +6234,7 @@ var ZodIssueCode = {
6225
6234
  var ZodFirstPartyTypeKind;
6226
6235
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6227
6236
  //#endregion
6228
- //#region ../types/dist/sleep-BegKjwUu.mjs
6237
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
6229
6238
  /**
6230
6239
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6231
6240
  * window to float samples (D455).
@@ -8607,6 +8616,12 @@ function normalizeAddonInitResult(result) {
8607
8616
  if (Array.isArray(result)) return { providers: result };
8608
8617
  return result;
8609
8618
  }
8619
+ /**
8620
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
8621
+ * and validates them (`share-token.service.ts` builds its enum from this
8622
+ * list); a data plane names the kinds it ACCEPTS in `share`.
8623
+ */
8624
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
8610
8625
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
8611
8626
  var PeerBytesTicketSchema = object({
8612
8627
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -13272,6 +13287,229 @@ var ConvertResultSchema = object({
13272
13287
  files: array(string()).readonly()
13273
13288
  })).readonly()
13274
13289
  });
13290
+ /**
13291
+ * Zod schemas for persisted record types.
13292
+ *
13293
+ * These schemas serve as the single source of truth for types that are
13294
+ * stored in the settings-store backend and retrieved via tRPC. They
13295
+ * replace the manual TypeScript interfaces with schema-derived types,
13296
+ * enabling runtime validation when reading from the backend.
13297
+ *
13298
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
13299
+ * keeps the original name for backward compatibility.
13300
+ */
13301
+ /**
13302
+ * Auth model (v2 — 2026-05-12 caps-only):
13303
+ *
13304
+ * Two principals:
13305
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
13306
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
13307
+ *
13308
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
13309
+ * `super_admin` — collapsed onto the single boolean because every
13310
+ * non-admin caller is governed by the same scope-check rules; the
13311
+ * distinction was only ever used to route role-specific procedures
13312
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
13313
+ * with `isAdmin: false` + an explicit scope list.
13314
+ */
13315
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
13316
+ var MethodAccessSchema = _enum([
13317
+ "view",
13318
+ "create",
13319
+ "delete"
13320
+ ]);
13321
+ /**
13322
+ * A single scope grant. Three forms — checked in matcher with OR
13323
+ * semantics; the first match decides whether the call passes:
13324
+ *
13325
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
13326
+ * cap with the matching `scope` declaration. New caps inherit grants
13327
+ * automatically — adding a device cap to the codebase makes it
13328
+ * reachable to every user with `category:device [...]` without a
13329
+ * re-grant. Use this for "family viewer" / "operator" tiers.
13330
+ *
13331
+ * - `addon` — every cap that ships inside a given addon id. Niche;
13332
+ * useful when an integration needs to interact with one specific
13333
+ * addon's surface regardless of how many caps it exports.
13334
+ *
13335
+ * - `capability` — the most precise form. Single cap name. Use for
13336
+ * integration tokens where you want to grant `addons.installPackage`
13337
+ * and nothing else.
13338
+ *
13339
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
13340
+ * "give me everything" escape; there is no wildcard scope.
13341
+ */
13342
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
13343
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
13344
+ var CapScopeSchema = _enum(["device", "system"]);
13345
+ /**
13346
+ * DeviceSelector (scope model v3 — 2026-08-12).
13347
+ *
13348
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
13349
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
13350
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
13351
+ * AFTER the grant was minted — no re-grant, no re-login.
13352
+ *
13353
+ * - `all` — every device in the deployment. The broad viewer/operator
13354
+ * lever without a `category` grant (a `category` grant also covers device
13355
+ * caps that carry no deviceId; `all` is specifically the device set).
13356
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
13357
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
13358
+ * is NOT covered until the grant is edited.
13359
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
13360
+ * DYNAMIC. A device that changes type, or a new device of the type,
13361
+ * re-resolves on the next request.
13362
+ * - `locations` — every device whose operator-assigned `location` label is
13363
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
13364
+ * null/unset location matches NO `locations` selector.
13365
+ */
13366
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
13367
+ object({ kind: literal("all") }),
13368
+ object({
13369
+ kind: literal("ids"),
13370
+ ids: array(number().int()).min(1)
13371
+ }),
13372
+ object({
13373
+ kind: literal("types"),
13374
+ types: array(_enum(DeviceType)).min(1)
13375
+ }),
13376
+ object({
13377
+ kind: literal("locations"),
13378
+ locations: array(string().min(1)).min(1)
13379
+ })
13380
+ ]);
13381
+ var DeviceTokenScopeSchema = object({
13382
+ type: literal("device"),
13383
+ /** The device SET this grant covers — resolved against the live fleet. */
13384
+ selector: DeviceSelectorSchema,
13385
+ access: array(MethodAccessSchema).min(1),
13386
+ /**
13387
+ * Whether a grant on a PARENT device transparently covers its accessory
13388
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
13389
+ * Direction is parent → children ONLY.
13390
+ *
13391
+ * Absent → the matcher DERIVES it from the access flavour: `view`
13392
+ * inherits (a camera viewer sees the camera's accessories), `create` /
13393
+ * `delete` do NOT (actuating/removing a child is an explicit act the
13394
+ * operator must grant on the child, not inherit from the parent). Set it
13395
+ * explicitly to override that default per grant.
13396
+ */
13397
+ includeLinked: boolean().optional()
13398
+ });
13399
+ /**
13400
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
13401
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
13402
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
13403
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
13404
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
13405
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
13406
+ * migration cannot reach a JWT already in a client's hands; parse-time
13407
+ * migration covers both without a flag day. No cast — the raw object is read
13408
+ * through `Reflect.get` (its static type is `unknown`).
13409
+ */
13410
+ function migrateLegacyTokenScope(raw) {
13411
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
13412
+ if (Reflect.get(raw, "type") !== "device") return raw;
13413
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
13414
+ const targets = Reflect.get(raw, "targets");
13415
+ if (!Array.isArray(targets)) return raw;
13416
+ return {
13417
+ type: "device",
13418
+ selector: {
13419
+ kind: "ids",
13420
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
13421
+ },
13422
+ access: Reflect.get(raw, "access")
13423
+ };
13424
+ }
13425
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
13426
+ object({
13427
+ type: literal("category"),
13428
+ target: CapScopeSchema,
13429
+ access: array(MethodAccessSchema).min(1)
13430
+ }),
13431
+ object({
13432
+ type: literal("capability"),
13433
+ target: string(),
13434
+ access: array(MethodAccessSchema).min(1)
13435
+ }),
13436
+ object({
13437
+ type: literal("addon"),
13438
+ target: string(),
13439
+ access: array(MethodAccessSchema).min(1)
13440
+ }),
13441
+ DeviceTokenScopeSchema
13442
+ ]));
13443
+ object({
13444
+ id: string(),
13445
+ username: string(),
13446
+ passwordHash: string(),
13447
+ /**
13448
+ * Admin bypass. When true, the middleware skips the scope-access
13449
+ * check entirely. There is no other axis of privilege; the legacy
13450
+ * role enum collapsed onto this boolean in v2.
13451
+ */
13452
+ isAdmin: boolean().default(false),
13453
+ allowedProviders: AllowedProviderSchema,
13454
+ allowedDevices: AllowedDevicesSchema,
13455
+ /**
13456
+ * Scopes granted to this user. Admins bypass; their `scopes` is
13457
+ * ignored. Non-admins without scopes are locked out of every
13458
+ * protected call.
13459
+ */
13460
+ scopes: array(TokenScopeSchema).default([]),
13461
+ createdAt: number(),
13462
+ updatedAt: number()
13463
+ });
13464
+ object({
13465
+ id: string(),
13466
+ label: string(),
13467
+ isAdmin: boolean().default(false),
13468
+ allowedProviders: AllowedProviderSchema,
13469
+ allowedDevices: AllowedDevicesSchema,
13470
+ tokenHash: string(),
13471
+ tokenPrefix: string(),
13472
+ createdAt: number(),
13473
+ lastUsedAt: number().optional()
13474
+ });
13475
+ object({
13476
+ id: string(),
13477
+ userId: string(),
13478
+ name: string(),
13479
+ tokenHash: string(),
13480
+ tokenPrefix: string(),
13481
+ scopes: array(TokenScopeSchema),
13482
+ expiresAt: number().nullish(),
13483
+ lastUsedAt: number().nullish(),
13484
+ createdAt: number()
13485
+ });
13486
+ /** What a share-view grant lets its holder see. */
13487
+ var ShareViewGrantSchema = object({
13488
+ kind: _enum(SHARE_VIEW_KINDS),
13489
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
13490
+ /** Talk-back, opt-in at mint time; absent means off. */
13491
+ talk: boolean().optional()
13492
+ });
13493
+ var ShareViewScopeSchema = object({
13494
+ type: literal("share-view"),
13495
+ grant: ShareViewGrantSchema
13496
+ });
13497
+ var AddonRoutesScopeSchema = object({
13498
+ type: literal("addon-routes"),
13499
+ access: array(MethodAccessSchema).min(1)
13500
+ });
13501
+ var CredentialScopeSchema = union([
13502
+ literal("*"),
13503
+ ShareViewScopeSchema,
13504
+ AddonRoutesScopeSchema,
13505
+ TokenScopeSchema
13506
+ ]);
13507
+ object({
13508
+ kind: literal("credential"),
13509
+ sub: string().min(1),
13510
+ jti: string().min(16),
13511
+ scopes: array(CredentialScopeSchema).min(1)
13512
+ });
13275
13513
  _enum(["new-session", "step-up"]);
13276
13514
  /** The languages the hub's app landing pages are written in (D858). */
13277
13515
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13988,7 +14226,14 @@ var AlertSeveritySchema = _enum([
13988
14226
  ]);
13989
14227
  var AlertActionSchema = object({
13990
14228
  label: string(),
13991
- href: string().optional()
14229
+ href: string().optional(),
14230
+ /**
14231
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
14232
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
14233
+ * start) — the browser must leave the SPA with a full navigation, because
14234
+ * the SPA has no such route and would bounce to the home page.
14235
+ */
14236
+ navigation: _enum(["app", "server"]).optional()
13992
14237
  });
13993
14238
  var AlertStatusSchema = _enum([
13994
14239
  "active",
@@ -42721,6 +42966,9 @@ var NcSystemEventKindSchema = _enum([
42721
42966
  "server-updated",
42722
42967
  "export-completed",
42723
42968
  "backup-completed",
42969
+ "alert-critical",
42970
+ "alert-error",
42971
+ "alert-critical-resolved",
42724
42972
  "camera-online",
42725
42973
  "camera-offline",
42726
42974
  "camera-disabled",
@@ -44756,202 +45004,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44756
45004
  auth: "admin"
44757
45005
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44758
45006
  /**
44759
- * Zod schemas for persisted record types.
44760
- *
44761
- * These schemas serve as the single source of truth for types that are
44762
- * stored in the settings-store backend and retrieved via tRPC. They
44763
- * replace the manual TypeScript interfaces with schema-derived types,
44764
- * enabling runtime validation when reading from the backend.
44765
- *
44766
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44767
- * keeps the original name for backward compatibility.
44768
- */
44769
- /**
44770
- * Auth model (v2 — 2026-05-12 caps-only):
44771
- *
44772
- * Two principals:
44773
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44774
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44775
- *
44776
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44777
- * `super_admin` — collapsed onto the single boolean because every
44778
- * non-admin caller is governed by the same scope-check rules; the
44779
- * distinction was only ever used to route role-specific procedures
44780
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44781
- * with `isAdmin: false` + an explicit scope list.
44782
- */
44783
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44784
- var MethodAccessSchema = _enum([
44785
- "view",
44786
- "create",
44787
- "delete"
44788
- ]);
44789
- /**
44790
- * A single scope grant. Three forms — checked in matcher with OR
44791
- * semantics; the first match decides whether the call passes:
44792
- *
44793
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44794
- * cap with the matching `scope` declaration. New caps inherit grants
44795
- * automatically — adding a device cap to the codebase makes it
44796
- * reachable to every user with `category:device [...]` without a
44797
- * re-grant. Use this for "family viewer" / "operator" tiers.
44798
- *
44799
- * - `addon` — every cap that ships inside a given addon id. Niche;
44800
- * useful when an integration needs to interact with one specific
44801
- * addon's surface regardless of how many caps it exports.
44802
- *
44803
- * - `capability` — the most precise form. Single cap name. Use for
44804
- * integration tokens where you want to grant `addons.installPackage`
44805
- * and nothing else.
44806
- *
44807
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44808
- * "give me everything" escape; there is no wildcard scope.
44809
- */
44810
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44811
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44812
- var CapScopeSchema = _enum(["device", "system"]);
44813
- /**
44814
- * DeviceSelector (scope model v3 — 2026-08-12).
44815
- *
44816
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44817
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44818
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44819
- * AFTER the grant was minted — no re-grant, no re-login.
44820
- *
44821
- * - `all` — every device in the deployment. The broad viewer/operator
44822
- * lever without a `category` grant (a `category` grant also covers device
44823
- * caps that carry no deviceId; `all` is specifically the device set).
44824
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44825
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44826
- * is NOT covered until the grant is edited.
44827
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44828
- * DYNAMIC. A device that changes type, or a new device of the type,
44829
- * re-resolves on the next request.
44830
- * - `locations` — every device whose operator-assigned `location` label is
44831
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44832
- * null/unset location matches NO `locations` selector.
44833
- */
44834
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44835
- object({ kind: literal("all") }),
44836
- object({
44837
- kind: literal("ids"),
44838
- ids: array(number().int()).min(1)
44839
- }),
44840
- object({
44841
- kind: literal("types"),
44842
- types: array(_enum(DeviceType)).min(1)
44843
- }),
44844
- object({
44845
- kind: literal("locations"),
44846
- locations: array(string().min(1)).min(1)
44847
- })
44848
- ]);
44849
- var DeviceTokenScopeSchema = object({
44850
- type: literal("device"),
44851
- /** The device SET this grant covers — resolved against the live fleet. */
44852
- selector: DeviceSelectorSchema,
44853
- access: array(MethodAccessSchema).min(1),
44854
- /**
44855
- * Whether a grant on a PARENT device transparently covers its accessory
44856
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44857
- * Direction is parent → children ONLY.
44858
- *
44859
- * Absent → the matcher DERIVES it from the access flavour: `view`
44860
- * inherits (a camera viewer sees the camera's accessories), `create` /
44861
- * `delete` do NOT (actuating/removing a child is an explicit act the
44862
- * operator must grant on the child, not inherit from the parent). Set it
44863
- * explicitly to override that default per grant.
44864
- */
44865
- includeLinked: boolean().optional()
44866
- });
44867
- /**
44868
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44869
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44870
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44871
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44872
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44873
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44874
- * migration cannot reach a JWT already in a client's hands; parse-time
44875
- * migration covers both without a flag day. No cast — the raw object is read
44876
- * through `Reflect.get` (its static type is `unknown`).
44877
- */
44878
- function migrateLegacyTokenScope(raw) {
44879
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44880
- if (Reflect.get(raw, "type") !== "device") return raw;
44881
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44882
- const targets = Reflect.get(raw, "targets");
44883
- if (!Array.isArray(targets)) return raw;
44884
- return {
44885
- type: "device",
44886
- selector: {
44887
- kind: "ids",
44888
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44889
- },
44890
- access: Reflect.get(raw, "access")
44891
- };
44892
- }
44893
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44894
- object({
44895
- type: literal("category"),
44896
- target: CapScopeSchema,
44897
- access: array(MethodAccessSchema).min(1)
44898
- }),
44899
- object({
44900
- type: literal("capability"),
44901
- target: string(),
44902
- access: array(MethodAccessSchema).min(1)
44903
- }),
44904
- object({
44905
- type: literal("addon"),
44906
- target: string(),
44907
- access: array(MethodAccessSchema).min(1)
44908
- }),
44909
- DeviceTokenScopeSchema
44910
- ]));
44911
- object({
44912
- id: string(),
44913
- username: string(),
44914
- passwordHash: string(),
44915
- /**
44916
- * Admin bypass. When true, the middleware skips the scope-access
44917
- * check entirely. There is no other axis of privilege; the legacy
44918
- * role enum collapsed onto this boolean in v2.
44919
- */
44920
- isAdmin: boolean().default(false),
44921
- allowedProviders: AllowedProviderSchema,
44922
- allowedDevices: AllowedDevicesSchema,
44923
- /**
44924
- * Scopes granted to this user. Admins bypass; their `scopes` is
44925
- * ignored. Non-admins without scopes are locked out of every
44926
- * protected call.
44927
- */
44928
- scopes: array(TokenScopeSchema).default([]),
44929
- createdAt: number(),
44930
- updatedAt: number()
44931
- });
44932
- object({
44933
- id: string(),
44934
- label: string(),
44935
- isAdmin: boolean().default(false),
44936
- allowedProviders: AllowedProviderSchema,
44937
- allowedDevices: AllowedDevicesSchema,
44938
- tokenHash: string(),
44939
- tokenPrefix: string(),
44940
- createdAt: number(),
44941
- lastUsedAt: number().optional()
44942
- });
44943
- object({
44944
- id: string(),
44945
- userId: string(),
44946
- name: string(),
44947
- tokenHash: string(),
44948
- tokenPrefix: string(),
44949
- scopes: array(TokenScopeSchema),
44950
- expiresAt: number().nullish(),
44951
- lastUsedAt: number().nullish(),
44952
- createdAt: number()
44953
- });
44954
- /**
44955
45007
  * `oauth-integration` — a collection cap by which an addon declares
44956
45008
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44957
45009
  * Each provider returns a static descriptor; the core enumerates them
@@ -51797,7 +51849,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51797
51849
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51798
51850
  kind: "mutation",
51799
51851
  auth: "admin"
51800
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51852
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51853
+ clear: boolean(),
51854
+ repointLocationId: string().optional()
51855
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51801
51856
  kind: "mutation",
51802
51857
  auth: "admin"
51803
51858
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -56061,6 +56116,11 @@ onStatusChanged: { data: object({
56061
56116
  *
56062
56117
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
56063
56118
  * provider refreshes the slice on an interval and eagerly after commands.
56119
+ *
56120
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
56121
+ * nullable: `null` means "not known right now" (the appliance has not said,
56122
+ * the link is down, or the description does not carry it) and is never
56123
+ * rendered or exported as `false` / `0`. `availability` says why.
56064
56124
  */
56065
56125
  var DishwasherStateSchema = _enum([
56066
56126
  "idle",
@@ -56070,43 +56130,155 @@ var DishwasherStateSchema = _enum([
56070
56130
  "error",
56071
56131
  "unavailable"
56072
56132
  ]);
56133
+ /**
56134
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
56135
+ * view for compact surfaces; this is what the appliance said.
56136
+ */
56137
+ var DishwasherOperationStateSchema = _enum([
56138
+ "Inactive",
56139
+ "Ready",
56140
+ "DelayedStart",
56141
+ "Run",
56142
+ "Pause",
56143
+ "ActionRequired",
56144
+ "Finished",
56145
+ "Error",
56146
+ "Aborting"
56147
+ ]);
56148
+ /**
56149
+ * Why fields may be `null`:
56150
+ * - `available` — the link is up and the description is loaded;
56151
+ * - `offline` — the local link is down (values are unknown, not last-known);
56152
+ * - `description-missing` — the link is up but the appliance's description could not
56153
+ * be loaded, so its values cannot be decoded.
56154
+ */
56155
+ var DishwasherAvailabilitySchema = _enum([
56156
+ "available",
56157
+ "offline",
56158
+ "description-missing"
56159
+ ]);
56073
56160
  var DishwasherConsumableLevelSchema = _enum([
56074
56161
  "ok",
56075
56162
  "low",
56076
56163
  "empty"
56077
56164
  ]);
56078
56165
  var DishwasherStatusSchema = object({
56166
+ availability: DishwasherAvailabilitySchema,
56167
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
56079
56168
  state: DishwasherStateSchema,
56080
- /** Active program id/name, or null when none selected / unknown. */
56169
+ /** The appliance's operation state as reported; null when not known. */
56170
+ operationState: DishwasherOperationStateSchema.nullable(),
56171
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
56081
56172
  program: string().nullable(),
56082
- /** Program tokens the hardware accepts — drives the UI selector. */
56173
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
56174
+ selectedProgram: string().nullable(),
56175
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
56083
56176
  availablePrograms: array(string()),
56084
- /** Minutes remaining on the active cycle, or null when not running. */
56085
- remainingMinutes: number().int().nonnegative().nullable(),
56177
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
56178
+ remainingSeconds: number().int().nonnegative().nullable(),
56179
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
56180
+ delayedStartSeconds: number().int().nonnegative().nullable(),
56086
56181
  /** Cycle completion 0..100, or null when not applicable. */
56087
56182
  progressPercent: number().min(0).max(100).nullable(),
56088
- /** True when the door is reported open. */
56089
- doorOpen: boolean(),
56090
- /** True when remote start is allowed (door closed, power on, etc.). */
56091
- remoteStartAllowed: boolean(),
56092
- /** Main power / switched-on state. */
56093
- powerOn: boolean(),
56183
+ /** True when the door is reported open; null when the door state is not known. */
56184
+ doorOpen: boolean().nullable(),
56185
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
56186
+ doorLocked: boolean().nullable(),
56187
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
56188
+ remoteStartAllowed: boolean().nullable(),
56189
+ /** True when the appliance accepts remote control now; null when not known. */
56190
+ remoteControlActive: boolean().nullable(),
56191
+ /** True while somebody operates the appliance at its panel; null when not reported. */
56192
+ localControlActive: boolean().nullable(),
56193
+ /** Main power / switched-on state; null when not known. */
56194
+ powerOn: boolean().nullable(),
56195
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
56196
+ powerState: string().nullable(),
56094
56197
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
56095
56198
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
56096
- halfLoad: boolean(),
56097
- hygienePlus: boolean(),
56199
+ /** Option states: null when the appliance does not expose the option or has not said. */
56200
+ halfLoad: boolean().nullable(),
56201
+ hygienePlus: boolean().nullable(),
56098
56202
  /** Extra dry option when the appliance exposes it. */
56099
- extraDry: boolean(),
56203
+ extraDry: boolean().nullable(),
56100
56204
  /** Intensive zone (lower basket) when the appliance exposes it. */
56101
- intensiveZone: boolean(),
56205
+ intensiveZone: boolean().nullable(),
56102
56206
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
56103
- varioSpeedPlus: boolean(),
56104
- /** Child lock (controls disabled on the appliance). */
56105
- childLock: boolean(),
56207
+ varioSpeedPlus: boolean().nullable(),
56208
+ /** Child lock (controls disabled on the appliance); null when not known. */
56209
+ childLock: boolean().nullable(),
56210
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
56211
+ activeEvents: array(string()),
56212
+ /** Numeric error code when the appliance reports one; null otherwise. */
56106
56213
  errorCode: number().nullable(),
56214
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
56107
56215
  errorLabel: string().nullable(),
56216
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
56108
56217
  lastFetchedAt: number()
56109
56218
  });
56219
+ var DeviceIdSchema = number().int().nonnegative();
56220
+ /** A value a program option or setting can take. */
56221
+ var DishwasherValueSchema = union([
56222
+ boolean(),
56223
+ string(),
56224
+ number()
56225
+ ]);
56226
+ var DishwasherAccessSchema = _enum([
56227
+ "none",
56228
+ "read",
56229
+ "readWrite",
56230
+ "writeOnly",
56231
+ "readStatic"
56232
+ ]);
56233
+ /**
56234
+ * One option or setting the appliance declares, with the constraints its description
56235
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
56236
+ */
56237
+ var DishwasherOptionDescriptorSchema = object({
56238
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
56239
+ key: string(),
56240
+ /** Last segment of the key, for display. */
56241
+ name: string(),
56242
+ type: _enum([
56243
+ "boolean",
56244
+ "number",
56245
+ "enum",
56246
+ "string"
56247
+ ]),
56248
+ access: DishwasherAccessSchema,
56249
+ /** The appliance reports this entity as currently available. */
56250
+ available: boolean(),
56251
+ /** Unit the description declares for a number; null when it declares none. */
56252
+ unit: string().nullable(),
56253
+ min: number().nullable(),
56254
+ max: number().nullable(),
56255
+ step: number().nullable(),
56256
+ /** Allowed members of an enum; null for other types. */
56257
+ enumValues: array(string()).nullable(),
56258
+ defaultValue: DishwasherValueSchema.nullable()
56259
+ });
56260
+ var DishwasherProgramSchema = object({
56261
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
56262
+ key: string(),
56263
+ name: string(),
56264
+ /** The appliance currently offers this program. */
56265
+ available: boolean(),
56266
+ /** The options this program lists, with the program-level access / availability / default. */
56267
+ options: array(DishwasherOptionDescriptorSchema)
56268
+ });
56269
+ var DishwasherOptionsSchema = object({
56270
+ availability: DishwasherAvailabilitySchema,
56271
+ /** What the appliance can be told to do, from the commands its description declares. */
56272
+ supportsStart: boolean(),
56273
+ supportsPause: boolean(),
56274
+ supportsResume: boolean(),
56275
+ supportsStop: boolean(),
56276
+ supportsPower: boolean(),
56277
+ /** Every program the description lists, with its options. */
56278
+ programs: array(DishwasherProgramSchema),
56279
+ /** Every option and setting entity the description lists (programs reference these by key). */
56280
+ options: array(DishwasherOptionDescriptorSchema)
56281
+ });
56110
56282
  var dishwasherCapability = {
56111
56283
  name: "dishwasher",
56112
56284
  scope: "device",
@@ -56114,86 +56286,102 @@ var dishwasherCapability = {
56114
56286
  mode: "singleton",
56115
56287
  deviceTypes: [DeviceType.Dishwasher],
56116
56288
  methods: {
56117
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56289
+ /**
56290
+ * Start a program. Without `program` the selected one starts. `options` are
56291
+ * option feature keys; each is checked against the program's constraints.
56292
+ */
56293
+ start: method(object({
56294
+ deviceId: DeviceIdSchema,
56295
+ program: string().min(1).optional(),
56296
+ options: record(string(), DishwasherValueSchema).optional()
56297
+ }), _void(), {
56118
56298
  kind: "mutation",
56119
56299
  auth: "protected"
56120
56300
  }),
56121
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56301
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
56122
56302
  kind: "mutation",
56123
56303
  auth: "protected"
56124
56304
  }),
56125
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56305
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
56306
+ kind: "mutation",
56307
+ auth: "protected"
56308
+ }),
56309
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
56126
56310
  kind: "mutation",
56127
56311
  auth: "protected"
56128
56312
  }),
56313
+ /** Select (not start) a program; refused when the appliance does not offer it. */
56129
56314
  setProgram: method(object({
56130
- deviceId: number().int().nonnegative(),
56315
+ deviceId: DeviceIdSchema,
56131
56316
  program: string().min(1)
56132
56317
  }), _void(), {
56133
56318
  kind: "mutation",
56134
56319
  auth: "protected"
56135
56320
  }),
56136
56321
  setPower: method(object({
56137
- deviceId: number().int().nonnegative(),
56322
+ deviceId: DeviceIdSchema,
56138
56323
  on: boolean()
56139
56324
  }), _void(), {
56140
56325
  kind: "mutation",
56141
56326
  auth: "protected"
56142
56327
  }),
56143
56328
  setHalfLoad: method(object({
56144
- deviceId: number().int().nonnegative(),
56329
+ deviceId: DeviceIdSchema,
56145
56330
  on: boolean()
56146
56331
  }), _void(), {
56147
56332
  kind: "mutation",
56148
56333
  auth: "protected"
56149
56334
  }),
56150
56335
  setHygienePlus: method(object({
56151
- deviceId: number().int().nonnegative(),
56336
+ deviceId: DeviceIdSchema,
56152
56337
  on: boolean()
56153
56338
  }), _void(), {
56154
56339
  kind: "mutation",
56155
56340
  auth: "protected"
56156
56341
  }),
56157
56342
  setExtraDry: method(object({
56158
- deviceId: number().int().nonnegative(),
56343
+ deviceId: DeviceIdSchema,
56159
56344
  on: boolean()
56160
56345
  }), _void(), {
56161
56346
  kind: "mutation",
56162
56347
  auth: "protected"
56163
56348
  }),
56164
56349
  setIntensiveZone: method(object({
56165
- deviceId: number().int().nonnegative(),
56350
+ deviceId: DeviceIdSchema,
56166
56351
  on: boolean()
56167
56352
  }), _void(), {
56168
56353
  kind: "mutation",
56169
56354
  auth: "protected"
56170
56355
  }),
56171
56356
  setVarioSpeedPlus: method(object({
56172
- deviceId: number().int().nonnegative(),
56357
+ deviceId: DeviceIdSchema,
56173
56358
  on: boolean()
56174
56359
  }), _void(), {
56175
56360
  kind: "mutation",
56176
56361
  auth: "protected"
56177
56362
  }),
56178
56363
  setChildLock: method(object({
56179
- deviceId: number().int().nonnegative(),
56364
+ deviceId: DeviceIdSchema,
56180
56365
  on: boolean()
56181
56366
  }), _void(), {
56182
56367
  kind: "mutation",
56183
56368
  auth: "protected"
56184
56369
  }),
56370
+ /**
56371
+ * Write any option or setting by feature key. Refused when the description does
56372
+ * not list it, it is not writable or not available now, or the value is outside
56373
+ * its declared range / members.
56374
+ */
56185
56375
  setOption: method(object({
56186
- deviceId: number().int().nonnegative(),
56376
+ deviceId: DeviceIdSchema,
56187
56377
  key: string().min(1),
56188
- value: union([
56189
- boolean(),
56190
- string(),
56191
- number()
56192
- ])
56378
+ value: DishwasherValueSchema
56193
56379
  }), _void(), {
56194
56380
  kind: "mutation",
56195
56381
  auth: "protected"
56196
- })
56382
+ }),
56383
+ /** What this appliance can do, from its own description — the UI is derived from it. */
56384
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
56197
56385
  },
56198
56386
  status: {
56199
56387
  schema: DishwasherStatusSchema,
@@ -70142,6 +70330,12 @@ Object.freeze({
70142
70330
  addonId: null,
70143
70331
  access: "view"
70144
70332
  },
70333
+ "dishwasher.getOptions": {
70334
+ capName: "dishwasher",
70335
+ capScope: "device",
70336
+ addonId: null,
70337
+ access: "view"
70338
+ },
70145
70339
  "dishwasher.getStatus": {
70146
70340
  capName: "dishwasher",
70147
70341
  capScope: "device",
@@ -70154,6 +70348,12 @@ Object.freeze({
70154
70348
  addonId: null,
70155
70349
  access: "create"
70156
70350
  },
70351
+ "dishwasher.resume": {
70352
+ capName: "dishwasher",
70353
+ capScope: "device",
70354
+ addonId: null,
70355
+ access: "create"
70356
+ },
70157
70357
  "dishwasher.setChildLock": {
70158
70358
  capName: "dishwasher",
70159
70359
  capScope: "device",
@@ -74654,6 +74854,12 @@ Object.freeze({
74654
74854
  addonId: null,
74655
74855
  access: "view"
74656
74856
  },
74857
+ "storageMigration.moverClearance": {
74858
+ capName: "storage-migration",
74859
+ capScope: "system",
74860
+ addonId: null,
74861
+ access: "view"
74862
+ },
74657
74863
  "storageMigration.movers": {
74658
74864
  capName: "storage-migration",
74659
74865
  capScope: "system",
@@ -76847,6 +77053,11 @@ Object.freeze({
76847
77053
  form: "single",
76848
77054
  optional: false
76849
77055
  }],
77056
+ "dishwasher.getOptions": [{
77057
+ name: "deviceId",
77058
+ form: "single",
77059
+ optional: false
77060
+ }],
76850
77061
  "dishwasher.getStatus": [{
76851
77062
  name: "deviceId",
76852
77063
  form: "single",
@@ -76857,6 +77068,11 @@ Object.freeze({
76857
77068
  form: "single",
76858
77069
  optional: false
76859
77070
  }],
77071
+ "dishwasher.resume": [{
77072
+ name: "deviceId",
77073
+ form: "single",
77074
+ optional: false
77075
+ }],
76860
77076
  "dishwasher.setChildLock": [{
76861
77077
  name: "deviceId",
76862
77078
  form: "single",
@@ -78943,6 +79159,9 @@ new Map(Object.entries({
78943
79159
  "wrapper-update-available": "system",
78944
79160
  "backup-completed": "system",
78945
79161
  "export-completed": "system",
79162
+ "alert-critical": "system",
79163
+ "alert-error": "system",
79164
+ "alert-critical-resolved": "system",
78946
79165
  "storage-location-low": "system",
78947
79166
  "storage-location-critical": "system",
78948
79167
  "storage-location-ok": "system",
@@ -79067,6 +79286,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
79067
79286
  "storage-location-ok"
79068
79287
  ]
79069
79288
  },
79289
+ {
79290
+ id: "alerts",
79291
+ family: "system",
79292
+ label: "Alerts",
79293
+ kinds: [
79294
+ "alert-critical",
79295
+ "alert-error",
79296
+ "alert-critical-resolved"
79297
+ ]
79298
+ },
79070
79299
  {
79071
79300
  id: "alarm",
79072
79301
  family: "alarm",
@@ -79111,6 +79340,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
79111
79340
  return [[descriptor.kind, field]];
79112
79341
  })));
79113
79342
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
79343
+ object({
79344
+ phase: _enum(["raised", "resolved"]),
79345
+ episodeId: string().min(1),
79346
+ alertId: string().min(1),
79347
+ severity: AlertSeveritySchema,
79348
+ category: string(),
79349
+ title: string(),
79350
+ message: string(),
79351
+ sourceType: string().optional(),
79352
+ sourceId: string().optional(),
79353
+ nodeId: string().optional(),
79354
+ /** The alert's own action link (where the operator acts on it), when it has one. */
79355
+ actionUrl: string().optional(),
79356
+ at: number()
79357
+ });
79114
79358
  var RULE_BODY_ONLY = ["body"];
79115
79359
  var RULE_TEXT = ["title", "body"];
79116
79360
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -79120,6 +79364,11 @@ var TANK = [
79120
79364
  "device-tank-full",
79121
79365
  "device-tank-normal"
79122
79366
  ];
79367
+ var ALERT_EPISODE = [
79368
+ "alert-critical",
79369
+ "alert-error",
79370
+ "alert-critical-resolved"
79371
+ ];
79123
79372
  var UPDATES = [
79124
79373
  "addon-update-available",
79125
79374
  "server-update-available",
@@ -79312,14 +79561,14 @@ var STATE_SUMMARY_VARS = [
79312
79561
  ([...RULE_TEXT], [...CONSUMABLE]),
79313
79562
  ([...RULE_TEXT], [...TANK]),
79314
79563
  [...RULE_TEXT],
79315
- ([...RULE_TEXT], [...UPDATES]),
79316
- ([...RULE_TEXT], [...UPDATES]),
79317
- [...RULE_TEXT],
79564
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79565
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79318
79566
  [...RULE_TEXT],
79319
79567
  [...RULE_TEXT],
79320
79568
  [...RULE_TEXT],
79321
79569
  [...RULE_TEXT],
79322
79570
  [...RULE_TEXT],
79571
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79323
79572
  [...RULE_TEXT],
79324
79573
  [...RULE_TEXT],
79325
79574
  [...RULE_TEXT],
@@ -79337,7 +79586,11 @@ var STATE_SUMMARY_VARS = [
79337
79586
  [...RULE_TEXT],
79338
79587
  [...RULE_TEXT],
79339
79588
  [...RULE_TEXT],
79340
- [...RULE_TEXT],
79589
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79590
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79591
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79592
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79593
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79341
79594
  [...RULE_TEXT],
79342
79595
  [...RULE_TEXT],
79343
79596
  [...RULE_TEXT],