@camstack/addon-provider-bosch 0.1.2 → 0.1.4

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.
@@ -1,5 +1,5 @@
1
1
  require("node:crypto");
2
- //#region ../types/dist/event-category-BvOFi6PY.mjs
2
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -78,9 +78,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
78
78
  /**
79
79
  * The node's one-shot runner boot check (D877): planned runners against the
80
80
  * process service, `degraded` when any is failed, refused or missing. The
81
- * alert centre turns it into one alert and a direct critical push.
81
+ * alert centre turns it into one critical alert.
82
82
  */
83
83
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
84
+ /**
85
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
86
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
87
+ * centre sends no notification of its own: Notification Center turns this
88
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
89
+ * system-event kinds, and reconciles from the alerts store because a bus
90
+ * event may be dropped (D8, D11).
91
+ */
92
+ EventCategory["AlertEpisode"] = "alert.episode";
84
93
  EventCategory["AddonError"] = "addon.error";
85
94
  EventCategory["AddonPageReady"] = "addon.page-ready";
86
95
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5405,7 +5414,7 @@ var ZodIssueCode = {
5405
5414
  var ZodFirstPartyTypeKind;
5406
5415
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5407
5416
  //#endregion
5408
- //#region ../types/dist/sleep-BegKjwUu.mjs
5417
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5409
5418
  /**
5410
5419
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5411
5420
  * 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. */
@@ -12478,6 +12493,229 @@ var ConvertResultSchema = object({
12478
12493
  files: array(string()).readonly()
12479
12494
  })).readonly()
12480
12495
  });
