@camstack/addon-mqtt-broker 1.2.127 → 1.2.129

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,7 +46,7 @@ let node_fs = require("node:fs");
46
46
  node_fs = __toESM(node_fs);
47
47
  let node_path = require("node:path");
48
48
  node_path = __toESM(node_path);
49
- //#region ../types/dist/event-category-BvOFi6PY.mjs
49
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
50
50
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
51
51
  EventCategory["SystemBoot"] = "system.boot";
52
52
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -125,9 +125,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
125
125
  /**
126
126
  * The node's one-shot runner boot check (D877): planned runners against the
127
127
  * process service, `degraded` when any is failed, refused or missing. The
128
- * alert centre turns it into one alert and a direct critical push.
128
+ * alert centre turns it into one critical alert.
129
129
  */
130
130
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
131
+ /**
132
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
133
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
134
+ * centre sends no notification of its own: Notification Center turns this
135
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
136
+ * system-event kinds, and reconciles from the alerts store because a bus
137
+ * event may be dropped (D8, D11).
138
+ */
139
+ EventCategory["AlertEpisode"] = "alert.episode";
131
140
  EventCategory["AddonError"] = "addon.error";
132
141
  EventCategory["AddonPageReady"] = "addon.page-ready";
133
142
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5585,7 +5594,7 @@ var ZodIssueCode = {
5585
5594
  var ZodFirstPartyTypeKind;
5586
5595
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5587
5596
  //#endregion
5588
- //#region ../types/dist/sleep-BegKjwUu.mjs
5597
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5589
5598
  /**
5590
5599
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5591
5600
  * window to float samples (D455).
@@ -7967,6 +7976,12 @@ function normalizeAddonInitResult(result) {
7967
7976
  if (Array.isArray(result)) return { providers: result };
7968
7977
  return result;
7969
7978
  }
7979
+ /**
7980
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7981
+ * and validates them (`share-token.service.ts` builds its enum from this
7982
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7983
+ */
7984
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7970
7985
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7971
7986
  var PeerBytesTicketSchema = object({
7972
7987
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12827,6 +12842,229 @@ var ConvertResultSchema = object({
12827
12842
  files: array(string()).readonly()
12828
12843
  })).readonly()
12829
12844
  });
