@camstack/addon-provider-homeassistant 1.2.603 → 1.2.605

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";
@@ -5538,7 +5547,7 @@ var ZodIssueCode = {
5538
5547
  var ZodFirstPartyTypeKind;
5539
5548
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5540
5549
  //#endregion
5541
- //#region ../types/dist/sleep-BegKjwUu.mjs
5550
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5542
5551
  /**
5543
5552
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5544
5553
  * window to float samples (D455).
@@ -7920,6 +7929,12 @@ function normalizeAddonInitResult(result) {
7920
7929
  if (Array.isArray(result)) return { providers: result };
7921
7930
  return result;
7922
7931
  }
7932
+ /**
7933
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7934
+ * and validates them (`share-token.service.ts` builds its enum from this
7935
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7936
+ */
7937
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7923
7938
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7924
7939
  var PeerBytesTicketSchema = object({
7925
7940
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12988,6 +13003,229 @@ var ConvertResultSchema = object({
12988
13003
  files: array(string()).readonly()
12989
13004
  })).readonly()
12990
13005
  });
13006
+ /**
13007
+ * Zod schemas for persisted record types.
13008
+ *
13009
+ * These schemas serve as the single source of truth for types that are
13010
+ * stored in the settings-store backend and retrieved via tRPC. They
13011
+ * replace the manual TypeScript interfaces with schema-derived types,
13012
+ * enabling runtime validation when reading from the backend.
13013
+ *
13014
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
13015
+ * keeps the original name for backward compatibility.
13016
+ */
13017
+ /**
13018
+ * Auth model (v2 — 2026-05-12 caps-only):
13019
+ *
13020
+ * Two principals:
13021
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
13022
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
13023
+ *
13024
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
13025
+ * `super_admin` — collapsed onto the single boolean because every
13026
+ * non-admin caller is governed by the same scope-check rules; the
13027
+ * distinction was only ever used to route role-specific procedures
13028
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
13029
+ * with `isAdmin: false` + an explicit scope list.
13030
+ */
13031
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
13032
+ var MethodAccessSchema = _enum([
13033
+ "view",
13034
+ "create",
13035
+ "delete"
13036
+ ]);
13037
+ /**
13038
+ * A single scope grant. Three forms — checked in matcher with OR
13039
+ * semantics; the first match decides whether the call passes:
13040
+ *
13041
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
13042
+ * cap with the matching `scope` declaration. New caps inherit grants
13043
+ * automatically — adding a device cap to the codebase makes it
13044
+ * reachable to every user with `category:device [...]` without a
13045
+ * re-grant. Use this for "family viewer" / "operator" tiers.
13046
+ *
13047
+ * - `addon` — every cap that ships inside a given addon id. Niche;
13048
+ * useful when an integration needs to interact with one specific
13049
+ * addon's surface regardless of how many caps it exports.
13050
+ *
13051
+ * - `capability` — the most precise form. Single cap name. Use for
13052
+ * integration tokens where you want to grant `addons.installPackage`
13053
+ * and nothing else.
13054
+ *
13055
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
13056
+ * "give me everything" escape; there is no wildcard scope.
13057
+ */
13058
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
13059
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
13060
+ var CapScopeSchema = _enum(["device", "system"]);
13061
+ /**
13062
+ * DeviceSelector (scope model v3 — 2026-08-12).
13063
+ *
13064
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
13065
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
13066
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
13067
+ * AFTER the grant was minted — no re-grant, no re-login.
13068
+ *
13069
+ * - `all` — every device in the deployment. The broad viewer/operator
13070
+ * lever without a `category` grant (a `category` grant also covers device
13071
+ * caps that carry no deviceId; `all` is specifically the device set).
13072
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
13073
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
13074
+ * is NOT covered until the grant is edited.
13075
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
13076
+ * DYNAMIC. A device that changes type, or a new device of the type,
13077
+ * re-resolves on the next request.
13078
+ * - `locations` — every device whose operator-assigned `location` label is
13079
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
13080
+ * null/unset location matches NO `locations` selector.
13081
+ */
13082
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
13083
+ object({ kind: literal("all") }),
13084
+ object({
13085
+ kind: literal("ids"),
13086
+ ids: array(number().int()).min(1)
13087
+ }),
13088
+ object({
13089
+ kind: literal("types"),
13090
+ types: array(_enum(DeviceType)).min(1)
13091
+ }),
13092
+ object({
13093
+ kind: literal("locations"),
13094
+ locations: array(string().min(1)).min(1)
13095
+ })
13096
+ ]);
13097
+ var DeviceTokenScopeSchema = object({
13098
+ type: literal("device"),
13099
+ /** The device SET this grant covers — resolved against the live fleet. */
13100
+ selector: DeviceSelectorSchema,
13101
+ access: array(MethodAccessSchema).min(1),
13102
+ /**
13103
+ * Whether a grant on a PARENT device transparently covers its accessory
13104
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
13105
+ * Direction is parent → children ONLY.
13106
+ *
13107
+ * Absent → the matcher DERIVES it from the access flavour: `view`
13108
+ * inherits (a camera viewer sees the camera's accessories), `create` /
13109
+ * `delete` do NOT (actuating/removing a child is an explicit act the
13110
+ * operator must grant on the child, not inherit from the parent). Set it
13111
+ * explicitly to override that default per grant.
13112
+ */
13113
+ includeLinked: boolean().optional()
13114
+ });
13115
+ /**
13116
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
13117
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
13118
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
13119
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
13120
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
13121
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
13122
+ * migration cannot reach a JWT already in a client's hands; parse-time
13123
+ * migration covers both without a flag day. No cast — the raw object is read
13124
+ * through `Reflect.get` (its static type is `unknown`).
13125
+ */
13126
+ function migrateLegacyTokenScope(raw) {
13127
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
13128
+ if (Reflect.get(raw, "type") !== "device") return raw;
13129
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
13130
+ const targets = Reflect.get(raw, "targets");
13131
+ if (!Array.isArray(targets)) return raw;
13132
+ return {
13133
+ type: "device",
13134
+ selector: {
13135
+ kind: "ids",
13136
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
13137
+ },
13138
+ access: Reflect.get(raw, "access")
13139
+ };
13140
+ }
13141
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
13142
+ object({
13143
+ type: literal("category"),
13144
+ target: CapScopeSchema,
13145
+ access: array(MethodAccessSchema).min(1)
13146
+ }),
13147
+ object({
13148
+ type: literal("capability"),
13149
+ target: string(),
13150
+ access: array(MethodAccessSchema).min(1)
13151
+ }),
13152
+ object({
13153
+ type: literal("addon"),
13154
+ target: string(),
13155
+ access: array(MethodAccessSchema).min(1)
13156
+ }),
13157
+ DeviceTokenScopeSchema
13158
+ ]));
13159
+ object({
13160
+ id: string(),
13161
+ username: string(),
13162
+ passwordHash: string(),
13163
+ /**
13164
+ * Admin bypass. When true, the middleware skips the scope-access
13165
+ * check entirely. There is no other axis of privilege; the legacy
13166
+ * role enum collapsed onto this boolean in v2.
13167
+ */
13168
+ isAdmin: boolean().default(false),
13169
+ allowedProviders: AllowedProviderSchema,
13170
+ allowedDevices: AllowedDevicesSchema,
13171
+ /**
13172
+ * Scopes granted to this user. Admins bypass; their `scopes` is
13173
+ * ignored. Non-admins without scopes are locked out of every
13174
+ * protected call.
13175
+ */
13176
+ scopes: array(TokenScopeSchema).default([]),
13177
+ createdAt: number(),
13178
+ updatedAt: number()
13179
+ });
13180
+ object({
13181
+ id: string(),
13182
+ label: string(),
13183
+ isAdmin: boolean().default(false),
13184
+ allowedProviders: AllowedProviderSchema,
13185
+ allowedDevices: AllowedDevicesSchema,
13186
+ tokenHash: string(),
13187
+ tokenPrefix: string(),
13188
+ createdAt: number(),
13189
+ lastUsedAt: number().optional()
13190
+ });
13191
+ object({
13192
+ id: string(),
13193
+ userId: string(),
13194
+ name: string(),
13195
+ tokenHash: string(),
13196
+ tokenPrefix: string(),
13197
+ scopes: array(TokenScopeSchema),
13198
+ expiresAt: number().nullish(),
13199
+ lastUsedAt: number().nullish(),
13200
+ createdAt: number()
13201
+ });
13202
+ /** What a share-view grant lets its holder see. */
13203
+ var ShareViewGrantSchema = object({
13204
+ kind: _enum(SHARE_VIEW_KINDS),
13205
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
13206
+ /** Talk-back, opt-in at mint time; absent means off. */
13207
+ talk: boolean().optional()
13208
+ });
13209
+ var ShareViewScopeSchema = object({
13210
+ type: literal("share-view"),
13211
+ grant: ShareViewGrantSchema
13212
+ });
13213
+ var AddonRoutesScopeSchema = object({
13214
+ type: literal("addon-routes"),
13215
+ access: array(MethodAccessSchema).min(1)
13216
+ });
13217
+ var CredentialScopeSchema = union([
13218
+ literal("*"),
13219
+ ShareViewScopeSchema,
13220
+ AddonRoutesScopeSchema,
13221
+ TokenScopeSchema
13222
+ ]);
13223
+ object({
13224
+ kind: literal("credential"),
13225
+ sub: string().min(1),
13226
+ jti: string().min(16),
13227
+ scopes: array(CredentialScopeSchema).min(1)
13228
+ });
12991
13229
  _enum(["new-session", "step-up"]);
