@camstack/types 0.1.41 → 0.1.42

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 (45) hide show
  1. package/dist/capabilities/filesystem-browse.cap.d.ts +39 -0
  2. package/dist/capabilities/filesystem-browse.cap.d.ts.map +1 -0
  3. package/dist/capabilities/index.d.ts +5 -1
  4. package/dist/capabilities/index.d.ts.map +1 -1
  5. package/dist/capabilities/recording.cap.d.ts +129 -0
  6. package/dist/capabilities/recording.cap.d.ts.map +1 -1
  7. package/dist/capabilities/storage-provider.cap.d.ts +15 -0
  8. package/dist/capabilities/storage-provider.cap.d.ts.map +1 -1
  9. package/dist/capabilities/storage.cap.d.ts +6 -0
  10. package/dist/capabilities/storage.cap.d.ts.map +1 -1
  11. package/dist/capabilities/stream-broker.cap.d.ts +14 -0
  12. package/dist/capabilities/stream-broker.cap.d.ts.map +1 -1
  13. package/dist/capabilities/videoclips.cap.d.ts +77 -0
  14. package/dist/capabilities/videoclips.cap.d.ts.map +1 -0
  15. package/dist/generated/addon-api.d.ts +428 -2
  16. package/dist/generated/addon-api.d.ts.map +1 -1
  17. package/dist/generated/capability-router-map.d.ts +8 -2
  18. package/dist/generated/capability-router-map.d.ts.map +1 -1
  19. package/dist/generated/device-proxy.d.ts +2 -0
  20. package/dist/generated/device-proxy.d.ts.map +1 -1
  21. package/dist/generated/method-access-map.d.ts +1 -1
  22. package/dist/generated/method-access-map.d.ts.map +1 -1
  23. package/dist/generated/system-proxy.d.ts +1 -1
  24. package/dist/generated/system-proxy.d.ts.map +1 -1
  25. package/dist/{index-Bpj3ScIH.mjs → index-BxWo3b49.mjs} +624 -465
  26. package/dist/index-BxWo3b49.mjs.map +1 -0
  27. package/dist/{index-BSA_TBea.js → index-CGMPfVaT.js} +161 -2
  28. package/dist/index-CGMPfVaT.js.map +1 -0
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +62 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +485 -424
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/interfaces/recording-config-migrate.d.ts +13 -0
  36. package/dist/interfaces/recording-config-migrate.d.ts.map +1 -0
  37. package/dist/interfaces/recording-config.d.ts +119 -1
  38. package/dist/interfaces/recording-config.d.ts.map +1 -1
  39. package/dist/interfaces/storage-location.d.ts +1 -0
  40. package/dist/interfaces/storage-location.d.ts.map +1 -1
  41. package/dist/node.js +1 -1
  42. package/dist/node.mjs +1 -1
  43. package/package.json +1 -1
  44. package/dist/index-BSA_TBea.js.map +0 -1
  45. package/dist/index-Bpj3ScIH.mjs.map +0 -1
@@ -0,0 +1,13 @@
1
+ import type { RecordingConfig, RecordingBand } from './recording-config.js';
2
+ /**
3
+ * One-way migration from the legacy recording-config shape to the authoritative
4
+ * mode-per-band model. Pure (no clock access).
5
+ *
6
+ * - If `config.bands` is present, it is authoritative and returned as-is.
7
+ * - Otherwise the result is derived from the legacy fields: a disabled config or
8
+ * `mode: 'off'` yields no bands; every legacy schedule maps to one band whose
9
+ * mode is `continuous` when `config.mode === 'continuous'`, else `events`
10
+ * (carrying `triggers`/`preBufferSec`/`postBufferSec`).
11
+ */
12
+ export declare function migrateConfigToBands(config: RecordingConfig): RecordingBand[];
13
+ //# sourceMappingURL=recording-config-migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recording-config-migrate.d.ts","sourceRoot":"","sources":["../../src/interfaces/recording-config-migrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAqB,aAAa,EAAqB,MAAM,uBAAuB,CAAA;AA8BjH;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,EAAE,CAa7E"}
@@ -21,6 +21,75 @@ export declare const RecordingModeSchema: z.ZodEnum<{
21
21
  onAudioThreshold: "onAudioThreshold";
22
22
  }>;
23
23
  export type RecordingMode = z.infer<typeof RecordingModeSchema>;
