@camstack/addon-export-alexa 1.2.147 → 1.2.149

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.
@@ -34,7 +34,7 @@ let node_path = require("node:path");
34
34
  node_path = __toESM(node_path, 1);
35
35
  require("node:child_process");
36
36
  require("node:zlib");
37
- //#region ../types/dist/event-category-BvOFi6PY.mjs
37
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
38
38
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
39
39
  EventCategory["SystemBoot"] = "system.boot";
40
40
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -113,9 +113,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
113
113
  /**
114
114
  * The node's one-shot runner boot check (D877): planned runners against the
115
115
  * process service, `degraded` when any is failed, refused or missing. The
116
- * alert centre turns it into one alert and a direct critical push.
116
+ * alert centre turns it into one critical alert.
117
117
  */
118
118
  EventCategory["SystemRunnerCheck"] = "system.runner-check";
119
+ /**
120
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
121
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
122
+ * centre sends no notification of its own: Notification Center turns this
123
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
124
+ * system-event kinds, and reconciles from the alerts store because a bus
125
+ * event may be dropped (D8, D11).
126
+ */
127
+ EventCategory["AlertEpisode"] = "alert.episode";
119
128
  EventCategory["AddonError"] = "addon.error";
120
129
  EventCategory["AddonPageReady"] = "addon.page-ready";
