@camstack/addon-auth 1.2.147 → 1.2.148

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.
@@ -5420,7 +5420,7 @@ var ZodIssueCode = {
5420
5420
  var ZodFirstPartyTypeKind;
5421
5421
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5422
5422
  //#endregion
5423
- //#region ../types/dist/sleep-DAX0-2v9.mjs
5423
+ //#region ../types/dist/sleep-DRqxtc0C.mjs
5424
5424
  /**
5425
5425
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5426
5426
  * window to float samples (D455).
@@ -8188,8 +8188,12 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
8188
8188
  kind: "mutation",
8189
8189
  auth: "admin"
8190
8190
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8191
+ object({
8192
+ code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
8193
+ params: record(string(), union([string(), number()])).optional()
8194
+ });
8191
8195
  //#endregion
8192
- //#region ../types/dist/err-msg-DX6i_MY4.mjs
8196
+ //#region ../types/dist/err-msg-DLerKiVO.mjs
8193
8197
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
8194
8198
  DeviceType["Camera"] = "camera";
8195
8199
  DeviceType["Hub"] = "hub";
@@ -8439,6 +8443,22 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8439
8443
  DeviceRole["Nightvision"] = "nightvision";
8440
8444
  DeviceRole["PrivacyMask"] = "privacy-mask";
8441
8445
  DeviceRole["Doorbell"] = "doorbell";
8446
+ /** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
8447
+ DeviceRole["CoverBlind"] = "cover-blind";
8448
+ /** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
8449
+ DeviceRole["CoverShutter"] = "cover-shutter";
8450
+ /** Exterior awning. HA `device_class: awning`. */
8451
+ DeviceRole["CoverAwning"] = "cover-awning";
8452
+ /** Curtain / drape. HA `device_class: curtain`. */
8453
+ DeviceRole["CoverCurtain"] = "cover-curtain";
8454
+ /** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
8455
+ DeviceRole["CoverGarage"] = "cover-garage";
8456
+ /** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
8457
+ DeviceRole["CoverGate"] = "cover-gate";
8458
+ /** Door. HA `device_class: door`. A security actuator: exports gate it. */
8459
+ DeviceRole["CoverDoor"] = "cover-door";
8460
+ /** Window. HA `device_class: window`. */
8461
+ DeviceRole["CoverWindow"] = "cover-window";
8442
8462
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
8443
8463
  * real Switch device for UI rendering / export adapters. */
8444
8464
  DeviceRole["BinaryHelper"] = "binary-helper";
@@ -8519,7 +8539,7 @@ function errMsg(err) {
8519
8539
  return String(err);
8520
8540
  }
8521
8541
  //#endregion
8522
- //#region ../types/dist/composition-C-WpVYTX.mjs
8542
+ //#region ../types/dist/composition-EQ9Ok0Ee.mjs
8523
8543
  /**
8524
8544
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8525
8545
  *
@@ -13038,7 +13058,9 @@ var ConfigTabDeclarationSchema = object({
13038
13058
  var ConfigSectionWithValuesSchema = object({
13039
13059
  id: string(),
13040
13060
  title: string(),
13061
+ titleKey: string().optional(),
13041
13062
  description: string().optional(),
13063
+ descriptionKey: string().optional(),
13042
13064
  style: _enum(["card", "accordion"]).optional(),
13043
13065
  defaultCollapsed: boolean().optional(),
13044
13066
  columns: union([
@@ -16296,6 +16318,9 @@ method(object({
16296
16318
  }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
16297
16319
  kind: "mutation",
16298
16320
  auth: "admin"
16321
+ }), method(object({ deviceId: number().int() }), object({ refs: array(string()).readonly() }), {
16322
+ kind: "mutation",
16323
+ auth: "admin"
16299
16324
  }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
16300
16325
  /**
16301
16326
  * device-history — the ONE mechanism for numeric history (D850).
@@ -37717,6 +37742,38 @@ var DeviceRegisterPayloadSchema = object({
37717
37742
  * omits it and the keyword backstop applies. */
37718
37743
  secretConfigPaths: array(string()).optional()
37719
37744
  });