12496
+ /**
12497
+ * Zod schemas for persisted record types.
12498
+ *
12499
+ * These schemas serve as the single source of truth for types that are
12500
+ * stored in the settings-store backend and retrieved via tRPC. They
12501
+ * replace the manual TypeScript interfaces with schema-derived types,
12502
+ * enabling runtime validation when reading from the backend.
12503
+ *
12504
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12505
+ * keeps the original name for backward compatibility.
12506
+ */
12507
+ /**
12508
+ * Auth model (v2 — 2026-05-12 caps-only):
12509
+ *
12510
+ * Two principals:
12511
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12512
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12513
+ *
12514
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12515
+ * `super_admin` — collapsed onto the single boolean because every
12516
+ * non-admin caller is governed by the same scope-check rules; the
12517
+ * distinction was only ever used to route role-specific procedures
12518
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12519
+ * with `isAdmin: false` + an explicit scope list.
12520
+ */
12521
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12522
+ var MethodAccessSchema = _enum([
12523
+ "view",
12524
+ "create",
12525
+ "delete"
12526
+ ]);
12527
+ /**
12528
+ * A single scope grant. Three forms — checked in matcher with OR
12529
+ * semantics; the first match decides whether the call passes:
12530
+ *
12531
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12532
+ * cap with the matching `scope` declaration. New caps inherit grants
12533
+ * automatically — adding a device cap to the codebase makes it
12534
+ * reachable to every user with `category:device [...]` without a
12535
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12536
+ *
12537
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12538
+ * useful when an integration needs to interact with one specific
12539
+ * addon's surface regardless of how many caps it exports.
12540
+ *
12541
+ * - `capability` — the most precise form. Single cap name. Use for
12542
+ * integration tokens where you want to grant `addons.installPackage`
12543
+ * and nothing else.
12544
+ *
12545
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12546
+ * "give me everything" escape; there is no wildcard scope.
12547
+ */
12548
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12549
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12550
+ var CapScopeSchema = _enum(["device", "system"]);
12551
+ /**
12552
+ * DeviceSelector (scope model v3 — 2026-08-12).
12553
+ *
12554
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12555
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12556
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12557
+ * AFTER the grant was minted — no re-grant, no re-login.
12558
+ *
12559
+ * - `all` — every device in the deployment. The broad viewer/operator
12560
+ * lever without a `category` grant (a `category` grant also covers device
12561
+ * caps that carry no deviceId; `all` is specifically the device set).
12562
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12563
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12564
+ * is NOT covered until the grant is edited.
12565
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12566
+ * DYNAMIC. A device that changes type, or a new device of the type,
12567
+ * re-resolves on the next request.
12568
+ * - `locations` — every device whose operator-assigned `location` label is
12569
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12570
+ * null/unset location matches NO `locations` selector.
12571
+ */
12572
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12573
+ object({ kind: literal("all") }),
12574
+ object({
12575
+ kind: literal("ids"),
12576
+ ids: array(number().int()).min(1)
12577
+ }),
12578
+ object({
12579
+ kind: literal("types"),
12580
+ types: array(_enum(DeviceType)).min(1)
12581
+ }),
12582
+ object({
12583
+ kind: literal("locations"),
12584
+ locations: array(string().min(1)).min(1)
12585
+ })
12586
+ ]);
12587
+ var DeviceTokenScopeSchema = object({
12588
+ type: literal("device"),
12589
+ /** The device SET this grant covers — resolved against the live fleet. */
12590
+ selector: DeviceSelectorSchema,
12591
+ access: array(MethodAccessSchema).min(1),
12592
+ /**
12593
+ * Whether a grant on a PARENT device transparently covers its accessory
12594
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12595
+ * Direction is parent → children ONLY.
12596
+ *
12597
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12598
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12599
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12600
+ * operator must grant on the child, not inherit from the parent). Set it
12601
+ * explicitly to override that default per grant.
12602
+ */
12603
+ includeLinked: boolean().optional()
12604
+ });
12605
+ /**
12606
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12607
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12608
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12609
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12610
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12611
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12612
+ * migration cannot reach a JWT already in a client's hands; parse-time
12613
+ * migration covers both without a flag day. No cast — the raw object is read
12614
+ * through `Reflect.get` (its static type is `unknown`).
12615
+ */
12616
+ function migrateLegacyTokenScope(raw) {
12617
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12618
+ if (Reflect.get(raw, "type") !== "device") return raw;
12619
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12620
+ const targets = Reflect.get(raw, "targets");
12621
+ if (!Array.isArray(targets)) return raw;
12622
+ return {
12623
+ type: "device",
12624
+ selector: {
12625
+ kind: "ids",
12626
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12627
+ },
12628
+ access: Reflect.get(raw, "access")
12629
+ };
12630
+ }
12631
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12632
+ object({
12633
+ type: literal("category"),
12634
+ target: CapScopeSchema,
12635
+ access: array(MethodAccessSchema).min(1)
12636
+ }),
12637
+ object({
12638
+ type: literal("capability"),
12639
+ target: string(),
12640
+ access: array(MethodAccessSchema).min(1)
12641
+ }),
12642
+ object({
12643
+ type: literal("addon"),
12644
+ target: string(),
12645
+ access: array(MethodAccessSchema).min(1)
12646
+ }),
12647
+ DeviceTokenScopeSchema
12648
+ ]));
12649
+ object({
12650
+ id: string(),
12651
+ username: string(),
12652
+ passwordHash: string(),
12653
+ /**
12654
+ * Admin bypass. When true, the middleware skips the scope-access
12655
+ * check entirely. There is no other axis of privilege; the legacy
12656
+ * role enum collapsed onto this boolean in v2.
12657
+ */
12658
+ isAdmin: boolean().default(false),
12659
+ allowedProviders: AllowedProviderSchema,
12660
+ allowedDevices: AllowedDevicesSchema,
12661
+ /**
12662
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12663
+ * ignored. Non-admins without scopes are locked out of every
12664
+ * protected call.
12665
+ */
12666
+ scopes: array(TokenScopeSchema).default([]),
12667
+ createdAt: number(),
12668
+ updatedAt: number()
12669
+ });
12670
+ object({
12671
+ id: string(),
12672
+ label: string(),
12673
+ isAdmin: boolean().default(false),
12674
+ allowedProviders: AllowedProviderSchema,
12675
+ allowedDevices: AllowedDevicesSchema,
12676
+ tokenHash: string(),
12677
+ tokenPrefix: string(),
12678
+ createdAt: number(),
12679
+ lastUsedAt: number().optional()
12680
+ });
12681
+ object({
12682
+ id: string(),
12683
+ userId: string(),
12684
+ name: string(),
12685
+ tokenHash: string(),
12686
+ tokenPrefix: string(),
12687
+ scopes: array(TokenScopeSchema),
12688
+ expiresAt: number().nullish(),
12689
+ lastUsedAt: number().nullish(),
12690
+ createdAt: number()
12691
+ });
12692
+ /** What a share-view grant lets its holder see. */
12693
+ var ShareViewGrantSchema = object({
12694
+ kind: _enum(SHARE_VIEW_KINDS),
12695
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
12696
+ /** Talk-back, opt-in at mint time; absent means off. */
12697
+ talk: boolean().optional()
12698
+ });
12699
+ var ShareViewScopeSchema = object({
12700
+ type: literal("share-view"),
12701
+ grant: ShareViewGrantSchema
12702
+ });
12703
+ var AddonRoutesScopeSchema = object({
12704
+ type: literal("addon-routes"),
12705
+ access: array(MethodAccessSchema).min(1)
12706
+ });
12707
+ var CredentialScopeSchema = union([
12708
+ literal("*"),
12709
+ ShareViewScopeSchema,
12710
+ AddonRoutesScopeSchema,
12711
+ TokenScopeSchema
12712
+ ]);
12713
+ object({
12714
+ kind: literal("credential"),
12715
+ sub: string().min(1),
12716
+ jti: string().min(16),
12717
+ scopes: array(CredentialScopeSchema).min(1)
12718
+ });
12481
12719
  _enum(["new-session", "step-up"]);