121
130
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5440,7 +5449,7 @@ var ZodIssueCode = {
5440
5449
  var ZodFirstPartyTypeKind;
5441
5450
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5442
5451
  //#endregion
5443
- //#region ../types/dist/sleep-BegKjwUu.mjs
5452
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5444
5453
  /**
5445
5454
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5446
5455
  * window to float samples (D455).
@@ -7822,6 +7831,12 @@ function normalizeAddonInitResult(result) {
7822
7831
  if (Array.isArray(result)) return { providers: result };
7823
7832
  return result;
7824
7833
  }
7834
+ /**
7835
+ * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7836
+ * and validates them (`share-token.service.ts` builds its enum from this
7837
+ * list); a data plane names the kinds it ACCEPTS in `share`.
7838
+ */
7839
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7825
7840
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7826
7841
  var PeerBytesTicketSchema = object({
7827
7842
  /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
@@ -12702,6 +12717,229 @@ var ConvertResultSchema = object({
12702
12717
  function scopesAllowDeviceCap(scopes, access) {
12703
12718
  return scopes.some((s) => s.type === "category" && s.target === "device" && s.access.includes(access));
12704
12719
  }
12720
+ /**
12721
+ * Zod schemas for persisted record types.
12722
+ *
12723
+ * These schemas serve as the single source of truth for types that are
12724
+ * stored in the settings-store backend and retrieved via tRPC. They
12725
+ * replace the manual TypeScript interfaces with schema-derived types,
12726
+ * enabling runtime validation when reading from the backend.
12727
+ *
12728
+ * Convention: each schema is named `<Type>Schema`, the inferred TS type
12729
+ * keeps the original name for backward compatibility.
12730
+ */
12731
+ /**
12732
+ * Auth model (v2 — 2026-05-12 caps-only):
12733
+ *
12734
+ * Two principals:
12735
+ * - `isAdmin: true` — full bypass. Admin scope set is ignored.
12736
+ * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
12737
+ *
12738
+ * No role enum. There used to be `viewer / agent / scoped` and earlier
12739
+ * `super_admin` — collapsed onto the single boolean because every
12740
+ * non-admin caller is governed by the same scope-check rules; the
12741
+ * distinction was only ever used to route role-specific procedures
12742
+ * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12743
+ * with `isAdmin: false` + an explicit scope list.
12744
+ */
12745
+ /** Per-method access flavour. Materialised on every cap method via codegen. */
12746
+ var MethodAccessSchema = _enum([
12747
+ "view",
12748
+ "create",
12749
+ "delete"
12750
+ ]);
12751
+ /**
12752
+ * A single scope grant. Three forms — checked in matcher with OR
12753
+ * semantics; the first match decides whether the call passes:
12754
+ *
12755
+ * - `category` — broadest. `target: 'device' | 'system'` selects every
12756
+ * cap with the matching `scope` declaration. New caps inherit grants
12757
+ * automatically — adding a device cap to the codebase makes it
12758
+ * reachable to every user with `category:device [...]` without a
12759
+ * re-grant. Use this for "family viewer" / "operator" tiers.
12760
+ *
12761
+ * - `addon` — every cap that ships inside a given addon id. Niche;
12762
+ * useful when an integration needs to interact with one specific
12763
+ * addon's surface regardless of how many caps it exports.
12764
+ *
12765
+ * - `capability` — the most precise form. Single cap name. Use for
12766
+ * integration tokens where you want to grant `addons.installPackage`
12767
+ * and nothing else.
12768
+ *
12769
+ * `access` is REQUIRED with min 1 element. `admin` bypass is the
12770
+ * "give me everything" escape; there is no wildcard scope.
12771
+ */
12772
+ var AllowedProviderSchema = union([literal("*"), array(string())]);
12773
+ var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
12774
+ var CapScopeSchema = _enum(["device", "system"]);
12775
+ /**
12776
+ * DeviceSelector (scope model v3 — 2026-08-12).
12777
+ *
12778
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
12779
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
12780
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
12781
+ * AFTER the grant was minted — no re-grant, no re-login.
12782
+ *
12783
+ * - `all` — every device in the deployment. The broad viewer/operator
12784
+ * lever without a `category` grant (a `category` grant also covers device
12785
+ * caps that carry no deviceId; `all` is specifically the device set).
12786
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
12787
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
12788
+ * is NOT covered until the grant is edited.
12789
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
12790
+ * DYNAMIC. A device that changes type, or a new device of the type,
12791
+ * re-resolves on the next request.
12792
+ * - `locations` — every device whose operator-assigned `location` label is
12793
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
12794
+ * null/unset location matches NO `locations` selector.
12795
+ */
12796
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
12797
+ object({ kind: literal("all") }),
12798
+ object({
12799
+ kind: literal("ids"),
12800
+ ids: array(number().int()).min(1)
12801
+ }),
12802
+ object({
12803
+ kind: literal("types"),
12804
+ types: array(_enum(DeviceType)).min(1)
12805
+ }),
12806
+ object({
12807
+ kind: literal("locations"),
12808
+ locations: array(string().min(1)).min(1)
12809
+ })
12810
+ ]);
12811
+ var DeviceTokenScopeSchema = object({
12812
+ type: literal("device"),
12813
+ /** The device SET this grant covers — resolved against the live fleet. */
12814
+ selector: DeviceSelectorSchema,
12815
+ access: array(MethodAccessSchema).min(1),
12816
+ /**
12817
+ * Whether a grant on a PARENT device transparently covers its accessory
12818
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
12819
+ * Direction is parent → children ONLY.
12820
+ *
12821
+ * Absent → the matcher DERIVES it from the access flavour: `view`
12822
+ * inherits (a camera viewer sees the camera's accessories), `create` /
12823
+ * `delete` do NOT (actuating/removing a child is an explicit act the
12824
+ * operator must grant on the child, not inherit from the parent). Set it
12825
+ * explicitly to override that default per grant.
12826
+ */
12827
+ includeLinked: boolean().optional()
12828
+ });
12829
+ /**
12830
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
12831
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
12832
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
12833
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
12834
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
12835
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
12836
+ * migration cannot reach a JWT already in a client's hands; parse-time
12837
+ * migration covers both without a flag day. No cast — the raw object is read
12838
+ * through `Reflect.get` (its static type is `unknown`).
12839
+ */
12840
+ function migrateLegacyTokenScope(raw) {
12841
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
12842
+ if (Reflect.get(raw, "type") !== "device") return raw;
12843
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
12844
+ const targets = Reflect.get(raw, "targets");
12845
+ if (!Array.isArray(targets)) return raw;
12846
+ return {
12847
+ type: "device",
12848
+ selector: {
12849
+ kind: "ids",
12850
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
12851
+ },
12852
+ access: Reflect.get(raw, "access")
12853
+ };
12854
+ }
12855
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
12856
+ object({
12857
+ type: literal("category"),
12858
+ target: CapScopeSchema,
12859
+ access: array(MethodAccessSchema).min(1)
12860
+ }),
12861
+ object({
12862
+ type: literal("capability"),
12863
+ target: string(),
12864
+ access: array(MethodAccessSchema).min(1)
12865
+ }),
12866
+ object({
12867
+ type: literal("addon"),
12868
+ target: string(),
12869
+ access: array(MethodAccessSchema).min(1)
12870
+ }),
12871
+ DeviceTokenScopeSchema
12872
+ ]));
12873
+ object({
12874
+ id: string(),
12875
+ username: string(),
12876
+ passwordHash: string(),
12877
+ /**
12878
+ * Admin bypass. When true, the middleware skips the scope-access
12879
+ * check entirely. There is no other axis of privilege; the legacy
12880
+ * role enum collapsed onto this boolean in v2.
12881
+ */
12882
+ isAdmin: boolean().default(false),
12883
+ allowedProviders: AllowedProviderSchema,
12884
+ allowedDevices: AllowedDevicesSchema,
12885
+ /**
12886
+ * Scopes granted to this user. Admins bypass; their `scopes` is
12887
+ * ignored. Non-admins without scopes are locked out of every
12888
+ * protected call.
12889
+ */
12890
+ scopes: array(TokenScopeSchema).default([]),
12891
+ createdAt: number(),
12892
+ updatedAt: number()
12893
+ });
12894
+ object({
12895
+ id: string(),
12896
+ label: string(),
12897
+ isAdmin: boolean().default(false),
12898
+ allowedProviders: AllowedProviderSchema,
12899
+ allowedDevices: AllowedDevicesSchema,
12900
+ tokenHash: string(),
12901
+ tokenPrefix: string(),
12902
+ createdAt: number(),
12903
+ lastUsedAt: number().optional()
12904
+ });
12905
+ object({
12906
+ id: string(),
12907
+ userId: string(),
12908
+ name: string(),
12909
+ tokenHash: string(),
12910
+ tokenPrefix: string(),
12911
+ scopes: array(TokenScopeSchema),
12912
+ expiresAt: number().nullish(),
12913
+ lastUsedAt: number().nullish(),
12914
+ createdAt: number()
12915
+ });
12916
+ /** What a share-view grant lets its holder see. */
12917
+ var ShareViewGrantSchema = object({
12918
+ kind: _enum(SHARE_VIEW_KINDS),
12919
+ deviceIds: array(number().int().nonnegative()).min(1).max(64),
12920
+ /** Talk-back, opt-in at mint time; absent means off. */
12921
+ talk: boolean().optional()
12922
+ });
12923
+ var ShareViewScopeSchema = object({
12924
+ type: literal("share-view"),
12925
+ grant: ShareViewGrantSchema
12926
+ });
12927
+ var AddonRoutesScopeSchema = object({
12928
+ type: literal("addon-routes"),
12929
+ access: array(MethodAccessSchema).min(1)
12930
+ });
12931
+ var CredentialScopeSchema = union([
12932
+ literal("*"),
12933
+ ShareViewScopeSchema,
12934
+ AddonRoutesScopeSchema,
12935
+ TokenScopeSchema
12936
+ ]);
12937
+ object({
12938
+ kind: literal("credential"),
12939
+ sub: string().min(1),
12940
+ jti: string().min(16),
12941
+ scopes: array(CredentialScopeSchema).min(1)
12942
+ });
12705
12943
  _enum(["new-session", "step-up"]);