12992
13230
  /** The languages the hub's app landing pages are written in (D858). */
12993
13231
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13723,7 +13961,14 @@ var AlertSeveritySchema = _enum([
13723
13961
  ]);
13724
13962
  var AlertActionSchema = object({
13725
13963
  label: string(),
13726
- href: string().optional()
13964
+ href: string().optional(),
13965
+ /**
13966
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13967
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13968
+ * start) — the browser must leave the SPA with a full navigation, because
13969
+ * the SPA has no such route and would bounce to the home page.
13970
+ */
13971
+ navigation: _enum(["app", "server"]).optional()
13727
13972
  });
13728
13973
  var AlertStatusSchema = _enum([
13729
13974
  "active",
@@ -42744,6 +42989,9 @@ var NcSystemEventKindSchema = _enum([
42744
42989
  "server-updated",
42745
42990
  "export-completed",
42746
42991
  "backup-completed",
42992
+ "alert-critical",
42993
+ "alert-error",
42994
+ "alert-critical-resolved",
42747
42995
  "camera-online",
42748
42996
  "camera-offline",
42749
42997
  "camera-disabled",
@@ -44779,202 +45027,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44779
45027
  auth: "admin"
44780
45028
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44781
45029
  /**
44782
- * Zod schemas for persisted record types.
44783
- *
44784
- * These schemas serve as the single source of truth for types that are
44785
- * stored in the settings-store backend and retrieved via tRPC. They
44786
- * replace the manual TypeScript interfaces with schema-derived types,
44787
- * enabling runtime validation when reading from the backend.
44788
- *
44789
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44790
- * keeps the original name for backward compatibility.
44791
- */
44792
- /**
44793
- * Auth model (v2 — 2026-05-12 caps-only):
44794
- *
44795
- * Two principals:
44796
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44797
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44798
- *
44799
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44800
- * `super_admin` — collapsed onto the single boolean because every
44801
- * non-admin caller is governed by the same scope-check rules; the
44802
- * distinction was only ever used to route role-specific procedures
44803
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44804
- * with `isAdmin: false` + an explicit scope list.
44805
- */
44806
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44807
- var MethodAccessSchema = _enum([
44808
- "view",
44809
- "create",
44810
- "delete"
44811
- ]);
44812
- /**
44813
- * A single scope grant. Three forms — checked in matcher with OR
44814
- * semantics; the first match decides whether the call passes:
44815
- *
44816
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44817
- * cap with the matching `scope` declaration. New caps inherit grants
44818
- * automatically — adding a device cap to the codebase makes it
44819
- * reachable to every user with `category:device [...]` without a
44820
- * re-grant. Use this for "family viewer" / "operator" tiers.
44821
- *
44822
- * - `addon` — every cap that ships inside a given addon id. Niche;
44823
- * useful when an integration needs to interact with one specific
44824
- * addon's surface regardless of how many caps it exports.
44825
- *
44826
- * - `capability` — the most precise form. Single cap name. Use for
44827
- * integration tokens where you want to grant `addons.installPackage`
44828
- * and nothing else.
44829
- *
44830
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44831
- * "give me everything" escape; there is no wildcard scope.
44832
- */
44833
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44834
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44835
- var CapScopeSchema = _enum(["device", "system"]);
44836
- /**
44837
- * DeviceSelector (scope model v3 — 2026-08-12).
44838
- *
44839
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44840
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44841
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44842
- * AFTER the grant was minted — no re-grant, no re-login.
44843
- *
44844
- * - `all` — every device in the deployment. The broad viewer/operator
44845
- * lever without a `category` grant (a `category` grant also covers device
44846
- * caps that carry no deviceId; `all` is specifically the device set).
44847
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44848
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44849
- * is NOT covered until the grant is edited.
44850
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44851
- * DYNAMIC. A device that changes type, or a new device of the type,
44852
- * re-resolves on the next request.
44853
- * - `locations` — every device whose operator-assigned `location` label is
44854
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44855
- * null/unset location matches NO `locations` selector.
44856
- */
44857
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44858
- object({ kind: literal("all") }),
44859
- object({
44860
- kind: literal("ids"),
44861
- ids: array(number().int()).min(1)
44862
- }),
44863
- object({
44864
- kind: literal("types"),
44865
- types: array(_enum(DeviceType)).min(1)
44866
- }),
44867
- object({
44868
- kind: literal("locations"),
44869
- locations: array(string().min(1)).min(1)
44870
- })
44871
- ]);
44872
- var DeviceTokenScopeSchema = object({
44873
- type: literal("device"),
44874
- /** The device SET this grant covers — resolved against the live fleet. */
44875
- selector: DeviceSelectorSchema,
44876
- access: array(MethodAccessSchema).min(1),
44877
- /**
44878
- * Whether a grant on a PARENT device transparently covers its accessory
44879
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44880
- * Direction is parent → children ONLY.
44881
- *
44882
- * Absent → the matcher DERIVES it from the access flavour: `view`
44883
- * inherits (a camera viewer sees the camera's accessories), `create` /
44884
- * `delete` do NOT (actuating/removing a child is an explicit act the
44885
- * operator must grant on the child, not inherit from the parent). Set it
44886
- * explicitly to override that default per grant.
44887
- */
44888
- includeLinked: boolean().optional()
44889
- });
44890
- /**
44891
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44892
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44893
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44894
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44895
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44896
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44897
- * migration cannot reach a JWT already in a client's hands; parse-time
44898
- * migration covers both without a flag day. No cast — the raw object is read
44899
- * through `Reflect.get` (its static type is `unknown`).
44900
- */
44901
- function migrateLegacyTokenScope(raw) {
44902
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44903
- if (Reflect.get(raw, "type") !== "device") return raw;
44904
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44905
- const targets = Reflect.get(raw, "targets");
44906
- if (!Array.isArray(targets)) return raw;
44907
- return {
44908
- type: "device",
44909
- selector: {
44910
- kind: "ids",
44911
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44912
- },
44913
- access: Reflect.get(raw, "access")
44914
- };
44915
- }
44916
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44917
- object({
44918
- type: literal("category"),
44919
- target: CapScopeSchema,
44920
- access: array(MethodAccessSchema).min(1)
44921
- }),
44922
- object({
44923
- type: literal("capability"),
44924
- target: string(),
44925
- access: array(MethodAccessSchema).min(1)
44926
- }),
44927
- object({
44928
- type: literal("addon"),
44929
- target: string(),
44930
- access: array(MethodAccessSchema).min(1)
44931
- }),
44932
- DeviceTokenScopeSchema
44933
- ]));
44934
- object({
44935
- id: string(),
44936
- username: string(),
44937
- passwordHash: string(),
44938
- /**
44939
- * Admin bypass. When true, the middleware skips the scope-access
44940
- * check entirely. There is no other axis of privilege; the legacy
44941
- * role enum collapsed onto this boolean in v2.
44942
- */
44943
- isAdmin: boolean().default(false),
44944
- allowedProviders: AllowedProviderSchema,
44945
- allowedDevices: AllowedDevicesSchema,
44946
- /**
44947
- * Scopes granted to this user. Admins bypass; their `scopes` is
44948
- * ignored. Non-admins without scopes are locked out of every
44949
- * protected call.
44950
- */
44951
- scopes: array(TokenScopeSchema).default([]),
44952
- createdAt: number(),
44953
- updatedAt: number()
44954
- });
44955
- object({
44956
- id: string(),
44957
- label: string(),
44958
- isAdmin: boolean().default(false),
44959
- allowedProviders: AllowedProviderSchema,
44960
- allowedDevices: AllowedDevicesSchema,
44961
- tokenHash: string(),
44962
- tokenPrefix: string(),
44963
- createdAt: number(),
44964
- lastUsedAt: number().optional()
44965
- });
44966
- object({
44967
- id: string(),
44968
- userId: string(),
44969
- name: string(),
44970
- tokenHash: string(),
44971
- tokenPrefix: string(),
44972
- scopes: array(TokenScopeSchema),
44973
- expiresAt: number().nullish(),
44974
- lastUsedAt: number().nullish(),
44975
- createdAt: number()
44976
- });
44977
- /**
44978
45030
  * `oauth-integration` — a collection cap by which an addon declares
44979
45031
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44980
45032
  * Each provider returns a static descriptor; the core enumerates them
@@ -51836,7 +51888,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51836
51888
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51837
51889
  kind: "mutation",
51838
51890
  auth: "admin"
51839
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51891
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51892
+ clear: boolean(),
51893
+ repointLocationId: string().optional()
51894
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51840
51895
  kind: "mutation",
51841
51896
  auth: "admin"
51842
51897
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -56191,6 +56246,11 @@ onStatusChanged: { data: object({
56191
56246
  *
56192
56247
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
56193
56248
  * provider refreshes the slice on an interval and eagerly after commands.
56249
+ *
56250
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
56251
+ * nullable: `null` means "not known right now" (the appliance has not said,
56252
+ * the link is down, or the description does not carry it) and is never
56253
+ * rendered or exported as `false` / `0`. `availability` says why.
56194
56254
  */