12482
12720
  /** The languages the hub's app landing pages are written in (D858). */
12483
12721
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13194,7 +13432,14 @@ var AlertSeveritySchema = _enum([
13194
13432
  ]);
13195
13433
  var AlertActionSchema = object({
13196
13434
  label: string(),
13197
- href: string().optional()
13435
+ href: string().optional(),
13436
+ /**
13437
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13438
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13439
+ * start) — the browser must leave the SPA with a full navigation, because
13440
+ * the SPA has no such route and would bounce to the home page.
13441
+ */
13442
+ navigation: _enum(["app", "server"]).optional()
13198
13443
  });
13199
13444
  var AlertStatusSchema = _enum([
13200
13445
  "active",
@@ -41927,6 +42172,9 @@ var NcSystemEventKindSchema = _enum([
41927
42172
  "server-updated",
41928
42173
  "export-completed",
41929
42174
  "backup-completed",
42175
+ "alert-critical",
42176
+ "alert-error",
42177
+ "alert-critical-resolved",
41930
42178
  "camera-online",
41931
42179
  "camera-offline",
41932
42180
  "camera-disabled",
@@ -43962,202 +44210,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
43962
44210
  auth: "admin"
43963
44211
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
43964
44212
  /**
43965
- * Zod schemas for persisted record types.
43966
- *
43967
- * These schemas serve as the single source of truth for types that are
43968
- * stored in the settings-store backend and retrieved via tRPC. They
43969
- * replace the manual TypeScript interfaces with schema-derived types,
43970
- * enabling runtime validation when reading from the backend.
43971
- *
43972
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
43973
- * keeps the original name for backward compatibility.
43974
- */
43975
- /**
43976
- * Auth model (v2 — 2026-05-12 caps-only):
43977
- *
43978
- * Two principals:
43979
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
43980
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
43981
- *
43982
- * No role enum. There used to be `viewer / agent / scoped` and earlier
43983
- * `super_admin` — collapsed onto the single boolean because every
43984
- * non-admin caller is governed by the same scope-check rules; the
43985
- * distinction was only ever used to route role-specific procedures
43986
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
43987
- * with `isAdmin: false` + an explicit scope list.
43988
- */
43989
- /** Per-method access flavour. Materialised on every cap method via codegen. */
43990
- var MethodAccessSchema = _enum([
43991
- "view",
43992
- "create",
43993
- "delete"
43994
- ]);
43995
- /**
43996
- * A single scope grant. Three forms — checked in matcher with OR
43997
- * semantics; the first match decides whether the call passes:
43998
- *
43999
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44000
- * cap with the matching `scope` declaration. New caps inherit grants
44001
- * automatically — adding a device cap to the codebase makes it
44002
- * reachable to every user with `category:device [...]` without a
44003
- * re-grant. Use this for "family viewer" / "operator" tiers.
44004
- *
44005
- * - `addon` — every cap that ships inside a given addon id. Niche;
44006
- * useful when an integration needs to interact with one specific
44007
- * addon's surface regardless of how many caps it exports.
44008
- *
44009
- * - `capability` — the most precise form. Single cap name. Use for
44010
- * integration tokens where you want to grant `addons.installPackage`
44011
- * and nothing else.
44012
- *
44013
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44014
- * "give me everything" escape; there is no wildcard scope.
44015
- */
44016
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44017
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44018
- var CapScopeSchema = _enum(["device", "system"]);
44019
- /**
44020
- * DeviceSelector (scope model v3 — 2026-08-12).
44021
- *
44022
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44023
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44024
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44025
- * AFTER the grant was minted — no re-grant, no re-login.
44026
- *
44027
- * - `all` — every device in the deployment. The broad viewer/operator
44028
- * lever without a `category` grant (a `category` grant also covers device
44029
- * caps that carry no deviceId; `all` is specifically the device set).
44030
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44031
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44032
- * is NOT covered until the grant is edited.
44033
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44034
- * DYNAMIC. A device that changes type, or a new device of the type,
44035
- * re-resolves on the next request.
44036
- * - `locations` — every device whose operator-assigned `location` label is
44037
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44038
- * null/unset location matches NO `locations` selector.
44039
- */
44040
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44041
- object({ kind: literal("all") }),
44042
- object({
44043
- kind: literal("ids"),
44044
- ids: array(number().int()).min(1)
44045
- }),
44046
- object({
44047
- kind: literal("types"),
44048
- types: array(_enum(DeviceType)).min(1)
44049
- }),
44050
- object({
44051
- kind: literal("locations"),
44052
- locations: array(string().min(1)).min(1)
44053
- })
44054
- ]);
44055
- var DeviceTokenScopeSchema = object({
44056
- type: literal("device"),
44057
- /** The device SET this grant covers — resolved against the live fleet. */
44058
- selector: DeviceSelectorSchema,
44059
- access: array(MethodAccessSchema).min(1),
44060
- /**
44061
- * Whether a grant on a PARENT device transparently covers its accessory
44062
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44063
- * Direction is parent → children ONLY.
44064
- *
44065
- * Absent → the matcher DERIVES it from the access flavour: `view`
44066
- * inherits (a camera viewer sees the camera's accessories), `create` /
44067
- * `delete` do NOT (actuating/removing a child is an explicit act the
44068
- * operator must grant on the child, not inherit from the parent). Set it
44069
- * explicitly to override that default per grant.
44070
- */
44071
- includeLinked: boolean().optional()
44072
- });
44073
- /**
44074
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44075
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44076
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44077
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44078
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44079
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44080
- * migration cannot reach a JWT already in a client's hands; parse-time
44081
- * migration covers both without a flag day. No cast — the raw object is read
44082
- * through `Reflect.get` (its static type is `unknown`).
44083
- */
44084
- function migrateLegacyTokenScope(raw) {
44085
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44086
- if (Reflect.get(raw, "type") !== "device") return raw;
44087
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44088
- const targets = Reflect.get(raw, "targets");
44089
- if (!Array.isArray(targets)) return raw;
44090
- return {
44091
- type: "device",
44092
- selector: {
44093
- kind: "ids",
44094
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44095
- },
44096
- access: Reflect.get(raw, "access")
44097
- };
44098
- }
44099
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44100
- object({
44101
- type: literal("category"),
44102
- target: CapScopeSchema,
44103
- access: array(MethodAccessSchema).min(1)
44104
- }),
44105
- object({
44106
- type: literal("capability"),
44107
- target: string(),
44108
- access: array(MethodAccessSchema).min(1)
44109
- }),
44110
- object({
44111
- type: literal("addon"),
44112
- target: string(),
44113
- access: array(MethodAccessSchema).min(1)
44114
- }),
44115
- DeviceTokenScopeSchema
44116
- ]));
44117
- object({
44118
- id: string(),
44119
- username: string(),
44120
- passwordHash: string(),
44121
- /**
44122
- * Admin bypass. When true, the middleware skips the scope-access
44123
- * check entirely. There is no other axis of privilege; the legacy
44124
- * role enum collapsed onto this boolean in v2.
44125
- */
44126
- isAdmin: boolean().default(false),
44127
- allowedProviders: AllowedProviderSchema,
44128
- allowedDevices: AllowedDevicesSchema,
44129
- /**
44130
- * Scopes granted to this user. Admins bypass; their `scopes` is
44131
- * ignored. Non-admins without scopes are locked out of every
44132
- * protected call.
44133
- */
44134
- scopes: array(TokenScopeSchema).default([]),
44135
- createdAt: number(),
44136
- updatedAt: number()
44137
- });
44138
- object({
44139
- id: string(),
44140
- label: string(),
44141
- isAdmin: boolean().default(false),
44142
- allowedProviders: AllowedProviderSchema,
44143
- allowedDevices: AllowedDevicesSchema,
44144
- tokenHash: string(),
44145
- tokenPrefix: string(),
44146
- createdAt: number(),
44147
- lastUsedAt: number().optional()
44148
- });
44149
- object({
44150
- id: string(),
44151
- userId: string(),
44152
- name: string(),
44153
- tokenHash: string(),
44154
- tokenPrefix: string(),
44155
- scopes: array(TokenScopeSchema),
44156
- expiresAt: number().nullish(),
44157
- lastUsedAt: number().nullish(),
44158
- createdAt: number()
44159
- });
44160
- /**
44161
44213
  * `oauth-integration` — a collection cap by which an addon declares
44162
44214
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44163
44215
  * Each provider returns a static descriptor; the core enumerates them
@@ -51003,7 +51055,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51003
51055
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51004
51056
  kind: "mutation",
51005
51057
  auth: "admin"
51006
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51058
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51059
+ clear: boolean(),
51060
+ repointLocationId: string().optional()
51061
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51007
51062
  kind: "mutation",
51008
51063
  auth: "admin"
51009
51064
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -55267,6 +55322,11 @@ onStatusChanged: { data: object({
55267
55322
  *
55268
55323
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55269
55324
  * provider refreshes the slice on an interval and eagerly after commands.
55325
+ *
55326
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55327
+ * nullable: `null` means "not known right now" (the appliance has not said,
55328
+ * the link is down, or the description does not carry it) and is never
55329
+ * rendered or exported as `false` / `0`. `availability` says why.
55270
55330
  */
