@camstack/addon-provider-rademacher 0.2.128 → 0.2.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +493 -240
  2. package/dist/addon.mjs +493 -240
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -983,7 +983,7 @@ var Rademacher = class {
983
983
  }
984
984
  };
985
985
  //#endregion
986
- //#region ../types/dist/event-category-BvOFi6PY.mjs
986
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
987
987
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
988
988
  EventCategory["SystemBoot"] = "system.boot";
989
989
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1062,9 +1062,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1062
1062
  /**
1063
1063
  * The node's one-shot runner boot check (D877): planned runners against the
1064
1064
  * process service, `degraded` when any is failed, refused or missing. The
1065
- * alert centre turns it into one alert and a direct critical push.
1065
+ * alert centre turns it into one critical alert.
1066
1066
  */
1067
1067
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
1068
+ /**
1069
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
1070
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
1071
+ * centre sends no notification of its own: Notification Center turns this
1072
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
1073
+ * system-event kinds, and reconciles from the alerts store because a bus
1074
+ * event may be dropped (D8, D11).
1075
+ */
1076
+ EventCategory["AlertEpisode"] = "alert.episode";
1068
1077
  EventCategory["AddonError"] = "addon.error";
1069
1078
  EventCategory["AddonPageReady"] = "addon.page-ready";
1070
1079
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -6389,7 +6398,7 @@ var ZodIssueCode = {
6389
6398
  var ZodFirstPartyTypeKind;
6390
6399
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6391
6400
  //#endregion
6392
- //#region ../types/dist/sleep-BegKjwUu.mjs
6401
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
6393
6402
  /**
6394
6403
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6395
6404
  * window to float samples (D455).
@@ -8771,6 +8780,12 @@ function normalizeAddonInitResult(result) {
8771
8780
  if (Array.isArray(result)) return { providers: result };
8772
8781
  return result;
8773
8782
  }
8783
+ /**
8784
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
8785
+ * and validates them (`share-token.service.ts` builds its enum from this
8786
+ * list); a data plane names the kinds it ACCEPTS in `share`.
8787
+ */
8788
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
8774
8789
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
8775
8790
  var PeerBytesTicketSchema = object({
8776
8791
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -13436,6 +13451,229 @@ var ConvertResultSchema = object({
13436
13451
  files: array(string()).readonly()
13437
13452
  })).readonly()
13438
13453
  });