56195
56255
  var DishwasherStateSchema = _enum([
56196
56256
  "idle",
@@ -56200,43 +56260,155 @@ var DishwasherStateSchema = _enum([
56200
56260
  "error",
56201
56261
  "unavailable"
56202
56262
  ]);
56263
+ /**
56264
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
56265
+ * view for compact surfaces; this is what the appliance said.
56266
+ */
56267
+ var DishwasherOperationStateSchema = _enum([
56268
+ "Inactive",
56269
+ "Ready",
56270
+ "DelayedStart",
56271
+ "Run",
56272
+ "Pause",
56273
+ "ActionRequired",
56274
+ "Finished",
56275
+ "Error",
56276
+ "Aborting"
56277
+ ]);
56278
+ /**
56279
+ * Why fields may be `null`:
56280
+ * - `available` — the link is up and the description is loaded;
56281
+ * - `offline` — the local link is down (values are unknown, not last-known);
56282
+ * - `description-missing` — the link is up but the appliance's description could not
56283
+ * be loaded, so its values cannot be decoded.
56284
+ */
56285
+ var DishwasherAvailabilitySchema = _enum([
56286
+ "available",
56287
+ "offline",
56288
+ "description-missing"
56289
+ ]);
56203
56290
  var DishwasherConsumableLevelSchema = _enum([
56204
56291
  "ok",
56205
56292
  "low",
56206
56293
  "empty"
56207
56294
  ]);
56208
56295
  var DishwasherStatusSchema = object({
56296
+ availability: DishwasherAvailabilitySchema,
56297
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
56209
56298
  state: DishwasherStateSchema,
56210
- /** Active program id/name, or null when none selected / unknown. */
56299
+ /** The appliance's operation state as reported; null when not known. */
56300
+ operationState: DishwasherOperationStateSchema.nullable(),
56301
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
56211
56302
  program: string().nullable(),
56212
- /** Program tokens the hardware accepts — drives the UI selector. */
56303
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
56304
+ selectedProgram: string().nullable(),
56305
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
56213
56306
  availablePrograms: array(string()),
56214
- /** Minutes remaining on the active cycle, or null when not running. */
56215
- remainingMinutes: number().int().nonnegative().nullable(),
56307
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
56308
+ remainingSeconds: number().int().nonnegative().nullable(),
56309
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
56310
+ delayedStartSeconds: number().int().nonnegative().nullable(),
56216
56311
  /** Cycle completion 0..100, or null when not applicable. */
56217
56312
  progressPercent: number().min(0).max(100).nullable(),
56218
- /** True when the door is reported open. */
56219
- doorOpen: boolean(),
56220
- /** True when remote start is allowed (door closed, power on, etc.). */
56221
- remoteStartAllowed: boolean(),
56222
- /** Main power / switched-on state. */
56223
- powerOn: boolean(),
56313
+ /** True when the door is reported open; null when the door state is not known. */
56314
+ doorOpen: boolean().nullable(),
56315
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
56316
+ doorLocked: boolean().nullable(),
56317
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
56318
+ remoteStartAllowed: boolean().nullable(),
56319
+ /** True when the appliance accepts remote control now; null when not known. */
56320
+ remoteControlActive: boolean().nullable(),
56321
+ /** True while somebody operates the appliance at its panel; null when not reported. */
56322
+ localControlActive: boolean().nullable(),
56323
+ /** Main power / switched-on state; null when not known. */
56324
+ powerOn: boolean().nullable(),
56325
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
56326
+ powerState: string().nullable(),
56224
56327
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
56225
56328
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
56226
- halfLoad: boolean(),
56227
- hygienePlus: boolean(),
56329
+ /** Option states: null when the appliance does not expose the option or has not said. */
56330
+ halfLoad: boolean().nullable(),
56331
+ hygienePlus: boolean().nullable(),
56228
56332
  /** Extra dry option when the appliance exposes it. */
56229
- extraDry: boolean(),
56333
+ extraDry: boolean().nullable(),
56230
56334
  /** Intensive zone (lower basket) when the appliance exposes it. */
56231
- intensiveZone: boolean(),
56335
+ intensiveZone: boolean().nullable(),
56232
56336
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
56233
- varioSpeedPlus: boolean(),
56234
- /** Child lock (controls disabled on the appliance). */
56235
- childLock: boolean(),
56337
+ varioSpeedPlus: boolean().nullable(),
56338
+ /** Child lock (controls disabled on the appliance); null when not known. */
56339
+ childLock: boolean().nullable(),
56340
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
56341
+ activeEvents: array(string()),
56342
+ /** Numeric error code when the appliance reports one; null otherwise. */
56236
56343
  errorCode: number().nullable(),
56344
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
56237
56345
  errorLabel: string().nullable(),
56346
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
56238
56347
  lastFetchedAt: number()
56239
56348
  });
56349
+ var DeviceIdSchema = number().int().nonnegative();
56350
+ /** A value a program option or setting can take. */
56351
+ var DishwasherValueSchema = union([
56352
+ boolean(),
56353
+ string(),
56354
+ number()
56355
+ ]);
56356
+ var DishwasherAccessSchema = _enum([
56357
+ "none",
56358
+ "read",
56359
+ "readWrite",
56360
+ "writeOnly",
56361
+ "readStatic"
56362
+ ]);
56363
+ /**
56364
+ * One option or setting the appliance declares, with the constraints its description
56365
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
56366
+ */
56367
+ var DishwasherOptionDescriptorSchema = object({
56368
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
56369
+ key: string(),
56370
+ /** Last segment of the key, for display. */
56371
+ name: string(),
56372
+ type: _enum([
56373
+ "boolean",
56374
+ "number",
56375
+ "enum",
56376
+ "string"
56377
+ ]),
56378
+ access: DishwasherAccessSchema,
56379
+ /** The appliance reports this entity as currently available. */
56380
+ available: boolean(),
56381
+ /** Unit the description declares for a number; null when it declares none. */
56382
+ unit: string().nullable(),
56383
+ min: number().nullable(),
56384
+ max: number().nullable(),
56385
+ step: number().nullable(),
56386
+ /** Allowed members of an enum; null for other types. */
56387
+ enumValues: array(string()).nullable(),
56388
+ defaultValue: DishwasherValueSchema.nullable()
56389
+ });
56390
+ var DishwasherProgramSchema = object({
56391
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
56392
+ key: string(),
56393
+ name: string(),
56394
+ /** The appliance currently offers this program. */
56395
+ available: boolean(),
56396
+ /** The options this program lists, with the program-level access / availability / default. */
56397
+ options: array(DishwasherOptionDescriptorSchema)
56398
+ });
56399
+ var DishwasherOptionsSchema = object({
56400
+ availability: DishwasherAvailabilitySchema,
56401
+ /** What the appliance can be told to do, from the commands its description declares. */
56402
+ supportsStart: boolean(),
56403
+ supportsPause: boolean(),
56404
+ supportsResume: boolean(),
56405
+ supportsStop: boolean(),
56406
+ supportsPower: boolean(),
56407
+ /** Every program the description lists, with its options. */
56408
+ programs: array(DishwasherProgramSchema),
56409
+ /** Every option and setting entity the description lists (programs reference these by key). */
56410
+ options: array(DishwasherOptionDescriptorSchema)
56411
+ });
56240
56412
  var dishwasherCapability = {
56241
56413
  name: "dishwasher",
56242
56414
  scope: "device",
@@ -56244,86 +56416,102 @@ var dishwasherCapability = {
56244
56416
  mode: "singleton",
56245
56417
  deviceTypes: [DeviceType.Dishwasher],
56246
56418
  methods: {
56247
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56419
+ /**
56420
+ * Start a program. Without `program` the selected one starts. `options` are
56421
+ * option feature keys; each is checked against the program's constraints.
56422
+ */
56423
+ start: method(object({
56424
+ deviceId: DeviceIdSchema,
56425
+ program: string().min(1).optional(),
56426
+ options: record(string(), DishwasherValueSchema).optional()
56427
+ }), _void(), {
56248
56428
  kind: "mutation",
56249
56429
  auth: "protected"
56250
56430
  }),
56251
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56431
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
56252
56432
  kind: "mutation",
56253
56433
  auth: "protected"
56254
56434
  }),
56255
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56435
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
56436
+ kind: "mutation",
56437
+ auth: "protected"
56438
+ }),
56439
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
56256
56440
  kind: "mutation",
56257
56441
  auth: "protected"
56258
56442
  }),
