@camstack/addon-remote-storage 1.1.27 → 1.1.28

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/s3.addon.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-ChSRaxCw.js");
5
+ const require_shared = require("./shared-EwybxG9c.js");
6
6
  let node_stream = require("node:stream");
7
7
  let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
8
8
  let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
package/dist/s3.addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as BaseAddon, i as rearmIdleAbort, n as getOptionalBasePath, o as scheduleIdleAbort, s as storageProviderCapability, t as createSessionId } from "./shared-fXbGPtd5.mjs";
1
+ import { c as BaseAddon, i as rearmIdleAbort, n as getOptionalBasePath, o as scheduleIdleAbort, s as storageProviderCapability, t as createSessionId } from "./shared-DwOLwiOT.mjs";
2
2
  import { PassThrough } from "node:stream";
3
3
  import { DeleteObjectCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectsV2Command, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
4
4
  import { Upload } from "@aws-sdk/lib-storage";
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-ChSRaxCw.js");
5
+ const require_shared = require("./shared-EwybxG9c.js");
6
6
  let ssh2 = require("ssh2");
7
7
  let node_path = require("node:path");
8
8
  node_path = require_shared.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-fXbGPtd5.mjs";
1
+ import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-DwOLwiOT.mjs";
2
2
  import { Client } from "ssh2";
3
3
  import * as path from "node:path";
4
4
  //#region src/providers/sftp/sftp-config-schema.ts
@@ -7329,6 +7329,62 @@ var RecordingConfigSchema = object({
7329
7329
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7330
7330
  });
7331
7331
  /**
7332
+ * Ops-log — the durable, append-only operations audit shared by the
7333
+ * recordings and events management surfaces.
7334
+ *
7335
+ * ONE row shape is reused for both domains so a single "Activity" view can
7336
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7337
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7338
+ * management operation, WHY it ran (reason), and its measurable effect
7339
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7340
+ * never fail the operation it records.
7341
+ */
7342
+ /** Which management domain the operation belongs to. */
7343
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7344
+ /** The kind of management operation performed. */
7345
+ var OpsLogOpSchema = _enum([
7346
+ "prune",
7347
+ "manual-delete",
7348
+ "rescan",
7349
+ "retention-run"
7350
+ ]);
7351
+ /** Why the operation ran. */
7352
+ var OpsLogReasonSchema = _enum([
7353
+ "retention",
7354
+ "quota",
7355
+ "manual",
7356
+ "operator"
7357
+ ]);
7358
+ /** One audit row, shared verbatim by both domains. */
7359
+ var OpsLogEntrySchema = object({
7360
+ /** Unique row id. */
7361
+ id: string(),
7362
+ /** Epoch ms the operation completed. */
7363
+ at: number(),
7364
+ domain: OpsLogDomainSchema,
7365
+ op: OpsLogOpSchema,
7366
+ reason: OpsLogReasonSchema,
7367
+ /** The camera the op targeted; null for a cluster/global op. */
7368
+ deviceId: number().nullable(),
7369
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7370
+ nodeId: string(),
7371
+ /** Buckets / rows deleted (op-specific unit). */
7372
+ itemsAffected: number(),
7373
+ /** Bytes reclaimed by the op (0 when not measurable). */
7374
+ bytesReclaimed: number(),
7375
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7376
+ detail: string().nullable(),
7377
+ /** Who/what triggered the op. */
7378
+ actor: string()
7379
+ });
7380
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7381
+ var OpsLogQueryInputSchema = object({
7382
+ /** Restrict to a single camera; omit for every row. */
7383
+ deviceId: number().optional(),
7384
+ /** Max rows returned, newest-first. */
7385
+ limit: number().int().min(1).max(1e3).optional()
7386
+ });
7387
+ /**
7332
7388
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7333
7389
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7334
7390
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -16129,6 +16185,26 @@ var TrackCascadeCountsSchema = object({
16129
16185
  /** Per-track CLIP search vectors removed (best-effort). */
16130
16186
  embeddings: number().int()
16131
16187
  });
16188
+ /** Event-store footprint for one camera. */
16189
+ var EventStoreDeviceFootprintSchema = object({
16190
+ deviceId: number(),
16191
+ /** Persisted event rows (motion + object + audio) for the camera. */
16192
+ rows: number().int(),
16193
+ /** Event-owned media bytes on disk for the camera. */
16194
+ bytes: number().int()
16195
+ });
16196
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16197
+ var EventStoreFootprintSchema = object({
16198
+ totalRows: number().int(),
16199
+ totalBytes: number().int(),
16200
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16201
+ });
16202
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16203
+ var EventPruneCountsSchema = object({
16204
+ motion: number().int(),
16205
+ object: number().int(),
16206
+ audio: number().int()
16207
+ });
16132
16208
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16133
16209
  deviceId: number(),