13454
+ /**
13455
+ * Zod schemas for persisted record types.
13456
+ *
13457
+ * These schemas serve as the single source of truth for types that are
13458
+ * stored in the settings-store backend and retrieved via tRPC. They
13459
+ * replace the manual TypeScript interfaces with schema-derived types,
13460
+ * enabling runtime validation when reading from the backend.
13461
+ *
13462
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
13463
+ * keeps the original name for backward compatibility.
13464
+ */
13465
+ /**
13466
+ * Auth model (v2 — 2026-05-12 caps-only):
13467
+ *
13468
+ * Two principals:
13469
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
13470
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
13471
+ *
13472
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
13473
+ * `super_admin` — collapsed onto the single boolean because every
13474
+ * non-admin caller is governed by the same scope-check rules; the
13475
+ * distinction was only ever used to route role-specific procedures
13476
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
13477
+ * with `isAdmin: false` + an explicit scope list.
13478
+ */
13479
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
13480
+ var MethodAccessSchema = _enum([
13481
+ "view",
13482
+ "create",
13483
+ "delete"
13484
+ ]);
13485
+ /**
13486
+ * A single scope grant. Three forms — checked in matcher with OR
13487
+ * semantics; the first match decides whether the call passes:
13488
+ *
13489
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
13490
+ * cap with the matching `scope` declaration. New caps inherit grants
13491
+ * automatically — adding a device cap to the codebase makes it
13492
+ * reachable to every user with `category:device [...]` without a
13493
+ * re-grant. Use this for "family viewer" / "operator" tiers.
13494
+ *
13495
+ * - `addon` — every cap that ships inside a given addon id. Niche;
13496
+ * useful when an integration needs to interact with one specific
13497
+ * addon's surface regardless of how many caps it exports.
13498
+ *
13499
+ * - `capability` — the most precise form. Single cap name. Use for
13500
+ * integration tokens where you want to grant `addons.installPackage`
13501
+ * and nothing else.
13502
+ *
13503
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
13504
+ * "give me everything" escape; there is no wildcard scope.
13505
+ */
13506
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
13507
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
13508
+ var CapScopeSchema = _enum(["device", "system"]);
13509
+ /**
13510
+ * DeviceSelector (scope model v3 — 2026-08-12).
13511
+ *
13512
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
13513
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
13514
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
13515
+ * AFTER the grant was minted — no re-grant, no re-login.
13516
+ *
13517
+ * - `all` — every device in the deployment. The broad viewer/operator
13518
+ * lever without a `category` grant (a `category` grant also covers device
13519
+ * caps that carry no deviceId; `all` is specifically the device set).
13520
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
13521
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
13522
+ * is NOT covered until the grant is edited.
13523
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
13524
+ * DYNAMIC. A device that changes type, or a new device of the type,
13525
+ * re-resolves on the next request.
13526
+ * - `locations` — every device whose operator-assigned `location` label is
13527
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
13528
+ * null/unset location matches NO `locations` selector.
13529
+ */
13530
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
13531
+ object({ kind: literal("all") }),
13532
+ object({
13533
+ kind: literal("ids"),
13534
+ ids: array(number().int()).min(1)
13535
+ }),
13536
+ object({
13537
+ kind: literal("types"),
13538
+ types: array(_enum(DeviceType)).min(1)
13539
+ }),
13540
+ object({
13541
+ kind: literal("locations"),
13542
+ locations: array(string().min(1)).min(1)
13543
+ })
13544
+ ]);
13545
+ var DeviceTokenScopeSchema = object({
13546
+ type: literal("device"),
13547
+ /** The device SET this grant covers — resolved against the live fleet. */
13548
+ selector: DeviceSelectorSchema,
13549
+ access: array(MethodAccessSchema).min(1),
13550
+ /**
13551
+ * Whether a grant on a PARENT device transparently covers its accessory
13552
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
13553
+ * Direction is parent → children ONLY.
13554
+ *
13555
+ * Absent → the matcher DERIVES it from the access flavour: `view`
13556
+ * inherits (a camera viewer sees the camera's accessories), `create` /
13557
+ * `delete` do NOT (actuating/removing a child is an explicit act the
13558
+ * operator must grant on the child, not inherit from the parent). Set it
13559
+ * explicitly to override that default per grant.
13560
+ */
13561
+ includeLinked: boolean().optional()
13562
+ });
13563
+ /**
13564
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
13565
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
13566
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
13567
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
13568
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
13569
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
13570
+ * migration cannot reach a JWT already in a client's hands; parse-time
13571
+ * migration covers both without a flag day. No cast — the raw object is read
13572
+ * through `Reflect.get` (its static type is `unknown`).
13573
+ */
13574
+ function migrateLegacyTokenScope(raw) {
13575
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
13576
+ if (Reflect.get(raw, "type") !== "device") return raw;
13577
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
13578
+ const targets = Reflect.get(raw, "targets");
13579
+ if (!Array.isArray(targets)) return raw;
13580
+ return {
13581
+ type: "device",
13582
+ selector: {
13583
+ kind: "ids",
13584
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
13585
+ },
13586
+ access: Reflect.get(raw, "access")
13587
+ };
13588
+ }
13589
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
13590
+ object({
13591
+ type: literal("category"),
13592
+ target: CapScopeSchema,
13593
+ access: array(MethodAccessSchema).min(1)
13594
+ }),
13595
+ object({
13596
+ type: literal("capability"),
13597
+ target: string(),
13598
+ access: array(MethodAccessSchema).min(1)
13599
+ }),
13600
+ object({
13601
+ type: literal("addon"),
13602
+ target: string(),
13603
+ access: array(MethodAccessSchema).min(1)
13604
+ }),
13605
+ DeviceTokenScopeSchema
13606
+ ]));
13607
+ object({
13608
+ id: string(),
13609
+ username: string(),
13610
+ passwordHash: string(),
13611
+ /**
13612
+ * Admin bypass. When true, the middleware skips the scope-access
13613
+ * check entirely. There is no other axis of privilege; the legacy
13614
+ * role enum collapsed onto this boolean in v2.
13615
+ */
13616
+ isAdmin: boolean().default(false),
13617
+ allowedProviders: AllowedProviderSchema,
13618
+ allowedDevices: AllowedDevicesSchema,
13619
+ /**
13620
+ * Scopes granted to this user. Admins bypass; their `scopes` is
13621
+ * ignored. Non-admins without scopes are locked out of every
13622
+ * protected call.
13623
+ */
13624
+ scopes: array(TokenScopeSchema).default([]),
13625
+ createdAt: number(),
13626
+ updatedAt: number()
13627
+ });
13628
+ object({
13629
+ id: string(),
13630
+ label: string(),
13631
+ isAdmin: boolean().default(false),
13632
+ allowedProviders: AllowedProviderSchema,
13633
+ allowedDevices: AllowedDevicesSchema,
13634
+ tokenHash: string(),
13635
+ tokenPrefix: string(),
13636
+ createdAt: number(),
13637
+ lastUsedAt: number().optional()
13638
+ });
13639
+ object({
13640
+ id: string(),
13641
+ userId: string(),
13642
+ name: string(),
13643
+ tokenHash: string(),
13644
+ tokenPrefix: string(),
13645
+ scopes: array(TokenScopeSchema),
13646
+ expiresAt: number().nullish(),
13647
+ lastUsedAt: number().nullish(),
13648
+ createdAt: number()
13649
+ });
13650
+ /** What a share-view grant lets its holder see. */
13651
+ var ShareViewGrantSchema = object({
13652
+ kind: _enum(SHARE_VIEW_KINDS),
13653
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
13654
+ /** Talk-back, opt-in at mint time; absent means off. */
13655
+ talk: boolean().optional()
13656
+ });
13657
+ var ShareViewScopeSchema = object({
13658
+ type: literal("share-view"),
13659
+ grant: ShareViewGrantSchema
13660
+ });
13661
+ var AddonRoutesScopeSchema = object({
13662
+ type: literal("addon-routes"),
13663
+ access: array(MethodAccessSchema).min(1)
13664
+ });
13665
+ var CredentialScopeSchema = union([
13666
+ literal("*"),
13667
+ ShareViewScopeSchema,
13668
+ AddonRoutesScopeSchema,
13669
+ TokenScopeSchema
13670
+ ]);
13671
+ object({
13672
+ kind: literal("credential"),
13673
+ sub: string().min(1),
13674
+ jti: string().min(16),
13675
+ scopes: array(CredentialScopeSchema).min(1)
13676
+ });
13439
13677
  _enum(["new-session", "step-up"]);