24
+ /**
25
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
26
+ * reads directly (never inferred from `rules`):
27
+ * - `off` — not recording.
28
+ * - `events` — record only around triggers (motion / audio threshold),
29
+ * with pre/post-buffer.
30
+ * - `continuous` — record 24/7 within the schedule.
31
+ *
32
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
33
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
34
+ */
35
+ export declare const RecordingStorageModeSchema: z.ZodEnum<{
36
+ events: "events";
37
+ off: "off";
38
+ continuous: "continuous";
39
+ }>;
40
+ export type RecordingStorageMode = z.infer<typeof RecordingStorageModeSchema>;
41
+ /** Which detectors trigger an `events`-mode recording. */
42
+ export declare const RecordingTriggersSchema: z.ZodObject<{
43
+ motion: z.ZodOptional<z.ZodBoolean>;
44
+ audioThresholdDbfs: z.ZodOptional<z.ZodNumber>;
45
+ }, z.core.$strip>;
46
+ export type RecordingTriggers = z.infer<typeof RecordingTriggersSchema>;
47
+ /**
48
+ * Mode of a single recording band — the recorder per-band vocabulary.
49
+ *
50
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
51
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
52
+ * covering band, not by a band value.
53
+ */
54
+ export declare const RecordingBandModeSchema: z.ZodEnum<{
55
+ events: "events";
56
+ continuous: "continuous";
57
+ }>;
58
+ export type RecordingBandMode = z.infer<typeof RecordingBandModeSchema>;
59
+ /**
60
+ * Triggers for an `events`-mode band. Identical shape to
61
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
62
+ * two never drift.
63
+ */
64
+ export declare const RecordingBandTriggersSchema: z.ZodObject<{
65
+ motion: z.ZodOptional<z.ZodBoolean>;
66
+ audioThresholdDbfs: z.ZodOptional<z.ZodNumber>;
67
+ }, z.core.$strip>;
68
+ export type RecordingBandTriggers = z.infer<typeof RecordingBandTriggersSchema>;
69
+ /**
70
+ * A single mode-per-band window — the canonical recorder band shape, the
71
+ * single source of truth re-used by `addon-pipeline/recorder`.
72
+ *
73
+ * `days` lists the weekdays the band covers (empty = every day, matching the
74
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
75
+ * span wraps past midnight (handled by the band engine).
76
+ */
77
+ export declare const RecordingBandSchema: z.ZodObject<{
78
+ days: z.ZodArray<z.ZodNumber>;
79
+ start: z.ZodString;
80
+ end: z.ZodString;
81
+ mode: z.ZodEnum<{
82
+ events: "events";
83
+ continuous: "continuous";
84
+ }>;
85
+ triggers: z.ZodOptional<z.ZodObject<{
86
+ motion: z.ZodOptional<z.ZodBoolean>;
87
+ audioThresholdDbfs: z.ZodOptional<z.ZodNumber>;
88
+ }, z.core.$strip>>;
89
+ preBufferSec: z.ZodOptional<z.ZodNumber>;
90
+ postBufferSec: z.ZodOptional<z.ZodNumber>;
91
+ }, z.core.$strip>;
92
+ export type RecordingBand = z.infer<typeof RecordingBandSchema>;
24
93
  export declare const RecordingRuleSchema: z.ZodObject<{
25
94
  schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
26
95
  kind: z.ZodLiteral<"always">;
@@ -54,15 +123,49 @@ export declare const RecordingRetentionSchema: z.ZodObject<{
54
123
  maxSizeGb: z.ZodOptional<z.ZodNumber>;
55
124
  }, z.core.$strip>;
56
125
  export type RecordingRetention = z.infer<typeof RecordingRetentionSchema>;
57
- /** The full per-camera recording intent — the wire shape of a RecordingTarget. */
126
+ /**
127
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
128
+ *
129
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
130
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
131
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
132
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
133
+ */
58
134
  export declare const RecordingConfigSchema: z.ZodObject<{
59
135
  enabled: z.ZodBoolean;
136
+ mode: z.ZodOptional<z.ZodEnum<{
137
+ events: "events";
138
+ off: "off";
139
+ continuous: "continuous";
140
+ }>>;
60
141
  profiles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
61
142
  high: "high";
62
143
  mid: "mid";
63
144
  low: "low";
64
145
  }>>>;
65
146
  segmentSeconds: z.ZodOptional<z.ZodNumber>;
147
+ schedules: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
148
+ kind: z.ZodLiteral<"always">;
149
+ }, z.core.$strip>, z.ZodObject<{
150
+ kind: z.ZodLiteral<"timeOfDay">;
151
+ start: z.ZodString;
152
+ end: z.ZodString;
153
+ days: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
154
+ }, z.core.$strip>], "kind">>>;
155
+ schedule: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
156
+ kind: z.ZodLiteral<"always">;
157
+ }, z.core.$strip>, z.ZodObject<{
158
+ kind: z.ZodLiteral<"timeOfDay">;
159
+ start: z.ZodString;
160
+ end: z.ZodString;
161
+ days: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
162
+ }, z.core.$strip>], "kind">>;
163
+ triggers: z.ZodOptional<z.ZodObject<{
164
+ motion: z.ZodOptional<z.ZodBoolean>;
165
+ audioThresholdDbfs: z.ZodOptional<z.ZodNumber>;
166
+ }, z.core.$strip>>;
167
+ preBufferSec: z.ZodOptional<z.ZodNumber>;
168
+ postBufferSec: z.ZodOptional<z.ZodNumber>;
66
169
  rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