55271
55331
  var DishwasherStateSchema = _enum([
55272
55332
  "idle",
@@ -55276,43 +55336,155 @@ var DishwasherStateSchema = _enum([
55276
55336
  "error",
55277
55337
  "unavailable"
55278
55338
  ]);
55339
+ /**
55340
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55341
+ * view for compact surfaces; this is what the appliance said.
55342
+ */
55343
+ var DishwasherOperationStateSchema = _enum([
55344
+ "Inactive",
55345
+ "Ready",
55346
+ "DelayedStart",
55347
+ "Run",
55348
+ "Pause",
55349
+ "ActionRequired",
55350
+ "Finished",
55351
+ "Error",
55352
+ "Aborting"
55353
+ ]);
55354
+ /**
55355
+ * Why fields may be `null`:
55356
+ * - `available` — the link is up and the description is loaded;
55357
+ * - `offline` — the local link is down (values are unknown, not last-known);
55358
+ * - `description-missing` — the link is up but the appliance's description could not
55359
+ * be loaded, so its values cannot be decoded.
55360
+ */
55361
+ var DishwasherAvailabilitySchema = _enum([
55362
+ "available",
55363
+ "offline",
55364
+ "description-missing"
55365
+ ]);
55279
55366
  var DishwasherConsumableLevelSchema = _enum([
55280
55367
  "ok",
55281
55368
  "low",
55282
55369
  "empty"
55283
55370
  ]);
55284
55371
  var DishwasherStatusSchema = object({
55372
+ availability: DishwasherAvailabilitySchema,
55373
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55285
55374
  state: DishwasherStateSchema,
55286
- /** Active program id/name, or null when none selected / unknown. */
55375
+ /** The appliance's operation state as reported; null when not known. */
55376
+ operationState: DishwasherOperationStateSchema.nullable(),
55377
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55287
55378
  program: string().nullable(),
55288
- /** Program tokens the hardware accepts — drives the UI selector. */
55379
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55380
+ selectedProgram: string().nullable(),
55381
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55289
55382
  availablePrograms: array(string()),
55290
- /** Minutes remaining on the active cycle, or null when not running. */
55291
- remainingMinutes: number().int().nonnegative().nullable(),
55383
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55384
+ remainingSeconds: number().int().nonnegative().nullable(),
55385
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55386
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55292
55387
  /** Cycle completion 0..100, or null when not applicable. */
55293
55388
  progressPercent: number().min(0).max(100).nullable(),
55294
- /** True when the door is reported open. */
55295
- doorOpen: boolean(),
55296
- /** True when remote start is allowed (door closed, power on, etc.). */
55297
- remoteStartAllowed: boolean(),
55298
- /** Main power / switched-on state. */
55299
- powerOn: boolean(),
55389
+ /** True when the door is reported open; null when the door state is not known. */
55390
+ doorOpen: boolean().nullable(),
55391
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55392
+ doorLocked: boolean().nullable(),
55393
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55394
+ remoteStartAllowed: boolean().nullable(),
55395
+ /** True when the appliance accepts remote control now; null when not known. */
55396
+ remoteControlActive: boolean().nullable(),
55397
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55398
+ localControlActive: boolean().nullable(),
55399
+ /** Main power / switched-on state; null when not known. */
55400
+ powerOn: boolean().nullable(),
55401
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55402
+ powerState: string().nullable(),
55300
55403
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
55301
55404
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55302
- halfLoad: boolean(),
55303
- hygienePlus: boolean(),
55405
+ /** Option states: null when the appliance does not expose the option or has not said. */
55406
+ halfLoad: boolean().nullable(),
55407
+ hygienePlus: boolean().nullable(),
55304
55408
  /** Extra dry option when the appliance exposes it. */
55305
- extraDry: boolean(),
55409
+ extraDry: boolean().nullable(),
55306
55410
  /** Intensive zone (lower basket) when the appliance exposes it. */
55307
- intensiveZone: boolean(),
55411
+ intensiveZone: boolean().nullable(),
55308
55412
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55309
- varioSpeedPlus: boolean(),
55310
- /** Child lock (controls disabled on the appliance). */
55311
- childLock: boolean(),
55413
+ varioSpeedPlus: boolean().nullable(),
55414
+ /** Child lock (controls disabled on the appliance); null when not known. */
55415
+ childLock: boolean().nullable(),
55416
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55417
+ activeEvents: array(string()),
55418
+ /** Numeric error code when the appliance reports one; null otherwise. */
55312
55419
  errorCode: number().nullable(),
55420
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55313
55421
  errorLabel: string().nullable(),
55422
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55314
55423
  lastFetchedAt: number()
55315
55424
  });
55425
+ var DeviceIdSchema = number().int().nonnegative();
55426
+ /** A value a program option or setting can take. */
55427
+ var DishwasherValueSchema = union([
55428
+ boolean(),
55429
+ string(),
55430
+ number()
55431
+ ]);
55432
+ var DishwasherAccessSchema = _enum([
55433
+ "none",
55434
+ "read",
55435
+ "readWrite",
55436
+ "writeOnly",
55437
+ "readStatic"
55438
+ ]);
55439
+ /**
55440
+ * One option or setting the appliance declares, with the constraints its description
55441
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55442
+ */
55443
+ var DishwasherOptionDescriptorSchema = object({
55444
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55445
+ key: string(),
55446
+ /** Last segment of the key, for display. */
55447
+ name: string(),
55448
+ type: _enum([
55449
+ "boolean",
55450
+ "number",
55451
+ "enum",
55452
+ "string"
55453
+ ]),
55454
+ access: DishwasherAccessSchema,
55455
+ /** The appliance reports this entity as currently available. */
55456
+ available: boolean(),
55457
+ /** Unit the description declares for a number; null when it declares none. */
55458
+ unit: string().nullable(),
55459
+ min: number().nullable(),
55460
+ max: number().nullable(),
55461
+ step: number().nullable(),
55462
+ /** Allowed members of an enum; null for other types. */
55463
+ enumValues: array(string()).nullable(),
55464
+ defaultValue: DishwasherValueSchema.nullable()
55465
+ });
55466
+ var DishwasherProgramSchema = object({
55467
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
55468
+ key: string(),
55469
+ name: string(),
55470
+ /** The appliance currently offers this program. */
55471
+ available: boolean(),
55472
+ /** The options this program lists, with the program-level access / availability / default. */
55473
+ options: array(DishwasherOptionDescriptorSchema)
55474
+ });
55475
+ var DishwasherOptionsSchema = object({
55476
+ availability: DishwasherAvailabilitySchema,
55477
+ /** What the appliance can be told to do, from the commands its description declares. */
55478
+ supportsStart: boolean(),
55479
+ supportsPause: boolean(),
55480
+ supportsResume: boolean(),
55481
+ supportsStop: boolean(),
55482
+ supportsPower: boolean(),
55483
+ /** Every program the description lists, with its options. */
55484
+ programs: array(DishwasherProgramSchema),
55485
+ /** Every option and setting entity the description lists (programs reference these by key). */
55486
+ options: array(DishwasherOptionDescriptorSchema)
55487
+ });
55316
55488
  var dishwasherCapability = {
55317
55489
  name: "dishwasher",
55318
55490
  scope: "device",
@@ -55320,86 +55492,102 @@ var dishwasherCapability = {
55320
55492
  mode: "singleton",
55321
55493
  deviceTypes: [DeviceType.Dishwasher],
55322
55494
  methods: {
55323
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55495
+ /**
55496
+ * Start a program. Without `program` the selected one starts. `options` are
55497
+ * option feature keys; each is checked against the program's constraints.
55498
+ */
55499
+ start: method(object({
55500
+ deviceId: DeviceIdSchema,
55501
+ program: string().min(1).optional(),
55502
+ options: record(string(), DishwasherValueSchema).optional()
55503
+ }), _void(), {
55324
55504
  kind: "mutation",
55325
55505
  auth: "protected"
55326
55506
  }),
55327
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55507
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55328
55508
  kind: "mutation",
55329
55509
  auth: "protected"
55330
55510
  }),
55331
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55511
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
55512
+ kind: "mutation",
55513
+ auth: "protected"
55514
+ }),
55515
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55332
55516
  kind: "mutation",
55333
55517
  auth: "protected"
55334
55518
  }),
