@camstack/addon-provider-onvif 1.2.130 → 1.2.132

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 +480 -240
  2. package/dist/addon.mjs +480 -240
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
5
  //#endregion
6
- //#region ../types/dist/event-category-BvOFi6PY.mjs
6
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
7
7
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
8
8
  EventCategory["SystemBoot"] = "system.boot";
9
9
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -82,9 +82,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
82
82
  /**
83
83
  * The node's one-shot runner boot check (D877): planned runners against the
84
84
  * process service, `degraded` when any is failed, refused or missing. The
85
- * alert centre turns it into one alert and a direct critical push.
85
+ * alert centre turns it into one critical alert.
86
86
  */
87
87
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
88
+ /**
89
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
90
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
91
+ * centre sends no notification of its own: Notification Center turns this
92
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
93
+ * system-event kinds, and reconciles from the alerts store because a bus
94
+ * event may be dropped (D8, D11).
95
+ */
96
+ EventCategory["AlertEpisode"] = "alert.episode";
88
97
  EventCategory["AddonError"] = "addon.error";
89
98
  EventCategory["AddonPageReady"] = "addon.page-ready";
90
99
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5409,7 +5418,7 @@ var ZodIssueCode = {
5409
5418
  var ZodFirstPartyTypeKind;
5410
5419
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5411
5420
  //#endregion
5412
- //#region ../types/dist/sleep-BegKjwUu.mjs
5421
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5413
5422
  /**
5414
5423
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5415
5424
  * window to float samples (D455).
@@ -7791,6 +7800,12 @@ function normalizeAddonInitResult(result) {
7791
7800
  if (Array.isArray(result)) return { providers: result };
7792
7801
  return result;
7793
7802
  }
7803
+ /**
7804
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7805
+ * and validates them (`share-token.service.ts` builds its enum from this
7806
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7807
+ */
7808
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7794
7809
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7795
7810
  var PeerBytesTicketSchema = object({
7796
7811
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12385,6 +12400,229 @@ var ConvertResultSchema = object({
12385
12400
  files: array(string()).readonly()
12386
12401
  })).readonly()
12387
12402
  });