13440
13678
  /** The languages the hub's app landing pages are written in (D858). */
13441
13679
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -14152,7 +14390,14 @@ var AlertSeveritySchema = _enum([
14152
14390
  ]);
14153
14391
  var AlertActionSchema = object({
14154
14392
  label: string(),
14155
- href: string().optional()
14393
+ href: string().optional(),
14394
+ /**
14395
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
14396
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
14397
+ * start) — the browser must leave the SPA with a full navigation, because
14398
+ * the SPA has no such route and would bounce to the home page.
14399
+ */
14400
+ navigation: _enum(["app", "server"]).optional()
14156
14401
  });
14157
14402
  var AlertStatusSchema = _enum([
14158
14403
  "active",
@@ -42981,6 +43226,9 @@ var NcSystemEventKindSchema = _enum([
42981
43226
  "server-updated",
42982
43227
  "export-completed",
42983
43228
  "backup-completed",
43229
+ "alert-critical",
43230
+ "alert-error",
43231
+ "alert-critical-resolved",
42984
43232
  "camera-online",
42985
43233
  "camera-offline",
42986
43234
  "camera-disabled",
@@ -45016,202 +45264,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
45016
45264
  auth: "admin"
45017
45265
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
45018
45266
  /**
45019
- * Zod schemas for persisted record types.
45020
- *
45021
- * These schemas serve as the single source of truth for types that are
45022
- * stored in the settings-store backend and retrieved via tRPC. They
45023
- * replace the manual TypeScript interfaces with schema-derived types,
45024
- * enabling runtime validation when reading from the backend.
45025
- *
45026
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
45027
- * keeps the original name for backward compatibility.
45028
- */
45029
- /**
45030
- * Auth model (v2 — 2026-05-12 caps-only):
45031
- *
45032
- * Two principals:
45033
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
45034
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
45035
- *
45036
- * No role enum. There used to be `viewer / agent / scoped` and earlier
45037
- * `super_admin` — collapsed onto the single boolean because every
45038
- * non-admin caller is governed by the same scope-check rules; the
45039
- * distinction was only ever used to route role-specific procedures
45040
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
45041
- * with `isAdmin: false` + an explicit scope list.
45042
- */
45043
- /** Per-method access flavour. Materialised on every cap method via codegen. */
45044
- var MethodAccessSchema = _enum([
45045
- "view",
45046
- "create",
45047
- "delete"
45048
- ]);
45049
- /**
45050
- * A single scope grant. Three forms — checked in matcher with OR
45051
- * semantics; the first match decides whether the call passes:
45052
- *
45053
- * - `category` — broadest. `target: 'device' | 'system'` selects every
45054
- * cap with the matching `scope` declaration. New caps inherit grants
45055
- * automatically — adding a device cap to the codebase makes it
45056
- * reachable to every user with `category:device [...]` without a
45057
- * re-grant. Use this for "family viewer" / "operator" tiers.
45058
- *
45059
- * - `addon` — every cap that ships inside a given addon id. Niche;
45060
- * useful when an integration needs to interact with one specific
45061
- * addon's surface regardless of how many caps it exports.
45062
- *
45063
- * - `capability` — the most precise form. Single cap name. Use for
45064
- * integration tokens where you want to grant `addons.installPackage`
45065
- * and nothing else.
45066
- *
45067
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
45068
- * "give me everything" escape; there is no wildcard scope.
45069
- */
45070
- var AllowedProviderSchema = union([literal("*"), array(string())]);
45071
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
45072
- var CapScopeSchema = _enum(["device", "system"]);
45073
- /**
45074
- * DeviceSelector (scope model v3 — 2026-08-12).
45075
- *
45076
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
45077
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
45078
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
45079
- * AFTER the grant was minted — no re-grant, no re-login.
45080
- *
45081
- * - `all` — every device in the deployment. The broad viewer/operator
45082
- * lever without a `category` grant (a `category` grant also covers device
45083
- * caps that carry no deviceId; `all` is specifically the device set).
45084
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
45085
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
45086
- * is NOT covered until the grant is edited.
45087
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
45088
- * DYNAMIC. A device that changes type, or a new device of the type,
45089
- * re-resolves on the next request.
45090
- * - `locations` — every device whose operator-assigned `location` label is
45091
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
45092
- * null/unset location matches NO `locations` selector.
45093
- */
45094
- var DeviceSelectorSchema = discriminatedUnion("kind", [
45095
- object({ kind: literal("all") }),
45096
- object({
45097
- kind: literal("ids"),
45098
- ids: array(number().int()).min(1)
45099
- }),
45100
- object({
45101
- kind: literal("types"),
45102
- types: array(_enum(DeviceType)).min(1)
45103
- }),
45104
- object({
45105
- kind: literal("locations"),
45106
- locations: array(string().min(1)).min(1)
45107
- })
45108
- ]);
45109
- var DeviceTokenScopeSchema = object({
45110
- type: literal("device"),
45111
- /** The device SET this grant covers — resolved against the live fleet. */
45112
- selector: DeviceSelectorSchema,
45113
- access: array(MethodAccessSchema).min(1),
45114
- /**
45115
- * Whether a grant on a PARENT device transparently covers its accessory
45116
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
45117
- * Direction is parent → children ONLY.
45118
- *
45119
- * Absent → the matcher DERIVES it from the access flavour: `view`
45120
- * inherits (a camera viewer sees the camera's accessories), `create` /
45121
- * `delete` do NOT (actuating/removing a child is an explicit act the
45122
- * operator must grant on the child, not inherit from the parent). Set it
45123
- * explicitly to override that default per grant.
45124
- */
45125
- includeLinked: boolean().optional()
45126
- });
45127
- /**
45128
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
45129
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
45130
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
45131
- * EVERY parse path — stored records AND the JWT-carried scope arrays
45132
- * normalised at the request boundary ({@link normalizeTokenScopes} in
45133
- * `device-selector.ts`). Chosen over a one-time DB migration because a
45134
- * migration cannot reach a JWT already in a client's hands; parse-time
45135
- * migration covers both without a flag day. No cast — the raw object is read
45136
- * through `Reflect.get` (its static type is `unknown`).
45137
- */
45138
- function migrateLegacyTokenScope(raw) {
45139
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
45140
- if (Reflect.get(raw, "type") !== "device") return raw;
45141
- if (Reflect.get(raw, "selector") !== void 0) return raw;
45142
- const targets = Reflect.get(raw, "targets");
45143
- if (!Array.isArray(targets)) return raw;
45144
- return {
45145
- type: "device",
45146
- selector: {
45147
- kind: "ids",
45148
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
45149
- },
45150
- access: Reflect.get(raw, "access")
45151
- };
45152
- }
45153
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
45154
- object({
45155
- type: literal("category"),
45156
- target: CapScopeSchema,
45157
- access: array(MethodAccessSchema).min(1)
45158
- }),
45159
- object({
45160
- type: literal("capability"),
45161
- target: string(),
45162
- access: array(MethodAccessSchema).min(1)
45163
- }),
45164
- object({
45165
- type: literal("addon"),
45166
- target: string(),
45167
- access: array(MethodAccessSchema).min(1)
45168
- }),
45169
- DeviceTokenScopeSchema
45170
- ]));
45171
- object({
45172
- id: string(),
45173
- username: string(),
45174
- passwordHash: string(),
45175
- /**
45176
- * Admin bypass. When true, the middleware skips the scope-access
45177
- * check entirely. There is no other axis of privilege; the legacy
45178
- * role enum collapsed onto this boolean in v2.
45179
- */
45180
- isAdmin: boolean().default(false),
45181
- allowedProviders: AllowedProviderSchema,
45182
- allowedDevices: AllowedDevicesSchema,
45183
- /**
45184
- * Scopes granted to this user. Admins bypass; their `scopes` is
45185
- * ignored. Non-admins without scopes are locked out of every
45186
- * protected call.
45187
- */
45188
- scopes: array(TokenScopeSchema).default([]),
45189
- createdAt: number(),
45190
- updatedAt: number()
45191
- });
45192
- object({
45193
- id: string(),
45194
- label: string(),
45195
- isAdmin: boolean().default(false),
45196
- allowedProviders: AllowedProviderSchema,
45197
- allowedDevices: AllowedDevicesSchema,
45198
- tokenHash: string(),
45199
- tokenPrefix: string(),
45200
- createdAt: number(),
45201
- lastUsedAt: number().optional()
45202
- });
45203
- object({
45204
- id: string(),
45205
- userId: string(),
45206
- name: string(),
45207
- tokenHash: string(),
45208
- tokenPrefix: string(),
45209
- scopes: array(TokenScopeSchema),
45210
- expiresAt: number().nullish(),
45211
- lastUsedAt: number().nullish(),
45212
- createdAt: number()
45213
- });
45214
- /**
45215
45267
  * `oauth-integration` — a collection cap by which an addon declares
45216
45268
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
45217
45269
  * Each provider returns a static descriptor; the core enumerates them
@@ -52057,7 +52109,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
52057
52109
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
52058
52110
  kind: "mutation",
52059
52111
  auth: "admin"
52060
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
52112
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
52113
+ clear: boolean(),
52114
+ repointLocationId: string().optional()
52115
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
52061
52116
  kind: "mutation",
52062
52117
  auth: "admin"
52063
52118
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -56313,6 +56368,11 @@ onStatusChanged: { data: object({
56313
56368
  *
56314
56369
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
56315
56370
  * provider refreshes the slice on an interval and eagerly after commands.
56371
+ *
56372
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
56373
+ * nullable: `null` means "not known right now" (the appliance has not said,
56374
+ * the link is down, or the description does not carry it) and is never
56375
+ * rendered or exported as `false` / `0`. `availability` says why.
56316
56376
  */
56317
56377
  var DishwasherStateSchema = _enum([
56318
56378
  "idle",
@@ -56322,43 +56382,155 @@ var DishwasherStateSchema = _enum([
56322
56382
  "error",
56323
56383
  "unavailable"
56324
56384
  ]);
56385
+ /**
56386
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
56387
+ * view for compact surfaces; this is what the appliance said.
56388
+ */
56389
+ var DishwasherOperationStateSchema = _enum([
56390
+ "Inactive",
56391
+ "Ready",
56392
+ "DelayedStart",
56393
+ "Run",
56394
+ "Pause",
56395
+ "ActionRequired",
56396
+ "Finished",
56397
+ "Error",
56398
+ "Aborting"
56399
+ ]);
56400
+ /**
56401
+ * Why fields may be `null`:
56402
+ * - `available` — the link is up and the description is loaded;
56403
+ * - `offline` — the local link is down (values are unknown, not last-known);
56404
+ * - `description-missing` — the link is up but the appliance's description could not
56405
+ * be loaded, so its values cannot be decoded.
56406
+ */
56407
+ var DishwasherAvailabilitySchema = _enum([
56408
+ "available",
56409
+ "offline",
56410
+ "description-missing"
56411
+ ]);
56325
56412
  var DishwasherConsumableLevelSchema = _enum([
56326
56413
  "ok",
56327
56414
  "low",
56328
56415
  "empty"
56329
56416
  ]);
56330
56417
  var DishwasherStatusSchema = object({
56418
+ availability: DishwasherAvailabilitySchema,
56419
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
56331
56420
  state: DishwasherStateSchema,
56332
- /** Active program id/name, or null when none selected / unknown. */
56421
+ /** The appliance's operation state as reported; null when not known. */
56422
+ operationState: DishwasherOperationStateSchema.nullable(),
56423
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
56333
56424
  program: string().nullable(),
56334
- /** Program tokens the hardware accepts — drives the UI selector. */
56425
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
56426
+ selectedProgram: string().nullable(),
56427
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
56335
56428
  availablePrograms: array(string()),
56336
- /** Minutes remaining on the active cycle, or null when not running. */
56337
- remainingMinutes: number().int().nonnegative().nullable(),
56429
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
56430
+ remainingSeconds: number().int().nonnegative().nullable(),
56431
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
56432
+ delayedStartSeconds: number().int().nonnegative().nullable(),
56338
56433
  /** Cycle completion 0..100, or null when not applicable. */
56339
56434
  progressPercent: number().min(0).max(100).nullable(),
56340
- /** True when the door is reported open. */
56341
- doorOpen: boolean(),
56342
- /** True when remote start is allowed (door closed, power on, etc.). */
56343
- remoteStartAllowed: boolean(),
56344
- /** Main power / switched-on state. */
56345
- powerOn: boolean(),
56435
+ /** True when the door is reported open; null when the door state is not known. */
56436
+ doorOpen: boolean().nullable(),
56437
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
56438
+ doorLocked: boolean().nullable(),
56439
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
56440
+ remoteStartAllowed: boolean().nullable(),
56441
+ /** True when the appliance accepts remote control now; null when not known. */
56442
+ remoteControlActive: boolean().nullable(),
56443
+ /** True while somebody operates the appliance at its panel; null when not reported. */
56444
+ localControlActive: boolean().nullable(),
56445
+ /** Main power / switched-on state; null when not known. */
56446
+ powerOn: boolean().nullable(),
56447
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
56448
+ powerState: string().nullable(),
56346
56449
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
56347
56450
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
56348
- halfLoad: boolean(),
56349
- hygienePlus: boolean(),
56451
+ /** Option states: null when the appliance does not expose the option or has not said. */
56452
+ halfLoad: boolean().nullable(),
56453
+ hygienePlus: boolean().nullable(),
56350
56454
  /** Extra dry option when the appliance exposes it. */
56351
- extraDry: boolean(),
56455
+ extraDry: boolean().nullable(),
56352
56456
  /** Intensive zone (lower basket) when the appliance exposes it. */
56353
- intensiveZone: boolean(),
56457
+ intensiveZone: boolean().nullable(),
56354
56458
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
56355
- varioSpeedPlus: boolean(),
56356
- /** Child lock (controls disabled on the appliance). */
56357
- childLock: boolean(),
56459
+ varioSpeedPlus: boolean().nullable(),
56460
+ /** Child lock (controls disabled on the appliance); null when not known. */
56461
+ childLock: boolean().nullable(),
56462
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
56463
+ activeEvents: array(string()),
56464
+ /** Numeric error code when the appliance reports one; null otherwise. */
56358
56465
  errorCode: number().nullable(),
56466
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
56359
56467
  errorLabel: string().nullable(),
56468
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
56360
56469
  lastFetchedAt: number()
56361
56470
  });
56471
+ var DeviceIdSchema = number().int().nonnegative();
56472
+ /** A value a program option or setting can take. */
56473
+ var DishwasherValueSchema = union([
56474
+ boolean(),
56475
+ string(),
56476
+ number()
56477
+ ]);
56478
+ var DishwasherAccessSchema = _enum([
56479
+ "none",
56480
+ "read",
56481
+ "readWrite",
56482
+ "writeOnly",
56483
+ "readStatic"
56484
+ ]);
56485
+ /**
56486
+ * One option or setting the appliance declares, with the constraints its description
56487
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
56488
+ */
56489
+ var DishwasherOptionDescriptorSchema = object({
56490
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
56491
+ key: string(),
56492
+ /** Last segment of the key, for display. */
56493
+ name: string(),
56494
+ type: _enum([
56495
+ "boolean",
56496
+ "number",
56497
+ "enum",
56498
+ "string"
56499
+ ]),
56500
+ access: DishwasherAccessSchema,
56501
+ /** The appliance reports this entity as currently available. */
56502
+ available: boolean(),
56503
+ /** Unit the description declares for a number; null when it declares none. */
56504
+ unit: string().nullable(),
56505
+ min: number().nullable(),
56506
+ max: number().nullable(),
56507
+ step: number().nullable(),
56508
+ /** Allowed members of an enum; null for other types. */
56509
+ enumValues: array(string()).nullable(),
56510
+ defaultValue: DishwasherValueSchema.nullable()
56511
+ });
56512
+ var DishwasherProgramSchema = object({
56513
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
56514
+ key: string(),
56515
+ name: string(),
56516
+ /** The appliance currently offers this program. */
56517
+ available: boolean(),
56518
+ /** The options this program lists, with the program-level access / availability / default. */
56519
+ options: array(DishwasherOptionDescriptorSchema)
56520
+ });
56521
+ var DishwasherOptionsSchema = object({
56522
+ availability: DishwasherAvailabilitySchema,
56523
+ /** What the appliance can be told to do, from the commands its description declares. */
56524
+ supportsStart: boolean(),
56525
+ supportsPause: boolean(),
56526
+ supportsResume: boolean(),
56527
+ supportsStop: boolean(),
56528
+ supportsPower: boolean(),
56529
+ /** Every program the description lists, with its options. */
56530
+ programs: array(DishwasherProgramSchema),
56531
+ /** Every option and setting entity the description lists (programs reference these by key). */
56532
+ options: array(DishwasherOptionDescriptorSchema)
56533
+ });
56362
56534
  var dishwasherCapability = {
56363
56535
  name: "dishwasher",
56364
56536
  scope: "device",
@@ -56366,86 +56538,102 @@ var dishwasherCapability = {
56366
56538
  mode: "singleton",
56367
56539
  deviceTypes: [DeviceType.Dishwasher],
56368
56540
  methods: {
56369
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56541
+ /**
56542
+ * Start a program. Without `program` the selected one starts. `options` are
56543
+ * option feature keys; each is checked against the program's constraints.
56544
+ */
56545
+ start: method(object({
56546
+ deviceId: DeviceIdSchema,
56547
+ program: string().min(1).optional(),
56548
+ options: record(string(), DishwasherValueSchema).optional()
56549
+ }), _void(), {
56370
56550
  kind: "mutation",
56371
56551
  auth: "protected"
56372
56552
  }),
56373
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56553
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
56374
56554
  kind: "mutation",
56375
56555
  auth: "protected"
56376
56556
  }),
56377
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56557
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
56558
+ kind: "mutation",
56559
+ auth: "protected"
56560
+ }),
56561
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
56378
56562
  kind: "mutation",
56379
56563
  auth: "protected"
56380
56564
  }),