55519
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55335
55520
  setProgram: method(object({
55336
- deviceId: number().int().nonnegative(),
55521
+ deviceId: DeviceIdSchema,
55337
55522
  program: string().min(1)
55338
55523
  }), _void(), {
55339
55524
  kind: "mutation",
55340
55525
  auth: "protected"
55341
55526
  }),
55342
55527
  setPower: method(object({
55343
- deviceId: number().int().nonnegative(),
55528
+ deviceId: DeviceIdSchema,
55344
55529
  on: boolean()
55345
55530
  }), _void(), {
55346
55531
  kind: "mutation",
55347
55532
  auth: "protected"
55348
55533
  }),
55349
55534
  setHalfLoad: method(object({
55350
- deviceId: number().int().nonnegative(),
55535
+ deviceId: DeviceIdSchema,
55351
55536
  on: boolean()
55352
55537
  }), _void(), {
55353
55538
  kind: "mutation",
55354
55539
  auth: "protected"
55355
55540
  }),
55356
55541
  setHygienePlus: method(object({
55357
- deviceId: number().int().nonnegative(),
55542
+ deviceId: DeviceIdSchema,
55358
55543
  on: boolean()
55359
55544
  }), _void(), {
55360
55545
  kind: "mutation",
55361
55546
  auth: "protected"
55362
55547
  }),
