@camstack/addon-cloudflare 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.
@@ -7327,6 +7327,62 @@ var RecordingConfigSchema = object({
7327
7327
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7328
7328
  });
7329
7329
  /**
7330
+ * Ops-log — the durable, append-only operations audit shared by the
7331
+ * recordings and events management surfaces.
7332
+ *
7333
+ * ONE row shape is reused for both domains so a single "Activity" view can
7334
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7335
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7336
+ * management operation, WHY it ran (reason), and its measurable effect
7337
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7338
+ * never fail the operation it records.
7339
+ */
7340
+ /** Which management domain the operation belongs to. */
7341
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7342
+ /** The kind of management operation performed. */
7343
+ var OpsLogOpSchema = _enum([
7344
+ "prune",
7345
+ "manual-delete",
7346
+ "rescan",
7347
+ "retention-run"
7348
+ ]);
7349
+ /** Why the operation ran. */
7350
+ var OpsLogReasonSchema = _enum([
7351
+ "retention",
7352
+ "quota",
7353
+ "manual",
7354
+ "operator"
7355
+ ]);
7356
+ /** One audit row, shared verbatim by both domains. */
7357
+ var OpsLogEntrySchema = object({
7358
+ /** Unique row id. */
7359
+ id: string(),
7360
+ /** Epoch ms the operation completed. */
7361
+ at: number(),
7362
+ domain: OpsLogDomainSchema,
7363
+ op: OpsLogOpSchema,
7364
+ reason: OpsLogReasonSchema,
7365
+ /** The camera the op targeted; null for a cluster/global op. */
7366
+ deviceId: number().nullable(),
7367
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7368
+ nodeId: string(),
7369
+ /** Buckets / rows deleted (op-specific unit). */
7370
+ itemsAffected: number(),
7371
+ /** Bytes reclaimed by the op (0 when not measurable). */
7372
+ bytesReclaimed: number(),
7373
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7374
+ detail: string().nullable(),
7375
+ /** Who/what triggered the op. */
7376
+ actor: string()
7377
+ });
7378
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7379
+ var OpsLogQueryInputSchema = object({
7380
+ /** Restrict to a single camera; omit for every row. */
7381
+ deviceId: number().optional(),
7382
+ /** Max rows returned, newest-first. */
7383
+ limit: number().int().min(1).max(1e3).optional()
7384
+ });
7385
+ /**
7330
7386
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7331
7387
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7332
7388
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -16165,6 +16221,26 @@ var TrackCascadeCountsSchema = object({
16165
16221
  /** Per-track CLIP search vectors removed (best-effort). */
16166
16222
  embeddings: number().int()
16167
16223
  });
16224
+ /** Event-store footprint for one camera. */
16225
+ var EventStoreDeviceFootprintSchema = object({
16226
+ deviceId: number(),
16227
+ /** Persisted event rows (motion + object + audio) for the camera. */
16228
+ rows: number().int(),
16229
+ /** Event-owned media bytes on disk for the camera. */
16230
+ bytes: number().int()
16231
+ });
16232
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16233
+ var EventStoreFootprintSchema = object({
16234
+ totalRows: number().int(),
16235
+ totalBytes: number().int(),
16236
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16237
+ });
16238
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16239
+ var EventPruneCountsSchema = object({
16240
+ motion: number().int(),
16241
+ object: number().int(),
16242
+ audio: number().int()
16243
+ });
16168
16244
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16169
16245
  deviceId: number(),
16170
16246
  trackId: string()
