@camstack/types 1.2.162 → 1.2.164

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 (38) hide show
  1. package/dist/addon.js +4 -3
  2. package/dist/addon.mjs +4 -3
  3. package/dist/capabilities/alerts.cap.d.ts +5 -5
  4. package/dist/capabilities/index.d.ts +7 -5
  5. package/dist/capabilities/motion.cap.d.ts +2 -0
  6. package/dist/capabilities/notifier.cap.d.ts +3 -3
  7. package/dist/capabilities/pet-feeder.cap.d.ts +4 -4
  8. package/dist/capabilities/pipeline-runner.cap.d.ts +19 -0
  9. package/dist/capabilities/snapshot.cap.d.ts +2 -2
  10. package/dist/capabilities/storage-occupancy.cap.d.ts +72 -0
  11. package/dist/capabilities/storage-provider.cap.d.ts +110 -0
  12. package/dist/capabilities/storage.cap.d.ts +43 -0
  13. package/dist/capabilities/stream-broker.cap.d.ts +1 -1
  14. package/dist/device/device-profile.d.ts +1 -1
  15. package/dist/enums/event-category.d.ts +13 -0
  16. package/dist/enums.js +1 -1
  17. package/dist/enums.mjs +1 -1
  18. package/dist/{event-category-b8kBSOTT.js → event-category-BVo6ta6_.js} +13 -0
  19. package/dist/{event-category-zAv7pMUz.mjs → event-category-CnLqLOKs.mjs} +13 -0
  20. package/dist/generated/addon-api.d.ts +22 -0
  21. package/dist/generated/capability-router-map.d.ts +5 -2
  22. package/dist/generated/collection-array-methods.d.ts +1 -1
  23. package/dist/generated/method-access-map.d.ts +1 -1
  24. package/dist/generated/system-proxy.d.ts +1 -1
  25. package/dist/index.d.ts +4 -2
  26. package/dist/index.js +914 -561
  27. package/dist/index.mjs +895 -562
  28. package/dist/interfaces/event-bus.d.ts +23 -2
  29. package/dist/interfaces/storage-location-mode.d.ts +135 -0
  30. package/dist/interfaces/storage-location.d.ts +54 -6
  31. package/dist/interfaces/stream-broker.d.ts +15 -0
  32. package/dist/node.d.ts +13 -11
  33. package/dist/node.js +935 -876
  34. package/dist/node.mjs +936 -879
  35. package/dist/{sleep-DDIFZGbc.js → sleep-BZtO-eFY.js} +1 -1
  36. package/dist/{sleep-Cfij6Jj9.mjs → sleep-Bd-Y4RUt.mjs} +1 -1
  37. package/dist/storage/physical-root.d.ts +25 -0
  38. package/package.json +1 -1
@@ -29,10 +29,20 @@ declare const BeginUploadInputSchema: z.ZodObject<{
29
29
  nodeId: z.ZodOptional<z.ZodString>;
30
30
  isSystem: z.ZodDefault<z.ZodBoolean>;
31
31
  enabled: z.ZodOptional<z.ZodBoolean>;
32
+ mode: z.ZodOptional<z.ZodEnum<{
33
+ readonly: "readonly";
34
+ active: "active";
35
+ drain: "drain";
36
+ disabled: "disabled";
37
+ }>>;
32
38
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
33
39
  totalBytes: z.ZodNumber;
34
40
  availableBytes: z.ZodNumber;
35
41
  }, z.core.$strip>>>;
42
+ owned: z.ZodOptional<z.ZodObject<{
43
+ bytes: z.ZodNumber;
44
+ measuredAtMs: z.ZodNumber;
45
+ }, z.core.$strip>>;
36
46
  createdAt: z.ZodNumber;
37
47
  updatedAt: z.ZodNumber;
38
48
  }, z.core.$strip>;
@@ -63,10 +73,20 @@ declare const BeginDownloadInputSchema: z.ZodObject<{
63
73
  nodeId: z.ZodOptional<z.ZodString>;
64
74
  isSystem: z.ZodDefault<z.ZodBoolean>;
65
75
  enabled: z.ZodOptional<z.ZodBoolean>;
76
+ mode: z.ZodOptional<z.ZodEnum<{
77
+ readonly: "readonly";
78
+ active: "active";
79
+ drain: "drain";
80
+ disabled: "disabled";
81
+ }>>;
66
82
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
67
83
  totalBytes: z.ZodNumber;
68
84
  availableBytes: z.ZodNumber;
69
85
  }, z.core.$strip>>>;
86
+ owned: z.ZodOptional<z.ZodObject<{
87
+ bytes: z.ZodNumber;
88
+ measuredAtMs: z.ZodNumber;
89
+ }, z.core.$strip>>;
70
90
  createdAt: z.ZodNumber;
