@camstack/addon-provider-homematic 1.2.138 → 1.2.140

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
@@ -9,7 +9,7 @@ import { join } from "path";
9
9
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
10
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
11
11
  //#endregion
12
- //#region ../types/dist/event-category-BvOFi6PY.mjs
12
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
13
13
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
14
14
  EventCategory["SystemBoot"] = "system.boot";
15
15
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -88,9 +88,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
88
88
  /**
89
89
  * The node's one-shot runner boot check (D877): planned runners against the
90
90
  * process service, `degraded` when any is failed, refused or missing. The
91
- * alert centre turns it into one alert and a direct critical push.
91
+ * alert centre turns it into one critical alert.
92
92
  */
93
93
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
94
+ /**
95
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
96
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
97
+ * centre sends no notification of its own: Notification Center turns this
98
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
99
+ * system-event kinds, and reconciles from the alerts store because a bus
100
+ * event may be dropped (D8, D11).
101
+ */
102
+ EventCategory["AlertEpisode"] = "alert.episode";
94
103
  EventCategory["AddonError"] = "addon.error";
95
104
  EventCategory["AddonPageReady"] = "addon.page-ready";
96
105
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5548,7 +5557,7 @@ var ZodIssueCode = {
5548
5557
  var ZodFirstPartyTypeKind;
5549
5558
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5550
5559
  //#endregion
5551
- //#region ../types/dist/sleep-BegKjwUu.mjs
5560
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5552
5561
  /**
5553
5562
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5554
5563
  * window to float samples (D455).
@@ -7930,6 +7939,12 @@ function normalizeAddonInitResult(result) {
7930
7939
  if (Array.isArray(result)) return { providers: result };
7931
7940
  return result;
7932
7941
  }
7942
+ /**
7943
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7944
+ * and validates them (`share-token.service.ts` builds its enum from this
7945
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7946
+ */
7947
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7933
7948
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7934
7949
  var PeerBytesTicketSchema = object({
7935
7950
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12795,6 +12810,229 @@ var ConvertResultSchema = object({
12795
12810
  files: array(string()).readonly()
12796
12811
  })).readonly()
12797
12812
  });