55363
55548
  setExtraDry: method(object({
55364
- deviceId: number().int().nonnegative(),
55549
+ deviceId: DeviceIdSchema,
55365
55550
  on: boolean()
55366
55551
  }), _void(), {
55367
55552
  kind: "mutation",
55368
55553
  auth: "protected"
55369
55554
  }),
55370
55555
  setIntensiveZone: method(object({
55371
- deviceId: number().int().nonnegative(),
55556
+ deviceId: DeviceIdSchema,
55372
55557
  on: boolean()
55373
55558
  }), _void(), {
55374
55559
  kind: "mutation",
55375
55560
  auth: "protected"
55376
55561
  }),
55377
55562
  setVarioSpeedPlus: method(object({
55378
- deviceId: number().int().nonnegative(),
55563
+ deviceId: DeviceIdSchema,
55379
55564
  on: boolean()
55380
55565
  }), _void(), {
55381
55566
  kind: "mutation",
55382
55567
  auth: "protected"
55383
55568
  }),
55384
55569
  setChildLock: method(object({
55385
- deviceId: number().int().nonnegative(),
55570
+ deviceId: DeviceIdSchema,
55386
55571
  on: boolean()
55387
55572
  }), _void(), {
55388
55573
  kind: "mutation",
55389
55574
  auth: "protected"
55390
55575
  }),
