@camstack/types 0.1.41 → 0.1.42
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/capabilities/filesystem-browse.cap.d.ts +39 -0
- package/dist/capabilities/filesystem-browse.cap.d.ts.map +1 -0
- package/dist/capabilities/index.d.ts +5 -1
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/recording.cap.d.ts +129 -0
- package/dist/capabilities/recording.cap.d.ts.map +1 -1
- package/dist/capabilities/storage-provider.cap.d.ts +15 -0
- package/dist/capabilities/storage-provider.cap.d.ts.map +1 -1
- package/dist/capabilities/storage.cap.d.ts +6 -0
- package/dist/capabilities/storage.cap.d.ts.map +1 -1
- package/dist/capabilities/stream-broker.cap.d.ts +14 -0
- package/dist/capabilities/stream-broker.cap.d.ts.map +1 -1
- package/dist/capabilities/videoclips.cap.d.ts +77 -0
- package/dist/capabilities/videoclips.cap.d.ts.map +1 -0
- package/dist/generated/addon-api.d.ts +428 -2
- package/dist/generated/addon-api.d.ts.map +1 -1
- package/dist/generated/capability-router-map.d.ts +8 -2
- package/dist/generated/capability-router-map.d.ts.map +1 -1
- package/dist/generated/device-proxy.d.ts +2 -0
- package/dist/generated/device-proxy.d.ts.map +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts.map +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts.map +1 -1
- package/dist/{index-Bpj3ScIH.mjs → index-BxWo3b49.mjs} +624 -465
- package/dist/index-BxWo3b49.mjs.map +1 -0
- package/dist/{index-BSA_TBea.js → index-CGMPfVaT.js} +161 -2
- package/dist/index-CGMPfVaT.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +485 -424
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/recording-config-migrate.d.ts +13 -0
- package/dist/interfaces/recording-config-migrate.d.ts.map +1 -0
- package/dist/interfaces/recording-config.d.ts +119 -1
- package/dist/interfaces/recording-config.d.ts.map +1 -1
- package/dist/interfaces/storage-location.d.ts +1 -0
- package/dist/interfaces/storage-location.d.ts.map +1 -1
- package/dist/node.js +1 -1
- package/dist/node.mjs +1 -1
- package/package.json +1 -1
- package/dist/index-BSA_TBea.js.map +0 -1
- package/dist/index-Bpj3ScIH.mjs.map +0 -1
|
@@ -395,6 +395,22 @@ const RecordingScheduleSchema = zod.z.discriminatedUnion("kind", [
|
|
|
395
395
|
})
|
|
396
396
|
]);
|
|
397
397
|
const RecordingModeSchema = zod.z.enum(["continuous", "onMotion", "onAudioThreshold"]);
|
|
398
|
+
const RecordingStorageModeSchema = zod.z.enum(["off", "events", "continuous"]);
|
|
399
|
+
const RecordingTriggersSchema = zod.z.object({
|
|
400
|
+
motion: zod.z.boolean().optional(),
|
|
401
|
+
audioThresholdDbfs: zod.z.number().optional()
|
|
402
|
+
});
|
|
403
|
+
const RecordingBandModeSchema = zod.z.enum(["continuous", "events"]);
|
|
404
|
+
const RecordingBandTriggersSchema = RecordingTriggersSchema;
|
|
405
|
+
const RecordingBandSchema = zod.z.object({
|
|
406
|
+
days: zod.z.array(RecordingWeekdaySchema),
|
|
407
|
+
start: zod.z.string().regex(HHMM),
|
|
408
|
+
end: zod.z.string().regex(HHMM),
|
|
409
|
+
mode: RecordingBandModeSchema,
|
|
410
|
+
triggers: RecordingBandTriggersSchema.optional(),
|
|
411
|
+
preBufferSec: zod.z.number().min(0).optional(),
|
|
412
|
+
postBufferSec: zod.z.number().min(0).optional()
|
|
413
|
+
});
|
|
398
414
|
const RecordingRuleSchema = zod.z.object({
|
|
399
415
|
schedule: RecordingScheduleSchema,
|
|
400
416
|
mode: RecordingModeSchema,
|
|
@@ -413,9 +429,33 @@ const RecordingRetentionSchema = zod.z.object({
|
|
|
413
429
|
});
|
|
414
430
|
const RecordingConfigSchema = zod.z.object({
|
|
415
431
|
enabled: zod.z.boolean(),
|
|
432
|
+
/** Authoritative storage mode. Absent on legacy targets → derived once via
|
|
433
|
+
* `migrateRulesToMode`, then persisted. */
|
|
434
|
+
mode: RecordingStorageModeSchema.optional(),
|
|
416
435
|
profiles: zod.z.array(CamProfileSchema).optional(),
|
|
417
436
|
segmentSeconds: zod.z.number().int().positive().optional(),
|
|
437
|
+
/** Shared recording time-bands for `events` & `continuous` — record only when
|
|
438
|
+
* the wall-clock falls inside one of these windows. Omit or empty = always.
|
|
439
|
+
* `continuous` compiles to one rule per band; `events` to band × trigger. */
|
|
440
|
+
schedules: zod.z.array(RecordingScheduleSchema).optional(),
|
|
441
|
+
/** Legacy single-band predecessor of `schedules`. Read-compat only — it is
|
|
442
|
+
* normalized into `schedules` on read and never written going forward. (Not
|
|
443
|
+
* tagged `@deprecated`: the normalization paths must read it cast-free.) */
|
|
444
|
+
schedule: RecordingScheduleSchema.optional(),
|
|
445
|
+
/** `events`-mode only — which detectors trigger a recording. */
|
|
446
|
+
triggers: RecordingTriggersSchema.optional(),
|
|
447
|
+
/** `events`-mode only — seconds retained before / after a trigger. */
|
|
448
|
+
preBufferSec: zod.z.number().min(0).optional(),
|
|
449
|
+
postBufferSec: zod.z.number().min(0).optional(),
|
|
450
|
+
/** DEPRECATED authoring input; retained for migration/transition. */
|
|
418
451
|
rules: zod.z.array(RecordingRuleSchema).optional(),
|
|
452
|
+
/**
|
|
453
|
+
* AUTHORITATIVE mode-per-band recording model (recorder). When present it
|
|
454
|
+
* is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
|
|
455
|
+
* `triggers`/`rules` fields above are kept for READ-COMPAT only and are
|
|
456
|
+
* derived into bands once via `migrateConfigToBands`.
|
|
457
|
+
*/
|
|
458
|
+
bands: zod.z.array(RecordingBandSchema).optional(),
|
|
419
459
|
retention: RecordingRetentionSchema.optional()
|
|
420
460
|
});
|
|
421
461
|
const StorageLocationTypeSchema = zod.z.string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
@@ -428,6 +468,14 @@ const StorageLocationSchema = zod.z.object({
|
|
|
428
468
|
displayName: zod.z.string().min(1),
|
|
429
469
|
providerId: zod.z.string().min(1),
|
|
430
470
|
config: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
471
|
+
/**
|
|
472
|
+
* Cluster node this location physically lives on. REQUIRED for node-local
|
|
473
|
+
* providers (filesystem — the path exists on one node's disk), null/absent
|
|
474
|
+
* for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
|
|
475
|
+
* `'hub'` is the hub node. Validated against the provider's `nodeLocal`
|
|
476
|
+
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
477
|
+
*/
|
|
478
|
+
nodeId: zod.z.string().optional(),
|
|
431
479
|
isDefault: zod.z.boolean().default(false),
|
|
432
480
|
isSystem: zod.z.boolean().default(false),
|
|
433
481
|
createdAt: zod.z.number(),
|
|
@@ -1961,6 +2009,19 @@ const streamBrokerCapability = {
|
|
|
1961
2009
|
zod.z.object({ brokerId: zod.z.string() }),
|
|
1962
2010
|
BrokerStatsSchema
|
|
1963
2011
|
),
|
|
2012
|
+
/**
|
|
2013
|
+
* Force a one-shot probe of a single source stream: transiently dial the
|
|
2014
|
+
* broker (a `warmup` consumer), capture a fresh `BrokerStats` snapshot for
|
|
2015
|
+
* the per-stream "Probed" settings field, then release. Wakes a suspended
|
|
2016
|
+
* (incl. battery) stream for a few seconds. `summary` is the rendered
|
|
2017
|
+
* probed-values string; `probed` is false if the stream never reached
|
|
2018
|
+
* `streaming` within the timeout.
|
|
2019
|
+
*/
|
|
2020
|
+
probeStream: method(
|
|
2021
|
+
zod.z.object({ brokerId: zod.z.string() }),
|
|
2022
|
+
zod.z.object({ probed: zod.z.boolean(), summary: zod.z.string() }),
|
|
2023
|
+
{ kind: "mutation", auth: "admin" }
|
|
2024
|
+
),
|
|
1964
2025
|
listClients: method(
|
|
1965
2026
|
zod.z.object({ brokerId: zod.z.string() }),
|
|
1966
2027
|
BrokerClientsSchema
|
|
@@ -6057,6 +6118,7 @@ const ProviderListEntrySchema = zod.z.discriminatedUnion("shouldSaveDiskSpace",
|
|
|
6057
6118
|
providerId: zod.z.string().min(1),
|
|
6058
6119
|
displayName: zod.z.string().min(1),
|
|
6059
6120
|
configSchema: zod.z.unknown(),
|
|
6121
|
+
nodeLocal: zod.z.boolean(),
|
|
6060
6122
|
shouldSaveDiskSpace: zod.z.literal(true),
|
|
6061
6123
|
minFreePercent: zod.z.number().min(0).max(100)
|
|
6062
6124
|
}),
|
|
@@ -6064,6 +6126,7 @@ const ProviderListEntrySchema = zod.z.discriminatedUnion("shouldSaveDiskSpace",
|
|
|
6064
6126
|
providerId: zod.z.string().min(1),
|
|
6065
6127
|
displayName: zod.z.string().min(1),
|
|
6066
6128
|
configSchema: zod.z.unknown(),
|
|
6129
|
+
nodeLocal: zod.z.boolean(),
|
|
6067
6130
|
shouldSaveDiskSpace: zod.z.literal(false),
|
|
6068
6131
|
minFreePercent: zod.z.literal(null)
|
|
6069
6132
|
})
|
|
@@ -6200,6 +6263,10 @@ const ProviderInfoSchema = zod.z.discriminatedUnion("shouldSaveDiskSpace", [
|
|
|
6200
6263
|
providerId: zod.z.string().min(1),
|
|
6201
6264
|
displayName: zod.z.string().min(1),
|
|
6202
6265
|
configSchema: zod.z.unknown(),
|
|
6266
|
+
/** True = provider serves a node-local volume (filesystem): its locations
|
|
6267
|
+
* bind to a single node and need a node + path. False = reachable from any
|
|
6268
|
+
* node (remote/object store). */
|
|
6269
|
+
nodeLocal: zod.z.boolean(),
|
|
6203
6270
|
// Provider manages a finite volume → declares a default free-space threshold.
|
|
6204
6271
|
shouldSaveDiskSpace: zod.z.literal(true),
|
|
6205
6272
|
minFreePercent: zod.z.number().min(0).max(100)
|
|
@@ -6208,6 +6275,10 @@ const ProviderInfoSchema = zod.z.discriminatedUnion("shouldSaveDiskSpace", [
|
|
|
6208
6275
|
providerId: zod.z.string().min(1),
|
|
6209
6276
|
displayName: zod.z.string().min(1),
|
|
6210
6277
|
configSchema: zod.z.unknown(),
|
|
6278
|
+
/** True = provider serves a node-local volume (filesystem): its locations
|
|
6279
|
+
* bind to a single node and need a node + path. False = reachable from any
|
|
6280
|
+
* node (remote/object store). */
|
|
6281
|
+
nodeLocal: zod.z.boolean(),
|
|
6211
6282
|
// No local free-space concept (remote/object store) → no threshold.
|
|
6212
6283
|
shouldSaveDiskSpace: zod.z.literal(false),
|
|
6213
6284
|
minFreePercent: zod.z.literal(null)
|
|
@@ -6335,6 +6406,43 @@ const storageEvictableCapability = {
|
|
|
6335
6406
|
)
|
|
6336
6407
|
}
|
|
6337
6408
|
};
|
|
6409
|
+
const DirEntrySchema = zod.z.object({
|
|
6410
|
+
name: zod.z.string(),
|
|
6411
|
+
path: zod.z.string()
|
|
6412
|
+
});
|
|
6413
|
+
const BrowseResultSchema = zod.z.object({
|
|
6414
|
+
path: zod.z.string(),
|
|
6415
|
+
entries: zod.z.array(DirEntrySchema).readonly(),
|
|
6416
|
+
freeBytes: zod.z.number(),
|
|
6417
|
+
totalBytes: zod.z.number()
|
|
6418
|
+
});
|
|
6419
|
+
const filesystemBrowseCapability = {
|
|
6420
|
+
name: "filesystem-browse",
|
|
6421
|
+
scope: "system",
|
|
6422
|
+
// `singleton` + node-routing: every node hosts its own provider; the hub
|
|
6423
|
+
// call carries `{nodeId}` and the cap-router routes to that node via
|
|
6424
|
+
// `createRemoteProxy` (same pattern as `platform-probe`). The codegen's
|
|
6425
|
+
// ALL_CAPABILITY_DEFINITIONS map only matches singleton/collection, and
|
|
6426
|
+
// `per-node` is not an actually-wired runtime mode — singleton is correct.
|
|
6427
|
+
mode: "singleton",
|
|
6428
|
+
internal: true,
|
|
6429
|
+
methods: {
|
|
6430
|
+
/** The allowed roots browsing is sandboxed to on this node. */
|
|
6431
|
+
listAllowedRoots: method(zod.z.void(), zod.z.array(zod.z.string()).readonly(), { auth: "admin" }),
|
|
6432
|
+
/** Immediate subdirectories of `path` (must be within an allowed root) + free/total bytes. */
|
|
6433
|
+
browse: method(
|
|
6434
|
+
zod.z.object({ path: zod.z.string() }),
|
|
6435
|
+
BrowseResultSchema,
|
|
6436
|
+
{ auth: "admin" }
|
|
6437
|
+
),
|
|
6438
|
+
/** Create a subdirectory (within an allowed root). Returns its absolute path. */
|
|
6439
|
+
createDir: method(
|
|
6440
|
+
zod.z.object({ path: zod.z.string() }),
|
|
6441
|
+
zod.z.object({ path: zod.z.string() }),
|
|
6442
|
+
{ kind: "mutation", auth: "admin" }
|
|
6443
|
+
)
|
|
6444
|
+
}
|
|
6445
|
+
};
|
|
6338
6446
|
const BackupSubDestinationInfoSchema = zod.z.object({
|
|
6339
6447
|
/**
|
|
6340
6448
|
* Sub-id within this addon. Convention `default` for single-
|
|
@@ -8040,6 +8148,48 @@ const webrtcSessionCapability = {
|
|
|
8040
8148
|
)
|
|
8041
8149
|
}
|
|
8042
8150
|
};
|
|
8151
|
+
const ClipSchema = zod.z.object({
|
|
8152
|
+
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
8153
|
+
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
8154
|
+
id: zod.z.string(),
|
|
8155
|
+
/** Which provider produced it (`analytics` | `native:<vendor>` | …). */
|
|
8156
|
+
source: zod.z.string(),
|
|
8157
|
+
kind: zod.z.enum(["motion", "object", "audio", "native"]),
|
|
8158
|
+
timeRange: zod.z.object({ startMs: zod.z.number(), endMs: zod.z.number() }),
|
|
8159
|
+
/** Thumbnail URL (lazy; e.g. analytics `getEventMedia`). Never inlined. */
|
|
8160
|
+
thumbnail: zod.z.string().optional()
|
|
8161
|
+
});
|
|
8162
|
+
const ClipPlaybackSchema = zod.z.object({
|
|
8163
|
+
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
8164
|
+
playbackUrl: zod.z.string(),
|
|
8165
|
+
/** Optional LAN/remote alternates for the same clip. */
|
|
8166
|
+
playbackEndpoints: zod.z.array(zod.z.string()).optional(),
|
|
8167
|
+
token: zod.z.string().optional()
|
|
8168
|
+
});
|
|
8169
|
+
const videoclipsCapability = {
|
|
8170
|
+
name: "videoclips",
|
|
8171
|
+
scope: "device",
|
|
8172
|
+
mode: "singleton",
|
|
8173
|
+
kind: "wrapper",
|
|
8174
|
+
defaultActive: true,
|
|
8175
|
+
methods: {
|
|
8176
|
+
listClips: method(
|
|
8177
|
+
zod.z.object({
|
|
8178
|
+
deviceId: zod.z.number(),
|
|
8179
|
+
since: zod.z.number(),
|
|
8180
|
+
until: zod.z.number(),
|
|
8181
|
+
limit: zod.z.number().int().positive().optional()
|
|
8182
|
+
}),
|
|
8183
|
+
zod.z.array(ClipSchema).readonly(),
|
|
8184
|
+
{ kind: "query", auth: "admin" }
|
|
8185
|
+
),
|
|
8186
|
+
getClipPlayback: method(
|
|
8187
|
+
zod.z.object({ deviceId: zod.z.number(), clipId: zod.z.string() }),
|
|
8188
|
+
ClipPlaybackSchema,
|
|
8189
|
+
{ kind: "query", auth: "admin" }
|
|
8190
|
+
)
|
|
8191
|
+
}
|
|
8192
|
+
};
|
|
8043
8193
|
const CameraPipelineConfigSchema = zod.z.object({
|
|
8044
8194
|
engine: PipelineEngineChoiceSchema,
|
|
8045
8195
|
steps: zod.z.array(PipelineStepInputSchema).readonly(),
|
|
@@ -10407,7 +10557,7 @@ const eventsCapability = {
|
|
|
10407
10557
|
const RecordingStatusSchema = zod.z.object({
|
|
10408
10558
|
deviceId: zod.z.number(),
|
|
10409
10559
|
enabled: zod.z.boolean(),
|
|
10410
|
-
activeMode: zod.z.enum(["off", "continuous"]),
|
|
10560
|
+
activeMode: zod.z.enum(["off", "continuous", "events"]),
|
|
10411
10561
|
nodeId: zod.z.string(),
|
|
10412
10562
|
storageBytes: zod.z.number()
|
|
10413
10563
|
});
|
|
@@ -12845,6 +12995,8 @@ exports.CarbonMonoxideStatusSchema = CarbonMonoxideStatusSchema;
|
|
|
12845
12995
|
exports.ChargingStatus = ChargingStatus;
|
|
12846
12996
|
exports.ClientNetworkStatsSchema = ClientNetworkStatsSchema;
|
|
12847
12997
|
exports.ClimateControlStatusSchema = ClimateControlStatusSchema;
|
|
12998
|
+
exports.ClipPlaybackSchema = ClipPlaybackSchema;
|
|
12999
|
+
exports.ClipSchema = ClipSchema;
|
|
12848
13000
|
exports.ClusterAddonNodeDeploymentSchema = ClusterAddonNodeDeploymentSchema;
|
|
12849
13001
|
exports.ClusterAddonStatusEntrySchema = ClusterAddonStatusEntrySchema;
|
|
12850
13002
|
exports.CollectionColumnSchema = CollectionColumnSchema;
|
|
@@ -13040,6 +13192,9 @@ exports.QueryFilterSchema = QueryFilterSchema;
|
|
|
13040
13192
|
exports.RawStateResultSchema = RawStateResultSchema;
|
|
13041
13193
|
exports.ReadChunkInputSchema = ReadChunkInputSchema;
|
|
13042
13194
|
exports.RecordingAvailabilitySchema = RecordingAvailabilitySchema;
|
|
13195
|
+
exports.RecordingBandModeSchema = RecordingBandModeSchema;
|
|
13196
|
+
exports.RecordingBandSchema = RecordingBandSchema;
|
|
13197
|
+
exports.RecordingBandTriggersSchema = RecordingBandTriggersSchema;
|
|
13043
13198
|
exports.RecordingConfigSchema = RecordingConfigSchema;
|
|
13044
13199
|
exports.RecordingDeviceUsageSchema = RecordingDeviceUsageSchema;
|
|
13045
13200
|
exports.RecordingLocationUsageSchema = RecordingLocationUsageSchema;
|
|
@@ -13050,7 +13205,9 @@ exports.RecordingRetentionSchema = RecordingRetentionSchema;
|
|
|
13050
13205
|
exports.RecordingRuleSchema = RecordingRuleSchema;
|
|
13051
13206
|
exports.RecordingScheduleSchema = RecordingScheduleSchema;
|
|
13052
13207
|
exports.RecordingStatusSchema = RecordingStatusSchema;
|
|
13208
|
+
exports.RecordingStorageModeSchema = RecordingStorageModeSchema;
|
|
13053
13209
|
exports.RecordingStorageUsageSchema = RecordingStorageUsageSchema;
|
|
13210
|
+
exports.RecordingTriggersSchema = RecordingTriggersSchema;
|
|
13054
13211
|
exports.RecordingWeekdaySchema = RecordingWeekdaySchema;
|
|
13055
13212
|
exports.RegisteredStreamSchema = RegisteredStreamSchema;
|
|
13056
13213
|
exports.RegistryStatusSchema = RegistryStatusSchema;
|
|
@@ -13214,6 +13371,7 @@ exports.expandCapMethods = expandCapMethods;
|
|
|
13214
13371
|
exports.extractSourceInfoFromMetadata = extractSourceInfoFromMetadata;
|
|
13215
13372
|
exports.fanControlCapability = fanControlCapability;
|
|
13216
13373
|
exports.featureProbeCapability = featureProbeCapability;
|
|
13374
|
+
exports.filesystemBrowseCapability = filesystemBrowseCapability;
|
|
13217
13375
|
exports.floodCapability = floodCapability;
|
|
13218
13376
|
exports.gasCapability = gasCapability;
|
|
13219
13377
|
exports.getAudioMacroClassIds = getAudioMacroClassIds;
|
|
@@ -13295,6 +13453,7 @@ exports.userPasskeysCapability = userPasskeysCapability;
|
|
|
13295
13453
|
exports.vacuumControlCapability = vacuumControlCapability;
|
|
13296
13454
|
exports.valveCapability = valveCapability;
|
|
13297
13455
|
exports.vibrationCapability = vibrationCapability;
|
|
13456
|
+
exports.videoclipsCapability = videoclipsCapability;
|
|
13298
13457
|
exports.waterHeaterCapability = waterHeaterCapability;
|
|
13299
13458
|
exports.weatherCapability = weatherCapability;
|
|
13300
13459
|
exports.webrtcCapability = webrtcCapability;
|
|
@@ -13308,4 +13467,4 @@ exports.wiringProbeResultSchema = wiringProbeResultSchema;
|
|
|
13308
13467
|
exports.zoneAnalyticsCapability = zoneAnalyticsCapability;
|
|
13309
13468
|
exports.zoneRulesCapability = zoneRulesCapability;
|
|
13310
13469
|
exports.zonesCapability = zonesCapability;
|
|
13311
|
-
//# sourceMappingURL=index-
|
|
13470
|
+
//# sourceMappingURL=index-CGMPfVaT.js.map
|