@camstack/types 1.2.375 → 1.2.377

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.
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-rqlHXgwb.js");
2
+ const require_sleep = require("./sleep-Dq0Uyeh0.js");
3
3
  const require_event_category = require("./event-category-T43rdQWR.js");
4
- const require_composition = require("./composition-DIp0uE_b.js");
4
+ const require_composition = require("./composition-CUAOHZ38.js");
5
5
  const require_node_color = require("./node-color.js");
6
- const require_err_msg = require("./err-msg-Ls8Q6dHO.js");
6
+ const require_err_msg = require("./err-msg-Bb-s4Xuj.js");
7
7
  const require_enums = require("./enums.js");
8
8
  let zod = require("zod");
9
9
  //#region src/media/media-owner-key.ts
@@ -13900,6 +13900,91 @@ id: zod.z.union([zod.z.string(), zod.z.number()]) }), {
13900
13900
  }
13901
13901
  };
13902
13902
  //#endregion
13903
+ //#region src/capabilities/storage-admin.cap.ts
13904
+ /** One table of the settings database. */
13905
+ var StorageTableSchema = zod.z.object({
13906
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
13907
+ name: zod.z.string(),
13908
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
13909
+ owner: zod.z.string().nullable(),
13910
+ rows: zod.z.number().int().nonnegative(),
13911
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
13912
+ bytes: zod.z.number().int().nonnegative().nullable(),
13913
+ /** Declared by an addon since this engine process started (a running addon claims it). */
13914
+ declaredThisBoot: zod.z.boolean()
13915
+ });
13916
+ /**
13917
+ * The collections retired by exact name: the D870 ones (their data became keys
13918
+ * of the camera's settings) and the three D871 leftovers (the `stats-5m` tables
13919
+ * superseded by `stats-5m-v2`, and the unread `vec_object_clip`). No addon
13920
+ * declares any of them any more; the engine still refuses one a running addon
13921
+ * declared this boot. `dropCollection` may remove these, the
13922
+ * per-addon scoped `addon-settings` / `addon-devices` / `sections` tables, and
13923
+ * the tables of owners that are no longer installed - nothing else.
13924
+ */
13925
+ var STORAGE_ADMIN_MOVED_COLLECTIONS = [
13926
+ "stream-broker:probe-snapshots",
13927
+ "stream-broker:profile-map",
13928
+ "stream-broker:rtsp-tokens",
13929
+ "notification-center:device-mutes",
13930
+ "recorder:recording-configs",
13931
+ "pipeline-orchestrator:device-features",
13932
+ "pipeline-analytics:stats-5m",
13933
+ "pipeline-orchestrator:stats-5m",
13934
+ "vec_object_clip"
13935
+ ];
13936
+ /** The per-addon blob tables a scoped name may carry. */
13937
+ var STORAGE_ADMIN_SCOPED_BASES = [
13938
+ "addon-settings",
13939
+ "addon-devices",
13940
+ "sections"
13941
+ ];
13942
+ /**
13943
+ * storage-admin - the operator's maintenance reach into the settings database:
13944
+ * list its tables, drop one that nothing owns any more (D870).
13945
+ *
13946
+ * Hub-only, internal and `auth: 'admin'` explicitly (`internal` does not gate
13947
+ * the mount, see `data-store-provider`). Both methods are LOGGED by the engine
13948
+ * with the table and the counts. `dropCollection` is a ONE-SHOT of the D870
13949
+ * migration and is marked for removal once the last hub has run it.
13950
+ *
13951
+ * `listTables` is READ-ONLY: it never creates a table, which `count` and `get`
13952
+ * on an undeclared scoped name used to do.
13953
+ */
13954
+ var storageAdminCapability = {
13955
+ name: "storage-admin",
13956
+ scope: "system",
13957
+ mode: "singleton",
13958
+ internal: true,
13959
+ methods: {
13960
+ /**
13961
+ * Every table of the settings database with its row count and size,
13962
+ * optionally only those owned by `ownerPrefix`. Reads only.
13963
+ */
13964
+ listTables: require_sleep.method(zod.z.object({ ownerPrefix: zod.z.string().min(1).optional() }), zod.z.object({ tables: zod.z.array(StorageTableSchema) }), { auth: "admin" }),
13965
+ /**
13966
+ * Drop one table. REFUSES when an addon declared it since the engine
13967
+ * started (a running addon still owns it), when it is an engine or
13968
+ * canonical table, when it does not exist, or when its row count is not
13969
+ * `expectRows` - the caller states what it believes it is deleting. The
13970
+ * engine also refuses anything but `<owner>:(addon-settings|addon-devices|
13971
+ * sections)`, the retired collections by name, and tables of owners that
13972
+ * are not installed (and refuses when it cannot read the installed list).
13973
+ * Removed with the D870 migration script once the last hub ran it.
13974
+ */
13975
+ dropCollection: require_sleep.method(zod.z.object({
13976
+ collection: zod.z.string().min(1),
13977
+ expectRows: zod.z.number().int().nonnegative()
13978
+ }), zod.z.object({
13979
+ dropped: zod.z.literal(true),
13980
+ rows: zod.z.number().int().nonnegative()
13981
+ }), {
13982
+ kind: "mutation",
13983
+ auth: "admin"
13984
+ })
13985
+ }
13986
+ };
13987
+ //#endregion
13903
13988
  //#region src/capabilities/keychain.cap.ts