55576
+ /**
55577
+ * Write any option or setting by feature key. Refused when the description does
55578
+ * not list it, it is not writable or not available now, or the value is outside
55579
+ * its declared range / members.
55580
+ */
55391
55581
  setOption: method(object({
55392
- deviceId: number().int().nonnegative(),
55582
+ deviceId: DeviceIdSchema,
55393
55583
  key: string().min(1),
55394
- value: union([
55395
- boolean(),
55396
- string(),
55397
- number()
55398
- ])
55584
+ value: DishwasherValueSchema
55399
55585
  }), _void(), {
55400
55586
  kind: "mutation",
55401
55587
  auth: "protected"
55402
- })
55588
+ }),
55589
+ /** What this appliance can do, from its own description — the UI is derived from it. */
55590
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55403
55591
  },
55404
55592
  status: {
55405
55593
  schema: DishwasherStatusSchema,
@@ -69348,6 +69536,12 @@ Object.freeze({
69348
69536
  addonId: null,
69349
69537
  access: "view"
69350
69538
  },
69539
+ "dishwasher.getOptions": {
69540
+ capName: "dishwasher",
69541
+ capScope: "device",
69542
+ addonId: null,
69543
+ access: "view"
69544
+ },
69351
69545
  "dishwasher.getStatus": {
69352
69546
  capName: "dishwasher",
69353
69547
  capScope: "device",
@@ -69360,6 +69554,12 @@ Object.freeze({
69360
69554
  addonId: null,
69361
69555
  access: "create"
69362
69556
  },
69557
+ "dishwasher.resume": {
69558
+ capName: "dishwasher",
69559
+ capScope: "device",
69560
+ addonId: null,
69561
+ access: "create"
69562
+ },
69363
69563
  "dishwasher.setChildLock": {
69364
69564
  capName: "dishwasher",
69365
69565
  capScope: "device",
@@ -73860,6 +74060,12 @@ Object.freeze({
73860
74060
  addonId: null,
73861
74061
  access: "view"
73862
74062
  },
74063
+ "storageMigration.moverClearance": {
74064
+ capName: "storage-migration",
74065
+ capScope: "system",
74066
+ addonId: null,
74067
+ access: "view"
74068
+ },
73863
74069
  "storageMigration.movers": {
73864
74070
  capName: "storage-migration",
73865
74071
  capScope: "system",
@@ -76053,6 +76259,11 @@ Object.freeze({
76053
76259
  form: "single",
76054
76260
  optional: false
76055
76261
  }],
76262
+ "dishwasher.getOptions": [{
76263
+ name: "deviceId",
76264
+ form: "single",
76265
+ optional: false
76266
+ }],
76056
76267
  "dishwasher.getStatus": [{
76057
76268
  name: "deviceId",
76058
76269
  form: "single",
@@ -76063,6 +76274,11 @@ Object.freeze({
76063
76274
  form: "single",
76064
76275
  optional: false
76065
76276
  }],
76277
+ "dishwasher.resume": [{
76278
+ name: "deviceId",
76279
+ form: "single",
76280
+ optional: false
76281
+ }],
76066
76282
  "dishwasher.setChildLock": [{
76067
76283
  name: "deviceId",
76068
76284
  form: "single",
@@ -78149,6 +78365,9 @@ new Map(Object.entries({
78149
78365
  "wrapper-update-available": "system",
78150
78366
  "backup-completed": "system",
78151
78367
  "export-completed": "system",
78368
+ "alert-critical": "system",
78369
+ "alert-error": "system",
78370
+ "alert-critical-resolved": "system",
78152
78371
  "storage-location-low": "system",
78153
78372
  "storage-location-critical": "system",
78154
78373
  "storage-location-ok": "system",
@@ -78273,6 +78492,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
78273
78492
  "storage-location-ok"
78274
78493
  ]
78275
78494
  },
78495
+ {
78496
+ id: "alerts",
78497
+ family: "system",
78498
+ label: "Alerts",
78499
+ kinds: [
78500
+ "alert-critical",
78501
+ "alert-error",
78502
+ "alert-critical-resolved"
78503
+ ]
78504
+ },
78276
78505
  {
78277
78506
  id: "alarm",
78278
78507
  family: "alarm",
@@ -78317,6 +78546,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
78317
78546
  return [[descriptor.kind, field]];
78318
78547
  })));
78319
78548
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
78549
+ object({
78550
+ phase: _enum(["raised", "resolved"]),
78551
+ episodeId: string().min(1),
78552
+ alertId: string().min(1),
78553
+ severity: AlertSeveritySchema,
78554
+ category: string(),
78555
+ title: string(),
78556
+ message: string(),
78557
+ sourceType: string().optional(),
78558
+ sourceId: string().optional(),
78559
+ nodeId: string().optional(),
78560
+ /** The alert's own action link (where the operator acts on it), when it has one. */
78561
+ actionUrl: string().optional(),
78562
+ at: number()
78563
+ });
78320
78564
  var RULE_BODY_ONLY = ["body"];
78321
78565
  var RULE_TEXT = ["title", "body"];
78322
78566
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -78326,6 +78570,11 @@ var TANK = [
78326
78570
  "device-tank-full",
78327
78571
  "device-tank-normal"
78328
78572
  ];
78573
+ var ALERT_EPISODE = [
78574
+ "alert-critical",
78575
+ "alert-error",
78576
+ "alert-critical-resolved"
78577
+ ];
78329
78578
  var UPDATES = [
78330
78579
  "addon-update-available",
78331
78580
  "server-update-available",
@@ -78518,14 +78767,14 @@ var STATE_SUMMARY_VARS = [
78518
78767
  ([...RULE_TEXT], [...CONSUMABLE]),
78519
78768
  ([...RULE_TEXT], [...TANK]),
78520
78769
  [...RULE_TEXT],
78521
- ([...RULE_TEXT], [...UPDATES]),
78522
- ([...RULE_TEXT], [...UPDATES]),
78523
- [...RULE_TEXT],
78770
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78771
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78524
78772
  [...RULE_TEXT],
78525
78773
  [...RULE_TEXT],
78526
78774
  [...RULE_TEXT],
78527
78775
  [...RULE_TEXT],
78528
78776
  [...RULE_TEXT],
78777
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78529
78778
  [...RULE_TEXT],
78530
78779
  [...RULE_TEXT],
78531
78780
  [...RULE_TEXT],
@@ -78543,7 +78792,11 @@ var STATE_SUMMARY_VARS = [
78543
78792
  [...RULE_TEXT],
78544
78793
  [...RULE_TEXT],
78545
78794
  [...RULE_TEXT],
78546
- [...RULE_TEXT],
78795
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78796
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78797
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78798
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78799
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78547
78800
  [...RULE_TEXT],
78548
78801
  [...RULE_TEXT],
78549
78802
  [...RULE_TEXT],
@@ -79108,6 +79361,12 @@ Object.defineProperty(exports, "DeviceType", {
79108
79361
  return DeviceType;
79109
79362
  }
79110
79363
  });
79364
+ Object.defineProperty(exports, "DishwasherOperationStateSchema", {
79365
+ enumerable: true,
79366
+ get: function() {
79367
+ return DishwasherOperationStateSchema;
79368
+ }
79369
+ });
79111
79370
  Object.defineProperty(exports, "EventCategory", {
79112
79371
  enumerable: true,
79113
79372
  get: function() {
@@ -79150,6 +79409,12 @@ Object.defineProperty(exports, "connectionTestCapability", {
79150
79409
  return connectionTestCapability;
79151
79410
  }
79152
79411
  });
79412
+ Object.defineProperty(exports, "createEvent", {
79413
+ enumerable: true,
79414
+ get: function() {
79415
+ return createEvent;
79416
+ }
79417
+ });
79153
79418
  Object.defineProperty(exports, "customAction", {
79154
79419
  enumerable: true,
79155
79420
  get: function() {
@@ -79186,6 +79451,12 @@ Object.defineProperty(exports, "errMsg", {
79186
79451
  return errMsg;
79187
79452
  }
79188
79453
  });
79454
+ Object.defineProperty(exports, "eventEmitterCapability", {
79455
+ enumerable: true,
79456
+ get: function() {
79457
+ return eventEmitterCapability;
79458
+ }
79459
+ });
79189
79460
  Object.defineProperty(exports, "heatingValveCapability", {
79190
79461
  enumerable: true,
79191
79462
  get: function() {