12403
+ /**
12404
+ * Zod schemas for persisted record types.
12405
+ *
12406
+ * These schemas serve as the single source of truth for types that are
12407
+ * stored in the settings-store backend and retrieved via tRPC. They
12408
+ * replace the manual TypeScript interfaces with schema-derived types,
12409
+ * enabling runtime validation when reading from the backend.
12410
+ *
12411
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12412
+ * keeps the original name for backward compatibility.
12413
+ */
12414
+ /**
12415
+ * Auth model (v2 — 2026-05-12 caps-only):
12416
+ *
12417
+ * Two principals:
12418
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12419
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12420
+ *
12421
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12422
+ * `super_admin` — collapsed onto the single boolean because every
12423
+ * non-admin caller is governed by the same scope-check rules; the
12424
+ * distinction was only ever used to route role-specific procedures
12425
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12426
+ * with `isAdmin: false` + an explicit scope list.
12427
+ */
12428
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12429
+ var MethodAccessSchema = _enum([
12430
+ "view",
12431
+ "create",
12432
+ "delete"
12433
+ ]);
12434
+ /**
12435
+ * A single scope grant. Three forms — checked in matcher with OR
12436
+ * semantics; the first match decides whether the call passes:
12437
+ *
12438
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12439
+ * cap with the matching `scope` declaration. New caps inherit grants
12440
+ * automatically — adding a device cap to the codebase makes it
12441
+ * reachable to every user with `category:device [...]` without a
12442
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12443
+ *
12444
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12445
+ * useful when an integration needs to interact with one specific
12446
+ * addon's surface regardless of how many caps it exports.
12447
+ *
12448
+ * - `capability` — the most precise form. Single cap name. Use for
12449
+ * integration tokens where you want to grant `addons.installPackage`
12450
+ * and nothing else.
12451
+ *
12452
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12453
+ * "give me everything" escape; there is no wildcard scope.
12454
+ */
12455
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12456
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12457
+ var CapScopeSchema = _enum(["device", "system"]);
12458
+ /**
12459
+ * DeviceSelector (scope model v3 — 2026-08-12).
12460
+ *
12461
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12462
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12463
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12464
+ * AFTER the grant was minted — no re-grant, no re-login.
12465
+ *
12466
+ * - `all` — every device in the deployment. The broad viewer/operator
12467
+ * lever without a `category` grant (a `category` grant also covers device
12468
+ * caps that carry no deviceId; `all` is specifically the device set).
12469
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12470
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12471
+ * is NOT covered until the grant is edited.
12472
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12473
+ * DYNAMIC. A device that changes type, or a new device of the type,
12474
+ * re-resolves on the next request.
12475
+ * - `locations` — every device whose operator-assigned `location` label is
12476
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12477
+ * null/unset location matches NO `locations` selector.
12478
+ */
12479
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12480
+ object({ kind: literal("all") }),
12481
+ object({
12482
+ kind: literal("ids"),
12483
+ ids: array(number().int()).min(1)
12484
+ }),
12485
+ object({
12486
+ kind: literal("types"),
12487
+ types: array(_enum(DeviceType)).min(1)
12488
+ }),
12489
+ object({
12490
+ kind: literal("locations"),
12491
+ locations: array(string().min(1)).min(1)
12492
+ })
12493
+ ]);
12494
+ var DeviceTokenScopeSchema = object({
12495
+ type: literal("device"),
12496
+ /** The device SET this grant covers — resolved against the live fleet. */
12497
+ selector: DeviceSelectorSchema,
12498
+ access: array(MethodAccessSchema).min(1),
12499
+ /**
12500
+ * Whether a grant on a PARENT device transparently covers its accessory
12501
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12502
+ * Direction is parent → children ONLY.
12503
+ *
12504
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12505
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12506
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12507
+ * operator must grant on the child, not inherit from the parent). Set it
12508
+ * explicitly to override that default per grant.
12509
+ */
12510
+ includeLinked: boolean().optional()
12511
+ });
12512
+ /**
12513
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12514
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12515
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12516
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12517
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12518
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12519
+ * migration cannot reach a JWT already in a client's hands; parse-time
12520
+ * migration covers both without a flag day. No cast — the raw object is read
12521
+ * through `Reflect.get` (its static type is `unknown`).
12522
+ */
12523
+ function migrateLegacyTokenScope(raw) {
12524
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12525
+ if (Reflect.get(raw, "type") !== "device") return raw;
12526
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12527
+ const targets = Reflect.get(raw, "targets");
12528
+ if (!Array.isArray(targets)) return raw;
12529
+ return {
12530
+ type: "device",
12531
+ selector: {
12532
+ kind: "ids",
12533
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12534
+ },
12535
+ access: Reflect.get(raw, "access")
12536
+ };
12537
+ }
12538
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12539
+ object({
12540
+ type: literal("category"),
12541
+ target: CapScopeSchema,
12542
+ access: array(MethodAccessSchema).min(1)
12543
+ }),
12544
+ object({
12545
+ type: literal("capability"),
12546
+ target: string(),
12547
+ access: array(MethodAccessSchema).min(1)
12548
+ }),
12549
+ object({
12550
+ type: literal("addon"),
12551
+ target: string(),
12552
+ access: array(MethodAccessSchema).min(1)
12553
+ }),
12554
+ DeviceTokenScopeSchema
12555
+ ]));
12556
+ object({
12557
+ id: string(),
12558
+ username: string(),
12559
+ passwordHash: string(),
12560
+ /**
12561
+ * Admin bypass. When true, the middleware skips the scope-access
12562
+ * check entirely. There is no other axis of privilege; the legacy
12563
+ * role enum collapsed onto this boolean in v2.
12564
+ */
12565
+ isAdmin: boolean().default(false),
12566
+ allowedProviders: AllowedProviderSchema,
12567
+ allowedDevices: AllowedDevicesSchema,
12568
+ /**
12569
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12570
+ * ignored. Non-admins without scopes are locked out of every
12571
+ * protected call.
12572
+ */
12573
+ scopes: array(TokenScopeSchema).default([]),
12574
+ createdAt: number(),
12575
+ updatedAt: number()
12576
+ });
12577
+ object({
12578
+ id: string(),
12579
+ label: string(),
12580
+ isAdmin: boolean().default(false),
12581
+ allowedProviders: AllowedProviderSchema,
12582
+ allowedDevices: AllowedDevicesSchema,
12583
+ tokenHash: string(),
12584
+ tokenPrefix: string(),
12585
+ createdAt: number(),
12586
+ lastUsedAt: number().optional()
12587
+ });
12588
+ object({
12589
+ id: string(),
12590
+ userId: string(),
12591
+ name: string(),
12592
+ tokenHash: string(),
12593
+ tokenPrefix: string(),
12594
+ scopes: array(TokenScopeSchema),
12595
+ expiresAt: number().nullish(),
12596
+ lastUsedAt: number().nullish(),
12597
+ createdAt: number()
12598
+ });
12599
+ /** What a share-view grant lets its holder see. */
12600
+ var ShareViewGrantSchema = object({
12601
+ kind: _enum(SHARE_VIEW_KINDS),
12602
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
12603
+ /** Talk-back, opt-in at mint time; absent means off. */
12604
+ talk: boolean().optional()
12605
+ });
12606
+ var ShareViewScopeSchema = object({
12607
+ type: literal("share-view"),
12608
+ grant: ShareViewGrantSchema
12609
+ });
12610
+ var AddonRoutesScopeSchema = object({
12611
+ type: literal("addon-routes"),
12612
+ access: array(MethodAccessSchema).min(1)
12613
+ });
12614
+ var CredentialScopeSchema = union([
12615
+ literal("*"),
12616
+ ShareViewScopeSchema,
12617
+ AddonRoutesScopeSchema,
12618
+ TokenScopeSchema
12619
+ ]);
12620
+ object({
12621
+ kind: literal("credential"),
12622
+ sub: string().min(1),
12623
+ jti: string().min(16),
12624
+ scopes: array(CredentialScopeSchema).min(1)
12625
+ });
12388
12626
  _enum(["new-session", "step-up"]);