56565
+ /** Select (not start) a program; refused when the appliance does not offer it. */
56381
56566
  setProgram: method(object({
56382
- deviceId: number().int().nonnegative(),
56567
+ deviceId: DeviceIdSchema,
56383
56568
  program: string().min(1)
56384
56569
  }), _void(), {
56385
56570
  kind: "mutation",
56386
56571
  auth: "protected"
56387
56572
  }),
56388
56573
  setPower: method(object({
56389
- deviceId: number().int().nonnegative(),
56574
+ deviceId: DeviceIdSchema,
56390
56575
  on: boolean()
56391
56576
  }), _void(), {
56392
56577
  kind: "mutation",
56393
56578
  auth: "protected"
56394
56579
  }),
56395
56580
  setHalfLoad: method(object({
56396
- deviceId: number().int().nonnegative(),
56581
+ deviceId: DeviceIdSchema,
56397
56582
  on: boolean()
56398
56583
  }), _void(), {
56399
56584
  kind: "mutation",
56400
56585
  auth: "protected"
56401
56586
  }),
56402
56587
  setHygienePlus: method(object({
56403
- deviceId: number().int().nonnegative(),
56588
+ deviceId: DeviceIdSchema,
56404
56589
  on: boolean()
56405
56590
  }), _void(), {
56406
56591
  kind: "mutation",
56407
56592
  auth: "protected"
56408
56593
  }),