@@ -16228,6 +16304,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16228
16304
  }), {
16229
16305
  kind: "mutation",
16230
16306
  auth: "admin"
16307
+ }), method(object({}), EventStoreFootprintSchema, {
16308
+ kind: "query",
16309
+ auth: "admin"
16310
+ }), method(object({
16311
+ olderThanMs: number(),
16312
+ reason: OpsLogReasonSchema.optional()
16313
+ }), EventPruneCountsSchema, {
16314
+ kind: "mutation",
16315
+ auth: "admin"
16316
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16317
+ kind: "mutation",
16318
+ auth: "admin"
16319
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16320
+ kind: "query",
16321
+ auth: "admin"
16231
16322
  }), method(object({
16232
16323
  eventId: string(),
16233
16324
  kind: MediaFileKindEnum.optional()
@@ -19484,13 +19575,29 @@ method(object({
19484
19575
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19485
19576
  kind: "mutation",
19486
19577
  auth: "admin"
19487
- }), method(object({ deviceId: number() }), object({
19578
+ }), method(object({
19579
+ deviceId: number(),
19580
+ reason: OpsLogReasonSchema.optional()
19581
+ }), object({
19488
19582
  floorMs: number().nullable(),
19489
19583
  deletedBuckets: number().int(),
19490
19584
  reclaimedBytes: number().int()
19491
19585
  }), {
19492
19586
  kind: "mutation",
19493
19587
  auth: "admin"
19588
+ }), method(object({
19589
+ deviceId: number(),
19590
+ fromMs: number().optional(),
19591
+ toMs: number().optional()
19592
+ }), object({
19593
+ deletedBuckets: number().int(),
19594
+ reclaimedBytes: number().int()
19595
+ }), {
19596
+ kind: "mutation",
19597
+ auth: "admin"
19598
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19599
+ kind: "query",
19600
+ auth: "admin"
19494
19601
  });
19495
19602
  /**
19496
19603
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22612,6 +22719,12 @@ Object.freeze({
22612
22719
  addonId: null,
22613
22720
  access: "delete"
22614
22721
  },
22722
+ "pipelineAnalytics.deleteDeviceEvents": {
22723
+ capName: "pipeline-analytics",
22724
+ capScope: "device",
22725
+ addonId: null,
22726
+ access: "delete"
22727
+ },
22615
22728
  "pipelineAnalytics.deleteTracks": {
22616
22729
  capName: "pipeline-analytics",
22617
22730
  capScope: "device",
@@ -22642,6 +22755,12 @@ Object.freeze({
22642
22755
  addonId: null,
22643
22756
  access: "view"
22644
22757
  },
22758
+ "pipelineAnalytics.getEventStoreFootprint": {
22759
+ capName: "pipeline-analytics",
22760
+ capScope: "device",
22761
+ addonId: null,
22762
+ access: "view"
22763
+ },
22645
22764
  "pipelineAnalytics.getKeyEvents": {
22646
22765
  capName: "pipeline-analytics",
22647
22766
  capScope: "device",
@@ -22684,6 +22803,12 @@ Object.freeze({
22684
22803
  addonId: null,
22685
22804
  access: "view"
22686
22805
  },
22806
+ "pipelineAnalytics.listOpsLog": {
22807
+ capName: "pipeline-analytics",
22808
+ capScope: "device",
22809
+ addonId: null,
22810
+ access: "view"
22811
+ },
22687
22812
  "pipelineAnalytics.listRecentTracks": {
22688
22813
  capName: "pipeline-analytics",
22689
22814
  capScope: "device",
@@ -22696,6 +22821,12 @@ Object.freeze({
22696
22821
  addonId: null,
22697
22822
  access: "view"
22698
22823
  },
22824
+ "pipelineAnalytics.pruneEvents": {
22825
+ capName: "pipeline-analytics",
22826
+ capScope: "device",
22827
+ addonId: null,
22828
+ access: "create"
22829
+ },
22699
22830
  "pipelineAnalytics.pruneEventsBefore": {
22700
22831
  capName: "pipeline-analytics",
22701
22832
  capScope: "device",
@@ -23458,6 +23589,12 @@ Object.freeze({
23458
23589
  addonId: null,
23459
23590
  access: "create"
23460
23591
  },
23592
+ "recording.deleteFootprint": {
23593
+ capName: "recording",
23594
+ capScope: "system",
23595
+ addonId: null,
23596
+ access: "delete"
23597
+ },
23461
23598
  "recording.getAvailability": {
23462
23599
  capName: "recording",
23463
23600
  capScope: "system",
@@ -23488,6 +23625,12 @@ Object.freeze({
23488
23625
  addonId: null,
23489
23626
  access: "view"
23490
23627
  },
23628
+ "recording.listOpsLog": {
23629
+ capName: "recording",
23630
+ capScope: "system",
23631
+ addonId: null,
23632
+ access: "view"
23633
+ },
23491
23634
  "recording.locateSegment": {
23492
23635
  capName: "recording",
23493
23636
  capScope: "system",
@@ -7327,6 +7327,62 @@ var RecordingConfigSchema = object({
7327
7327
  scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7328
7328
  });
7329
7329
  /**
7330
+ * Ops-log — the durable, append-only operations audit shared by the
7331
+ * recordings and events management surfaces.
7332
+ *
7333
+ * ONE row shape is reused for both domains so a single "Activity" view can
7334
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7335
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
7336
+ * management operation, WHY it ran (reason), and its measurable effect
7337
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
7338
+ * never fail the operation it records.
7339
+ */
7340
+ /** Which management domain the operation belongs to. */
7341
+ var OpsLogDomainSchema = _enum(["recording", "events"]);
7342
+ /** The kind of management operation performed. */
7343
+ var OpsLogOpSchema = _enum([
7344
+ "prune",
7345
+ "manual-delete",
7346
+ "rescan",
7347
+ "retention-run"
7348
+ ]);
7349
+ /** Why the operation ran. */
7350
+ var OpsLogReasonSchema = _enum([
7351
+ "retention",
7352
+ "quota",
7353
+ "manual",
7354
+ "operator"
7355
+ ]);
7356
+ /** One audit row, shared verbatim by both domains. */
7357
+ var OpsLogEntrySchema = object({
7358
+ /** Unique row id. */
7359
+ id: string(),
7360
+ /** Epoch ms the operation completed. */
7361
+ at: number(),
7362
+ domain: OpsLogDomainSchema,
7363
+ op: OpsLogOpSchema,
7364
+ reason: OpsLogReasonSchema,
7365
+ /** The camera the op targeted; null for a cluster/global op. */
7366
+ deviceId: number().nullable(),
7367
+ /** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
7368
+ nodeId: string(),
7369
+ /** Buckets / rows deleted (op-specific unit). */
7370
+ itemsAffected: number(),
7371
+ /** Bytes reclaimed by the op (0 when not measurable). */
7372
+ bytesReclaimed: number(),
7373
+ /** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
7374
+ detail: string().nullable(),
7375
+ /** Who/what triggered the op. */
7376
+ actor: string()
7377
+ });
7378
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
7379
+ var OpsLogQueryInputSchema = object({
7380
+ /** Restrict to a single camera; omit for every row. */
7381
+ deviceId: number().optional(),
7382
+ /** Max rows returned, newest-first. */
7383
+ limit: number().int().min(1).max(1e3).optional()
7384
+ });
7385
+ /**
7330
7386
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
7331
7387
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
7332
7388
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -16165,6 +16221,26 @@ var TrackCascadeCountsSchema = object({
16165
16221
  /** Per-track CLIP search vectors removed (best-effort). */
16166
16222
  embeddings: number().int()
16167
16223
  });
16224
+ /** Event-store footprint for one camera. */
16225
+ var EventStoreDeviceFootprintSchema = object({
16226
+ deviceId: number(),
16227
+ /** Persisted event rows (motion + object + audio) for the camera. */
16228
+ rows: number().int(),
16229
+ /** Event-owned media bytes on disk for the camera. */
16230
+ bytes: number().int()
16231
+ });
16232
+ /** Aggregate event-store footprint: global totals + per-camera breakdown. */
16233
+ var EventStoreFootprintSchema = object({
16234
+ totalRows: number().int(),
16235
+ totalBytes: number().int(),
16236
+ devices: array(EventStoreDeviceFootprintSchema).readonly()
16237
+ });
16238
+ /** Per-kind counts returned by the event-prune / device-delete mutations. */
16239
+ var EventPruneCountsSchema = object({
16240
+ motion: number().int(),
16241
+ object: number().int(),
16242
+ audio: number().int()
16243
+ });
16168
16244
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
16169
16245
  deviceId: number(),
16170
16246
  trackId: string()
@@ -16228,6 +16304,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16228
16304
  }), {
16229
16305
  kind: "mutation",
16230
16306
  auth: "admin"
16307
+ }), method(object({}), EventStoreFootprintSchema, {
16308
+ kind: "query",
16309
+ auth: "admin"
16310
+ }), method(object({
16311
+ olderThanMs: number(),
16312
+ reason: OpsLogReasonSchema.optional()
16313
+ }), EventPruneCountsSchema, {
16314
+ kind: "mutation",
16315
+ auth: "admin"
16316
+ }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16317
+ kind: "mutation",
16318
+ auth: "admin"
16319
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
16320
+ kind: "query",
16321
+ auth: "admin"
16231
16322
  }), method(object({
16232
16323
  eventId: string(),
16233
16324
  kind: MediaFileKindEnum.optional()
@@ -19484,13 +19575,29 @@ method(object({
19484
19575
  }), method(object({ deviceId: number() }), RecordingStatusSchema, {
19485
19576
  kind: "mutation",
19486
19577
  auth: "admin"
19487
- }), method(object({ deviceId: number() }), object({
19578
+ }), method(object({
19579
+ deviceId: number(),
19580
+ reason: OpsLogReasonSchema.optional()
19581
+ }), object({
19488
19582
  floorMs: number().nullable(),
19489
19583
  deletedBuckets: number().int(),
19490
19584
  reclaimedBytes: number().int()
19491
19585
  }), {
19492
19586
  kind: "mutation",
19493
19587
  auth: "admin"
19588
+ }), method(object({
19589
+ deviceId: number(),
19590
+ fromMs: number().optional(),
19591
+ toMs: number().optional()
19592
+ }), object({
19593
+ deletedBuckets: number().int(),
19594
+ reclaimedBytes: number().int()
19595
+ }), {
19596
+ kind: "mutation",
19597
+ auth: "admin"
19598
+ }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
19599
+ kind: "query",
19600
+ auth: "admin"
19494
19601
  });
19495
19602
  /**
19496
19603
  * `recordingExport` cap — render a footage time range into a single downloadable
@@ -22612,6 +22719,12 @@ Object.freeze({
22612
22719
  addonId: null,
22613
22720
  access: "delete"
22614
22721
  },
22722
+ "pipelineAnalytics.deleteDeviceEvents": {
22723
+ capName: "pipeline-analytics",
22724
+ capScope: "device",
22725
+ addonId: null,
22726
+ access: "delete"
22727
+ },
22615
22728
  "pipelineAnalytics.deleteTracks": {
22616
22729
  capName: "pipeline-analytics",
22617
22730
  capScope: "device",
@@ -22642,6 +22755,12 @@ Object.freeze({
22642
22755
  addonId: null,
22643
22756
  access: "view"
22644
22757
  },
22758
+ "pipelineAnalytics.getEventStoreFootprint": {
22759
+ capName: "pipeline-analytics",
22760
+ capScope: "device",
22761
+ addonId: null,
22762
+ access: "view"
22763
+ },
22645
22764
  "pipelineAnalytics.getKeyEvents": {
22646
22765
  capName: "pipeline-analytics",
22647
22766
  capScope: "device",
@@ -22684,6 +22803,12 @@ Object.freeze({
22684
22803
  addonId: null,
22685
22804
  access: "view"
22686
22805
  },
22806
+ "pipelineAnalytics.listOpsLog": {
22807
+ capName: "pipeline-analytics",
22808
+ capScope: "device",
22809
+ addonId: null,
22810
+ access: "view"
22811
+ },
22687
22812
  "pipelineAnalytics.listRecentTracks": {
22688
22813
  capName: "pipeline-analytics",
22689
22814
  capScope: "device",
@@ -22696,6 +22821,12 @@ Object.freeze({
22696
22821
  addonId: null,
22697
22822
  access: "view"
22698
22823
  },
22824
+ "pipelineAnalytics.pruneEvents": {
22825
+ capName: "pipeline-analytics",
22826
+ capScope: "device",
22827
+ addonId: null,
22828
+ access: "create"
22829
+ },
22699
22830
  "pipelineAnalytics.pruneEventsBefore": {
22700
22831
  capName: "pipeline-analytics",
22701
22832
  capScope: "device",
@@ -23458,6 +23589,12 @@ Object.freeze({
23458
23589
  addonId: null,
23459
23590
  access: "create"
23460
23591
  },
23592
+ "recording.deleteFootprint": {
23593
+ capName: "recording",
23594
+ capScope: "system",
23595
+ addonId: null,
23596
+ access: "delete"
23597
+ },
23461
23598
  "recording.getAvailability": {
23462
23599
  capName: "recording",
23463
23600
  capScope: "system",
@@ -23488,6 +23625,12 @@ Object.freeze({
23488
23625
  addonId: null,
23489
23626
  access: "view"
23490
23627
  },
23628
+ "recording.listOpsLog": {
23629
+ capName: "recording",
23630
+ capScope: "system",
23631
+ addonId: null,
23632
+ access: "view"
23633
+ },
23491
23634
  "recording.locateSegment": {
23492
23635
  capName: "recording",
23493
23636
  capScope: "system",
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_dist = require("../dist-C9Tfy1_h.js");
24
+ const require_dist = require("../dist-DMo00v-O.js");
25
25
  let node_path = require("node:path");
26
26
  node_path = __toESM(node_path);
27
27
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, c as boolean, d as number, f as object, m as EventCategory, n as defineCustomActions, o as _enum, p as string, r as networkAccessCapability, s as array, t as customAction, u as literal } from "../dist-Ck9DoDhU.mjs";
1
+ import { a as BaseAddon, c as boolean, d as number, f as object, m as EventCategory, n as defineCustomActions, o as _enum, p as string, r as networkAccessCapability, s as array, t as customAction, u as literal } from "../dist-Cp3DWi9N.mjs";
2
2
  import * as path from "node:path";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { spawn } from "node:child_process";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("../dist-C9Tfy1_h.js");
2
+ const require_dist = require("../dist-DMo00v-O.js");
3
3
  //#region src/turn/cloudflare-turn.ts
4
4
  /**
5
5
  * Cloudflare returns ICE servers in several flavours depending on which
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, c as boolean, d as number, f as object, i as turnProviderCapability, l as discriminatedUnion, n as defineCustomActions, p as string, t as customAction, u as literal } from "../dist-Ck9DoDhU.mjs";
1
+ import { a as BaseAddon, c as boolean, d as number, f as object, i as turnProviderCapability, l as discriminatedUnion, n as defineCustomActions, p as string, t as customAction, u as literal } from "../dist-Cp3DWi9N.mjs";
2
2
  //#region src/turn/cloudflare-turn.ts
3
3
  /**
4
4
  * Cloudflare returns ICE servers in several flavours depending on which
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-cloudflare",
3
- "version": "1.1.27",
3
+ "version": "1.1.28",
4
4
  "description": "Cloudflare bundle — Tunnel (network-access) + TURN relay (turn-provider). Multi-entry npm package shipping 2 addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",