@camstack/addon-provider-rtsp 1.2.128 → 1.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.js CHANGED
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  //#endregion
24
24
  let node_net = require("node:net");
25
25
  node_net = __toESM(node_net);
26
- //#region ../types/dist/event-category-BvOFi6PY.mjs
26
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
27
27
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
28
28
  EventCategory["SystemBoot"] = "system.boot";
29
29
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -102,9 +102,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
102
102
  /**
103
103
  * The node's one-shot runner boot check (D877): planned runners against the
104
104
  * process service, `degraded` when any is failed, refused or missing. The
105
- * alert centre turns it into one alert and a direct critical push.
105
+ * alert centre turns it into one critical alert.
106
106
  */
107
107
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
108
+ /**
109
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
110
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
111
+ * centre sends no notification of its own: Notification Center turns this
112
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
113
+ * system-event kinds, and reconciles from the alerts store because a bus
114
+ * event may be dropped (D8, D11).
115
+ */
116
+ EventCategory["AlertEpisode"] = "alert.episode";
108
117
  EventCategory["AddonError"] = "addon.error";
109
118
  EventCategory["AddonPageReady"] = "addon.page-ready";
110
119
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5429,7 +5438,7 @@ var ZodIssueCode = {
5429
5438
  var ZodFirstPartyTypeKind;
5430
5439
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5431
5440
  //#endregion
5432
- //#region ../types/dist/sleep-BegKjwUu.mjs
5441
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5433
5442
  /**
5434
5443
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5435
5444
  * window to float samples (D455).
@@ -7811,6 +7820,12 @@ function normalizeAddonInitResult(result) {
7811
7820
  if (Array.isArray(result)) return { providers: result };
7812
7821
  return result;
7813
7822
  }
7823
+ /**
7824
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7825
+ * and validates them (`share-token.service.ts` builds its enum from this
7826
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7827
+ */
7828
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7814
7829
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7815
7830
  var PeerBytesTicketSchema = object({
7816
7831
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12597,6 +12612,229 @@ var ConvertResultSchema = object({
12597
12612
  files: array(string()).readonly()
12598
12613
  })).readonly()
12599
12614
  });
