@camstack/addon-provider-petkit 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
@@ -1100,7 +1100,7 @@ var Nodepetkit = class {
1100
1100
  }
1101
1101
  };
1102
1102
  //#endregion
1103
- //#region ../types/dist/event-category-BvOFi6PY.mjs
1103
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
1104
1104
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
1105
1105
  EventCategory["SystemBoot"] = "system.boot";
1106
1106
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1179,9 +1179,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1179
1179
  /**
1180
1180
  * The node's one-shot runner boot check (D877): planned runners against the
1181
1181
  * process service, `degraded` when any is failed, refused or missing. The
1182
- * alert centre turns it into one alert and a direct critical push.
1182
+ * alert centre turns it into one critical alert.
1183
1183
  */
1184
1184
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
1185
+ /**
1186
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
1187
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
1188
+ * centre sends no notification of its own: Notification Center turns this
1189
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
1190
+ * system-event kinds, and reconciles from the alerts store because a bus
1191
+ * event may be dropped (D8, D11).
1192
+ */
1193
+ EventCategory["AlertEpisode"] = "alert.episode";
1185
1194
  EventCategory["AddonError"] = "addon.error";
1186
1195
  EventCategory["AddonPageReady"] = "addon.page-ready";
1187
1196
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -6506,7 +6515,7 @@ var ZodIssueCode = {
6506
6515
  var ZodFirstPartyTypeKind;
6507
6516
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6508
6517
  //#endregion
6509
- //#region ../types/dist/sleep-BegKjwUu.mjs
6518
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
6510
6519
  /**
6511
6520
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6512
6521
  * window to float samples (D455).
@@ -8888,6 +8897,12 @@ function normalizeAddonInitResult(result) {
8888
8897
  if (Array.isArray(result)) return { providers: result };
8889
8898
  return result;
8890
8899
  }
8900
+ /**
8901
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
8902
+ * and validates them (`share-token.service.ts` builds its enum from this
8903
+ * list); a data plane names the kinds it ACCEPTS in `share`.
8904
+ */
8905
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
8891
8906
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
8892
8907
  var PeerBytesTicketSchema = object({
8893
8908
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -13553,6 +13568,229 @@ var ConvertResultSchema = object({
13553
13568
  files: array(string()).readonly()
13554
13569
  })).readonly()
13555
13570
  });