12706
12944
  /** The languages the hub's app landing pages are written in (D858). */
12707
12945
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -13437,7 +13675,14 @@ var AlertSeveritySchema = _enum([
13437
13675
  ]);
13438
13676
  var AlertActionSchema = object({
13439
13677
  label: string(),
13440
- href: string().optional()
13678
+ href: string().optional(),
13679
+ /**
13680
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13681
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13682
+ * start) — the browser must leave the SPA with a full navigation, because
13683
+ * the SPA has no such route and would bounce to the home page.
13684
+ */
13685
+ navigation: _enum(["app", "server"]).optional()
13441
13686
  });
13442
13687
  var AlertStatusSchema = _enum([
13443
13688
  "active",
@@ -41838,6 +42083,9 @@ var NcSystemEventKindSchema = _enum([
41838
42083
  "server-updated",
41839
42084
  "export-completed",
41840
42085
  "backup-completed",
42086
+ "alert-critical",
42087
+ "alert-error",
42088
+ "alert-critical-resolved",
41841
42089
  "camera-online",
41842
42090
  "camera-offline",
41843
42091
  "camera-disabled",
@@ -43873,202 +44121,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
43873
44121
  auth: "admin"
43874
44122
  }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
43875
44123
  /**
43876
- * Zod schemas for persisted record types.
43877
- *
43878
- * These schemas serve as the single source of truth for types that are
43879
- * stored in the settings-store backend and retrieved via tRPC. They
43880
- * replace the manual TypeScript interfaces with schema-derived types,
43881
- * enabling runtime validation when reading from the backend.
43882
- *
43883
- * Convention: each schema is named `<Type>Schema`, the inferred TS type
43884
- * keeps the original name for backward compatibility.
43885
- */
43886
- /**
43887
- * Auth model (v2 — 2026-05-12 caps-only):
43888
- *
43889
- * Two principals:
43890
- * - `isAdmin: true` — full bypass. Admin scope set is ignored.
43891
- * - `isAdmin: false` — every call gated by `scopes` (see TokenScope).
43892
- *
43893
- * No role enum. There used to be `viewer / agent / scoped` and earlier
43894
- * `super_admin` — collapsed onto the single boolean because every
43895
- * non-admin caller is governed by the same scope-check rules; the
43896
- * distinction was only ever used to route role-specific procedures
43897
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
43898
- * with `isAdmin: false` + an explicit scope list.
43899
- */
43900
- /** Per-method access flavour. Materialised on every cap method via codegen. */
43901
- var MethodAccessSchema = _enum([
43902
- "view",
43903
- "create",
43904
- "delete"
43905
- ]);
43906
- /**
43907
- * A single scope grant. Three forms — checked in matcher with OR
43908
- * semantics; the first match decides whether the call passes:
43909
- *
43910
- * - `category` — broadest. `target: 'device' | 'system'` selects every
43911
- * cap with the matching `scope` declaration. New caps inherit grants
43912
- * automatically — adding a device cap to the codebase makes it
43913
- * reachable to every user with `category:device [...]` without a
43914
- * re-grant. Use this for "family viewer" / "operator" tiers.
43915
- *
43916
- * - `addon` — every cap that ships inside a given addon id. Niche;
43917
- * useful when an integration needs to interact with one specific
43918
- * addon's surface regardless of how many caps it exports.
43919
- *
43920
- * - `capability` — the most precise form. Single cap name. Use for
43921
- * integration tokens where you want to grant `addons.installPackage`
43922
- * and nothing else.
43923
- *
43924
- * `access` is REQUIRED with min 1 element. `admin` bypass is the
43925
- * "give me everything" escape; there is no wildcard scope.
43926
- */
43927
- var AllowedProviderSchema = union([literal("*"), array(string())]);
43928
- var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
43929
- var CapScopeSchema = _enum(["device", "system"]);
43930
- /**
43931
- * DeviceSelector (scope model v3 — 2026-08-12).
43932
- *
43933
- * A `device` grant no longer carries a frozen list of deviceIds. It carries
43934
- * a SELECTOR the matcher resolves against the live fleet, so the grant can be
43935
- * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
43936
- * AFTER the grant was minted — no re-grant, no re-login.
43937
- *
43938
- * - `all` — every device in the deployment. The broad viewer/operator
43939
- * lever without a `category` grant (a `category` grant also covers device
43940
- * caps that carry no deviceId; `all` is specifically the device set).
43941
- * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
43942
- * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
43943
- * is NOT covered until the grant is edited.
43944
- * - `types` — every device of a `DeviceType` (e.g. every `camera`).
43945
- * DYNAMIC. A device that changes type, or a new device of the type,
43946
- * re-resolves on the next request.
43947
- * - `locations` — every device whose operator-assigned `location` label is
43948
- * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
43949
- * null/unset location matches NO `locations` selector.
43950
- */
43951
- var DeviceSelectorSchema = discriminatedUnion("kind", [
43952
- object({ kind: literal("all") }),
43953
- object({
43954
- kind: literal("ids"),
43955
- ids: array(number().int()).min(1)
43956
- }),
43957
- object({
43958
- kind: literal("types"),
43959
- types: array(_enum(DeviceType)).min(1)
43960
- }),
43961
- object({
43962
- kind: literal("locations"),
43963
- locations: array(string().min(1)).min(1)
43964
- })
43965
- ]);
43966
- var DeviceTokenScopeSchema = object({
43967
- type: literal("device"),
43968
- /** The device SET this grant covers — resolved against the live fleet. */
43969
- selector: DeviceSelectorSchema,
43970
- access: array(MethodAccessSchema).min(1),
43971
- /**
43972
- * Whether a grant on a PARENT device transparently covers its accessory
43973
- * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
43974
- * Direction is parent → children ONLY.
43975
- *
43976
- * Absent → the matcher DERIVES it from the access flavour: `view`
43977
- * inherits (a camera viewer sees the camera's accessories), `create` /
43978
- * `delete` do NOT (actuating/removing a child is an explicit act the
43979
- * operator must grant on the child, not inherit from the parent). Set it
43980
- * explicitly to override that default per grant.
43981
- */
43982
- includeLinked: boolean().optional()
43983
- });
43984
- /**
43985
- * v2 → v3 lazy migration. A pre-v3 `device` grant carried
43986
- * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
43987
- * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
43988
- * EVERY parse path — stored records AND the JWT-carried scope arrays
43989
- * normalised at the request boundary ({@link normalizeTokenScopes} in
43990
- * `device-selector.ts`). Chosen over a one-time DB migration because a
43991
- * migration cannot reach a JWT already in a client's hands; parse-time
43992
- * migration covers both without a flag day. No cast — the raw object is read
43993
- * through `Reflect.get` (its static type is `unknown`).
43994
- */
43995
- function migrateLegacyTokenScope(raw) {
43996
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
43997
- if (Reflect.get(raw, "type") !== "device") return raw;
43998
- if (Reflect.get(raw, "selector") !== void 0) return raw;
43999
- const targets = Reflect.get(raw, "targets");
44000
- if (!Array.isArray(targets)) return raw;
44001
- return {
44002
- type: "device",
44003
- selector: {
44004
- kind: "ids",
44005
- ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
44006
- },
44007
- access: Reflect.get(raw, "access")
44008
- };
44009
- }
44010
- var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
44011
- object({
44012
- type: literal("category"),
44013
- target: CapScopeSchema,
44014
- access: array(MethodAccessSchema).min(1)
44015
- }),
44016
- object({
44017
- type: literal("capability"),
44018
- target: string(),
44019
- access: array(MethodAccessSchema).min(1)
44020
- }),
44021
- object({
44022
- type: literal("addon"),
44023
- target: string(),
44024
- access: array(MethodAccessSchema).min(1)
44025
- }),
44026
- DeviceTokenScopeSchema
44027
- ]));
44028
- object({
44029
- id: string(),
44030
- username: string(),
44031
- passwordHash: string(),
44032
- /**
44033
- * Admin bypass. When true, the middleware skips the scope-access
44034
- * check entirely. There is no other axis of privilege; the legacy
44035
- * role enum collapsed onto this boolean in v2.
44036
- */
44037
- isAdmin: boolean().default(false),
44038
- allowedProviders: AllowedProviderSchema,
44039
- allowedDevices: AllowedDevicesSchema,
44040
- /**
44041
- * Scopes granted to this user. Admins bypass; their `scopes` is
44042
- * ignored. Non-admins without scopes are locked out of every
44043
- * protected call.
44044
- */
44045
- scopes: array(TokenScopeSchema).default([]),
44046
- createdAt: number(),
44047
- updatedAt: number()
44048
- });
44049
- object({
44050
- id: string(),
44051
- label: string(),
44052
- isAdmin: boolean().default(false),
44053
- allowedProviders: AllowedProviderSchema,
44054
- allowedDevices: AllowedDevicesSchema,
44055
- tokenHash: string(),
44056
- tokenPrefix: string(),
44057
- createdAt: number(),
44058
- lastUsedAt: number().optional()
44059
- });
44060
- object({
44061
- id: string(),
44062
- userId: string(),
44063
- name: string(),
44064
- tokenHash: string(),
44065
- tokenPrefix: string(),
44066
- scopes: array(TokenScopeSchema),
44067
- expiresAt: number().nullish(),
44068
- lastUsedAt: number().nullish(),
44069
- createdAt: number()
44070
- });
44071
- /**
44072
44124
  * `oauth-integration` — a collection cap by which an addon declares
44073
44125
  * itself a linkable OAuth client of the hub's core `/oauth2/*` server.
44074
44126
  * Each provider returns a static descriptor; the core enumerates them
@@ -50886,7 +50938,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
50886
50938
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
50887
50939
  kind: "mutation",
50888
50940
  auth: "admin"
50889
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
50941
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
50942
+ clear: boolean(),
50943
+ repointLocationId: string().optional()
50944
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
50890
50945
  kind: "mutation",
50891
50946
  auth: "admin"
50892
50947
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -54345,6 +54400,11 @@ object({
54345
54400
  *
54346
54401
  * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
54347
54402
  * provider refreshes the slice on an interval and eagerly after commands.
54403
+ *
54404
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
54405
+ * nullable: `null` means "not known right now" (the appliance has not said,
54406
+ * the link is down, or the description does not carry it) and is never
54407
+ * rendered or exported as `false` / `0`. `availability` says why.
54348
54408
  */