12615
+ /**
12616
+ * Zod schemas for persisted record types.
12617
+ *
12618
+ * These schemas serve as the single source of truth for types that are
12619
+ * stored in the settings-store backend and retrieved via tRPC. They
12620
+ * replace the manual TypeScript interfaces with schema-derived types,
12621
+ * enabling runtime validation when reading from the backend.
12622
+ *
12623
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12624
+ * keeps the original name for backward compatibility.
12625
+ */
12626
+ /**
12627
+ * Auth model (v2 — 2026-05-12 caps-only):
12628
+ *
12629
+ * Two principals:
12630
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12631
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12632
+ *
12633
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12634
+ * `super_admin` — collapsed onto the single boolean because every
12635
+ * non-admin caller is governed by the same scope-check rules; the
12636
+ * distinction was only ever used to route role-specific procedures
12637
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12638
+ * with `isAdmin: false` + an explicit scope list.
12639
+ */
12640
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12641
+ var MethodAccessSchema = _enum([
12642
+ "view",
12643
+ "create",
12644
+ "delete"
12645
+ ]);
12646
+ /**
12647
+ * A single scope grant. Three forms — checked in matcher with OR
12648
+ * semantics; the first match decides whether the call passes:
12649
+ *
12650
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12651
+ * cap with the matching `scope` declaration. New caps inherit grants
12652
+ * automatically — adding a device cap to the codebase makes it
12653
+ * reachable to every user with `category:device [...]` without a
12654
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12655
+ *
12656
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12657
+ * useful when an integration needs to interact with one specific
12658
+ * addon's surface regardless of how many caps it exports.
12659
+ *
12660
+ * - `capability` — the most precise form. Single cap name. Use for
12661
+ * integration tokens where you want to grant `addons.installPackage`
12662
+ * and nothing else.
12663
+ *
12664
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12665
+ * "give me everything" escape; there is no wildcard scope.
12666
+ */
12667
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12668
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12669
+ var CapScopeSchema = _enum(["device", "system"]);
12670
+ /**
12671
+ * DeviceSelector (scope model v3 — 2026-08-12).
12672
+ *
12673
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12674
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12675
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12676
+ * AFTER the grant was minted — no re-grant, no re-login.
12677
+ *
12678
+ * - `all` — every device in the deployment. The broad viewer/operator
12679
+ * lever without a `category` grant (a `category` grant also covers device
12680
+ * caps that carry no deviceId; `all` is specifically the device set).
12681
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12682
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12683
+ * is NOT covered until the grant is edited.
12684
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12685
+ * DYNAMIC. A device that changes type, or a new device of the type,
12686
+ * re-resolves on the next request.
12687
+ * - `locations` — every device whose operator-assigned `location` label is
12688
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12689
+ * null/unset location matches NO `locations` selector.
12690
+ */
12691
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12692
+ object({ kind: literal("all") }),
12693
+ object({
12694
+ kind: literal("ids"),
12695
+ ids: array(number().int()).min(1)
12696
+ }),
12697
+ object({
12698
+ kind: literal("types"),
12699
+ types: array(_enum(DeviceType)).min(1)
12700
+ }),
12701
+ object({
12702
+ kind: literal("locations"),
12703
+ locations: array(string().min(1)).min(1)
12704
+ })
12705
+ ]);
12706
+ var DeviceTokenScopeSchema = object({
12707
+ type: literal("device"),
12708
+ /** The device SET this grant covers — resolved against the live fleet. */
12709
+ selector: DeviceSelectorSchema,
12710
+ access: array(MethodAccessSchema).min(1),
12711
+ /**
12712
+ * Whether a grant on a PARENT device transparently covers its accessory
12713
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12714
+ * Direction is parent → children ONLY.
12715
+ *
12716
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12717
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12718
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12719
+ * operator must grant on the child, not inherit from the parent). Set it
12720
+ * explicitly to override that default per grant.
12721
+ */
12722
+ includeLinked: boolean().optional()
12723
+ });
12724
+ /**
12725
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12726
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12727
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12728
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12729
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12730
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12731
+ * migration cannot reach a JWT already in a client's hands; parse-time
12732
+ * migration covers both without a flag day. No cast — the raw object is read
12733
+ * through `Reflect.get` (its static type is `unknown`).
12734
+ */
12735
+ function migrateLegacyTokenScope(raw) {
12736
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12737
+ if (Reflect.get(raw, "type") !== "device") return raw;
12738
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12739
+ const targets = Reflect.get(raw, "targets");
12740
+ if (!Array.isArray(targets)) return raw;
12741
+ return {
12742
+ type: "device",
12743
+ selector: {
12744
+ kind: "ids",
12745
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12746
+ },
12747
+ access: Reflect.get(raw, "access")
12748
+ };
12749
+ }
12750
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12751
+ object({
12752
+ type: literal("category"),
12753
+ target: CapScopeSchema,
12754
+ access: array(MethodAccessSchema).min(1)
12755
+ }),
12756
+ object({
12757
+ type: literal("capability"),
12758
+ target: string(),
12759
+ access: array(MethodAccessSchema).min(1)
12760
+ }),
12761
+ object({
12762
+ type: literal("addon"),
12763
+ target: string(),
12764
+ access: array(MethodAccessSchema).min(1)
12765
+ }),
12766
+ DeviceTokenScopeSchema
12767
+ ]));
12768
+ object({
12769
+ id: string(),
12770
+ username: string(),
12771
+ passwordHash: string(),
12772
+ /**
12773
+ * Admin bypass. When true, the middleware skips the scope-access
12774
+ * check entirely. There is no other axis of privilege; the legacy
12775
+ * role enum collapsed onto this boolean in v2.
12776
+ */
12777
+ isAdmin: boolean().default(false),
12778
+ allowedProviders: AllowedProviderSchema,
12779
+ allowedDevices: AllowedDevicesSchema,
12780
+ /**
12781
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12782
+ * ignored. Non-admins without scopes are locked out of every
12783
+ * protected call.
12784
+ */
12785
+ scopes: array(TokenScopeSchema).default([]),
12786
+ createdAt: number(),
12787
+ updatedAt: number()
12788
+ });
12789
+ object({
12790
+ id: string(),
12791
+ label: string(),
12792
+ isAdmin: boolean().default(false),
12793
+ allowedProviders: AllowedProviderSchema,
12794
+ allowedDevices: AllowedDevicesSchema,
12795
+ tokenHash: string(),
12796
+ tokenPrefix: string(),
12797
+ createdAt: number(),
12798
+ lastUsedAt: number().optional()
12799
+ });
12800
+ object({
12801
+ id: string(),
12802
+ userId: string(),
12803
+ name: string(),
12804
+ tokenHash: string(),
12805
+ tokenPrefix: string(),
12806
+ scopes: array(TokenScopeSchema),
12807
+ expiresAt: number().nullish(),
12808
+ lastUsedAt: number().nullish(),
12809
+ createdAt: number()
12810
+ });
12811
+ /** What a share-view grant lets its holder see. */
12812
+ var ShareViewGrantSchema = object({
12813
+ kind: _enum(SHARE_VIEW_KINDS),
12814
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
12815
+ /** Talk-back, opt-in at mint time; absent means off. */
12816
+ talk: boolean().optional()
12817
+ });
12818
+ var ShareViewScopeSchema = object({
12819
+ type: literal("share-view"),
12820
+ grant: ShareViewGrantSchema
12821
+ });
12822
+ var AddonRoutesScopeSchema = object({
12823
+ type: literal("addon-routes"),
12824
+ access: array(MethodAccessSchema).min(1)
12825
+ });
12826
+ var CredentialScopeSchema = union([
12827
+ literal("*"),
12828
+ ShareViewScopeSchema,
12829
+ AddonRoutesScopeSchema,
12830
+ TokenScopeSchema
12831
+ ]);
12832
+ object({
12833
+ kind: literal("credential"),
12834
+ sub: string().min(1),
12835
+ jti: string().min(16),
12836
+ scopes: array(CredentialScopeSchema).min(1)
12837
+ });
12600
12838
  _enum(["new-session", "step-up"]);
