@camstack/addon-provider-hikvision 1.2.154 → 1.2.156

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
@@ -13,7 +13,7 @@ import { Agent as Agent$1, request as request$1 } from "node:https";
13
13
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
14
14
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
15
15
  //#endregion
16
- //#region ../types/dist/event-category-BvOFi6PY.mjs
16
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
17
17
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
18
18
  EventCategory["SystemBoot"] = "system.boot";
19
19
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -92,9 +92,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
92
92
  /**
93
93
  * The node's one-shot runner boot check (D877): planned runners against the
94
94
  * process service, `degraded` when any is failed, refused or missing. The
95
- * alert centre turns it into one alert and a direct critical push.
95
+ * alert centre turns it into one critical alert.
96
96
  */
97
97
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
98
+ /**
99
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
100
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
101
+ * centre sends no notification of its own: Notification Center turns this
102
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
103
+ * system-event kinds, and reconciles from the alerts store because a bus
104
+ * event may be dropped (D8, D11).
105
+ */
106
+ EventCategory["AlertEpisode"] = "alert.episode";
98
107
  EventCategory["AddonError"] = "addon.error";
99
108
  EventCategory["AddonPageReady"] = "addon.page-ready";
100
109
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5419,7 +5428,7 @@ var ZodIssueCode = {
5419
5428
  var ZodFirstPartyTypeKind;
5420
5429
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5421
5430
  //#endregion
5422
- //#region ../types/dist/sleep-BegKjwUu.mjs
5431
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5423
5432
  /**
5424
5433
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5425
5434
  * window to float samples (D455).
@@ -7801,6 +7810,12 @@ function normalizeAddonInitResult(result) {
7801
7810
  if (Array.isArray(result)) return { providers: result };
7802
7811
  return result;
7803
7812
  }
7813
+ /**
7814
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7815
+ * and validates them (`share-token.service.ts` builds its enum from this
7816
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7817
+ */
7818
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7804
7819
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7805
7820
  var PeerBytesTicketSchema = object({
7806
7821
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12783,6 +12798,229 @@ var ConvertResultSchema = object({
12783
12798
  files: array(string()).readonly()
12784
12799
  })).readonly()
12785
12800
  });