16134
16210
  trackId: string()
@@ -16192,6 +16268,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16192
16268
  }), {
16193
16269
  kind: "mutation",
16194
16270
  auth: "admin"
16271
+ }), method(object({}), EventStoreFootprintSchema, {
16272
+ kind: "query",
16273
+ auth: "admin"
16274
+ }), method(object({
16275
+ olderThanMs: number(),
16276
+ reason: OpsLogReasonSchema.optional()
16277
+ }), EventPruneCountsSchema, {
16278
+ kind: "mutation",
16279
+ auth: "admin"
16280
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16281
+ kind: "mutation",
16282
+ auth: "admin"
16283
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16284
+ kind: "query",
16285
+ auth: "admin"
16195
16286
  }), method(object({
16196
16287
  eventId: string(),
16197
16288
  kind: MediaFileKindEnum.optional()
@@ -19470,13 +19561,29 @@ method(object({
19470
19561
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19471
19562
  kind: "mutation",
19472
19563
  auth: "admin"
19473
- }), method(object({ deviceId: number() }), object({
19564
+ }), method(object({
19565
+ deviceId: number(),
19566
+ reason: OpsLogReasonSchema.optional()
19567
+ }), object({
19474
19568
  floorMs: number().nullable(),
19475
19569
  deletedBuckets: number().int(),
19476
19570
  reclaimedBytes: number().int()
19477
19571
  }), {
19478
19572
  kind: "mutation",
19479
19573
  auth: "admin"
19574
+ }), method(object({
19575
+ deviceId: number(),
19576
+ fromMs: number().optional(),
19577
+ toMs: number().optional()
19578
+ }), object({
19579
+ deletedBuckets: number().int(),
19580
+ reclaimedBytes: number().int()
19581
+ }), {
19582
+ kind: "mutation",
19583
+ auth: "admin"
19584
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19585
+ kind: "query",
19586
+ auth: "admin"
19480
19587
  });
19481
19588
  /**
19482
19589
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22598,6 +22705,12 @@ Object.freeze({
22598
22705
  addonId: null,
22599
22706
  access: "delete"
22600
22707
  },
22708
+ "pipelineAnalytics.deleteDeviceEvents": {
22709
+ capName: "pipeline-analytics",
22710
+ capScope: "device",
22711
+ addonId: null,
22712
+ access: "delete"
22713
+ },
22601
22714
  "pipelineAnalytics.deleteTracks": {
22602
22715
  capName: "pipeline-analytics",
22603
22716
  capScope: "device",
@@ -22628,6 +22741,12 @@ Object.freeze({
22628
22741
  addonId: null,
22629
22742
  access: "view"
22630
22743
  },
22744
+ "pipelineAnalytics.getEventStoreFootprint": {
22745
+ capName: "pipeline-analytics",
22746
+ capScope: "device",
22747
+ addonId: null,
22748
+ access: "view"
22749
+ },
22631
22750
  "pipelineAnalytics.getKeyEvents": {
22632
22751
  capName: "pipeline-analytics",
22633
22752
  capScope: "device",
@@ -22670,6 +22789,12 @@ Object.freeze({
22670
22789
  addonId: null,
22671
22790
  access: "view"
22672
22791
  },
22792
+ "pipelineAnalytics.listOpsLog": {
22793
+ capName: "pipeline-analytics",
22794
+ capScope: "device",
22795
+ addonId: null,
22796
+ access: "view"
22797
+ },
22673
22798
  "pipelineAnalytics.listRecentTracks": {
22674
22799
  capName: "pipeline-analytics",
22675
22800
  capScope: "device",
@@ -22682,6 +22807,12 @@ Object.freeze({
22682
22807
  addonId: null,
22683
22808
  access: "view"
22684
22809
  },
22810
+ "pipelineAnalytics.pruneEvents": {
22811
+ capName: "pipeline-analytics",
22812
+ capScope: "device",
22813
+ addonId: null,
22814
+ access: "create"
22815
+ },
22685
22816
  "pipelineAnalytics.pruneEventsBefore": {
22686
22817
  capName: "pipeline-analytics",
22687
22818
  capScope: "device",
@@ -23444,6 +23575,12 @@ Object.freeze({
23444
23575
  addonId: null,
23445
23576
  access: "create"
23446
23577
  },
23578
+ "recording.deleteFootprint": {
23579
+ capName: "recording",
23580
+ capScope: "system",
23581
+ addonId: null,
23582
+ access: "delete"
23583
+ },
23447
23584
  "recording.getAvailability": {
23448
23585
  capName: "recording",
23449
23586
  capScope: "system",
@@ -23474,6 +23611,12 @@ Object.freeze({
23474
23611
  addonId: null,
23475
23612
  access: "view"
23476
23613
  },
23614
+ "recording.listOpsLog": {
23615
+ capName: "recording",
23616
+ capScope: "system",
23617
+ addonId: null,
23618
+ access: "view"
23619
+ },
23477
23620
  "recording.locateSegment": {
23478
23621
  capName: "recording",
23479
23622
  capScope: "system",
@@ -7352,6 +7352,62 @@ var RecordingConfigSchema = object({
7352
7352
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7353
7353
  });
7354
7354
  /**
7355
+ * Ops-log — the durable, append-only operations audit shared by the
7356
+ * recordings and events management surfaces.
7357
+ *
7358
+ * ONE row shape is reused for both domains so a single "Activity" view can
7359
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7360
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7361
+ * management operation, WHY it ran (reason), and its measurable effect
7362
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7363
+ * never fail the operation it records.
7364
+ */
7365
+ /** Which management domain the operation belongs to. */
7366
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7367
+ /** The kind of management operation performed. */
7368
+ var OpsLogOpSchema = _enum([
7369
+ "prune",
7370
+ "manual-delete",
7371
+ "rescan",
7372
+ "retention-run"
7373
+ ]);
7374
+ /** Why the operation ran. */
7375
+ var OpsLogReasonSchema = _enum([
7376
+ "retention",
7377
+ "quota",
7378
+ "manual",
7379
+ "operator"
7380
+ ]);
7381
+ /** One audit row, shared verbatim by both domains. */
7382
+ var OpsLogEntrySchema = object({
7383
+ /** Unique row id. */
7384
+ id: string(),
7385
+ /** Epoch ms the operation completed. */
7386
+ at: number(),
7387
+ domain: OpsLogDomainSchema,
7388
+ op: OpsLogOpSchema,
7389
+ reason: OpsLogReasonSchema,
7390
+ /** The camera the op targeted; null for a cluster/global op. */
7391
+ deviceId: number().nullable(),
7392
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7393
+ nodeId: string(),
7394
+ /** Buckets / rows deleted (op-specific unit). */
7395
+ itemsAffected: number(),
7396
+ /** Bytes reclaimed by the op (0 when not measurable). */
7397
+ bytesReclaimed: number(),
7398
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7399
+ detail: string().nullable(),
7400
+ /** Who/what triggered the op. */
7401
+ actor: string()
7402
+ });
7403
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7404
+ var OpsLogQueryInputSchema = object({
7405
+ /** Restrict to a single camera; omit for every row. */
7406
+ deviceId: number().optional(),
7407
+ /** Max rows returned, newest-first. */
7408
+ limit: number().int().min(1).max(1e3).optional()
7409
+ });
7410
+ /**
7355
7411
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7356
7412
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7357
7413
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -16152,6 +16208,26 @@ var TrackCascadeCountsSchema = object({
16152
16208
  /** Per-track CLIP search vectors removed (best-effort). */
16153
16209
  embeddings: number().int()
16154
16210
  });
16211
+ /** Event-store footprint for one camera. */
16212
+ var EventStoreDeviceFootprintSchema = object({
16213
+ deviceId: number(),
16214
+ /** Persisted event rows (motion + object + audio) for the camera. */
16215
+ rows: number().int(),
16216
+ /** Event-owned media bytes on disk for the camera. */
16217
+ bytes: number().int()
16218
+ });
16219
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16220
+ var EventStoreFootprintSchema = object({
16221
+ totalRows: number().int(),
16222
+ totalBytes: number().int(),
16223
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16224
+ });
16225
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16226
+ var EventPruneCountsSchema = object({
16227
+ motion: number().int(),
16228
+ object: number().int(),
16229
+ audio: number().int()
16230
+ });
16155
16231
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16156
16232
  deviceId: number(),
16157
16233
  trackId: string()
@@ -16215,6 +16291,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16215
16291
  }), {
16216
16292
  kind: "mutation",
16217
16293
  auth: "admin"
16294
+ }), method(object({}), EventStoreFootprintSchema, {
16295
+ kind: "query",
16296
+ auth: "admin"
16297
+ }), method(object({
16298
+ olderThanMs: number(),
16299
+ reason: OpsLogReasonSchema.optional()
16300
+ }), EventPruneCountsSchema, {
16301
+ kind: "mutation",
16302
+ auth: "admin"
16303
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16304
+ kind: "mutation",
16305
+ auth: "admin"
16306
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16307
+ kind: "query",
16308
+ auth: "admin"
16218
16309
  }), method(object({
16219
16310
  eventId: string(),
16220
16311
  kind: MediaFileKindEnum.optional()
@@ -19493,13 +19584,29 @@ method(object({
19493
19584
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19494
19585
  kind: "mutation",
19495
19586
  auth: "admin"
19496
- }), method(object({ deviceId: number() }), object({
19587
+ }), method(object({
19588
+ deviceId: number(),
19589
+ reason: OpsLogReasonSchema.optional()
19590
+ }), object({
19497
19591
  floorMs: number().nullable(),
19498
19592
  deletedBuckets: number().int(),
19499
19593
  reclaimedBytes: number().int()
19500
19594
  }), {
19501
19595
  kind: "mutation",
19502
19596
  auth: "admin"
19597
+ }), method(object({
19598
+ deviceId: number(),
19599
+ fromMs: number().optional(),
19600
+ toMs: number().optional()
19601
+ }), object({
19602
+ deletedBuckets: number().int(),
19603
+ reclaimedBytes: number().int()
19604
+ }), {
19605
+ kind: "mutation",
19606
+ auth: "admin"
19607
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19608
+ kind: "query",
19609
+ auth: "admin"
19503
19610
  });
19504
19611
  /**
19505
19612
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22621,6 +22728,12 @@ Object.freeze({
22621
22728
  addonId: null,
22622
22729
  access: "delete"
22623
22730
  },
22731
+ "pipelineAnalytics.deleteDeviceEvents": {
22732
+ capName: "pipeline-analytics",
22733
+ capScope: "device",
22734
+ addonId: null,
22735
+ access: "delete"
22736
+ },
22624
22737
  "pipelineAnalytics.deleteTracks": {
22625
22738
  capName: "pipeline-analytics",
22626
22739
  capScope: "device",
@@ -22651,6 +22764,12 @@ Object.freeze({
22651
22764
  addonId: null,
22652
22765
  access: "view"
22653
22766
  },
22767
+ "pipelineAnalytics.getEventStoreFootprint": {
22768
+ capName: "pipeline-analytics",
22769
+ capScope: "device",
22770
+ addonId: null,
22771
+ access: "view"
22772
+ },
22654
22773
  "pipelineAnalytics.getKeyEvents": {
22655
22774
  capName: "pipeline-analytics",
22656
22775
  capScope: "device",
@@ -22693,6 +22812,12 @@ Object.freeze({
22693
22812
  addonId: null,
22694
22813
  access: "view"
22695
22814
  },
22815
+ "pipelineAnalytics.listOpsLog": {
22816
+ capName: "pipeline-analytics",
22817
+ capScope: "device",
22818
+ addonId: null,
22819
+ access: "view"
22820
+ },
22696
22821
  "pipelineAnalytics.listRecentTracks": {
22697
22822
  capName: "pipeline-analytics",
22698
22823
  capScope: "device",
@@ -22705,6 +22830,12 @@ Object.freeze({
22705
22830
  addonId: null,
22706
22831
  access: "view"
22707
22832
  },
22833
+ "pipelineAnalytics.pruneEvents": {
22834
+ capName: "pipeline-analytics",
22835
+ capScope: "device",
22836
+ addonId: null,
22837
+ access: "create"
22838
+ },
22708
22839
  "pipelineAnalytics.pruneEventsBefore": {
22709
22840
  capName: "pipeline-analytics",
22710
22841
  capScope: "device",
@@ -23467,6 +23598,12 @@ Object.freeze({
23467
23598
  addonId: null,
23468
23599
  access: "create"
23469
23600
  },
23601
+ "recording.deleteFootprint": {
23602
+ capName: "recording",
23603
+ capScope: "system",
23604
+ addonId: null,
23605
+ access: "delete"
23606
+ },
23470
23607
  "recording.getAvailability": {
23471
23608
  capName: "recording",
23472
23609
  capScope: "system",
@@ -23497,6 +23634,12 @@ Object.freeze({
23497
23634
  addonId: null,
23498
23635
  access: "view"
23499
23636
  },
23637
+ "recording.listOpsLog": {
23638
+ capName: "recording",
23639
+ capScope: "system",
23640
+ addonId: null,
23641
+ access: "view"
23642
+ },
23500
23643
  "recording.locateSegment": {
23501
23644
  capName: "recording",
23502
23645
  capScope: "system",
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-ChSRaxCw.js");
5
+ const require_shared = require("./shared-EwybxG9c.js");
6
6
  let node_stream = require("node:stream");
7
7
  let webdav = require("webdav");
8
8
  //#region src/providers/webdav/webdav-config-schema.ts
@@ -1,4 +1,4 @@
1
- import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-fXbGPtd5.mjs";
1
+ import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-DwOLwiOT.mjs";
2
2
  import { PassThrough } from "node:stream";
3
3
  import { AuthType, createClient } from "webdav";
4
4
  //#region src/providers/webdav/webdav-config-schema.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-remote-storage",
3
- "version": "1.1.27",
3
+ "version": "1.1.28",
4
4
  "description": "Remote storage providers (SFTP, S3, WebDAV) — unifies remote backends behind the storage-provider cap",
5
5
  "keywords": [
6
6
  "camstack",