13571
+ /**
13572
+ * Zod schemas for persisted record types.
13573
+ *
13574
+ * These schemas serve as the single source of truth for types that are
13575
+ * stored in the settings-store backend and retrieved via tRPC. They
13576
+ * replace the manual TypeScript interfaces with schema-derived types,
13577
+ * enabling runtime validation when reading from the backend.
13578
+ *
13579
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
13580
+ * keeps the original name for backward compatibility.
13581
+ */
13582
+ /**
13583
+ * Auth model (v2 — 2026-05-12 caps-only):
13584
+ *
13585
+ * Two principals:
13586
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
13587
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
13588
+ *
13589
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
13590
+ * `super_admin` — collapsed onto the single boolean because every
13591
+ * non-admin caller is governed by the same scope-check rules; the
13592
+ * distinction was only ever used to route role-specific procedures
13593
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
13594
+ * with `isAdmin: false` + an explicit scope list.
13595
+ */
13596
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
13597
+ var MethodAccessSchema = _enum([
13598
+ "view",
13599
+ "create",
13600
+ "delete"
13601
+ ]);
13602
+ /**
13603
+ * A single scope grant. Three forms — checked in matcher with OR
13604
+ * semantics; the first match decides whether the call passes:
13605
+ *
13606
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
13607
+ * cap with the matching `scope` declaration. New caps inherit grants
13608
+ * automatically — adding a device cap to the codebase makes it
13609
+ * reachable to every user with `category:device [...]` without a
13610
+ * re-grant. Use this for "family viewer" / "operator" tiers.
13611
+ *
13612
+ * - `addon` — every cap that ships inside a given addon id. Niche;
13613
+ * useful when an integration needs to interact with one specific
13614
+ * addon's surface regardless of how many caps it exports.
13615
+ *
13616
+ * - `capability` — the most precise form. Single cap name. Use for
13617
+ * integration tokens where you want to grant `addons.installPackage`
13618
+ * and nothing else.
13619
+ *
13620
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
13621
+ * "give me everything" escape; there is no wildcard scope.
13622
+ */
13623
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
13624
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
13625
+ var CapScopeSchema = _enum(["device", "system"]);
13626
+ /**
13627
+ * DeviceSelector (scope model v3 — 2026-08-12).
13628
+ *
13629
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
13630
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
13631
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
13632
+ * AFTER the grant was minted — no re-grant, no re-login.
13633
+ *
13634
+ * - `all` — every device in the deployment. The broad viewer/operator
13635
+ * lever without a `category` grant (a `category` grant also covers device
13636
+ * caps that carry no deviceId; `all` is specifically the device set).
13637
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
13638
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
13639
+ * is NOT covered until the grant is edited.
13640
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
13641
+ * DYNAMIC. A device that changes type, or a new device of the type,
13642
+ * re-resolves on the next request.
13643
+ * - `locations` — every device whose operator-assigned `location` label is
13644
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
13645
+ * null/unset location matches NO `locations` selector.
13646
+ */
13647
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
13648
+ object({ kind: literal("all") }),
13649
+ object({
13650
+ kind: literal("ids"),
13651
+ ids: array(number().int()).min(1)
13652
+ }),
13653
+ object({
13654
+ kind: literal("types"),
13655
+ types: array(_enum(DeviceType)).min(1)
13656
+ }),
13657
+ object({
13658
+ kind: literal("locations"),
13659
+ locations: array(string().min(1)).min(1)
13660
+ })
13661
+ ]);
13662
+ var DeviceTokenScopeSchema = object({
13663
+ type: literal("device"),
13664
+ /** The device SET this grant covers — resolved against the live fleet. */
13665
+ selector: DeviceSelectorSchema,
13666
+ access: array(MethodAccessSchema).min(1),
13667
+ /**
13668
+ * Whether a grant on a PARENT device transparently covers its accessory
13669
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
13670
+ * Direction is parent → children ONLY.
13671
+ *
13672
+ * Absent → the matcher DERIVES it from the access flavour: `view`
13673
+ * inherits (a camera viewer sees the camera's accessories), `create` /
13674
+ * `delete` do NOT (actuating/removing a child is an explicit act the
13675
+ * operator must grant on the child, not inherit from the parent). Set it
13676
+ * explicitly to override that default per grant.
13677
+ */
13678
+ includeLinked: boolean().optional()
13679
+ });
13680
+ /**
13681
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
13682
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
13683
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
13684
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
13685
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
13686
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
13687
+ * migration cannot reach a JWT already in a client's hands; parse-time
13688
+ * migration covers both without a flag day. No cast — the raw object is read
13689
+ * through `Reflect.get` (its static type is `unknown`).
13690
+ */
13691
+ function migrateLegacyTokenScope(raw) {
13692
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
13693
+ if (Reflect.get(raw, "type") !== "device") return raw;
13694
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
13695
+ const targets = Reflect.get(raw, "targets");
13696
+ if (!Array.isArray(targets)) return raw;
13697
+ return {
13698
+ type: "device",
13699
+ selector: {
13700
+ kind: "ids",
13701
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
13702
+ },
13703
+ access: Reflect.get(raw, "access")
13704
+ };
13705
+ }
13706
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
13707
+ object({
13708
+ type: literal("category"),
13709
+ target: CapScopeSchema,
13710
+ access: array(MethodAccessSchema).min(1)
13711
+ }),
13712
+ object({
13713
+ type: literal("capability"),
13714
+ target: string(),
13715
+ access: array(MethodAccessSchema).min(1)
13716
+ }),
13717
+ object({
13718
+ type: literal("addon"),
13719
+ target: string(),
13720
+ access: array(MethodAccessSchema).min(1)
13721
+ }),
13722
+ DeviceTokenScopeSchema
13723
+ ]));
13724
+ object({
13725
+ id: string(),
13726
+ username: string(),
13727
+ passwordHash: string(),
13728
+ /**
13729
+ * Admin bypass. When true, the middleware skips the scope-access
13730
+ * check entirely. There is no other axis of privilege; the legacy
13731
+ * role enum collapsed onto this boolean in v2.
13732
+ */
13733
+ isAdmin: boolean().default(false),
13734
+ allowedProviders: AllowedProviderSchema,
13735
+ allowedDevices: AllowedDevicesSchema,
13736
+ /**
13737
+ * Scopes granted to this user. Admins bypass; their `scopes` is
13738
+ * ignored. Non-admins without scopes are locked out of every
13739
+ * protected call.
13740
+ */
13741
+ scopes: array(TokenScopeSchema).default([]),
13742
+ createdAt: number(),
13743
+ updatedAt: number()
13744
+ });
13745
+ object({
13746
+ id: string(),
13747
+ label: string(),
13748
+ isAdmin: boolean().default(false),
13749
+ allowedProviders: AllowedProviderSchema,
13750
+ allowedDevices: AllowedDevicesSchema,
13751
+ tokenHash: string(),
13752
+ tokenPrefix: string(),
13753
+ createdAt: number(),
13754
+ lastUsedAt: number().optional()
13755
+ });
13756
+ object({
13757
+ id: string(),
13758
+ userId: string(),
13759
+ name: string(),
13760
+ tokenHash: string(),
13761
+ tokenPrefix: string(),
13762
+ scopes: array(TokenScopeSchema),
13763
+ expiresAt: number().nullish(),
13764
+ lastUsedAt: number().nullish(),
13765
+ createdAt: number()
13766
+ });
13767
+ /** What a share-view grant lets its holder see. */
13768
+ var ShareViewGrantSchema = object({
13769
+ kind: _enum(SHARE_VIEW_KINDS),
13770
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
13771
+ /** Talk-back, opt-in at mint time; absent means off. */
13772
+ talk: boolean().optional()
13773
+ });
13774
+ var ShareViewScopeSchema = object({
13775
+ type: literal("share-view"),
13776
+ grant: ShareViewGrantSchema
13777
+ });
13778
+ var AddonRoutesScopeSchema = object({
13779
+ type: literal("addon-routes"),
13780
+ access: array(MethodAccessSchema).min(1)
13781
+ });
13782
+ var CredentialScopeSchema = union([
13783
+ literal("*"),
13784
+ ShareViewScopeSchema,
13785
+ AddonRoutesScopeSchema,
13786
+ TokenScopeSchema
13787
+ ]);
13788
+ object({
13789
+ kind: literal("credential"),
13790
+ sub: string().min(1),
13791
+ jti: string().min(16),
13792
+ scopes: array(CredentialScopeSchema).min(1)
13793
+ });
13556
13794
  _enum(["new-session", "step-up"]);