37745
+ /** One deleted device, kept by device-manager so an addon that missed the
37746
+ * deletion can still learn of it (D865). Written by the delete path ONLY. */
37747
+ var DeviceTombstoneSchema = object({
37748
+ deviceId: number().int().positive(),
37749
+ /** Epoch ms the device was deleted. */
37750
+ deletedAt: number(),
37751
+ /** The addon that owned the device when it was deleted. */
37752
+ providerAddonId: string()
37753
+ });
37754
+ /** Data held for one device that device-manager no longer knows. */
37755
+ var OrphanDeviceDataSchema = object({
37756
+ deviceId: number().int().positive(),
37757
+ /** Rows/files per store (`<addonId>:<store>`). */
37758
+ stores: record(string(), number().int().nonnegative())
37759
+ });
37760
+ var CleanupDeletedDevicesResultSchema = object({
37761
+ /**
37762
+ * `skipped` — the absence check could not be trusted (a device-list read
37763
+ * failed or the two reads disagreed); nothing was listed or deleted.
37764
+ * `dry-run` — `devices` is what a confirmed run would delete.
37765
+ * `cleaned` — `devices` is what was deleted.
37766
+ */
37767
+ status: _enum([
37768
+ "skipped",
37769
+ "dry-run",
37770
+ "cleaned"
37771
+ ]),
37772
+ reason: string().nullable(),
37773
+ devices: array(OrphanDeviceDataSchema),
37774
+ /** Implementers that could not be asked (their stores are not in `devices`). */
37775
+ unreachable: array(string())
37776
+ });
37720
37777
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
37721
37778
  var DevicePersistConfigPayloadSchema = object({
37722
37779
  deviceId: number(),
@@ -37955,6 +38012,9 @@ method(object({
37955
38012
  }), method(object({ deviceId: number() }), object({ success: literal(true) }), {
37956
38013
  kind: "mutation",
37957
38014
  auth: "admin"
38015
+ }), method(object({ sinceMs: number() }), array(DeviceTombstoneSchema).readonly(), { auth: "admin" }), method(object({ confirm: boolean() }), CleanupDeletedDevicesResultSchema, {
38016
+ kind: "mutation",
38017
+ auth: "admin"
37958
38018
  }), method(object({ integrationId: string() }), object({ removed: number() }), {
37959
38019
  kind: "mutation",
37960
38020
  auth: "admin"
@@ -38417,6 +38477,72 @@ method(object({
38417
38477
  auth: "admin"
38418
38478
  });
38419
38479
  /**
38480
+ * `device-removal-hook` — the reliable way an addon learns a device was DELETED,
38481
+ * so it can delete what it keeps for that device (D865).
38482
+ *
38483
+ * ## Why an event was not enough
38484
+ *
38485
+ * `DeviceUnregistered` is telemetry and may be dropped (D8, D11). An addon that
38486
+ * hung its per-device clean-up on it left durable garbage whenever the event was
38487
+ * lost, the addon was down, or it was restarting at that moment — footage,
38488
+ * analytics rows and settings of device 4483 outlived the device. Loss of this
38489
+ * signal corrupts durable state, so it travels by RPC with a recorded fact
38490
+ * behind it (D8: "if loss would corrupt durable state, use RPC plus a reconcile").
38491
+ *
38492
+ * ## The three pieces
38493
+ *
38494
+ * 1. device-manager records a TOMBSTONE per deleted device
38495
+ * (`deviceManager.listDeletedSince`). The tombstone is written by the delete
38496
+ * path only — a device that is unregistered, offline or whose provider is
38497
+ * restarting is NOT deleted and gets none.
38498
+ * 2. After a delete, device-manager calls `onDeviceRemoved` on EVERY provider of
38499
+ * this collection, one by one, with bounded retries, logged.
38500
+ * 3. An implementer that was down asks `deviceManager.listDeletedSince` at start
38501
+ * (and periodically) and runs its own `onDeviceRemoved` for each tombstone it
38502
+ * may have missed. Reconcile is driven by tombstones, never by "the device is
38503
+ * not in the current list": a failed or partial list read must not destroy data.
38504
+ *
38505
+ * ## Contract for an implementer
38506
+ *
38507
+ * - **Idempotent.** It is called again by a retry, by a reconcile and by the
38508
+ * admin cleanup of data that predates tombstones. A device with nothing left
38509
+ * answers zero counts.
38510
+ * - **One key per store** in `counts`, deleted rows/files per store, so the log
38511
+ * line and the admin dry run can say where the data was.
38512
+ * - **Training datasets are NOT device data** and are never deleted by a hook.
38513
+ * - **Per-device SETTINGS are not hooked.** Configuration lives in the standard
38514
+ * per-device store (`ctx.settings.*DeviceStore`), which device-manager clears
38515
+ * for every addon centrally at delete time. This hook is for device DATA
38516
+ * that is not settings: footage, event media, analytics rows, history.
38517
+ * - A provider that cannot tell is allowed to throw; the caller retries it.
38518
+ *
38519
+ * `listDeviceData` is the read side of the admin "Clean data of deleted devices"
38520
+ * action: which device ids this addon holds data for, and how much per store. It
38521
+ * never deletes. device-manager decides which of those ids are absent from the
38522
+ * fleet, from TWO consistent reads of the device list (D49).
38523
+ */
38524
+ /** What a hook is told about the deletion. */
38525
+ var DeviceRemovedInputSchema = object({
38526
+ deviceId: number().int().positive(),
38527
+ /** Epoch ms the device was deleted (the tombstone's `deletedAt`). */
38528
+ deletedAt: number(),
38529
+ /** The addon that owned the device, as device-manager last knew it. */
38530
+ providerAddonId: string()
38531
+ });
38532
+ /** Rows/files/refs deleted, per store this implementer owns. */
38533
+ var DeviceRemovedResultSchema = object({ counts: record(string(), number().int().nonnegative()) });
38534
+ /** One (store, device) pair an implementer holds data for. */
38535
+ var DeviceDataEntrySchema = object({
38536
+ store: string(),
38537
+ deviceId: number().int().positive(),
38538
+ /** Rows (or files) held for the device in the store. */
38539
+ count: number().int().nonnegative()
38540
+ });
38541
+ method(DeviceRemovedInputSchema, DeviceRemovedResultSchema, {
38542
+ kind: "mutation",
38543
+ auth: "admin"
38544
+ }), method(_void(), array(DeviceDataEntrySchema).readonly(), { auth: "admin" });
38545
+ /**
38420
38546
  * `failure-contribution` — the capability an addon reports its OWN losses
38421
38547
  * through, per camera, with the denominator attached. It stores nothing.
38422
38548
  *
@@ -62975,6 +63101,12 @@ Object.freeze({
62975
63101
  addonId: null,
62976
63102
  access: "create"
62977
63103
  },
63104
+ "deviceManager.cleanupDeletedDevicesData": {
63105
+ capName: "device-manager",
63106
+ capScope: "system",
63107
+ addonId: null,
63108
+ access: "create"
63109
+ },
62978
63110
  "deviceManager.createDevice": {
62979
63111
  capName: "device-manager",
62980
63112
  capScope: "system",
@@ -63155,6 +63287,12 @@ Object.freeze({
63155
63287
  addonId: null,
63156
63288
  access: "view"
63157
63289
  },
63290
+ "deviceManager.listDeletedSince": {
63291
+ capName: "device-manager",
63292
+ capScope: "system",
63293
+ addonId: null,
63294
+ access: "view"
63295
+ },
63158
63296
  "deviceManager.listDeviceIdsByCaps": {
63159
63297
  capName: "device-manager",
63160
63298
  capScope: "system",
@@ -63563,6 +63701,18 @@ Object.freeze({
63563
63701
  addonId: null,
63564
63702
  access: "create"
63565
63703
  },
63704
+ "deviceRemovalHook.listDeviceData": {
63705
+ capName: "device-removal-hook",
63706
+ capScope: "system",
63707
+ addonId: null,
63708
+ access: "view"
63709
+ },
63710
+ "deviceRemovalHook.onDeviceRemoved": {
63711
+ capName: "device-removal-hook",
63712
+ capScope: "system",
63713
+ addonId: null,
63714
+ access: "create"
63715
+ },
63566
63716
  "deviceState.claimFields": {
63567
63717
  capName: "device-state",
63568
63718
  capScope: "system",
@@ -63995,6 +64145,12 @@ Object.freeze({
63995
64145
  addonId: null,
63996
64146
  access: "delete"
63997
64147
  },
64148
+ "keychain.deleteDeviceScope": {
64149
+ capName: "keychain",
64150
+ capScope: "system",
64151
+ addonId: null,
64152
+ access: "delete"
64153
+ },
63998
64154
  "keychain.getState": {
63999
64155
  capName: "keychain",
64000
64156
  capScope: "system",
@@ -70007,6 +70163,11 @@ Object.freeze({
70007
70163
  form: "single",
70008
70164
  optional: false
70009
70165
  }],
70166
+ "deviceRemovalHook.onDeviceRemoved": [{
70167
+ name: "deviceId",
70168
+ form: "single",
70169
+ optional: false
70170
+ }],
70010
70171
  "deviceState.claimFields": [{
70011
70172
  name: "deviceId",
70012
70173
  form: "single",
@@ -70196,6 +70357,11 @@ Object.freeze({
70196
70357
  form: "single",
70197
70358
  optional: false
70198
70359
  }],
70360
+ "keychain.deleteDeviceScope": [{
70361
+ name: "deviceId",
70362
+ form: "single",
70363
+ optional: false
70364
+ }],
70199
70365
  "lawnMowerControl.dock": [{
70200
70366
  name: "deviceId",
70201
70367
  form: "single",
@@ -72544,6 +72710,8 @@ new Set([
72544
72710
  "audio-tools",
72545
72711
  "audio-silence"
72546
72712
  ]);
72713
+ AppPageLangSchema.options;
72714
+ record(string().min(1), string());
72547
72715
  /**
72548
72716
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
72549
72717
  *
@@ -5386,7 +5386,7 @@ var ZodIssueCode = {
5386
5386
  var ZodFirstPartyTypeKind;
5387
5387
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5388
5388
  //#endregion
5389
- //#region ../types/dist/sleep-DAX0-2v9.mjs
5389
+ //#region ../types/dist/sleep-DRqxtc0C.mjs
5390
5390
  /**
5391
5391
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5392
5392
  * window to float samples (D455).
@@ -8154,8 +8154,12 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
8154
8154
  kind: "mutation",
8155
8155
  auth: "admin"
8156
8156
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8157
+ object({
8158
+ code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
8159
+ params: record(string(), union([string(), number()])).optional()
8160
+ });
8157
8161
  //#endregion
8158
- //#region ../types/dist/err-msg-DX6i_MY4.mjs
8162
+ //#region ../types/dist/err-msg-DLerKiVO.mjs
8159
8163
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
8160
8164
  DeviceType["Camera"] = "camera";
8161
8165
  DeviceType["Hub"] = "hub";
@@ -8405,6 +8409,22 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8405
8409
  DeviceRole["Nightvision"] = "nightvision";
8406
8410
  DeviceRole["PrivacyMask"] = "privacy-mask";
8407
8411
  DeviceRole["Doorbell"] = "doorbell";
8412
+ /** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
8413
+ DeviceRole["CoverBlind"] = "cover-blind";
8414
+ /** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
8415
+ DeviceRole["CoverShutter"] = "cover-shutter";
8416
+ /** Exterior awning. HA `device_class: awning`. */
8417
+ DeviceRole["CoverAwning"] = "cover-awning";
8418
+ /** Curtain / drape. HA `device_class: curtain`. */
8419
+ DeviceRole["CoverCurtain"] = "cover-curtain";
8420
+ /** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
8421
+ DeviceRole["CoverGarage"] = "cover-garage";
8422
+ /** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
8423
+ DeviceRole["CoverGate"] = "cover-gate";
8424
+ /** Door. HA `device_class: door`. A security actuator: exports gate it. */
8425
+ DeviceRole["CoverDoor"] = "cover-door";
8426
+ /** Window. HA `device_class: window`. */
8427
+ DeviceRole["CoverWindow"] = "cover-window";
8408
8428
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
8409
8429
  * real Switch device for UI rendering / export adapters. */
8410
8430
  DeviceRole["BinaryHelper"] = "binary-helper";
@@ -8485,7 +8505,7 @@ function errMsg(err) {
8485
8505
  return String(err);
8486
8506
  }
8487
8507
  //#endregion
8488
- //#region ../types/dist/composition-C-WpVYTX.mjs
8508
+ //#region ../types/dist/composition-EQ9Ok0Ee.mjs
8489
8509
  /**
8490
8510
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8491
8511
  *
@@ -13004,7 +13024,9 @@ var ConfigTabDeclarationSchema = object({
13004
13024
  var ConfigSectionWithValuesSchema = object({
13005
13025
  id: string(),
13006
13026
  title: string(),
13027
+ titleKey: string().optional(),
13007
13028
  description: string().optional(),
13029
+ descriptionKey: string().optional(),
13008
13030
  style: _enum(["card", "accordion"]).optional(),
13009
13031
  defaultCollapsed: boolean().optional(),
13010
13032
  columns: union([
@@ -16262,6 +16284,9 @@ method(object({
16262
16284
  }), method(object({ refs: RefListSchema }), KeychainResolveResultSchema, { auth: "admin" }), method(object({ refs: RefListSchema }), object({ deleted: number().int() }), {
16263
16285
  kind: "mutation",
16264
16286
  auth: "admin"
16287
+ }), method(object({ deviceId: number().int() }), object({ refs: array(string()).readonly() }), {
16288
+ kind: "mutation",
16289
+ auth: "admin"
16265
16290
  }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
16266
16291
  /**
16267
16292
  * device-history — the ONE mechanism for numeric history (D850).
@@ -37683,6 +37708,38 @@ var DeviceRegisterPayloadSchema = object({
37683
37708
  * omits it and the keyword backstop applies. */
37684
37709
  secretConfigPaths: array(string()).optional()
37685
37710
  });
37711
+ /** One deleted device, kept by device-manager so an addon that missed the
37712
+ * deletion can still learn of it (D865). Written by the delete path ONLY. */
37713
+ var DeviceTombstoneSchema = object({
37714
+ deviceId: number().int().positive(),
37715
+ /** Epoch ms the device was deleted. */
37716
+ deletedAt: number(),
37717
+ /** The addon that owned the device when it was deleted. */
37718
+ providerAddonId: string()
37719
+ });
37720
+ /** Data held for one device that device-manager no longer knows. */
37721
+ var OrphanDeviceDataSchema = object({
37722
+ deviceId: number().int().positive(),
37723
+ /** Rows/files per store (`<addonId>:<store>`). */
37724
+ stores: record(string(), number().int().nonnegative())
37725
+ });
37726
+ var CleanupDeletedDevicesResultSchema = object({
37727
+ /**
37728
+ * `skipped` — the absence check could not be trusted (a device-list read
37729
+ * failed or the two reads disagreed); nothing was listed or deleted.
37730
+ * `dry-run` — `devices` is what a confirmed run would delete.
37731
+ * `cleaned` — `devices` is what was deleted.
37732
+ */
37733
+ status: _enum([
37734
+ "skipped",
37735
+ "dry-run",
37736
+ "cleaned"
37737
+ ]),
37738
+ reason: string().nullable(),
37739
+ devices: array(OrphanDeviceDataSchema),
37740
+ /** Implementers that could not be asked (their stores are not in `devices`). */
37741
+ unreachable: array(string())
37742
+ });
37686
37743
  var DeviceRemovePayloadSchema = object({ deviceId: number() });
37687
37744
  var DevicePersistConfigPayloadSchema = object({
37688
37745
  deviceId: number(),
@@ -37921,6 +37978,9 @@ method(object({
37921
37978
  }), method(object({ deviceId: number() }), object({ success: literal(true) }), {
37922
37979
  kind: "mutation",
37923
37980
  auth: "admin"
37981
+ }), method(object({ sinceMs: number() }), array(DeviceTombstoneSchema).readonly(), { auth: "admin" }), method(object({ confirm: boolean() }), CleanupDeletedDevicesResultSchema, {
37982
+ kind: "mutation",
37983
+ auth: "admin"
37924
37984
  }), method(object({ integrationId: string() }), object({ removed: number() }), {
37925
37985
  kind: "mutation",
37926
37986
  auth: "admin"
@@ -38383,6 +38443,72 @@ method(object({
38383
38443
  auth: "admin"
38384
38444
  });
38385
38445
  /**
38446
+ * `device-removal-hook` — the reliable way an addon learns a device was DELETED,
38447
+ * so it can delete what it keeps for that device (D865).
38448
+ *
38449
+ * ## Why an event was not enough
38450
+ *
38451
+ * `DeviceUnregistered` is telemetry and may be dropped (D8, D11). An addon that
38452
+ * hung its per-device clean-up on it left durable garbage whenever the event was
38453
+ * lost, the addon was down, or it was restarting at that moment — footage,
38454
+ * analytics rows and settings of device 4483 outlived the device. Loss of this
38455
+ * signal corrupts durable state, so it travels by RPC with a recorded fact
38456
+ * behind it (D8: "if loss would corrupt durable state, use RPC plus a reconcile").
38457
+ *
38458
+ * ## The three pieces
38459
+ *
38460
+ * 1. device-manager records a TOMBSTONE per deleted device
38461
+ * (`deviceManager.listDeletedSince`). The tombstone is written by the delete
38462
+ * path only — a device that is unregistered, offline or whose provider is
38463
+ * restarting is NOT deleted and gets none.
38464
+ * 2. After a delete, device-manager calls `onDeviceRemoved` on EVERY provider of
38465
+ * this collection, one by one, with bounded retries, logged.
38466
+ * 3. An implementer that was down asks `deviceManager.listDeletedSince` at start
38467
+ * (and periodically) and runs its own `onDeviceRemoved` for each tombstone it
38468
+ * may have missed. Reconcile is driven by tombstones, never by "the device is
38469
+ * not in the current list": a failed or partial list read must not destroy data.
38470
+ *
38471
+ * ## Contract for an implementer
38472
+ *
38473
+ * - **Idempotent.** It is called again by a retry, by a reconcile and by the
38474
+ * admin cleanup of data that predates tombstones. A device with nothing left
38475
+ * answers zero counts.
38476
+ * - **One key per store** in `counts`, deleted rows/files per store, so the log
38477
+ * line and the admin dry run can say where the data was.
38478
+ * - **Training datasets are NOT device data** and are never deleted by a hook.
38479
+ * - **Per-device SETTINGS are not hooked.** Configuration lives in the standard
38480
+ * per-device store (`ctx.settings.*DeviceStore`), which device-manager clears
38481
+ * for every addon centrally at delete time. This hook is for device DATA
38482
+ * that is not settings: footage, event media, analytics rows, history.
38483
+ * - A provider that cannot tell is allowed to throw; the caller retries it.
38484
+ *
38485
+ * `listDeviceData` is the read side of the admin "Clean data of deleted devices"
38486
+ * action: which device ids this addon holds data for, and how much per store. It
38487
+ * never deletes. device-manager decides which of those ids are absent from the
38488
+ * fleet, from TWO consistent reads of the device list (D49).
38489
+ */
38490
+ /** What a hook is told about the deletion. */
38491
+ var DeviceRemovedInputSchema = object({
38492
+ deviceId: number().int().positive(),
38493
+ /** Epoch ms the device was deleted (the tombstone's `deletedAt`). */
38494
+ deletedAt: number(),
38495
+ /** The addon that owned the device, as device-manager last knew it. */
38496
+ providerAddonId: string()
38497
+ });
38498
+ /** Rows/files/refs deleted, per store this implementer owns. */
38499
+ var DeviceRemovedResultSchema = object({ counts: record(string(), number().int().nonnegative()) });
38500
+ /** One (store, device) pair an implementer holds data for. */
38501
+ var DeviceDataEntrySchema = object({
38502
+ store: string(),
38503
+ deviceId: number().int().positive(),
38504
+ /** Rows (or files) held for the device in the store. */
38505
+ count: number().int().nonnegative()
38506
+ });
38507
+ method(DeviceRemovedInputSchema, DeviceRemovedResultSchema, {
38508
+ kind: "mutation",
38509
+ auth: "admin"
38510
+ }), method(_void(), array(DeviceDataEntrySchema).readonly(), { auth: "admin" });
38511
+ /**
38386
38512
  * `failure-contribution` — the capability an addon reports its OWN losses
38387
38513
  * through, per camera, with the denominator attached. It stores nothing.
38388
38514
  *
@@ -62941,6 +63067,12 @@ Object.freeze({
62941
63067
  addonId: null,
62942
63068
  access: "create"
62943
63069
  },
63070
+ "deviceManager.cleanupDeletedDevicesData": {
63071
+ capName: "device-manager",
63072
+ capScope: "system",
63073
+ addonId: null,
63074
+ access: "create"
63075
+ },
62944
63076
  "deviceManager.createDevice": {
62945
63077
  capName: "device-manager",
62946
63078
  capScope: "system",
@@ -63121,6 +63253,12 @@ Object.freeze({
63121
63253
  addonId: null,
63122
63254
  access: "view"
63123
63255
  },
63256
+ "deviceManager.listDeletedSince": {
63257
+ capName: "device-manager",
63258
+ capScope: "system",
63259
+ addonId: null,
63260
+ access: "view"
63261
+ },
63124
63262
  "deviceManager.listDeviceIdsByCaps": {
63125
63263
  capName: "device-manager",
63126
63264
  capScope: "system",
@@ -63529,6 +63667,18 @@ Object.freeze({
63529
63667
  addonId: null,
63530
63668
  access: "create"
63531
63669
  },
63670
+ "deviceRemovalHook.listDeviceData": {
63671
+ capName: "device-removal-hook",
63672
+ capScope: "system",
63673
+ addonId: null,
63674
+ access: "view"
63675
+ },
63676
+ "deviceRemovalHook.onDeviceRemoved": {
63677
+ capName: "device-removal-hook",
63678
+ capScope: "system",
63679
+ addonId: null,
63680
+ access: "create"
63681
+ },
63532
63682
  "deviceState.claimFields": {
63533
63683
  capName: "device-state",
63534
63684
  capScope: "system",
@@ -63961,6 +64111,12 @@ Object.freeze({
63961
64111
  addonId: null,
63962
64112
  access: "delete"
63963
64113
  },
64114
+ "keychain.deleteDeviceScope": {
64115
+ capName: "keychain",
64116
+ capScope: "system",
64117
+ addonId: null,
64118
+ access: "delete"
64119
+ },
63964
64120
  "keychain.getState": {
63965
64121
  capName: "keychain",
63966
64122
  capScope: "system",
@@ -69973,6 +70129,11 @@ Object.freeze({
69973
70129
  form: "single",
69974
70130
  optional: false
69975
70131
  }],
70132
+ "deviceRemovalHook.onDeviceRemoved": [{
70133
+ name: "deviceId",
70134
+ form: "single",
70135
+ optional: false
70136
+ }],
69976
70137
  "deviceState.claimFields": [{
69977
70138
  name: "deviceId",
69978
70139
  form: "single",
@@ -70162,6 +70323,11 @@ Object.freeze({
70162
70323
  form: "single",
70163
70324
  optional: false
70164
70325
  }],
70326
+ "keychain.deleteDeviceScope": [{
70327
+ name: "deviceId",
70328
+ form: "single",
70329
+ optional: false
70330
+ }],
70165
70331
  "lawnMowerControl.dock": [{
70166
70332
  name: "deviceId",
70167
70333
  form: "single",
@@ -72510,6 +72676,8 @@ new Set([
72510
72676
  "audio-tools",
72511
72677
  "audio-silence"
72512
72678
  ]);
72679
+ AppPageLangSchema.options;
72680
+ record(string().min(1), string());
72513
72681
  /**
72514
72682
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
72515
72683
  *
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-DDdB_Mme.js");
5
+ const require_dist = require("../dist-C2ZA1nlf.js");
6
6
  let node_crypto = require("node:crypto");
7
7
  node_crypto = require_dist.__toESM(node_crypto);
8
8
  //#region ../../node_modules/jose/dist/webapi/lib/buffer_utils.js
@@ -1,4 +1,4 @@
1
- import { C as arrayItemFieldPath, D as toSecretFieldView, E as isSecretMarker, S as SECRET_CLEAR, T as isSecretClear, _ as requestMountPrefix, b as errMsg, c as authProviderCapability, d as loginMethodCapability, f as normalizeOrigin, g as pickRequestOrigin, h as parseAppPageLang, i as addonRoutesCapability, l as buildAddonRouteProvider, m as parseAppFlowRequest, n as APP_REFUSED_PATH, o as advertisedHubOrigins, p as oidcConnectionsCapability, r as SSO_STATE_COOKIE, s as appFlowLocation, t as APP_FLOW_DEFAULT_REDIRECT, u as claimedRequestOrigins, v as resolveIconKey, w as globalSecretScope, x as BaseAddon } from "../dist-BGsjH-S3.mjs";
1
+ import { C as arrayItemFieldPath, D as toSecretFieldView, E as isSecretMarker, S as SECRET_CLEAR, T as isSecretClear, _ as requestMountPrefix, b as errMsg, c as authProviderCapability, d as loginMethodCapability, f as normalizeOrigin, g as pickRequestOrigin, h as parseAppPageLang, i as addonRoutesCapability, l as buildAddonRouteProvider, m as parseAppFlowRequest, n as APP_REFUSED_PATH, o as advertisedHubOrigins, p as oidcConnectionsCapability, r as SSO_STATE_COOKIE, s as appFlowLocation, t as APP_FLOW_DEFAULT_REDIRECT, u as claimedRequestOrigins, v as resolveIconKey, w as globalSecretScope, x as BaseAddon } from "../dist-roKTj364.mjs";
2
2
  import * as crypto$1 from "node:crypto";
3
3
  //#region ../../node_modules/jose/dist/webapi/lib/buffer_utils.js
4
4
  var encoder = new TextEncoder(), decoder = new TextDecoder(), strictDecoder = new TextDecoder("utf-8", { fatal: !0 });