12813
+ /**
12814
+ * Zod schemas for persisted record types.
12815
+ *
12816
+ * These schemas serve as the single source of truth for types that are
12817
+ * stored in the settings-store backend and retrieved via tRPC. They
12818
+ * replace the manual TypeScript interfaces with schema-derived types,
12819
+ * enabling runtime validation when reading from the backend.
12820
+ *
12821
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12822
+ * keeps the original name for backward compatibility.
12823
+ */
12824
+ /**
12825
+ * Auth model (v2 — 2026-05-12 caps-only):
12826
+ *
12827
+ * Two principals:
12828
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12829
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12830
+ *
12831
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12832
+ * `super_admin` — collapsed onto the single boolean because every
12833
+ * non-admin caller is governed by the same scope-check rules; the
12834
+ * distinction was only ever used to route role-specific procedures
12835
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12836
+ * with `isAdmin: false` + an explicit scope list.
12837
+ */
12838
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12839
+ var MethodAccessSchema = _enum([
12840
+ "view",
12841
+ "create",
12842
+ "delete"
12843
+ ]);
12844
+ /**
12845
+ * A single scope grant. Three forms — checked in matcher with OR
12846
+ * semantics; the first match decides whether the call passes:
12847
+ *
12848
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12849
+ * cap with the matching `scope` declaration. New caps inherit grants
12850
+ * automatically — adding a device cap to the codebase makes it
12851
+ * reachable to every user with `category:device [...]` without a
12852
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12853
+ *
12854
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12855
+ * useful when an integration needs to interact with one specific
12856
+ * addon's surface regardless of how many caps it exports.
12857
+ *
12858
+ * - `capability` — the most precise form. Single cap name. Use for
12859
+ * integration tokens where you want to grant `addons.installPackage`
12860
+ * and nothing else.
12861
+ *
12862
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12863
+ * "give me everything" escape; there is no wildcard scope.
12864
+ */
12865
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12866
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12867
+ var CapScopeSchema = _enum(["device", "system"]);
12868
+ /**
12869
+ * DeviceSelector (scope model v3 — 2026-08-12).
12870
+ *
12871
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12872
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12873
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12874
+ * AFTER the grant was minted — no re-grant, no re-login.
12875
+ *
12876
+ * - `all` — every device in the deployment. The broad viewer/operator
12877
+ * lever without a `category` grant (a `category` grant also covers device
12878
+ * caps that carry no deviceId; `all` is specifically the device set).
12879
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12880
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12881
+ * is NOT covered until the grant is edited.
12882
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12883
+ * DYNAMIC. A device that changes type, or a new device of the type,
12884
+ * re-resolves on the next request.
12885
+ * - `locations` — every device whose operator-assigned `location` label is
12886
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12887
+ * null/unset location matches NO `locations` selector.
12888
+ */
12889
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12890
+ object({ kind: literal("all") }),
12891
+ object({
12892
+ kind: literal("ids"),
12893
+ ids: array(number().int()).min(1)
12894
+ }),
12895
+ object({
12896
+ kind: literal("types"),
12897
+ types: array(_enum(DeviceType)).min(1)
12898
+ }),
12899
+ object({
12900
+ kind: literal("locations"),
12901
+ locations: array(string().min(1)).min(1)
12902
+ })
12903
+ ]);
12904
+ var DeviceTokenScopeSchema = object({
12905
+ type: literal("device"),
12906
+ /** The device SET this grant covers — resolved against the live fleet. */
12907
+ selector: DeviceSelectorSchema,
12908
+ access: array(MethodAccessSchema).min(1),
12909
+ /**
12910
+ * Whether a grant on a PARENT device transparently covers its accessory
12911
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12912
+ * Direction is parent → children ONLY.
12913
+ *
12914
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12915
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12916
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12917
+ * operator must grant on the child, not inherit from the parent). Set it
12918
+ * explicitly to override that default per grant.
12919
+ */
12920
+ includeLinked: boolean().optional()
12921
+ });
12922
+ /**
12923
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12924
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12925
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12926
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12927
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12928
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12929
+ * migration cannot reach a JWT already in a client's hands; parse-time
12930
+ * migration covers both without a flag day. No cast — the raw object is read
12931
+ * through `Reflect.get` (its static type is `unknown`).
12932
+ */
12933
+ function migrateLegacyTokenScope(raw) {
12934
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12935
+ if (Reflect.get(raw, "type") !== "device") return raw;
12936
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12937
+ const targets = Reflect.get(raw, "targets");
12938
+ if (!Array.isArray(targets)) return raw;
12939
+ return {
12940
+ type: "device",
12941
+ selector: {
12942
+ kind: "ids",
12943
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12944
+ },
12945
+ access: Reflect.get(raw, "access")
12946
+ };
12947
+ }
12948
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12949
+ object({
12950
+ type: literal("category"),
12951
+ target: CapScopeSchema,
12952
+ access: array(MethodAccessSchema).min(1)
12953
+ }),
12954
+ object({
12955
+ type: literal("capability"),
12956
+ target: string(),
12957
+ access: array(MethodAccessSchema).min(1)
12958
+ }),
12959
+ object({
12960
+ type: literal("addon"),
12961
+ target: string(),
12962
+ access: array(MethodAccessSchema).min(1)
12963
+ }),
12964
+ DeviceTokenScopeSchema
12965
+ ]));
12966
+ object({
12967
+ id: string(),
12968
+ username: string(),
12969
+ passwordHash: string(),
12970
+ /**
12971
+ * Admin bypass. When true, the middleware skips the scope-access
12972
+ * check entirely. There is no other axis of privilege; the legacy
12973
+ * role enum collapsed onto this boolean in v2.
12974
+ */
12975
+ isAdmin: boolean().default(false),
12976
+ allowedProviders: AllowedProviderSchema,
12977
+ allowedDevices: AllowedDevicesSchema,
12978
+ /**
12979
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12980
+ * ignored. Non-admins without scopes are locked out of every
12981
+ * protected call.
12982
+ */
12983
+ scopes: array(TokenScopeSchema).default([]),
12984
+ createdAt: number(),
12985
+ updatedAt: number()
12986
+ });
12987
+ object({
12988
+ id: string(),
12989
+ label: string(),
12990
+ isAdmin: boolean().default(false),
12991
+ allowedProviders: AllowedProviderSchema,
12992
+ allowedDevices: AllowedDevicesSchema,
12993
+ tokenHash: string(),
12994
+ tokenPrefix: string(),
12995
+ createdAt: number(),
12996
+ lastUsedAt: number().optional()
12997
+ });
12998
+ object({
12999
+ id: string(),
13000
+ userId: string(),
13001
+ name: string(),
13002
+ tokenHash: string(),
13003
+ tokenPrefix: string(),
13004
+ scopes: array(TokenScopeSchema),
13005
+ expiresAt: number().nullish(),
13006
+ lastUsedAt: number().nullish(),
13007
+ createdAt: number()
13008
+ });
13009
+ /** What a share-view grant lets its holder see. */
13010
+ var ShareViewGrantSchema = object({
13011
+ kind: _enum(SHARE_VIEW_KINDS),
13012
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
13013
+ /** Talk-back, opt-in at mint time; absent means off. */
13014
+ talk: boolean().optional()
13015
+ });
13016
+ var ShareViewScopeSchema = object({
13017
+ type: literal("share-view"),
13018
+ grant: ShareViewGrantSchema
13019
+ });
13020
+ var AddonRoutesScopeSchema = object({
13021
+ type: literal("addon-routes"),
13022
+ access: array(MethodAccessSchema).min(1)
13023
+ });
13024
+ var CredentialScopeSchema = union([
13025
+ literal("*"),
13026
+ ShareViewScopeSchema,
13027
+ AddonRoutesScopeSchema,
13028
+ TokenScopeSchema
13029
+ ]);
13030
+ object({
13031
+ kind: literal("credential"),
13032
+ sub: string().min(1),
13033
+ jti: string().min(16),
13034
+ scopes: array(CredentialScopeSchema).min(1)
13035
+ });
12798
13036
  _enum(["new-session", "step-up"]);