13557
13795
  /** The languages the hub's app landing pages are written in (D858). */
13558
13796
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -14269,7 +14507,14 @@ var AlertSeveritySchema = _enum([
14269
14507
  ]);
14270
14508
  var AlertActionSchema = object({
14271
14509
  label: string(),
14272
- href: string().optional()
14510
+ href: string().optional(),
14511
+ /**
14512
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
14513
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
14514
+ * start) — the browser must leave the SPA with a full navigation, because
14515
+ * the SPA has no such route and would bounce to the home page.
14516
+ */
14517
+ navigation: _enum(["app", "server"]).optional()
14273
14518
  });
14274
14519
  var AlertStatusSchema = _enum([
14275
14520
  "active",
@@ -43002,6 +43247,9 @@ var NcSystemEventKindSchema = _enum([
43002
43247
  "server-updated",
43003
43248
  "export-completed",
43004
43249
  "backup-completed",
43250
+ "alert-critical",
43251
+ "alert-error",
43252
+ "alert-critical-resolved",
43005
43253
  "camera-online",
43006
43254
  "camera-offline",
43007
43255
  "camera-disabled",
@@ -45037,202 +45285,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
45037
45285
  auth: "admin"
45038
45286
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
45039
45287
  /**
45040
- * Zod schemas for persisted record types.
45041
- *
45042
- * These schemas serve as the single source of truth for types that are
45043
- * stored in the settings-store backend and retrieved via tRPC. They
45044
- * replace the manual TypeScript interfaces with schema-derived types,
45045
- * enabling runtime validation when reading from the backend.
45046
- *
45047
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
45048
- * keeps the original name for backward compatibility.
45049
- */
45050
- /**
45051
- * Auth model (v2 — 2026-05-12 caps-only):
45052
- *
45053
- * Two principals:
45054
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
45055
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
45056
- *
45057
- * No role enum. There used to be `viewer / agent / scoped` and earlier
45058
- * `super_admin` — collapsed onto the single boolean because every
45059
- * non-admin caller is governed by the same scope-check rules; the
45060
- * distinction was only ever used to route role-specific procedures
45061
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
45062
- * with `isAdmin: false` + an explicit scope list.
45063
- */
45064
- /** Per-method access flavour. Materialised on every cap method via codegen. */
45065
- var MethodAccessSchema = _enum([
45066
- "view",
45067
- "create",
45068
- "delete"
45069
- ]);
45070
- /**
45071
- * A single scope grant. Three forms — checked in matcher with OR
45072
- * semantics; the first match decides whether the call passes:
45073
- *
45074
- * - `category` — broadest. `target: 'device' | 'system'` selects every
45075
- * cap with the matching `scope` declaration. New caps inherit grants
45076
- * automatically — adding a device cap to the codebase makes it
45077
- * reachable to every user with `category:device [...]` without a
45078
- * re-grant. Use this for "family viewer" / "operator" tiers.
45079
- *
45080
- * - `addon` — every cap that ships inside a given addon id. Niche;
45081
- * useful when an integration needs to interact with one specific
45082
- * addon's surface regardless of how many caps it exports.
45083
- *
45084
- * - `capability` — the most precise form. Single cap name. Use for
45085
- * integration tokens where you want to grant `addons.installPackage`
45086
- * and nothing else.
45087
- *
45088
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
45089
- * "give me everything" escape; there is no wildcard scope.
45090
- */
45091
- var AllowedProviderSchema = union([literal("*"), array(string())]);
45092
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
45093
- var CapScopeSchema = _enum(["device", "system"]);
45094
- /**
45095
- * DeviceSelector (scope model v3 — 2026-08-12).
45096
- *
45097
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
45098
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
45099
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
45100
- * AFTER the grant was minted — no re-grant, no re-login.
45101
- *
45102
- * - `all` — every device in the deployment. The broad viewer/operator
45103
- * lever without a `category` grant (a `category` grant also covers device
45104
- * caps that carry no deviceId; `all` is specifically the device set).
45105
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
45106
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
45107
- * is NOT covered until the grant is edited.
45108
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
45109
- * DYNAMIC. A device that changes type, or a new device of the type,
45110
- * re-resolves on the next request.
45111
- * - `locations` — every device whose operator-assigned `location` label is
45112
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
45113
- * null/unset location matches NO `locations` selector.
45114
- */
45115
- var DeviceSelectorSchema = discriminatedUnion("kind", [
45116
- object({ kind: literal("all") }),
45117
- object({
45118
- kind: literal("ids"),
45119
- ids: array(number().int()).min(1)
45120
- }),
45121
- object({
45122
- kind: literal("types"),
45123
- types: array(_enum(DeviceType)).min(1)
45124
- }),
45125
- object({
45126
- kind: literal("locations"),
45127
- locations: array(string().min(1)).min(1)
45128
- })
45129
- ]);
45130
- var DeviceTokenScopeSchema = object({
45131
- type: literal("device"),
45132
- /** The device SET this grant covers — resolved against the live fleet. */
45133
- selector: DeviceSelectorSchema,
45134
- access: array(MethodAccessSchema).min(1),
45135
- /**
45136
- * Whether a grant on a PARENT device transparently covers its accessory
45137
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
45138
- * Direction is parent → children ONLY.
45139
- *
45140
- * Absent → the matcher DERIVES it from the access flavour: `view`
45141
- * inherits (a camera viewer sees the camera's accessories), `create` /
45142
- * `delete` do NOT (actuating/removing a child is an explicit act the
45143
- * operator must grant on the child, not inherit from the parent). Set it
45144
- * explicitly to override that default per grant.
45145
- */
45146
- includeLinked: boolean().optional()
45147
- });
45148
- /**
45149
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
45150
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
45151
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
45152
- * EVERY parse path — stored records AND the JWT-carried scope arrays
45153
- * normalised at the request boundary ({@link normalizeTokenScopes} in
45154
- * `device-selector.ts`). Chosen over a one-time DB migration because a
45155
- * migration cannot reach a JWT already in a client's hands; parse-time
45156
- * migration covers both without a flag day. No cast — the raw object is read
45157
- * through `Reflect.get` (its static type is `unknown`).
45158
- */
45159
- function migrateLegacyTokenScope(raw) {
45160
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
45161
- if (Reflect.get(raw, "type") !== "device") return raw;
45162
- if (Reflect.get(raw, "selector") !== void 0) return raw;
45163
- const targets = Reflect.get(raw, "targets");
45164
- if (!Array.isArray(targets)) return raw;
45165
- return {
45166
- type: "device",
45167
- selector: {
45168
- kind: "ids",
45169
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
45170
- },
45171
- access: Reflect.get(raw, "access")
45172
- };
45173
- }
45174
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
45175
- object({
45176
- type: literal("category"),
45177
- target: CapScopeSchema,
45178
- access: array(MethodAccessSchema).min(1)
45179
- }),
45180
- object({
45181
- type: literal("capability"),
45182
- target: string(),
45183
- access: array(MethodAccessSchema).min(1)
45184
- }),
45185
- object({
45186
- type: literal("addon"),
45187
- target: string(),
45188
- access: array(MethodAccessSchema).min(1)
45189
- }),
45190
- DeviceTokenScopeSchema
45191
- ]));
45192
- object({
45193
- id: string(),
45194
- username: string(),
45195
- passwordHash: string(),
45196
- /**
45197
- * Admin bypass. When true, the middleware skips the scope-access
45198
- * check entirely. There is no other axis of privilege; the legacy
45199
- * role enum collapsed onto this boolean in v2.
45200
- */
45201
- isAdmin: boolean().default(false),
45202
- allowedProviders: AllowedProviderSchema,
45203
- allowedDevices: AllowedDevicesSchema,
45204
- /**
45205
- * Scopes granted to this user. Admins bypass; their `scopes` is
45206
- * ignored. Non-admins without scopes are locked out of every
45207
- * protected call.
45208
- */
45209
- scopes: array(TokenScopeSchema).default([]),
45210
- createdAt: number(),
45211
- updatedAt: number()
45212
- });
45213
- object({
45214
- id: string(),
45215
- label: string(),
45216
- isAdmin: boolean().default(false),
45217
- allowedProviders: AllowedProviderSchema,
45218
- allowedDevices: AllowedDevicesSchema,
45219
- tokenHash: string(),
45220
- tokenPrefix: string(),
45221
- createdAt: number(),
45222
- lastUsedAt: number().optional()
45223
- });
45224
- object({
45225
- id: string(),
45226
- userId: string(),
45227
- name: string(),
45228
- tokenHash: string(),
45229
- tokenPrefix: string(),
45230
- scopes: array(TokenScopeSchema),
45231
- expiresAt: number().nullish(),
45232
- lastUsedAt: number().nullish(),
45233
- createdAt: number()
45234
- });
45235
- /**
45236
45288
  * `oauth-integration` — a collection cap by which an addon declares
45237
45289
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
45238
45290
  * Each provider returns a static descriptor; the core enumerates them
@@ -52078,7 +52130,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
52078
52130
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
52079
52131
  kind: "mutation",
52080
52132
  auth: "admin"
52081
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
52133
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
52134
+ clear: boolean(),
52135
+ repointLocationId: string().optional()
52136
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
52082
52137
  kind: "mutation",
52083
52138
  auth: "admin"
52084
52139
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -56342,6 +56397,11 @@ onStatusChanged: { data: object({
56342
56397
  *
56343
56398
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
56344
56399
  * provider refreshes the slice on an interval and eagerly after commands.
56400
+ *
56401
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
56402
+ * nullable: `null` means "not known right now" (the appliance has not said,
56403
+ * the link is down, or the description does not carry it) and is never
56404
+ * rendered or exported as `false` / `0`. `availability` says why.
56345
56405
  */
56346
56406
  var DishwasherStateSchema = _enum([
56347
56407
  "idle",
@@ -56351,43 +56411,155 @@ var DishwasherStateSchema = _enum([
56351
56411
  "error",
56352
56412
  "unavailable"
56353
56413
  ]);
56414
+ /**
56415
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
56416
+ * view for compact surfaces; this is what the appliance said.
56417
+ */
56418
+ var DishwasherOperationStateSchema = _enum([
56419
+ "Inactive",
56420
+ "Ready",
56421
+ "DelayedStart",
56422
+ "Run",
56423
+ "Pause",
56424
+ "ActionRequired",
56425
+ "Finished",
56426
+ "Error",
56427
+ "Aborting"
56428
+ ]);
56429
+ /**
56430
+ * Why fields may be `null`:
56431
+ * - `available` — the link is up and the description is loaded;
56432
+ * - `offline` — the local link is down (values are unknown, not last-known);
56433
+ * - `description-missing` — the link is up but the appliance's description could not
56434
+ * be loaded, so its values cannot be decoded.
56435
+ */
56436
+ var DishwasherAvailabilitySchema = _enum([
56437
+ "available",
56438
+ "offline",
56439
+ "description-missing"
56440
+ ]);
56354
56441
  var DishwasherConsumableLevelSchema = _enum([
56355
56442
  "ok",
56356
56443
  "low",
56357
56444
  "empty"
56358
56445
  ]);
56359
56446
  var DishwasherStatusSchema = object({
56447
+ availability: DishwasherAvailabilitySchema,
56448
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
56360
56449
  state: DishwasherStateSchema,
56361
- /** Active program id/name, or null when none selected / unknown. */
56450
+ /** The appliance's operation state as reported; null when not known. */
56451
+ operationState: DishwasherOperationStateSchema.nullable(),
56452
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
56362
56453
  program: string().nullable(),
56363
- /** Program tokens the hardware accepts — drives the UI selector. */
56454
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
56455
+ selectedProgram: string().nullable(),
56456
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
56364
56457
  availablePrograms: array(string()),
56365
- /** Minutes remaining on the active cycle, or null when not running. */
56366
- remainingMinutes: number().int().nonnegative().nullable(),
56458
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
56459
+ remainingSeconds: number().int().nonnegative().nullable(),
56460
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
56461
+ delayedStartSeconds: number().int().nonnegative().nullable(),
56367
56462
  /** Cycle completion 0..100, or null when not applicable. */
56368
56463
  progressPercent: number().min(0).max(100).nullable(),
56369
- /** True when the door is reported open. */
56370
- doorOpen: boolean(),
56371
- /** True when remote start is allowed (door closed, power on, etc.). */
56372
- remoteStartAllowed: boolean(),
56373
- /** Main power / switched-on state. */
56374
- powerOn: boolean(),
56464
+ /** True when the door is reported open; null when the door state is not known. */
56465
+ doorOpen: boolean().nullable(),
56466
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
56467
+ doorLocked: boolean().nullable(),
56468
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
56469
+ remoteStartAllowed: boolean().nullable(),
56470
+ /** True when the appliance accepts remote control now; null when not known. */
56471
+ remoteControlActive: boolean().nullable(),
56472
+ /** True while somebody operates the appliance at its panel; null when not reported. */
56473
+ localControlActive: boolean().nullable(),
56474
+ /** Main power / switched-on state; null when not known. */
56475
+ powerOn: boolean().nullable(),
56476
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
56477
+ powerState: string().nullable(),
56375
56478
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
56376
56479
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
56377
- halfLoad: boolean(),
56378
- hygienePlus: boolean(),
56480
+ /** Option states: null when the appliance does not expose the option or has not said. */
56481
+ halfLoad: boolean().nullable(),
56482
+ hygienePlus: boolean().nullable(),
56379
56483
  /** Extra dry option when the appliance exposes it. */
56380
- extraDry: boolean(),
56484
+ extraDry: boolean().nullable(),
56381
56485
  /** Intensive zone (lower basket) when the appliance exposes it. */
56382
- intensiveZone: boolean(),
56486
+ intensiveZone: boolean().nullable(),
56383
56487
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
56384
- varioSpeedPlus: boolean(),
56385
- /** Child lock (controls disabled on the appliance). */
56386
- childLock: boolean(),
56488
+ varioSpeedPlus: boolean().nullable(),
56489
+ /** Child lock (controls disabled on the appliance); null when not known. */
56490
+ childLock: boolean().nullable(),
56491
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
56492
+ activeEvents: array(string()),
56493
+ /** Numeric error code when the appliance reports one; null otherwise. */
56387
56494
  errorCode: number().nullable(),
56495
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
56388
56496
  errorLabel: string().nullable(),
56497
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
56389
56498
  lastFetchedAt: number()
56390
56499
  });
56500
+ var DeviceIdSchema = number().int().nonnegative();
56501
+ /** A value a program option or setting can take. */
56502
+ var DishwasherValueSchema = union([
56503
+ boolean(),
56504
+ string(),
56505
+ number()
56506
+ ]);
56507
+ var DishwasherAccessSchema = _enum([
56508
+ "none",
56509
+ "read",
56510
+ "readWrite",
56511
+ "writeOnly",
56512
+ "readStatic"
56513
+ ]);
56514
+ /**
56515
+ * One option or setting the appliance declares, with the constraints its description
56516
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
56517
+ */
56518
+ var DishwasherOptionDescriptorSchema = object({
56519
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
56520
+ key: string(),
56521
+ /** Last segment of the key, for display. */
56522
+ name: string(),
56523
+ type: _enum([
56524
+ "boolean",
56525
+ "number",
56526
+ "enum",
56527
+ "string"
56528
+ ]),
56529
+ access: DishwasherAccessSchema,
56530
+ /** The appliance reports this entity as currently available. */
56531
+ available: boolean(),
56532
+ /** Unit the description declares for a number; null when it declares none. */
56533
+ unit: string().nullable(),
56534
+ min: number().nullable(),
56535
+ max: number().nullable(),
56536
+ step: number().nullable(),
56537
+ /** Allowed members of an enum; null for other types. */
56538
+ enumValues: array(string()).nullable(),
56539
+ defaultValue: DishwasherValueSchema.nullable()
56540
+ });
56541
+ var DishwasherProgramSchema = object({
56542
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
56543
+ key: string(),
56544
+ name: string(),
56545
+ /** The appliance currently offers this program. */
56546
+ available: boolean(),
56547
+ /** The options this program lists, with the program-level access / availability / default. */
56548
+ options: array(DishwasherOptionDescriptorSchema)
56549
+ });
56550
+ var DishwasherOptionsSchema = object({
56551
+ availability: DishwasherAvailabilitySchema,
56552
+ /** What the appliance can be told to do, from the commands its description declares. */
56553
+ supportsStart: boolean(),
56554
+ supportsPause: boolean(),
56555
+ supportsResume: boolean(),
56556
+ supportsStop: boolean(),
56557
+ supportsPower: boolean(),
56558
+ /** Every program the description lists, with its options. */
56559
+ programs: array(DishwasherProgramSchema),
56560
+ /** Every option and setting entity the description lists (programs reference these by key). */
56561
+ options: array(DishwasherOptionDescriptorSchema)
56562
+ });
56391
56563
  var dishwasherCapability = {
56392
56564
  name: "dishwasher",
56393
56565
  scope: "device",
@@ -56395,86 +56567,102 @@ var dishwasherCapability = {
56395
56567
  mode: "singleton",
56396
56568
  deviceTypes: [DeviceType.Dishwasher],
56397
56569
  methods: {
56398
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56570
+ /**
56571
+ * Start a program. Without `program` the selected one starts. `options` are
56572
+ * option feature keys; each is checked against the program's constraints.
56573
+ */
56574
+ start: method(object({
56575
+ deviceId: DeviceIdSchema,
56576
+ program: string().min(1).optional(),
56577
+ options: record(string(), DishwasherValueSchema).optional()
56578
+ }), _void(), {
56399
56579
  kind: "mutation",
56400
56580
  auth: "protected"
56401
56581
  }),
56402
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56582
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
56403
56583
  kind: "mutation",
56404
56584
  auth: "protected"
56405
56585
  }),
56406
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56586
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
56587
+ kind: "mutation",
56588
+ auth: "protected"
56589
+ }),
56590
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
56407
56591
  kind: "mutation",
56408
56592
  auth: "protected"
56409
56593
  }),