71
91
  updatedAt: z.ZodNumber;
72
92
  }, z.core.$strip>;
@@ -158,10 +178,20 @@ export declare const storageProviderCapability: {
158
178
  nodeId: z.ZodOptional<z.ZodString>;
159
179
  isSystem: z.ZodDefault<z.ZodBoolean>;
160
180
  enabled: z.ZodOptional<z.ZodBoolean>;
181
+ mode: z.ZodOptional<z.ZodEnum<{
182
+ readonly: "readonly";
183
+ active: "active";
184
+ drain: "drain";
185
+ disabled: "disabled";
186
+ }>>;
161
187
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
162
188
  totalBytes: z.ZodNumber;
163
189
  availableBytes: z.ZodNumber;
164
190
  }, z.core.$strip>>>;
191
+ owned: z.ZodOptional<z.ZodObject<{
192
+ bytes: z.ZodNumber;
193
+ measuredAtMs: z.ZodNumber;
194
+ }, z.core.$strip>>;
165
195
  createdAt: z.ZodNumber;
166
196
  updatedAt: z.ZodNumber;
167
197
  }, z.core.$strip>;
@@ -177,10 +207,20 @@ export declare const storageProviderCapability: {
177
207
  nodeId: z.ZodOptional<z.ZodString>;
178
208
  isSystem: z.ZodDefault<z.ZodBoolean>;
179
209
  enabled: z.ZodOptional<z.ZodBoolean>;
210
+ mode: z.ZodOptional<z.ZodEnum<{
211
+ readonly: "readonly";
212
+ active: "active";
213
+ drain: "drain";
214
+ disabled: "disabled";
215
+ }>>;
180
216
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
181
217
  totalBytes: z.ZodNumber;
182
218
  availableBytes: z.ZodNumber;
183
219
  }, z.core.$strip>>>;
220
+ owned: z.ZodOptional<z.ZodObject<{
221
+ bytes: z.ZodNumber;
222
+ measuredAtMs: z.ZodNumber;
223
+ }, z.core.$strip>>;
184
224
  createdAt: z.ZodNumber;
185
225
  updatedAt: z.ZodNumber;
186
226
  }, z.core.$strip>;
@@ -197,10 +237,20 @@ export declare const storageProviderCapability: {
197
237
  nodeId: z.ZodOptional<z.ZodString>;
198
238
  isSystem: z.ZodDefault<z.ZodBoolean>;
199
239
  enabled: z.ZodOptional<z.ZodBoolean>;
240
+ mode: z.ZodOptional<z.ZodEnum<{
241
+ readonly: "readonly";
242
+ active: "active";
243
+ drain: "drain";
244
+ disabled: "disabled";
245
+ }>>;
200
246
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
201
247
  totalBytes: z.ZodNumber;
202
248
  availableBytes: z.ZodNumber;
203
249
  }, z.core.$strip>>>;
250
+ owned: z.ZodOptional<z.ZodObject<{
251
+ bytes: z.ZodNumber;
252
+ measuredAtMs: z.ZodNumber;
253
+ }, z.core.$strip>>;
204
254
  createdAt: z.ZodNumber;
205
255
  updatedAt: z.ZodNumber;
206
256
  }, z.core.$strip>;
@@ -216,10 +266,20 @@ export declare const storageProviderCapability: {
216
266
  nodeId: z.ZodOptional<z.ZodString>;
217
267
  isSystem: z.ZodDefault<z.ZodBoolean>;
218
268
  enabled: z.ZodOptional<z.ZodBoolean>;
269
+ mode: z.ZodOptional<z.ZodEnum<{
270
+ readonly: "readonly";
271
+ active: "active";
272
+ drain: "drain";
273
+ disabled: "disabled";
274
+ }>>;
219
275
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
220
276
  totalBytes: z.ZodNumber;
221
277
  availableBytes: z.ZodNumber;
222
278
  }, z.core.$strip>>>;
279
+ owned: z.ZodOptional<z.ZodObject<{
280
+ bytes: z.ZodNumber;
281
+ measuredAtMs: z.ZodNumber;
282
+ }, z.core.$strip>>;
223
283
  createdAt: z.ZodNumber;
224
284
  updatedAt: z.ZodNumber;
225
285
  }, z.core.$strip>;
@@ -235,10 +295,20 @@ export declare const storageProviderCapability: {
235
295
  nodeId: z.ZodOptional<z.ZodString>;
236
296
  isSystem: z.ZodDefault<z.ZodBoolean>;
237
297
  enabled: z.ZodOptional<z.ZodBoolean>;
298
+ mode: z.ZodOptional<z.ZodEnum<{
299
+ readonly: "readonly";
300
+ active: "active";
301
+ drain: "drain";
302
+ disabled: "disabled";
303
+ }>>;
238
304
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
239
305
  totalBytes: z.ZodNumber;
240
306
  availableBytes: z.ZodNumber;
241
307
  }, z.core.$strip>>>;