56409
56594
  setExtraDry: method(object({
56410
- deviceId: number().int().nonnegative(),
56595
+ deviceId: DeviceIdSchema,
56411
56596
  on: boolean()
56412
56597
  }), _void(), {
56413
56598
  kind: "mutation",
56414
56599
  auth: "protected"
56415
56600
  }),
56416
56601
  setIntensiveZone: method(object({
56417
- deviceId: number().int().nonnegative(),
56602
+ deviceId: DeviceIdSchema,
56418
56603
  on: boolean()
56419
56604
  }), _void(), {
56420
56605
  kind: "mutation",
56421
56606
  auth: "protected"
56422
56607
  }),
56423
56608
  setVarioSpeedPlus: method(object({
56424
- deviceId: number().int().nonnegative(),
56609
+ deviceId: DeviceIdSchema,
56425
56610
  on: boolean()
56426
56611
  }), _void(), {
56427
56612
  kind: "mutation",
56428
56613
  auth: "protected"
56429
56614
  }),
56430
56615
  setChildLock: method(object({
56431
- deviceId: number().int().nonnegative(),
56616
+ deviceId: DeviceIdSchema,
56432
56617
  on: boolean()
56433
56618
  }), _void(), {
56434
56619
  kind: "mutation",
56435
56620
  auth: "protected"
56436
56621
  }),