56594
+ /** Select (not start) a program; refused when the appliance does not offer it. */
56410
56595
  setProgram: method(object({
56411
- deviceId: number().int().nonnegative(),
56596
+ deviceId: DeviceIdSchema,
56412
56597
  program: string().min(1)
56413
56598
  }), _void(), {
56414
56599
  kind: "mutation",
56415
56600
  auth: "protected"
56416
56601
  }),
56417
56602
  setPower: method(object({
56418
- deviceId: number().int().nonnegative(),
56603
+ deviceId: DeviceIdSchema,
56419
56604
  on: boolean()
56420
56605
  }), _void(), {
56421
56606
  kind: "mutation",
56422
56607
  auth: "protected"
56423
56608
  }),
56424
56609
  setHalfLoad: method(object({
56425
- deviceId: number().int().nonnegative(),
56610
+ deviceId: DeviceIdSchema,
56426
56611
  on: boolean()
56427
56612
  }), _void(), {
56428
56613
  kind: "mutation",
56429
56614
  auth: "protected"
56430
56615
  }),
56431
56616
  setHygienePlus: method(object({
56432
- deviceId: number().int().nonnegative(),
56617
+ deviceId: DeviceIdSchema,
56433
56618
  on: boolean()
56434
56619
  }), _void(), {
56435
56620
  kind: "mutation",
56436
56621
  auth: "protected"
56437
56622
  }),