56443
+ /** Select (not start) a program; refused when the appliance does not offer it. */
56259
56444
  setProgram: method(object({
56260
- deviceId: number().int().nonnegative(),
56445
+ deviceId: DeviceIdSchema,
56261
56446
  program: string().min(1)
56262
56447
  }), _void(), {
56263
56448
  kind: "mutation",
56264
56449
  auth: "protected"
56265
56450
  }),
56266
56451
  setPower: method(object({
56267
- deviceId: number().int().nonnegative(),
56452
+ deviceId: DeviceIdSchema,
56268
56453
  on: boolean()
56269
56454
  }), _void(), {
56270
56455
  kind: "mutation",
56271
56456
  auth: "protected"
56272
56457
  }),
56273
56458
  setHalfLoad: method(object({
56274
- deviceId: number().int().nonnegative(),
56459
+ deviceId: DeviceIdSchema,
56275
56460
  on: boolean()
56276
56461
  }), _void(), {
56277
56462
  kind: "mutation",
56278
56463
  auth: "protected"
56279
56464
  }),
56280
56465
  setHygienePlus: method(object({
56281
- deviceId: number().int().nonnegative(),
56466
+ deviceId: DeviceIdSchema,
56282
56467
  on: boolean()
56283
56468
  }), _void(), {
56284
56469
  kind: "mutation",
56285
56470
  auth: "protected"
56286
56471
  }),