12799
13037
  /** The languages the hub's app landing pages are written in (D858). */
12800
13038
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13511,7 +13749,14 @@ var AlertSeveritySchema = _enum([
13511
13749
  ]);
13512
13750
  var AlertActionSchema = object({
13513
13751
  label: string(),
13514
- href: string().optional()
13752
+ href: string().optional(),
13753
+ /**
13754
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13755
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13756
+ * start) — the browser must leave the SPA with a full navigation, because
13757
+ * the SPA has no such route and would bounce to the home page.
13758
+ */
13759
+ navigation: _enum(["app", "server"]).optional()
13515
13760
  });
13516
13761
  var AlertStatusSchema = _enum([
13517
13762
  "active",
@@ -42406,6 +42651,9 @@ var NcSystemEventKindSchema = _enum([
42406
42651
  "server-updated",
42407
42652
  "export-completed",
42408
42653
  "backup-completed",
42654
+ "alert-critical",
42655
+ "alert-error",
42656
+ "alert-critical-resolved",
42409
42657
  "camera-online",
42410
42658
  "camera-offline",
42411
42659
  "camera-disabled",
@@ -44441,202 +44689,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44441
44689
  auth: "admin"
44442
44690
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44443
44691
  /**
44444
- * Zod schemas for persisted record types.
44445
- *
44446
- * These schemas serve as the single source of truth for types that are
44447
- * stored in the settings-store backend and retrieved via tRPC. They
44448
- * replace the manual TypeScript interfaces with schema-derived types,
44449
- * enabling runtime validation when reading from the backend.
44450
- *
44451
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44452
- * keeps the original name for backward compatibility.
44453
- */
44454
- /**
44455
- * Auth model (v2 — 2026-05-12 caps-only):
44456
- *
44457
- * Two principals:
44458
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44459
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44460
- *
44461
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44462
- * `super_admin` — collapsed onto the single boolean because every
44463
- * non-admin caller is governed by the same scope-check rules; the
44464
- * distinction was only ever used to route role-specific procedures
44465
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44466
- * with `isAdmin: false` + an explicit scope list.
44467
- */
44468
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44469
- var MethodAccessSchema = _enum([
44470
- "view",
44471
- "create",
44472
- "delete"
44473
- ]);
44474
- /**
44475
- * A single scope grant. Three forms — checked in matcher with OR
44476
- * semantics; the first match decides whether the call passes:
44477
- *
44478
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44479
- * cap with the matching `scope` declaration. New caps inherit grants
44480
- * automatically — adding a device cap to the codebase makes it
44481
- * reachable to every user with `category:device [...]` without a
44482
- * re-grant. Use this for "family viewer" / "operator" tiers.
44483
- *
44484
- * - `addon` — every cap that ships inside a given addon id. Niche;
44485
- * useful when an integration needs to interact with one specific
44486
- * addon's surface regardless of how many caps it exports.
44487
- *
44488
- * - `capability` — the most precise form. Single cap name. Use for
44489
- * integration tokens where you want to grant `addons.installPackage`
44490
- * and nothing else.
44491
- *
44492
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44493
- * "give me everything" escape; there is no wildcard scope.
44494
- */
44495
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44496
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44497
- var CapScopeSchema = _enum(["device", "system"]);
44498
- /**
44499
- * DeviceSelector (scope model v3 — 2026-08-12).
44500
- *
44501
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44502
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44503
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44504
- * AFTER the grant was minted — no re-grant, no re-login.
44505
- *
44506
- * - `all` — every device in the deployment. The broad viewer/operator
44507
- * lever without a `category` grant (a `category` grant also covers device
44508
- * caps that carry no deviceId; `all` is specifically the device set).
44509
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44510
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44511
- * is NOT covered until the grant is edited.
44512
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44513
- * DYNAMIC. A device that changes type, or a new device of the type,
44514
- * re-resolves on the next request.
44515
- * - `locations` — every device whose operator-assigned `location` label is
44516
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44517
- * null/unset location matches NO `locations` selector.
44518
- */
44519
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44520
- object({ kind: literal("all") }),
44521
- object({
44522
- kind: literal("ids"),
44523
- ids: array(number().int()).min(1)
44524
- }),
44525
- object({
44526
- kind: literal("types"),
44527
- types: array(_enum(DeviceType)).min(1)
44528
- }),
44529
- object({
44530
- kind: literal("locations"),
44531
- locations: array(string().min(1)).min(1)
44532
- })
44533
- ]);
44534
- var DeviceTokenScopeSchema = object({
44535
- type: literal("device"),
44536
- /** The device SET this grant covers — resolved against the live fleet. */
44537
- selector: DeviceSelectorSchema,
44538
- access: array(MethodAccessSchema).min(1),
44539
- /**
44540
- * Whether a grant on a PARENT device transparently covers its accessory
44541
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44542
- * Direction is parent → children ONLY.
44543
- *
44544
- * Absent → the matcher DERIVES it from the access flavour: `view`
44545
- * inherits (a camera viewer sees the camera's accessories), `create` /
44546
- * `delete` do NOT (actuating/removing a child is an explicit act the
44547
- * operator must grant on the child, not inherit from the parent). Set it
44548
- * explicitly to override that default per grant.
44549
- */
44550
- includeLinked: boolean().optional()
44551
- });
44552
- /**
44553
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44554
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44555
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44556
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44557
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44558
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44559
- * migration cannot reach a JWT already in a client's hands; parse-time
44560
- * migration covers both without a flag day. No cast — the raw object is read
44561
- * through `Reflect.get` (its static type is `unknown`).
44562
- */
44563
- function migrateLegacyTokenScope(raw) {
44564
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44565
- if (Reflect.get(raw, "type") !== "device") return raw;
44566
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44567
- const targets = Reflect.get(raw, "targets");
44568
- if (!Array.isArray(targets)) return raw;
44569
- return {
44570
- type: "device",
44571
- selector: {
44572
- kind: "ids",
44573
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44574
- },
44575
- access: Reflect.get(raw, "access")
44576
- };
44577
- }
44578
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44579
- object({
44580
- type: literal("category"),
44581
- target: CapScopeSchema,
44582
- access: array(MethodAccessSchema).min(1)
44583
- }),
44584
- object({
44585
- type: literal("capability"),
44586
- target: string(),
44587
- access: array(MethodAccessSchema).min(1)
44588
- }),
44589
- object({
44590
- type: literal("addon"),
44591
- target: string(),
44592
- access: array(MethodAccessSchema).min(1)
44593
- }),
44594
- DeviceTokenScopeSchema
44595
- ]));
44596
- object({
44597
- id: string(),
44598
- username: string(),
44599
- passwordHash: string(),
44600
- /**
44601
- * Admin bypass. When true, the middleware skips the scope-access
44602
- * check entirely. There is no other axis of privilege; the legacy
44603
- * role enum collapsed onto this boolean in v2.
44604
- */
44605
- isAdmin: boolean().default(false),
44606
- allowedProviders: AllowedProviderSchema,
44607
- allowedDevices: AllowedDevicesSchema,
44608
- /**
44609
- * Scopes granted to this user. Admins bypass; their `scopes` is
44610
- * ignored. Non-admins without scopes are locked out of every
44611
- * protected call.
44612
- */
44613
- scopes: array(TokenScopeSchema).default([]),
44614
- createdAt: number(),
44615
- updatedAt: number()
44616
- });
44617
- object({
44618
- id: string(),
44619
- label: string(),
44620
- isAdmin: boolean().default(false),
44621
- allowedProviders: AllowedProviderSchema,
44622
- allowedDevices: AllowedDevicesSchema,
44623
- tokenHash: string(),
44624
- tokenPrefix: string(),
44625
- createdAt: number(),
44626
- lastUsedAt: number().optional()
44627
- });
44628
- object({
44629
- id: string(),
44630
- userId: string(),
44631
- name: string(),
44632
- tokenHash: string(),
44633
- tokenPrefix: string(),
44634
- scopes: array(TokenScopeSchema),
44635
- expiresAt: number().nullish(),
44636
- lastUsedAt: number().nullish(),
44637
- createdAt: number()
44638
- });
44639
- /**
44640
44692
  * `oauth-integration` — a collection cap by which an addon declares
44641
44693
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44642
44694
  * Each provider returns a static descriptor; the core enumerates them
@@ -51482,7 +51534,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51482
51534
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51483
51535
  kind: "mutation",
51484
51536
  auth: "admin"
51485
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51537
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51538
+ clear: boolean(),
51539
+ repointLocationId: string().optional()
51540
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51486
51541
  kind: "mutation",
51487
51542
  auth: "admin"
51488
51543
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -55738,6 +55793,11 @@ onStatusChanged: { data: object({
55738
55793
  *
55739
55794
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55740
55795
  * provider refreshes the slice on an interval and eagerly after commands.
55796
+ *
55797
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55798
+ * nullable: `null` means "not known right now" (the appliance has not said,
55799
+ * the link is down, or the description does not carry it) and is never
55800
+ * rendered or exported as `false` / `0`. `availability` says why.
55741
55801
  */