12601
12839
  /** The languages the hub's app landing pages are written in (D858). */
12602
12840
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13313,7 +13551,14 @@ var AlertSeveritySchema = _enum([
13313
13551
  ]);
13314
13552
  var AlertActionSchema = object({
13315
13553
  label: string(),
13316
- href: string().optional()
13554
+ href: string().optional(),
13555
+ /**
13556
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13557
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13558
+ * start) — the browser must leave the SPA with a full navigation, because
13559
+ * the SPA has no such route and would bounce to the home page.
13560
+ */
13561
+ navigation: _enum(["app", "server"]).optional()
13317
13562
  });
13318
13563
  var AlertStatusSchema = _enum([
13319
13564
  "active",
@@ -42029,6 +42274,9 @@ var NcSystemEventKindSchema = _enum([
42029
42274
  "server-updated",
42030
42275
  "export-completed",
42031
42276
  "backup-completed",
42277
+ "alert-critical",
42278
+ "alert-error",
42279
+ "alert-critical-resolved",
42032
42280
  "camera-online",
42033
42281
  "camera-offline",
42034
42282
  "camera-disabled",
@@ -44064,202 +44312,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44064
44312
  auth: "admin"
44065
44313
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44066
44314
  /**
44067
- * Zod schemas for persisted record types.
44068
- *
44069
- * These schemas serve as the single source of truth for types that are
44070
- * stored in the settings-store backend and retrieved via tRPC. They
44071
- * replace the manual TypeScript interfaces with schema-derived types,
44072
- * enabling runtime validation when reading from the backend.
44073
- *
44074
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44075
- * keeps the original name for backward compatibility.
44076
- */
44077
- /**
44078
- * Auth model (v2 — 2026-05-12 caps-only):
44079
- *
44080
- * Two principals:
44081
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44082
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44083
- *
44084
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44085
- * `super_admin` — collapsed onto the single boolean because every
44086
- * non-admin caller is governed by the same scope-check rules; the
44087
- * distinction was only ever used to route role-specific procedures
44088
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44089
- * with `isAdmin: false` + an explicit scope list.
44090
- */
44091
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44092
- var MethodAccessSchema = _enum([
44093
- "view",
44094
- "create",
44095
- "delete"
44096
- ]);
44097
- /**
44098
- * A single scope grant. Three forms — checked in matcher with OR
44099
- * semantics; the first match decides whether the call passes:
44100
- *
44101
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44102
- * cap with the matching `scope` declaration. New caps inherit grants
44103
- * automatically — adding a device cap to the codebase makes it
44104
- * reachable to every user with `category:device [...]` without a
44105
- * re-grant. Use this for "family viewer" / "operator" tiers.
44106
- *
44107
- * - `addon` — every cap that ships inside a given addon id. Niche;
44108
- * useful when an integration needs to interact with one specific
44109
- * addon's surface regardless of how many caps it exports.
44110
- *
44111
- * - `capability` — the most precise form. Single cap name. Use for
44112
- * integration tokens where you want to grant `addons.installPackage`
44113
- * and nothing else.
44114
- *
44115
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44116
- * "give me everything" escape; there is no wildcard scope.
44117
- */
44118
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44119
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44120
- var CapScopeSchema = _enum(["device", "system"]);
44121
- /**
44122
- * DeviceSelector (scope model v3 — 2026-08-12).
44123
- *
44124
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44125
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44126
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44127
- * AFTER the grant was minted — no re-grant, no re-login.
44128
- *
44129
- * - `all` — every device in the deployment. The broad viewer/operator
44130
- * lever without a `category` grant (a `category` grant also covers device
44131
- * caps that carry no deviceId; `all` is specifically the device set).
44132
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44133
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44134
- * is NOT covered until the grant is edited.
44135
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44136
- * DYNAMIC. A device that changes type, or a new device of the type,
44137
- * re-resolves on the next request.
44138
- * - `locations` — every device whose operator-assigned `location` label is
44139
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44140
- * null/unset location matches NO `locations` selector.
44141
- */
44142
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44143
- object({ kind: literal("all") }),
44144
- object({
44145
- kind: literal("ids"),
44146
- ids: array(number().int()).min(1)
44147
- }),
44148
- object({
44149
- kind: literal("types"),
44150
- types: array(_enum(DeviceType)).min(1)
44151
- }),
44152
- object({
44153
- kind: literal("locations"),
44154
- locations: array(string().min(1)).min(1)
44155
- })
44156
- ]);
44157
- var DeviceTokenScopeSchema = object({
44158
- type: literal("device"),
44159
- /** The device SET this grant covers — resolved against the live fleet. */
44160
- selector: DeviceSelectorSchema,
44161
- access: array(MethodAccessSchema).min(1),
44162
- /**
44163
- * Whether a grant on a PARENT device transparently covers its accessory
44164
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44165
- * Direction is parent → children ONLY.
44166
- *
44167
- * Absent → the matcher DERIVES it from the access flavour: `view`
44168
- * inherits (a camera viewer sees the camera's accessories), `create` /
44169
- * `delete` do NOT (actuating/removing a child is an explicit act the
44170
- * operator must grant on the child, not inherit from the parent). Set it
44171
- * explicitly to override that default per grant.
44172
- */
44173
- includeLinked: boolean().optional()
44174
- });
44175
- /**
44176
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44177
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44178
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44179
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44180
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44181
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44182
- * migration cannot reach a JWT already in a client's hands; parse-time
44183
- * migration covers both without a flag day. No cast — the raw object is read
44184
- * through `Reflect.get` (its static type is `unknown`).
44185
- */
44186
- function migrateLegacyTokenScope(raw) {
44187
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44188
- if (Reflect.get(raw, "type") !== "device") return raw;
44189
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44190
- const targets = Reflect.get(raw, "targets");
44191
- if (!Array.isArray(targets)) return raw;
44192
- return {
44193
- type: "device",
44194
- selector: {
44195
- kind: "ids",
44196
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44197
- },
44198
- access: Reflect.get(raw, "access")
44199
- };
44200
- }
44201
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44202
- object({
44203
- type: literal("category"),
44204
- target: CapScopeSchema,
44205
- access: array(MethodAccessSchema).min(1)
44206
- }),
44207
- object({
44208
- type: literal("capability"),
44209
- target: string(),
44210
- access: array(MethodAccessSchema).min(1)
44211
- }),
44212
- object({
44213
- type: literal("addon"),
44214
- target: string(),
44215
- access: array(MethodAccessSchema).min(1)
44216
- }),
44217
- DeviceTokenScopeSchema
44218
- ]));
44219
- object({
44220
- id: string(),
44221
- username: string(),
44222
- passwordHash: string(),
44223
- /**
44224
- * Admin bypass. When true, the middleware skips the scope-access
44225
- * check entirely. There is no other axis of privilege; the legacy
44226
- * role enum collapsed onto this boolean in v2.
44227
- */
44228
- isAdmin: boolean().default(false),
44229
- allowedProviders: AllowedProviderSchema,
44230
- allowedDevices: AllowedDevicesSchema,
44231
- /**
44232
- * Scopes granted to this user. Admins bypass; their `scopes` is
44233
- * ignored. Non-admins without scopes are locked out of every
44234
- * protected call.
44235
- */
44236
- scopes: array(TokenScopeSchema).default([]),
44237
- createdAt: number(),
44238
- updatedAt: number()
44239
- });
44240
- object({
44241
- id: string(),
44242
- label: string(),
44243
- isAdmin: boolean().default(false),
44244
- allowedProviders: AllowedProviderSchema,
44245
- allowedDevices: AllowedDevicesSchema,
44246
- tokenHash: string(),
44247
- tokenPrefix: string(),
44248
- createdAt: number(),
44249
- lastUsedAt: number().optional()
44250
- });
44251
- object({
44252
- id: string(),
44253
- userId: string(),
44254
- name: string(),
44255
- tokenHash: string(),
44256
- tokenPrefix: string(),
44257
- scopes: array(TokenScopeSchema),
44258
- expiresAt: number().nullish(),
44259
- lastUsedAt: number().nullish(),
44260
- createdAt: number()
44261
- });
44262
- /**
44263
44315
  * `oauth-integration` — a collection cap by which an addon declares
44264
44316
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44265
44317
  * Each provider returns a static descriptor; the core enumerates them
@@ -51209,7 +51261,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51209
51261
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51210
51262
  kind: "mutation",
51211
51263
  auth: "admin"
51212
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51264
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51265
+ clear: boolean(),
51266
+ repointLocationId: string().optional()
51267
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51213
51268
  kind: "mutation",
51214
51269
  auth: "admin"
51215
51270
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -55473,6 +55528,11 @@ onStatusChanged: { data: object({
55473
55528
  *
55474
55529
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55475
55530
  * provider refreshes the slice on an interval and eagerly after commands.
55531
+ *
55532
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55533
+ * nullable: `null` means "not known right now" (the appliance has not said,
55534
+ * the link is down, or the description does not carry it) and is never
55535
+ * rendered or exported as `false` / `0`. `availability` says why.
55476
55536
  */