56622
+ /**
56623
+ * Write any option or setting by feature key. Refused when the description does
56624
+ * not list it, it is not writable or not available now, or the value is outside
56625
+ * its declared range / members.
56626
+ */
56437
56627
  setOption: method(object({
56438
- deviceId: number().int().nonnegative(),
56628
+ deviceId: DeviceIdSchema,
56439
56629
  key: string().min(1),
56440
- value: union([
56441
- boolean(),
56442
- string(),
56443
- number()
56444
- ])
56630
+ value: DishwasherValueSchema
56445
56631
  }), _void(), {
56446
56632
  kind: "mutation",
56447
56633
  auth: "protected"
56448
- })
56634
+ }),
56635
+ /** What this appliance can do, from its own description — the UI is derived from it. */
56636
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
56449
56637
  },
56450
56638
  status: {
56451
56639
  schema: DishwasherStatusSchema,
@@ -70394,6 +70582,12 @@ Object.freeze({
70394
70582
  addonId: null,
70395
70583
  access: "view"
70396
70584
  },
70585
+ "dishwasher.getOptions": {
70586
+ capName: "dishwasher",
70587
+ capScope: "device",
70588
+ addonId: null,
70589
+ access: "view"
70590
+ },
70397
70591
  "dishwasher.getStatus": {
70398
70592
  capName: "dishwasher",
70399
70593
  capScope: "device",
@@ -70406,6 +70600,12 @@ Object.freeze({
70406
70600
  addonId: null,
70407
70601
  access: "create"
70408
70602
  },
70603
+ "dishwasher.resume": {
70604
+ capName: "dishwasher",
70605
+ capScope: "device",
70606
+ addonId: null,
70607
+ access: "create"
70608
+ },
70409
70609
  "dishwasher.setChildLock": {
70410
70610
  capName: "dishwasher",
70411
70611
  capScope: "device",
@@ -74906,6 +75106,12 @@ Object.freeze({
74906
75106
  addonId: null,
74907
75107
  access: "view"
74908
75108
  },
75109
+ "storageMigration.moverClearance": {
75110
+ capName: "storage-migration",
75111
+ capScope: "system",
75112
+ addonId: null,
75113
+ access: "view"
75114
+ },
74909
75115
  "storageMigration.movers": {
74910
75116
  capName: "storage-migration",
74911
75117
  capScope: "system",
@@ -77099,6 +77305,11 @@ Object.freeze({
77099
77305
  form: "single",
77100
77306
  optional: false
77101
77307
  }],
77308
+ "dishwasher.getOptions": [{
77309
+ name: "deviceId",
77310
+ form: "single",
77311
+ optional: false
77312
+ }],
77102
77313
  "dishwasher.getStatus": [{
77103
77314
  name: "deviceId",
77104
77315
  form: "single",
@@ -77109,6 +77320,11 @@ Object.freeze({
77109
77320
  form: "single",
77110
77321
  optional: false
77111
77322
  }],
77323
+ "dishwasher.resume": [{
77324
+ name: "deviceId",
77325
+ form: "single",
77326
+ optional: false
77327
+ }],
77112
77328
  "dishwasher.setChildLock": [{
77113
77329
  name: "deviceId",
77114
77330
  form: "single",
@@ -79195,6 +79411,9 @@ new Map(Object.entries({
79195
79411
  "wrapper-update-available": "system",
79196
79412
  "backup-completed": "system",
79197
79413
  "export-completed": "system",
79414
+ "alert-critical": "system",
79415
+ "alert-error": "system",
79416
+ "alert-critical-resolved": "system",
79198
79417
  "storage-location-low": "system",
79199
79418
  "storage-location-critical": "system",
79200
79419
  "storage-location-ok": "system",
@@ -79319,6 +79538,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
79319
79538
  "storage-location-ok"
79320
79539
  ]
79321
79540
  },
79541
+ {
79542
+ id: "alerts",
79543
+ family: "system",
79544
+ label: "Alerts",
79545
+ kinds: [
79546
+ "alert-critical",
79547
+ "alert-error",
79548
+ "alert-critical-resolved"
79549
+ ]
79550
+ },
79322
79551
  {
79323
79552
  id: "alarm",
79324
79553
  family: "alarm",
@@ -79363,6 +79592,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
79363
79592
  return [[descriptor.kind, field]];
79364
79593
  })));
79365
79594
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
79595
+ object({
79596
+ phase: _enum(["raised", "resolved"]),
79597
+ episodeId: string().min(1),
79598
+ alertId: string().min(1),
79599
+ severity: AlertSeveritySchema,
79600
+ category: string(),
79601
+ title: string(),
79602
+ message: string(),
79603
+ sourceType: string().optional(),
79604
+ sourceId: string().optional(),
79605
+ nodeId: string().optional(),
79606
+ /** The alert's own action link (where the operator acts on it), when it has one. */
79607
+ actionUrl: string().optional(),
79608
+ at: number()
79609
+ });
79366
79610
  var RULE_BODY_ONLY = ["body"];
79367
79611
  var RULE_TEXT = ["title", "body"];
79368
79612
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -79372,6 +79616,11 @@ var TANK = [
79372
79616
  "device-tank-full",
79373
79617
  "device-tank-normal"
79374
79618
  ];
79619
+ var ALERT_EPISODE = [
79620
+ "alert-critical",
79621
+ "alert-error",
79622
+ "alert-critical-resolved"
79623
+ ];
79375
79624
  var UPDATES = [
79376
79625
  "addon-update-available",
79377
79626
  "server-update-available",
@@ -79564,14 +79813,14 @@ var STATE_SUMMARY_VARS = [
79564
79813
  ([...RULE_TEXT], [...CONSUMABLE]),
79565
79814
  ([...RULE_TEXT], [...TANK]),
79566
79815
  [...RULE_TEXT],
79567
- ([...RULE_TEXT], [...UPDATES]),
79568
- ([...RULE_TEXT], [...UPDATES]),
79569
- [...RULE_TEXT],
79816
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79817
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79570
79818
  [...RULE_TEXT],
79571
79819
  [...RULE_TEXT],
79572
79820
  [...RULE_TEXT],
79573
79821
  [...RULE_TEXT],
79574
79822
  [...RULE_TEXT],
79823
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79575
79824
  [...RULE_TEXT],
79576
79825
  [...RULE_TEXT],
79577
79826
  [...RULE_TEXT],
@@ -79589,7 +79838,11 @@ var STATE_SUMMARY_VARS = [
79589
79838
  [...RULE_TEXT],
79590
79839
  [...RULE_TEXT],
79591
79840
  [...RULE_TEXT],
79592
- [...RULE_TEXT],
79841
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79842
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79843
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79844
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79845
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79593
79846
  [...RULE_TEXT],
79594
79847
  [...RULE_TEXT],
79595
79848
  [...RULE_TEXT],