55742
55802
  var DishwasherStateSchema = _enum([
55743
55803
  "idle",
@@ -55747,43 +55807,155 @@ var DishwasherStateSchema = _enum([
55747
55807
  "error",
55748
55808
  "unavailable"
55749
55809
  ]);
55810
+ /**
55811
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55812
+ * view for compact surfaces; this is what the appliance said.
55813
+ */
55814
+ var DishwasherOperationStateSchema = _enum([
55815
+ "Inactive",
55816
+ "Ready",
55817
+ "DelayedStart",
55818
+ "Run",
55819
+ "Pause",
55820
+ "ActionRequired",
55821
+ "Finished",
55822
+ "Error",
55823
+ "Aborting"
55824
+ ]);
55825
+ /**
55826
+ * Why fields may be `null`:
55827
+ * - `available` — the link is up and the description is loaded;
55828
+ * - `offline` — the local link is down (values are unknown, not last-known);
55829
+ * - `description-missing` — the link is up but the appliance's description could not
55830
+ * be loaded, so its values cannot be decoded.
55831
+ */
55832
+ var DishwasherAvailabilitySchema = _enum([
55833
+ "available",
55834
+ "offline",
55835
+ "description-missing"
55836
+ ]);
55750
55837
  var DishwasherConsumableLevelSchema = _enum([
55751
55838
  "ok",
55752
55839
  "low",
55753
55840
  "empty"
55754
55841
  ]);
55755
55842
  var DishwasherStatusSchema = object({
55843
+ availability: DishwasherAvailabilitySchema,
55844
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55756
55845
  state: DishwasherStateSchema,
55757
- /** Active program id/name, or null when none selected / unknown. */
55846
+ /** The appliance's operation state as reported; null when not known. */
55847
+ operationState: DishwasherOperationStateSchema.nullable(),
55848
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55758
55849
  program: string().nullable(),
55759
- /** Program tokens the hardware accepts — drives the UI selector. */
55850
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55851
+ selectedProgram: string().nullable(),
55852
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55760
55853
  availablePrograms: array(string()),
55761
- /** Minutes remaining on the active cycle, or null when not running. */
55762
- remainingMinutes: number().int().nonnegative().nullable(),
55854
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55855
+ remainingSeconds: number().int().nonnegative().nullable(),
55856
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55857
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55763
55858
  /** Cycle completion 0..100, or null when not applicable. */
55764
55859
  progressPercent: number().min(0).max(100).nullable(),
55765
- /** True when the door is reported open. */
55766
- doorOpen: boolean(),
55767
- /** True when remote start is allowed (door closed, power on, etc.). */
55768
- remoteStartAllowed: boolean(),
55769
- /** Main power / switched-on state. */
55770
- powerOn: boolean(),
55860
+ /** True when the door is reported open; null when the door state is not known. */
55861
+ doorOpen: boolean().nullable(),
55862
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55863
+ doorLocked: boolean().nullable(),
55864
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55865
+ remoteStartAllowed: boolean().nullable(),
55866
+ /** True when the appliance accepts remote control now; null when not known. */
55867
+ remoteControlActive: boolean().nullable(),
55868
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55869
+ localControlActive: boolean().nullable(),
55870
+ /** Main power / switched-on state; null when not known. */
55871
+ powerOn: boolean().nullable(),
55872
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55873
+ powerState: string().nullable(),
55771
55874
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
55772
55875
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55773
- halfLoad: boolean(),
55774
- hygienePlus: boolean(),
55876
+ /** Option states: null when the appliance does not expose the option or has not said. */
55877
+ halfLoad: boolean().nullable(),
55878
+ hygienePlus: boolean().nullable(),
55775
55879
  /** Extra dry option when the appliance exposes it. */
55776
- extraDry: boolean(),
55880
+ extraDry: boolean().nullable(),
55777
55881
  /** Intensive zone (lower basket) when the appliance exposes it. */
55778
- intensiveZone: boolean(),
55882
+ intensiveZone: boolean().nullable(),
55779
55883
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55780
- varioSpeedPlus: boolean(),
55781
- /** Child lock (controls disabled on the appliance). */
55782
- childLock: boolean(),
55884
+ varioSpeedPlus: boolean().nullable(),
55885
+ /** Child lock (controls disabled on the appliance); null when not known. */
55886
+ childLock: boolean().nullable(),
55887
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55888
+ activeEvents: array(string()),
55889
+ /** Numeric error code when the appliance reports one; null otherwise. */
55783
55890
  errorCode: number().nullable(),
55891
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55784
55892
  errorLabel: string().nullable(),
55893
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55785
55894
  lastFetchedAt: number()
55786
55895
  });
55896
+ var DeviceIdSchema = number().int().nonnegative();
55897
+ /** A value a program option or setting can take. */
55898
+ var DishwasherValueSchema = union([
55899
+ boolean(),
55900
+ string(),
55901
+ number()
55902
+ ]);
55903
+ var DishwasherAccessSchema = _enum([
55904
+ "none",
55905
+ "read",
55906
+ "readWrite",
55907
+ "writeOnly",
55908
+ "readStatic"
55909
+ ]);
55910
+ /**
55911
+ * One option or setting the appliance declares, with the constraints its description
55912
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55913
+ */
55914
+ var DishwasherOptionDescriptorSchema = object({
55915
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55916
+ key: string(),
55917
+ /** Last segment of the key, for display. */
55918
+ name: string(),
55919
+ type: _enum([
55920
+ "boolean",
55921
+ "number",
55922
+ "enum",
55923
+ "string"
55924
+ ]),
55925
+ access: DishwasherAccessSchema,
55926
+ /** The appliance reports this entity as currently available. */
55927
+ available: boolean(),
55928
+ /** Unit the description declares for a number; null when it declares none. */
55929
+ unit: string().nullable(),
55930
+ min: number().nullable(),
55931
+ max: number().nullable(),
55932
+ step: number().nullable(),
55933
+ /** Allowed members of an enum; null for other types. */
55934
+ enumValues: array(string()).nullable(),
55935
+ defaultValue: DishwasherValueSchema.nullable()
55936
+ });
55937
+ var DishwasherProgramSchema = object({
55938
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
55939
+ key: string(),
55940
+ name: string(),
55941
+ /** The appliance currently offers this program. */
55942
+ available: boolean(),
55943
+ /** The options this program lists, with the program-level access / availability / default. */
55944
+ options: array(DishwasherOptionDescriptorSchema)
55945
+ });
55946
+ var DishwasherOptionsSchema = object({
55947
+ availability: DishwasherAvailabilitySchema,
55948
+ /** What the appliance can be told to do, from the commands its description declares. */
55949
+ supportsStart: boolean(),
55950
+ supportsPause: boolean(),
55951
+ supportsResume: boolean(),
55952
+ supportsStop: boolean(),
55953
+ supportsPower: boolean(),
55954
+ /** Every program the description lists, with its options. */
55955
+ programs: array(DishwasherProgramSchema),
55956
+ /** Every option and setting entity the description lists (programs reference these by key). */
55957
+ options: array(DishwasherOptionDescriptorSchema)
55958
+ });
55787
55959
  var dishwasherCapability = {
55788
55960
  name: "dishwasher",
55789
55961
  scope: "device",
@@ -55791,86 +55963,102 @@ var dishwasherCapability = {
55791
55963
  mode: "singleton",
55792
55964
  deviceTypes: [DeviceType.Dishwasher],
55793
55965
  methods: {
55794
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55966
+ /**
55967
+ * Start a program. Without `program` the selected one starts. `options` are
55968
+ * option feature keys; each is checked against the program's constraints.
55969
+ */
55970
+ start: method(object({
55971
+ deviceId: DeviceIdSchema,
55972
+ program: string().min(1).optional(),
55973
+ options: record(string(), DishwasherValueSchema).optional()
55974
+ }), _void(), {
55795
55975
  kind: "mutation",
55796
55976
  auth: "protected"
55797
55977
  }),
55798
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55978
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55799
55979
  kind: "mutation",
55800
55980
  auth: "protected"
55801
55981
  }),
55802
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55982
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
55983
+ kind: "mutation",
55984
+ auth: "protected"
55985
+ }),
55986
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55803
55987
  kind: "mutation",
55804
55988
  auth: "protected"
55805
55989
  }),