12801
+ /**
12802
+ * Zod schemas for persisted record types.
12803
+ *
12804
+ * These schemas serve as the single source of truth for types that are
12805
+ * stored in the settings-store backend and retrieved via tRPC. They
12806
+ * replace the manual TypeScript interfaces with schema-derived types,
12807
+ * enabling runtime validation when reading from the backend.
12808
+ *
12809
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12810
+ * keeps the original name for backward compatibility.
12811
+ */
12812
+ /**
12813
+ * Auth model (v2 — 2026-05-12 caps-only):
12814
+ *
12815
+ * Two principals:
12816
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12817
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12818
+ *
12819
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12820
+ * `super_admin` — collapsed onto the single boolean because every
12821
+ * non-admin caller is governed by the same scope-check rules; the
12822
+ * distinction was only ever used to route role-specific procedures
12823
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12824
+ * with `isAdmin: false` + an explicit scope list.
12825
+ */
12826
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12827
+ var MethodAccessSchema = _enum([
12828
+ "view",
12829
+ "create",
12830
+ "delete"
12831
+ ]);
12832
+ /**
12833
+ * A single scope grant. Three forms — checked in matcher with OR
12834
+ * semantics; the first match decides whether the call passes:
12835
+ *
12836
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12837
+ * cap with the matching `scope` declaration. New caps inherit grants
12838
+ * automatically — adding a device cap to the codebase makes it
12839
+ * reachable to every user with `category:device [...]` without a
12840
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12841
+ *
12842
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12843
+ * useful when an integration needs to interact with one specific
12844
+ * addon's surface regardless of how many caps it exports.
12845
+ *
12846
+ * - `capability` — the most precise form. Single cap name. Use for
12847
+ * integration tokens where you want to grant `addons.installPackage`
12848
+ * and nothing else.
12849
+ *
12850
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12851
+ * "give me everything" escape; there is no wildcard scope.
12852
+ */
12853
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12854
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12855
+ var CapScopeSchema = _enum(["device", "system"]);
12856
+ /**
12857
+ * DeviceSelector (scope model v3 — 2026-08-12).
12858
+ *
12859
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12860
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12861
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12862
+ * AFTER the grant was minted — no re-grant, no re-login.
12863
+ *
12864
+ * - `all` — every device in the deployment. The broad viewer/operator
12865
+ * lever without a `category` grant (a `category` grant also covers device
12866
+ * caps that carry no deviceId; `all` is specifically the device set).
12867
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12868
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12869
+ * is NOT covered until the grant is edited.
12870
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12871
+ * DYNAMIC. A device that changes type, or a new device of the type,
12872
+ * re-resolves on the next request.
12873
+ * - `locations` — every device whose operator-assigned `location` label is
12874
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12875
+ * null/unset location matches NO `locations` selector.
12876
+ */
12877
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12878
+ object({ kind: literal("all") }),
12879
+ object({
12880
+ kind: literal("ids"),
12881
+ ids: array(number().int()).min(1)
12882
+ }),
12883
+ object({
12884
+ kind: literal("types"),
12885
+ types: array(_enum(DeviceType)).min(1)
12886
+ }),
12887
+ object({
12888
+ kind: literal("locations"),
12889
+ locations: array(string().min(1)).min(1)
12890
+ })
12891
+ ]);
12892
+ var DeviceTokenScopeSchema = object({
12893
+ type: literal("device"),
12894
+ /** The device SET this grant covers — resolved against the live fleet. */
12895
+ selector: DeviceSelectorSchema,
12896
+ access: array(MethodAccessSchema).min(1),
12897
+ /**
12898
+ * Whether a grant on a PARENT device transparently covers its accessory
12899
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12900
+ * Direction is parent → children ONLY.
12901
+ *
12902
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12903
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12904
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12905
+ * operator must grant on the child, not inherit from the parent). Set it
12906
+ * explicitly to override that default per grant.
12907
+ */
12908
+ includeLinked: boolean().optional()
12909
+ });
12910
+ /**
12911
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12912
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12913
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12914
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12915
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12916
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12917
+ * migration cannot reach a JWT already in a client's hands; parse-time
12918
+ * migration covers both without a flag day. No cast — the raw object is read
12919
+ * through `Reflect.get` (its static type is `unknown`).
12920
+ */
12921
+ function migrateLegacyTokenScope(raw) {
12922
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12923
+ if (Reflect.get(raw, "type") !== "device") return raw;
12924
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12925
+ const targets = Reflect.get(raw, "targets");
12926
+ if (!Array.isArray(targets)) return raw;
12927
+ return {
12928
+ type: "device",
12929
+ selector: {
12930
+ kind: "ids",
12931
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12932
+ },
12933
+ access: Reflect.get(raw, "access")
12934
+ };
12935
+ }
12936
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12937
+ object({
12938
+ type: literal("category"),
12939
+ target: CapScopeSchema,
12940
+ access: array(MethodAccessSchema).min(1)
12941
+ }),
12942
+ object({
12943
+ type: literal("capability"),
12944
+ target: string(),
12945
+ access: array(MethodAccessSchema).min(1)
12946
+ }),
12947
+ object({
12948
+ type: literal("addon"),
12949
+ target: string(),
12950
+ access: array(MethodAccessSchema).min(1)
12951
+ }),
12952
+ DeviceTokenScopeSchema
12953
+ ]));
12954
+ object({
12955
+ id: string(),
12956
+ username: string(),
12957
+ passwordHash: string(),
12958
+ /**
12959
+ * Admin bypass. When true, the middleware skips the scope-access
12960
+ * check entirely. There is no other axis of privilege; the legacy
12961
+ * role enum collapsed onto this boolean in v2.
12962
+ */
12963
+ isAdmin: boolean().default(false),
12964
+ allowedProviders: AllowedProviderSchema,
12965
+ allowedDevices: AllowedDevicesSchema,
12966
+ /**
12967
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12968
+ * ignored. Non-admins without scopes are locked out of every
12969
+ * protected call.
12970
+ */
12971
+ scopes: array(TokenScopeSchema).default([]),
12972
+ createdAt: number(),
12973
+ updatedAt: number()
12974
+ });
12975
+ object({
12976
+ id: string(),
12977
+ label: string(),
12978
+ isAdmin: boolean().default(false),
12979
+ allowedProviders: AllowedProviderSchema,
12980
+ allowedDevices: AllowedDevicesSchema,
12981
+ tokenHash: string(),
12982
+ tokenPrefix: string(),
12983
+ createdAt: number(),
12984
+ lastUsedAt: number().optional()
12985
+ });
12986
+ object({
12987
+ id: string(),
12988
+ userId: string(),
12989
+ name: string(),
12990
+ tokenHash: string(),
12991
+ tokenPrefix: string(),
12992
+ scopes: array(TokenScopeSchema),
12993
+ expiresAt: number().nullish(),
12994
+ lastUsedAt: number().nullish(),
12995
+ createdAt: number()
12996
+ });
12997
+ /** What a share-view grant lets its holder see. */
12998
+ var ShareViewGrantSchema = object({
12999
+ kind: _enum(SHARE_VIEW_KINDS),
13000
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
13001
+ /** Talk-back, opt-in at mint time; absent means off. */
13002
+ talk: boolean().optional()
13003
+ });
13004
+ var ShareViewScopeSchema = object({
13005
+ type: literal("share-view"),
13006
+ grant: ShareViewGrantSchema
13007
+ });
13008
+ var AddonRoutesScopeSchema = object({
13009
+ type: literal("addon-routes"),
13010
+ access: array(MethodAccessSchema).min(1)
13011
+ });
13012
+ var CredentialScopeSchema = union([
13013
+ literal("*"),
13014
+ ShareViewScopeSchema,
13015
+ AddonRoutesScopeSchema,
13016
+ TokenScopeSchema
13017
+ ]);
13018
+ object({
13019
+ kind: literal("credential"),
13020
+ sub: string().min(1),
13021
+ jti: string().min(16),
13022
+ scopes: array(CredentialScopeSchema).min(1)
13023
+ });
12786
13024
  _enum(["new-session", "step-up"]);
