@camstack/types 1.2.133 → 1.2.135

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,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_event_category = require("./event-category-BaEgqJNv.js");
3
- const require_sleep = require("./sleep-DkBAyPva.js");
3
+ const require_sleep = require("./sleep-BwGJ_wL_.js");
4
4
  const require_canonical_hash = require("./canonical-hash-DNV8S5ET.js");
5
5
  const require_enums = require("./enums.js");
6
6
  const require_err_msg = require("./err-msg-COpsHMw2.js");
@@ -14585,6 +14585,8 @@ var NcSystemEventKindSchema = zod.z.enum([
14585
14585
  "device-offline",
14586
14586
  "device-disabled",
14587
14587
  "device-enabled",
14588
+ "device-battery-low",
14589
+ "device-battery-normal",
14588
14590
  "stream-online",
14589
14591
  "stream-offline",
14590
14592
  "node-online",
@@ -18775,6 +18777,49 @@ var KeyEventsForDeviceSchema = zod.z.object({
18775
18777
  deviceId: zod.z.number(),
18776
18778
  events: zod.z.array(KeyEventSchema).readonly()
18777
18779
  });
18780
+ /** One non-empty bucket of the timeline histogram. */
18781
+ var EventDensityBucketSchema = zod.z.object({
18782
+ bucketStart: zod.z.number(),
18783
+ motion: zod.z.number().int(),
18784
+ object: zod.z.number().int(),
18785
+ audio: zod.z.number().int()
18786
+ });
18787
+ /**
18788
+ * Most cameras one `getEventDensityBatch` may name.
18789
+ *
18790
+ * The same ceiling the sibling batches on this cap already carry
18791
+ * (`listEventKindsBatch`, `getKeyEventsBatch`): a tablet grid is tens of
18792
+ * cameras, never hundreds, and one call's answer is N × (window / bucketMs)
18793
+ * buckets crossing a process boundary.
18794
+ *
18795
+ * The ceiling is on the SCHEMA, not only on the caller. An over-eager ask is
18796
+ * REFUSED — never truncated to the first {@link EVENT_DENSITY_BATCH_MAX} ids,
18797
+ * because that answer is indistinguishable from a complete one and the caller
18798
+ * would never learn it asked too much. A caller with more cameras sends
18799
+ * ⌈n/max⌉ calls.
18800
+ */
18801
+ var EVENT_DENSITY_BATCH_MAX = 200;
18802
+ /**
18803
+ * One camera's row in a `getEventDensityBatch` answer.
18804
+ *
18805
+ * TWO facts, and the timeline draws them differently:
18806
+ *
18807
+ * - `read: 'read'` — the histogram for this camera. `buckets: []` is a real
18808
+ * claim: read, and nothing happened in the window.
18809
+ * - `read: 'unreadable'` — nobody could answer for this camera. `buckets` is
18810
+ * empty and that emptiness means NOTHING; the timeline must render unknown,
18811
+ * not quiet.
18812
+ *
18813
+ * Fanned out per camera the difference was free — one query rejected while the
18814
+ * others resolved — and collapsing to a batch is the exact moment it is lost
18815
+ * silently. Every requested id gets a row: a caller that asked for twelve and
18816
+ * got eleven cannot tell which one is missing, or that any is.
18817
+ */
18818
+ var EventDensityForDeviceSchema = zod.z.object({
18819
+ deviceId: zod.z.number(),
18820
+ read: zod.z.enum(["read", "unreadable"]),
18821
+ buckets: zod.z.array(EventDensityBucketSchema).readonly()
18822
+ });
18778
18823
  var TrackedDetectionSchema = zod.z.object({
18779
18824
  trackId: zod.z.string(),
18780
18825
  className: zod.z.string(),
@@ -19175,12 +19220,31 @@ var pipelineAnalyticsCapability = {
19175
19220
  since: zod.z.number(),
19176
19221
  until: zod.z.number(),
19177
19222
  bucketMs: zod.z.number().int().positive()
19178
- }), zod.z.array(zod.z.object({
19179
- bucketStart: zod.z.number(),
19180
- motion: zod.z.number().int(),
19181
- object: zod.z.number().int(),
19182
- audio: zod.z.number().int()
19183
- })).readonly()),
19223
+ }), zod.z.array(EventDensityBucketSchema).readonly()),
19224
+ /**
19225
+ * The same histogram, for a SET of cameras, in one round trip.
19226
+ *
19227
+ * A multi-camera timeline (the tablet grid) re-asks this of every camera in
19228
+ * the grid on every day change — N browser → hub → post-analysis round
19229
+ * trips for N independent, already-indexed store queries. The queries are
19230
+ * unchanged and still run per camera (`densityByKind`, one per deviceId,
19231
+ * concurrently INSIDE the owner); only the transport collapses.
19232
+ *
19233
+ * Deliberately per-device rather than pre-merged: a timeline lane belongs
19234
+ * to a camera, and a caller that merged would have to un-merge.
19235
+ * `getEventDensity` stays for single-camera callers.
19236
+ *
19237
+ * Every requested id gets a row, marked — see
19238
+ * {@link EventDensityForDeviceSchema}. `deviceIds` is capped at
19239
+ * {@link EVENT_DENSITY_BATCH_MAX}, and an over-cap ask is refused rather
19240
+ * than truncated.
19241
+ */
19242
+ getEventDensityBatch: require_sleep.method(zod.z.object({
19243
+ deviceIds: zod.z.array(zod.z.number()).min(1).max(200),
19244
+ since: zod.z.number(),
19245
+ until: zod.z.number(),
19246
+ bucketMs: zod.z.number().int().positive()
19247
+ }), zod.z.array(EventDensityForDeviceSchema).readonly()),
19184
19248
  /**
19185
19249
  * @deprecated Prefer `pruneTracksBefore` — the track is the ROOT of the
19186
19250
  * analytics model and retention must cascade from it (design §5.1). This
@@ -31111,6 +31175,54 @@ var RecordingDaysSchema = zod.z.object({
31111
31175
  /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
31112
31176
  days: zod.z.array(zod.z.number())
31113
31177
  });
31178
+ /**
31179
+ * Most cameras one `getAvailabilityBatch` / `getDaysWithRecordingsBatch` may
31180
+ * name.
31181
+ *
31182
+ * Matches the ceiling the per-camera batches elsewhere in the system carry
31183
+ * (`pipelineAnalytics.getKeyEventsBatch`, `sceneMonitor.listScenesBatch`): a
31184
+ * grid is tens of cameras, never hundreds, and each id costs the recorder one
31185
+ * calendar walk whose answer crosses a process boundary.
31186
+ *
31187
+ * The ceiling is on the SCHEMA. An over-eager ask is REFUSED, never truncated
31188
+ * to the first {@link RECORDING_TIMELINE_BATCH_MAX} ids — a truncated answer
31189
+ * looks exactly like a complete one, and the caller would draw an empty
31190
+ * timeline for the cameras it never learned were dropped.
31191
+ */
31192
+ var RECORDING_TIMELINE_BATCH_MAX = 200;
31193
+ /**
31194
+ * One camera's row in a `getAvailabilityBatch` answer.
31195
+ *
31196
+ * `ranges` is EXACTLY what `getAvailability` returns for that camera — the
31197
+ * batch collapses the transport, not the work — plus the one thing the singular
31198
+ * method never had to say:
31199
+ *
31200
+ * - `read: 'read'` — answered. `ranges: []` means "read, and this camera has
31201
+ * no footage in the window", which is a real claim.
31202
+ * - `read: 'unreadable'` — the recorder could not answer for this camera (its
31203
+ * calendar rung threw, its location is unmounted). `ranges` is empty and
31204
+ * that emptiness means NOTHING.
31205
+ *
31206
+ * A timeline that renders the second as the first tells an operator there is no
31207
+ * footage when the truth is that nobody looked.
31208
+ */
31209
+ var RecordingAvailabilityForDeviceSchema = zod.z.object({
31210
+ deviceId: zod.z.number(),
31211
+ read: zod.z.enum(["read", "unreadable"]),
31212
+ ranges: zod.z.array(RecordingRangeSchema).readonly()
31213
+ });
31214
+ /**
31215
+ * One camera's row in a `getDaysWithRecordingsBatch` answer. Same rule as
31216
+ * {@link RecordingAvailabilityForDeviceSchema}: `days: []` on a `'read'` row is
31217
+ * "no footage in this month", `read: 'unreadable'` is "nobody could look", and
31218
+ * the date-picker's day dots must not spell them the same.
31219
+ */
31220
+ var RecordingDaysForDeviceSchema = zod.z.object({
31221
+ deviceId: zod.z.number(),
31222
+ read: zod.z.enum(["read", "unreadable"]),
31223
+ /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
31224
+ days: zod.z.array(zod.z.number()).readonly()
31225
+ });
31114
31226
  var RecordingManifestSchema = zod.z.object({
31115
31227
  deviceId: zod.z.number(),
31116
31228
  /** Local filesystem path to the master playlist; null when no recording exists for the requested range. */
@@ -31356,6 +31468,32 @@ var recordingCapability = {
31356
31468
  kind: "query",
31357
31469
  auth: "protected"
31358
31470
  }),
31471
+ /**
31472
+ * `getAvailability` for a SET of cameras, in one round trip.
31473
+ *
31474
+ * A multi-camera timeline re-asks availability for every camera in the grid
31475
+ * on every day change; fanned out that is one request per camera for N
31476
+ * independent calendar walks. The per-camera work is IDENTICAL (the same
31477
+ * `availabilityProfileFor` + `rangesIn`, run concurrently inside the
31478
+ * recorder) — only the transport collapses.
31479
+ *
31480
+ * `protected` for the same reason the singular method is: every id in
31481
+ * `deviceIds` is a device reference, so the F1 #3 gate refuses any camera
31482
+ * outside the caller's scope — one id out of scope refuses the CALL, it
31483
+ * does not quietly drop a row.
31484
+ *
31485
+ * Every requested id gets a row, marked — see
31486
+ * {@link RecordingAvailabilityForDeviceSchema}. `deviceIds` is capped at
31487
+ * {@link RECORDING_TIMELINE_BATCH_MAX} and an over-cap ask is refused.
31488
+ */
31489
+ getAvailabilityBatch: require_sleep.method(zod.z.object({
31490
+ deviceIds: zod.z.array(zod.z.number()).min(1).max(200),
31491
+ fromMs: zod.z.number(),
31492
+ toMs: zod.z.number()
31493
+ }), zod.z.array(RecordingAvailabilityForDeviceSchema).readonly(), {
31494
+ kind: "query",
31495
+ auth: "protected"
31496
+ }),
31359
31497
  /** Which calendar days in [fromMs,toMs) have ≥1 recorded segment, bucketed by
31360
31498
  * the client's local day (`tzOffsetMinutes` = minutes to add to UTC). Drives
31361
31499
  * the theater date-picker's day dots. */
@@ -31368,6 +31506,26 @@ var recordingCapability = {
31368
31506
  kind: "query",
31369
31507
  auth: "protected"
31370
31508
  }),