12389
12627
  /** The languages the hub's app landing pages are written in (D858). */
12390
12628
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13101,7 +13339,14 @@ var AlertSeveritySchema = _enum([
13101
13339
  ]);
13102
13340
  var AlertActionSchema = object({
13103
13341
  label: string(),
13104
- href: string().optional()
13342
+ href: string().optional(),
13343
+ /**
13344
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13345
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13346
+ * start) — the browser must leave the SPA with a full navigation, because
13347
+ * the SPA has no such route and would bounce to the home page.
13348
+ */
13349
+ navigation: _enum(["app", "server"]).optional()
13105
13350
  });
13106
13351
  var AlertStatusSchema = _enum([
13107
13352
  "active",
@@ -41671,6 +41916,9 @@ var NcSystemEventKindSchema = _enum([
41671
41916
  "server-updated",
41672
41917
  "export-completed",
41673
41918
  "backup-completed",
41919
+ "alert-critical",
41920
+ "alert-error",
41921
+ "alert-critical-resolved",
41674
41922
  "camera-online",
41675
41923
  "camera-offline",
41676
41924
  "camera-disabled",
@@ -43706,202 +43954,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
43706
43954
  auth: "admin"
43707
43955
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
43708
43956
  /**
43709
- * Zod schemas for persisted record types.
43710
- *
43711
- * These schemas serve as the single source of truth for types that are
43712
- * stored in the settings-store backend and retrieved via tRPC. They
43713
- * replace the manual TypeScript interfaces with schema-derived types,
43714
- * enabling runtime validation when reading from the backend.
43715
- *
43716
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
43717
- * keeps the original name for backward compatibility.
43718
- */
43719
- /**
43720
- * Auth model (v2 — 2026-05-12 caps-only):
43721
- *
43722
- * Two principals:
43723
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
43724
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
43725
- *
43726
- * No role enum. There used to be `viewer / agent / scoped` and earlier
43727
- * `super_admin` — collapsed onto the single boolean because every
43728
- * non-admin caller is governed by the same scope-check rules; the
43729
- * distinction was only ever used to route role-specific procedures
43730
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
43731
- * with `isAdmin: false` + an explicit scope list.
43732
- */
43733
- /** Per-method access flavour. Materialised on every cap method via codegen. */
43734
- var MethodAccessSchema = _enum([
43735
- "view",
43736
- "create",
43737
- "delete"
43738
- ]);
43739
- /**
43740
- * A single scope grant. Three forms — checked in matcher with OR
43741
- * semantics; the first match decides whether the call passes:
43742
- *
43743
- * - `category` — broadest. `target: 'device' | 'system'` selects every
43744
- * cap with the matching `scope` declaration. New caps inherit grants
43745
- * automatically — adding a device cap to the codebase makes it
43746
- * reachable to every user with `category:device [...]` without a
43747
- * re-grant. Use this for "family viewer" / "operator" tiers.
43748
- *
43749
- * - `addon` — every cap that ships inside a given addon id. Niche;
43750
- * useful when an integration needs to interact with one specific
43751
- * addon's surface regardless of how many caps it exports.
43752
- *
43753
- * - `capability` — the most precise form. Single cap name. Use for
43754
- * integration tokens where you want to grant `addons.installPackage`
43755
- * and nothing else.
43756
- *
43757
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
43758
- * "give me everything" escape; there is no wildcard scope.
43759
- */
43760
- var AllowedProviderSchema = union([literal("*"), array(string())]);
43761
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
43762
- var CapScopeSchema = _enum(["device", "system"]);
43763
- /**
43764
- * DeviceSelector (scope model v3 — 2026-08-12).
43765
- *
43766
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
43767
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
43768
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
43769
- * AFTER the grant was minted — no re-grant, no re-login.
43770
- *
43771
- * - `all` — every device in the deployment. The broad viewer/operator
43772
- * lever without a `category` grant (a `category` grant also covers device
43773
- * caps that carry no deviceId; `all` is specifically the device set).
43774
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
43775
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
43776
- * is NOT covered until the grant is edited.
43777
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
43778
- * DYNAMIC. A device that changes type, or a new device of the type,
43779
- * re-resolves on the next request.
43780
- * - `locations` — every device whose operator-assigned `location` label is
43781
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
43782
- * null/unset location matches NO `locations` selector.
43783
- */
43784
- var DeviceSelectorSchema = discriminatedUnion("kind", [
43785
- object({ kind: literal("all") }),
43786
- object({
43787
- kind: literal("ids"),
43788
- ids: array(number().int()).min(1)
43789
- }),
43790
- object({
43791
- kind: literal("types"),
43792
- types: array(_enum(DeviceType)).min(1)
43793
- }),
43794
- object({
43795
- kind: literal("locations"),
43796
- locations: array(string().min(1)).min(1)
43797
- })
43798
- ]);
43799
- var DeviceTokenScopeSchema = object({
43800
- type: literal("device"),
43801
- /** The device SET this grant covers — resolved against the live fleet. */
43802
- selector: DeviceSelectorSchema,
43803
- access: array(MethodAccessSchema).min(1),
43804
- /**
43805
- * Whether a grant on a PARENT device transparently covers its accessory
43806
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
43807
- * Direction is parent → children ONLY.
43808
- *
43809
- * Absent → the matcher DERIVES it from the access flavour: `view`
43810
- * inherits (a camera viewer sees the camera's accessories), `create` /
43811
- * `delete` do NOT (actuating/removing a child is an explicit act the
43812
- * operator must grant on the child, not inherit from the parent). Set it
43813
- * explicitly to override that default per grant.
43814
- */
43815
- includeLinked: boolean().optional()
43816
- });
43817
- /**
43818
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
43819
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
43820
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
43821
- * EVERY parse path — stored records AND the JWT-carried scope arrays
43822
- * normalised at the request boundary ({@link normalizeTokenScopes} in
43823
- * `device-selector.ts`). Chosen over a one-time DB migration because a
43824
- * migration cannot reach a JWT already in a client's hands; parse-time
43825
- * migration covers both without a flag day. No cast — the raw object is read
43826
- * through `Reflect.get` (its static type is `unknown`).
43827
- */
43828
- function migrateLegacyTokenScope(raw) {
43829
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
43830
- if (Reflect.get(raw, "type") !== "device") return raw;
43831
- if (Reflect.get(raw, "selector") !== void 0) return raw;
43832
- const targets = Reflect.get(raw, "targets");
43833
- if (!Array.isArray(targets)) return raw;
43834
- return {
43835
- type: "device",
43836
- selector: {
43837
- kind: "ids",
43838
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
43839
- },
43840
- access: Reflect.get(raw, "access")
43841
- };
43842
- }
43843
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
43844
- object({
43845
- type: literal("category"),
43846
- target: CapScopeSchema,
43847
- access: array(MethodAccessSchema).min(1)
43848
- }),
43849
- object({
43850
- type: literal("capability"),
43851
- target: string(),
43852
- access: array(MethodAccessSchema).min(1)
43853
- }),
43854
- object({
43855
- type: literal("addon"),
43856
- target: string(),
43857
- access: array(MethodAccessSchema).min(1)
43858
- }),
43859
- DeviceTokenScopeSchema
43860
- ]));
43861
- object({
43862
- id: string(),
43863
- username: string(),
43864
- passwordHash: string(),
43865
- /**
43866
- * Admin bypass. When true, the middleware skips the scope-access
43867
- * check entirely. There is no other axis of privilege; the legacy
43868
- * role enum collapsed onto this boolean in v2.
43869
- */
43870
- isAdmin: boolean().default(false),
43871
- allowedProviders: AllowedProviderSchema,
43872
- allowedDevices: AllowedDevicesSchema,
43873
- /**
43874
- * Scopes granted to this user. Admins bypass; their `scopes` is
43875
- * ignored. Non-admins without scopes are locked out of every
43876
- * protected call.
43877
- */
43878
- scopes: array(TokenScopeSchema).default([]),
43879
- createdAt: number(),
43880
- updatedAt: number()
43881
- });
43882
- object({
43883
- id: string(),
43884
- label: string(),
43885
- isAdmin: boolean().default(false),
43886
- allowedProviders: AllowedProviderSchema,
43887
- allowedDevices: AllowedDevicesSchema,
43888
- tokenHash: string(),
43889
- tokenPrefix: string(),
43890
- createdAt: number(),
43891
- lastUsedAt: number().optional()
43892
- });
43893
- object({
43894
- id: string(),
43895
- userId: string(),
43896
- name: string(),
43897
- tokenHash: string(),
43898
- tokenPrefix: string(),
43899
- scopes: array(TokenScopeSchema),
43900
- expiresAt: number().nullish(),
43901
- lastUsedAt: number().nullish(),
43902
- createdAt: number()
43903
- });
43904
- /**
43905
43957
  * `oauth-integration` — a collection cap by which an addon declares
43906
43958
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
43907
43959
  * Each provider returns a static descriptor; the core enumerates them
@@ -50807,7 +50859,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
50807
50859
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
50808
50860
  kind: "mutation",
50809
50861
  auth: "admin"
50810
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
50862
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
50863
+ clear: boolean(),
50864
+ repointLocationId: string().optional()
50865
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
50811
50866
  kind: "mutation",
50812
50867
  auth: "admin"
50813
50868
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -54242,6 +54297,11 @@ object({
54242
54297
  *
54243
54298
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
54244
54299
  * provider refreshes the slice on an interval and eagerly after commands.
54300
+ *
54301
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
54302
+ * nullable: `null` means "not known right now" (the appliance has not said,
54303
+ * the link is down, or the description does not carry it) and is never
54304
+ * rendered or exported as `false` / `0`. `availability` says why.
54245
54305
  */
54246
54306
  var DishwasherStateSchema = _enum([
54247
54307
  "idle",
@@ -54251,112 +54311,227 @@ var DishwasherStateSchema = _enum([
54251
54311
  "error",
54252
54312
  "unavailable"
54253
54313
  ]);
54314
+ /**
54315
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
54316
+ * view for compact surfaces; this is what the appliance said.
54317
+ */
54318
+ var DishwasherOperationStateSchema = _enum([
54319
+ "Inactive",
54320
+ "Ready",
54321
+ "DelayedStart",
54322
+ "Run",
54323
+ "Pause",
54324
+ "ActionRequired",
54325
+ "Finished",
54326
+ "Error",
54327
+ "Aborting"
54328
+ ]);
54329
+ /**
54330
+ * Why fields may be `null`:
54331
+ * - `available` — the link is up and the description is loaded;
54332
+ * - `offline` — the local link is down (values are unknown, not last-known);
54333
+ * - `description-missing` — the link is up but the appliance's description could not
54334
+ * be loaded, so its values cannot be decoded.
54335
+ */
54336
+ var DishwasherAvailabilitySchema = _enum([
54337
+ "available",
54338
+ "offline",
54339
+ "description-missing"
54340
+ ]);
54254
54341
  var DishwasherConsumableLevelSchema = _enum([
54255
54342
  "ok",
54256
54343
  "low",
54257
54344
  "empty"
54258
54345
  ]);
54259
54346
  object({
54347
+ availability: DishwasherAvailabilitySchema,
54348
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
54260
54349
  state: DishwasherStateSchema,
54261
- /** Active program id/name, or null when none selected / unknown. */
54350
+ /** The appliance's operation state as reported; null when not known. */
54351
+ operationState: DishwasherOperationStateSchema.nullable(),
54352
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
54262
54353
  program: string().nullable(),
54263
- /** Program tokens the hardware accepts — drives the UI selector. */
54354
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
54355
+ selectedProgram: string().nullable(),
54356
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
54264
54357
  availablePrograms: array(string()),
54265
- /** Minutes remaining on the active cycle, or null when not running. */
54266
- remainingMinutes: number().int().nonnegative().nullable(),
54358
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
54359
+ remainingSeconds: number().int().nonnegative().nullable(),
54360
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
54361
+ delayedStartSeconds: number().int().nonnegative().nullable(),
54267
54362
  /** Cycle completion 0..100, or null when not applicable. */
54268
54363
  progressPercent: number().min(0).max(100).nullable(),
54269
- /** True when the door is reported open. */
54270
- doorOpen: boolean(),
54271
- /** True when remote start is allowed (door closed, power on, etc.). */
54272
- remoteStartAllowed: boolean(),
54273
- /** Main power / switched-on state. */
54274
- powerOn: boolean(),
54364
+ /** True when the door is reported open; null when the door state is not known. */
54365
+ doorOpen: boolean().nullable(),
54366
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
54367
+ doorLocked: boolean().nullable(),
54368
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
54369
+ remoteStartAllowed: boolean().nullable(),
54370
+ /** True when the appliance accepts remote control now; null when not known. */
54371
+ remoteControlActive: boolean().nullable(),
54372
+ /** True while somebody operates the appliance at its panel; null when not reported. */
54373
+ localControlActive: boolean().nullable(),
54374
+ /** Main power / switched-on state; null when not known. */
54375
+ powerOn: boolean().nullable(),
54376
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
54377
+ powerState: string().nullable(),
54275
54378
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
54276
54379
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
54277
- halfLoad: boolean(),
54278
- hygienePlus: boolean(),
54380
+ /** Option states: null when the appliance does not expose the option or has not said. */
54381
+ halfLoad: boolean().nullable(),
54382
+ hygienePlus: boolean().nullable(),
54279
54383
  /** Extra dry option when the appliance exposes it. */
54280
- extraDry: boolean(),
54384
+ extraDry: boolean().nullable(),
54281
54385
  /** Intensive zone (lower basket) when the appliance exposes it. */
54282
- intensiveZone: boolean(),
54386
+ intensiveZone: boolean().nullable(),
54283
54387
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
54284
- varioSpeedPlus: boolean(),
54285
- /** Child lock (controls disabled on the appliance). */
54286
- childLock: boolean(),
54388
+ varioSpeedPlus: boolean().nullable(),
54389
+ /** Child lock (controls disabled on the appliance); null when not known. */
54390
+ childLock: boolean().nullable(),
54391
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
54392
+ activeEvents: array(string()),
54393
+ /** Numeric error code when the appliance reports one; null otherwise. */
54287
54394
  errorCode: number().nullable(),
54395
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
54288
54396
  errorLabel: string().nullable(),
54397
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
54289
54398
  lastFetchedAt: number()
54290
54399
  });
54291
- DeviceType.Dishwasher, method(object({ deviceId: number().int().nonnegative() }), _void(), {
54400
+ var DeviceIdSchema = number().int().nonnegative();
54401
+ /** A value a program option or setting can take. */
54402
+ var DishwasherValueSchema = union([
54403
+ boolean(),
54404
+ string(),
54405
+ number()
54406
+ ]);
54407
+ var DishwasherAccessSchema = _enum([
54408
+ "none",
54409
+ "read",
54410
+ "readWrite",
54411
+ "writeOnly",
54412
+ "readStatic"
54413
+ ]);
54414
+ /**
54415
+ * One option or setting the appliance declares, with the constraints its description
54416
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
54417
+ */
54418
+ var DishwasherOptionDescriptorSchema = object({
54419
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
54420
+ key: string(),
54421
+ /** Last segment of the key, for display. */
54422
+ name: string(),
54423
+ type: _enum([
54424
+ "boolean",
54425
+ "number",
54426
+ "enum",
54427
+ "string"
54428
+ ]),
54429
+ access: DishwasherAccessSchema,
54430
+ /** The appliance reports this entity as currently available. */
54431
+ available: boolean(),
54432
+ /** Unit the description declares for a number; null when it declares none. */
54433
+ unit: string().nullable(),
54434
+ min: number().nullable(),
54435
+ max: number().nullable(),
54436
+ step: number().nullable(),
54437
+ /** Allowed members of an enum; null for other types. */
54438
+ enumValues: array(string()).nullable(),
54439
+ defaultValue: DishwasherValueSchema.nullable()
54440
+ });
54441
+ var DishwasherProgramSchema = object({
54442
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
54443
+ key: string(),
54444
+ name: string(),
54445
+ /** The appliance currently offers this program. */
54446
+ available: boolean(),
54447
+ /** The options this program lists, with the program-level access / availability / default. */
54448
+ options: array(DishwasherOptionDescriptorSchema)
54449
+ });
54450
+ var DishwasherOptionsSchema = object({
54451
+ availability: DishwasherAvailabilitySchema,
54452
+ /** What the appliance can be told to do, from the commands its description declares. */
54453
+ supportsStart: boolean(),
54454
+ supportsPause: boolean(),
54455
+ supportsResume: boolean(),
54456
+ supportsStop: boolean(),
54457
+ supportsPower: boolean(),
54458
+ /** Every program the description lists, with its options. */
54459
+ programs: array(DishwasherProgramSchema),
54460
+ /** Every option and setting entity the description lists (programs reference these by key). */
54461
+ options: array(DishwasherOptionDescriptorSchema)
54462
+ });
54463
+ DeviceType.Dishwasher, method(object({
54464
+ deviceId: DeviceIdSchema,
54465
+ program: string().min(1).optional(),
54466
+ options: record(string(), DishwasherValueSchema).optional()
54467
+ }), _void(), {
54292
54468
  kind: "mutation",
54293
54469
  auth: "protected"
54294
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
54470
+ }), method(object({ deviceId: DeviceIdSchema }), _void(), {
54295
54471
  kind: "mutation",
54296
54472
  auth: "protected"
54297
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
54473
+ }), method(object({ deviceId: DeviceIdSchema }), _void(), {
54474
+ kind: "mutation",
54475
+ auth: "protected"
54476
+ }), method(object({ deviceId: DeviceIdSchema }), _void(), {
54298
54477
  kind: "mutation",
54299
54478
  auth: "protected"
54300
54479
  }), method(object({
54301
- deviceId: number().int().nonnegative(),
54480
+ deviceId: DeviceIdSchema,
54302
54481
  program: string().min(1)
54303
54482
  }), _void(), {
54304
54483
  kind: "mutation",
54305
54484
  auth: "protected"
54306
54485
  }), method(object({
54307
- deviceId: number().int().nonnegative(),
54486
+ deviceId: DeviceIdSchema,
54308
54487
  on: boolean()
54309
54488
  }), _void(), {
54310
54489
  kind: "mutation",
54311
54490
  auth: "protected"
54312
54491
  }), method(object({
54313
- deviceId: number().int().nonnegative(),
54492
+ deviceId: DeviceIdSchema,
54314
54493
  on: boolean()
54315
54494
  }), _void(), {
54316
54495
  kind: "mutation",
54317
54496
  auth: "protected"
54318
54497
  }), method(object({
54319
- deviceId: number().int().nonnegative(),
54498
+ deviceId: DeviceIdSchema,
54320
54499
  on: boolean()
54321
54500
  }), _void(), {
54322
54501
  kind: "mutation",
54323
54502
  auth: "protected"
54324
54503
  }), method(object({
54325
- deviceId: number().int().nonnegative(),
54504
+ deviceId: DeviceIdSchema,
54326
54505
  on: boolean()
54327
54506
  }), _void(), {
54328
54507
  kind: "mutation",
54329
54508
  auth: "protected"
54330
54509
  }), method(object({
54331
- deviceId: number().int().nonnegative(),
54510
+ deviceId: DeviceIdSchema,
54332
54511
  on: boolean()
54333
54512
  }), _void(), {
54334
54513
  kind: "mutation",
54335
54514
  auth: "protected"
54336
54515
  }), method(object({
54337
- deviceId: number().int().nonnegative(),
54516
+ deviceId: DeviceIdSchema,
54338
54517
  on: boolean()
54339
54518
  }), _void(), {
54340
54519
  kind: "mutation",
54341
54520
  auth: "protected"
54342
54521
  }), method(object({
54343
- deviceId: number().int().nonnegative(),
54522
+ deviceId: DeviceIdSchema,
54344
54523
  on: boolean()
54345
54524
  }), _void(), {
54346
54525
  kind: "mutation",
54347
54526
  auth: "protected"
54348
54527
  }), method(object({
54349
- deviceId: number().int().nonnegative(),
54528
+ deviceId: DeviceIdSchema,
54350
54529
  key: string().min(1),
54351
- value: union([
54352
- boolean(),
54353
- string(),
54354
- number()
54355
- ])
54530
+ value: DishwasherValueSchema
54356
54531
  }), _void(), {
54357
54532
  kind: "mutation",
54358
54533
  auth: "protected"
54359
- });
54534
+ }), method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" });
54360
54535
  object({
54361
54536
  /** Ms epoch of the last press. null = never observed since this provider started. */
54362
54537
  lastPressedAt: number().nullable(),
@@ -65333,6 +65508,12 @@ Object.freeze({
65333
65508
  addonId: null,
65334
65509
  access: "view"
65335
65510
  },
65511
+ "dishwasher.getOptions": {
65512
+ capName: "dishwasher",
65513
+ capScope: "device",
65514
+ addonId: null,
65515
+ access: "view"
65516
+ },
65336
65517
  "dishwasher.getStatus": {
65337
65518
  capName: "dishwasher",
65338
65519
  capScope: "device",
@@ -65345,6 +65526,12 @@ Object.freeze({
65345
65526
  addonId: null,
65346
65527
  access: "create"
65347
65528
  },
65529
+ "dishwasher.resume": {
65530
+ capName: "dishwasher",
65531
+ capScope: "device",
65532
+ addonId: null,
65533
+ access: "create"
65534
+ },
65348
65535
  "dishwasher.setChildLock": {
65349
65536
  capName: "dishwasher",
65350
65537
  capScope: "device",
@@ -69845,6 +70032,12 @@ Object.freeze({
69845
70032
  addonId: null,
69846
70033
  access: "view"
69847
70034
  },
70035
+ "storageMigration.moverClearance": {
70036
+ capName: "storage-migration",
70037
+ capScope: "system",
70038
+ addonId: null,
70039
+ access: "view"
70040
+ },
69848
70041
  "storageMigration.movers": {
69849
70042
  capName: "storage-migration",
69850
70043
  capScope: "system",
@@ -72104,6 +72297,11 @@ Object.freeze({
72104
72297
  form: "single",
72105
72298
  optional: false
72106
72299
  }],
72300
+ "dishwasher.getOptions": [{
72301
+ name: "deviceId",
72302
+ form: "single",
72303
+ optional: false
72304
+ }],
72107
72305
  "dishwasher.getStatus": [{
72108
72306
  name: "deviceId",
72109
72307
  form: "single",
@@ -72114,6 +72312,11 @@ Object.freeze({
72114
72312
  form: "single",
72115
72313
  optional: false
72116
72314
  }],
72315
+ "dishwasher.resume": [{
72316
+ name: "deviceId",
72317
+ form: "single",
72318
+ optional: false
72319
+ }],
72117
72320
  "dishwasher.setChildLock": [{
72118
72321
  name: "deviceId",
72119
72322
  form: "single",
@@ -74200,6 +74403,9 @@ new Map(Object.entries({
74200
74403
  "wrapper-update-available": "system",
74201
74404
  "backup-completed": "system",
74202
74405
  "export-completed": "system",
74406
+ "alert-critical": "system",
74407
+ "alert-error": "system",
74408
+ "alert-critical-resolved": "system",
74203
74409
  "storage-location-low": "system",
74204
74410
  "storage-location-critical": "system",
74205
74411
  "storage-location-ok": "system",
@@ -74324,6 +74530,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
74324
74530
  "storage-location-ok"
74325
74531
  ]
74326
74532
  },
74533
+ {
74534
+ id: "alerts",
74535
+ family: "system",
74536
+ label: "Alerts",
74537
+ kinds: [
74538
+ "alert-critical",
74539
+ "alert-error",
74540
+ "alert-critical-resolved"
74541
+ ]
74542
+ },
74327
74543
  {
74328
74544
  id: "alarm",
74329
74545
  family: "alarm",
@@ -74368,6 +74584,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
74368
74584
  return [[descriptor.kind, field]];
74369
74585
  })));
74370
74586
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
74587
+ object({
74588
+ phase: _enum(["raised", "resolved"]),
74589
+ episodeId: string().min(1),
74590
+ alertId: string().min(1),
74591
+ severity: AlertSeveritySchema,
74592
+ category: string(),
74593
+ title: string(),
74594
+ message: string(),
74595
+ sourceType: string().optional(),
74596
+ sourceId: string().optional(),
74597
+ nodeId: string().optional(),
74598
+ /** The alert's own action link (where the operator acts on it), when it has one. */
74599
+ actionUrl: string().optional(),
74600
+ at: number()
74601
+ });
74371
74602
  var RULE_BODY_ONLY = ["body"];
74372
74603
  var RULE_TEXT = ["title", "body"];
74373
74604
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -74377,6 +74608,11 @@ var TANK = [
74377
74608
  "device-tank-full",
74378
74609
  "device-tank-normal"
74379
74610
  ];
74611
+ var ALERT_EPISODE = [
74612
+ "alert-critical",
74613
+ "alert-error",
74614
+ "alert-critical-resolved"
74615
+ ];
74380
74616
  var UPDATES = [
74381
74617
  "addon-update-available",
74382
74618
  "server-update-available",
@@ -74569,14 +74805,14 @@ var STATE_SUMMARY_VARS = [
74569
74805
  ([...RULE_TEXT], [...CONSUMABLE]),
74570
74806
  ([...RULE_TEXT], [...TANK]),
74571
74807
  [...RULE_TEXT],
74572
- ([...RULE_TEXT], [...UPDATES]),
74573
- ([...RULE_TEXT], [...UPDATES]),
74574
- [...RULE_TEXT],
74808
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
74809
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
74575
74810
  [...RULE_TEXT],
74576
74811
  [...RULE_TEXT],
74577
74812
  [...RULE_TEXT],
74578
74813
  [...RULE_TEXT],
74579
74814
  [...RULE_TEXT],
74815
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74580
74816
  [...RULE_TEXT],
74581
74817
  [...RULE_TEXT],
74582
74818
  [...RULE_TEXT],
@@ -74594,7 +74830,11 @@ var STATE_SUMMARY_VARS = [
74594
74830
  [...RULE_TEXT],
74595
74831
  [...RULE_TEXT],
74596
74832
  [...RULE_TEXT],
74597
- [...RULE_TEXT],
74833
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74834
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74835
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74836
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74837
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74598
74838
  [...RULE_TEXT],
74599
74839
  [...RULE_TEXT],
74600
74840
  [...RULE_TEXT],