308
+ owned: z.ZodOptional<z.ZodObject<{
309
+ bytes: z.ZodNumber;
310
+ measuredAtMs: z.ZodNumber;
311
+ }, z.core.$strip>>;
242
312
  createdAt: z.ZodNumber;
243
313
  updatedAt: z.ZodNumber;
244
314
  }, z.core.$strip>;
@@ -254,10 +324,20 @@ export declare const storageProviderCapability: {
254
324
  nodeId: z.ZodOptional<z.ZodString>;
255
325
  isSystem: z.ZodDefault<z.ZodBoolean>;
256
326
  enabled: z.ZodOptional<z.ZodBoolean>;
327
+ mode: z.ZodOptional<z.ZodEnum<{
328
+ readonly: "readonly";
329
+ active: "active";
330
+ drain: "drain";
331
+ disabled: "disabled";
332
+ }>>;
257
333
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
258
334
  totalBytes: z.ZodNumber;
259
335
  availableBytes: z.ZodNumber;
260
336
  }, z.core.$strip>>>;
337
+ owned: z.ZodOptional<z.ZodObject<{
338
+ bytes: z.ZodNumber;
339
+ measuredAtMs: z.ZodNumber;
340
+ }, z.core.$strip>>;
261
341
  createdAt: z.ZodNumber;
262
342
  updatedAt: z.ZodNumber;
263
343
  }, z.core.$strip>;
@@ -273,10 +353,20 @@ export declare const storageProviderCapability: {
273
353
  nodeId: z.ZodOptional<z.ZodString>;
274
354
  isSystem: z.ZodDefault<z.ZodBoolean>;
275
355
  enabled: z.ZodOptional<z.ZodBoolean>;
356
+ mode: z.ZodOptional<z.ZodEnum<{
357
+ readonly: "readonly";
358
+ active: "active";
359
+ drain: "drain";
360
+ disabled: "disabled";
361
+ }>>;
276
362
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
277
363
  totalBytes: z.ZodNumber;
278
364
  availableBytes: z.ZodNumber;
279
365
  }, z.core.$strip>>>;
366
+ owned: z.ZodOptional<z.ZodObject<{
367
+ bytes: z.ZodNumber;
368
+ measuredAtMs: z.ZodNumber;
369
+ }, z.core.$strip>>;
280
370
  createdAt: z.ZodNumber;
281
371
  updatedAt: z.ZodNumber;
282
372
  }, z.core.$strip>;
@@ -291,10 +381,20 @@ export declare const storageProviderCapability: {
291
381
  nodeId: z.ZodOptional<z.ZodString>;
292
382
  isSystem: z.ZodDefault<z.ZodBoolean>;
293
383
  enabled: z.ZodOptional<z.ZodBoolean>;
384
+ mode: z.ZodOptional<z.ZodEnum<{
385
+ readonly: "readonly";
386
+ active: "active";
387
+ drain: "drain";
388
+ disabled: "disabled";
389
+ }>>;
294
390
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
295
391
  totalBytes: z.ZodNumber;
296
392
  availableBytes: z.ZodNumber;
297
393
  }, z.core.$strip>>>;
394
+ owned: z.ZodOptional<z.ZodObject<{
395
+ bytes: z.ZodNumber;
396
+ measuredAtMs: z.ZodNumber;
397
+ }, z.core.$strip>>;
298
398
  createdAt: z.ZodNumber;
299
399
  updatedAt: z.ZodNumber;
300
400
  }, z.core.$strip>;
@@ -324,10 +424,20 @@ export declare const storageProviderCapability: {
324
424
  nodeId: z.ZodOptional<z.ZodString>;
325
425
  isSystem: z.ZodDefault<z.ZodBoolean>;
326
426
  enabled: z.ZodOptional<z.ZodBoolean>;
427
+ mode: z.ZodOptional<z.ZodEnum<{
428
+ readonly: "readonly";
429
+ active: "active";
430
+ drain: "drain";
431
+ disabled: "disabled";
432
+ }>>;
327
433
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
328
434
  totalBytes: z.ZodNumber;
329
435
  availableBytes: z.ZodNumber;
330
436
  }, z.core.$strip>>>;
437
+ owned: z.ZodOptional<z.ZodObject<{
438
+ bytes: z.ZodNumber;
439
+ measuredAtMs: z.ZodNumber;
440
+ }, z.core.$strip>>;
331
441
  createdAt: z.ZodNumber;
332
442
  updatedAt: z.ZodNumber;