55990
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55806
55991
  setProgram: method(object({
55807
- deviceId: number().int().nonnegative(),
55992
+ deviceId: DeviceIdSchema,
55808
55993
  program: string().min(1)
55809
55994
  }), _void(), {
55810
55995
  kind: "mutation",
55811
55996
  auth: "protected"
55812
55997
  }),
55813
55998
  setPower: method(object({
55814
- deviceId: number().int().nonnegative(),
55999
+ deviceId: DeviceIdSchema,
55815
56000
  on: boolean()
55816
56001
  }), _void(), {
55817
56002
  kind: "mutation",
55818
56003
  auth: "protected"
55819
56004
  }),
55820
56005
  setHalfLoad: method(object({
55821
- deviceId: number().int().nonnegative(),
56006
+ deviceId: DeviceIdSchema,
55822
56007
  on: boolean()
55823
56008
  }), _void(), {
55824
56009
  kind: "mutation",
55825
56010
  auth: "protected"
55826
56011
  }),
55827
56012
  setHygienePlus: method(object({
55828
- deviceId: number().int().nonnegative(),
56013
+ deviceId: DeviceIdSchema,
55829
56014
  on: boolean()
55830
56015
  }), _void(), {
55831
56016
  kind: "mutation",
55832
56017
  auth: "protected"
55833
56018
  }),
