@camstack/addon-auth 1.1.13 → 1.1.15
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/{dist-CWKBj1qI.js → dist-CCXGqh4j.js} +511 -2
- package/dist/{dist-Du1AeySd.mjs → dist-COSFJXt6.mjs} +511 -2
- package/dist/magic-link/auth-magic-link.addon.js +1 -1
- package/dist/magic-link/auth-magic-link.addon.mjs +1 -1
- package/dist/oidc/auth-oidc.addon.js +1 -1
- package/dist/oidc/auth-oidc.addon.mjs +1 -1
- package/dist/webauthn/_stub.js +1 -1
- package/dist/webauthn/{_virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-CZYuaPs2.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-CbkA0E7z.mjs} +3 -3
- package/dist/webauthn/_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-jP3xqczc.mjs +26 -0
- package/dist/webauthn/auth-webauthn.addon.js +1 -1
- package/dist/webauthn/auth-webauthn.addon.mjs +1 -1
- package/dist/webauthn/{hostInit-DXXBz8Md.mjs → hostInit-D1Gbwg-e.mjs} +3 -3
- package/dist/webauthn/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/webauthn/_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-C1TjQuaU.mjs +0 -26
|
@@ -7456,6 +7456,62 @@ var RecordingConfigSchema = object({
|
|
|
7456
7456
|
scrubThumbnails: ScrubThumbnailPresetSchema.optional()
|
|
7457
7457
|
});
|
|
7458
7458
|
/**
|
|
7459
|
+
* Ops-log — the durable, append-only operations audit shared by the
|
|
7460
|
+
* recordings and events management surfaces.
|
|
7461
|
+
*
|
|
7462
|
+
* ONE row shape is reused for both domains so a single "Activity" view can
|
|
7463
|
+
* merge the recorder's DurableState ring (recordings ops-log) and the
|
|
7464
|
+
* pipeline-analytics SQLite collection (events ops-log). Each row records a
|
|
7465
|
+
* management operation, WHY it ran (reason), and its measurable effect
|
|
7466
|
+
* (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
|
|
7467
|
+
* never fail the operation it records.
|
|
7468
|
+
*/
|
|
7469
|
+
/** Which management domain the operation belongs to. */
|
|
7470
|
+
var OpsLogDomainSchema = _enum(["recording", "events"]);
|
|
7471
|
+
/** The kind of management operation performed. */
|
|
7472
|
+
var OpsLogOpSchema = _enum([
|
|
7473
|
+
"prune",
|
|
7474
|
+
"manual-delete",
|
|
7475
|
+
"rescan",
|
|
7476
|
+
"retention-run"
|
|
7477
|
+
]);
|
|
7478
|
+
/** Why the operation ran. */
|
|
7479
|
+
var OpsLogReasonSchema = _enum([
|
|
7480
|
+
"retention",
|
|
7481
|
+
"quota",
|
|
7482
|
+
"manual",
|
|
7483
|
+
"operator"
|
|
7484
|
+
]);
|
|
7485
|
+
/** One audit row, shared verbatim by both domains. */
|
|
7486
|
+
var OpsLogEntrySchema = object({
|
|
7487
|
+
/** Unique row id. */
|
|
7488
|
+
id: string(),
|
|
7489
|
+
/** Epoch ms the operation completed. */
|
|
7490
|
+
at: number(),
|
|
7491
|
+
domain: OpsLogDomainSchema,
|
|
7492
|
+
op: OpsLogOpSchema,
|
|
7493
|
+
reason: OpsLogReasonSchema,
|
|
7494
|
+
/** The camera the op targeted; null for a cluster/global op. */
|
|
7495
|
+
deviceId: number().nullable(),
|
|
7496
|
+
/** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
|
|
7497
|
+
nodeId: string(),
|
|
7498
|
+
/** Buckets / rows deleted (op-specific unit). */
|
|
7499
|
+
itemsAffected: number(),
|
|
7500
|
+
/** Bytes reclaimed by the op (0 when not measurable). */
|
|
7501
|
+
bytesReclaimed: number(),
|
|
7502
|
+
/** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
|
|
7503
|
+
detail: string().nullable(),
|
|
7504
|
+
/** Who/what triggered the op. */
|
|
7505
|
+
actor: string()
|
|
7506
|
+
});
|
|
7507
|
+
/** Shared query input for the per-domain `listOpsLog` cap methods. */
|
|
7508
|
+
var OpsLogQueryInputSchema = object({
|
|
7509
|
+
/** Restrict to a single camera; omit for every row. */
|
|
7510
|
+
deviceId: number().optional(),
|
|
7511
|
+
/** Max rows returned, newest-first. */
|
|
7512
|
+
limit: number().int().min(1).max(1e3).optional()
|
|
7513
|
+
});
|
|
7514
|
+
/**
|
|
7459
7515
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
7460
7516
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
7461
7517
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -7699,6 +7755,160 @@ var EncodeProfileSchema = object({
|
|
|
7699
7755
|
*/
|
|
7700
7756
|
outputArgs: array(string()).optional()
|
|
7701
7757
|
});
|
|
7758
|
+
var COCO_TO_MACRO = {
|
|
7759
|
+
mapping: {
|
|
7760
|
+
person: "person",
|
|
7761
|
+
bicycle: "vehicle",
|
|
7762
|
+
car: "vehicle",
|
|
7763
|
+
motorcycle: "vehicle",
|
|
7764
|
+
airplane: "vehicle",
|
|
7765
|
+
bus: "vehicle",
|
|
7766
|
+
train: "vehicle",
|
|
7767
|
+
truck: "vehicle",
|
|
7768
|
+
boat: "vehicle",
|
|
7769
|
+
bird: "animal",
|
|
7770
|
+
cat: "animal",
|
|
7771
|
+
dog: "animal",
|
|
7772
|
+
horse: "animal",
|
|
7773
|
+
sheep: "animal",
|
|
7774
|
+
cow: "animal",
|
|
7775
|
+
elephant: "animal",
|
|
7776
|
+
bear: "animal",
|
|
7777
|
+
zebra: "animal",
|
|
7778
|
+
giraffe: "animal",
|
|
7779
|
+
suitcase: "package",
|
|
7780
|
+
backpack: "package",
|
|
7781
|
+
handbag: "package"
|
|
7782
|
+
},
|
|
7783
|
+
preserveOriginal: false
|
|
7784
|
+
};
|
|
7785
|
+
var AUDIO_MACRO_LABELS = [
|
|
7786
|
+
{
|
|
7787
|
+
id: "speech",
|
|
7788
|
+
name: "Speech",
|
|
7789
|
+
icon: "🗣️"
|
|
7790
|
+
},
|
|
7791
|
+
{
|
|
7792
|
+
id: "scream",
|
|
7793
|
+
name: "Scream / Shout",
|
|
7794
|
+
icon: "😱"
|
|
7795
|
+
},
|
|
7796
|
+
{
|
|
7797
|
+
id: "crying",
|
|
7798
|
+
name: "Crying / Baby",
|
|
7799
|
+
icon: "😢"
|
|
7800
|
+
},
|
|
7801
|
+
{
|
|
7802
|
+
id: "laughter",
|
|
7803
|
+
name: "Laughter",
|
|
7804
|
+
icon: "😂"
|
|
7805
|
+
},
|
|
7806
|
+
{
|
|
7807
|
+
id: "music",
|
|
7808
|
+
name: "Music",
|
|
7809
|
+
icon: "🎵"
|
|
7810
|
+
},
|
|
7811
|
+
{
|
|
7812
|
+
id: "dog",
|
|
7813
|
+
name: "Dog",
|
|
7814
|
+
icon: "🐕"
|
|
7815
|
+
},
|
|
7816
|
+
{
|
|
7817
|
+
id: "cat",
|
|
7818
|
+
name: "Cat",
|
|
7819
|
+
icon: "🐈"
|
|
7820
|
+
},
|
|
7821
|
+
{
|
|
7822
|
+
id: "bird",
|
|
7823
|
+
name: "Bird",
|
|
7824
|
+
icon: "🐦"
|
|
7825
|
+
},
|
|
7826
|
+
{
|
|
7827
|
+
id: "animal",
|
|
7828
|
+
name: "Animal (other)",
|
|
7829
|
+
icon: "🐾"
|
|
7830
|
+
},
|
|
7831
|
+
{
|
|
7832
|
+
id: "alarm",
|
|
7833
|
+
name: "Alarm / Siren",
|
|
7834
|
+
icon: "🚨"
|
|
7835
|
+
},
|
|
7836
|
+
{
|
|
7837
|
+
id: "doorbell",
|
|
7838
|
+
name: "Doorbell / Knock",
|
|
7839
|
+
icon: "🔔"
|
|
7840
|
+
},
|
|
7841
|
+
{
|
|
7842
|
+
id: "glass_breaking",
|
|
7843
|
+
name: "Glass Breaking",
|
|
7844
|
+
icon: "💥"
|
|
7845
|
+
},
|
|
7846
|
+
{
|
|
7847
|
+
id: "gunshot",
|
|
7848
|
+
name: "Gunshot / Explosion",
|
|
7849
|
+
icon: "💣"
|
|
7850
|
+
},
|
|
7851
|
+
{
|
|
7852
|
+
id: "vehicle",
|
|
7853
|
+
name: "Vehicle",
|
|
7854
|
+
icon: "🚗"
|
|
7855
|
+
},
|
|
7856
|
+
{
|
|
7857
|
+
id: "siren",
|
|
7858
|
+
name: "Emergency Siren",
|
|
7859
|
+
icon: "🚑"
|
|
7860
|
+
},
|
|
7861
|
+
{
|
|
7862
|
+
id: "fire",
|
|
7863
|
+
name: "Fire / Smoke",
|
|
7864
|
+
icon: "🔥"
|
|
7865
|
+
},
|
|
7866
|
+
{
|
|
7867
|
+
id: "water",
|
|
7868
|
+
name: "Water",
|
|
7869
|
+
icon: "💧"
|
|
7870
|
+
},
|
|
7871
|
+
{
|
|
7872
|
+
id: "wind",
|
|
7873
|
+
name: "Wind / Weather",
|
|
7874
|
+
icon: "🌬️"
|
|
7875
|
+
},
|
|
7876
|
+
{
|
|
7877
|
+
id: "door",
|
|
7878
|
+
name: "Door",
|
|
7879
|
+
icon: "🚪"
|
|
7880
|
+
},
|
|
7881
|
+
{
|
|
7882
|
+
id: "footsteps",
|
|
7883
|
+
name: "Footsteps",
|
|
7884
|
+
icon: "👣"
|
|
7885
|
+
},
|
|
7886
|
+
{
|
|
7887
|
+
id: "crowd",
|
|
7888
|
+
name: "Crowd / Chatter",
|
|
7889
|
+
icon: "👥"
|
|
7890
|
+
},
|
|
7891
|
+
{
|
|
7892
|
+
id: "telephone",
|
|
7893
|
+
name: "Telephone",
|
|
7894
|
+
icon: "📞"
|
|
7895
|
+
},
|
|
7896
|
+
{
|
|
7897
|
+
id: "engine",
|
|
7898
|
+
name: "Engine / Motor",
|
|
7899
|
+
icon: "⚙️"
|
|
7900
|
+
},
|
|
7901
|
+
{
|
|
7902
|
+
id: "tools",
|
|
7903
|
+
name: "Tools / Construction",
|
|
7904
|
+
icon: "🔨"
|
|
7905
|
+
},
|
|
7906
|
+
{
|
|
7907
|
+
id: "silence",
|
|
7908
|
+
name: "Silence",
|
|
7909
|
+
icon: "🤫"
|
|
7910
|
+
}
|
|
7911
|
+
];
|
|
7702
7912
|
var YAMNET_TO_MACRO = {
|
|
7703
7913
|
mapping: {
|
|
7704
7914
|
Speech: "speech",
|
|
@@ -7965,6 +8175,125 @@ var _macroLookup = /* @__PURE__ */ new Map();
|
|
|
7965
8175
|
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7966
8176
|
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7967
8177
|
/**
|
|
8178
|
+
* Unified event-kind taxonomy — THE single source of truth for
|
|
8179
|
+
* `kind → { parentKind, category, level, color, iconId, labelKey, label,
|
|
8180
|
+
* icon }`.
|
|
8181
|
+
*
|
|
8182
|
+
* This dictionary folds together what used to be scattered across four
|
|
8183
|
+
* copies:
|
|
8184
|
+
* - `capabilities/sensor-event-kinds.ts` (sensor cap colors)
|
|
8185
|
+
* - `addon-post-analysis/.../services/event-kinds.ts`
|
|
8186
|
+
* (MOTION/PERSON/VEHICLE… _COLOR constants)
|
|
8187
|
+
* - `ui-library/composites/detection-colors.ts` (CLASS_COLORS)
|
|
8188
|
+
* - `addon-post-analysis/shared/frame/box-drawer.ts` (DEFAULT_COLOR)
|
|
8189
|
+
* - the COCO / audio class maps (macro ↔ sub relationships)
|
|
8190
|
+
*
|
|
8191
|
+
* The DATA (serializable — color/iconId/labelKey/parentKind) lives here in
|
|
8192
|
+
* `@camstack/types`. The UI-side mapping `iconId → lucide component` and
|
|
8193
|
+
* `labelKey → t()` lives in `@camstack/ui-library`. UIs never hardcode a
|
|
8194
|
+
* color or an icon: they read this dictionary (server descriptors carry the
|
|
8195
|
+
* fields inline; the client resolves color/icon/label from `iconId`/`kind`).
|
|
8196
|
+
*
|
|
8197
|
+
* Two levels only (v1 YAGNI): macro → sub. `person` is a leaf macro.
|
|
8198
|
+
*/
|
|
8199
|
+
var TAXONOMY_COLORS = {
|
|
8200
|
+
motion: "#f59e0b",
|
|
8201
|
+
audio: "#06b6d4",
|
|
8202
|
+
person: "#22c55e",
|
|
8203
|
+
vehicle: "#3b82f6",
|
|
8204
|
+
animal: "#f97316",
|
|
8205
|
+
package: "#a855f7",
|
|
8206
|
+
sensor: "#8b5cf6",
|
|
8207
|
+
control: "#10b981",
|
|
8208
|
+
genericDetection: "#64748b"
|
|
8209
|
+
};
|
|
8210
|
+
var DETECTION_SUB_COLORS = {
|
|
8211
|
+
car: "#f59e0b",
|
|
8212
|
+
truck: "#d97706",
|
|
8213
|
+
bus: "#b45309",
|
|
8214
|
+
motorcycle: "#eab308",
|
|
8215
|
+
bicycle: "#ca8a04",
|
|
8216
|
+
airplane: "#60a5fa",
|
|
8217
|
+
boat: "#2563eb",
|
|
8218
|
+
train: "#1d4ed8",
|
|
8219
|
+
bird: "#14b8a6",
|
|
8220
|
+
dog: "#84cc16",
|
|
8221
|
+
cat: "#f97316",
|
|
8222
|
+
horse: "#a16207",
|
|
8223
|
+
sheep: "#a3a3a3",
|
|
8224
|
+
cow: "#78716c",
|
|
8225
|
+
elephant: "#6b7280",
|
|
8226
|
+
bear: "#7c2d12",
|
|
8227
|
+
zebra: "#404040",
|
|
8228
|
+
giraffe: "#d4a373"
|
|
8229
|
+
};
|
|
8230
|
+
function titleCase(id) {
|
|
8231
|
+
return id.split(/[-_ ]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");
|
|
8232
|
+
}
|
|
8233
|
+
var entries = /* @__PURE__ */ new Map();
|
|
8234
|
+
function macro(kind, category, color, iconId, label) {
|
|
8235
|
+
entries.set(kind, {
|
|
8236
|
+
kind,
|
|
8237
|
+
parentKind: null,
|
|
8238
|
+
level: "macro",
|
|
8239
|
+
category,
|
|
8240
|
+
color,
|
|
8241
|
+
iconId,
|
|
8242
|
+
labelKey: `eventKind.${kind}`,
|
|
8243
|
+
label
|
|
8244
|
+
});
|
|
8245
|
+
}
|
|
8246
|
+
function sub(kind, parentKind, category, color, iconId, label) {
|
|
8247
|
+
entries.set(kind, {
|
|
8248
|
+
kind,
|
|
8249
|
+
parentKind,
|
|
8250
|
+
level: "sub",
|
|
8251
|
+
category,
|
|
8252
|
+
color,
|
|
8253
|
+
iconId,
|
|
8254
|
+
labelKey: `eventKind.${kind}`,
|
|
8255
|
+
label
|
|
8256
|
+
});
|
|
8257
|
+
}
|
|
8258
|
+
macro("motion", "motion", TAXONOMY_COLORS.motion, "motion", "Motion");
|
|
8259
|
+
macro("audio", "audio", TAXONOMY_COLORS.audio, "audio", "Audio");
|
|
8260
|
+
macro("person", "detection", TAXONOMY_COLORS.person, "person", "Person");
|
|
8261
|
+
macro("vehicle", "detection", TAXONOMY_COLORS.vehicle, "vehicle", "Vehicle");
|
|
8262
|
+
macro("animal", "detection", TAXONOMY_COLORS.animal, "animal", "Animal");
|
|
8263
|
+
macro("package", "package", TAXONOMY_COLORS.package, "package", "Package");
|
|
8264
|
+
macro("sensor", "sensor", TAXONOMY_COLORS.sensor, "sensor", "Sensor");
|
|
8265
|
+
macro("control", "control", TAXONOMY_COLORS.control, "control", "Control");
|
|
8266
|
+
for (const [cocoClass, macroClass] of Object.entries(COCO_TO_MACRO.mapping)) {
|
|
8267
|
+
if (macroClass !== "vehicle" && macroClass !== "animal") continue;
|
|
8268
|
+
if (entries.has(cocoClass)) continue;
|
|
8269
|
+
sub(cocoClass, macroClass, "detection", DETECTION_SUB_COLORS[cocoClass] ?? TAXONOMY_COLORS.genericDetection, cocoClass, titleCase(cocoClass));
|
|
8270
|
+
}
|
|
8271
|
+
sub("package-delivered", "package", "package", TAXONOMY_COLORS.package, "package", "Package delivered");
|
|
8272
|
+
sub("package-picked-up", "package", "package", TAXONOMY_COLORS.package, "package", "Package picked up");
|
|
8273
|
+
sub("contact", "sensor", "sensor", "#f59e0b", "door", "Contact");
|
|
8274
|
+
sub("motion-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "pir", "Motion sensor");
|
|
8275
|
+
sub("smoke", "sensor", "sensor", "#ef4444", "smoke", "Smoke");
|
|
8276
|
+
sub("flood", "sensor", "sensor", "#3b82f6", "water", "Water leak");
|
|
8277
|
+
sub("gas", "sensor", "sensor", "#ef4444", "gas", "Gas");
|
|
8278
|
+
sub("carbon-monoxide", "sensor", "sensor", "#dc2626", "smoke", "Carbon monoxide");
|
|
8279
|
+
sub("vibration", "sensor", "sensor", "#eab308", "vibration", "Vibration");
|
|
8280
|
+
sub("tamper", "sensor", "sensor", "#f97316", "tamper", "Tamper");
|
|
8281
|
+
sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
|
|
8282
|
+
sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
|
|
8283
|
+
sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
|
|
8284
|
+
sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
|
|
8285
|
+
sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
|
|
8286
|
+
sub("siren", "control", "control", "#dc2626", "siren", "Siren");
|
|
8287
|
+
sub("button", "control", "control", "#10b981", "button", "Button");
|
|
8288
|
+
sub("doorbell", "control", "control", "#a855f7", "doorbell", "Doorbell");
|
|
8289
|
+
for (const l of AUDIO_MACRO_LABELS) {
|
|
8290
|
+
const kind = `audio-${l.id}`;
|
|
8291
|
+
if (entries.has(kind)) continue;
|
|
8292
|
+
sub(kind, "audio", "audio", TAXONOMY_COLORS.audio, kind, l.name);
|
|
8293
|
+
}
|
|
8294
|
+
/** The complete taxonomy dictionary, keyed by kind. */
|
|
8295
|
+
var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
|
|
8296
|
+
/**
|
|
7968
8297
|
* Error types for the safe expression engine. Two distinct classes so callers
|
|
7969
8298
|
* can tell a compile-time (grammar) failure from a runtime (evaluation)
|
|
7970
8299
|
* failure — both are non-fatal to the host: read paths degrade to "skip link".
|
|
@@ -15960,17 +16289,30 @@ var EventKindCategorySchema = _enum([
|
|
|
15960
16289
|
"audio",
|
|
15961
16290
|
"detection",
|
|
15962
16291
|
"sensor",
|
|
16292
|
+
"control",
|
|
15963
16293
|
"custom",
|
|
15964
16294
|
"package"
|
|
15965
16295
|
]);
|
|
16296
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
16297
|
+
var EventKindLevelSchema = _enum(["macro", "sub"]);
|
|
15966
16298
|
var EventKindDescriptorSchema = object({
|
|
15967
|
-
/** Stable kind id (e.g. 'motion', '
|
|
16299
|
+
/** Stable kind id (e.g. 'motion', 'vehicle', 'car', 'lock'). */
|
|
15968
16300
|
kind: string(),
|
|
16301
|
+
/** i18n key resolved on the UI side; `label` is the English fallback. */
|
|
16302
|
+
labelKey: string(),
|
|
16303
|
+
/** English fallback label (kept for clients that don't translate). */
|
|
15969
16304
|
label: string(),
|
|
15970
16305
|
/** Hex color for timeline/legend rendering. */
|
|
15971
16306
|
color: string(),
|
|
16307
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
16308
|
+
iconId: string(),
|
|
16309
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
15972
16310
|
icon: EventKindIconSchema,
|
|
15973
16311
|
category: EventKindCategorySchema,
|
|
16312
|
+
/** Macro parent for this kind ('car' → 'vehicle'); null for a macro. */
|
|
16313
|
+
parentKind: string().nullable(),
|
|
16314
|
+
/** Derived from `parentKind`, explicit for the client tree. */
|
|
16315
|
+
level: EventKindLevelSchema,
|
|
15974
16316
|
/** Which cap + device contributes this kind. For built-ins the camera
|
|
15975
16317
|
* itself; for sensor kinds the LINKED source device. */
|
|
15976
16318
|
source: object({
|
|
@@ -16043,11 +16385,21 @@ var TrackAudioLabelSchema = object({
|
|
|
16043
16385
|
firstAt: number(),
|
|
16044
16386
|
lastAt: number()
|
|
16045
16387
|
});
|
|
16388
|
+
/**
|
|
16389
|
+
* How a track was produced. `pipeline` (default / absent) = the spatial
|
|
16390
|
+
* detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
|
|
16391
|
+
* linked sensor/control state change (no positions; carries a snapshot). The
|
|
16392
|
+
* spatial subsystems (tracker association, occupancy count, re-id/embedding,
|
|
16393
|
+
* resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
|
|
16394
|
+
*/
|
|
16395
|
+
var TrackSourceSchema = _enum(["pipeline", "sensor"]);
|
|
16046
16396
|
var TrackSchema = object({
|
|
16047
16397
|
trackId: string(),
|
|
16048
16398
|
deviceId: number(),
|
|
16049
16399
|
className: string(),
|
|
16050
16400
|
label: string().optional(),
|
|
16401
|
+
/** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
|
|
16402
|
+
source: TrackSourceSchema.optional(),
|
|
16051
16403
|
firstSeen: number(),
|
|
16052
16404
|
lastSeen: number(),
|
|
16053
16405
|
/** Frame-rate position history (subject to maxPositionHistory cap). */
|
|
@@ -16302,6 +16654,26 @@ var TrackCascadeCountsSchema = object({
|
|
|
16302
16654
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
16303
16655
|
embeddings: number().int()
|
|
16304
16656
|
});
|
|
16657
|
+
/** Event-store footprint for one camera. */
|
|
16658
|
+
var EventStoreDeviceFootprintSchema = object({
|
|
16659
|
+
deviceId: number(),
|
|
16660
|
+
/** Persisted event rows (motion + object + audio) for the camera. */
|
|
16661
|
+
rows: number().int(),
|
|
16662
|
+
/** Event-owned media bytes on disk for the camera. */
|
|
16663
|
+
bytes: number().int()
|
|
16664
|
+
});
|
|
16665
|
+
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
16666
|
+
var EventStoreFootprintSchema = object({
|
|
16667
|
+
totalRows: number().int(),
|
|
16668
|
+
totalBytes: number().int(),
|
|
16669
|
+
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
16670
|
+
});
|
|
16671
|
+
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
16672
|
+
var EventPruneCountsSchema = object({
|
|
16673
|
+
motion: number().int(),
|
|
16674
|
+
object: number().int(),
|
|
16675
|
+
audio: number().int()
|
|
16676
|
+
});
|
|
16305
16677
|
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
16306
16678
|
deviceId: number(),
|
|
16307
16679
|
trackId: string()
|
|
@@ -16365,6 +16737,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16365
16737
|
}), {
|
|
16366
16738
|
kind: "mutation",
|
|
16367
16739
|
auth: "admin"
|
|
16740
|
+
}), method(object({}), EventStoreFootprintSchema, {
|
|
16741
|
+
kind: "query",
|
|
16742
|
+
auth: "admin"
|
|
16743
|
+
}), method(object({
|
|
16744
|
+
olderThanMs: number(),
|
|
16745
|
+
reason: OpsLogReasonSchema.optional()
|
|
16746
|
+
}), EventPruneCountsSchema, {
|
|
16747
|
+
kind: "mutation",
|
|
16748
|
+
auth: "admin"
|
|
16749
|
+
}), method(object({ deviceId: number() }), EventPruneCountsSchema, {
|
|
16750
|
+
kind: "mutation",
|
|
16751
|
+
auth: "admin"
|
|
16752
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
16753
|
+
kind: "query",
|
|
16754
|
+
auth: "admin"
|
|
16368
16755
|
}), method(object({
|
|
16369
16756
|
eventId: string(),
|
|
16370
16757
|
kind: MediaFileKindEnum.optional()
|
|
@@ -16389,6 +16776,76 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
16389
16776
|
eventId: string(),
|
|
16390
16777
|
timestamp: number()
|
|
16391
16778
|
});
|
|
16779
|
+
/**
|
|
16780
|
+
* Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
|
|
16781
|
+
* `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
|
|
16782
|
+
* caps into per-camera event-kind descriptors.
|
|
16783
|
+
*
|
|
16784
|
+
* The descriptor DATA (color / iconId / labelKey / parentKind / category)
|
|
16785
|
+
* is NOT duplicated here — every entry is derived from the single
|
|
16786
|
+
* `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
|
|
16787
|
+
* ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
|
|
16788
|
+
* control cap means adding one line here (and a taxonomy entry); the anti-
|
|
16789
|
+
* drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
|
|
16790
|
+
* eventful cap is missing.
|
|
16791
|
+
*/
|
|
16792
|
+
/** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
|
|
16793
|
+
var LEGACY_ICON = {
|
|
16794
|
+
motion: "motion",
|
|
16795
|
+
audio: "audio",
|
|
16796
|
+
person: "person",
|
|
16797
|
+
vehicle: "vehicle",
|
|
16798
|
+
animal: "animal",
|
|
16799
|
+
package: "package",
|
|
16800
|
+
door: "door",
|
|
16801
|
+
pir: "pir",
|
|
16802
|
+
smoke: "smoke",
|
|
16803
|
+
water: "water",
|
|
16804
|
+
button: "button",
|
|
16805
|
+
generic: "generic",
|
|
16806
|
+
gas: "smoke",
|
|
16807
|
+
vibration: "generic",
|
|
16808
|
+
tamper: "generic",
|
|
16809
|
+
presence: "person",
|
|
16810
|
+
lock: "generic",
|
|
16811
|
+
siren: "generic",
|
|
16812
|
+
switch: "generic",
|
|
16813
|
+
doorbell: "button"
|
|
16814
|
+
};
|
|
16815
|
+
function legacyIcon(iconId) {
|
|
16816
|
+
return LEGACY_ICON[iconId] ?? "generic";
|
|
16817
|
+
}
|
|
16818
|
+
/**
|
|
16819
|
+
* Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
|
|
16820
|
+
* The anti-drift guard cross-checks this against the eventful caps declared
|
|
16821
|
+
* in `packages/types/src/capabilities/*.cap.ts`.
|
|
16822
|
+
*/
|
|
16823
|
+
var CAP_TO_KIND = {
|
|
16824
|
+
contact: "contact",
|
|
16825
|
+
motion: "motion-sensor",
|
|
16826
|
+
smoke: "smoke",
|
|
16827
|
+
flood: "flood",
|
|
16828
|
+
gas: "gas",
|
|
16829
|
+
"carbon-monoxide": "carbon-monoxide",
|
|
16830
|
+
vibration: "vibration",
|
|
16831
|
+
tamper: "tamper",
|
|
16832
|
+
presence: "presence",
|
|
16833
|
+
"enum-sensor": "enum-sensor",
|
|
16834
|
+
"event-emitter": "device-event",
|
|
16835
|
+
"lock-control": "lock",
|
|
16836
|
+
switch: "switch",
|
|
16837
|
+
button: "button",
|
|
16838
|
+
doorbell: "doorbell"
|
|
16839
|
+
};
|
|
16840
|
+
function buildDescriptor(capName, kind) {
|
|
16841
|
+
const t = EVENT_TAXONOMY[kind];
|
|
16842
|
+
if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
|
|
16843
|
+
return {
|
|
16844
|
+
...t,
|
|
16845
|
+
icon: legacyIcon(t.iconId)
|
|
16846
|
+
};
|
|
16847
|
+
}
|
|
16848
|
+
Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
|
|
16392
16849
|
var CameraPipelineConfigSchema = object({
|
|
16393
16850
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
16394
16851
|
steps: array(PipelineStepInputSchema).readonly(),
|
|
@@ -19615,13 +20072,29 @@ method(object({
|
|
|
19615
20072
|
}), method(object({ deviceId: number() }), RecordingStatusSchema, {
|
|
19616
20073
|
kind: "mutation",
|
|
19617
20074
|
auth: "admin"
|
|
19618
|
-
}), method(object({
|
|
20075
|
+
}), method(object({
|
|
20076
|
+
deviceId: number(),
|
|
20077
|
+
reason: OpsLogReasonSchema.optional()
|
|
20078
|
+
}), object({
|
|
19619
20079
|
floorMs: number().nullable(),
|
|
19620
20080
|
deletedBuckets: number().int(),
|
|
19621
20081
|
reclaimedBytes: number().int()
|
|
19622
20082
|
}), {
|
|
19623
20083
|
kind: "mutation",
|
|
19624
20084
|
auth: "admin"
|
|
20085
|
+
}), method(object({
|
|
20086
|
+
deviceId: number(),
|
|
20087
|
+
fromMs: number().optional(),
|
|
20088
|
+
toMs: number().optional()
|
|
20089
|
+
}), object({
|
|
20090
|
+
deletedBuckets: number().int(),
|
|
20091
|
+
reclaimedBytes: number().int()
|
|
20092
|
+
}), {
|
|
20093
|
+
kind: "mutation",
|
|
20094
|
+
auth: "admin"
|
|
20095
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
20096
|
+
kind: "query",
|
|
20097
|
+
auth: "admin"
|
|
19625
20098
|
});
|
|
19626
20099
|
/**
|
|
19627
20100
|
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
@@ -22743,6 +23216,12 @@ Object.freeze({
|
|
|
22743
23216
|
addonId: null,
|
|
22744
23217
|
access: "delete"
|
|
22745
23218
|
},
|
|
23219
|
+
"pipelineAnalytics.deleteDeviceEvents": {
|
|
23220
|
+
capName: "pipeline-analytics",
|
|
23221
|
+
capScope: "device",
|
|
23222
|
+
addonId: null,
|
|
23223
|
+
access: "delete"
|
|
23224
|
+
},
|
|
22746
23225
|
"pipelineAnalytics.deleteTracks": {
|
|
22747
23226
|
capName: "pipeline-analytics",
|
|
22748
23227
|
capScope: "device",
|
|
@@ -22773,6 +23252,12 @@ Object.freeze({
|
|
|
22773
23252
|
addonId: null,
|
|
22774
23253
|
access: "view"
|
|
22775
23254
|
},
|
|
23255
|
+
"pipelineAnalytics.getEventStoreFootprint": {
|
|
23256
|
+
capName: "pipeline-analytics",
|
|
23257
|
+
capScope: "device",
|
|
23258
|
+
addonId: null,
|
|
23259
|
+
access: "view"
|
|
23260
|
+
},
|
|
22776
23261
|
"pipelineAnalytics.getKeyEvents": {
|
|
22777
23262
|
capName: "pipeline-analytics",
|
|
22778
23263
|
capScope: "device",
|
|
@@ -22815,6 +23300,12 @@ Object.freeze({
|
|
|
22815
23300
|
addonId: null,
|
|
22816
23301
|
access: "view"
|
|
22817
23302
|
},
|
|
23303
|
+
"pipelineAnalytics.listOpsLog": {
|
|
23304
|
+
capName: "pipeline-analytics",
|
|
23305
|
+
capScope: "device",
|
|
23306
|
+
addonId: null,
|
|
23307
|
+
access: "view"
|
|
23308
|
+
},
|
|
22818
23309
|
"pipelineAnalytics.listRecentTracks": {
|
|
22819
23310
|
capName: "pipeline-analytics",
|
|
22820
23311
|
capScope: "device",
|
|
@@ -22827,6 +23318,12 @@ Object.freeze({
|
|
|
22827
23318
|
addonId: null,
|
|
22828
23319
|
access: "view"
|
|
22829
23320
|
},
|
|
23321
|
+
"pipelineAnalytics.pruneEvents": {
|
|
23322
|
+
capName: "pipeline-analytics",
|
|
23323
|
+
capScope: "device",
|
|
23324
|
+
addonId: null,
|
|
23325
|
+
access: "create"
|
|
23326
|
+
},
|
|
22830
23327
|
"pipelineAnalytics.pruneEventsBefore": {
|
|
22831
23328
|
capName: "pipeline-analytics",
|
|
22832
23329
|
capScope: "device",
|
|
@@ -23589,6 +24086,12 @@ Object.freeze({
|
|
|
23589
24086
|
addonId: null,
|
|
23590
24087
|
access: "create"
|
|
23591
24088
|
},
|
|
24089
|
+
"recording.deleteFootprint": {
|
|
24090
|
+
capName: "recording",
|
|
24091
|
+
capScope: "system",
|
|
24092
|
+
addonId: null,
|
|
24093
|
+
access: "delete"
|
|
24094
|
+
},
|
|
23592
24095
|
"recording.getAvailability": {
|
|
23593
24096
|
capName: "recording",
|
|
23594
24097
|
capScope: "system",
|
|
@@ -23619,6 +24122,12 @@ Object.freeze({
|
|
|
23619
24122
|
addonId: null,
|
|
23620
24123
|
access: "view"
|
|
23621
24124
|
},
|
|
24125
|
+
"recording.listOpsLog": {
|
|
24126
|
+
capName: "recording",
|
|
24127
|
+
capScope: "system",
|
|
24128
|
+
addonId: null,
|
|
24129
|
+
access: "view"
|
|
24130
|
+
},
|
|
23622
24131
|
"recording.locateSegment": {
|
|
23623
24132
|
capName: "recording",
|
|
23624
24133
|
capScope: "system",
|