12787
13025
  /** The languages the hub's app landing pages are written in (D858). */
12788
13026
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13499,7 +13737,14 @@ var AlertSeveritySchema = _enum([
13499
13737
  ]);
13500
13738
  var AlertActionSchema = object({
13501
13739
  label: string(),
13502
- href: string().optional()
13740
+ href: string().optional(),
13741
+ /**
13742
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13743
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13744
+ * start) — the browser must leave the SPA with a full navigation, because
13745
+ * the SPA has no such route and would bounce to the home page.
13746
+ */
13747
+ navigation: _enum(["app", "server"]).optional()
13503
13748
  });
13504
13749
  var AlertStatusSchema = _enum([
13505
13750
  "active",
@@ -42347,6 +42592,9 @@ var NcSystemEventKindSchema = _enum([
42347
42592
  "server-updated",
42348
42593
  "export-completed",
42349
42594
  "backup-completed",
42595
+ "alert-critical",
42596
+ "alert-error",
42597
+ "alert-critical-resolved",
42350
42598
  "camera-online",
42351
42599
  "camera-offline",
42352
42600
  "camera-disabled",
@@ -44382,202 +44630,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
44382
44630
  auth: "admin"
44383
44631
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
44384
44632
  /**
44385
- * Zod schemas for persisted record types.
44386
- *
44387
- * These schemas serve as the single source of truth for types that are
44388
- * stored in the settings-store backend and retrieved via tRPC. They
44389
- * replace the manual TypeScript interfaces with schema-derived types,
44390
- * enabling runtime validation when reading from the backend.
44391
- *
44392
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
44393
- * keeps the original name for backward compatibility.
44394
- */
44395
- /**
44396
- * Auth model (v2 — 2026-05-12 caps-only):
44397
- *
44398
- * Two principals:
44399
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
44400
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
44401
- *
44402
- * No role enum. There used to be `viewer / agent / scoped` and earlier
44403
- * `super_admin` — collapsed onto the single boolean because every
44404
- * non-admin caller is governed by the same scope-check rules; the
44405
- * distinction was only ever used to route role-specific procedures
44406
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
44407
- * with `isAdmin: false` + an explicit scope list.
44408
- */
44409
- /** Per-method access flavour. Materialised on every cap method via codegen. */
44410
- var MethodAccessSchema = _enum([
44411
- "view",
44412
- "create",
44413
- "delete"
44414
- ]);
44415
- /**
44416
- * A single scope grant. Three forms — checked in matcher with OR
44417
- * semantics; the first match decides whether the call passes:
44418
- *
44419
- * - `category` — broadest. `target: 'device' | 'system'` selects every
44420
- * cap with the matching `scope` declaration. New caps inherit grants
44421
- * automatically — adding a device cap to the codebase makes it
44422
- * reachable to every user with `category:device [...]` without a
44423
- * re-grant. Use this for "family viewer" / "operator" tiers.
44424
- *
44425
- * - `addon` — every cap that ships inside a given addon id. Niche;
44426
- * useful when an integration needs to interact with one specific
44427
- * addon's surface regardless of how many caps it exports.
44428
- *
44429
- * - `capability` — the most precise form. Single cap name. Use for
44430
- * integration tokens where you want to grant `addons.installPackage`
44431
- * and nothing else.
44432
- *
44433
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
44434
- * "give me everything" escape; there is no wildcard scope.
44435
- */
44436
- var AllowedProviderSchema = union([literal("*"), array(string())]);
44437
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
44438
- var CapScopeSchema = _enum(["device", "system"]);
44439
- /**
44440
- * DeviceSelector (scope model v3 — 2026-08-12).
44441
- *
44442
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
44443
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
44444
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
44445
- * AFTER the grant was minted — no re-grant, no re-login.
44446
- *
44447
- * - `all` — every device in the deployment. The broad viewer/operator
44448
- * lever without a `category` grant (a `category` grant also covers device
44449
- * caps that carry no deviceId; `all` is specifically the device set).
44450
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
44451
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
44452
- * is NOT covered until the grant is edited.
44453
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
44454
- * DYNAMIC. A device that changes type, or a new device of the type,
44455
- * re-resolves on the next request.
44456
- * - `locations` — every device whose operator-assigned `location` label is
44457
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
44458
- * null/unset location matches NO `locations` selector.
44459
- */
44460
- var DeviceSelectorSchema = discriminatedUnion("kind", [
44461
- object({ kind: literal("all") }),
44462
- object({
44463
- kind: literal("ids"),
44464
- ids: array(number().int()).min(1)
44465
- }),
44466
- object({
44467
- kind: literal("types"),
44468
- types: array(_enum(DeviceType)).min(1)
44469
- }),
44470
- object({
44471
- kind: literal("locations"),
44472
- locations: array(string().min(1)).min(1)
44473
- })
44474
- ]);
44475
- var DeviceTokenScopeSchema = object({
44476
- type: literal("device"),
44477
- /** The device SET this grant covers — resolved against the live fleet. */
44478
- selector: DeviceSelectorSchema,
44479
- access: array(MethodAccessSchema).min(1),
44480
- /**
44481
- * Whether a grant on a PARENT device transparently covers its accessory
44482
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
44483
- * Direction is parent → children ONLY.
44484
- *
44485
- * Absent → the matcher DERIVES it from the access flavour: `view`
44486
- * inherits (a camera viewer sees the camera's accessories), `create` /
44487
- * `delete` do NOT (actuating/removing a child is an explicit act the
44488
- * operator must grant on the child, not inherit from the parent). Set it
44489
- * explicitly to override that default per grant.
44490
- */
44491
- includeLinked: boolean().optional()
44492
- });
44493
- /**
44494
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
44495
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
44496
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
44497
- * EVERY parse path — stored records AND the JWT-carried scope arrays
44498
- * normalised at the request boundary ({@link normalizeTokenScopes} in
44499
- * `device-selector.ts`). Chosen over a one-time DB migration because a
44500
- * migration cannot reach a JWT already in a client's hands; parse-time
44501
- * migration covers both without a flag day. No cast — the raw object is read
44502
- * through `Reflect.get` (its static type is `unknown`).
44503
- */
44504
- function migrateLegacyTokenScope(raw) {
44505
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
44506
- if (Reflect.get(raw, "type") !== "device") return raw;
44507
- if (Reflect.get(raw, "selector") !== void 0) return raw;
44508
- const targets = Reflect.get(raw, "targets");
44509
- if (!Array.isArray(targets)) return raw;
44510
- return {
44511
- type: "device",
44512
- selector: {
44513
- kind: "ids",
44514
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44515
- },
44516
- access: Reflect.get(raw, "access")
44517
- };
44518
- }
44519
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44520
- object({
44521
- type: literal("category"),
44522
- target: CapScopeSchema,
44523
- access: array(MethodAccessSchema).min(1)
44524
- }),
44525
- object({
44526
- type: literal("capability"),
44527
- target: string(),
44528
- access: array(MethodAccessSchema).min(1)
44529
- }),
44530
- object({
44531
- type: literal("addon"),
44532
- target: string(),
44533
- access: array(MethodAccessSchema).min(1)
44534
- }),
44535
- DeviceTokenScopeSchema
44536
- ]));
44537
- object({
44538
- id: string(),
44539
- username: string(),
44540
- passwordHash: string(),
44541
- /**
44542
- * Admin bypass. When true, the middleware skips the scope-access
44543
- * check entirely. There is no other axis of privilege; the legacy
44544
- * role enum collapsed onto this boolean in v2.
44545
- */
44546
- isAdmin: boolean().default(false),
44547
- allowedProviders: AllowedProviderSchema,
44548
- allowedDevices: AllowedDevicesSchema,
44549
- /**
44550
- * Scopes granted to this user. Admins bypass; their `scopes` is
44551
- * ignored. Non-admins without scopes are locked out of every
44552
- * protected call.
44553
- */
44554
- scopes: array(TokenScopeSchema).default([]),
44555
- createdAt: number(),
44556
- updatedAt: number()
44557
- });
44558
- object({
44559
- id: string(),
44560
- label: string(),
44561
- isAdmin: boolean().default(false),
44562
- allowedProviders: AllowedProviderSchema,
44563
- allowedDevices: AllowedDevicesSchema,
44564
- tokenHash: string(),
44565
- tokenPrefix: string(),
44566
- createdAt: number(),
44567
- lastUsedAt: number().optional()
44568
- });
44569
- object({
44570
- id: string(),
44571
- userId: string(),
44572
- name: string(),
44573
- tokenHash: string(),
44574
- tokenPrefix: string(),
44575
- scopes: array(TokenScopeSchema),
44576
- expiresAt: number().nullish(),
44577
- lastUsedAt: number().nullish(),
44578
- createdAt: number()
44579
- });
44580
- /**
44581
44633
  * `oauth-integration` — a collection cap by which an addon declares
44582
44634
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44583
44635
  * Each provider returns a static descriptor; the core enumerates them
@@ -51527,7 +51579,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
51527
51579
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
51528
51580
  kind: "mutation",
51529
51581
  auth: "admin"
51530
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51582
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51583
+ clear: boolean(),
51584
+ repointLocationId: string().optional()
51585
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51531
51586
  kind: "mutation",
51532
51587
  auth: "admin"
51533
51588
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -56201,6 +56256,11 @@ onStatusChanged: { data: object({
56201
56256
  *
56202
56257
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
56203
56258
  * provider refreshes the slice on an interval and eagerly after commands.
56259
+ *
56260
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
56261
+ * nullable: `null` means "not known right now" (the appliance has not said,
56262
+ * the link is down, or the description does not carry it) and is never
56263
+ * rendered or exported as `false` / `0`. `availability` says why.
56204
56264
  */
56205
56265
  var DishwasherStateSchema = _enum([
56206
56266
  "idle",
@@ -56210,43 +56270,155 @@ var DishwasherStateSchema = _enum([
56210
56270
  "error",
56211
56271
  "unavailable"
56212
56272
  ]);
56273
+ /**
56274
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
56275
+ * view for compact surfaces; this is what the appliance said.
56276
+ */
56277
+ var DishwasherOperationStateSchema = _enum([
56278
+ "Inactive",
56279
+ "Ready",
56280
+ "DelayedStart",
56281
+ "Run",
56282
+ "Pause",
56283
+ "ActionRequired",
56284
+ "Finished",
56285
+ "Error",
56286
+ "Aborting"
56287
+ ]);
56288
+ /**
56289
+ * Why fields may be `null`:
56290
+ * - `available` — the link is up and the description is loaded;
56291
+ * - `offline` — the local link is down (values are unknown, not last-known);
56292
+ * - `description-missing` — the link is up but the appliance's description could not
56293
+ * be loaded, so its values cannot be decoded.
56294
+ */
56295
+ var DishwasherAvailabilitySchema = _enum([
56296
+ "available",
56297
+ "offline",
56298
+ "description-missing"
56299
+ ]);
56213
56300
  var DishwasherConsumableLevelSchema = _enum([
56214
56301
  "ok",
56215
56302
  "low",
56216
56303
  "empty"
56217
56304
  ]);
56218
56305
  var DishwasherStatusSchema = object({
56306
+ availability: DishwasherAvailabilitySchema,
56307
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
56219
56308
  state: DishwasherStateSchema,
56220
- /** Active program id/name, or null when none selected / unknown. */
56309
+ /** The appliance's operation state as reported; null when not known. */
56310
+ operationState: DishwasherOperationStateSchema.nullable(),
56311
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
56221
56312
  program: string().nullable(),
56222
- /** Program tokens the hardware accepts — drives the UI selector. */
56313
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
56314
+ selectedProgram: string().nullable(),
56315
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
56223
56316
  availablePrograms: array(string()),
56224
- /** Minutes remaining on the active cycle, or null when not running. */
56225
- remainingMinutes: number().int().nonnegative().nullable(),
56317
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
56318
+ remainingSeconds: number().int().nonnegative().nullable(),
56319
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
56320
+ delayedStartSeconds: number().int().nonnegative().nullable(),
56226
56321
  /** Cycle completion 0..100, or null when not applicable. */
56227
56322
  progressPercent: number().min(0).max(100).nullable(),
56228
- /** True when the door is reported open. */
56229
- doorOpen: boolean(),
56230
- /** True when remote start is allowed (door closed, power on, etc.). */
56231
- remoteStartAllowed: boolean(),
56232
- /** Main power / switched-on state. */
56233
- powerOn: boolean(),
56323
+ /** True when the door is reported open; null when the door state is not known. */
56324
+ doorOpen: boolean().nullable(),
56325
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
56326
+ doorLocked: boolean().nullable(),
56327
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
56328
+ remoteStartAllowed: boolean().nullable(),
56329
+ /** True when the appliance accepts remote control now; null when not known. */
56330
+ remoteControlActive: boolean().nullable(),
56331
+ /** True while somebody operates the appliance at its panel; null when not reported. */
56332
+ localControlActive: boolean().nullable(),
56333
+ /** Main power / switched-on state; null when not known. */
56334
+ powerOn: boolean().nullable(),
56335
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
56336
+ powerState: string().nullable(),
56234
56337
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
56235
56338
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
56236
- halfLoad: boolean(),
56237
- hygienePlus: boolean(),
56339
+ /** Option states: null when the appliance does not expose the option or has not said. */
56340
+ halfLoad: boolean().nullable(),
56341
+ hygienePlus: boolean().nullable(),
56238
56342
  /** Extra dry option when the appliance exposes it. */
56239
- extraDry: boolean(),
56343
+ extraDry: boolean().nullable(),
56240
56344
  /** Intensive zone (lower basket) when the appliance exposes it. */
56241
- intensiveZone: boolean(),
56345
+ intensiveZone: boolean().nullable(),
56242
56346
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
56243
- varioSpeedPlus: boolean(),
56244
- /** Child lock (controls disabled on the appliance). */
56245
- childLock: boolean(),
56347
+ varioSpeedPlus: boolean().nullable(),
56348
+ /** Child lock (controls disabled on the appliance); null when not known. */
56349
+ childLock: boolean().nullable(),
56350
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
56351
+ activeEvents: array(string()),
56352
+ /** Numeric error code when the appliance reports one; null otherwise. */
56246
56353
  errorCode: number().nullable(),
56354
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
56247
56355
  errorLabel: string().nullable(),
56356
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
56248
56357
  lastFetchedAt: number()
56249
56358
  });
56359
+ var DeviceIdSchema = number().int().nonnegative();
56360
+ /** A value a program option or setting can take. */
56361
+ var DishwasherValueSchema = union([
56362
+ boolean(),
56363
+ string(),
56364
+ number()
56365
+ ]);
56366
+ var DishwasherAccessSchema = _enum([
56367
+ "none",
56368
+ "read",
56369
+ "readWrite",
56370
+ "writeOnly",
56371
+ "readStatic"
56372
+ ]);
56373
+ /**
56374
+ * One option or setting the appliance declares, with the constraints its description
56375
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
56376
+ */
56377
+ var DishwasherOptionDescriptorSchema = object({
56378
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
56379
+ key: string(),
56380
+ /** Last segment of the key, for display. */
56381
+ name: string(),
56382
+ type: _enum([
56383
+ "boolean",
56384
+ "number",
56385
+ "enum",
56386
+ "string"
56387
+ ]),
56388
+ access: DishwasherAccessSchema,
56389
+ /** The appliance reports this entity as currently available. */
56390
+ available: boolean(),
56391
+ /** Unit the description declares for a number; null when it declares none. */
56392
+ unit: string().nullable(),
56393
+ min: number().nullable(),
56394
+ max: number().nullable(),
56395
+ step: number().nullable(),
56396
+ /** Allowed members of an enum; null for other types. */
56397
+ enumValues: array(string()).nullable(),
56398
+ defaultValue: DishwasherValueSchema.nullable()
56399
+ });
56400
+ var DishwasherProgramSchema = object({
56401
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
56402
+ key: string(),
56403
+ name: string(),
56404
+ /** The appliance currently offers this program. */
56405
+ available: boolean(),
56406
+ /** The options this program lists, with the program-level access / availability / default. */
56407
+ options: array(DishwasherOptionDescriptorSchema)
56408
+ });
56409
+ var DishwasherOptionsSchema = object({
56410
+ availability: DishwasherAvailabilitySchema,
56411
+ /** What the appliance can be told to do, from the commands its description declares. */
56412
+ supportsStart: boolean(),
56413
+ supportsPause: boolean(),
56414
+ supportsResume: boolean(),
56415
+ supportsStop: boolean(),
56416
+ supportsPower: boolean(),
56417
+ /** Every program the description lists, with its options. */
56418
+ programs: array(DishwasherProgramSchema),
56419
+ /** Every option and setting entity the description lists (programs reference these by key). */
56420
+ options: array(DishwasherOptionDescriptorSchema)
56421
+ });
56250
56422
  var dishwasherCapability = {
56251
56423
  name: "dishwasher",
56252
56424
  scope: "device",
@@ -56254,86 +56426,102 @@ var dishwasherCapability = {
56254
56426
  mode: "singleton",
56255
56427
  deviceTypes: [DeviceType.Dishwasher],
56256
56428
  methods: {
56257
- start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56429
+ /**
56430
+ * Start a program. Without `program` the selected one starts. `options` are
56431
+ * option feature keys; each is checked against the program's constraints.
56432
+ */
56433
+ start: method(object({
56434
+ deviceId: DeviceIdSchema,
56435
+ program: string().min(1).optional(),
56436
+ options: record(string(), DishwasherValueSchema).optional()
56437
+ }), _void(), {
56258
56438
  kind: "mutation",
56259
56439
  auth: "protected"
56260
56440
  }),
56261
- pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56441
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
56262
56442
  kind: "mutation",
56263
56443
  auth: "protected"
56264
56444
  }),
56265
- stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
56445
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
56446
+ kind: "mutation",
56447
+ auth: "protected"
56448
+ }),
56449
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
56266
56450
  kind: "mutation",
56267
56451
  auth: "protected"
56268
56452
  }),