12845
+ /**
12846
+ * Zod schemas for persisted record types.
12847
+ *
12848
+ * These schemas serve as the single source of truth for types that are
12849
+ * stored in the settings-store backend and retrieved via tRPC. They
12850
+ * replace the manual TypeScript interfaces with schema-derived types,
12851
+ * enabling runtime validation when reading from the backend.
12852
+ *
12853
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12854
+ * keeps the original name for backward compatibility.
12855
+ */
12856
+ /**
12857
+ * Auth model (v2 — 2026-05-12 caps-only):
12858
+ *
12859
+ * Two principals:
12860
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12861
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12862
+ *
12863
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12864
+ * `super_admin` — collapsed onto the single boolean because every
12865
+ * non-admin caller is governed by the same scope-check rules; the
12866
+ * distinction was only ever used to route role-specific procedures
12867
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12868
+ * with `isAdmin: false` + an explicit scope list.
12869
+ */
12870
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12871
+ var MethodAccessSchema = _enum([
12872
+ "view",
12873
+ "create",
12874
+ "delete"
12875
+ ]);
12876
+ /**
12877
+ * A single scope grant. Three forms — checked in matcher with OR
12878
+ * semantics; the first match decides whether the call passes:
12879
+ *
12880
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12881
+ * cap with the matching `scope` declaration. New caps inherit grants
12882
+ * automatically — adding a device cap to the codebase makes it
12883
+ * reachable to every user with `category:device [...]` without a
12884
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12885
+ *
12886
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12887
+ * useful when an integration needs to interact with one specific
12888
+ * addon's surface regardless of how many caps it exports.
12889
+ *
12890
+ * - `capability` — the most precise form. Single cap name. Use for
12891
+ * integration tokens where you want to grant `addons.installPackage`
12892
+ * and nothing else.
12893
+ *
12894
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12895
+ * "give me everything" escape; there is no wildcard scope.
12896
+ */
12897
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12898
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12899
+ var CapScopeSchema = _enum(["device", "system"]);
12900
+ /**
12901
+ * DeviceSelector (scope model v3 — 2026-08-12).
12902
+ *
12903
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12904
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12905
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12906
+ * AFTER the grant was minted — no re-grant, no re-login.
12907
+ *
12908
+ * - `all` — every device in the deployment. The broad viewer/operator
12909
+ * lever without a `category` grant (a `category` grant also covers device
12910
+ * caps that carry no deviceId; `all` is specifically the device set).
12911
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12912
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12913
+ * is NOT covered until the grant is edited.
12914
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12915
+ * DYNAMIC. A device that changes type, or a new device of the type,
12916
+ * re-resolves on the next request.
12917
+ * - `locations` — every device whose operator-assigned `location` label is
12918
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12919
+ * null/unset location matches NO `locations` selector.
12920
+ */
12921
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12922
+ object({ kind: literal("all") }),
12923
+ object({
12924
+ kind: literal("ids"),
12925
+ ids: array(number().int()).min(1)
12926
+ }),
12927
+ object({
12928
+ kind: literal("types"),
12929
+ types: array(_enum(DeviceType)).min(1)
12930
+ }),
12931
+ object({
12932
+ kind: literal("locations"),
12933
+ locations: array(string().min(1)).min(1)
12934
+ })
12935
+ ]);
12936
+ var DeviceTokenScopeSchema = object({
12937
+ type: literal("device"),
12938
+ /** The device SET this grant covers — resolved against the live fleet. */
12939
+ selector: DeviceSelectorSchema,
12940
+ access: array(MethodAccessSchema).min(1),
12941
+ /**
12942
+ * Whether a grant on a PARENT device transparently covers its accessory
12943
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12944
+ * Direction is parent → children ONLY.
12945
+ *
12946
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12947
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12948
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12949
+ * operator must grant on the child, not inherit from the parent). Set it
12950
+ * explicitly to override that default per grant.
12951
+ */
12952
+ includeLinked: boolean().optional()
12953
+ });
12954
+ /**
12955
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12956
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12957
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12958
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12959
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12960
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12961
+ * migration cannot reach a JWT already in a client's hands; parse-time
12962
+ * migration covers both without a flag day. No cast — the raw object is read
12963
+ * through `Reflect.get` (its static type is `unknown`).
12964
+ */
12965
+ function migrateLegacyTokenScope(raw) {
12966
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12967
+ if (Reflect.get(raw, "type") !== "device") return raw;
12968
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12969
+ const targets = Reflect.get(raw, "targets");
12970
+ if (!Array.isArray(targets)) return raw;
12971
+ return {
12972
+ type: "device",
12973
+ selector: {
12974
+ kind: "ids",
12975
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12976
+ },
12977
+ access: Reflect.get(raw, "access")
12978
+ };
12979
+ }
12980
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12981
+ object({
12982
+ type: literal("category"),
12983
+ target: CapScopeSchema,
12984
+ access: array(MethodAccessSchema).min(1)
12985
+ }),
12986
+ object({
12987
+ type: literal("capability"),
12988
+ target: string(),
12989
+ access: array(MethodAccessSchema).min(1)
12990
+ }),
12991
+ object({
12992
+ type: literal("addon"),
12993
+ target: string(),
12994
+ access: array(MethodAccessSchema).min(1)
12995
+ }),
12996
+ DeviceTokenScopeSchema
12997
+ ]));
12998
+ object({
12999
+ id: string(),
13000
+ username: string(),
13001
+ passwordHash: string(),
13002
+ /**
13003
+ * Admin bypass. When true, the middleware skips the scope-access
13004
+ * check entirely. There is no other axis of privilege; the legacy
13005
+ * role enum collapsed onto this boolean in v2.
13006
+ */
13007
+ isAdmin: boolean().default(false),
13008
+ allowedProviders: AllowedProviderSchema,
13009
+ allowedDevices: AllowedDevicesSchema,
13010
+ /**
13011
+ * Scopes granted to this user. Admins bypass; their `scopes` is
13012
+ * ignored. Non-admins without scopes are locked out of every
13013
+ * protected call.
13014
+ */
13015
+ scopes: array(TokenScopeSchema).default([]),
13016
+ createdAt: number(),
13017
+ updatedAt: number()
13018
+ });
13019
+ object({
13020
+ id: string(),
13021
+ label: string(),
13022
+ isAdmin: boolean().default(false),
13023
+ allowedProviders: AllowedProviderSchema,
13024
+ allowedDevices: AllowedDevicesSchema,
13025
+ tokenHash: string(),
13026
+ tokenPrefix: string(),
13027
+ createdAt: number(),
13028
+ lastUsedAt: number().optional()
13029
+ });
13030
+ object({
13031
+ id: string(),
13032
+ userId: string(),
13033
+ name: string(),
13034
+ tokenHash: string(),
13035
+ tokenPrefix: string(),
13036
+ scopes: array(TokenScopeSchema),
13037
+ expiresAt: number().nullish(),
13038
+ lastUsedAt: number().nullish(),
13039
+ createdAt: number()
13040
+ });
13041
+ /** What a share-view grant lets its holder see. */
13042
+ var ShareViewGrantSchema = object({
13043
+ kind: _enum(SHARE_VIEW_KINDS),
13044
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
13045
+ /** Talk-back, opt-in at mint time; absent means off. */
13046
+ talk: boolean().optional()
13047
+ });
13048
+ var ShareViewScopeSchema = object({
13049
+ type: literal("share-view"),
13050
+ grant: ShareViewGrantSchema
13051
+ });
13052
+ var AddonRoutesScopeSchema = object({
13053
+ type: literal("addon-routes"),
13054
+ access: array(MethodAccessSchema).min(1)
13055
+ });
13056
+ var CredentialScopeSchema = union([
13057
+ literal("*"),
13058
+ ShareViewScopeSchema,
13059
+ AddonRoutesScopeSchema,
13060
+ TokenScopeSchema
13061
+ ]);
13062
+ object({
13063
+ kind: literal("credential"),
13064
+ sub: string().min(1),
13065
+ jti: string().min(16),
13066
+ scopes: array(CredentialScopeSchema).min(1)
13067
+ });
12830
13068
  _enum(["new-session", "step-up"]);