55477
55537
  var DishwasherStateSchema = _enum([
55478
55538
  "idle",
@@ -55482,43 +55542,155 @@ var DishwasherStateSchema = _enum([
55482
55542
  "error",
55483
55543
  "unavailable"
55484
55544
  ]);
55545
+ /**
55546
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55547
+ * view for compact surfaces; this is what the appliance said.
55548
+ */
55549
+ var DishwasherOperationStateSchema = _enum([
55550
+ "Inactive",
55551
+ "Ready",
55552
+ "DelayedStart",
55553
+ "Run",
55554
+ "Pause",
55555
+ "ActionRequired",
55556
+ "Finished",
55557
+ "Error",
55558
+ "Aborting"
55559
+ ]);
55560
+ /**
55561
+ * Why fields may be `null`:
55562
+ * - `available` — the link is up and the description is loaded;
55563
+ * - `offline` — the local link is down (values are unknown, not last-known);
55564
+ * - `description-missing` — the link is up but the appliance's description could not
55565
+ * be loaded, so its values cannot be decoded.
55566
+ */
55567
+ var DishwasherAvailabilitySchema = _enum([
55568
+ "available",
55569
+ "offline",
55570
+ "description-missing"
55571
+ ]);
55485
55572
  var DishwasherConsumableLevelSchema = _enum([
55486
55573
  "ok",
55487
55574
  "low",
55488
55575
  "empty"
55489
55576
  ]);
55490
55577
  var DishwasherStatusSchema = object({
55578
+ availability: DishwasherAvailabilitySchema,
55579
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55491
55580
  state: DishwasherStateSchema,
55492
- /** Active program id/name, or null when none selected / unknown. */
55581
+ /** The appliance's operation state as reported; null when not known. */
55582
+ operationState: DishwasherOperationStateSchema.nullable(),
55583
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55493
55584
  program: string().nullable(),
55494
- /** Program tokens the hardware accepts — drives the UI selector. */
55585
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55586
+ selectedProgram: string().nullable(),
55587
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55495
55588
  availablePrograms: array(string()),
55496
- /** Minutes remaining on the active cycle, or null when not running. */
55497
- remainingMinutes: number().int().nonnegative().nullable(),
55589
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55590
+ remainingSeconds: number().int().nonnegative().nullable(),
55591
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55592
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55498
55593
  /** Cycle completion 0..100, or null when not applicable. */
55499
55594
  progressPercent: number().min(0).max(100).nullable(),
55500
- /** True when the door is reported open. */
55501
- doorOpen: boolean(),
55502
- /** True when remote start is allowed (door closed, power on, etc.). */
55503
- remoteStartAllowed: boolean(),
55504
- /** Main power / switched-on state. */
55505
- powerOn: boolean(),
55595
+ /** True when the door is reported open; null when the door state is not known. */
55596
+ doorOpen: boolean().nullable(),
55597
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55598
+ doorLocked: boolean().nullable(),
55599
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55600
+ remoteStartAllowed: boolean().nullable(),
55601
+ /** True when the appliance accepts remote control now; null when not known. */
55602
+ remoteControlActive: boolean().nullable(),
55603
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55604
+ localControlActive: boolean().nullable(),
55605
+ /** Main power / switched-on state; null when not known. */
55606
+ powerOn: boolean().nullable(),
55607
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55608
+ powerState: string().nullable(),
55506
55609
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
55507
55610
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55508
- halfLoad: boolean(),
55509
- hygienePlus: boolean(),
55611
+ /** Option states: null when the appliance does not expose the option or has not said. */
55612
+ halfLoad: boolean().nullable(),
55613
+ hygienePlus: boolean().nullable(),
55510
55614
  /** Extra dry option when the appliance exposes it. */
55511
- extraDry: boolean(),
55615
+ extraDry: boolean().nullable(),
55512
55616
  /** Intensive zone (lower basket) when the appliance exposes it. */
55513
- intensiveZone: boolean(),
55617
+ intensiveZone: boolean().nullable(),
55514
55618
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55515
- varioSpeedPlus: boolean(),
55516
- /** Child lock (controls disabled on the appliance). */
55517
- childLock: boolean(),
55619
+ varioSpeedPlus: boolean().nullable(),
55620
+ /** Child lock (controls disabled on the appliance); null when not known. */
55621
+ childLock: boolean().nullable(),
55622
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55623
+ activeEvents: array(string()),
55624
+ /** Numeric error code when the appliance reports one; null otherwise. */
55518
55625
  errorCode: number().nullable(),
55626
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55519
55627
  errorLabel: string().nullable(),
55628
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55520
55629
  lastFetchedAt: number()
55521
55630
  });
55631
+ var DeviceIdSchema = number().int().nonnegative();
55632
+ /** A value a program option or setting can take. */
55633
+ var DishwasherValueSchema = union([
55634
+ boolean(),
55635
+ string(),
55636
+ number()
55637
+ ]);
55638
+ var DishwasherAccessSchema = _enum([
55639
+ "none",
55640
+ "read",
55641
+ "readWrite",
55642
+ "writeOnly",
55643
+ "readStatic"
55644
+ ]);
55645
+ /**
55646
+ * One option or setting the appliance declares, with the constraints its description
55647
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55648
+ */
55649
+ var DishwasherOptionDescriptorSchema = object({
55650
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55651
+ key: string(),
55652
+ /** Last segment of the key, for display. */
55653
+ name: string(),
55654
+ type: _enum([
55655
+ "boolean",
55656
+ "number",
55657
+ "enum",
55658
+ "string"
55659
+ ]),
55660
+ access: DishwasherAccessSchema,
55661
+ /** The appliance reports this entity as currently available. */
55662
+ available: boolean(),
55663
+ /** Unit the description declares for a number; null when it declares none. */
55664
+ unit: string().nullable(),
55665
+ min: number().nullable(),
55666
+ max: number().nullable(),
55667
+ step: number().nullable(),
55668
+ /** Allowed members of an enum; null for other types. */
55669
+ enumValues: array(string()).nullable(),
55670
+ defaultValue: DishwasherValueSchema.nullable()
55671
+ });
55672
+ var DishwasherProgramSchema = object({
55673
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
55674
+ key: string(),
55675
+ name: string(),
55676
+ /** The appliance currently offers this program. */
55677
+ available: boolean(),
55678
+ /** The options this program lists, with the program-level access / availability / default. */
55679
+ options: array(DishwasherOptionDescriptorSchema)
55680
+ });
55681
+ var DishwasherOptionsSchema = object({
55682
+ availability: DishwasherAvailabilitySchema,
55683
+ /** What the appliance can be told to do, from the commands its description declares. */
55684
+ supportsStart: boolean(),
55685
+ supportsPause: boolean(),
55686
+ supportsResume: boolean(),
55687
+ supportsStop: boolean(),
55688
+ supportsPower: boolean(),
55689
+ /** Every program the description lists, with its options. */
55690
+ programs: array(DishwasherProgramSchema),
55691
+ /** Every option and setting entity the description lists (programs reference these by key). */
55692
+ options: array(DishwasherOptionDescriptorSchema)
55693
+ });
55522
55694
  var dishwasherCapability = {
55523
55695
  name: "dishwasher",
55524
55696
  scope: "device",
@@ -55526,86 +55698,102 @@ var dishwasherCapability = {
55526
55698
  mode: "singleton",
55527
55699
  deviceTypes: [DeviceType.Dishwasher],
55528
55700
  methods: {
55529
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55701
+ /**
55702
+ * Start a program. Without `program` the selected one starts. `options` are
55703
+ * option feature keys; each is checked against the program's constraints.
55704
+ */
55705
+ start: method(object({
55706
+ deviceId: DeviceIdSchema,
55707
+ program: string().min(1).optional(),
55708
+ options: record(string(), DishwasherValueSchema).optional()
55709
+ }), _void(), {
55530
55710
  kind: "mutation",
55531
55711
  auth: "protected"
55532
55712
  }),
55533
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55713
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55534
55714
  kind: "mutation",
55535
55715
  auth: "protected"
55536
55716
  }),
55537
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55717
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
55718
+ kind: "mutation",
55719
+ auth: "protected"
55720
+ }),
55721
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55538
55722
  kind: "mutation",
55539
55723
  auth: "protected"
55540
55724
  }),