54349
54409
  var DishwasherStateSchema = _enum([
54350
54410
  "idle",
@@ -54354,112 +54414,227 @@ var DishwasherStateSchema = _enum([
54354
54414
  "error",
54355
54415
  "unavailable"
54356
54416
  ]);
54417
+ /**
54418
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
54419
+ * view for compact surfaces; this is what the appliance said.
54420
+ */
54421
+ var DishwasherOperationStateSchema = _enum([
54422
+ "Inactive",
54423
+ "Ready",
54424
+ "DelayedStart",
54425
+ "Run",
54426
+ "Pause",
54427
+ "ActionRequired",
54428
+ "Finished",
54429
+ "Error",
54430
+ "Aborting"
54431
+ ]);
54432
+ /**
54433
+ * Why fields may be `null`:
54434
+ * - `available` — the link is up and the description is loaded;
54435
+ * - `offline` — the local link is down (values are unknown, not last-known);
54436
+ * - `description-missing` — the link is up but the appliance's description could not
54437
+ * be loaded, so its values cannot be decoded.
54438
+ */
54439
+ var DishwasherAvailabilitySchema = _enum([
54440
+ "available",
54441
+ "offline",
54442
+ "description-missing"
54443
+ ]);
54357
54444
  var DishwasherConsumableLevelSchema = _enum([
54358
54445
  "ok",
54359
54446
  "low",
54360
54447
  "empty"
54361
54448
  ]);
54362
54449
  object({
54450
+ availability: DishwasherAvailabilitySchema,
54451
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
54363
54452
  state: DishwasherStateSchema,
54364
- /** Active program id/name, or null when none selected / unknown. */
54453
+ /** The appliance's operation state as reported; null when not known. */
54454
+ operationState: DishwasherOperationStateSchema.nullable(),
54455
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
54365
54456
  program: string().nullable(),
54366
- /** Program tokens the hardware accepts — drives the UI selector. */
54457
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
54458
+ selectedProgram: string().nullable(),
54459
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
54367
54460
  availablePrograms: array(string()),
54368
- /** Minutes remaining on the active cycle, or null when not running. */
54369
- remainingMinutes: number().int().nonnegative().nullable(),
54461
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
54462
+ remainingSeconds: number().int().nonnegative().nullable(),
54463
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
54464
+ delayedStartSeconds: number().int().nonnegative().nullable(),
54370
54465
  /** Cycle completion 0..100, or null when not applicable. */
54371
54466
  progressPercent: number().min(0).max(100).nullable(),
54372
- /** True when the door is reported open. */
54373
- doorOpen: boolean(),
54374
- /** True when remote start is allowed (door closed, power on, etc.). */
54375
- remoteStartAllowed: boolean(),
54376
- /** Main power / switched-on state. */
54377
- powerOn: boolean(),
54467
+ /** True when the door is reported open; null when the door state is not known. */
54468
+ doorOpen: boolean().nullable(),
54469
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
54470
+ doorLocked: boolean().nullable(),
54471
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
54472
+ remoteStartAllowed: boolean().nullable(),
54473
+ /** True when the appliance accepts remote control now; null when not known. */
54474
+ remoteControlActive: boolean().nullable(),
54475
+ /** True while somebody operates the appliance at its panel; null when not reported. */
54476
+ localControlActive: boolean().nullable(),
54477
+ /** Main power / switched-on state; null when not known. */
54478
+ powerOn: boolean().nullable(),
54479
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
54480
+ powerState: string().nullable(),
54378
54481
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
54379
54482
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
54380
- halfLoad: boolean(),
54381
- hygienePlus: boolean(),
54483
+ /** Option states: null when the appliance does not expose the option or has not said. */
54484
+ halfLoad: boolean().nullable(),
54485
+ hygienePlus: boolean().nullable(),
54382
54486
  /** Extra dry option when the appliance exposes it. */
54383
- extraDry: boolean(),
54487
+ extraDry: boolean().nullable(),
54384
54488
  /** Intensive zone (lower basket) when the appliance exposes it. */
54385
- intensiveZone: boolean(),
54489
+ intensiveZone: boolean().nullable(),
54386
54490
  /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
54387
- varioSpeedPlus: boolean(),
54388
- /** Child lock (controls disabled on the appliance). */
54389
- childLock: boolean(),
54491
+ varioSpeedPlus: boolean().nullable(),
54492
+ /** Child lock (controls disabled on the appliance); null when not known. */
54493
+ childLock: boolean().nullable(),
54494
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
54495
+ activeEvents: array(string()),
54496
+ /** Numeric error code when the appliance reports one; null otherwise. */
54390
54497
  errorCode: number().nullable(),
54498
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
54391
54499
  errorLabel: string().nullable(),
54500
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
54392
54501
  lastFetchedAt: number()
54393
54502
  });
54394
- DeviceType.Dishwasher, method(object({ deviceId: number().int().nonnegative() }), _void(), {
54503
+ var DeviceIdSchema = number().int().nonnegative();
54504
+ /** A value a program option or setting can take. */
54505
+ var DishwasherValueSchema = union([
54506
+ boolean(),
54507
+ string(),
54508
+ number()
54509
+ ]);
54510
+ var DishwasherAccessSchema = _enum([
54511
+ "none",
54512
+ "read",
54513
+ "readWrite",
54514
+ "writeOnly",
54515
+ "readStatic"
54516
+ ]);
54517
+ /**
54518
+ * One option or setting the appliance declares, with the constraints its description
54519
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
54520
+ */
54521
+ var DishwasherOptionDescriptorSchema = object({
54522
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
54523
+ key: string(),
54524
+ /** Last segment of the key, for display. */
54525
+ name: string(),
54526
+ type: _enum([
54527
+ "boolean",
54528
+ "number",
54529
+ "enum",
54530
+ "string"
54531
+ ]),
54532
+ access: DishwasherAccessSchema,
54533
+ /** The appliance reports this entity as currently available. */
54534
+ available: boolean(),
54535
+ /** Unit the description declares for a number; null when it declares none. */
54536
+ unit: string().nullable(),
54537
+ min: number().nullable(),
54538
+ max: number().nullable(),
54539
+ step: number().nullable(),
54540
+ /** Allowed members of an enum; null for other types. */
54541
+ enumValues: array(string()).nullable(),
54542
+ defaultValue: DishwasherValueSchema.nullable()
54543
+ });
54544
+ var DishwasherProgramSchema = object({
54545
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
54546
+ key: string(),
54547
+ name: string(),
54548
+ /** The appliance currently offers this program. */
54549
+ available: boolean(),
54550
+ /** The options this program lists, with the program-level access / availability / default. */
54551
+ options: array(DishwasherOptionDescriptorSchema)
54552
+ });
54553
+ var DishwasherOptionsSchema = object({
54554
+ availability: DishwasherAvailabilitySchema,
54555
+ /** What the appliance can be told to do, from the commands its description declares. */
54556
+ supportsStart: boolean(),
54557
+ supportsPause: boolean(),
54558
+ supportsResume: boolean(),
54559
+ supportsStop: boolean(),
54560
+ supportsPower: boolean(),
54561
+ /** Every program the description lists, with its options. */
54562
+ programs: array(DishwasherProgramSchema),
54563
+ /** Every option and setting entity the description lists (programs reference these by key). */
54564
+ options: array(DishwasherOptionDescriptorSchema)
54565
+ });
54566
+ DeviceType.Dishwasher, method(object({
54567
+ deviceId: DeviceIdSchema,
54568
+ program: string().min(1).optional(),
54569
+ options: record(string(), DishwasherValueSchema).optional()
54570
+ }), _void(), {
54395
54571
  kind: "mutation",
54396
54572
  auth: "protected"
54397
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
54573
+ }), method(object({ deviceId: DeviceIdSchema }), _void(), {
54398
54574
  kind: "mutation",
54399
54575
  auth: "protected"
54400
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
54576
+ }), method(object({ deviceId: DeviceIdSchema }), _void(), {
54577
+ kind: "mutation",
54578
+ auth: "protected"
54579
+ }), method(object({ deviceId: DeviceIdSchema }), _void(), {
54401
54580
  kind: "mutation",
54402
54581
  auth: "protected"
54403
54582
  }), method(object({
54404
- deviceId: number().int().nonnegative(),
54583
+ deviceId: DeviceIdSchema,
54405
54584
  program: string().min(1)
54406
54585
  }), _void(), {
54407
54586
  kind: "mutation",
54408
54587
  auth: "protected"
54409
54588
  }), method(object({
54410
- deviceId: number().int().nonnegative(),
54589
+ deviceId: DeviceIdSchema,
54411
54590
  on: boolean()
54412
54591
  }), _void(), {
54413
54592
  kind: "mutation",
54414
54593
  auth: "protected"
54415
54594
  }), method(object({
54416
- deviceId: number().int().nonnegative(),
54595
+ deviceId: DeviceIdSchema,
54417
54596
  on: boolean()
54418
54597
  }), _void(), {
54419
54598
  kind: "mutation",
54420
54599
  auth: "protected"
54421
54600
  }), method(object({
54422
- deviceId: number().int().nonnegative(),
54601
+ deviceId: DeviceIdSchema,
54423
54602
  on: boolean()
54424
54603
  }), _void(), {
54425
54604
  kind: "mutation",
54426
54605
  auth: "protected"
54427
54606
  }), method(object({
54428
- deviceId: number().int().nonnegative(),
54607
+ deviceId: DeviceIdSchema,
54429
54608
  on: boolean()
54430
54609
  }), _void(), {
54431
54610
  kind: "mutation",
54432
54611
  auth: "protected"
54433
54612
  }), method(object({
54434
- deviceId: number().int().nonnegative(),
54613
+ deviceId: DeviceIdSchema,
54435
54614
  on: boolean()
54436
54615
  }), _void(), {
54437
54616
  kind: "mutation",
54438
54617
  auth: "protected"
54439
54618
  }), method(object({
54440
- deviceId: number().int().nonnegative(),
54619
+ deviceId: DeviceIdSchema,
54441
54620
  on: boolean()
54442
54621
  }), _void(), {
54443
54622
  kind: "mutation",
54444
54623
  auth: "protected"
54445
54624
  }), method(object({
54446
- deviceId: number().int().nonnegative(),
54625
+ deviceId: DeviceIdSchema,
54447
54626
  on: boolean()
54448
54627
  }), _void(), {
54449
54628
  kind: "mutation",
54450
54629
  auth: "protected"
54451
54630
  }), method(object({
54452
- deviceId: number().int().nonnegative(),
54631
+ deviceId: DeviceIdSchema,
54453
54632
  key: string().min(1),
54454
- value: union([
54455
- boolean(),
54456
- string(),
54457
- number()
54458
- ])
54633
+ value: DishwasherValueSchema
54459
54634
  }), _void(), {
54460
54635
  kind: "mutation",
54461
54636
  auth: "protected"
54462
- });
54637
+ }), method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" });
54463
54638
  object({
54464
54639
  /** Ms epoch of the last press. null = never observed since this provider started. */
54465
54640
  lastPressedAt: number().nullable(),
@@ -64550,6 +64725,12 @@ Object.freeze({
64550
64725
  addonId: null,
64551
64726
  access: "view"
64552
64727
  },
64728
+ "dishwasher.getOptions": {
64729
+ capName: "dishwasher",
64730
+ capScope: "device",
64731
+ addonId: null,
64732
+ access: "view"
64733
+ },
64553
64734
  "dishwasher.getStatus": {
64554
64735
  capName: "dishwasher",
64555
64736
  capScope: "device",
@@ -64562,6 +64743,12 @@ Object.freeze({
64562
64743
  addonId: null,
64563
64744
  access: "create"
64564
64745
  },
64746
+ "dishwasher.resume": {
64747
+ capName: "dishwasher",
64748
+ capScope: "device",
64749
+ addonId: null,
64750
+ access: "create"
64751
+ },
64565
64752
  "dishwasher.setChildLock": {
64566
64753
  capName: "dishwasher",
64567
64754
  capScope: "device",
@@ -69062,6 +69249,12 @@ Object.freeze({
69062
69249
  addonId: null,
69063
69250
  access: "view"
69064
69251
  },
69252
+ "storageMigration.moverClearance": {
69253
+ capName: "storage-migration",
69254
+ capScope: "system",
69255
+ addonId: null,
69256
+ access: "view"
69257
+ },
69065
69258
  "storageMigration.movers": {
69066
69259
  capName: "storage-migration",
69067
69260
  capScope: "system",
@@ -71255,6 +71448,11 @@ Object.freeze({
71255
71448
  form: "single",
71256
71449
  optional: false
71257
71450
  }],
71451
+ "dishwasher.getOptions": [{
71452
+ name: "deviceId",
71453
+ form: "single",
71454
+ optional: false
71455
+ }],
71258
71456
  "dishwasher.getStatus": [{
71259
71457
  name: "deviceId",
71260
71458
  form: "single",
@@ -71265,6 +71463,11 @@ Object.freeze({
71265
71463
  form: "single",
71266
71464
  optional: false
71267
71465
  }],
71466
+ "dishwasher.resume": [{
71467
+ name: "deviceId",
71468
+ form: "single",
71469
+ optional: false
71470
+ }],
71268
71471
  "dishwasher.setChildLock": [{
71269
71472
  name: "deviceId",
71270
71473
  form: "single",
@@ -73351,6 +73554,9 @@ new Map(Object.entries({
73351
73554
  "wrapper-update-available": "system",
73352
73555
  "backup-completed": "system",
73353
73556
  "export-completed": "system",
73557
+ "alert-critical": "system",
73558
+ "alert-error": "system",
73559
+ "alert-critical-resolved": "system",
73354
73560
  "storage-location-low": "system",
73355
73561
  "storage-location-critical": "system",
73356
73562
  "storage-location-ok": "system",
@@ -73475,6 +73681,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
73475
73681
  "storage-location-ok"
73476
73682
  ]
73477
73683
  },
73684
+ {
73685
+ id: "alerts",
73686
+ family: "system",
73687
+ label: "Alerts",
73688
+ kinds: [
73689
+ "alert-critical",
73690
+ "alert-error",
73691
+ "alert-critical-resolved"
73692
+ ]
73693
+ },
73478
73694
  {
73479
73695
  id: "alarm",
73480
73696
  family: "alarm",
@@ -73519,6 +73735,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
73519
73735
  return [[descriptor.kind, field]];
73520
73736
  })));
73521
73737
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
73738
+ object({
73739
+ phase: _enum(["raised", "resolved"]),
73740
+ episodeId: string().min(1),
73741
+ alertId: string().min(1),
73742
+ severity: AlertSeveritySchema,
73743
+ category: string(),
73744
+ title: string(),
73745
+ message: string(),
73746
+ sourceType: string().optional(),
73747
+ sourceId: string().optional(),
73748
+ nodeId: string().optional(),
73749
+ /** The alert's own action link (where the operator acts on it), when it has one. */
73750
+ actionUrl: string().optional(),
73751
+ at: number()
73752
+ });
73522
73753
  var RULE_BODY_ONLY = ["body"];
73523
73754
  var RULE_TEXT = ["title", "body"];
73524
73755
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -73528,6 +73759,11 @@ var TANK = [
73528
73759
  "device-tank-full",
73529
73760
  "device-tank-normal"
73530
73761
  ];
73762
+ var ALERT_EPISODE = [
73763
+ "alert-critical",
73764
+ "alert-error",
73765
+ "alert-critical-resolved"
73766
+ ];
73531
73767
  var UPDATES = [
73532
73768
  "addon-update-available",
73533
73769
  "server-update-available",
@@ -73720,14 +73956,14 @@ var STATE_SUMMARY_VARS = [
73720
73956
  ([...RULE_TEXT], [...CONSUMABLE]),
73721
73957
  ([...RULE_TEXT], [...TANK]),
73722
73958
  [...RULE_TEXT],
73723
- ([...RULE_TEXT], [...UPDATES]),
73724
- ([...RULE_TEXT], [...UPDATES]),
73725
- [...RULE_TEXT],
73959
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
73960
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
73726
73961
  [...RULE_TEXT],
73727
73962
  [...RULE_TEXT],
73728
73963
  [...RULE_TEXT],
73729
73964
  [...RULE_TEXT],
73730
73965
  [...RULE_TEXT],
73966
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
73731
73967
  [...RULE_TEXT],
73732
73968
  [...RULE_TEXT],
73733
73969
  [...RULE_TEXT],
@@ -73745,7 +73981,11 @@ var STATE_SUMMARY_VARS = [
73745
73981
  [...RULE_TEXT],
73746
73982
  [...RULE_TEXT],
73747
73983
  [...RULE_TEXT],
73748
- [...RULE_TEXT],
73984
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
73985
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
73986
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
73987
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
73988
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
73749
73989
  [...RULE_TEXT],
73750
73990
  [...RULE_TEXT],
73751
73991
  [...RULE_TEXT],
@@ -83634,13 +83874,20 @@ function buildAlexaOauthIntegration(publicHubUrl) {
83634
83874
  function buildAlexaSetupBlock(input) {
83635
83875
  const base = input.publicHubUrl.replace(/\/+$/, "");
83636
83876
  return {
83637
- fields: [...base ? [{
83638
- label: "Directive endpoint",
83639
- value: `${base}/addon/export-alexa/directive`
83640
- }] : [], ...input.ingressToken && input.skillMode === "custom" ? [{
83641
- label: "Ingress token (Lambda HUB_INGRESS_TOKEN) — use \"Show ingress token\" in settings",
83642
- value: maskSecretTail(input.ingressToken)
83643
- }] : []],
83877
+ fields: [
83878
+ ...base ? [{
83879
+ label: "Hub address to enter in the Alexa app",
83880
+ value: base
83881
+ }] : [],
83882
+ ...base ? [{
83883
+ label: "Directive endpoint",
83884
+ value: `${base}/addon/export-alexa/directive`
83885
+ }] : [],
83886
+ ...input.ingressToken && input.skillMode === "custom" ? [{
83887
+ label: "Ingress token (Lambda HUB_INGRESS_TOKEN) — use \"Show ingress token\" in settings",
83888
+ value: maskSecretTail(input.ingressToken)
83889
+ }] : []
83890
+ ],
83644
83891
  note: base ? "Account linking is handled by the core OAuth server. Use the hub's /api/oauth2/authorize endpoint with integration=export-alexa." : "Set the public hub URL on the settings form first — the directive endpoint URL is derived from it."
83645
83892
  };
83646
83893
  }