12831
13069
  /** The languages the hub's app landing pages are written in (D858). */
12832
13070
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13543,7 +13781,14 @@ var AlertSeveritySchema = _enum([
13543
13781
  ]);
13544
13782
  var AlertActionSchema = object({
13545
13783
  label: string(),
13546
- href: string().optional()
13784
+ href: string().optional(),
13785
+ /**
13786
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13787
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13788
+ * start) — the browser must leave the SPA with a full navigation, because
13789
+ * the SPA has no such route and would bounce to the home page.
13790
+ */
13791
+ navigation: _enum(["app", "server"]).optional()
13547
13792
  });
13548
13793
  var AlertStatusSchema = _enum([
13549
13794
  "active",
@@ -41987,6 +42232,9 @@ var NcSystemEventKindSchema = _enum([
41987
42232
  "server-updated",
41988
42233
  "export-completed",
41989
42234
  "backup-completed",
42235
+ "alert-critical",
42236
+ "alert-error",
42237
+ "alert-critical-resolved",
41990
42238
  "camera-online",
41991
42239
  "camera-offline",
41992
42240
  "camera-disabled",
@@ -44022,202 +44270,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44022
44270
  auth: "admin"
44023
44271
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44024
44272
  /**
44025
- * Zod schemas for persisted record types.
44026
- *
44027
- * These schemas serve as the single source of truth for types that are
44028
- * stored in the settings-store backend and retrieved via tRPC. They
44029
- * replace the manual TypeScript interfaces with schema-derived types,
44030
- * enabling runtime validation when reading from the backend.
44031
- *
44032
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44033
- * keeps the original name for backward compatibility.
44034
- */
44035
- /**
44036
- * Auth model (v2 — 2026-05-12 caps-only):
44037
- *
44038
- * Two principals:
44039
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44040
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44041
- *
44042
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44043
- * `super_admin` — collapsed onto the single boolean because every
44044
- * non-admin caller is governed by the same scope-check rules; the
44045
- * distinction was only ever used to route role-specific procedures
44046
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44047
- * with `isAdmin: false` + an explicit scope list.
44048
- */
44049
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44050
- var MethodAccessSchema = _enum([
44051
- "view",
44052
- "create",
44053
- "delete"
44054
- ]);
44055
- /**
44056
- * A single scope grant. Three forms — checked in matcher with OR
44057
- * semantics; the first match decides whether the call passes:
44058
- *
44059
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44060
- * cap with the matching `scope` declaration. New caps inherit grants
44061
- * automatically — adding a device cap to the codebase makes it
44062
- * reachable to every user with `category:device [...]` without a
44063
- * re-grant. Use this for "family viewer" / "operator" tiers.
44064
- *
44065
- * - `addon` — every cap that ships inside a given addon id. Niche;
44066
- * useful when an integration needs to interact with one specific
44067
- * addon's surface regardless of how many caps it exports.
44068
- *
44069
- * - `capability` — the most precise form. Single cap name. Use for
44070
- * integration tokens where you want to grant `addons.installPackage`
44071
- * and nothing else.
44072
- *
44073
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44074
- * "give me everything" escape; there is no wildcard scope.
44075
- */
44076
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44077
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44078
- var CapScopeSchema = _enum(["device", "system"]);
44079
- /**
44080
- * DeviceSelector (scope model v3 — 2026-08-12).
44081
- *
44082
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44083
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44084
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44085
- * AFTER the grant was minted — no re-grant, no re-login.
44086
- *
44087
- * - `all` — every device in the deployment. The broad viewer/operator
44088
- * lever without a `category` grant (a `category` grant also covers device
44089
- * caps that carry no deviceId; `all` is specifically the device set).
44090
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44091
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44092
- * is NOT covered until the grant is edited.
44093
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44094
- * DYNAMIC. A device that changes type, or a new device of the type,
44095
- * re-resolves on the next request.
44096
- * - `locations` — every device whose operator-assigned `location` label is
44097
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44098
- * null/unset location matches NO `locations` selector.
44099
- */
44100
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44101
- object({ kind: literal("all") }),
44102
- object({
44103
- kind: literal("ids"),
44104
- ids: array(number().int()).min(1)
44105
- }),
44106
- object({
44107
- kind: literal("types"),
44108
- types: array(_enum(DeviceType)).min(1)
44109
- }),
44110
- object({
44111
- kind: literal("locations"),
44112
- locations: array(string().min(1)).min(1)
44113
- })
44114
- ]);
44115
- var DeviceTokenScopeSchema = object({
44116
- type: literal("device"),
44117
- /** The device SET this grant covers — resolved against the live fleet. */
44118
- selector: DeviceSelectorSchema,
44119
- access: array(MethodAccessSchema).min(1),
44120
- /**
44121
- * Whether a grant on a PARENT device transparently covers its accessory
44122
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44123
- * Direction is parent → children ONLY.
44124
- *
44125
- * Absent → the matcher DERIVES it from the access flavour: `view`
44126
- * inherits (a camera viewer sees the camera's accessories), `create` /
44127
- * `delete` do NOT (actuating/removing a child is an explicit act the
44128
- * operator must grant on the child, not inherit from the parent). Set it
44129
- * explicitly to override that default per grant.
44130
- */
44131
- includeLinked: boolean().optional()
44132
- });
44133
- /**
44134
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44135
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44136
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44137
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44138
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44139
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44140
- * migration cannot reach a JWT already in a client's hands; parse-time
44141
- * migration covers both without a flag day. No cast — the raw object is read
44142
- * through `Reflect.get` (its static type is `unknown`).
44143
- */
44144
- function migrateLegacyTokenScope(raw) {
44145
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44146
- if (Reflect.get(raw, "type") !== "device") return raw;
44147
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44148
- const targets = Reflect.get(raw, "targets");
44149
- if (!Array.isArray(targets)) return raw;
44150
- return {
44151
- type: "device",
44152
- selector: {
44153
- kind: "ids",
44154
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44155
- },
44156
- access: Reflect.get(raw, "access")
44157
- };
44158
- }
44159
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44160
- object({
44161
- type: literal("category"),
44162
- target: CapScopeSchema,
44163
- access: array(MethodAccessSchema).min(1)
44164
- }),
44165
- object({
44166
- type: literal("capability"),
44167
- target: string(),
44168
- access: array(MethodAccessSchema).min(1)
44169
- }),
44170
- object({
44171
- type: literal("addon"),
44172
- target: string(),
44173
- access: array(MethodAccessSchema).min(1)
44174
- }),
44175
- DeviceTokenScopeSchema
44176
- ]));
44177
- object({
44178
- id: string(),
44179
- username: string(),
44180
- passwordHash: string(),
44181
- /**
44182
- * Admin bypass. When true, the middleware skips the scope-access
44183
- * check entirely. There is no other axis of privilege; the legacy
44184
- * role enum collapsed onto this boolean in v2.
44185
- */
44186
- isAdmin: boolean().default(false),
44187
- allowedProviders: AllowedProviderSchema,
44188
- allowedDevices: AllowedDevicesSchema,
44189
- /**
44190
- * Scopes granted to this user. Admins bypass; their `scopes` is
44191
- * ignored. Non-admins without scopes are locked out of every
44192
- * protected call.
44193
- */
44194
- scopes: array(TokenScopeSchema).default([]),
44195
- createdAt: number(),
44196
- updatedAt: number()
44197
- });
44198
- object({
44199
- id: string(),
44200
- label: string(),
44201
- isAdmin: boolean().default(false),
44202
- allowedProviders: AllowedProviderSchema,
44203
- allowedDevices: AllowedDevicesSchema,
44204
- tokenHash: string(),
44205
- tokenPrefix: string(),
44206
- createdAt: number(),
44207
- lastUsedAt: number().optional()
44208
- });
44209
- object({
44210
- id: string(),
44211
- userId: string(),
44212
- name: string(),
44213
- tokenHash: string(),
44214
- tokenPrefix: string(),
44215
- scopes: array(TokenScopeSchema),
44216
- expiresAt: number().nullish(),
44217
- lastUsedAt: number().nullish(),
44218
- createdAt: number()
44219
- });
44220
- /**
44221
44273
  * `oauth-integration` — a collection cap by which an addon declares
44222
44274
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44223
44275
  * Each provider returns a static descriptor; the core enumerates them
@@ -51019,7 +51071,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51019
51071
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51020
51072
  kind: "mutation",
51021
51073
  auth: "admin"
51022
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51074
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51075
+ clear: boolean(),
51076
+ repointLocationId: string().optional()
51077
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51023
51078
  kind: "mutation",
51024
51079
  auth: "admin"
51025
51080
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -54454,6 +54509,11 @@ object({
54454
54509
  *
54455
54510
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
54456
54511
  * provider refreshes the slice on an interval and eagerly after commands.
54512
+ *
54513
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
54514
+ * nullable: `null` means "not known right now" (the appliance has not said,
54515
+ * the link is down, or the description does not carry it) and is never
54516
+ * rendered or exported as `false` / `0`. `availability` says why.
54457
54517
  */