55725
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55541
55726
  setProgram: method(object({
55542
- deviceId: number().int().nonnegative(),
55727
+ deviceId: DeviceIdSchema,
55543
55728
  program: string().min(1)
55544
55729
  }), _void(), {
55545
55730
  kind: "mutation",
55546
55731
  auth: "protected"
55547
55732
  }),
55548
55733
  setPower: method(object({
55549
- deviceId: number().int().nonnegative(),
55734
+ deviceId: DeviceIdSchema,
55550
55735
  on: boolean()
55551
55736
  }), _void(), {
55552
55737
  kind: "mutation",
55553
55738
  auth: "protected"
55554
55739
  }),
55555
55740
  setHalfLoad: method(object({
55556
- deviceId: number().int().nonnegative(),
55741
+ deviceId: DeviceIdSchema,
55557
55742
  on: boolean()
55558
55743
  }), _void(), {
55559
55744
  kind: "mutation",
55560
55745
  auth: "protected"
55561
55746
  }),
55562
55747
  setHygienePlus: method(object({
55563
- deviceId: number().int().nonnegative(),
55748
+ deviceId: DeviceIdSchema,
55564
55749
  on: boolean()
55565
55750
  }), _void(), {
55566
55751
  kind: "mutation",
55567
55752
  auth: "protected"
55568
55753
  }),