67
170
  schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
68
171
  kind: z.ZodLiteral<"always">;
@@ -82,6 +185,21 @@ export declare const RecordingConfigSchema: z.ZodObject<{
82
185
  resetTimeoutOnNewEvent: z.ZodDefault<z.ZodBoolean>;
83
186
  thresholdDbfs: z.ZodOptional<z.ZodNumber>;
84
187
  }, z.core.$strip>>>;
188
+ bands: z.ZodOptional<z.ZodArray<z.ZodObject<{
189
+ days: z.ZodArray<z.ZodNumber>;
190
+ start: z.ZodString;
191
+ end: z.ZodString;
192
+ mode: z.ZodEnum<{
193
+ events: "events";
194
+ continuous: "continuous";
195
+ }>;
196
+ triggers: z.ZodOptional<z.ZodObject<{
197
+ motion: z.ZodOptional<z.ZodBoolean>;
198
+ audioThresholdDbfs: z.ZodOptional<z.ZodNumber>;
199
+ }, z.core.$strip>>;
200
+ preBufferSec: z.ZodOptional<z.ZodNumber>;
201
+ postBufferSec: z.ZodOptional<z.ZodNumber>;
202
+ }, z.core.$strip>>>;
85
203
  retention: z.ZodOptional<z.ZodObject<{
86
204
  maxAgeDays: z.ZodOptional<z.ZodNumber>;
87
205
  maxSizeGb: z.ZodOptional<z.ZodNumber>;
@@ -1 +1 @@
1
- {"version":3,"file":"recording-config.d.ts","sourceRoot":"","sources":["../../src/interfaces/recording-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,aAAiC,CAAA;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAIrE,eAAO,MAAM,uBAAuB;;;;;;;2BASlC,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,mBAAmB;;;;EAAyD,CAAA;AACzF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iBAW9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,k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AAC,OAAO,2BAA2B,CAAC,CAAA;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;iBAQ9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iBAW9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -45,6 +45,7 @@ export declare const StorageLocationSchema: z.ZodObject<{
45
45
  displayName: z.ZodString;
46
46
  providerId: z.ZodString;
47
47
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
48
+ nodeId: z.ZodOptional<z.ZodString>;
48
49
  isDefault: z.ZodDefault<z.ZodBoolean>;
49
50
  isSystem: z.ZodDefault<z.ZodBoolean>;
50
51
  createdAt: z.ZodNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"storage-location.d.ts","sourceRoot":"","sources":["../../src/interfaces/storage-location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,yBAAyB,aAA2C,CAAA;AAEjF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAahC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,iDAGnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
1
+ {"version":3,"file":"storage-location.d.ts","sourceRoot":"","sources":["../../src/interfaces/storage-location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,yBAAyB,aAA2C,CAAA;AAEjF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;iBAqBhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,iDAGnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
package/dist/node.js CHANGED
@@ -28,7 +28,7 @@ const promises = require("node:stream/promises");
28
28
  const node_stream = require("node:stream");
29
29
  const node_child_process = require("node:child_process");
30
30
  const node_crypto = require("node:crypto");
31
- const index = require("./index-BSA_TBea.js");
31
+ const index = require("./index-CGMPfVaT.js");
32
32
  require("zod");
33
33
  function _interopNamespaceDefault(e) {
34
34
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
package/dist/node.mjs CHANGED
@@ -6,7 +6,7 @@ import { pipeline } from "node:stream/promises";
6
6
  import { Readable } from "node:stream";
7
7
  import { execFileSync } from "node:child_process";
8
8
  import { createHash } from "node:crypto";
9
- import { e as errMsg } from "./index-Bpj3ScIH.mjs";
9
+ import { e as errMsg } from "./index-BxWo3b49.mjs";
10
10
  import "zod";
11
11
  function getPlatformInfo() {
12
12
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",