54458
54518
  var DishwasherStateSchema = _enum([
54459
54519
  "idle",
@@ -54463,112 +54523,227 @@ var DishwasherStateSchema = _enum([
54463
54523
  "error",
54464
54524
  "unavailable"
54465
54525
  ]);
54526
+ /**
54527
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
54528
+ * view for compact surfaces; this is what the appliance said.
54529
+ */
54530
+ var DishwasherOperationStateSchema = _enum([
54531
+ "Inactive",
54532
+ "Ready",
54533
+ "DelayedStart",
54534
+ "Run",
54535
+ "Pause",
54536
+ "ActionRequired",
54537
+ "Finished",
54538
+ "Error",
54539
+ "Aborting"
54540
+ ]);
54541
+ /**
54542
+ * Why fields may be `null`:
54543
+ * - `available` — the link is up and the description is loaded;
54544
+ * - `offline` — the local link is down (values are unknown, not last-known);
54545
+ * - `description-missing` — the link is up but the appliance's description could not
54546
+ * be loaded, so its values cannot be decoded.
54547
+ */
54548
+ var DishwasherAvailabilitySchema = _enum([
54549
+ "available",
54550
+ "offline",
54551
+ "description-missing"
54552
+ ]);
54466
54553
  var DishwasherConsumableLevelSchema = _enum([
54467
54554
  "ok",
54468
54555
  "low",
54469
54556
  "empty"
54470
54557
  ]);
54471
54558
  object({
54559
+ availability: DishwasherAvailabilitySchema,
54560
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
54472
54561
  state: DishwasherStateSchema,
54473
- /** Active program id/name, or null when none selected / unknown. */
54562
+ /** The appliance's operation state as reported; null when not known. */
54563
+ operationState: DishwasherOperationStateSchema.nullable(),
54564
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
54474
54565
  program: string().nullable(),
54475
- /** Program tokens the hardware accepts — drives the UI selector. */
54566
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
54567
+ selectedProgram: string().nullable(),
54568
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
54476
54569
  availablePrograms: array(string()),
54477
- /** Minutes remaining on the active cycle, or null when not running. */
54478
- remainingMinutes: number().int().nonnegative().nullable(),
54570
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
54571
+ remainingSeconds: number().int().nonnegative().nullable(),
54572
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
54573
+ delayedStartSeconds: number().int().nonnegative().nullable(),
54479
54574
  /** Cycle completion 0..100, or null when not applicable. */
54480
54575
  progressPercent: number().min(0).max(100).nullable(),
54481
- /** True when the door is reported open. */
54482
- doorOpen: boolean(),
54483
- /** True when remote start is allowed (door closed, power on, etc.). */
54484
- remoteStartAllowed: boolean(),
54485
- /** Main power / switched-on state. */
54486
- powerOn: boolean(),
54576
+ /** True when the door is reported open; null when the door state is not known. */
54577
+ doorOpen: boolean().nullable(),
54578
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
54579
+ doorLocked: boolean().nullable(),
54580
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
54581
+ remoteStartAllowed: boolean().nullable(),
54582
+ /** True when the appliance accepts remote control now; null when not known. */
54583
+ remoteControlActive: boolean().nullable(),
54584
+ /** True while somebody operates the appliance at its panel; null when not reported. */
54585
+ localControlActive: boolean().nullable(),
54586
+ /** Main power / switched-on state; null when not known. */
54587
+ powerOn: boolean().nullable(),
54588
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
54589
+ powerState: string().nullable(),
54487
54590
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
54488
54591
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
54489
- halfLoad: boolean(),
54490
- hygienePlus: boolean(),
54592
+ /** Option states: null when the appliance does not expose the option or has not said. */
54593
+ halfLoad: boolean().nullable(),
54594
+ hygienePlus: boolean().nullable(),
54491
54595
  /** Extra dry option when the appliance exposes it. */
54492
- extraDry: boolean(),
54596
+ extraDry: boolean().nullable(),
54493
54597
  /** Intensive zone (lower basket) when the appliance exposes it. */
54494
- intensiveZone: boolean(),
54598
+ intensiveZone: boolean().nullable(),
54495
54599
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
54496
- varioSpeedPlus: boolean(),
54497
- /** Child lock (controls disabled on the appliance). */
54498
- childLock: boolean(),
54600
+ varioSpeedPlus: boolean().nullable(),
54601
+ /** Child lock (controls disabled on the appliance); null when not known. */
54602
+ childLock: boolean().nullable(),
54603
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
54604
+ activeEvents: array(string()),
54605
+ /** Numeric error code when the appliance reports one; null otherwise. */
54499
54606
  errorCode: number().nullable(),
54607
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
54500
54608
  errorLabel: string().nullable(),
54609
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
54501
54610
  lastFetchedAt: number()
54502
54611
  });
54503
- DeviceType.Dishwasher, method(object({ deviceId: number().int().nonnegative() }), _void(), {
54612
+ var DeviceIdSchema = number().int().nonnegative();
54613
+ /** A value a program option or setting can take. */
54614
+ var DishwasherValueSchema = union([
54615
+ boolean(),
54616
+ string(),
54617
+ number()
54618
+ ]);
54619
+ var DishwasherAccessSchema = _enum([
54620
+ "none",
54621
+ "read",
54622
+ "readWrite",
54623
+ "writeOnly",
54624
+ "readStatic"
54625
+ ]);
54626
+ /**
54627
+ * One option or setting the appliance declares, with the constraints its description
54628
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
54629
+ */
54630
+ var DishwasherOptionDescriptorSchema = object({
54631
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
54632
+ key: string(),
54633
+ /** Last segment of the key, for display. */
54634
+ name: string(),
54635
+ type: _enum([
54636
+ "boolean",
54637
+ "number",
54638
+ "enum",
54639
+ "string"
54640
+ ]),
54641
+ access: DishwasherAccessSchema,
54642
+ /** The appliance reports this entity as currently available. */
54643
+ available: boolean(),
54644
+ /** Unit the description declares for a number; null when it declares none. */
54645
+ unit: string().nullable(),
54646
+ min: number().nullable(),
54647
+ max: number().nullable(),
54648
+ step: number().nullable(),
54649
+ /** Allowed members of an enum; null for other types. */
54650
+ enumValues: array(string()).nullable(),
54651
+ defaultValue: DishwasherValueSchema.nullable()
54652
+ });
54653
+ var DishwasherProgramSchema = object({
54654
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
54655
+ key: string(),
54656
+ name: string(),
54657
+ /** The appliance currently offers this program. */
54658
+ available: boolean(),
54659
+ /** The options this program lists, with the program-level access / availability / default. */
54660
+ options: array(DishwasherOptionDescriptorSchema)
54661
+ });
54662
+ var DishwasherOptionsSchema = object({
54663
+ availability: DishwasherAvailabilitySchema,
54664
+ /** What the appliance can be told to do, from the commands its description declares. */
54665
+ supportsStart: boolean(),
54666
+ supportsPause: boolean(),
54667
+ supportsResume: boolean(),
54668
+ supportsStop: boolean(),
54669
+ supportsPower: boolean(),
54670
+ /** Every program the description lists, with its options. */
54671
+ programs: array(DishwasherProgramSchema),
54672
+ /** Every option and setting entity the description lists (programs reference these by key). */
54673
+ options: array(DishwasherOptionDescriptorSchema)
54674
+ });
54675
+ DeviceType.Dishwasher, method(object({
54676
+ deviceId: DeviceIdSchema,
54677
+ program: string().min(1).optional(),
54678
+ options: record(string(), DishwasherValueSchema).optional()
54679
+ }), _void(), {
54504
54680
  kind: "mutation",
54505
54681
  auth: "protected"
54506
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
54682
+ }), method(object({ deviceId: DeviceIdSchema }), _void(), {
54507
54683
  kind: "mutation",
54508
54684
  auth: "protected"
54509
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
54685
+ }), method(object({ deviceId: DeviceIdSchema }), _void(), {
54686
+ kind: "mutation",
54687
+ auth: "protected"
54688
+ }), method(object({ deviceId: DeviceIdSchema }), _void(), {
54510
54689
  kind: "mutation",
54511
54690
  auth: "protected"
54512
54691
  }), method(object({
54513
- deviceId: number().int().nonnegative(),
54692
+ deviceId: DeviceIdSchema,
54514
54693
  program: string().min(1)
54515
54694
  }), _void(), {
54516
54695
  kind: "mutation",
54517
54696
  auth: "protected"
54518
54697
  }), method(object({
54519
- deviceId: number().int().nonnegative(),
54698
+ deviceId: DeviceIdSchema,
54520
54699
  on: boolean()
54521
54700
  }), _void(), {
54522
54701
  kind: "mutation",
54523
54702
  auth: "protected"
54524
54703
  }), method(object({
54525
- deviceId: number().int().nonnegative(),
54704
+ deviceId: DeviceIdSchema,
54526
54705
  on: boolean()
54527
54706
  }), _void(), {
54528
54707
  kind: "mutation",
54529
54708
  auth: "protected"
54530
54709
  }), method(object({
54531
- deviceId: number().int().nonnegative(),
54710
+ deviceId: DeviceIdSchema,
54532
54711
  on: boolean()
54533
54712
  }), _void(), {
54534
54713
  kind: "mutation",
54535
54714
  auth: "protected"
54536
54715
  }), method(object({
54537
- deviceId: number().int().nonnegative(),
54716
+ deviceId: DeviceIdSchema,
54538
54717
  on: boolean()
54539
54718
  }), _void(), {
54540
54719
  kind: "mutation",
54541
54720
  auth: "protected"
54542
54721
  }), method(object({
54543
- deviceId: number().int().nonnegative(),
54722
+ deviceId: DeviceIdSchema,
54544
54723
  on: boolean()
54545
54724
  }), _void(), {
54546
54725
  kind: "mutation",
54547
54726
  auth: "protected"
54548
54727
  }), method(object({
54549
- deviceId: number().int().nonnegative(),
54728
+ deviceId: DeviceIdSchema,
54550
54729
  on: boolean()
54551
54730
  }), _void(), {
54552
54731
  kind: "mutation",
54553
54732
  auth: "protected"
54554
54733
  }), method(object({
54555
- deviceId: number().int().nonnegative(),
54734
+ deviceId: DeviceIdSchema,
54556
54735
  on: boolean()
54557
54736
  }), _void(), {
54558
54737
  kind: "mutation",
54559
54738
  auth: "protected"
54560
54739
  }), method(object({
54561
- deviceId: number().int().nonnegative(),
54740
+ deviceId: DeviceIdSchema,
54562
54741
  key: string().min(1),
54563
- value: union([
54564
- boolean(),
54565
- string(),
54566
- number()
54567
- ])
54742
+ value: DishwasherValueSchema
54568
54743
  }), _void(), {
54569
54744
  kind: "mutation",
54570
54745
  auth: "protected"
54571
- });
54746
+ }), method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" });
54572
54747
  object({
54573
54748
  /** Ms epoch of the last press. null = never observed since this provider started. */
54574
54749
  lastPressedAt: number().nullable(),
@@ -64628,6 +64803,12 @@ Object.freeze({
64628
64803
  addonId: null,
64629
64804
  access: "view"
64630
64805
  },
64806
+ "dishwasher.getOptions": {
64807
+ capName: "dishwasher",
64808
+ capScope: "device",
64809
+ addonId: null,
64810
+ access: "view"
64811
+ },
64631
64812
  "dishwasher.getStatus": {
64632
64813
  capName: "dishwasher",
64633
64814
  capScope: "device",
@@ -64640,6 +64821,12 @@ Object.freeze({
64640
64821
  addonId: null,
64641
64822
  access: "create"
64642
64823
  },
64824
+ "dishwasher.resume": {
64825
+ capName: "dishwasher",
64826
+ capScope: "device",
64827
+ addonId: null,
64828
+ access: "create"
64829
+ },
64643
64830
  "dishwasher.setChildLock": {
64644
64831
  capName: "dishwasher",
64645
64832
  capScope: "device",
@@ -69140,6 +69327,12 @@ Object.freeze({
69140
69327
  addonId: null,
69141
69328
  access: "view"
69142
69329
  },
69330
+ "storageMigration.moverClearance": {
69331
+ capName: "storage-migration",
69332
+ capScope: "system",
69333
+ addonId: null,
69334
+ access: "view"
69335
+ },
69143
69336
  "storageMigration.movers": {
69144
69337
  capName: "storage-migration",
69145
69338
  capScope: "system",
@@ -71333,6 +71526,11 @@ Object.freeze({
71333
71526
  form: "single",
71334
71527
  optional: false
71335
71528
  }],
71529
+ "dishwasher.getOptions": [{
71530
+ name: "deviceId",
71531
+ form: "single",
71532
+ optional: false
71533
+ }],
71336
71534
  "dishwasher.getStatus": [{
71337
71535
  name: "deviceId",
71338
71536
  form: "single",
@@ -71343,6 +71541,11 @@ Object.freeze({
71343
71541
  form: "single",
71344
71542
  optional: false
71345
71543
  }],
71544
+ "dishwasher.resume": [{
71545
+ name: "deviceId",
71546
+ form: "single",
71547
+ optional: false
71548
+ }],
71346
71549
  "dishwasher.setChildLock": [{
71347
71550
  name: "deviceId",
71348
71551
  form: "single",
@@ -73429,6 +73632,9 @@ new Map(Object.entries({
73429
73632
  "wrapper-update-available": "system",
73430
73633
  "backup-completed": "system",
73431
73634
  "export-completed": "system",
73635
+ "alert-critical": "system",
73636
+ "alert-error": "system",
73637
+ "alert-critical-resolved": "system",
73432
73638
  "storage-location-low": "system",
73433
73639
  "storage-location-critical": "system",
73434
73640
  "storage-location-ok": "system",
@@ -73553,6 +73759,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
73553
73759
  "storage-location-ok"
73554
73760
  ]
73555
73761
  },
73762
+ {
73763
+ id: "alerts",
73764
+ family: "system",
73765
+ label: "Alerts",
73766
+ kinds: [
73767
+ "alert-critical",
73768
+ "alert-error",
73769
+ "alert-critical-resolved"
73770
+ ]
73771
+ },
73556
73772
  {
73557
73773
  id: "alarm",
73558
73774
  family: "alarm",
@@ -73597,6 +73813,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
73597
73813
  return [[descriptor.kind, field]];
73598
73814
  })));
73599
73815
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
73816
+ object({
73817
+ phase: _enum(["raised", "resolved"]),
73818
+ episodeId: string().min(1),
73819
+ alertId: string().min(1),
73820
+ severity: AlertSeveritySchema,
73821
+ category: string(),
73822
+ title: string(),
73823
+ message: string(),
73824
+ sourceType: string().optional(),
73825
+ sourceId: string().optional(),
73826
+ nodeId: string().optional(),
73827
+ /** The alert's own action link (where the operator acts on it), when it has one. */
73828
+ actionUrl: string().optional(),
73829
+ at: number()
73830
+ });
73600
73831
  var RULE_BODY_ONLY = ["body"];
73601
73832
  var RULE_TEXT = ["title", "body"];
73602
73833
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -73606,6 +73837,11 @@ var TANK = [
73606
73837
  "device-tank-full",
73607
73838
  "device-tank-normal"
73608
73839
  ];
73840
+ var ALERT_EPISODE = [
73841
+ "alert-critical",
73842
+ "alert-error",
73843
+ "alert-critical-resolved"
73844
+ ];
73609
73845
  var UPDATES = [
73610
73846
  "addon-update-available",
73611
73847
  "server-update-available",
@@ -73798,14 +74034,14 @@ var STATE_SUMMARY_VARS = [
73798
74034
  ([...RULE_TEXT], [...CONSUMABLE]),
73799
74035
  ([...RULE_TEXT], [...TANK]),
73800
74036
  [...RULE_TEXT],
73801
- ([...RULE_TEXT], [...UPDATES]),
73802
- ([...RULE_TEXT], [...UPDATES]),
73803
- [...RULE_TEXT],
74037
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
74038
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
73804
74039
  [...RULE_TEXT],
73805
74040
  [...RULE_TEXT],
73806
74041
  [...RULE_TEXT],
73807
74042
  [...RULE_TEXT],
73808
74043
  [...RULE_TEXT],
74044
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
73809
74045
  [...RULE_TEXT],
73810
74046
  [...RULE_TEXT],
73811
74047
  [...RULE_TEXT],
@@ -73823,7 +74059,11 @@ var STATE_SUMMARY_VARS = [
73823
74059
  [...RULE_TEXT],
73824
74060
  [...RULE_TEXT],
73825
74061
  [...RULE_TEXT],
73826
- [...RULE_TEXT],
74062
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74063
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74064
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74065
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
74066
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
73827
74067
  [...RULE_TEXT],
73828
74068
  [...RULE_TEXT],
73829
74069
  [...RULE_TEXT],