@camstack/addon-advanced-notifier 0.1.27 → 0.1.29
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/addon.js +528 -96
- package/dist/addon.js.map +1 -1
- package/dist/addon.mjs +528 -96
- package/dist/addon.mjs.map +1 -1
- package/package.json +2 -1
package/dist/addon.js
CHANGED
|
@@ -5070,6 +5070,7 @@ const WELL_KNOWN_TABS = [
|
|
|
5070
5070
|
{ id: "osd", label: "OSD", icon: "type", order: 18 },
|
|
5071
5071
|
{ id: "stream-broker", label: "Stream Broker", icon: "radio", order: 20 },
|
|
5072
5072
|
{ id: "streaming", label: "Streaming", icon: "video", order: 35 },
|
|
5073
|
+
{ id: "ptz", label: "PTZ", icon: "move", order: 40 },
|
|
5073
5074
|
{ id: "pipeline", label: "Detection Pipeline", icon: "cpu", order: 39 },
|
|
5074
5075
|
{ id: "zones", label: "Detection", icon: "shapes", order: 38 },
|
|
5075
5076
|
{ id: "live-stats", label: "Live Stats", icon: "activity", order: 39 },
|
|
@@ -5137,6 +5138,9 @@ function hydrateField(field, values) {
|
|
|
5137
5138
|
return { ...field, value: items };
|
|
5138
5139
|
}
|
|
5139
5140
|
const rawValue = storedValue !== void 0 ? storedValue : defaultValue !== void 0 ? defaultValue : null;
|
|
5141
|
+
if (field.type === "password") {
|
|
5142
|
+
return { ...field, value: "" };
|
|
5143
|
+
}
|
|
5140
5144
|
const value = field.type === "textarea" && field.isJson && rawValue !== null && typeof rawValue === "object" ? JSON.stringify(rawValue, null, 2) : rawValue;
|
|
5141
5145
|
const hydrated = { ...field, value };
|
|
5142
5146
|
return hydrated;
|
|
@@ -5223,7 +5227,19 @@ const DecoderSessionConfigSchema = object({
|
|
|
5223
5227
|
* on every line so `grep tag=broker:5/high` filters one camera
|
|
5224
5228
|
* profile cleanly.
|
|
5225
5229
|
*/
|
|
5226
|
-
tag: string().optional()
|
|
5230
|
+
tag: string().optional(),
|
|
5231
|
+
/**
|
|
5232
|
+
* Where the session delivers decoded frames (Phase 5 / D9):
|
|
5233
|
+
*
|
|
5234
|
+
* - `'callback'` (default) — the legacy pixel path: decoded frames are
|
|
5235
|
+
* buffered as `DecodedFrame`s and drained via `pullFrames`.
|
|
5236
|
+
* - `'shm'` — the shared-memory frame plane: decoded frames are written
|
|
5237
|
+
* into an OS shared-memory ring and drained as zero-pixel
|
|
5238
|
+
* `FrameHandle`s via `pullHandles`. A session is one mode or the
|
|
5239
|
+
* other — `pullFrames` returns nothing for an `'shm'` session and
|
|
5240
|
+
* `pullHandles` returns nothing for a `'callback'` session.
|
|
5241
|
+
*/
|
|
5242
|
+
frameSink: _enum(["callback", "shm"]).default("callback")
|
|
5227
5243
|
});
|
|
5228
5244
|
const YAMNET_TO_MACRO = {
|
|
5229
5245
|
mapping: {
|
|
@@ -5953,6 +5969,53 @@ const DecodedFrameSchema = object({
|
|
|
5953
5969
|
format: _enum(["jpeg", "rgb", "bgr", "yuv420", "gray"]),
|
|
5954
5970
|
timestamp: number()
|
|
5955
5971
|
});
|
|
5972
|
+
const FrameHandleSchema = object({
|
|
5973
|
+
shmId: string(),
|
|
5974
|
+
slot: number().int().nonnegative(),
|
|
5975
|
+
seq: number().int().nonnegative(),
|
|
5976
|
+
width: number().int().positive(),
|
|
5977
|
+
height: number().int().positive(),
|
|
5978
|
+
format: _enum(["jpeg", "rgb", "bgr", "yuv420", "gray"]),
|
|
5979
|
+
pts: number(),
|
|
5980
|
+
byteLength: number().int().nonnegative(),
|
|
5981
|
+
nodeId: string(),
|
|
5982
|
+
slotCount: number().int().positive()
|
|
5983
|
+
});
|
|
5984
|
+
const FrameHandleFormatSchema = _enum(["rgb", "bgr", "yuv420", "gray"]);
|
|
5985
|
+
const SubscribeFramesInputSchema = object({
|
|
5986
|
+
brokerId: string(),
|
|
5987
|
+
format: FrameHandleFormatSchema,
|
|
5988
|
+
/**
|
|
5989
|
+
* Optional reader-side cadence hint in frames per second. The broker does
|
|
5990
|
+
* NOT throttle — latest-wins ring reads drop frames implicitly for a slow
|
|
5991
|
+
* consumer. The value is echoed back in `SubscribeFramesResult.maxFps` so
|
|
5992
|
+
* the consumer can pace its own `pullFrameHandles` polling.
|
|
5993
|
+
*/
|
|
5994
|
+
maxFps: number().positive().optional(),
|
|
5995
|
+
/** Short caller-identity tag (`motion`, `detection`, …) for diagnostics. */
|
|
5996
|
+
tag: string().optional()
|
|
5997
|
+
});
|
|
5998
|
+
const SubscribeFramesResultSchema = object({
|
|
5999
|
+
/** Opaque id the consumer passes to `pullFrameHandles` / `unsubscribeFrames`. */
|
|
6000
|
+
subscriptionId: string(),
|
|
6001
|
+
/** Reader-side cadence hint (frames/s) — echoes `SubscribeFramesInput.maxFps`. */
|
|
6002
|
+
maxFps: number().nonnegative()
|
|
6003
|
+
});
|
|
6004
|
+
const DecodedAudioChunkSchema = object({
|
|
6005
|
+
data: _instanceof(Uint8Array),
|
|
6006
|
+
sampleRate: number().int().positive(),
|
|
6007
|
+
channels: number().int().positive(),
|
|
6008
|
+
timestamp: number()
|
|
6009
|
+
});
|
|
6010
|
+
const SubscribeAudioChunksInputSchema = object({
|
|
6011
|
+
brokerId: string(),
|
|
6012
|
+
/** Short caller-identity tag (`audio-analyzer`, …) for `listClients`. */
|
|
6013
|
+
tag: string().optional()
|
|
6014
|
+
});
|
|
6015
|
+
const SubscribeAudioChunksResultSchema = object({
|
|
6016
|
+
/** Opaque id passed to `pullAudioChunks` / `unsubscribeAudioChunks`. */
|
|
6017
|
+
subscriptionId: string()
|
|
6018
|
+
});
|
|
5956
6019
|
const BrokerStatusSchema$1 = _enum(["idle", "connecting", "streaming", "error", "stopped"]);
|
|
5957
6020
|
const BrokerStatsSchema = object({
|
|
5958
6021
|
status: BrokerStatusSchema$1,
|
|
@@ -6174,9 +6237,76 @@ const RtpSourceSchema = object({
|
|
|
6174
6237
|
object({ released: boolean(), refcount: number().int().nonnegative() }),
|
|
6175
6238
|
{ kind: "mutation", auth: "admin" }
|
|
6176
6239
|
),
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6240
|
+
/**
|
|
6241
|
+
* ── Decoded audio-chunk plane (Phase 5 / D9) ──────────────────────
|
|
6242
|
+
*
|
|
6243
|
+
* The serialisable replacement for the live-object `IStreamBroker.
|
|
6244
|
+
* onDecodedAudioChunk` callback path. Unlike the video frame plane,
|
|
6245
|
+
* audio chunks are tiny (a ~500ms PCM window is a few KB) so they ship
|
|
6246
|
+
* their bytes INLINE over tRPC — no shared-memory ring. A consumer:
|
|
6247
|
+
*
|
|
6248
|
+
* 1. `subscribeAudioChunks({ brokerId, tag })` — the broker registers
|
|
6249
|
+
* a per-subscription bounded FIFO queue and returns a
|
|
6250
|
+
* `subscriptionId`.
|
|
6251
|
+
* 2. polls `pullAudioChunks({ subscriptionId, maxCount })` — drains
|
|
6252
|
+
* `DecodedAudioChunk[]` in arrival order (FIFO, no latest-wins
|
|
6253
|
+
* drop: an audio gap is audible / breaks an analysis window). The
|
|
6254
|
+
* queue is generously sized; it only drops its oldest chunk if a
|
|
6255
|
+
* truly stalled consumer lets it overflow.
|
|
6256
|
+
* 3. `unsubscribeAudioChunks({ subscriptionId })` on teardown.
|
|
6257
|
+
*/
|
|
6258
|
+
subscribeAudioChunks: method(
|
|
6259
|
+
SubscribeAudioChunksInputSchema,
|
|
6260
|
+
SubscribeAudioChunksResultSchema,
|
|
6261
|
+
{ kind: "mutation" }
|
|
6262
|
+
),
|
|
6263
|
+
pullAudioChunks: method(
|
|
6264
|
+
object({
|
|
6265
|
+
subscriptionId: string(),
|
|
6266
|
+
maxCount: number().int().positive().default(8)
|
|
6267
|
+
}),
|
|
6268
|
+
array(DecodedAudioChunkSchema).readonly()
|
|
6269
|
+
),
|
|
6270
|
+
unsubscribeAudioChunks: method(
|
|
6271
|
+
object({ subscriptionId: string() }),
|
|
6272
|
+
object({ released: boolean() }),
|
|
6273
|
+
{ kind: "mutation" }
|
|
6274
|
+
),
|
|
6275
|
+
/**
|
|
6276
|
+
* ── Shared-memory frame plane (Phase 5 / D9) ──────────────────────
|
|
6277
|
+
*
|
|
6278
|
+
* The handle-based replacement for the live-object `IStreamBroker.
|
|
6279
|
+
* onDecodedFrame` callback path. A consumer:
|
|
6280
|
+
*
|
|
6281
|
+
* 1. `subscribeFrames({ brokerId, format })` — the broker spins up
|
|
6282
|
+
* (or reuses) a `frameSink: 'shm'` decoder session producing that
|
|
6283
|
+
* `format` and returns a `subscriptionId`.
|
|
6284
|
+
* 2. polls `pullFrameHandles({ subscriptionId, maxCount })` — drains
|
|
6285
|
+
* zero-pixel `FrameHandle[]`; each handle is fed to a
|
|
6286
|
+
* `FrameRingReader` that opens the named shm segment and reads the
|
|
6287
|
+
* pixels back zero-copy.
|
|
6288
|
+
* 3. `unsubscribeFrames({ subscriptionId })` on teardown.
|
|
6289
|
+
*
|
|
6290
|
+
* The broker keeps one shm ring per `(brokerId, format)` actually
|
|
6291
|
+
* requested — no broker-side `sharp` conversion. fps throttling is
|
|
6292
|
+
* implicit (latest-wins ring reads drop frames for a slow consumer).
|
|
6293
|
+
*/
|
|
6294
|
+
subscribeFrames: method(
|
|
6295
|
+
SubscribeFramesInputSchema,
|
|
6296
|
+
SubscribeFramesResultSchema,
|
|
6297
|
+
{ kind: "mutation" }
|
|
6298
|
+
),
|
|
6299
|
+
pullFrameHandles: method(
|
|
6300
|
+
object({
|
|
6301
|
+
subscriptionId: string(),
|
|
6302
|
+
maxCount: number().int().positive().default(4)
|
|
6303
|
+
}),
|
|
6304
|
+
array(FrameHandleSchema).readonly()
|
|
6305
|
+
),
|
|
6306
|
+
unsubscribeFrames: method(
|
|
6307
|
+
object({ subscriptionId: string() }),
|
|
6308
|
+
object({ released: boolean() }),
|
|
6309
|
+
{ kind: "mutation" }
|
|
6180
6310
|
),
|
|
6181
6311
|
setPreBufferDuration: method(
|
|
6182
6312
|
object({ brokerId: string(), seconds: number().min(0).max(30) }),
|
|
@@ -7254,6 +7384,34 @@ MotionTriggerStatusSchema.extend({
|
|
|
7254
7384
|
}) }
|
|
7255
7385
|
}
|
|
7256
7386
|
});
|
|
7387
|
+
object({
|
|
7388
|
+
enabled: boolean(),
|
|
7389
|
+
sensitivity: number(),
|
|
7390
|
+
/** Row-major active-cell grid. Length = gridWidth*gridHeight (see getOptions). */
|
|
7391
|
+
cells: array(boolean()),
|
|
7392
|
+
lastFetchedAt: number()
|
|
7393
|
+
});
|
|
7394
|
+
const MotionZoneOptionsSchema = object({
|
|
7395
|
+
gridWidth: number(),
|
|
7396
|
+
gridHeight: number(),
|
|
7397
|
+
sensitivity: object({ min: number(), max: number(), step: number() })
|
|
7398
|
+
});
|
|
7399
|
+
const MotionZonePatchSchema = object({
|
|
7400
|
+
enabled: boolean().optional(),
|
|
7401
|
+
sensitivity: number().optional(),
|
|
7402
|
+
cells: array(boolean()).optional()
|
|
7403
|
+
});
|
|
7404
|
+
({
|
|
7405
|
+
deviceTypes: [DeviceType.Camera],
|
|
7406
|
+
methods: {
|
|
7407
|
+
getOptions: method(object({ deviceId: number() }), MotionZoneOptionsSchema),
|
|
7408
|
+
setZone: method(
|
|
7409
|
+
object({ deviceId: number(), patch: MotionZonePatchSchema }),
|
|
7410
|
+
_void(),
|
|
7411
|
+
{ kind: "mutation", auth: "admin" }
|
|
7412
|
+
)
|
|
7413
|
+
}
|
|
7414
|
+
});
|
|
7257
7415
|
const AutotrackTargetTypeSchema = string().describe("Vendor target string (people/vehicle/pet); empty = camera default");
|
|
7258
7416
|
const PtzAutotrackSettingsSchema = object({
|
|
7259
7417
|
targetType: AutotrackTargetTypeSchema,
|
|
@@ -7342,6 +7500,100 @@ PtzAutotrackStatusSchema.extend({
|
|
|
7342
7500
|
}) }
|
|
7343
7501
|
}
|
|
7344
7502
|
});
|
|
7503
|
+
const StreamProfileSchema = _enum(["main", "sub", "ext"]);
|
|
7504
|
+
const StreamProfileConfigSchema = object({
|
|
7505
|
+
width: number(),
|
|
7506
|
+
height: number(),
|
|
7507
|
+
codec: _enum(["h264", "h265"]),
|
|
7508
|
+
framerate: number(),
|
|
7509
|
+
bitrate: number(),
|
|
7510
|
+
// kbps
|
|
7511
|
+
bitrateMode: _enum(["vbr", "cbr"]).optional(),
|
|
7512
|
+
encoderProfile: _enum(["high", "main", "baseline"]).optional(),
|
|
7513
|
+
gop: number().optional(),
|
|
7514
|
+
audio: boolean().optional()
|
|
7515
|
+
});
|
|
7516
|
+
object({
|
|
7517
|
+
/** Per-profile current config. A profile absent = the camera doesn't have it. */
|
|
7518
|
+
main: StreamProfileConfigSchema.optional(),
|
|
7519
|
+
sub: StreamProfileConfigSchema.optional(),
|
|
7520
|
+
ext: StreamProfileConfigSchema.optional(),
|
|
7521
|
+
lastFetchedAt: number()
|
|
7522
|
+
});
|
|
7523
|
+
const StreamProfileOptionsSchema = object({
|
|
7524
|
+
resolutions: array(object({ width: number(), height: number() })),
|
|
7525
|
+
codecs: array(_enum(["h264", "h265"])),
|
|
7526
|
+
framerates: array(number()),
|
|
7527
|
+
/** Allowed bitrate values (kbps). Empty if the camera takes a free range. */
|
|
7528
|
+
bitrates: array(number()),
|
|
7529
|
+
/** Optional [min,max] kbps when the camera accepts a continuous range. */
|
|
7530
|
+
bitrateRange: tuple([number(), number()]).optional(),
|
|
7531
|
+
supportsBitrateMode: boolean(),
|
|
7532
|
+
supportsEncoderProfile: boolean(),
|
|
7533
|
+
supportsGop: boolean(),
|
|
7534
|
+
/** Allowed GOP / keyframe-interval range, in seconds — drives the
|
|
7535
|
+
* I-frame-interval selector. Absent when the camera advertises GOP
|
|
7536
|
+
* support but no concrete range (callers then fall back to a free
|
|
7537
|
+
* numeric input). `{ min, max, step }` per the getOptions convention. */
|
|
7538
|
+
gop: object({ min: number(), max: number(), step: number() }).optional()
|
|
7539
|
+
});
|
|
7540
|
+
const StreamParamsOptionsSchema = object({
|
|
7541
|
+
main: StreamProfileOptionsSchema.optional(),
|
|
7542
|
+
sub: StreamProfileOptionsSchema.optional(),
|
|
7543
|
+
ext: StreamProfileOptionsSchema.optional()
|
|
7544
|
+
});
|
|
7545
|
+
const StreamProfilePatchSchema = object({
|
|
7546
|
+
width: number().optional(),
|
|
7547
|
+
height: number().optional(),
|
|
7548
|
+
codec: _enum(["h264", "h265"]).optional(),
|
|
7549
|
+
framerate: number().optional(),
|
|
7550
|
+
bitrate: number().optional(),
|
|
7551
|
+
bitrateMode: _enum(["vbr", "cbr"]).optional(),
|
|
7552
|
+
encoderProfile: _enum(["high", "main", "baseline"]).optional(),
|
|
7553
|
+
gop: number().optional(),
|
|
7554
|
+
audio: boolean().optional()
|
|
7555
|
+
});
|
|
7556
|
+
({
|
|
7557
|
+
deviceTypes: [DeviceType.Camera],
|
|
7558
|
+
methods: {
|
|
7559
|
+
getOptions: method(
|
|
7560
|
+
object({ deviceId: number() }),
|
|
7561
|
+
StreamParamsOptionsSchema
|
|
7562
|
+
),
|
|
7563
|
+
setProfile: method(
|
|
7564
|
+
object({
|
|
7565
|
+
deviceId: number(),
|
|
7566
|
+
profile: StreamProfileSchema,
|
|
7567
|
+
patch: StreamProfilePatchSchema
|
|
7568
|
+
}),
|
|
7569
|
+
_void(),
|
|
7570
|
+
{ kind: "mutation", auth: "admin" }
|
|
7571
|
+
),
|
|
7572
|
+
/**
|
|
7573
|
+
* Build the `ConfigUISchema` (admin-ui `ConfigFormBuilder` input
|
|
7574
|
+
* shape) for this camera's stream-encoder settings — one section per
|
|
7575
|
+
* profile (main / sub / ext) with the resolution / codec / framerate
|
|
7576
|
+
* / bitrate / bitrate-mode / encoder-profile / GOP controls the
|
|
7577
|
+
* firmware actually exposes.
|
|
7578
|
+
*
|
|
7579
|
+
* Driven by `getOptions` (camera-probed availability) + `getStatus`
|
|
7580
|
+
* (current per-profile config); each field's `default` is seeded
|
|
7581
|
+
* from the live config so the form renders the camera state in one
|
|
7582
|
+
* pass. Returns `null` when the camera exposes no configurable
|
|
7583
|
+
* stream property — the renderer then shows the unsupported message.
|
|
7584
|
+
*
|
|
7585
|
+
* Output is `z.unknown().nullable()` — the same convention every
|
|
7586
|
+
* other `ConfigUISchema`-returning cap method uses (`device-ops`,
|
|
7587
|
+
* `device-manager`); `ConfigUISchema` is a TS-only type with no
|
|
7588
|
+
* companion Zod schema, and a concrete object would collapse
|
|
7589
|
+
* unrelated AppRouter branches to `unknown` during codegen.
|
|
7590
|
+
*/
|
|
7591
|
+
getConfigSchema: method(
|
|
7592
|
+
object({ deviceId: number() }),
|
|
7593
|
+
unknown().nullable()
|
|
7594
|
+
)
|
|
7595
|
+
}
|
|
7596
|
+
});
|
|
7345
7597
|
object({
|
|
7346
7598
|
on: boolean(),
|
|
7347
7599
|
/** Ms epoch of the last state change. Useful for UI "X minutes ago". */
|
|
@@ -8279,6 +8531,83 @@ const VersionOutputSchema = object({ version: string() });
|
|
|
8279
8531
|
getVersion: method(_void(), VersionOutputSchema)
|
|
8280
8532
|
}
|
|
8281
8533
|
});
|
|
8534
|
+
const MethodAccessSchema = _enum(["view", "create", "delete"]);
|
|
8535
|
+
const AllowedProviderSchema = union([literal("*"), array(string())]);
|
|
8536
|
+
const AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
|
|
8537
|
+
const CapScopeSchema = _enum(["device", "system"]);
|
|
8538
|
+
const TokenScopeSchema = discriminatedUnion("type", [
|
|
8539
|
+
object({
|
|
8540
|
+
type: literal("category"),
|
|
8541
|
+
target: CapScopeSchema,
|
|
8542
|
+
access: array(MethodAccessSchema).min(1)
|
|
8543
|
+
}),
|
|
8544
|
+
object({
|
|
8545
|
+
type: literal("capability"),
|
|
8546
|
+
target: string(),
|
|
8547
|
+
access: array(MethodAccessSchema).min(1)
|
|
8548
|
+
}),
|
|
8549
|
+
object({
|
|
8550
|
+
type: literal("addon"),
|
|
8551
|
+
target: string(),
|
|
8552
|
+
access: array(MethodAccessSchema).min(1)
|
|
8553
|
+
}),
|
|
8554
|
+
object({
|
|
8555
|
+
type: literal("device"),
|
|
8556
|
+
/**
|
|
8557
|
+
* One or more deviceIds (serialised as strings for wire-format
|
|
8558
|
+
* consistency with the rest of the union). Matcher accepts if
|
|
8559
|
+
* `input.deviceId` ∈ `targets`. Array shape avoids the row-explosion
|
|
8560
|
+
* of one scope-per-device when granting access to a set of cameras.
|
|
8561
|
+
*/
|
|
8562
|
+
targets: array(string()).min(1),
|
|
8563
|
+
access: array(MethodAccessSchema).min(1)
|
|
8564
|
+
})
|
|
8565
|
+
]);
|
|
8566
|
+
object({
|
|
8567
|
+
id: string(),
|
|
8568
|
+
username: string(),
|
|
8569
|
+
passwordHash: string(),
|
|
8570
|
+
/**
|
|
8571
|
+
* Admin bypass. When true, the middleware skips the scope-access
|
|
8572
|
+
* check entirely. There is no other axis of privilege; the legacy
|
|
8573
|
+
* role enum collapsed onto this boolean in v2.
|
|
8574
|
+
*/
|
|
8575
|
+
isAdmin: boolean().default(false),
|
|
8576
|
+
allowedProviders: AllowedProviderSchema,
|
|
8577
|
+
allowedDevices: AllowedDevicesSchema,
|
|
8578
|
+
/**
|
|
8579
|
+
* Scopes granted to this user. Admins bypass; their `scopes` is
|
|
8580
|
+
* ignored. Non-admins without scopes are locked out of every
|
|
8581
|
+
* protected call.
|
|
8582
|
+
*/
|
|
8583
|
+
scopes: array(TokenScopeSchema).default([]),
|
|
8584
|
+
createdAt: number(),
|
|
8585
|
+
updatedAt: number()
|
|
8586
|
+
});
|
|
8587
|
+
object({
|
|
8588
|
+
id: string(),
|
|
8589
|
+
label: string(),
|
|
8590
|
+
isAdmin: boolean().default(false),
|
|
8591
|
+
allowedProviders: AllowedProviderSchema,
|
|
8592
|
+
allowedDevices: AllowedDevicesSchema,
|
|
8593
|
+
tokenHash: string(),
|
|
8594
|
+
tokenPrefix: string(),
|
|
8595
|
+
createdAt: number(),
|
|
8596
|
+
lastUsedAt: number().optional()
|
|
8597
|
+
});
|
|
8598
|
+
object({
|
|
8599
|
+
id: string(),
|
|
8600
|
+
userId: string(),
|
|
8601
|
+
name: string(),
|
|
8602
|
+
tokenHash: string(),
|
|
8603
|
+
tokenPrefix: string(),
|
|
8604
|
+
scopes: array(TokenScopeSchema),
|
|
8605
|
+
// SQLite/JSON storage round-trips undefined → null. Use `nullish` so the
|
|
8606
|
+
// schema accepts both `null` (read from disk) and `undefined` (in-memory).
|
|
8607
|
+
expiresAt: number().nullish(),
|
|
8608
|
+
lastUsedAt: number().nullish(),
|
|
8609
|
+
createdAt: number()
|
|
8610
|
+
});
|
|
8282
8611
|
const SsoBridgeClaimsSchema = object({
|
|
8283
8612
|
userId: string(),
|
|
8284
8613
|
username: string(),
|
|
@@ -8294,7 +8623,18 @@ const SsoBridgeClaimsSchema = object({
|
|
|
8294
8623
|
* JWT WITHOUT verifying the signature — the hub re-verifies on every
|
|
8295
8624
|
* inbound call so trust still rests with the signing hub.
|
|
8296
8625
|
*/
|
|
8297
|
-
hubUrl: string().optional()
|
|
8626
|
+
hubUrl: string().optional(),
|
|
8627
|
+
/** Permission scopes baked into the token. Set by the OAuth
|
|
8628
|
+
* account-linking grant; absent on ordinary SSO-login tokens. */
|
|
8629
|
+
scopes: array(TokenScopeSchema).optional(),
|
|
8630
|
+
/** OAuth authorization-code binding — set only on `oauth-code` tokens. */
|
|
8631
|
+
redirectUri: string().optional(),
|
|
8632
|
+
integrationId: string().optional(),
|
|
8633
|
+
/** JWT ID — unique per issued code; consumed-set enforces single-use. */
|
|
8634
|
+
jti: string().optional(),
|
|
8635
|
+
/** OAuth session registry id — set on `oauth-access`/`oauth-refresh`
|
|
8636
|
+
* tokens so the verify path can check the session is not revoked. */
|
|
8637
|
+
sessionId: string().optional()
|
|
8298
8638
|
});
|
|
8299
8639
|
({
|
|
8300
8640
|
methods: {
|
|
@@ -8311,6 +8651,23 @@ const SsoBridgeClaimsSchema = object({
|
|
|
8311
8651
|
)
|
|
8312
8652
|
}
|
|
8313
8653
|
});
|
|
8654
|
+
const OauthIntegrationDescriptorSchema = object({
|
|
8655
|
+
/** Stable id used as the `integration=` query param, e.g. 'export-alexa'. */
|
|
8656
|
+
integrationId: string(),
|
|
8657
|
+
/** Human label rendered on the consent page. */
|
|
8658
|
+
displayName: string(),
|
|
8659
|
+
/** Scopes baked into every token issued for this integration. */
|
|
8660
|
+
requestedScopes: array(TokenScopeSchema),
|
|
8661
|
+
/** Allowed redirect_uri prefixes. /api/oauth2/authorize rejects any
|
|
8662
|
+
* redirect_uri that does not start with one of these. Required —
|
|
8663
|
+
* an empty list means the integration can never complete linking. */
|
|
8664
|
+
allowedRedirectPrefixes: array(string()).min(1)
|
|
8665
|
+
});
|
|
8666
|
+
({
|
|
8667
|
+
methods: {
|
|
8668
|
+
getDescriptor: method(_void(), OauthIntegrationDescriptorSchema)
|
|
8669
|
+
}
|
|
8670
|
+
});
|
|
8314
8671
|
const PasskeySummarySchema = object({
|
|
8315
8672
|
credentialId: string(),
|
|
8316
8673
|
label: string(),
|
|
@@ -8591,21 +8948,30 @@ const AddonPageDeclarationSchema = object({
|
|
|
8591
8948
|
});
|
|
8592
8949
|
const WidgetHostEnum = _enum(["device-tab", "dashboard", "integration-detail"]);
|
|
8593
8950
|
const WidgetSizeEnum = _enum(["xs", "sm", "md", "lg", "xl"]);
|
|
8951
|
+
const WidgetRemoteSchema = object({
|
|
8952
|
+
remoteName: string(),
|
|
8953
|
+
exposedModule: string(),
|
|
8954
|
+
componentKey: string().optional()
|
|
8955
|
+
});
|
|
8594
8956
|
const WidgetMetadataSchema = object({
|
|
8595
|
-
|
|
8596
|
-
|
|
8957
|
+
// ── UiContribution core (kind:'remote') ──────────────────────────
|
|
8958
|
+
/** Primary host tab — `'dashboard'`, `'device-tab'`, or a device-detail tab id. */
|
|
8959
|
+
tab: string(),
|
|
8960
|
+
/** Optional sub-tab within `tab`. */
|
|
8961
|
+
subTab: string().optional(),
|
|
8597
8962
|
/** Operator-facing label. */
|
|
8598
8963
|
label: string(),
|
|
8964
|
+
/** Ordering within `(tab, subTab)`, ascending. */
|
|
8965
|
+
order: number().optional(),
|
|
8966
|
+
/** Always `'remote'` — a widget is a Module Federation remote. */
|
|
8967
|
+
kind: literal("remote"),
|
|
8968
|
+
/** MF remote descriptor. */
|
|
8969
|
+
remote: WidgetRemoteSchema,
|
|
8970
|
+
// ── Widget-only metadata ─────────────────────────────────────────
|
|
8971
|
+
/** Stable id within the addon — kebab-case. Equals `remote.componentKey`. */
|
|
8972
|
+
stableId: string(),
|
|
8599
8973
|
description: string().optional(),
|
|
8600
8974
|
icon: string().optional(),
|
|
8601
|
-
/**
|
|
8602
|
-
* Module Federation remote name — must match the `name` field on the
|
|
8603
|
-
* widget addon's `federation()` plugin config. Used by the host's
|
|
8604
|
-
* `<WidgetRegistryProvider>` to call `loadRemote('<remoteName>/widgets')`.
|
|
8605
|
-
* Conventionally `addon_<addonid>_widgets` (snake_case; MF names
|
|
8606
|
-
* cannot contain hyphens).
|
|
8607
|
-
*/
|
|
8608
|
-
remoteName: string(),
|
|
8609
8975
|
/**
|
|
8610
8976
|
* Bundle filename inside the addon's `dist/` dir served at
|
|
8611
8977
|
* `/api/addon-widgets/<addonId>/<bundle>`. With Module Federation
|
|
@@ -8614,9 +8980,9 @@ const WidgetMetadataSchema = object({
|
|
|
8614
8980
|
* cache-buster URL without a separate filesystem stat.
|
|
8615
8981
|
*/
|
|
8616
8982
|
bundle: string(),
|
|
8617
|
-
/**
|
|
8983
|
+
/** Every host the widget supports. The picker filters on this set. */
|
|
8618
8984
|
hosts: array(WidgetHostEnum).readonly(),
|
|
8619
|
-
/** Required props the host must supply. Validated at
|
|
8985
|
+
/** Required props the host must supply. Validated at `<WidgetSlot>` mount. */
|
|
8620
8986
|
requires: object({
|
|
8621
8987
|
deviceContext: boolean().default(false),
|
|
8622
8988
|
integrationContext: boolean().default(false)
|
|
@@ -8687,6 +9053,16 @@ const InvokeReplyEnvelopeSchema = object({
|
|
|
8687
9053
|
invoke: method(InvokeRequestSchema, InvokeReplyEnvelopeSchema, { kind: "mutation" })
|
|
8688
9054
|
}
|
|
8689
9055
|
});
|
|
9056
|
+
const ShmRingStatsSchema = object({
|
|
9057
|
+
sessionId: string(),
|
|
9058
|
+
slotCount: number().int(),
|
|
9059
|
+
slotByteLength: number().int(),
|
|
9060
|
+
segmentBytes: number().int(),
|
|
9061
|
+
budgetMb: number().int(),
|
|
9062
|
+
framesWritten: number().int(),
|
|
9063
|
+
getFrameHits: number().int(),
|
|
9064
|
+
getFrameMisses: number().int()
|
|
9065
|
+
});
|
|
8690
9066
|
({
|
|
8691
9067
|
methods: {
|
|
8692
9068
|
// ── Discovery ─────────────────────────────────────────────────
|
|
@@ -8714,10 +9090,27 @@ const InvokeReplyEnvelopeSchema = object({
|
|
|
8714
9090
|
url: string()
|
|
8715
9091
|
}), _void()),
|
|
8716
9092
|
// ── Output — polling-based frame retrieval ────────────────────
|
|
9093
|
+
// `pullFrames` drains the pixel `DecodedFrame[]` of a `frameSink:
|
|
9094
|
+
// 'callback'` session. `pullHandles` (Phase 5 / D9) drains the
|
|
9095
|
+
// zero-pixel `FrameHandle[]` of a `frameSink: 'shm'` session — the
|
|
9096
|
+
// broker hands each handle to a `FrameRingReader` that opens the
|
|
9097
|
+
// named segment and reads the pixels back zero-copy. A session is
|
|
9098
|
+
// one mode or the other; the unmatched method returns an empty
|
|
9099
|
+
// array.
|
|
8717
9100
|
pullFrames: method(object({
|
|
8718
9101
|
sessionId: string(),
|
|
8719
9102
|
maxCount: number().default(1)
|
|
8720
9103
|
}), array(DecodedFrameSchema)),
|
|
9104
|
+
pullHandles: method(object({
|
|
9105
|
+
sessionId: string(),
|
|
9106
|
+
maxCount: number().default(1)
|
|
9107
|
+
}), array(FrameHandleSchema)),
|
|
9108
|
+
// ── Frame fetch (Phase 5 / D9 downstream access) ──────────────
|
|
9109
|
+
// Read the pixels a FrameHandle refers to from this node's shm ring.
|
|
9110
|
+
// Returns null when the slot was already recycled (latest-wins).
|
|
9111
|
+
getFrame: method(object({ handle: FrameHandleSchema }), DecodedFrameSchema.nullable()),
|
|
9112
|
+
// shm ring usage stats for a session.
|
|
9113
|
+
getShmStats: method(object({ sessionId: string() }), ShmRingStatsSchema.nullable()),
|
|
8721
9114
|
// ── Control ───────────────────────────────────────────────────
|
|
8722
9115
|
updateConfig: method(object({
|
|
8723
9116
|
sessionId: string(),
|
|
@@ -9885,8 +10278,8 @@ const DevicePersistConfigPayloadSchema = object({
|
|
|
9885
10278
|
/**
|
|
9886
10279
|
* Return the addon ids that declared a wrapper provider for `capName`.
|
|
9887
10280
|
* Backs the device-bindings UI's wrapper-picker dropdown. Entries are
|
|
9888
|
-
* sourced from `CapabilityRegistry.wrapperProviders`, populated
|
|
9889
|
-
* `
|
|
10281
|
+
* sourced from `CapabilityRegistry.wrapperProviders`, populated when
|
|
10282
|
+
* the cap definition declares `kind: 'wrapper'`.
|
|
9890
10283
|
*/
|
|
9891
10284
|
listWrappersForCap: method(
|
|
9892
10285
|
object({ capName: string() }),
|
|
@@ -10983,6 +11376,18 @@ const PtzMoveCommandSchema = object({
|
|
|
10983
11376
|
zoom: number().optional(),
|
|
10984
11377
|
speed: number().optional()
|
|
10985
11378
|
});
|
|
11379
|
+
PtzPositionSchema.extend({ autofocus: boolean() });
|
|
11380
|
+
const PtzOptionsSchema = object({
|
|
11381
|
+
hasPan: boolean(),
|
|
11382
|
+
hasTilt: boolean(),
|
|
11383
|
+
hasZoom: boolean(),
|
|
11384
|
+
supportsPresets: boolean(),
|
|
11385
|
+
/** Max number of named presets the camera supports, when known. */
|
|
11386
|
+
maxPresets: number().optional(),
|
|
11387
|
+
/** Whether the camera exposes a controllable autofocus toggle
|
|
11388
|
+
* (boolean `hasX` per the getOptions availability convention). */
|
|
11389
|
+
hasAutofocus: boolean()
|
|
11390
|
+
});
|
|
10986
11391
|
({
|
|
10987
11392
|
deviceTypes: [DeviceType.Camera],
|
|
10988
11393
|
methods: {
|
|
@@ -11010,6 +11415,20 @@ const PtzMoveCommandSchema = object({
|
|
|
11010
11415
|
_void(),
|
|
11011
11416
|
{ kind: "mutation" }
|
|
11012
11417
|
),
|
|
11418
|
+
savePreset: method(
|
|
11419
|
+
object({ deviceId: number(), presetId: string(), name: string() }),
|
|
11420
|
+
_void(),
|
|
11421
|
+
{ kind: "mutation", auth: "admin" }
|
|
11422
|
+
),
|
|
11423
|
+
deletePreset: method(
|
|
11424
|
+
object({ deviceId: number(), presetId: string() }),
|
|
11425
|
+
_void(),
|
|
11426
|
+
{ kind: "mutation", auth: "admin" }
|
|
11427
|
+
),
|
|
11428
|
+
getOptions: method(
|
|
11429
|
+
object({ deviceId: number() }),
|
|
11430
|
+
PtzOptionsSchema
|
|
11431
|
+
),
|
|
11013
11432
|
goHome: method(
|
|
11014
11433
|
object({ deviceId: number() }),
|
|
11015
11434
|
_void(),
|
|
@@ -11024,6 +11443,13 @@ const PtzMoveCommandSchema = object({
|
|
|
11024
11443
|
getPosition: method(
|
|
11025
11444
|
object({ deviceId: number() }),
|
|
11026
11445
|
PtzPositionSchema
|
|
11446
|
+
),
|
|
11447
|
+
/** Toggle the camera's autofocus. Only meaningful when
|
|
11448
|
+
* `getOptions().hasAutofocus` is true. */
|
|
11449
|
+
setAutofocus: method(
|
|
11450
|
+
object({ deviceId: number(), enabled: boolean() }),
|
|
11451
|
+
_void(),
|
|
11452
|
+
{ kind: "mutation" }
|
|
11027
11453
|
)
|
|
11028
11454
|
}
|
|
11029
11455
|
});
|
|
@@ -11959,83 +12385,6 @@ const MeshStatusSchema = object({
|
|
|
11959
12385
|
// tabs driven by this cap.
|
|
11960
12386
|
}
|
|
11961
12387
|
});
|
|
11962
|
-
const MethodAccessSchema = _enum(["view", "create", "delete"]);
|
|
11963
|
-
const AllowedProviderSchema = union([literal("*"), array(string())]);
|
|
11964
|
-
const AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
|
|
11965
|
-
const CapScopeSchema = _enum(["device", "system"]);
|
|
11966
|
-
const TokenScopeSchema = discriminatedUnion("type", [
|
|
11967
|
-
object({
|
|
11968
|
-
type: literal("category"),
|
|
11969
|
-
target: CapScopeSchema,
|
|
11970
|
-
access: array(MethodAccessSchema).min(1)
|
|
11971
|
-
}),
|
|
11972
|
-
object({
|
|
11973
|
-
type: literal("capability"),
|
|
11974
|
-
target: string(),
|
|
11975
|
-
access: array(MethodAccessSchema).min(1)
|
|
11976
|
-
}),
|
|
11977
|
-
object({
|
|
11978
|
-
type: literal("addon"),
|
|
11979
|
-
target: string(),
|
|
11980
|
-
access: array(MethodAccessSchema).min(1)
|
|
11981
|
-
}),
|
|
11982
|
-
object({
|
|
11983
|
-
type: literal("device"),
|
|
11984
|
-
/**
|
|
11985
|
-
* One or more deviceIds (serialised as strings for wire-format
|
|
11986
|
-
* consistency with the rest of the union). Matcher accepts if
|
|
11987
|
-
* `input.deviceId` ∈ `targets`. Array shape avoids the row-explosion
|
|
11988
|
-
* of one scope-per-device when granting access to a set of cameras.
|
|
11989
|
-
*/
|
|
11990
|
-
targets: array(string()).min(1),
|
|
11991
|
-
access: array(MethodAccessSchema).min(1)
|
|
11992
|
-
})
|
|
11993
|
-
]);
|
|
11994
|
-
object({
|
|
11995
|
-
id: string(),
|
|
11996
|
-
username: string(),
|
|
11997
|
-
passwordHash: string(),
|
|
11998
|
-
/**
|
|
11999
|
-
* Admin bypass. When true, the middleware skips the scope-access
|
|
12000
|
-
* check entirely. There is no other axis of privilege; the legacy
|
|
12001
|
-
* role enum collapsed onto this boolean in v2.
|
|
12002
|
-
*/
|
|
12003
|
-
isAdmin: boolean().default(false),
|
|
12004
|
-
allowedProviders: AllowedProviderSchema,
|
|
12005
|
-
allowedDevices: AllowedDevicesSchema,
|
|
12006
|
-
/**
|
|
12007
|
-
* Scopes granted to this user. Admins bypass; their `scopes` is
|
|
12008
|
-
* ignored. Non-admins without scopes are locked out of every
|
|
12009
|
-
* protected call.
|
|
12010
|
-
*/
|
|
12011
|
-
scopes: array(TokenScopeSchema).default([]),
|
|
12012
|
-
createdAt: number(),
|
|
12013
|
-
updatedAt: number()
|
|
12014
|
-
});
|
|
12015
|
-
object({
|
|
12016
|
-
id: string(),
|
|
12017
|
-
label: string(),
|
|
12018
|
-
isAdmin: boolean().default(false),
|
|
12019
|
-
allowedProviders: AllowedProviderSchema,
|
|
12020
|
-
allowedDevices: AllowedDevicesSchema,
|
|
12021
|
-
tokenHash: string(),
|
|
12022
|
-
tokenPrefix: string(),
|
|
12023
|
-
createdAt: number(),
|
|
12024
|
-
lastUsedAt: number().optional()
|
|
12025
|
-
});
|
|
12026
|
-
object({
|
|
12027
|
-
id: string(),
|
|
12028
|
-
userId: string(),
|
|
12029
|
-
name: string(),
|
|
12030
|
-
tokenHash: string(),
|
|
12031
|
-
tokenPrefix: string(),
|
|
12032
|
-
scopes: array(TokenScopeSchema),
|
|
12033
|
-
// SQLite/JSON storage round-trips undefined → null. Use `nullish` so the
|
|
12034
|
-
// schema accepts both `null` (read from disk) and `undefined` (in-memory).
|
|
12035
|
-
expiresAt: number().nullish(),
|
|
12036
|
-
lastUsedAt: number().nullish(),
|
|
12037
|
-
createdAt: number()
|
|
12038
|
-
});
|
|
12039
12388
|
const UserSummarySchema = object({
|
|
12040
12389
|
id: string(),
|
|
12041
12390
|
username: string(),
|
|
@@ -12108,6 +12457,16 @@ const CreateScopedTokenResultSchema = object({
|
|
|
12108
12457
|
token: string(),
|
|
12109
12458
|
record: ScopedTokenSummarySchema
|
|
12110
12459
|
});
|
|
12460
|
+
const OauthSessionSummarySchema = object({
|
|
12461
|
+
id: string(),
|
|
12462
|
+
userId: string(),
|
|
12463
|
+
username: string(),
|
|
12464
|
+
integrationId: string(),
|
|
12465
|
+
scopes: array(TokenScopeSchema),
|
|
12466
|
+
createdAt: number(),
|
|
12467
|
+
lastUsedAt: number(),
|
|
12468
|
+
revokedAt: number().nullable()
|
|
12469
|
+
});
|
|
12111
12470
|
const TotpSetupResultSchema = object({
|
|
12112
12471
|
secret: string(),
|
|
12113
12472
|
otpauthUrl: string()
|
|
@@ -12183,6 +12542,66 @@ const TotpStatusSchema = object({
|
|
|
12183
12542
|
object({ userId: string(), code: string() }),
|
|
12184
12543
|
object({ valid: boolean() }),
|
|
12185
12544
|
{ kind: "mutation", access: "view" }
|
|
12545
|
+
),
|
|
12546
|
+
// ── OAuth account-linking grant ────────────────────────────────
|
|
12547
|
+
//
|
|
12548
|
+
// Core's /oauth2/* endpoints delegate here. Tokens are sso-bridge
|
|
12549
|
+
// JWTs (kinds oauth-code / oauth-access / oauth-refresh) and ALWAYS
|
|
12550
|
+
// carry isAdmin:false — the operator login proves hub control; the
|
|
12551
|
+
// issued token is minimal (device scope only).
|
|
12552
|
+
oauthIssueCode: method(
|
|
12553
|
+
object({
|
|
12554
|
+
integrationId: string(),
|
|
12555
|
+
userId: string(),
|
|
12556
|
+
username: string(),
|
|
12557
|
+
scopes: array(TokenScopeSchema),
|
|
12558
|
+
redirectUri: string(),
|
|
12559
|
+
hubUrl: string()
|
|
12560
|
+
}),
|
|
12561
|
+
object({ code: string() }),
|
|
12562
|
+
{ kind: "mutation", access: "create" }
|
|
12563
|
+
),
|
|
12564
|
+
oauthExchangeCode: method(
|
|
12565
|
+
object({ code: string(), redirectUri: string() }),
|
|
12566
|
+
object({
|
|
12567
|
+
accessToken: string(),
|
|
12568
|
+
refreshToken: string(),
|
|
12569
|
+
expiresIn: number()
|
|
12570
|
+
}).nullable(),
|
|
12571
|
+
{ kind: "mutation", access: "view" }
|
|
12572
|
+
),
|
|
12573
|
+
oauthRefresh: method(
|
|
12574
|
+
object({ refreshToken: string() }),
|
|
12575
|
+
object({
|
|
12576
|
+
accessToken: string(),
|
|
12577
|
+
refreshToken: string(),
|
|
12578
|
+
expiresIn: number()
|
|
12579
|
+
}).nullable(),
|
|
12580
|
+
{ kind: "mutation", access: "view" }
|
|
12581
|
+
),
|
|
12582
|
+
oauthVerifyAccessToken: method(
|
|
12583
|
+
object({ token: string() }),
|
|
12584
|
+
object({
|
|
12585
|
+
userId: string(),
|
|
12586
|
+
username: string(),
|
|
12587
|
+
scopes: array(TokenScopeSchema)
|
|
12588
|
+
}).nullable(),
|
|
12589
|
+
{ access: "view" }
|
|
12590
|
+
),
|
|
12591
|
+
// ── OAuth linked-session management (Phase D) ──────────────────
|
|
12592
|
+
//
|
|
12593
|
+
// The admin UI lists active account-linking sessions and revokes
|
|
12594
|
+
// them; revocation makes the linked integration's tokens fail
|
|
12595
|
+
// verification immediately.
|
|
12596
|
+
listOauthSessions: method(
|
|
12597
|
+
_void(),
|
|
12598
|
+
array(OauthSessionSummarySchema),
|
|
12599
|
+
{ auth: "admin" }
|
|
12600
|
+
),
|
|
12601
|
+
revokeOauthSession: method(
|
|
12602
|
+
object({ id: string() }),
|
|
12603
|
+
object({ success: boolean() }),
|
|
12604
|
+
{ kind: "mutation", auth: "admin", access: "delete" }
|
|
12186
12605
|
)
|
|
12187
12606
|
}
|
|
12188
12607
|
});
|
|
@@ -12399,6 +12818,19 @@ const RenameNodeResultSchema = object({
|
|
|
12399
12818
|
record(string(), ClusterAddonStatusEntrySchema),
|
|
12400
12819
|
{ auth: "admin" }
|
|
12401
12820
|
),
|
|
12821
|
+
getCapUsageGraph: method(
|
|
12822
|
+
object({
|
|
12823
|
+
windowSeconds: number().int().positive().max(300).default(60)
|
|
12824
|
+
}),
|
|
12825
|
+
array(object({
|
|
12826
|
+
callerAddonId: string(),
|
|
12827
|
+
providerAddonId: string(),
|
|
12828
|
+
capName: string(),
|
|
12829
|
+
callsPerMin: number(),
|
|
12830
|
+
lastCallAtMs: number()
|
|
12831
|
+
})).readonly(),
|
|
12832
|
+
{ auth: "admin" }
|
|
12833
|
+
),
|
|
12402
12834
|
/**
|
|
12403
12835
|
* Direct per-node addon listing — calls `$agent.status` on the target
|
|
12404
12836
|
* node (or returns the hub registry for `nodeId === 'hub'`) and surfaces
|