333
443
  }, z.core.$strip>;
@@ -96,10 +96,20 @@ export declare const storageCapability: {
96
96
  nodeId: z.ZodOptional<z.ZodString>;
97
97
  isSystem: z.ZodDefault<z.ZodBoolean>;
98
98
  enabled: z.ZodOptional<z.ZodBoolean>;
99
+ mode: z.ZodOptional<z.ZodEnum<{
100
+ readonly: "readonly";
101
+ active: "active";
102
+ drain: "drain";
103
+ disabled: "disabled";
104
+ }>>;
99
105
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
100
106
  totalBytes: z.ZodNumber;
101
107
  availableBytes: z.ZodNumber;
102
108
  }, z.core.$strip>>>;
109
+ owned: z.ZodOptional<z.ZodObject<{
110
+ bytes: z.ZodNumber;
111
+ measuredAtMs: z.ZodNumber;
112
+ }, z.core.$strip>>;
103
113
  createdAt: z.ZodNumber;
104
114
  updatedAt: z.ZodNumber;
105
115
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
@@ -131,10 +141,20 @@ export declare const storageCapability: {
131
141
  providerId: z.ZodString;
132
142
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
133
143
  isSystem: z.ZodDefault<z.ZodBoolean>;
144
+ mode: z.ZodOptional<z.ZodEnum<{
145
+ readonly: "readonly";
146
+ active: "active";
147
+ drain: "drain";
148
+ disabled: "disabled";
149
+ }>>;
134
150
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
135
151
  totalBytes: z.ZodNumber;
136
152
  availableBytes: z.ZodNumber;
137
153
  }, z.core.$strip>>>;
154
+ owned: z.ZodOptional<z.ZodObject<{
155
+ bytes: z.ZodNumber;
156
+ measuredAtMs: z.ZodNumber;
157
+ }, z.core.$strip>>;
138
158
  }, z.core.$strip>, z.ZodObject<{
139
159
  id: z.ZodString;
140
160
  type: z.ZodString;
@@ -144,10 +164,20 @@ export declare const storageCapability: {
144
164
  nodeId: z.ZodOptional<z.ZodString>;
145
165
  isSystem: z.ZodDefault<z.ZodBoolean>;
146
166
  enabled: z.ZodOptional<z.ZodBoolean>;
167
+ mode: z.ZodOptional<z.ZodEnum<{
168
+ readonly: "readonly";
169
+ active: "active";
170
+ drain: "drain";
171
+ disabled: "disabled";
172
+ }>>;
147
173
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
148
174
  totalBytes: z.ZodNumber;
149
175
  availableBytes: z.ZodNumber;
150
176
  }, z.core.$strip>>>;
177
+ owned: z.ZodOptional<z.ZodObject<{
178
+ bytes: z.ZodNumber;
179
+ measuredAtMs: z.ZodNumber;
180
+ }, z.core.$strip>>;
151
181
  createdAt: z.ZodNumber;
152
182
  updatedAt: z.ZodNumber;
153
183
  }, z.core.$strip>, "mutation">;
@@ -169,6 +199,19 @@ export declare const storageCapability: {
169
199
  id: z.ZodString;
170
200
  force: z.ZodOptional<z.ZodBoolean>;
171
201
  }, z.core.$strip>, z.ZodVoid, "mutation">;
202
+ /**
203
+ * How far each draining location has got (D386). A pure READ of what the
204
+ * last pressure sweep computed — it starts no work, and a location that is
205
+ * not draining simply does not appear.
206
+ */
207
+ readonly listDrainProgress: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodObject<{
208
+ locationId: z.ZodString;
209
+ startedAtMs: z.ZodNumber;
210
+ startBytes: z.ZodNumber;
211
+ bytesRemaining: z.ZodNumber;
212
+ drained: z.ZodBoolean;
213
+ estimatedEmptyAtMs: z.ZodNullable<z.ZodNumber>;
214
+ }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
172
215
  readonly testLocation: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
173
216
  id: z.ZodString;
174
217
  }, z.core.$strip>, z.ZodObject<{
@@ -294,10 +294,10 @@ export type BrokerDecodedClient = z.infer<typeof BrokerDecodedClientSchema>;
294
294
  export type BrokerAudioClient = z.infer<typeof BrokerAudioClientSchema>;
295
295
  export type BrokerClients = z.infer<typeof BrokerClientsSchema>;
296
296
  export declare const PlaceholderReasonSchema: z.ZodEnum<{
297
+ disabled: "disabled";
297
298
  sleeping: "sleeping";
298
299
  reconnecting: "reconnecting";
299
300
  offline: "offline";
300
- disabled: "disabled";
301
301
  waking: "waking";
302
302
  }>;
303
303
  export type PlaceholderReason = z.infer<typeof PlaceholderReasonSchema>;
@@ -105,7 +105,7 @@ export interface DeviceProfileDefaults {
105
105
  * explicitly to enable SW motion). PIR-sourced motion currently
106
106
  * flows through `'onboard'` because Reolink's accessory PIRs feed
107
107
  * the parent camera's firmware motion event channel. */
108
- readonly motionSources?: readonly ('onboard' | 'analyzer')[];
108
+ readonly motionSources?: import('../capabilities/pipeline-runner.cap.js').MotionSources;
109
109
  readonly audioMode?: PipelinePhaseMode;
110
110
  readonly detectionMode?: PipelinePhaseMode;
111
111
  }
