@camstack/types 1.2.47 → 1.2.48

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.
@@ -28,6 +28,7 @@ declare const FaceInfoSchema: z.ZodObject<{
28
28
  identityName: z.ZodOptional<z.ZodString>;
29
29
  assigned: z.ZodBoolean;
30
30
  base64: z.ZodOptional<z.ZodString>;
31
+ cropUrl: z.ZodOptional<z.ZodString>;
31
32
  faceBbox: z.ZodOptional<z.ZodObject<{
32
33
  x: z.ZodNumber;
33
34
  y: z.ZodNumber;
@@ -92,6 +93,7 @@ export declare const faceGalleryCapability: {
92
93
  recognized: "recognized";
93
94
  all: "all";
94
95
  }>>;
96
+ includeCrops: z.ZodOptional<z.ZodBoolean>;
95
97
  }, z.core.$strip>>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
96
98
  faceId: z.ZodString;
97
99
  deviceId: z.ZodNumber;
@@ -101,6 +103,7 @@ export declare const faceGalleryCapability: {
101
103
  identityName: z.ZodOptional<z.ZodString>;
102
104
  assigned: z.ZodBoolean;
103
105
  base64: z.ZodOptional<z.ZodString>;
106
+ cropUrl: z.ZodOptional<z.ZodString>;
104
107
  faceBbox: z.ZodOptional<z.ZodObject<{
105
108
  x: z.ZodNumber;
106
109
  y: z.ZodNumber;
@@ -125,6 +128,7 @@ export declare const faceGalleryCapability: {
125
128
  identityName: z.ZodOptional<z.ZodString>;
126
129
  assigned: z.ZodBoolean;
127
130
  base64: z.ZodOptional<z.ZodString>;
131
+ cropUrl: z.ZodOptional<z.ZodString>;
128
132
  faceBbox: z.ZodOptional<z.ZodObject<{
129
133
  x: z.ZodNumber;
130
134
  y: z.ZodNumber;
@@ -9304,7 +9304,7 @@ export type AppRouter = TrpcCoreRouter<{
9304
9304
  createShareToken: import("@trpc/server").TRPCMutationProcedure<{
9305
9305
  input: {
9306
9306
  scope: {
9307
- kind: "grid-view";
9307
+ kind: "grid-view" | "events-view";
9308
9308
  deviceIds: number[];
9309
9309
  };
9310
9310
  ttlSec?: number | "never" | undefined;
@@ -9332,7 +9332,7 @@ export type AppRouter = TrpcCoreRouter<{
9332
9332
  userId: string;
9333
9333
  tokenPrefix: string;
9334
9334
  scope: {
9335
- kind: "grid-view";
9335
+ kind: "grid-view" | "events-view";
9336
9336
  deviceIds: number[];
9337
9337
  };
9338
9338
  createdAt: number;
@@ -9617,7 +9617,7 @@ export type AppRouter = TrpcCoreRouter<{
9617
9617
  createShareToken: import("@trpc/server").TRPCMutationProcedure<{
9618
9618
  input: {
9619
9619
  scope: {
9620
- kind: "grid-view";
9620
+ kind: "grid-view" | "events-view";
9621
9621
  deviceIds: number[];
9622
9622
  };
9623
9623
  ttlSec?: number | "never" | undefined;
@@ -9645,7 +9645,7 @@ export type AppRouter = TrpcCoreRouter<{
9645
9645
  userId: string;
9646
9646
  tokenPrefix: string;
9647
9647
  scope: {
9648
- kind: "grid-view";
9648
+ kind: "grid-view" | "events-view";
9649
9649
  deviceIds: number[];
9650
9650
  };
9651
9651
  createdAt: number;
package/dist/index.js CHANGED
@@ -19114,7 +19114,29 @@ var FaceInfoSchema = zod.z.object({
19114
19114
  recognizedIdentityId: zod.z.string().optional(),
19115
19115
  identityName: zod.z.string().optional(),
19116
19116
  assigned: zod.z.boolean(),
19117
+ /**
19118
+ * The crop, inline, base64.
19119
+ *
19120
+ * **Prefer {@link cropUrl}.** At the 500 rows the Faces view asks for this
19121
+ * field alone is ~2.87 MiB, re-sent in full on every operator assign and
19122
+ * every 30 s poll, base64-inflated over the msgpack socket and held in the
19123
+ * query heap. It stays for callers that have not migrated; `includeCrops:
19124
+ * false` turns it off once they have.
19125
+ */
19117
19126
  base64: zod.z.string().optional(),
19127
+ /**
19128
+ * Same crop, as a data-plane URL for `<img src>` — the move the admin
19129
+ * snapshot surfaces made on 2026-08-08.
19130
+ *
19131
+ * Served by the `event-media` plane, which resolves a raw MediaStore key and
19132
+ * is `access: 'authenticated'`: a bare `<img>` carries the `camstack_session`
19133
+ * cookie, so no header plumbing is needed. The bytes then ride the browser's
19134
+ * HTTP cache with an ETag and `immutable`, instead of the WebSocket.
19135
+ *
19136
+ * Absent when the face has no stored crop, or when the addon has no data
19137
+ * plane — callers fall back to {@link base64}.
19138
+ */
19139
+ cropUrl: zod.z.string().optional(),
19118
19140
  /** Design B: the face bbox (pixel space) on the key frame — lets a detail
19119
19141
  * view draw the box over the native `keyFrameMediaKey` frame. Absent on
19120
19142
  * legacy rows written before design B. */
@@ -19190,7 +19212,23 @@ var faceGalleryCapability = {
19190
19212
  }),
19191
19213
  listRecentFaces: require_sleep.method(zod.z.object({
19192
19214
  limit: zod.z.number().int().positive().optional(),
19193
- filter: FaceFilterEnum.optional()
19215
+ filter: FaceFilterEnum.optional(),
19216
+ /**
19217
+ * Inline the base64 crop on every row. Default `true` — the existing
19218
+ * behaviour, kept so no caller breaks.
19219
+ *
19220
+ * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
19221
+ * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
19222
+ * the browser cache the images.
19223
+ *
19224
+ * **This is an INPUT field, so it does not reach the addon until the
19225
+ * next train.** The hub router validates cap inputs against its own
19226
+ * compiled Zod, which strips a key it does not know — verified today
19227
+ * on the OUTPUT side, where an additive field DOES arrive immediately
19228
+ * (`Track.hasFace`). Until the train ships, sending `false` is
19229
+ * harmless and simply keeps the crops inline.
19230
+ */
19231
+ includeCrops: zod.z.boolean().optional()
19194
19232
  }).optional(), zod.z.array(FaceInfoSchema).readonly()),
19195
19233
  getFaceByTrack: require_sleep.method(zod.z.object({
19196
19234
  deviceId: zod.z.number().int(),
package/dist/index.mjs CHANGED
@@ -19113,7 +19113,29 @@ var FaceInfoSchema = z.object({
19113
19113
  recognizedIdentityId: z.string().optional(),
19114
19114
  identityName: z.string().optional(),
19115
19115
  assigned: z.boolean(),
19116
+ /**
19117
+ * The crop, inline, base64.
19118
+ *
19119
+ * **Prefer {@link cropUrl}.** At the 500 rows the Faces view asks for this
19120
+ * field alone is ~2.87 MiB, re-sent in full on every operator assign and
19121
+ * every 30 s poll, base64-inflated over the msgpack socket and held in the
19122
+ * query heap. It stays for callers that have not migrated; `includeCrops:
19123
+ * false` turns it off once they have.
19124
+ */
19116
19125
  base64: z.string().optional(),
19126
+ /**
19127
+ * Same crop, as a data-plane URL for `<img src>` — the move the admin
19128
+ * snapshot surfaces made on 2026-08-08.
19129
+ *
19130
+ * Served by the `event-media` plane, which resolves a raw MediaStore key and
19131
+ * is `access: 'authenticated'`: a bare `<img>` carries the `camstack_session`
19132
+ * cookie, so no header plumbing is needed. The bytes then ride the browser's
19133
+ * HTTP cache with an ETag and `immutable`, instead of the WebSocket.
19134
+ *
19135
+ * Absent when the face has no stored crop, or when the addon has no data
19136
+ * plane — callers fall back to {@link base64}.
19137
+ */
19138
+ cropUrl: z.string().optional(),
19117
19139
  /** Design B: the face bbox (pixel space) on the key frame — lets a detail
19118
19140
  * view draw the box over the native `keyFrameMediaKey` frame. Absent on
19119
19141
  * legacy rows written before design B. */
@@ -19189,7 +19211,23 @@ var faceGalleryCapability = {
19189
19211
  }),
19190
19212
  listRecentFaces: method(z.object({
19191
19213
  limit: z.number().int().positive().optional(),
19192
- filter: FaceFilterEnum.optional()
19214
+ filter: FaceFilterEnum.optional(),
19215
+ /**
19216
+ * Inline the base64 crop on every row. Default `true` — the existing
19217
+ * behaviour, kept so no caller breaks.
19218
+ *
19219
+ * Set `false` once the caller renders {@link FaceInfo.cropUrl}: that
19220
+ * drops ~2.87 MiB per 500-row page to a few KiB of metadata and lets
19221
+ * the browser cache the images.
19222
+ *
19223
+ * **This is an INPUT field, so it does not reach the addon until the
19224
+ * next train.** The hub router validates cap inputs against its own
19225
+ * compiled Zod, which strips a key it does not know — verified today
19226
+ * on the OUTPUT side, where an additive field DOES arrive immediately
19227
+ * (`Track.hasFace`). Until the train ships, sending `false` is
19228
+ * harmless and simply keeps the crops inline.
19229
+ */
19230
+ includeCrops: z.boolean().optional()
19193
19231
  }).optional(), z.array(FaceInfoSchema).readonly()),
19194
19232
  getFaceByTrack: method(z.object({
19195
19233
  deviceId: z.number().int(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.47",
3
+ "version": "1.2.48",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",