55834
56019
  setExtraDry: method(object({
55835
- deviceId: number().int().nonnegative(),
56020
+ deviceId: DeviceIdSchema,
55836
56021
  on: boolean()
55837
56022
  }), _void(), {
55838
56023
  kind: "mutation",
55839
56024
  auth: "protected"
55840
56025
  }),
55841
56026
  setIntensiveZone: method(object({
55842
- deviceId: number().int().nonnegative(),
56027
+ deviceId: DeviceIdSchema,
55843
56028
  on: boolean()
55844
56029
  }), _void(), {
55845
56030
  kind: "mutation",
55846
56031
  auth: "protected"
55847
56032
  }),
55848
56033
  setVarioSpeedPlus: method(object({
55849
- deviceId: number().int().nonnegative(),
56034
+ deviceId: DeviceIdSchema,
55850
56035
  on: boolean()
55851
56036
  }), _void(), {
55852
56037
  kind: "mutation",
55853
56038
  auth: "protected"
55854
56039
  }),
55855
56040
  setChildLock: method(object({
55856
- deviceId: number().int().nonnegative(),
56041
+ deviceId: DeviceIdSchema,
55857
56042
  on: boolean()
55858
56043
  }), _void(), {
55859
56044
  kind: "mutation",
55860
56045
  auth: "protected"
55861
56046
  }),