55569
55754
  setExtraDry: method(object({
55570
- deviceId: number().int().nonnegative(),
55755
+ deviceId: DeviceIdSchema,
55571
55756
  on: boolean()
55572
55757
  }), _void(), {
55573
55758
  kind: "mutation",
55574
55759
  auth: "protected"
55575
55760
  }),
55576
55761
  setIntensiveZone: method(object({
55577
- deviceId: number().int().nonnegative(),
55762
+ deviceId: DeviceIdSchema,
55578
55763
  on: boolean()
55579
55764
  }), _void(), {
55580
55765
  kind: "mutation",
55581
55766
  auth: "protected"
55582
55767
  }),
55583
55768
  setVarioSpeedPlus: method(object({
55584
- deviceId: number().int().nonnegative(),
55769
+ deviceId: DeviceIdSchema,
55585
55770
  on: boolean()
55586
55771
  }), _void(), {
55587
55772
  kind: "mutation",
55588
55773
  auth: "protected"
55589
55774
  }),
55590
55775
  setChildLock: method(object({
55591
- deviceId: number().int().nonnegative(),
55776
+ deviceId: DeviceIdSchema,
55592
55777
  on: boolean()
55593
55778
  }), _void(), {
55594
55779
  kind: "mutation",
55595
55780
  auth: "protected"
55596
55781
  }),