13904
13989
  /**
13905
13990
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -14647,6 +14732,24 @@ var keychainAdminCapability = {
14647
14732
  auth: "admin",
14648
14733
  caller: "required"
14649
14734
  }),
14735
+ /**
14736
+ * Store a value an operator tool carries over from a retired store at an
14737
+ * addon's own ref (`secret://<owner>/<scope>/<path>`) and answer the ref -
14738
+ * the D870 migration moves a camera's restream tokens this way, so they
14739
+ * never sit in a settings row as plaintext. Audited as the operator; the
14740
+ * caller then writes the MARKER of the ref where the value used to be.
14741
+ */
14742
+ importSecret: require_sleep.method(zod.z.object({
14743
+ ref: zod.z.string().min(1),
14744
+ value: zod.z.string().min(1)
14745
+ }), zod.z.object({
14746
+ ref: zod.z.string(),
14747
+ version: zod.z.number().int()
14748
+ }), {
14749
+ kind: "mutation",
14750
+ auth: "admin",
14751
+ caller: "required"
14752
+ }),
14650
14753
  /** Delete refs no owner points at any more. Re-checked here; `unknown` is kept. */
14651
14754
  deleteOrphans: require_sleep.method(zod.z.object({ refs: zod.z.array(zod.z.string().min(1)).max(1e3) }), zod.z.object({
14652
14755
  deleted: zod.z.array(zod.z.string()).readonly(),
@@ -59598,6 +59701,12 @@ var ClimateControlStatusSchema = zod.z.object({
59598
59701
  /** Horizontal louver swing on/off. Null when the device has no
59599
59702
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
59600
59703
  swingHorizontal: zod.z.boolean().nullable(),
59704
+ /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
59705
+ minTemp: zod.z.number().nullable().optional(),
59706
+ /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
59707
+ maxTemp: zod.z.number().nullable().optional(),
59708
+ /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
59709
+ tempStep: zod.z.number().positive().nullable().optional(),
59601
59710
  /** Ms epoch when the slice was last updated (push or command). */
59602
59711
  lastFetchedAt: zod.z.number()
59603
59712
  });
@@ -79399,6 +79508,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
79399
79508
  addonId: null,
79400
79509
  access: "create"
79401
79510
  },
79511
+ "keychainAdmin.importSecret": {
79512
+ capName: "keychain-admin",
79513
+ capScope: "system",
79514
+ addonId: null,
79515
+ access: "create"
79516
+ },
79402
79517
  "keychainAdmin.listAudit": {
79403
79518
  capName: "keychain-admin",
79404
79519
  capScope: "system",
@@ -83185,6 +83300,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
83185
83300
  addonId: null,
83186
83301
  access: "create"
83187
83302
  },
83303
+ "storageAdmin.dropCollection": {
83304
+ capName: "storage-admin",
83305
+ capScope: "system",
83306
+ addonId: null,
83307
+ access: "delete"
83308
+ },
83309
+ "storageAdmin.listTables": {
83310
+ capName: "storage-admin",
83311
+ capScope: "system",
83312
+ addonId: null,
83313
+ access: "view"
83314
+ },
83188
83315
  "storageEvictable.evict": {
83189
83316
  capName: "storage-evictable",
83190
83317
  capScope: "system",
@@ -84740,6 +84867,7 @@ var KNOWN_CAP_NAMES = [
84740
84867
  "snapshot",
84741
84868
  "sso-bridge",
84742
84869
  "storage",
84870
+ "storage-admin",
84743
84871
  "storage-evictable",
84744
84872
  "storage-migration",
84745
84873
  "storage-occupancy",
@@ -84937,6 +85065,7 @@ var SYSTEM_CAP_NAMES = [
84937
85065
  "smtp-provider",
84938
85066
  "sso-bridge",
84939
85067
  "storage",
85068
+ "storage-admin",
84940
85069
  "storage-evictable",
84941
85070
  "storage-migration",
84942
85071
  "storage-occupancy",
@@ -87012,6 +87141,7 @@ var CAPABILITY_NAMES = {
87012
87141
  snapshot: "snapshot",
87013
87142
  ssoBridge: "sso-bridge",
87014
87143
  storage: "storage",
87144
+ storageAdmin: "storage-admin",
87015
87145
  storageEvictable: "storage-evictable",
87016
87146
  storageMigration: "storage-migration",
87017
87147
  storageOccupancy: "storage-occupancy",
@@ -87615,6 +87745,10 @@ var CAPABILITY_ROUTER_KEYS = [
87615
87745
  key: "storage",
87616
87746
  name: "storage"
87617
87747
  },
87748
+ {
87749
+ key: "storageAdmin",
87750
+ name: "storage-admin"
87751
+ },
87618
87752
  {
87619
87753
  key: "storageEvictable",
87620
87754
  name: "storage-evictable"
@@ -87896,6 +88030,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
87896
88030
  snapshotCapability,
87897
88031
  ssoBridgeCapability,
87898
88032
  storageCapability,
88033
+ storageAdminCapability,
87899
88034
  storageEvictableCapability,
87900
88035
  storageMigrationCapability,
87901
88036
  storageOccupancyCapability,
@@ -91954,6 +92089,7 @@ function createSystemProxy(api) {
91954
92089
  listAudit: (input) => dispatch("keychainAdmin", "listAudit", "query", input),
91955
92090
  reveal: (input) => dispatch("keychainAdmin", "reveal", "mutation", input),
91956
92091
  setSystemSecret: (input) => dispatch("keychainAdmin", "setSystemSecret", "mutation", input),
92092
+ importSecret: (input) => dispatch("keychainAdmin", "importSecret", "mutation", input),
91957
92093
  deleteOrphans: (input) => dispatch("keychainAdmin", "deleteOrphans", "mutation", input),
91958
92094
  rotateMasterKey: (input) => dispatch("keychainAdmin", "rotateMasterKey", "mutation", input),
91959
92095
  purgeRetiredKeys: (input) => dispatch("keychainAdmin", "purgeRetiredKeys", "mutation", input),
@@ -102590,6 +102726,8 @@ exports.STATE_LABELS = STATE_LABELS;
102590
102726
  exports.STATE_LABEL_KEYS = STATE_LABEL_KEYS;
102591
102727
  exports.STATIONARY_OVERLAY_STYLE = STATIONARY_OVERLAY_STYLE;
102592
102728
  exports.STORAGE_ACCESS_FALLBACK = STORAGE_ACCESS_FALLBACK;
102729
+ exports.STORAGE_ADMIN_MOVED_COLLECTIONS = STORAGE_ADMIN_MOVED_COLLECTIONS;
102730
+ exports.STORAGE_ADMIN_SCOPED_BASES = STORAGE_ADMIN_SCOPED_BASES;
102593
102731
  exports.STORAGE_BYTES_PER_GB = STORAGE_BYTES_PER_GB;
102594
102732
  exports.STORAGE_LOCATION_MODES = STORAGE_LOCATION_MODES;
102595
102733
  exports.STREAM_PROFILE_META = STREAM_PROFILE_META;
@@ -102697,6 +102835,7 @@ exports.StorageMigrationSourcesSchema = StorageMigrationSourcesSchema;
102697
102835
  exports.StorageOccupancyReportSchema = StorageOccupancyReportSchema;
102698
102836
  exports.StorageProviderInfoSchema = ProviderInfoSchema;
102699
102837
  exports.StorageReadChunkInputSchema = ReadChunkInputSchema;
102838
+ exports.StorageTableSchema = StorageTableSchema;
102700
102839
  exports.StorageTestLocationResultSchema = TestLocationResultSchema;
102701
102840
  exports.StorageWriteChunkInputSchema = WriteChunkInputSchema;
102702
102841
  exports.StreamCodecSchema = StreamCodecSchema;
@@ -102999,6 +103138,7 @@ exports.classifyCamerasForBenchmark = classifyCamerasForBenchmark;
102999
103138
  exports.classifyInferenceHardware = classifyInferenceHardware;
103000
103139
  exports.classifyRetrainReview = classifyRetrainReview;
103001
103140
  exports.classifySecretWrite = require_sleep.classifySecretWrite;
103141
+ exports.classifyStoreError = require_sleep.classifyStoreError;
103002
103142
  exports.classifyStream = classifyStream;
103003
103143
  exports.classifyStreams = classifyStreams;
103004
103144
  exports.clearKnownSecrets = require_sleep.clearKnownSecrets;
@@ -103624,6 +103764,7 @@ exports.stateLabel = stateLabel;
103624
103764
  exports.stateVocabularyFor = stateVocabularyFor;
103625
103765
  exports.stepModelRunsOnFormat = stepModelRunsOnFormat;
103626
103766
  exports.stepSettingSource = stepSettingSource;
103767
+ exports.storageAdminCapability = storageAdminCapability;
103627
103768
  exports.storageCapability = storageCapability;
103628
103769
  exports.storageEvictableCapability = storageEvictableCapability;
103629
103770
  exports.storageMigrationCapability = storageMigrationCapability;