@@ -192,6 +192,19 @@ export declare enum EventCategory {
192
192
  ProcessCrashed = "process.crashed",
193
193
  ProcessRestartScheduled = "process.restart_scheduled",
194
194
  ProcessRestarted = "process.restarted",
195
+ /**
196
+ * The SET of storage locations changed — one was created, edited, enabled,
197
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
198
+ *
199
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
200
+ * it must also converge on its own periodic path, because a dropped event
201
+ * must not leave a node writing to yesterday's disk set forever. It exists
202
+ * because there was NO signal at all — an operator who added a second
203
+ * recordings disk in the admin UI got nothing, and the recorder kept its
204
+ * resolved locations until something else happened to re-resolve them
205
+ * (D387). Payload `StorageLocationsChangedPayload`.
206
+ */
207
+ StorageLocationsChanged = "storage.locations-changed",
195
208
  RecordingStarted = "recording.started",
196
209
  RecordingStopped = "recording.stopped",
197
210
  RecordingError = "recording.error",
package/dist/enums.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_event_category = require("./event-category-b8kBSOTT.js");
2
+ const require_event_category = require("./event-category-BVo6ta6_.js");
3
3
  //#region src/enums/event-source-type.ts
4
4
  var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
5
5
  EventSourceType["Addon"] = "addon";
package/dist/enums.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as EventCategory } from "./event-category-zAv7pMUz.mjs";
1
+ import { t as EventCategory } from "./event-category-CnLqLOKs.mjs";
2
2
  //#region src/enums/event-source-type.ts
3
3
  var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
4
4
  EventSourceType["Addon"] = "addon";
@@ -193,6 +193,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
193
193
  EventCategory["ProcessCrashed"] = "process.crashed";
194
194
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
195
195
  EventCategory["ProcessRestarted"] = "process.restarted";
196
+ /**
197
+ * The SET of storage locations changed — one was created, edited, enabled,
198
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
199
+ *
200
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
201
+ * it must also converge on its own periodic path, because a dropped event
202
+ * must not leave a node writing to yesterday's disk set forever. It exists
203
+ * because there was NO signal at all — an operator who added a second
204
+ * recordings disk in the admin UI got nothing, and the recorder kept its
205
+ * resolved locations until something else happened to re-resolve them
206
+ * (D387). Payload `StorageLocationsChangedPayload`.
207
+ */
208
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
196
209
  EventCategory["RecordingStarted"] = "recording.started";
197
210
  EventCategory["RecordingStopped"] = "recording.stopped";
198
211
  EventCategory["RecordingError"] = "recording.error";
@@ -193,6 +193,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
193
193
  EventCategory["ProcessCrashed"] = "process.crashed";
194
194
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
195
195
  EventCategory["ProcessRestarted"] = "process.restarted";
196
+ /**
197
+ * The SET of storage locations changed — one was created, edited, enabled,
198
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
199
+ *
200
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
201
+ * it must also converge on its own periodic path, because a dropped event
202
+ * must not leave a node writing to yesterday's disk set forever. It exists
203
+ * because there was NO signal at all — an operator who added a second
204
+ * recordings disk in the admin UI got nothing, and the recorder kept its
205
+ * resolved locations until something else happened to re-resolve them
206
+ * (D387). Payload `StorageLocationsChangedPayload`.
207
+ */
208
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
196
209
  EventCategory["RecordingStarted"] = "recording.started";
197
210
  EventCategory["RecordingStopped"] = "recording.stopped";
198
211
  EventCategory["RecordingError"] = "recording.error";
@@ -104,6 +104,7 @@ import type { snapshotCapability } from '../capabilities/snapshot.cap.js';
104
104
  import type { ssoBridgeCapability } from '../capabilities/sso-bridge.cap.js';
105
105
  import type { storageEvictableCapability } from '../capabilities/storage-evictable.cap.js';
106
106
  import type { storageMigrationCapability } from '../capabilities/storage-migration.cap.js';