31509
+ /**
31510
+ * `getDaysWithRecordings` for a SET of cameras, in one round trip.
31511
+ *
31512
+ * The cheapest question in the product, asked once per camera per month
31513
+ * change. One directory read per day per camera at the owner, unchanged;
31514
+ * what collapses is the N requests it took to ask.
31515
+ *
31516
+ * Every requested id gets a row, marked — see
31517
+ * {@link RecordingDaysForDeviceSchema}. `deviceIds` is capped at
31518
+ * {@link RECORDING_TIMELINE_BATCH_MAX} and an over-cap ask is refused.
31519
+ */
31520
+ getDaysWithRecordingsBatch: require_sleep.method(zod.z.object({
31521
+ deviceIds: zod.z.array(zod.z.number()).min(1).max(200),
31522
+ fromMs: zod.z.number(),
31523
+ toMs: zod.z.number(),
31524
+ tzOffsetMinutes: zod.z.number()
31525
+ }), zod.z.array(RecordingDaysForDeviceSchema).readonly(), {
31526
+ kind: "query",
31527
+ auth: "protected"
31528
+ }),
31371
31529
  getPlaybackManifest: require_sleep.method(zod.z.object({
31372
31530
  deviceId: zod.z.number(),
31373
31531
  fromMs: zod.z.number(),
@@ -41980,6 +42138,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
41980
42138
  addonId: null,
41981
42139
  access: "view"
41982
42140
  },
42141
+ "pipelineAnalytics.getEventDensityBatch": {
42142
+ capName: "pipeline-analytics",
42143
+ capScope: "device",
42144
+ addonId: null,
42145
+ access: "view"
42146
+ },
41983
42147
  "pipelineAnalytics.getEventMedia": {
41984
42148
  capName: "pipeline-analytics",
41985
42149
  capScope: "device",
@@ -43102,12 +43266,24 @@ var METHOD_ACCESS_MAP = Object.freeze({
43102
43266
  addonId: null,
43103
43267
  access: "view"
43104
43268
  },
43269
+ "recording.getAvailabilityBatch": {
43270
+ capName: "recording",
43271
+ capScope: "system",
43272
+ addonId: null,
43273
+ access: "view"
43274
+ },
43105
43275
  "recording.getDaysWithRecordings": {
43106
43276
  capName: "recording",
43107
43277
  capScope: "system",
43108
43278
  addonId: null,
43109
43279
  access: "view"
43110
43280
  },
43281
+ "recording.getDaysWithRecordingsBatch": {
43282
+ capName: "recording",
43283
+ capScope: "system",
43284
+ addonId: null,
43285
+ access: "view"
43286
+ },
43111
43287
  "recording.getDeviceConfig": {
43112
43288
  capName: "recording",
43113
43289
  capScope: "system",
@@ -45975,6 +46151,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
45975
46151
  form: "single",
45976
46152
  optional: false
45977
46153
  }],
46154
+ "pipelineAnalytics.getEventDensityBatch": [{
46155
+ name: "deviceIds",
46156
+ form: "array",
46157
+ optional: false
46158
+ }],
45978
46159
  "pipelineAnalytics.getEventMedia": [{
45979
46160
  name: "deviceId",
45980
46161
  form: "single",
@@ -46390,11 +46571,21 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
46390
46571
  form: "single",
46391
46572
  optional: false
46392
46573
  }],
46574
+ "recording.getAvailabilityBatch": [{
46575
+ name: "deviceIds",
46576
+ form: "array",
46577
+ optional: false
46578
+ }],
46393
46579
  "recording.getDaysWithRecordings": [{
46394
46580
  name: "deviceId",
46395
46581
  form: "single",
46396
46582
  optional: false
46397
46583
  }],
46584
+ "recording.getDaysWithRecordingsBatch": [{
46585
+ name: "deviceIds",
46586
+ form: "array",
46587
+ optional: false
46588
+ }],
46398
46589
  "recording.getDeviceConfig": [{
46399
46590
  name: "deviceId",
46400
46591
  form: "single",
@@ -46926,7 +47117,9 @@ var SYSTEM_SCOPE_DEVICE_METHODS = [
46926
47117
  "plateGallery.listPlates",
46927
47118
  "recording.deleteFootprint",
46928
47119
  "recording.getAvailability",
47120
+ "recording.getAvailabilityBatch",
46929
47121
  "recording.getDaysWithRecordings",
47122
+ "recording.getDaysWithRecordingsBatch",
46930
47123
  "recording.getDeviceConfig",
46931
47124
  "recording.getPlaybackManifest",
46932
47125
  "recording.listOpsLog",
@@ -47857,6 +48050,8 @@ function createSystemProxy(api) {
47857
48050
  unassignPlates: (input) => dispatch("plateGallery", "unassignPlates", "mutation", input)
47858
48051
  },
47859
48052
  recording: {
48053
+ getAvailabilityBatch: (input) => dispatch("recording", "getAvailabilityBatch", "query", input),
48054
+ getDaysWithRecordingsBatch: (input) => dispatch("recording", "getDaysWithRecordingsBatch", "query", input),
47860
48055
  getStorageUsage: (input) => dispatch("recording", "getStorageUsage", "query", input),
47861
48056
  listOpsLog: (input) => dispatch("recording", "listOpsLog", "query", input),
47862
48057
  pauseForStorageMigration: (input) => dispatch("recording", "pauseForStorageMigration", "mutation", input),
@@ -52258,6 +52453,7 @@ exports.DisposerChain = require_sleep.DisposerChain;
52258
52453
  exports.DoorbellPressEventSchema = DoorbellPressEventSchema;
52259
52454
  exports.DoorbellStatusSchema = DoorbellStatusSchema;
52260
52455
  exports.EVENTFUL_CAP_NAMES = EVENTFUL_CAP_NAMES;
52456
+ exports.EVENT_DENSITY_BATCH_MAX = EVENT_DENSITY_BATCH_MAX;
52261
52457
  exports.EVENT_KIND_BY_CAP = EVENT_KIND_BY_CAP;
52262
52458
  exports.EVENT_PAD_MS = EVENT_PAD_MS;
52263
52459
  exports.EVENT_TAXONOMY = EVENT_TAXONOMY;
@@ -52280,6 +52476,8 @@ exports.EnrichedWidgetMetadataSchema = EnrichedWidgetMetadataSchema;
52280
52476
  exports.EnumSensorDateTimeFormatSchema = EnumSensorDateTimeFormatSchema;
52281
52477
  exports.EnumSensorStatusSchema = EnumSensorStatusSchema;
52282
52478
  exports.EventCategory = require_event_category.EventCategory;
52479
+ exports.EventDensityBucketSchema = EventDensityBucketSchema;
52480
+ exports.EventDensityForDeviceSchema = EventDensityForDeviceSchema;
52283
52481
  exports.EventEmitterStatusSchema = EventEmitterStatusSchema;
52284
52482
  exports.EventFireSchema = EventFireSchema;
52285
52483
  exports.EventItemSchema = EventItemSchema;
@@ -52689,6 +52887,7 @@ exports.REACHABILITY_POLL_INTERVAL_MS = REACHABILITY_POLL_INTERVAL_MS;
52689
52887
  exports.REACHABILITY_PROBE_TIMEOUT_MS = REACHABILITY_PROBE_TIMEOUT_MS;
52690
52888
  exports.RECOGNITION_TYPES = RECOGNITION_TYPES;
52691
52889
  exports.RECORDING_EXPORT_MAX_READ_BYTES = RECORDING_EXPORT_MAX_READ_BYTES;
52890
+ exports.RECORDING_TIMELINE_BATCH_MAX = RECORDING_TIMELINE_BATCH_MAX;
52692
52891
  exports.REDACTED_SECRET = REDACTED_SECRET;
52693
52892
  exports.RESERVED_BINDING_NAMES = RESERVED_BINDING_NAMES;
52694
52893
  exports.RESTORED_CAP_NAMES = RESTORED_CAP_NAMES;
@@ -52705,11 +52904,13 @@ exports.ReadinessRegistry = require_sleep.ReadinessRegistry;
52705
52904
  exports.ReadinessTimeoutError = require_sleep.ReadinessTimeoutError;
52706
52905
  exports.RecentTracksPageSchema = RecentTracksPageSchema;
52707
52906
  exports.RecentTracksQueryInput = RecentTracksQueryInput;
52907
+ exports.RecordingAvailabilityForDeviceSchema = RecordingAvailabilityForDeviceSchema;
52708
52908
  exports.RecordingAvailabilitySchema = RecordingAvailabilitySchema;
52709
52909
  exports.RecordingBandModeSchema = RecordingBandModeSchema;
52710
52910
  exports.RecordingBandSchema = RecordingBandSchema;
52711
52911
  exports.RecordingBandTriggersSchema = RecordingBandTriggersSchema;
52712
52912
  exports.RecordingConfigSchema = RecordingConfigSchema;
52913
+ exports.RecordingDaysForDeviceSchema = RecordingDaysForDeviceSchema;
52713
52914
  exports.RecordingDaysSchema = RecordingDaysSchema;
52714
52915
  exports.RecordingDeviceUsageSchema = RecordingDeviceUsageSchema;
52715
52916
  exports.RecordingLocationUsageSchema = RecordingLocationUsageSchema;