56438
56623
  setExtraDry: method(object({
56439
- deviceId: number().int().nonnegative(),
56624
+ deviceId: DeviceIdSchema,
56440
56625
  on: boolean()
56441
56626
  }), _void(), {
56442
56627
  kind: "mutation",
56443
56628
  auth: "protected"
56444
56629
  }),
56445
56630
  setIntensiveZone: method(object({
56446
- deviceId: number().int().nonnegative(),
56631
+ deviceId: DeviceIdSchema,
56447
56632
  on: boolean()
56448
56633
  }), _void(), {
56449
56634
  kind: "mutation",
56450
56635
  auth: "protected"
56451
56636
  }),
56452
56637
  setVarioSpeedPlus: method(object({
56453
- deviceId: number().int().nonnegative(),
56638
+ deviceId: DeviceIdSchema,
56454
56639
  on: boolean()
56455
56640
  }), _void(), {
56456
56641
  kind: "mutation",
56457
56642
  auth: "protected"
56458
56643
  }),
56459
56644
  setChildLock: method(object({
56460
- deviceId: number().int().nonnegative(),
56645
+ deviceId: DeviceIdSchema,
56461
56646
  on: boolean()
56462
56647
  }), _void(), {
56463
56648
  kind: "mutation",
56464
56649
  auth: "protected"
56465
56650
  }),