107
+ import type { storageOccupancyCapability } from '../capabilities/storage-occupancy.cap.js';
107
108
  import type { storageProviderCapability } from '../capabilities/storage-provider.cap.js';
108
109
  import type { storageCapability } from '../capabilities/storage.cap.js';
109
110
  import type { streamBrokerCapability } from '../capabilities/stream-broker.cap.js';
@@ -7415,6 +7416,13 @@ export type AppRouter = TrpcCoreRouter<{
7415
7416
  output: z.infer<typeof storageCapability.methods.deleteLocation.output>;
7416
7417
  meta: object;
7417
7418
  }>;
7419
+ listDrainProgress: TRPCQueryProcedure<{
7420
+ input: {
7421
+ nodeId?: string | undefined;
7422
+ } | undefined;
7423
+ output: z.infer<typeof storageCapability.methods.listDrainProgress.output>;
7424
+ meta: object;
7425
+ }>;
7418
7426
  testLocation: TRPCQueryProcedure<{
7419
7427
  input: {
7420
7428
  [x: string]: unknown;
@@ -7542,6 +7550,20 @@ export type AppRouter = TrpcCoreRouter<{
7542
7550
  meta: object;
7543
7551
  }>;
7544
7552
  }>>;
7553
+ storageOccupancy: TRPCBuiltRouter<{
7554
+ ctx: TrpcContext;
7555
+ meta: object;
7556
+ errorShape: AugmentedErrorShape;
7557
+ transformer: true;
7558
+ }, TRPCDecorateCreateRouterOptions<{
7559
+ getOccupancy: TRPCQueryProcedure<{
7560
+ input: {
7561
+ [x: string]: unknown;
7562
+ } & z.input<typeof storageOccupancyCapability.methods.getOccupancy.input>;
7563
+ output: z.infer<typeof storageOccupancyCapability.methods.getOccupancy.output>;
7564
+ meta: object;
7565
+ }>;
7566
+ }>>;
7545
7567
  storageProvider: TRPCBuiltRouter<{
7546
7568
  ctx: TrpcContext;
7547
7569
  meta: object;
@@ -127,6 +127,7 @@ export { ssoBridgeCapability } from '../capabilities/sso-bridge.cap.js';
127
127
  export { storageCapability } from '../capabilities/storage.cap.js';
128
128
  export { storageEvictableCapability } from '../capabilities/storage-evictable.cap.js';
129
129
  export { storageMigrationCapability } from '../capabilities/storage-migration.cap.js';
130
+ export { storageOccupancyCapability } from '../capabilities/storage-occupancy.cap.js';
130
131
  export { storageProviderCapability } from '../capabilities/storage-provider.cap.js';
131
132
  export { streamBrokerCapability } from '../capabilities/stream-broker.cap.js';
132
133
  export { streamCatalogCapability } from '../capabilities/stream-catalog.cap.js';
@@ -283,6 +284,7 @@ export declare const CAPABILITY_NAMES: {
283
284
  readonly storage: "storage";
284
285
  readonly storageEvictable: "storage-evictable";
285
286
  readonly storageMigration: "storage-migration";
287
+ readonly storageOccupancy: "storage-occupancy";
286
288
  readonly storageProvider: "storage-provider";
287
289
  readonly streamBroker: "stream-broker";
288
290
  readonly streamCatalog: "stream-catalog";
@@ -452,6 +454,7 @@ export interface CapabilityRouterMap<TRouter = unknown> {
452
454
  readonly storage: TRouter;
453
455
  readonly storageEvictable: TRouter;
454
456
  readonly storageMigration: TRouter;
457
+ readonly storageOccupancy: TRouter;
455
458
  readonly storageProvider: TRouter;
456
459
  readonly streamBroker: TRouter;
457
460
  readonly streamCatalog: TRouter;
@@ -483,8 +486,8 @@ export interface CapabilityRouterMap<TRouter = unknown> {
483
486
  export declare const SINGLETON_CAPABILITY_NAMES: readonly ["accessories", "addon-pages", "addon-settings", "addon-widgets", "addons", "admin-ui", "air-quality-sensor", "alarm-panel", "alerts", "ambient-light-sensor", "audio-analysis", "audio-analyzer", "audio-codec", "audio-metrics", "automation-control", "backup", "battery", "binary", "brightness", "button", "camera-credentials", "camera-pipeline-config", "camera-streams", "carbon-monoxide", "climate-control", "color", "connectivity", "consumables", "contact", "control", "core-blocks", "cover", "day-night", "decoder", "detection-pipeline", "device-adoption", "device-discovery", "device-manager", "device-ops", "device-state", "device-status", "doorbell", "enum-sensor", "event-emitter", "events", "face-gallery", "fan-control", "feature-probe", "filesystem-browse", "flood", "gas", "humidifier", "humidity-sensor", "image", "image-settings", "integrations", "intercom", "lawn-mower-control", "llm-runtime", "local-network", "lock-control", "media-player", "metrics-provider", "model-convert", "model-distributor", "motion", "motion-detection", "motion-trigger", "motion-zones", "native-object-detection", "navigation", "network-link", "network-quality", "nodes", "notification-rules", "notifier", "numeric-sensor", "osd", "osd-manager", "pet-feeder", "pipeline-analytics", "pipeline-executor", "pipeline-orchestrator", "pipeline-runner", "plate-gallery", "platform-probe", "power-meter", "presence", "pressure-sensor", "privacy-mask", "ptz", "ptz-autotrack", "reboot", "recording", "recording-export", "recording-signal", "scene-monitor", "script-runner", "server-management", "settings-store", "smoke", "snapshot", "sso-bridge", "storage", "storage-migration", "stream-broker", "stream-catalog", "stream-params", "switch", "system", "tamper", "temperature-sensor", "terminal-session", "toast", "update", "user-management", "vacuum-control", "valve", "vector-store", "vibration", "videoclips", "viewer-ui", "water-heater", "weather", "webrtc-session", "zone-analytics", "zone-rules", "zones"];
484
487
  /** Union of singleton capability names (literal string union). */
485
488
  export type SingletonCapabilityName = typeof SINGLETON_CAPABILITY_NAMES[number];
486
- /** Capability names whose mode is `collection` (27 caps). */
487
- export declare const COLLECTION_CAPABILITY_NAMES: readonly ["addon-pages-source", "addon-routes", "addon-widgets-source", "auth-provider", "broker", "connection-test", "custom-model-registry", "data-store-provider", "device-export", "device-provider", "embedding-encoder", "failure-contribution", "llm", "load-contribution", "log-channels", "log-destination", "login-method", "mesh-network", "mqtt-broker", "network-access", "notification-output", "oauth-integration", "smtp-provider", "storage-evictable", "storage-provider", "turn-provider", "user-passkeys"];
489
+ /** Capability names whose mode is `collection` (28 caps). */
490
+ export declare const COLLECTION_CAPABILITY_NAMES: readonly ["addon-pages-source", "addon-routes", "addon-widgets-source", "auth-provider", "broker", "connection-test", "custom-model-registry", "data-store-provider", "device-export", "device-provider", "embedding-encoder", "failure-contribution", "llm", "load-contribution", "log-channels", "log-destination", "login-method", "mesh-network", "mqtt-broker", "network-access", "notification-output", "oauth-integration", "smtp-provider", "storage-evictable", "storage-occupancy", "storage-provider", "turn-provider", "user-passkeys"];
488
491
  /** Union of collection capability names (literal string union). */
489
492
  export type CollectionCapabilityName = typeof COLLECTION_CAPABILITY_NAMES[number];
490
493
  /** Capability mode lookup at runtime — mirrors the `.cap.ts` definitions. */
@@ -8,7 +8,7 @@
8
8
  * barrel (`ALL_CAPABILITY_DEFINITIONS`), which would cost ~144MB RSS per
9
9
  * forked runner. See docs/decisions/adr-0028.md.
10
10
  *
11
- * Coverage: 20 collection caps, 33 array methods.
11
+ * Coverage: 21 collection caps, 34 array methods.
12
12
  */
13
13
  export declare const COLLECTION_ARRAY_METHODS: Readonly<Record<string, readonly string[]>>;
14
14
  /**
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 1019 method paths across 128 capabilities.
9
+ * Coverage: 1021 method paths across 129 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {
@@ -91,7 +91,7 @@ export interface SystemProxy {
91
91
  readonly recordingExport: Pick<InferProvider<typeof recordingExportCapability>, 'createExport' | 'getExport' | 'cancelExport' | 'deleteExport' | 'getDownloadUrl' | 'readExportBytes'>;
92
92
  readonly serverManagement: Pick<InferProvider<typeof serverManagementCapability>, 'getServerPackageStatus' | 'checkServerUpdate' | 'applyServerUpdate' | 'rollbackServerUpdate' | 'restartServer'>;
93
93
  readonly settingsStore: Pick<InferProvider<typeof settingsStoreCapability>, 'get' | 'set' | 'query' | 'insert' | 'insertMany' | 'update' | 'delete' | 'deleteWhere' | 'updateWhere' | 'count' | 'aggregate' | 'histogram' | 'isEmpty' | 'declareCollection'>;
94
- readonly storage: Pick<InferProvider<typeof storageCapability>, 'resolve' | 'write' | 'read' | 'exists' | 'list' | 'delete' | 'getAvailableSpace' | 'beginUpload' | 'writeChunk' | 'finalizeUpload' | 'abortUpload' | 'beginDownload' | 'readChunk' | 'endDownload' | 'listLocations' | 'listLocationDeclarations' | 'upsertLocation' | 'deleteLocation' | 'testLocation' | 'listProviders' | 'testConfig'>;
94
+ readonly storage: Pick<InferProvider<typeof storageCapability>, 'resolve' | 'write' | 'read' | 'exists' | 'list' | 'delete' | 'getAvailableSpace' | 'beginUpload' | 'writeChunk' | 'finalizeUpload' | 'abortUpload' | 'beginDownload' | 'readChunk' | 'endDownload' | 'listLocations' | 'listLocationDeclarations' | 'upsertLocation' | 'deleteLocation' | 'listDrainProgress' | 'testLocation' | 'listProviders' | 'testConfig'>;
95
95
  readonly storageMigration: Pick<InferProvider<typeof storageMigrationCapability>, 'plan' | 'start' | 'status' | 'cancel' | 'movers' | 'residue' | 'drain' | 'cleanupStart' | 'cleanupStatus' | 'cleanupCancel' | 'history'>;
96
96
  readonly streamBroker: Pick<InferProvider<typeof streamBrokerCapability>, 'fetchEventMedia' | 'listAllCameraStreams' | 'listAllProfileSlots' | 'getBrokerStats' | 'probeStream' | 'listClients' | 'killClient' | 'getStreamUrl' | 'getStreamWithCodec' | 'releaseStreamWithCodec' | 'acquireEgressTranscode' | 'releaseEgressTranscode' | 'subscribeAudioChunks' | 'pullAudioChunks' | 'unsubscribeAudioChunks' | 'subscribeFrames' | 'pullFrameHandles' | 'unsubscribeFrames' | 'setPreBufferDuration' | 'getPreBufferInfo' | 'getRtspPort' | 'getAllRtspEntries' | 'getRtspEntry' | 'regenerateRtspToken' | 'setRtspEnabled' | 'isRtspEnabled'>;
97
97
  readonly system: Pick<InferProvider<typeof systemCapability>, 'info' | 'health' | 'featureFlags' | 'networkAddresses' | 'getRetentionConfig' | 'setRetentionConfig' | 'forceRetentionCleanup' | 'getSiteLocation' | 'setSiteLocation' | 'detectSiteLocation' | 'getRequestCensus' | 'getLoadContributions' | 'getFailureContributions' | 'getLoggingSettings' | 'setLoggingSettings'>;
package/dist/index.d.ts CHANGED
@@ -86,10 +86,12 @@ export type * from './interfaces/server-analysis.js';
86
86
  export * from './interfaces/server-analysis.js';
87
87
  export type * from './interfaces/server-network.js';
88
88
  export type * from './interfaces/storage.js';
89
- export type { LegacyStorageLocationDefault, StorageLocation, StorageLocationRef, } from './interfaces/storage-location.js';
90
- export { isLocationEnabled, LegacyStorageLocationDefaultSchema, StorageLocationRefSchema, StorageLocationSchema, StorageLocationTypeSchema, } from './interfaces/storage-location.js';
89
+ export type { LegacyStorageLocationDefault, StorageDrainProgress, StorageLocation, StorageLocationRef, } from './interfaces/storage-location.js';
90
+ export { gbToBytes, isLocationEnabled, LegacyStorageLocationDefaultSchema, STORAGE_BYTES_PER_GB, StorageDrainProgressSchema, StorageLocationRefSchema, StorageLocationSchema, StorageLocationTypeSchema, } from './interfaces/storage-location.js';
91
91
  export type { StorageAccess, StorageLocationDeclaration, } from './interfaces/storage-location-declaration.js';
92
92
  export { STORAGE_ACCESS_FALLBACK, StorageAccessSchema, StorageLocationDeclarationSchema, } from './interfaces/storage-location-declaration.js';
93
+ export type { StorageEvictionPolicy, StorageLocationMode, StorageLocationModePatch, StorageLocationStateSource, } from './interfaces/storage-location-mode.js';
94
+ export { evictionPolicyForMode, evictionPolicyOfLocation, isStorageLocationMode, LEGACY_READ_ONLY_CONFIG_KEY, legacyModeOf, mayReadLocation, mayWriteToLocation, modeMayRead, modeMayWrite, resolveLocationMode, STORAGE_LOCATION_MODES, StorageEvictionPolicySchema, StorageLocationModeSchema, strippedOfLegacyReadOnly, withLocationMode, } from './interfaces/storage-location-mode.js';
93
95
  export * from './interfaces/stream-broker.js';
94
96
  export type * from './interfaces/task-handler.js';
95
97
  export type { Timezone, TimezoneDstRule, Weekday } from './interfaces/timezones.js';