@camstack/types 1.2.182 → 1.2.184

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.
@@ -216,8 +216,8 @@ export interface PipelineAnalyticsTrackLifecyclePayload {
216
216
  }>;
217
217
  /** The current best image, addressable over HTTP. */
218
218
  readonly media?: {
219
- readonly keyFrameMediaKey?: string;
220
- readonly bestCropMediaKey?: string;
219
+ readonly keyFrameMediaId?: number;
220
+ readonly bestCropMediaId?: number;
221
221
  readonly bestEventId?: string;
222
222
  };
223
223
  readonly embeddingId?: string;
@@ -276,8 +276,8 @@ export interface PipelineAnalyticsPackageDeliveredPayload {
276
276
  readonly className: string;
277
277
  /** Package-zone ids the entry's centroid fell inside. */
278
278
  readonly zoneIds: readonly string[];
279
- /** Native-res key-frame crop key (resolve via the event-media plane). */
280
- readonly keyFrameMediaKey?: string;
279
+ /** Native-res key-frame media row id (resolve via the event-media plane, D482). */
280
+ readonly keyFrameMediaId?: number;
281
281
  readonly bbox: {
282
282
  readonly x: number;
283
283
  readonly y: number;
@@ -109,6 +109,20 @@ export interface SettingsInsertInput<T extends object = Record<string, unknown>>
109
109
  readonly collection: SettingsCollection;
110
110
  readonly record: SettingsInsertRecord<T>;
111
111
  }
112
+ /**
113
+ * Input for an UPSERT against a slot that is not the primary key — see
114
+ * `settings-store.cap.ts`'s `upsert` docblock (D482).
115
+ *
116
+ * `conflict` names declared columns covered by a UNIQUE index. It is never
117
+ * empty: `ON CONFLICT()` is not valid SQL, and the intent an empty list would
118
+ * encode is `insert`.
119
+ */
120
+ export interface SettingsUpsertInput<T extends object = Record<string, unknown>> {
121
+ readonly namespace?: string;
122
+ readonly collection: SettingsCollection;
123
+ readonly conflict: readonly string[];
124
+ readonly record: SettingsInsertRecord<T>;
125
+ }
112
126
  export interface SettingsUpdateInput {
113
127
  readonly namespace?: string;
114
128
  readonly collection: SettingsCollection;
@@ -182,6 +196,10 @@ export interface ISettingsBackend {
182
196
  insert<T extends object = Record<string, unknown>>(input: SettingsInsertInput<T>): Promise<{
183
197
  readonly id: string | number;
184
198
  }>;
199
+ /** Make a slot hold this row, answering with the id the row has (D482) */
200
+ upsert<T extends object = Record<string, unknown>>(input: SettingsUpsertInput<T>): Promise<{
201
+ readonly id: string | number;
202
+ }>;
185
203
  /** Update an existing record by ID */
186
204
  update(input: SettingsUpdateInput): Promise<void>;
187
205
  /** Delete a record by key/ID */
@@ -28,9 +28,19 @@
28
28
  * throws: it sits on the media READ path, where an exception takes out every
29
29
  * thumbnail and a guess puts the wrong image on screen. A legacy `event:` key
30
30
  * is therefore unreadable BY DESIGN - on this hub the 299 883 resolvable ones
31
- * are rewritten by the D474 data migration, and the 676 that remain were
32
- * already orphaned, their event having aged out before it.
31
+ * are rewritten by the D474 data migration.
32
+ *
33
+ * The 676 that remain are NOT what this comment used to claim ("already
34
+ * orphaned, their event having aged out before it"). Measured 2026-09-12
35
+ * (D480): 675 are notification summary MOSAICS, filed under
36
+ * `ownerKind: 'event'` with a synthetic `summary-<ruleId>-<windowEndMs>` owner
37
+ * id that no event row has ever had — 271 MiB on one camera, still growing.
38
+ * Exactly ONE is a real aged-out orphan. The retention cascade escapes 1 row
39
+ * in 300 220, and reading this residue as "what the cascade missed" is what
40
+ * sent D480 looking in the wrong place; read that record before trusting any
41
+ * count here.
33
42
  */
43
+ import { z } from 'zod';
34
44
  /**
35
45
  * Owner types, i.e. the tables that own media.
36
46
  *
@@ -46,7 +56,7 @@
46
56
  * rejected their keys the day one appeared. A list derived from data is a list
47
57
  * that is correct until the data changes.
48
58
  */
49
- export declare const MEDIA_OWNER_TYPES: readonly ["track", "summary", "face", "identity", "plate", "vehicle", "scene", "motion", "object", "audio"];
59
+ export declare const MEDIA_OWNER_TYPES: readonly ["track", "summary", "face", "identity", "plate", "vehicle", "scene", "motion", "object", "audio", "mosaic"];
50
60
  export type MediaOwnerType = (typeof MEDIA_OWNER_TYPES)[number];
51
61
  /** A parsed media key. `timestampMs` is absent for the three-segment form. */
52
62
  export interface MediaOwnerKey {
@@ -66,6 +76,16 @@ export interface MediaOwnerKeyInput {
66
76
  readonly fileKind: string;
67
77
  readonly timestampMs?: number;
68
78
  }
79
+ /**
80
+ * Is this string a declared media owner type?
81
+ *
82
+ * Exported because the `event-media` plane's path parser needs it (D482): a
83
+ * path segment is an arbitrary string until something narrows it, and a
84
+ * hand-written list at the door would drift from {@link MEDIA_OWNER_TYPES} the
85
+ * day an owner kind is added — the failure this module's own docblock already
86
+ * records for `vehicle` and `scene`.
87
+ */
88
+ export declare function isMediaOwnerType(value: string): value is MediaOwnerType;
69
89
  /**
70
90
  * Read a media key. `null` when it is not one - an unknown owner type, a legacy
71
91
  * `event:` key, a missing segment, or a fourth segment that is not a timestamp.
@@ -86,5 +106,19 @@ export declare function formatMediaOwnerKey(key: MediaOwnerKeyInput): string;
86
106
  */
87
107
  export declare const EVENT_OWNER_TYPES: readonly ["motion", "object", "audio"];
88
108
  export type EventOwnerType = (typeof EVENT_OWNER_TYPES)[number];
109
+ /**
110
+ * The same list as a Zod enum, for the cap inputs that must NAME the table
111
+ * (D482: `getEventMedia` / `listEventMedia` take an owner, and an owner is
112
+ * `(table, id)`).
113
+ *
114
+ * Built FROM {@link EVENT_OWNER_TYPES} rather than re-spelled: a fourth event
115
+ * table would otherwise be accepted by the codec and refused at the door, with
116
+ * nothing failing until a caller asked.
117
+ */
118
+ export declare const EventOwnerTypeSchema: z.ZodEnum<{
119
+ motion: 'motion';
120
+ object: 'object';
121
+ audio: 'audio';
122
+ }>;
89
123
  /** True when this key's owner is one of the three event tables. */
90
124
  export declare function isEventOwnerType(ownerType: MediaOwnerType): ownerType is EventOwnerType;
@@ -1,4 +1,4 @@
1
- const require_event_category = require("./event-category-BNJ9EE5B.js");
1
+ const require_event_category = require("./event-category-yW4s1MGD.js");
2
2
  let zod = require("zod");
3
3
  //#region src/audio/audio-chunk-format.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as EventCategory } from "./event-category-DAXzJeTX.mjs";
1
+ import { t as EventCategory } from "./event-category-ZyX6jcse.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/audio/audio-chunk-format.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.182",
3
+ "version": "1.2.184",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",