@camstack/types 1.2.181 → 1.2.183

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
- const require_sleep = require("./sleep-B1ZwxAhh.js");
3
- const require_event_category = require("./event-category-BNJ9EE5B.js");
2
+ const require_sleep = require("./sleep-CfDqEZrs.js");
3
+ const require_event_category = require("./event-category-yW4s1MGD.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");
@@ -36,8 +36,17 @@ let zod = require("zod");
36
36
  * throws: it sits on the media READ path, where an exception takes out every
37
37
  * thumbnail and a guess puts the wrong image on screen. A legacy `event:` key
38
38
  * is therefore unreadable BY DESIGN - on this hub the 299 883 resolvable ones
39
- * are rewritten by the D474 data migration, and the 676 that remain were
40
- * already orphaned, their event having aged out before it.
39
+ * are rewritten by the D474 data migration.
40
+ *
41
+ * The 676 that remain are NOT what this comment used to claim ("already
42
+ * orphaned, their event having aged out before it"). Measured 2026-09-12
43
+ * (D480): 675 are notification summary MOSAICS, filed under
44
+ * `ownerKind: 'event'` with a synthetic `summary-<ruleId>-<windowEndMs>` owner
45
+ * id that no event row has ever had — 271 MiB on one camera, still growing.
46
+ * Exactly ONE is a real aged-out orphan. The retention cascade escapes 1 row
47
+ * in 300 220, and reading this residue as "what the cascade missed" is what
48
+ * sent D480 looking in the wrong place; read that record before trusting any
49
+ * count here.
41
50
  */
42
51
  /**
43
52
  * Owner types, i.e. the tables that own media.
@@ -64,12 +73,22 @@ var MEDIA_OWNER_TYPES = [
64
73
  "scene",
65
74
  "motion",
66
75
  "object",
67
- "audio"
76
+ "audio",
77
+ "mosaic"
68
78
  ];
69
79
  var OWNER_TYPES = new Set(MEDIA_OWNER_TYPES);
70
80
  /** Digits only. `Number('')` is 0 and `Number(' ')` is 0, so neither is used. */
71
81
  var DIGITS = /^\d+$/;
72
- function isOwnerType(value) {
82
+ /**
83
+ * Is this string a declared media owner type?
84
+ *
85
+ * Exported because the `event-media` plane's path parser needs it (D482): a
86
+ * path segment is an arbitrary string until something narrows it, and a
87
+ * hand-written list at the door would drift from {@link MEDIA_OWNER_TYPES} the
88
+ * day an owner kind is added — the failure this module's own docblock already
89
+ * records for `vehicle` and `scene`.
90
+ */
91
+ function isMediaOwnerType(value) {
73
92
  return OWNER_TYPES.has(value);
74
93
  }
75
94
  /**
@@ -86,7 +105,7 @@ function parseMediaOwnerKey(key) {
86
105
  const parts = key.split(":");
87
106
  if (parts.length !== 3 && parts.length !== 4) return null;
88
107
  const [ownerType, ownerId, fileKind, timestamp] = parts;
89
- if (ownerType === void 0 || !isOwnerType(ownerType)) return null;
108
+ if (ownerType === void 0 || !isMediaOwnerType(ownerType)) return null;
90
109
  if (ownerId === void 0 || ownerId.length === 0) return null;
91
110
  if (fileKind === void 0 || fileKind.length === 0) return null;
92
111
  if (timestamp === void 0) return {
@@ -117,6 +136,16 @@ var EVENT_OWNER_TYPES = [
117
136
  "object",
118
137
  "audio"
119
138
  ];
139
+ /**
140
+ * The same list as a Zod enum, for the cap inputs that must NAME the table
141
+ * (D482: `getEventMedia` / `listEventMedia` take an owner, and an owner is
142
+ * `(table, id)`).
143
+ *
144
+ * Built FROM {@link EVENT_OWNER_TYPES} rather than re-spelled: a fourth event
145
+ * table would otherwise be accepted by the codec and refused at the door, with
146
+ * nothing failing until a caller asked.
147
+ */
148
+ var EventOwnerTypeSchema = zod.z.enum(EVENT_OWNER_TYPES);
120
149
  var EVENT_OWNER_TYPE_SET = new Set(EVENT_OWNER_TYPES);
121
150
  /** True when this key's owner is one of the three event tables. */
122
151
  function isEventOwnerType(ownerType) {
@@ -9837,6 +9866,59 @@ var settingsStoreCapability = {
9837
9866
  filter: QueryFilterSchema.optional(),
9838
9867
  columns: zod.z.array(zod.z.string()).readonly().optional()
9839
9868
  }), zod.z.array(SettingsRecordSchema).readonly()),
9869
+ /**
9870
+ * Make a SLOT hold this row — insert it, or update whatever already
9871
+ * occupies the slot — and answer with the id the row HAS.
9872
+ *
9873
+ * ## Why the store needed this
9874
+ *
9875
+ * {@link set} is already an upsert, but its slot is the PRIMARY KEY: the
9876
+ * caller has to know the id to address the row. That is exactly what a
9877
+ * collection keyed by an `INTEGER` rowid alias cannot do — SQLite assigns
9878
+ * the id, so a writer whose uniqueness rule is "one row per
9879
+ * `(ownerKind, ownerId, kind, slot)`" has no id to name and no way to
9880
+ * express the rule. {@link insert} can express it (a UNIQUE index
9881
+ * arbitrates) but only by THROWING at the loser of a race, and the loser
9882
+ * here is a legitimate re-capture, not an error.
9883
+ *
9884
+ * Getting there without this method means read-then-write: query the slot,
9885
+ * then `insert` or `update`. Two statements instead of one, a race between
9886
+ * them, and a recovery path that has to recognise a UNIQUE violation by its
9887
+ * MESSAGE — across a process boundary, because the store lives behind an
9888
+ * RPC door. A string match would be the whole gate, and a store that
9889
+ * rephrased its error would lose the row silently. One statement has no
9890
+ * such gate (D482).
9891
+ *
9892
+ * ## The contract
9893
+ *
9894
+ * `conflict` names the DECLARED columns that identify the slot. They must
9895
+ * be covered by a UNIQUE index on the collection — SQLite resolves an
9896
+ * `ON CONFLICT` target against its indexes and REFUSES the statement when
9897
+ * none matches, so a wrong list is a loud error on the first write, never a
9898
+ * silently duplicated row. An empty list is refused rather than passed on:
9899
+ * `ON CONFLICT()` is not valid SQL, and the intent it would most likely
9900
+ * encode ("no slot, just insert") is {@link insert}.
9901
+ *
9902
+ * Row shape is {@link insert}'s: `record.id` is used when the collection
9903
+ * needs a supplied key and IGNORED when the primary key is an `INTEGER`
9904
+ * rowid alias — exactly as `insert` and `insertMany` already treat it.
9905
+ *
9906
+ * Returns the id either way: the one SQLite assigned on an insert, or the
9907
+ * one the row it updated already had. A caller cannot tell which happened,
9908
+ * and deliberately — every caller wants the slot's id, and one that needed
9909
+ * to distinguish creation from replacement would have to read first anyway.
9910
+ */
9911
+ upsert: require_sleep.method(zod.z.object({
9912
+ namespace: zod.z.string().optional(),
9913
+ collection: zod.z.string(),
9914
+ /** Declared columns identifying the slot; must be covered by a UNIQUE
9915
+ * index on the collection. Never empty. */
9916
+ conflict: zod.z.array(zod.z.string()).readonly(),
9917
+ record: BulkRecordSchema
9918
+ }), zod.z.object({
9919
+ /** The id the row HAS: assigned by SQLite on an insert, or the existing
9920
+ * row's own id on an update. */
9921
+ id: zod.z.union([zod.z.string(), zod.z.number()]) }), { kind: "mutation" }),
9840
9922
  /** Insert a new record. */
9841
9923
  insert: require_sleep.method(zod.z.object({
9842
9924
  namespace: zod.z.string().optional(),
@@ -10128,6 +10210,20 @@ id: zod.z.union([zod.z.string(), zod.z.number()]) }), {
10128
10210
  kind: "mutation",
10129
10211
  auth: "admin"
10130
10212
  }),
10213
+ /**
10214
+ * Make a slot hold this row, and answer with the id the row HAS. The
10215
+ * engine half of `settings-store.upsert` — read that docblock for why the
10216
+ * store needed a slot that is not the primary key (D482).
10217
+ */
10218
+ upsert: require_sleep.method(zod.z.object({
10219
+ namespace: zod.z.string().optional(),
10220
+ collection: zod.z.string(),
10221
+ conflict: zod.z.array(zod.z.string()).readonly(),
10222
+ record: BulkRecordSchema
10223
+ }), zod.z.object({ id: zod.z.union([zod.z.string(), zod.z.number()]) }), {
10224
+ kind: "mutation",
10225
+ auth: "admin"
10226
+ }),
10131
10227
  /** Insert many records in ONE transaction. All or nothing. */
10132
10228
  insertMany: require_sleep.method(zod.z.object({
10133
10229
  namespace: zod.z.string().optional(),
@@ -19145,8 +19241,8 @@ var TrackPositionSchema = zod.z.object({
19145
19241
  var TrackSnapshotSchema = zod.z.object({
19146
19242
  timestamp: zod.z.number(),
19147
19243
  position: TrackPositionSchema,
19148
- /** MediaStore key; resolve via `getTrackMedia({ trackId })`. */
19149
- mediaKey: zod.z.string()
19244
+ /** The snapshot's media row id (D482); resolve via `listTrackMedia({ trackId })`. */
19245
+ mediaId: zod.z.number().int()
19150
19246
  });
19151
19247
  /**
19152
19248
  * Normalized 0..1 trajectory envelope (min/max over every position bbox,
@@ -19785,14 +19881,14 @@ var ObjectEventSchema = zod.z.object({
19785
19881
  * pixel-space `bbox` onto a displayed image. Omitted in slim projection. */
19786
19882
  frameWidth: zod.z.number().optional(),
19787
19883
  frameHeight: zod.z.number().optional(),
19788
- /** MediaStore key for the crop attached to this event (if any). */
19789
- mediaKey: zod.z.string().optional(),
19790
- /** Design B: MediaStore key of the track's native-resolution key frame (the
19884
+ /** Media row id of the crop attached to this event (if any) — D482. */
19885
+ mediaId: zod.z.number().int().optional(),
19886
+ /** Design B: media row id of the track's native-resolution key frame (the
19791
19887
  * best-detection full frame). Resolve via the event-media data-plane
19792
- * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`) for a detail view that
19888
+ * (`/addon/<addonId>/event-media/m/<keyFrameMediaId>`) for a detail view that
19793
19889
  * draws `bbox` over the native frame. Absent on legacy rows / non-decoded
19794
- * sources — consumers fall back to `mediaKey` (the tight crop). */
19795
- keyFrameMediaKey: zod.z.string().optional(),
19890
+ * sources — consumers fall back to `mediaId` (the tight crop). */
19891
+ keyFrameMediaId: zod.z.number().int().optional(),
19796
19892
  /** Populated by B5 (recording playback URL for this event). */
19797
19893
  mediaUrl: zod.z.string().optional(),
19798
19894
  /** The parent track's key-event importance [0,1], propagated to every object
@@ -19838,7 +19934,19 @@ var MediaFileKindEnum = zod.z.enum([
19838
19934
  * plus the bytes.
19839
19935
  */
19840
19936
  var MediaFileRefSchema = zod.z.object({
19841
- key: zod.z.string(),
19937
+ /**
19938
+ * The media row's OWN id — the rowid SQLite assigned it (D482).
19939
+ *
19940
+ * It used to be the row's composite key, `<ownerType>:<ownerId>:<fileKind>
19941
+ * [:<timestampMs>]`, which embedded a FOREIGN id. D474 made event ids
19942
+ * per-table rowid aliases, so `object:101314` and `motion:101314` are two
19943
+ * different rows that spell the same number, and a track whose
19944
+ * `bestEventId` was an object event was served a motion event's snapshot —
19945
+ * a night-time thumbnail on an afternoon track, with no error anywhere. A
19946
+ * surrogate id cannot name the wrong row's owner, because it names no owner
19947
+ * at all.
19948
+ */
19949
+ mediaId: zod.z.number().int(),
19842
19950
  kind: MediaFileKindEnum,
19843
19951
  sizeBytes: zod.z.number(),
19844
19952
  timestamp: zod.z.number()
@@ -19857,7 +19965,7 @@ var MediaFileRefSchema = zod.z.object({
19857
19965
  * hub-main's heap on the way past — for an `<img>` that would have cached it.
19858
19966
  *
19859
19967
  * `url` points at the `event-media` data plane
19860
- * (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
19968
+ * (`/addon/<addonId>/event-media/m/<mediaId>` — D482), which serves the same blob
19861
19969
  * with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
19862
19970
  * render a `?variant=thumb`, and streams. The hub gate in front of it requires
19863
19971
  * a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
@@ -19865,10 +19973,13 @@ var MediaFileRefSchema = zod.z.object({
19865
19973
  * `data-plane-access.ts` for the rule and the one gap it does not close
19866
19974
  * (per-device scoping).
19867
19975
  *
19868
- * The URL is built from the row's **stored** key, which is not always its
19869
- * published `kind`: a track's face/plate crop is stored as `crop` under
19976
+ * The URL is built from the row's own id, which since D482 says nothing about
19977
+ * the row's owner or kind — and that is the point. The published `kind` is not
19978
+ * the stored one (a track's face/plate crop is stored as `crop` under
19870
19979
  * `('face'|'plate', '<prefix>-<trackId>')` and published as
19871
- * `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
19980
+ * `faceCrop`/`plateCrop`), and under the old composite key the URL had to be
19981
+ * taken from `row.key` verbatim or it 404'd exactly those two rows. An id
19982
+ * cannot be mis-reconstructed, because there is nothing in it to reconstruct.
19872
19983
  *
19873
19984
  * ## `base64` is TRANSITIONAL and is going away
19874
19985
  *
@@ -19984,7 +20095,7 @@ var RetrainTrackSchema = zod.z.object({
19984
20095
  });
19985
20096
  /** A frame the picker may offer — an index row, no blob was read to produce it. */
19986
20097
  var RetrainFrameCandidateSchema = zod.z.object({
19987
- mediaKey: zod.z.string(),
20098
+ mediaId: zod.z.number().int(),
19988
20099
  kind: MediaFileKindEnum,
19989
20100
  timestamp: zod.z.number(),
19990
20101
  sizeBytes: zod.z.number().int(),
@@ -19998,7 +20109,7 @@ var RetrainFrameSchema = zod.z.object({
19998
20109
  deviceId: zod.z.number(),
19999
20110
  trackId: zod.z.string(),
20000
20111
  /** Provenance only. It may already point at nothing — that is expected. */
20001
- sourceMediaKey: zod.z.string(),
20112
+ sourceMediaId: zod.z.number().int(),
20002
20113
  sourceKind: MediaFileKindEnum,
20003
20114
  sizeBytes: zod.z.number().int(),
20004
20115
  width: zod.z.number().int(),
@@ -20014,7 +20125,7 @@ var RetrainCopyRefusalSchema = zod.z.enum([
20014
20125
  var RetrainFrameSelectionSchema = zod.z.object({
20015
20126
  copied: zod.z.array(RetrainFrameSchema).readonly(),
20016
20127
  refused: zod.z.array(zod.z.object({
20017
- sourceMediaKey: zod.z.string(),
20128
+ sourceMediaId: zod.z.number().int(),
20018
20129
  reason: RetrainCopyRefusalSchema
20019
20130
  })).readonly()
20020
20131
  });
@@ -20022,7 +20133,7 @@ var RetrainFrameListSchema = zod.z.object({
20022
20133
  candidates: zod.z.array(RetrainFrameCandidateSchema).readonly(),
20023
20134
  copies: zod.z.array(RetrainFrameSchema).readonly(),
20024
20135
  /** What the page pre-selects — the native key frame when one survives. */
20025
- autoPickMediaKey: zod.z.string().optional()
20136
+ autoPickMediaId: zod.z.number().int().optional()
20026
20137
  });
20027
20138
  /** What the operator asked the assist to look for. */
20028
20139
  var RetrainAssistSubjectSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
@@ -20117,9 +20228,11 @@ var RecentTracksQueryInput = zod.z.object({
20117
20228
  });
20118
20229
  /**
20119
20230
  * A Summary (D359): the per-camera session envelope that references tracks.
20120
- * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
20121
- * served by the event-media plane by key), null until the first frame with a
20122
- * member visible has been materialised.
20231
+ * `groupShotMediaId` is the media ROW id of its group shot (`ownerKind:
20232
+ * 'summary'`, served by the event-media plane at `/m/<id>`), null until the
20233
+ * first frame with a member visible has been materialised (D482 — it was the
20234
+ * row's composite key, which embedded the owner and could name another table's
20235
+ * row once event ids became per-table rowids).
20123
20236
  */
20124
20237
  var SummarySchema = zod.z.object({
20125
20238
  id: zod.z.string(),
@@ -20128,7 +20241,7 @@ var SummarySchema = zod.z.object({
20128
20241
  lastActiveAt: zod.z.number(),
20129
20242
  sealedAt: zod.z.number().nullable(),
20130
20243
  memberCount: zod.z.number().int().nonnegative(),
20131
- groupShotKey: zod.z.string().nullable()
20244
+ groupShotMediaId: zod.z.number().int().nullable()
20132
20245
  });
20133
20246
  var SUMMARIES_MAX_LIMIT = 200;
20134
20247
  var SUMMARIES_DEFAULT_LIMIT = 50;
@@ -21129,7 +21242,7 @@ var pipelineAnalyticsCapability = {
21129
21242
  selectRetrainFrames: require_sleep.method(zod.z.object({
21130
21243
  deviceId: zod.z.number(),
21131
21244
  trackId: zod.z.string(),
21132
- mediaKeys: zod.z.array(zod.z.string()).min(1)
21245
+ mediaIds: zod.z.array(zod.z.number().int()).min(1)
21133
21246
  }), RetrainFrameSelectionSchema, {
21134
21247
  kind: "mutation",
21135
21248
  auth: "admin"
@@ -21293,8 +21406,29 @@ var pipelineAnalyticsCapability = {
21293
21406
  kind: "query",
21294
21407
  auth: "admin"
21295
21408
  }),
21409
+ /**
21410
+ * The media an EVENT owns.
21411
+ *
21412
+ * `ownerType` is REQUIRED, and that is the whole correction (D482). An
21413
+ * event is a row in ONE of three tables, and since D474 each numbers from
21414
+ * 1 independently: `motion:101314` and `object:101314` both exist. This
21415
+ * method took a bare `eventId` and the provider probed motion → object →
21416
+ * audio, stopping at the first hit — so on the live hub, where object
21417
+ * events own no media of their own and 299 883 of 300 559 media rows are
21418
+ * motion-owned, EVERY object event resolved to its motion namesake. A
21419
+ * track from 17:34 on camera 615 was served a snapshot from 22:35 eleven
21420
+ * days earlier, silently.
21421
+ *
21422
+ * D476 had already disambiguated the KEY (`motion:` vs `object:`); this is
21423
+ * the API catching up to it. Naming the table is not a "qualification" of
21424
+ * the ambiguity — a listing BY OWNER has no address to make surrogate: the
21425
+ * owner IS (table, id), and half of it is not a question.
21426
+ */
21296
21427
  getEventMedia: require_sleep.method(zod.z.object({
21297
- eventId: zod.z.string(),
21428
+ /** Which of the three event tables owns the row. */
21429
+ ownerType: EventOwnerTypeSchema,
21430
+ /** The event's rowid in that table (D474: an event id is a number). */
21431
+ eventId: zod.z.number().int(),
21298
21432
  kind: MediaFileKindEnum.optional(),
21299
21433
  deviceId: zod.z.number()
21300
21434
  }), zod.z.array(MediaFileSchema).readonly()),
@@ -21339,11 +21473,14 @@ var pipelineAnalyticsCapability = {
21339
21473
  * the live hub: one event's `fullFrameBoxed` is 2 824 077 B, base64'd to
21340
21474
  * ~3.8 MB, allocated whole in hub-main's heap, for a list of keys.
21341
21475
  *
21342
- * Same `deviceId` authorization subject as `getEventMedia`, and the same
21343
- * rows — this is a projection of that method, never a different question.
21476
+ * Same `deviceId` authorization subject as `getEventMedia`, the same
21477
+ * REQUIRED `ownerType` (read that method's docblock for the night-time
21478
+ * thumbnail this closes — D482), and the same rows: this is a projection
21479
+ * of that method, never a different question.
21344
21480
  */
21345
21481
  listEventMedia: require_sleep.method(zod.z.object({
21346
- eventId: zod.z.string(),
21482
+ ownerType: EventOwnerTypeSchema,
21483
+ eventId: zod.z.number().int(),
21347
21484
  deviceId: zod.z.number()
21348
21485
  }), zod.z.array(MediaFileInfoSchema).readonly()),
21349
21486
  /**
@@ -28527,8 +28664,8 @@ var IdentitySchema = zod.z.object({
28527
28664
  id: zod.z.string(),
28528
28665
  name: zod.z.string(),
28529
28666
  sampleCount: zod.z.number().int().nonnegative(),
28530
- coverMediaKey: zod.z.string().optional(),
28531
- /** Inline base64 of the cover sample's crop, resolved from `coverMediaKey`.
28667
+ coverMediaId: zod.z.number().int().optional(),
28668
+ /** Inline base64 of the cover sample's crop, resolved from `coverMediaId`.
28532
28669
  * Lets the UI render the person's face avatar instead of a placeholder icon. */
28533
28670
  coverBase64: zod.z.string().optional()
28534
28671
  });
@@ -28554,8 +28691,8 @@ var IdentitySampleAuditRowSchema = zod.z.object({
28554
28691
  enrolledAt: zod.z.number().int(),
28555
28692
  deviceId: zod.z.number().int().optional(),
28556
28693
  source: zod.z.enum(["detected", "photo"]),
28557
- /** The enrolled crop's media key, so the panel can show the evidence. */
28558
- mediaKey: zod.z.string().optional(),
28694
+ /** The enrolled crop's media row id, so the panel can show the evidence. */
28695
+ mediaId: zod.z.number().int().optional(),
28559
28696
  /**
28560
28697
  * False = the sample is stamped with a DIFFERENT face model, and a cosine
28561
28698
  * across feature spaces is a well-formed float with no meaning. Every number
@@ -28624,15 +28761,15 @@ var FaceInfoSchema = zod.z.object({
28624
28761
  */
28625
28762
  cropUrl: zod.z.string().optional(),
28626
28763
  /** Design B: the face bbox (pixel space) on the key frame — lets a detail
28627
- * view draw the box over the native `keyFrameMediaKey` frame. Absent on
28764
+ * view draw the box over the native `keyFrameMediaId` frame. Absent on
28628
28765
  * legacy rows written before design B. */
28629
28766
  faceBbox: BoundingBoxSchema.optional(),
28630
28767
  /** Design B: MediaStore key of the track's native-resolution key frame.
28631
28768
  * Fetch the native JPEG via the event-media data-plane
28632
- * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`). Absent when the
28769
+ * (`/addon/<addonId>/event-media/m/<keyFrameMediaId>`). Absent when the
28633
28770
  * track produced no key frame (e.g. native/onboard source) — the UI falls
28634
28771
  * back to the inline `base64` face crop. */
28635
- keyFrameMediaKey: zod.z.string().optional(),
28772
+ keyFrameMediaId: zod.z.number().int().optional(),
28636
28773
  /** Winning identity-match cosine (0..1) for this face's track, when an
28637
28774
  * identity was auto-confirmed. Lets the UI surface WHY a face was assigned
28638
28775
  * (confidence badge / low-confidence audit). Absent on legacy rows and on
@@ -28701,11 +28838,14 @@ var FaceClusterSchema = zod.z.object({
28701
28838
  * `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
28702
28839
  * dialog already rendering its key FRAME from the `event-media` plane.
28703
28840
  *
28704
- * `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
28705
- * media key directly, so this needed no new plane and no new access decision.
28841
+ * `url` is `/addon/<addonId>/event-media/m/<mediaId>` (D482). The plane
28842
+ * resolves a media row by its own id, so this needed no new plane and no new
28843
+ * access decision.
28706
28844
  */
28707
28845
  var MediaFileLiteSchema$1 = zod.z.object({
28708
- key: zod.z.string(),
28846
+ /** The media row's own id — the same address `MediaFileRef.mediaId` carries
28847
+ * (D482). It was the row's composite key, which embedded the owner. */
28848
+ mediaId: zod.z.number().int(),
28709
28849
  kind: zod.z.string(),
28710
28850
  url: zod.z.string(),
28711
28851
  sizeBytes: zod.z.number(),
@@ -28727,7 +28867,7 @@ var faceGalleryCapability = {
28727
28867
  * covers inline, ~10 KB of base64 per row, on a query this UI mounts
28728
28868
  * four times and the viewer holds at `staleTime: 30_000`.
28729
28869
  *
28730
- * Nothing loses its avatar: `coverMediaKey` is already on every row and
28870
+ * Nothing loses its avatar: `coverMediaId` is already on every row and
28731
28871
  * the `event-media` plane serves that key `immutable` with an ETag.
28732
28872
  *
28733
28873
  * **This is an INPUT field, so it does not reach the addon until the
@@ -32780,8 +32920,8 @@ var VehicleSchema = zod.z.object({
32780
32920
  id: zod.z.string(),
32781
32921
  name: zod.z.string(),
32782
32922
  sampleCount: zod.z.number().int().nonnegative(),
32783
- coverMediaKey: zod.z.string().optional(),
32784
- /** Inline base64 of the cover sample's plate crop, resolved from `coverMediaKey`. */
32923
+ coverMediaId: zod.z.number().int().optional(),
32924
+ /** Inline base64 of the cover sample's plate crop, resolved from `coverMediaId`. */
32785
32925
  coverBase64: zod.z.string().optional()
32786
32926
  });
32787
32927
  var VehicleSampleInfoSchema = zod.z.object({
@@ -32814,7 +32954,7 @@ var PlateInfoSchema = zod.z.object({
32814
32954
  /** keyFrame parity: the plate bbox (pixel space) on the native key frame. */
32815
32955
  plateBbox: BoundingBoxSchema.optional(),
32816
32956
  /** keyFrame parity: MediaStore key of the track's native-resolution key frame. */
32817
- keyFrameMediaKey: zod.z.string().optional(),
32957
+ keyFrameMediaId: zod.z.number().int().optional(),
32818
32958
  base64: zod.z.string().optional(),
32819
32959
  /**
32820
32960
  * Same crop as a data-plane URL, always present when the plate has a stored
@@ -32835,11 +32975,14 @@ var PlateInfoSchema = zod.z.object({
32835
32975
  * `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
32836
32976
  * dialog already rendering its key FRAME from the `event-media` plane.
32837
32977
  *
32838
- * `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
32839
- * media key directly, so this needed no new plane and no new access decision.
32978
+ * `url` is `/addon/<addonId>/event-media/m/<mediaId>` (D482). The plane
32979
+ * resolves a media row by its own id, so this needed no new plane and no new
32980
+ * access decision.
32840
32981
  */
32841
32982
  var MediaFileLiteSchema = zod.z.object({
32842
- key: zod.z.string(),
32983
+ /** The media row's own id — the same address `MediaFileRef.mediaId` carries
32984
+ * (D482). It was the row's composite key, which embedded the owner. */
32985
+ mediaId: zod.z.number().int(),
32843
32986
  kind: zod.z.string(),
32844
32987
  url: zod.z.string(),
32845
32988
  sizeBytes: zod.z.number(),
@@ -32921,7 +33064,7 @@ var plateGalleryCapability = {
32921
33064
  listVehicles: require_sleep.method(zod.z.object({
32922
33065
  /** Inline {@link VehicleSchema.coverBase64} on every row. Default
32923
33066
  * `false` — the vehicle twin of `faceGallery.listIdentities`'s
32924
- * option; `coverMediaKey` + the `event-media` plane carry the picture.
33067
+ * option; `coverMediaId` + the `event-media` plane carry the picture.
32925
33068
  * INPUT field: stripped by the hub router until the train ships, which
32926
33069
  * resolves to `false` and is exactly the intended default. */
32927
33070
  includeCrops: zod.z.boolean().optional() }).optional(), zod.z.array(VehicleSchema).readonly()),
@@ -34929,7 +35072,14 @@ var SceneReferenceSchema = zod.z.object({
34929
35072
  modelId: zod.z.string(),
34930
35073
  condition: SceneConditionSchema,
34931
35074
  capturedAt: zod.z.number(),
34932
- thumbnailMediaId: zod.z.string().optional(),
35075
+ /**
35076
+ * The reference thumbnail's media ROW id (D482).
35077
+ *
35078
+ * The name already said `mediaId` while the value was the row's composite
35079
+ * key — a leftover that read as done and was not. It is the row's own id
35080
+ * now, addressed at `/addon/<addonId>/event-media/m/<id>`.
35081
+ */
35082
+ thumbnailMediaId: zod.z.number().int().optional(),
34933
35083
  /** Whole-frame (downscaled) embedding captured alongside the ROI crop. The
34934
35084
  * anti-view-shift anchor: a bumped camera, a PTZ preset or a re-aim makes the
34935
35085
  * normalized rect frame a different piece of world, and the scene would
@@ -37399,7 +37549,7 @@ var StationaryObjectSchema = zod.z.object({
37399
37549
  /** Enrichment label carried from the source track (identity / plate). */
37400
37550
  label: zod.z.string().optional(),
37401
37551
  /** Native-resolution key-frame media key for the parked object's best image. */
37402
- keyFrameMediaKey: zod.z.string().optional()
37552
+ keyFrameMediaId: zod.z.number().int().optional()
37403
37553
  });
37404
37554
  var CameraOccupancySnapshotSchema = zod.z.object({
37405
37555
  /** Frame timestamp of the inference result that produced this snapshot. */
@@ -43313,6 +43463,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
43313
43463
  addonId: null,
43314
43464
  access: "create"
43315
43465
  },
43466
+ "dataStoreProvider.upsert": {
43467
+ capName: "data-store-provider",
43468
+ capScope: "system",
43469
+ addonId: null,
43470
+ access: "create"
43471
+ },
43316
43472
  "dayNight.getOptions": {
43317
43473
  capName: "day-night",
43318
43474
  capScope: "device",
@@ -47177,6 +47333,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
47177
47333
  addonId: null,
47178
47334
  access: "create"
47179
47335
  },
47336
+ "settingsStore.upsert": {
47337
+ capName: "settings-store",
47338
+ capScope: "system",
47339
+ addonId: null,
47340
+ access: "create"
47341
+ },
47180
47342
  "smtpProvider.getStatus": {
47181
47343
  capName: "smtp-provider",
47182
47344
  capScope: "system",
@@ -51746,6 +51908,7 @@ function createSystemProxy(api) {
51746
51908
  get: (input) => dispatch("settingsStore", "get", "query", input),
51747
51909
  set: (input) => dispatch("settingsStore", "set", "mutation", input),
51748
51910
  query: (input) => dispatch("settingsStore", "query", "query", input),
51911
+ upsert: (input) => dispatch("settingsStore", "upsert", "mutation", input),
51749
51912
  insert: (input) => dispatch("settingsStore", "insert", "mutation", input),
51750
51913
  insertMany: (input) => dispatch("settingsStore", "insertMany", "mutation", input),
51751
51914
  update: (input) => dispatch("settingsStore", "update", "mutation", input),
@@ -56323,6 +56486,7 @@ exports.EventMediaArtifactSchema = EventMediaArtifactSchema;
56323
56486
  exports.EventMediaCoverageSchema = EventMediaCoverageSchema;
56324
56487
  exports.EventMediaKindSchema = EventMediaKindSchema;
56325
56488
  exports.EventMediaProductionSchema = EventMediaProductionSchema;
56489
+ exports.EventOwnerTypeSchema = EventOwnerTypeSchema;
56326
56490
  exports.EventSourceType = require_enums.EventSourceType$1;
56327
56491
  exports.ExportBytesSchema = ExportBytesSchema;
56328
56492
  exports.ExportDenseRangeSchema = ExportDenseRangeSchema;
@@ -57295,6 +57459,7 @@ exports.isEventOwnerType = isEventOwnerType;
57295
57459
  exports.isFirstLevelMacroClass = isFirstLevelMacroClass;
57296
57460
  exports.isIsolatedBuiltin = isIsolatedBuiltin;
57297
57461
  exports.isLocationEnabled = isLocationEnabled;
57462
+ exports.isMediaOwnerType = isMediaOwnerType;
57298
57463
  exports.isNode = isNode;
57299
57464
  exports.isObjectInput = isObjectInput;
57300
57465
  exports.isOccupancyRule = isOccupancyRule;