56651
+ /**
56652
+ * Write any option or setting by feature key. Refused when the description does
56653
+ * not list it, it is not writable or not available now, or the value is outside
56654
+ * its declared range / members.
56655
+ */
56466
56656
  setOption: method(object({
56467
- deviceId: number().int().nonnegative(),
56657
+ deviceId: DeviceIdSchema,
56468
56658
  key: string().min(1),
56469
- value: union([
56470
- boolean(),
56471
- string(),
56472
- number()
56473
- ])
56659
+ value: DishwasherValueSchema
56474
56660
  }), _void(), {
56475
56661
  kind: "mutation",
56476
56662
  auth: "protected"
56477
- })
56663
+ }),
56664
+ /** What this appliance can do, from its own description — the UI is derived from it. */
56665
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
56478
56666
  },
56479
56667
  status: {
56480
56668
  schema: DishwasherStatusSchema,
@@ -70423,6 +70611,12 @@ Object.freeze({
70423
70611
  addonId: null,
70424
70612
  access: "view"
70425
70613
  },
70614
+ "dishwasher.getOptions": {
70615
+ capName: "dishwasher",
70616
+ capScope: "device",
70617
+ addonId: null,
70618
+ access: "view"
70619
+ },
70426
70620
  "dishwasher.getStatus": {
70427
70621
  capName: "dishwasher",
70428
70622
  capScope: "device",
@@ -70435,6 +70629,12 @@ Object.freeze({
70435
70629
  addonId: null,
70436
70630
  access: "create"
70437
70631
  },
70632
+ "dishwasher.resume": {
70633
+ capName: "dishwasher",
70634
+ capScope: "device",
70635
+ addonId: null,
70636
+ access: "create"
70637
+ },
70438
70638
  "dishwasher.setChildLock": {
70439
70639
  capName: "dishwasher",
70440
70640
  capScope: "device",
@@ -74935,6 +75135,12 @@ Object.freeze({
74935
75135
  addonId: null,
74936
75136
  access: "view"
74937
75137
  },
75138
+ "storageMigration.moverClearance": {
75139
+ capName: "storage-migration",
75140
+ capScope: "system",
75141
+ addonId: null,
75142
+ access: "view"
75143
+ },
74938
75144
  "storageMigration.movers": {
74939
75145
  capName: "storage-migration",
74940
75146
  capScope: "system",
@@ -77128,6 +77334,11 @@ Object.freeze({
77128
77334
  form: "single",
77129
77335
  optional: false
77130
77336
  }],
77337
+ "dishwasher.getOptions": [{
77338
+ name: "deviceId",
77339
+ form: "single",
77340
+ optional: false
77341
+ }],
77131
77342
  "dishwasher.getStatus": [{
77132
77343
  name: "deviceId",
77133
77344
  form: "single",
@@ -77138,6 +77349,11 @@ Object.freeze({
77138
77349
  form: "single",
77139
77350
  optional: false
77140
77351
  }],
77352
+ "dishwasher.resume": [{
77353
+ name: "deviceId",
77354
+ form: "single",
77355
+ optional: false
77356
+ }],
77141
77357
  "dishwasher.setChildLock": [{
77142
77358
  name: "deviceId",
77143
77359
  form: "single",
@@ -79224,6 +79440,9 @@ new Map(Object.entries({
79224
79440
  "wrapper-update-available": "system",
79225
79441
  "backup-completed": "system",
79226
79442
  "export-completed": "system",
79443
+ "alert-critical": "system",
79444
+ "alert-error": "system",
79445
+ "alert-critical-resolved": "system",
79227
79446
  "storage-location-low": "system",
79228
79447
  "storage-location-critical": "system",
79229
79448
  "storage-location-ok": "system",
@@ -79348,6 +79567,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
79348
79567
  "storage-location-ok"
79349
79568
  ]
79350
79569
  },
79570
+ {
79571
+ id: "alerts",
79572
+ family: "system",
79573
+ label: "Alerts",
79574
+ kinds: [
79575
+ "alert-critical",
79576
+ "alert-error",
79577
+ "alert-critical-resolved"
79578
+ ]
79579
+ },
79351
79580
  {
79352
79581
  id: "alarm",
79353
79582
  family: "alarm",
@@ -79392,6 +79621,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
79392
79621
  return [[descriptor.kind, field]];
79393
79622
  })));
79394
79623
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
79624
+ object({
79625
+ phase: _enum(["raised", "resolved"]),
79626
+ episodeId: string().min(1),
79627
+ alertId: string().min(1),
79628
+ severity: AlertSeveritySchema,
79629
+ category: string(),
79630
+ title: string(),
79631
+ message: string(),
79632
+ sourceType: string().optional(),
79633
+ sourceId: string().optional(),
79634
+ nodeId: string().optional(),
79635
+ /** The alert's own action link (where the operator acts on it), when it has one. */
79636
+ actionUrl: string().optional(),
79637
+ at: number()
79638
+ });
79395
79639
  var RULE_BODY_ONLY = ["body"];
79396
79640
  var RULE_TEXT = ["title", "body"];
79397
79641
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -79401,6 +79645,11 @@ var TANK = [
79401
79645
  "device-tank-full",
79402
79646
  "device-tank-normal"
79403
79647
  ];
79648
+ var ALERT_EPISODE = [
79649
+ "alert-critical",
79650
+ "alert-error",
79651
+ "alert-critical-resolved"
79652
+ ];
79404
79653
  var UPDATES = [
79405
79654
  "addon-update-available",
79406
79655
  "server-update-available",
@@ -79593,14 +79842,14 @@ var STATE_SUMMARY_VARS = [
79593
79842
  ([...RULE_TEXT], [...CONSUMABLE]),
79594
79843
  ([...RULE_TEXT], [...TANK]),
79595
79844
  [...RULE_TEXT],
79596
- ([...RULE_TEXT], [...UPDATES]),
79597
- ([...RULE_TEXT], [...UPDATES]),
79598
- [...RULE_TEXT],
79845
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79846
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
79599
79847
  [...RULE_TEXT],
79600
79848
  [...RULE_TEXT],
79601
79849
  [...RULE_TEXT],
79602
79850
  [...RULE_TEXT],
79603
79851
  [...RULE_TEXT],
79852
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79604
79853
  [...RULE_TEXT],
79605
79854
  [...RULE_TEXT],
79606
79855
  [...RULE_TEXT],
@@ -79618,7 +79867,11 @@ var STATE_SUMMARY_VARS = [
79618
79867
  [...RULE_TEXT],
79619
79868
  [...RULE_TEXT],
79620
79869
  [...RULE_TEXT],
79621
- [...RULE_TEXT],
79870
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79871
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79872
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79873
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79874
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
79622
79875
  [...RULE_TEXT],
79623
79876
  [...RULE_TEXT],
79624
79877
  [...RULE_TEXT],