56047
+ /**
56048
+ * Write any option or setting by feature key. Refused when the description does
56049
+ * not list it, it is not writable or not available now, or the value is outside
56050
+ * its declared range / members.
56051
+ */
55862
56052
  setOption: method(object({
55863
- deviceId: number().int().nonnegative(),
56053
+ deviceId: DeviceIdSchema,
55864
56054
  key: string().min(1),
55865
- value: union([
55866
- boolean(),
55867
- string(),
55868
- number()
55869
- ])
56055
+ value: DishwasherValueSchema
55870
56056
  }), _void(), {
55871
56057
  kind: "mutation",
55872
56058
  auth: "protected"
55873
- })
56059
+ }),
56060
+ /** What this appliance can do, from its own description — the UI is derived from it. */
56061
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55874
56062
  },
55875
56063
  status: {
55876
56064
  schema: DishwasherStatusSchema,
@@ -69819,6 +70007,12 @@ Object.freeze({
69819
70007
  addonId: null,
69820
70008
  access: "view"
69821
70009
  },
70010
+ "dishwasher.getOptions": {
70011
+ capName: "dishwasher",
70012
+ capScope: "device",
70013
+ addonId: null,
70014
+ access: "view"
70015
+ },
69822
70016
  "dishwasher.getStatus": {
69823
70017
  capName: "dishwasher",
69824
70018
  capScope: "device",
@@ -69831,6 +70025,12 @@ Object.freeze({
69831
70025
  addonId: null,
69832
70026
  access: "create"
69833
70027
  },
70028
+ "dishwasher.resume": {
70029
+ capName: "dishwasher",
70030
+ capScope: "device",
70031
+ addonId: null,
70032
+ access: "create"
70033
+ },
69834
70034
  "dishwasher.setChildLock": {
69835
70035
  capName: "dishwasher",
69836
70036
  capScope: "device",
@@ -74331,6 +74531,12 @@ Object.freeze({
74331
74531
  addonId: null,
74332
74532
  access: "view"
74333
74533
  },
74534
+ "storageMigration.moverClearance": {
74535
+ capName: "storage-migration",
74536
+ capScope: "system",
74537
+ addonId: null,
74538
+ access: "view"
74539
+ },
74334
74540
  "storageMigration.movers": {
74335
74541
  capName: "storage-migration",
74336
74542
  capScope: "system",
@@ -76524,6 +76730,11 @@ Object.freeze({
76524
76730
  form: "single",
76525
76731
  optional: false
76526
76732
  }],
76733
+ "dishwasher.getOptions": [{
76734
+ name: "deviceId",
76735
+ form: "single",
76736
+ optional: false
76737
+ }],
76527
76738
  "dishwasher.getStatus": [{
76528
76739
  name: "deviceId",
76529
76740
  form: "single",
@@ -76534,6 +76745,11 @@ Object.freeze({
76534
76745
  form: "single",
76535
76746
  optional: false
76536
76747
  }],
76748
+ "dishwasher.resume": [{
76749
+ name: "deviceId",
76750
+ form: "single",
76751
+ optional: false
76752
+ }],
76537
76753
  "dishwasher.setChildLock": [{
76538
76754
  name: "deviceId",
76539
76755
  form: "single",
@@ -78620,6 +78836,9 @@ new Map(Object.entries({
78620
78836
  "wrapper-update-available": "system",
78621
78837
  "backup-completed": "system",
78622
78838
  "export-completed": "system",
78839
+ "alert-critical": "system",
78840
+ "alert-error": "system",
78841
+ "alert-critical-resolved": "system",
78623
78842
  "storage-location-low": "system",
78624
78843
  "storage-location-critical": "system",
78625
78844
  "storage-location-ok": "system",
@@ -78744,6 +78963,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
78744
78963
  "storage-location-ok"
78745
78964
  ]
78746
78965
  },
78966
+ {
78967
+ id: "alerts",
78968
+ family: "system",
78969
+ label: "Alerts",
78970
+ kinds: [
78971
+ "alert-critical",
78972
+ "alert-error",
78973
+ "alert-critical-resolved"
78974
+ ]
78975
+ },
78747
78976
  {
78748
78977
  id: "alarm",
78749
78978
  family: "alarm",
@@ -78788,6 +79017,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
78788
79017
  return [[descriptor.kind, field]];
78789
79018
  })));
78790
79019
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
79020
+ object({
79021
+ phase: _enum(["raised", "resolved"]),
79022
+ episodeId: string().min(1),
79023
+ alertId: string().min(1),
79024
+ severity: AlertSeveritySchema,
79025
+ category: string(),
79026
+ title: string(),
79027
+ message: string(),
79028
+ sourceType: string().optional(),
79029
+ sourceId: string().optional(),
79030
+ nodeId: string().optional(),
79031
+ /** The alert's own action link (where the operator acts on it), when it has one. */
79032
+ actionUrl: string().optional(),
79033
+ at: number()
79034
+ });
78791
79035
  var RULE_BODY_ONLY = ["body"];
78792
79036
  var RULE_TEXT = ["title", "body"];
78793
79037
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -78797,6 +79041,11 @@ var TANK = [
78797
79041
  "device-tank-full",
78798
79042
  "device-tank-normal"
78799
79043
  ];
79044
+ var ALERT_EPISODE = [
79045
+ "alert-critical",
79046
+ "alert-error",
79047
+ "alert-critical-resolved"
79048
+ ];
78800
79049
  var UPDATES = [
78801
79050
  "addon-update-available",
78802
79051
  "server-update-available",
@@ -78989,14 +79238,14 @@ var STATE_SUMMARY_VARS = [
78989
79238
  ([...RULE_TEXT], [...CONSUMABLE]),
78990
79239
  ([...RULE_TEXT], [...TANK]),
78991
79240
  [...RULE_TEXT],
78992
- ([...RULE_TEXT], [...UPDATES]),
78993
- ([...RULE_TEXT], [...UPDATES]),
78994
- [...RULE_TEXT],
79241
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79242
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78995
79243
  [...RULE_TEXT],
78996
79244
  [...RULE_TEXT],
78997
79245
  [...RULE_TEXT],
78998
79246
  [...RULE_TEXT],
78999
79247
  [...RULE_TEXT],
79248
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79000
79249
  [...RULE_TEXT],
79001
79250
  [...RULE_TEXT],
79002
79251
  [...RULE_TEXT],
@@ -79014,7 +79263,11 @@ var STATE_SUMMARY_VARS = [
79014
79263
  [...RULE_TEXT],
79015
79264
  [...RULE_TEXT],
79016
79265
  [...RULE_TEXT],
79017
- [...RULE_TEXT],
79266
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79267
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79268
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79269
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79270
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79018
79271
  [...RULE_TEXT],
79019
79272
  [...RULE_TEXT],
79020
79273
  [...RULE_TEXT],