56453
+ /** Select (not start) a program; refused when the appliance does not offer it. */
56269
56454
  setProgram: method(object({
56270
- deviceId: number().int().nonnegative(),
56455
+ deviceId: DeviceIdSchema,
56271
56456
  program: string().min(1)
56272
56457
  }), _void(), {
56273
56458
  kind: "mutation",
56274
56459
  auth: "protected"
56275
56460
  }),
56276
56461
  setPower: method(object({
56277
- deviceId: number().int().nonnegative(),
56462
+ deviceId: DeviceIdSchema,
56278
56463
  on: boolean()
56279
56464
  }), _void(), {
56280
56465
  kind: "mutation",
56281
56466
  auth: "protected"
56282
56467
  }),
56283
56468
  setHalfLoad: method(object({
56284
- deviceId: number().int().nonnegative(),
56469
+ deviceId: DeviceIdSchema,
56285
56470
  on: boolean()
56286
56471
  }), _void(), {
56287
56472
  kind: "mutation",
56288
56473
  auth: "protected"
56289
56474
  }),
56290
56475
  setHygienePlus: method(object({
56291
- deviceId: number().int().nonnegative(),
56476
+ deviceId: DeviceIdSchema,
56292
56477
  on: boolean()
56293
56478
  }), _void(), {
56294
56479
  kind: "mutation",
56295
56480
  auth: "protected"
56296
56481
  }),