56287
56472
  setExtraDry: method(object({
56288
- deviceId: number().int().nonnegative(),
56473
+ deviceId: DeviceIdSchema,
56289
56474
  on: boolean()
56290
56475
  }), _void(), {
56291
56476
  kind: "mutation",
56292
56477
  auth: "protected"
56293
56478
  }),
56294
56479
  setIntensiveZone: method(object({
56295
- deviceId: number().int().nonnegative(),
56480
+ deviceId: DeviceIdSchema,
56296
56481
  on: boolean()
56297
56482
  }), _void(), {
56298
56483
  kind: "mutation",
56299
56484
  auth: "protected"
56300
56485
  }),
56301
56486
  setVarioSpeedPlus: method(object({
56302
- deviceId: number().int().nonnegative(),
56487
+ deviceId: DeviceIdSchema,
56303
56488
  on: boolean()
56304
56489
  }), _void(), {
56305
56490
  kind: "mutation",
56306
56491
  auth: "protected"
56307
56492
  }),
56308
56493
  setChildLock: method(object({
56309
- deviceId: number().int().nonnegative(),
56494
+ deviceId: DeviceIdSchema,
56310
56495
  on: boolean()
56311
56496
  }), _void(), {
56312
56497
  kind: "mutation",
56313
56498
  auth: "protected"
56314
56499
  }),