55782
+ /**
55783
+ * Write any option or setting by feature key. Refused when the description does
55784
+ * not list it, it is not writable or not available now, or the value is outside
55785
+ * its declared range / members.
55786
+ */
55597
55787
  setOption: method(object({
55598
- deviceId: number().int().nonnegative(),
55788
+ deviceId: DeviceIdSchema,
55599
55789
  key: string().min(1),
55600
- value: union([
55601
- boolean(),
55602
- string(),
55603
- number()
55604
- ])
55790
+ value: DishwasherValueSchema
55605
55791
  }), _void(), {
55606
55792
  kind: "mutation",
55607
55793
  auth: "protected"
55608
- })
55794
+ }),
55795
+ /** What this appliance can do, from its own description — the UI is derived from it. */
55796
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55609
55797
  },
55610
55798
  status: {
55611
55799
  schema: DishwasherStatusSchema,
@@ -69554,6 +69742,12 @@ Object.freeze({
69554
69742
  addonId: null,
69555
69743
  access: "view"
69556
69744
  },
69745
+ "dishwasher.getOptions": {
69746
+ capName: "dishwasher",
69747
+ capScope: "device",
69748
+ addonId: null,
69749
+ access: "view"
69750
+ },
69557
69751
  "dishwasher.getStatus": {
69558
69752
  capName: "dishwasher",
69559
69753
  capScope: "device",
@@ -69566,6 +69760,12 @@ Object.freeze({
69566
69760
  addonId: null,
69567
69761
  access: "create"
69568
69762
  },
69763
+ "dishwasher.resume": {
69764
+ capName: "dishwasher",
69765
+ capScope: "device",
69766
+ addonId: null,
69767
+ access: "create"
69768
+ },
69569
69769
  "dishwasher.setChildLock": {
69570
69770
  capName: "dishwasher",
69571
69771
  capScope: "device",
@@ -74066,6 +74266,12 @@ Object.freeze({
74066
74266
  addonId: null,
74067
74267
  access: "view"
74068
74268
  },
74269
+ "storageMigration.moverClearance": {
74270
+ capName: "storage-migration",
74271
+ capScope: "system",
74272
+ addonId: null,
74273
+ access: "view"
74274
+ },
74069
74275
  "storageMigration.movers": {
74070
74276
  capName: "storage-migration",
74071
74277
  capScope: "system",
@@ -76325,6 +76531,11 @@ Object.freeze({
76325
76531
  form: "single",
76326
76532
  optional: false
76327
76533
  }],
76534
+ "dishwasher.getOptions": [{
76535
+ name: "deviceId",
76536
+ form: "single",
76537
+ optional: false
76538
+ }],
76328
76539
  "dishwasher.getStatus": [{
76329
76540
  name: "deviceId",
76330
76541
  form: "single",
@@ -76335,6 +76546,11 @@ Object.freeze({
76335
76546
  form: "single",
76336
76547
  optional: false
76337
76548
  }],
76549
+ "dishwasher.resume": [{
76550
+ name: "deviceId",
76551
+ form: "single",
76552
+ optional: false
76553
+ }],
76338
76554
  "dishwasher.setChildLock": [{
76339
76555
  name: "deviceId",
76340
76556
  form: "single",
@@ -78421,6 +78637,9 @@ new Map(Object.entries({
78421
78637
  "wrapper-update-available": "system",
78422
78638
  "backup-completed": "system",
78423
78639
  "export-completed": "system",
78640
+ "alert-critical": "system",
78641
+ "alert-error": "system",
78642
+ "alert-critical-resolved": "system",
78424
78643
  "storage-location-low": "system",
78425
78644
  "storage-location-critical": "system",
78426
78645
  "storage-location-ok": "system",
@@ -78545,6 +78764,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
78545
78764
  "storage-location-ok"
78546
78765
  ]
78547
78766
  },
78767
+ {
78768
+ id: "alerts",
78769
+ family: "system",
78770
+ label: "Alerts",
78771
+ kinds: [
78772
+ "alert-critical",
78773
+ "alert-error",
78774
+ "alert-critical-resolved"
78775
+ ]
78776
+ },
78548
78777
  {
78549
78778
  id: "alarm",
78550
78779
  family: "alarm",
@@ -78589,6 +78818,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
78589
78818
  return [[descriptor.kind, field]];
78590
78819
  })));
78591
78820
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
78821
+ object({
78822
+ phase: _enum(["raised", "resolved"]),
78823
+ episodeId: string().min(1),
78824
+ alertId: string().min(1),
78825
+ severity: AlertSeveritySchema,
78826
+ category: string(),
78827
+ title: string(),
78828
+ message: string(),
78829
+ sourceType: string().optional(),
78830
+ sourceId: string().optional(),
78831
+ nodeId: string().optional(),
78832
+ /** The alert's own action link (where the operator acts on it), when it has one. */
78833
+ actionUrl: string().optional(),
78834
+ at: number()
78835
+ });
78592
78836
  var RULE_BODY_ONLY = ["body"];
78593
78837
  var RULE_TEXT = ["title", "body"];
78594
78838
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -78598,6 +78842,11 @@ var TANK = [
78598
78842
  "device-tank-full",
78599
78843
  "device-tank-normal"
78600
78844
  ];
78845
+ var ALERT_EPISODE = [
78846
+ "alert-critical",
78847
+ "alert-error",
78848
+ "alert-critical-resolved"
78849
+ ];
78601
78850
  var UPDATES = [
78602
78851
  "addon-update-available",
78603
78852
  "server-update-available",
@@ -78790,14 +79039,14 @@ var STATE_SUMMARY_VARS = [
78790
79039
  ([...RULE_TEXT], [...CONSUMABLE]),
78791
79040
  ([...RULE_TEXT], [...TANK]),
78792
79041
  [...RULE_TEXT],
78793
- ([...RULE_TEXT], [...UPDATES]),
78794
- ([...RULE_TEXT], [...UPDATES]),
78795
- [...RULE_TEXT],
79042
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79043
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78796
79044
  [...RULE_TEXT],
78797
79045
  [...RULE_TEXT],
78798
79046
  [...RULE_TEXT],
78799
79047
  [...RULE_TEXT],
78800
79048
  [...RULE_TEXT],
79049
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78801
79050
  [...RULE_TEXT],
78802
79051
  [...RULE_TEXT],
78803
79052
  [...RULE_TEXT],
@@ -78815,7 +79064,11 @@ var STATE_SUMMARY_VARS = [
78815
79064
  [...RULE_TEXT],
78816
79065
  [...RULE_TEXT],
78817
79066
  [...RULE_TEXT],
78818
- [...RULE_TEXT],
79067
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79068
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79069
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79070
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79071
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78819
79072
  [...RULE_TEXT],
78820
79073
  [...RULE_TEXT],
78821
79074
  [...RULE_TEXT],