56297
56482
  setExtraDry: method(object({
56298
- deviceId: number().int().nonnegative(),
56483
+ deviceId: DeviceIdSchema,
56299
56484
  on: boolean()
56300
56485
  }), _void(), {
56301
56486
  kind: "mutation",
56302
56487
  auth: "protected"
56303
56488
  }),
56304
56489
  setIntensiveZone: method(object({
56305
- deviceId: number().int().nonnegative(),
56490
+ deviceId: DeviceIdSchema,
56306
56491
  on: boolean()
56307
56492
  }), _void(), {
56308
56493
  kind: "mutation",
56309
56494
  auth: "protected"
56310
56495
  }),
56311
56496
  setVarioSpeedPlus: method(object({
56312
- deviceId: number().int().nonnegative(),
56497
+ deviceId: DeviceIdSchema,
56313
56498
  on: boolean()
56314
56499
  }), _void(), {
56315
56500
  kind: "mutation",
56316
56501
  auth: "protected"
56317
56502
  }),
56318
56503
  setChildLock: method(object({
56319
- deviceId: number().int().nonnegative(),
56504
+ deviceId: DeviceIdSchema,
56320
56505
  on: boolean()
56321
56506
  }), _void(), {
56322
56507
  kind: "mutation",
56323
56508
  auth: "protected"
56324
56509
  }),