56500
+ /**
56501
+ * Write any option or setting by feature key. Refused when the description does
56502
+ * not list it, it is not writable or not available now, or the value is outside
56503
+ * its declared range / members.
56504
+ */
56315
56505
  setOption: method(object({
56316
- deviceId: number().int().nonnegative(),
56506
+ deviceId: DeviceIdSchema,
56317
56507
  key: string().min(1),
56318
- value: union([
56319
- boolean(),
56320
- string(),
56321
- number()
56322
- ])
56508
+ value: DishwasherValueSchema
56323
56509
  }), _void(), {
56324
56510
  kind: "mutation",
56325
56511
  auth: "protected"
56326
- })
56512
+ }),
56513
+ /** What this appliance can do, from its own description — the UI is derived from it. */
56514
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
56327
56515
  },
56328
56516
  status: {
56329
56517
  schema: DishwasherStatusSchema,
@@ -70272,6 +70460,12 @@ Object.freeze({
70272
70460
  addonId: null,
70273
70461
  access: "view"
70274
70462
  },
70463
+ "dishwasher.getOptions": {
70464
+ capName: "dishwasher",
70465
+ capScope: "device",
70466
+ addonId: null,
70467
+ access: "view"
70468
+ },
70275
70469
  "dishwasher.getStatus": {
70276
70470
  capName: "dishwasher",
70277
70471
  capScope: "device",
@@ -70284,6 +70478,12 @@ Object.freeze({
70284
70478
  addonId: null,
70285
70479
  access: "create"
70286
70480
  },
70481
+ "dishwasher.resume": {
70482
+ capName: "dishwasher",
70483
+ capScope: "device",
70484
+ addonId: null,
70485
+ access: "create"
70486
+ },
70287
70487
  "dishwasher.setChildLock": {
70288
70488
  capName: "dishwasher",
70289
70489
  capScope: "device",
@@ -74784,6 +74984,12 @@ Object.freeze({
74784
74984
  addonId: null,
74785
74985
  access: "view"
74786
74986
  },
74987
+ "storageMigration.moverClearance": {
74988
+ capName: "storage-migration",
74989
+ capScope: "system",
74990
+ addonId: null,
74991
+ access: "view"
74992
+ },
74787
74993
  "storageMigration.movers": {
74788
74994
  capName: "storage-migration",
74789
74995
  capScope: "system",
@@ -76977,6 +77183,11 @@ Object.freeze({
76977
77183
  form: "single",
76978
77184
  optional: false
76979
77185
  }],
77186
+ "dishwasher.getOptions": [{
77187
+ name: "deviceId",
77188
+ form: "single",
77189
+ optional: false
77190
+ }],
76980
77191
  "dishwasher.getStatus": [{
76981
77192
  name: "deviceId",
76982
77193
  form: "single",
@@ -76987,6 +77198,11 @@ Object.freeze({
76987
77198
  form: "single",
76988
77199
  optional: false
76989
77200
  }],
77201
+ "dishwasher.resume": [{
77202
+ name: "deviceId",
77203
+ form: "single",
77204
+ optional: false
77205
+ }],
76990
77206
  "dishwasher.setChildLock": [{
76991
77207
  name: "deviceId",
76992
77208
  form: "single",
@@ -79280,6 +79496,9 @@ new Map(Object.entries({
79280
79496
  "wrapper-update-available": "system",
79281
79497
  "backup-completed": "system",
79282
79498
  "export-completed": "system",
79499
+ "alert-critical": "system",
79500
+ "alert-error": "system",
79501
+ "alert-critical-resolved": "system",
79283
79502
  "storage-location-low": "system",
79284
79503
  "storage-location-critical": "system",
79285
79504
  "storage-location-ok": "system",
@@ -79404,6 +79623,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
79404
79623
  "storage-location-ok"
79405
79624
  ]
79406
79625
  },
79626
+ {
79627
+ id: "alerts",
79628
+ family: "system",
79629
+ label: "Alerts",
79630
+ kinds: [
79631
+ "alert-critical",
79632
+ "alert-error",
79633
+ "alert-critical-resolved"
79634
+ ]
79635
+ },
79407
79636
  {
79408
79637
  id: "alarm",
79409
79638
  family: "alarm",
@@ -79448,6 +79677,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
79448
79677
  return [[descriptor.kind, field]];
79449
79678
  })));
79450
79679
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
79680
+ object({
79681
+ phase: _enum(["raised", "resolved"]),
79682
+ episodeId: string().min(1),
79683
+ alertId: string().min(1),
79684
+ severity: AlertSeveritySchema,
79685
+ category: string(),
79686
+ title: string(),
79687
+ message: string(),
79688
+ sourceType: string().optional(),
79689
+ sourceId: string().optional(),
79690
+ nodeId: string().optional(),
79691
+ /** The alert's own action link (where the operator acts on it), when it has one. */
79692
+ actionUrl: string().optional(),
79693
+ at: number()
79694
+ });
79451
79695
  var RULE_BODY_ONLY = ["body"];
79452
79696
  var RULE_TEXT = ["title", "body"];
79453
79697
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -79457,6 +79701,11 @@ var TANK = [
79457
79701
  "device-tank-full",
79458
79702
  "device-tank-normal"
79459
79703
  ];
79704
+ var ALERT_EPISODE = [
79705
+ "alert-critical",
79706
+ "alert-error",
79707
+ "alert-critical-resolved"
79708
+ ];
79460
79709
  var UPDATES = [
79461
79710
  "addon-update-available",
79462
79711
  "server-update-available",
@@ -79649,14 +79898,14 @@ var STATE_SUMMARY_VARS = [
79649
79898
  ([...RULE_TEXT], [...CONSUMABLE]),
79650
79899
  ([...RULE_TEXT], [...TANK]),
79651
79900
  [...RULE_TEXT],
79652
- ([...RULE_TEXT], [...UPDATES]),
79653
- ([...RULE_TEXT], [...UPDATES]),
79654
- [...RULE_TEXT],
79901
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79902
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79655
79903
  [...RULE_TEXT],
79656
79904
  [...RULE_TEXT],
79657
79905
  [...RULE_TEXT],
79658
79906
  [...RULE_TEXT],
79659
79907
  [...RULE_TEXT],
79908
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79660
79909
  [...RULE_TEXT],
79661
79910
  [...RULE_TEXT],
79662
79911
  [...RULE_TEXT],
@@ -79674,7 +79923,11 @@ var STATE_SUMMARY_VARS = [
79674
79923
  [...RULE_TEXT],
79675
79924
  [...RULE_TEXT],
79676
79925
  [...RULE_TEXT],
79677
- [...RULE_TEXT],
79926
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79927
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79928
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79929
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79930
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79678
79931
  [...RULE_TEXT],
79679
79932
  [...RULE_TEXT],
79680
79933
  [...RULE_TEXT],