56510
+ /**
56511
+ * Write any option or setting by feature key. Refused when the description does
56512
+ * not list it, it is not writable or not available now, or the value is outside
56513
+ * its declared range / members.
56514
+ */
56325
56515
  setOption: method(object({
56326
- deviceId: number().int().nonnegative(),
56516
+ deviceId: DeviceIdSchema,
56327
56517
  key: string().min(1),
56328
- value: union([
56329
- boolean(),
56330
- string(),
56331
- number()
56332
- ])
56518
+ value: DishwasherValueSchema
56333
56519
  }), _void(), {
56334
56520
  kind: "mutation",
56335
56521
  auth: "protected"
56336
- })
56522
+ }),
56523
+ /** What this appliance can do, from its own description — the UI is derived from it. */
56524
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
56337
56525
  },
56338
56526
  status: {
56339
56527
  schema: DishwasherStatusSchema,
@@ -70862,6 +71050,12 @@ Object.freeze({
70862
71050
  addonId: null,
70863
71051
  access: "view"
70864
71052
  },
71053
+ "dishwasher.getOptions": {
71054
+ capName: "dishwasher",
71055
+ capScope: "device",
71056
+ addonId: null,
71057
+ access: "view"
71058
+ },
70865
71059
  "dishwasher.getStatus": {
70866
71060
  capName: "dishwasher",
70867
71061
  capScope: "device",
@@ -70874,6 +71068,12 @@ Object.freeze({
70874
71068
  addonId: null,
70875
71069
  access: "create"
70876
71070
  },
71071
+ "dishwasher.resume": {
71072
+ capName: "dishwasher",
71073
+ capScope: "device",
71074
+ addonId: null,
71075
+ access: "create"
71076
+ },
70877
71077
  "dishwasher.setChildLock": {
70878
71078
  capName: "dishwasher",
70879
71079
  capScope: "device",
@@ -75374,6 +75574,12 @@ Object.freeze({
75374
75574
  addonId: null,
75375
75575
  access: "view"
75376
75576
  },
75577
+ "storageMigration.moverClearance": {
75578
+ capName: "storage-migration",
75579
+ capScope: "system",
75580
+ addonId: null,
75581
+ access: "view"
75582
+ },
75377
75583
  "storageMigration.movers": {
75378
75584
  capName: "storage-migration",
75379
75585
  capScope: "system",
@@ -77785,6 +77991,11 @@ Object.freeze({
77785
77991
  form: "single",
77786
77992
  optional: false
77787
77993
  }],
77994
+ "dishwasher.getOptions": [{
77995
+ name: "deviceId",
77996
+ form: "single",
77997
+ optional: false
77998
+ }],
77788
77999
  "dishwasher.getStatus": [{
77789
78000
  name: "deviceId",
77790
78001
  form: "single",
@@ -77795,6 +78006,11 @@ Object.freeze({
77795
78006
  form: "single",
77796
78007
  optional: false
77797
78008
  }],
78009
+ "dishwasher.resume": [{
78010
+ name: "deviceId",
78011
+ form: "single",
78012
+ optional: false
78013
+ }],
77798
78014
  "dishwasher.setChildLock": [{
77799
78015
  name: "deviceId",
77800
78016
  form: "single",
@@ -79881,6 +80097,9 @@ new Map(Object.entries({
79881
80097
  "wrapper-update-available": "system",
79882
80098
  "backup-completed": "system",
79883
80099
  "export-completed": "system",
80100
+ "alert-critical": "system",
80101
+ "alert-error": "system",
80102
+ "alert-critical-resolved": "system",
79884
80103
  "storage-location-low": "system",
79885
80104
  "storage-location-critical": "system",
79886
80105
  "storage-location-ok": "system",
@@ -80005,6 +80224,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
80005
80224
  "storage-location-ok"
80006
80225
  ]
80007
80226
  },
80227
+ {
80228
+ id: "alerts",
80229
+ family: "system",
80230
+ label: "Alerts",
80231
+ kinds: [
80232
+ "alert-critical",
80233
+ "alert-error",
80234
+ "alert-critical-resolved"
80235
+ ]
80236
+ },
80008
80237
  {
80009
80238
  id: "alarm",
80010
80239
  family: "alarm",
@@ -80049,6 +80278,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
80049
80278
  return [[descriptor.kind, field]];
80050
80279
  })));
80051
80280
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
80281
+ object({
80282
+ phase: _enum(["raised", "resolved"]),
80283
+ episodeId: string().min(1),
80284
+ alertId: string().min(1),
80285
+ severity: AlertSeveritySchema,
80286
+ category: string(),
80287
+ title: string(),
80288
+ message: string(),
80289
+ sourceType: string().optional(),
80290
+ sourceId: string().optional(),
80291
+ nodeId: string().optional(),
80292
+ /** The alert's own action link (where the operator acts on it), when it has one. */
80293
+ actionUrl: string().optional(),
80294
+ at: number()
80295
+ });
80052
80296
  var RULE_BODY_ONLY = ["body"];
80053
80297
  var RULE_TEXT = ["title", "body"];
80054
80298
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -80058,6 +80302,11 @@ var TANK = [
80058
80302
  "device-tank-full",
80059
80303
  "device-tank-normal"
80060
80304
  ];
80305
+ var ALERT_EPISODE = [
80306
+ "alert-critical",
80307
+ "alert-error",
80308
+ "alert-critical-resolved"
80309
+ ];
80061
80310
  var UPDATES = [
80062
80311
  "addon-update-available",
80063
80312
  "server-update-available",
@@ -80250,14 +80499,14 @@ var STATE_SUMMARY_VARS = [
80250
80499
  ([...RULE_TEXT], [...CONSUMABLE]),
80251
80500
  ([...RULE_TEXT], [...TANK]),
80252
80501
  [...RULE_TEXT],
80253
- ([...RULE_TEXT], [...UPDATES]),
80254
- ([...RULE_TEXT], [...UPDATES]),
80255
- [...RULE_TEXT],
80502
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
80503
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
80256
80504
  [...RULE_TEXT],
80257
80505
  [...RULE_TEXT],
80258
80506
  [...RULE_TEXT],
80259
80507
  [...RULE_TEXT],
80260
80508
  [...RULE_TEXT],
80509
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80261
80510
  [...RULE_TEXT],
80262
80511
  [...RULE_TEXT],
80263
80512
  [...RULE_TEXT],
@@ -80275,7 +80524,11 @@ var STATE_SUMMARY_VARS = [
80275
80524
  [...RULE_TEXT],
80276
80525
  [...RULE_TEXT],
80277
80526
  [...RULE_TEXT],
80278
- [...RULE_TEXT],
80527
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80528
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80529
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80530
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80531
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
80279
80532
  [...RULE_TEXT],
80280
80533
  [...RULE_TEXT],
80281
80534
  [...RULE_TEXT],