@camstack/addon-provider-homeassistant 1.2.54 → 1.2.56
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 +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/{dist-BfdeH6US.mjs → dist-DQlMgQbg.mjs} +154 -19
- package/dist/{dist-D24orV6m.js → dist-DuEiH0D0.js} +154 -19
- package/dist/ha-export/ha-export.addon.js +1 -1
- package/dist/ha-export/ha-export.addon.mjs +1 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-DuEiH0D0.js");
|
|
3
3
|
let node_crypto = require("node:crypto");
|
|
4
4
|
let node_zlib = require("node:zlib");
|
|
5
5
|
//#region src/ha-device-source.ts
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-
|
|
1
|
+
import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-DQlMgQbg.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
|
|
4
4
|
//#region src/ha-device-source.ts
|
|
@@ -8242,18 +8242,61 @@ var RelocateFootageInputSchema = object({
|
|
|
8242
8242
|
* `RecordingConfig.enabled` or camera wrapper bindings. */
|
|
8243
8243
|
var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
|
|
8244
8244
|
var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
|
|
8245
|
+
/**
|
|
8246
|
+
* What a `relocateMedia` pass DOES. One engine, three passes — never a second
|
|
8247
|
+
* mover (the engine already walks both collections with a timestamp cursor and
|
|
8248
|
+
* already has a stamp-without-copy path).
|
|
8249
|
+
*
|
|
8250
|
+
* - `move` — the default and the historical behaviour: event-media and
|
|
8251
|
+
* retrain blobs move to `toLocationId` and their rows are
|
|
8252
|
+
* stamped. The enrolled gallery is skipped (D197).
|
|
8253
|
+
* - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
|
|
8254
|
+
* stamped with `toLocationId`. `toLocationId` here is the id the
|
|
8255
|
+
* bytes ALREADY sit on — today's `eventMedia` default — because
|
|
8256
|
+
* a NULL row means "wherever `eventMedia` points *now*", and the
|
|
8257
|
+
* instant a repoint moves that pointer the row reads from the
|
|
8258
|
+
* new disk while its bytes are on the old one.
|
|
8259
|
+
* - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
|
|
8260
|
+
* (enrolled-gallery) rows, which `move` deliberately skips.
|
|
8261
|
+
* `galleryMedia` is `cardinality: 'single'`, so this pass can
|
|
8262
|
+
* never run beside a live second location: it is stop-the-world
|
|
8263
|
+
* by construction, which is acceptable only because the gallery
|
|
8264
|
+
* is a few KB per enrolled sample.
|
|
8265
|
+
*/
|
|
8266
|
+
var MediaRelocateModeSchema = _enum([
|
|
8267
|
+
"move",
|
|
8268
|
+
"seal",
|
|
8269
|
+
"gallery"
|
|
8270
|
+
]);
|
|
8245
8271
|
var RelocateMediaInputSchema = object({
|
|
8246
8272
|
toLocationId: string(),
|
|
8247
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
8273
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
8274
|
+
/** Omitted = `move`, the pre-existing behaviour. */
|
|
8275
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8276
|
+
});
|
|
8277
|
+
/** How many rows still carry NO `locationId` — the population a repoint would
|
|
8278
|
+
* silently re-aim at a disk that does not hold their bytes. Zero is the only
|
|
8279
|
+
* value that permits a non-blocking `eventMedia` cutover. */
|
|
8280
|
+
var UnstampedEventMediaCountSchema = object({
|
|
8281
|
+
media: number().int().nonnegative(),
|
|
8282
|
+
retrainFrames: number().int().nonnegative(),
|
|
8283
|
+
total: number().int().nonnegative()
|
|
8248
8284
|
});
|
|
8249
8285
|
var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
|
|
8250
|
-
/** The independently selectable logical storage classes
|
|
8251
|
-
*
|
|
8252
|
-
*
|
|
8286
|
+
/** The independently selectable logical storage classes — every class
|
|
8287
|
+
* `storage.listLocationDeclarations` reports, so an operator never meets a
|
|
8288
|
+
* Zod enum error where they should meet an explanation.
|
|
8289
|
+
*
|
|
8290
|
+
* `recordings` encompasses the high and mid segment profiles; `recordingsLow`
|
|
8291
|
+
* is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
|
|
8292
|
+
* enrolled gallery; `backups` is the system backup archive. The last two have
|
|
8293
|
+
* their own rules — see {@link StorageMigrationFindingCodeSchema}. */
|
|
8253
8294
|
var StorageMigrationClassSchema = _enum([
|
|
8254
8295
|
"recordings",
|
|
8255
8296
|
"recordingsLow",
|
|
8256
|
-
"eventMedia"
|
|
8297
|
+
"eventMedia",
|
|
8298
|
+
"backups",
|
|
8299
|
+
"galleryMedia"
|
|
8257
8300
|
]);
|
|
8258
8301
|
/** A destination is always an existing, fully-qualified location id. The
|
|
8259
8302
|
* migration API intentionally never changes a source location's `basePath`:
|
|
@@ -8261,20 +8304,56 @@ var StorageMigrationClassSchema = _enum([
|
|
|
8261
8304
|
var StorageMigrationDestinationsSchema = object({
|
|
8262
8305
|
recordings: string().min(1).optional(),
|
|
8263
8306
|
recordingsLow: string().min(1).optional(),
|
|
8264
|
-
eventMedia: string().min(1).optional()
|
|
8307
|
+
eventMedia: string().min(1).optional(),
|
|
8308
|
+
backups: string().min(1).optional(),
|
|
8309
|
+
galleryMedia: string().min(1).optional()
|
|
8265
8310
|
}).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
|
|
8311
|
+
/**
|
|
8312
|
+
* How a migration sequences the cutover against the byte move.
|
|
8313
|
+
*
|
|
8314
|
+
* - `blocking` — the historical order: pause, move every byte, repoint,
|
|
8315
|
+
* resume. Recording is stopped for the whole move. Right
|
|
8316
|
+
* for a small or a cold class, and the only legal mode for
|
|
8317
|
+
* a `cardinality: 'single'` class.
|
|
8318
|
+
* - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
|
|
8319
|
+
* refresh, resume, then move the past with everything
|
|
8320
|
+
* running. The pause is three bounded instants (a detach +
|
|
8321
|
+
* attach round, a write-gate drain, a lease) instead of one
|
|
8322
|
+
* bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
|
|
8323
|
+
* stopped recording under `blocking`; the same move is
|
|
8324
|
+
* seconds of stopped recording under `nonBlocking`.
|
|
8325
|
+
*
|
|
8326
|
+
* The mode is on the JOB, not only on the input, because `status` is where an
|
|
8327
|
+
* operator finds out which one is running.
|
|
8328
|
+
*/
|
|
8329
|
+
var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
|
|
8266
8330
|
/** Shared input for planning and starting an orchestrated storage migration. */
|
|
8267
8331
|
var StorageMigrationInputSchema = object({
|
|
8268
8332
|
destinations: StorageMigrationDestinationsSchema,
|
|
8269
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
8333
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
8334
|
+
/** Omitted = `blocking`, which stays the default. */
|
|
8335
|
+
mode: StorageMigrationModeSchema.optional()
|
|
8270
8336
|
});
|
|
8271
|
-
/**
|
|
8272
|
-
*
|
|
8273
|
-
*
|
|
8337
|
+
/**
|
|
8338
|
+
* The durable coordinator state machine.
|
|
8339
|
+
*
|
|
8340
|
+
* `blocking`:
|
|
8341
|
+
* planning → pausing → moving → verifying → repointing → refreshing → resuming → done
|
|
8342
|
+
*
|
|
8343
|
+
* `nonBlocking`:
|
|
8344
|
+
* planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
|
|
8345
|
+
*
|
|
8346
|
+
* Same phases, different order plus two new ones — not a second mover.
|
|
8347
|
+
* `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
|
|
8348
|
+
* `draining` runs the same movers UNLEASED, after every writer is back up.
|
|
8349
|
+
* `repointing` is still the only phase that changes a default location.
|
|
8350
|
+
*/
|
|
8274
8351
|
var StorageMigrationPhaseSchema = _enum([
|
|
8275
8352
|
"planning",
|
|
8353
|
+
"sealing",
|
|
8276
8354
|
"pausing",
|
|
8277
8355
|
"moving",
|
|
8356
|
+
"draining",
|
|
8278
8357
|
"verifying",
|
|
8279
8358
|
"repointing",
|
|
8280
8359
|
"refreshing",
|
|
@@ -8299,6 +8378,9 @@ var StorageMigrationMoveSchema = object({
|
|
|
8299
8378
|
var StorageMigrationJobSchema = object({
|
|
8300
8379
|
jobId: string(),
|
|
8301
8380
|
phase: StorageMigrationPhaseSchema,
|
|
8381
|
+
/** Which order this job is running. `status` is the only place an operator
|
|
8382
|
+
* can tell a seconds-long cutover from a thirty-hour one. */
|
|
8383
|
+
mode: StorageMigrationModeSchema,
|
|
8302
8384
|
destinations: StorageMigrationDestinationsSchema,
|
|
8303
8385
|
throttleMbps: number(),
|
|
8304
8386
|
moves: array(StorageMigrationMoveSchema),
|
|
@@ -8311,13 +8393,30 @@ var StorageMigrationJobSchema = object({
|
|
|
8311
8393
|
finishedAt: number().nullable(),
|
|
8312
8394
|
error: string().nullable()
|
|
8313
8395
|
});
|
|
8396
|
+
var StorageMigrationFindingSchema = object({
|
|
8397
|
+
code: _enum([
|
|
8398
|
+
"sharesDeviceWithSource",
|
|
8399
|
+
"deviceIdentityUnknown",
|
|
8400
|
+
"unstampedEventMediaRows",
|
|
8401
|
+
"blockingOnly",
|
|
8402
|
+
"noMover"
|
|
8403
|
+
]),
|
|
8404
|
+
storageClass: StorageMigrationClassSchema,
|
|
8405
|
+
/** Human-readable, already carrying the ids and counts. */
|
|
8406
|
+
message: string()
|
|
8407
|
+
});
|
|
8314
8408
|
var StorageMigrationPlanSchema = object({
|
|
8315
8409
|
destinations: StorageMigrationDestinationsSchema,
|
|
8410
|
+
/** The mode this plan was built for. A plan is only valid for its mode: the
|
|
8411
|
+
* `eventMedia` seal gate and the single-cardinality refusal both depend on
|
|
8412
|
+
* it. */
|
|
8413
|
+
mode: StorageMigrationModeSchema,
|
|
8316
8414
|
moves: array(object({
|
|
8317
8415
|
storageClass: StorageMigrationClassSchema,
|
|
8318
8416
|
fromLocationId: string(),
|
|
8319
8417
|
toLocationId: string()
|
|
8320
|
-
}))
|
|
8418
|
+
})),
|
|
8419
|
+
findings: array(StorageMigrationFindingSchema)
|
|
8321
8420
|
});
|
|
8322
8421
|
/**
|
|
8323
8422
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
@@ -19355,7 +19454,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19355
19454
|
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
19356
19455
|
kind: "mutation",
|
|
19357
19456
|
auth: "admin"
|
|
19358
|
-
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
19457
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
19359
19458
|
kind: "query",
|
|
19360
19459
|
auth: "admin"
|
|
19361
19460
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
@@ -21262,7 +21361,10 @@ method(object({
|
|
|
21262
21361
|
}), StorageLocationSchema, {
|
|
21263
21362
|
kind: "mutation",
|
|
21264
21363
|
auth: "admin"
|
|
21265
|
-
}), method(object({
|
|
21364
|
+
}), method(object({
|
|
21365
|
+
id: string(),
|
|
21366
|
+
force: boolean().optional()
|
|
21367
|
+
}), _void(), {
|
|
21266
21368
|
kind: "mutation",
|
|
21267
21369
|
auth: "admin"
|
|
21268
21370
|
}), method(object({ id: string() }), object({
|
|
@@ -25419,6 +25521,33 @@ var intercomCapability = {
|
|
|
25419
25521
|
deviceNative: true,
|
|
25420
25522
|
mode: "singleton",
|
|
25421
25523
|
deviceTypes: [DeviceType.Camera],
|
|
25524
|
+
/**
|
|
25525
|
+
* **Auth tier: `protected` on every method — deliberate, and load-bearing.**
|
|
25526
|
+
*
|
|
25527
|
+
* Talking through a camera is an OPERATE action, not a CONFIGURE one. This
|
|
25528
|
+
* cap has no configuration surface at all: all six methods open, feed and
|
|
25529
|
+
* close one live audio session against one `deviceId`. That is the same
|
|
25530
|
+
* authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
|
|
25531
|
+
* the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
|
|
25532
|
+
* `admin` because they change what the device IS.
|
|
25533
|
+
*
|
|
25534
|
+
* `protected` does not mean ungated: `protectedProcedure` runs the
|
|
25535
|
+
* `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
|
|
25536
|
+
* with `access: 'create'` and a `deviceId` in its input. So a caller needs a
|
|
25537
|
+
* grant that covers THAT camera at `create` — a `camera-viewer` (`view`
|
|
25538
|
+
* only) still cannot talk, and a grant on camera 5 cannot talk through
|
|
25539
|
+
* camera 7.
|
|
25540
|
+
*
|
|
25541
|
+
* Every method was `auth: 'admin'` from the initial commit, which made the
|
|
25542
|
+
* cap unreachable by every non-admin principal — `adminProcedure` throws
|
|
25543
|
+
* `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
|
|
25544
|
+
* machinery generated for this cap (`METHOD_ACCESS_MAP`,
|
|
25545
|
+
* `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
|
|
25546
|
+
* `camera-operator` scope preset has promised "PTZ control, intercom,
|
|
25547
|
+
* snapshots" since that same commit; the promise could not be kept. Recorded
|
|
25548
|
+
* as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
|
|
25549
|
+
* preset promises a cap no row of that preset can reach.
|
|
25550
|
+
*/
|
|
25422
25551
|
methods: {
|
|
25423
25552
|
/**
|
|
25424
25553
|
* Open a server-side WebRTC audio-only session. Returns an SDP
|
|
@@ -25431,7 +25560,7 @@ var intercomCapability = {
|
|
|
25431
25560
|
sdpOffer: string()
|
|
25432
25561
|
}), {
|
|
25433
25562
|
kind: "mutation",
|
|
25434
|
-
auth: "
|
|
25563
|
+
auth: "protected"
|
|
25435
25564
|
}),
|
|
25436
25565
|
handleAnswer: method(object({
|
|
25437
25566
|
deviceId: number(),
|
|
@@ -25439,7 +25568,7 @@ var intercomCapability = {
|
|
|
25439
25568
|
sdpAnswer: string()
|
|
25440
25569
|
}), _void(), {
|
|
25441
25570
|
kind: "mutation",
|
|
25442
|
-
auth: "
|
|
25571
|
+
auth: "protected"
|
|
25443
25572
|
}),
|
|
25444
25573
|
/** Close explicitly. Server also auto-closes on 30s idle. */
|
|
25445
25574
|
stopSession: method(object({
|
|
@@ -25447,7 +25576,7 @@ var intercomCapability = {
|
|
|
25447
25576
|
sessionId: string()
|
|
25448
25577
|
}), _void(), {
|
|
25449
25578
|
kind: "mutation",
|
|
25450
|
-
auth: "
|
|
25579
|
+
auth: "protected"
|
|
25451
25580
|
}),
|
|
25452
25581
|
/**
|
|
25453
25582
|
* Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
|
|
@@ -25460,7 +25589,7 @@ var intercomCapability = {
|
|
|
25460
25589
|
*/
|
|
25461
25590
|
startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
|
|
25462
25591
|
kind: "mutation",
|
|
25463
|
-
auth: "
|
|
25592
|
+
auth: "protected"
|
|
25464
25593
|
}),
|
|
25465
25594
|
/**
|
|
25466
25595
|
* Push one chunk of talk-back audio onto the active talk session.
|
|
@@ -25495,12 +25624,12 @@ var intercomCapability = {
|
|
|
25495
25624
|
sequenceNumber: number().int()
|
|
25496
25625
|
}), object({ accepted: boolean() }), {
|
|
25497
25626
|
kind: "mutation",
|
|
25498
|
-
auth: "
|
|
25627
|
+
auth: "protected"
|
|
25499
25628
|
}),
|
|
25500
25629
|
/** Close the raw-PCM talk session. Idempotent. */
|
|
25501
25630
|
endTalkSession: method(object({ deviceId: number() }), _void(), {
|
|
25502
25631
|
kind: "mutation",
|
|
25503
|
-
auth: "
|
|
25632
|
+
auth: "protected"
|
|
25504
25633
|
})
|
|
25505
25634
|
},
|
|
25506
25635
|
events: { onStatusChanged: { data: object({
|
|
@@ -35181,6 +35310,12 @@ Object.freeze({
|
|
|
35181
35310
|
addonId: null,
|
|
35182
35311
|
access: "create"
|
|
35183
35312
|
},
|
|
35313
|
+
"pipelineAnalytics.countUnstampedEventMedia": {
|
|
35314
|
+
capName: "pipeline-analytics",
|
|
35315
|
+
capScope: "device",
|
|
35316
|
+
addonId: null,
|
|
35317
|
+
access: "view"
|
|
35318
|
+
},
|
|
35184
35319
|
"pipelineAnalytics.deleteDeviceEvents": {
|
|
35185
35320
|
capName: "pipeline-analytics",
|
|
35186
35321
|
capScope: "device",
|
|
@@ -8242,18 +8242,61 @@ var RelocateFootageInputSchema = object({
|
|
|
8242
8242
|
* `RecordingConfig.enabled` or camera wrapper bindings. */
|
|
8243
8243
|
var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
|
|
8244
8244
|
var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
|
|
8245
|
+
/**
|
|
8246
|
+
* What a `relocateMedia` pass DOES. One engine, three passes — never a second
|
|
8247
|
+
* mover (the engine already walks both collections with a timestamp cursor and
|
|
8248
|
+
* already has a stamp-without-copy path).
|
|
8249
|
+
*
|
|
8250
|
+
* - `move` — the default and the historical behaviour: event-media and
|
|
8251
|
+
* retrain blobs move to `toLocationId` and their rows are
|
|
8252
|
+
* stamped. The enrolled gallery is skipped (D197).
|
|
8253
|
+
* - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
|
|
8254
|
+
* stamped with `toLocationId`. `toLocationId` here is the id the
|
|
8255
|
+
* bytes ALREADY sit on — today's `eventMedia` default — because
|
|
8256
|
+
* a NULL row means "wherever `eventMedia` points *now*", and the
|
|
8257
|
+
* instant a repoint moves that pointer the row reads from the
|
|
8258
|
+
* new disk while its bytes are on the old one.
|
|
8259
|
+
* - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
|
|
8260
|
+
* (enrolled-gallery) rows, which `move` deliberately skips.
|
|
8261
|
+
* `galleryMedia` is `cardinality: 'single'`, so this pass can
|
|
8262
|
+
* never run beside a live second location: it is stop-the-world
|
|
8263
|
+
* by construction, which is acceptable only because the gallery
|
|
8264
|
+
* is a few KB per enrolled sample.
|
|
8265
|
+
*/
|
|
8266
|
+
var MediaRelocateModeSchema = _enum([
|
|
8267
|
+
"move",
|
|
8268
|
+
"seal",
|
|
8269
|
+
"gallery"
|
|
8270
|
+
]);
|
|
8245
8271
|
var RelocateMediaInputSchema = object({
|
|
8246
8272
|
toLocationId: string(),
|
|
8247
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
8273
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
8274
|
+
/** Omitted = `move`, the pre-existing behaviour. */
|
|
8275
|
+
mode: MediaRelocateModeSchema.optional()
|
|
8276
|
+
});
|
|
8277
|
+
/** How many rows still carry NO `locationId` — the population a repoint would
|
|
8278
|
+
* silently re-aim at a disk that does not hold their bytes. Zero is the only
|
|
8279
|
+
* value that permits a non-blocking `eventMedia` cutover. */
|
|
8280
|
+
var UnstampedEventMediaCountSchema = object({
|
|
8281
|
+
media: number().int().nonnegative(),
|
|
8282
|
+
retrainFrames: number().int().nonnegative(),
|
|
8283
|
+
total: number().int().nonnegative()
|
|
8248
8284
|
});
|
|
8249
8285
|
var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
|
|
8250
|
-
/** The independently selectable logical storage classes
|
|
8251
|
-
*
|
|
8252
|
-
*
|
|
8286
|
+
/** The independently selectable logical storage classes — every class
|
|
8287
|
+
* `storage.listLocationDeclarations` reports, so an operator never meets a
|
|
8288
|
+
* Zod enum error where they should meet an explanation.
|
|
8289
|
+
*
|
|
8290
|
+
* `recordings` encompasses the high and mid segment profiles; `recordingsLow`
|
|
8291
|
+
* is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
|
|
8292
|
+
* enrolled gallery; `backups` is the system backup archive. The last two have
|
|
8293
|
+
* their own rules — see {@link StorageMigrationFindingCodeSchema}. */
|
|
8253
8294
|
var StorageMigrationClassSchema = _enum([
|
|
8254
8295
|
"recordings",
|
|
8255
8296
|
"recordingsLow",
|
|
8256
|
-
"eventMedia"
|
|
8297
|
+
"eventMedia",
|
|
8298
|
+
"backups",
|
|
8299
|
+
"galleryMedia"
|
|
8257
8300
|
]);
|
|
8258
8301
|
/** A destination is always an existing, fully-qualified location id. The
|
|
8259
8302
|
* migration API intentionally never changes a source location's `basePath`:
|
|
@@ -8261,20 +8304,56 @@ var StorageMigrationClassSchema = _enum([
|
|
|
8261
8304
|
var StorageMigrationDestinationsSchema = object({
|
|
8262
8305
|
recordings: string().min(1).optional(),
|
|
8263
8306
|
recordingsLow: string().min(1).optional(),
|
|
8264
|
-
eventMedia: string().min(1).optional()
|
|
8307
|
+
eventMedia: string().min(1).optional(),
|
|
8308
|
+
backups: string().min(1).optional(),
|
|
8309
|
+
galleryMedia: string().min(1).optional()
|
|
8265
8310
|
}).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
|
|
8311
|
+
/**
|
|
8312
|
+
* How a migration sequences the cutover against the byte move.
|
|
8313
|
+
*
|
|
8314
|
+
* - `blocking` — the historical order: pause, move every byte, repoint,
|
|
8315
|
+
* resume. Recording is stopped for the whole move. Right
|
|
8316
|
+
* for a small or a cold class, and the only legal mode for
|
|
8317
|
+
* a `cardinality: 'single'` class.
|
|
8318
|
+
* - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
|
|
8319
|
+
* refresh, resume, then move the past with everything
|
|
8320
|
+
* running. The pause is three bounded instants (a detach +
|
|
8321
|
+
* attach round, a write-gate drain, a lease) instead of one
|
|
8322
|
+
* bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
|
|
8323
|
+
* stopped recording under `blocking`; the same move is
|
|
8324
|
+
* seconds of stopped recording under `nonBlocking`.
|
|
8325
|
+
*
|
|
8326
|
+
* The mode is on the JOB, not only on the input, because `status` is where an
|
|
8327
|
+
* operator finds out which one is running.
|
|
8328
|
+
*/
|
|
8329
|
+
var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
|
|
8266
8330
|
/** Shared input for planning and starting an orchestrated storage migration. */
|
|
8267
8331
|
var StorageMigrationInputSchema = object({
|
|
8268
8332
|
destinations: StorageMigrationDestinationsSchema,
|
|
8269
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
8333
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
8334
|
+
/** Omitted = `blocking`, which stays the default. */
|
|
8335
|
+
mode: StorageMigrationModeSchema.optional()
|
|
8270
8336
|
});
|
|
8271
|
-
/**
|
|
8272
|
-
*
|
|
8273
|
-
*
|
|
8337
|
+
/**
|
|
8338
|
+
* The durable coordinator state machine.
|
|
8339
|
+
*
|
|
8340
|
+
* `blocking`:
|
|
8341
|
+
* planning → pausing → moving → verifying → repointing → refreshing → resuming → done
|
|
8342
|
+
*
|
|
8343
|
+
* `nonBlocking`:
|
|
8344
|
+
* planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
|
|
8345
|
+
*
|
|
8346
|
+
* Same phases, different order plus two new ones — not a second mover.
|
|
8347
|
+
* `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
|
|
8348
|
+
* `draining` runs the same movers UNLEASED, after every writer is back up.
|
|
8349
|
+
* `repointing` is still the only phase that changes a default location.
|
|
8350
|
+
*/
|
|
8274
8351
|
var StorageMigrationPhaseSchema = _enum([
|
|
8275
8352
|
"planning",
|
|
8353
|
+
"sealing",
|
|
8276
8354
|
"pausing",
|
|
8277
8355
|
"moving",
|
|
8356
|
+
"draining",
|
|
8278
8357
|
"verifying",
|
|
8279
8358
|
"repointing",
|
|
8280
8359
|
"refreshing",
|
|
@@ -8299,6 +8378,9 @@ var StorageMigrationMoveSchema = object({
|
|
|
8299
8378
|
var StorageMigrationJobSchema = object({
|
|
8300
8379
|
jobId: string(),
|
|
8301
8380
|
phase: StorageMigrationPhaseSchema,
|
|
8381
|
+
/** Which order this job is running. `status` is the only place an operator
|
|
8382
|
+
* can tell a seconds-long cutover from a thirty-hour one. */
|
|
8383
|
+
mode: StorageMigrationModeSchema,
|
|
8302
8384
|
destinations: StorageMigrationDestinationsSchema,
|
|
8303
8385
|
throttleMbps: number(),
|
|
8304
8386
|
moves: array(StorageMigrationMoveSchema),
|
|
@@ -8311,13 +8393,30 @@ var StorageMigrationJobSchema = object({
|
|
|
8311
8393
|
finishedAt: number().nullable(),
|
|
8312
8394
|
error: string().nullable()
|
|
8313
8395
|
});
|
|
8396
|
+
var StorageMigrationFindingSchema = object({
|
|
8397
|
+
code: _enum([
|
|
8398
|
+
"sharesDeviceWithSource",
|
|
8399
|
+
"deviceIdentityUnknown",
|
|
8400
|
+
"unstampedEventMediaRows",
|
|
8401
|
+
"blockingOnly",
|
|
8402
|
+
"noMover"
|
|
8403
|
+
]),
|
|
8404
|
+
storageClass: StorageMigrationClassSchema,
|
|
8405
|
+
/** Human-readable, already carrying the ids and counts. */
|
|
8406
|
+
message: string()
|
|
8407
|
+
});
|
|
8314
8408
|
var StorageMigrationPlanSchema = object({
|
|
8315
8409
|
destinations: StorageMigrationDestinationsSchema,
|
|
8410
|
+
/** The mode this plan was built for. A plan is only valid for its mode: the
|
|
8411
|
+
* `eventMedia` seal gate and the single-cardinality refusal both depend on
|
|
8412
|
+
* it. */
|
|
8413
|
+
mode: StorageMigrationModeSchema,
|
|
8316
8414
|
moves: array(object({
|
|
8317
8415
|
storageClass: StorageMigrationClassSchema,
|
|
8318
8416
|
fromLocationId: string(),
|
|
8319
8417
|
toLocationId: string()
|
|
8320
|
-
}))
|
|
8418
|
+
})),
|
|
8419
|
+
findings: array(StorageMigrationFindingSchema)
|
|
8321
8420
|
});
|
|
8322
8421
|
/**
|
|
8323
8422
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
@@ -19355,7 +19454,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19355
19454
|
}), method(RelocateMediaInputSchema, object({ jobId: string() }), {
|
|
19356
19455
|
kind: "mutation",
|
|
19357
19456
|
auth: "admin"
|
|
19358
|
-
}), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
19457
|
+
}), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
|
|
19359
19458
|
kind: "query",
|
|
19360
19459
|
auth: "admin"
|
|
19361
19460
|
}), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
|
|
@@ -21262,7 +21361,10 @@ method(object({
|
|
|
21262
21361
|
}), StorageLocationSchema, {
|
|
21263
21362
|
kind: "mutation",
|
|
21264
21363
|
auth: "admin"
|
|
21265
|
-
}), method(object({
|
|
21364
|
+
}), method(object({
|
|
21365
|
+
id: string(),
|
|
21366
|
+
force: boolean().optional()
|
|
21367
|
+
}), _void(), {
|
|
21266
21368
|
kind: "mutation",
|
|
21267
21369
|
auth: "admin"
|
|
21268
21370
|
}), method(object({ id: string() }), object({
|
|
@@ -25419,6 +25521,33 @@ var intercomCapability = {
|
|
|
25419
25521
|
deviceNative: true,
|
|
25420
25522
|
mode: "singleton",
|
|
25421
25523
|
deviceTypes: [DeviceType.Camera],
|
|
25524
|
+
/**
|
|
25525
|
+
* **Auth tier: `protected` on every method — deliberate, and load-bearing.**
|
|
25526
|
+
*
|
|
25527
|
+
* Talking through a camera is an OPERATE action, not a CONFIGURE one. This
|
|
25528
|
+
* cap has no configuration surface at all: all six methods open, feed and
|
|
25529
|
+
* close one live audio session against one `deviceId`. That is the same
|
|
25530
|
+
* authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
|
|
25531
|
+
* the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
|
|
25532
|
+
* `admin` because they change what the device IS.
|
|
25533
|
+
*
|
|
25534
|
+
* `protected` does not mean ungated: `protectedProcedure` runs the
|
|
25535
|
+
* `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
|
|
25536
|
+
* with `access: 'create'` and a `deviceId` in its input. So a caller needs a
|
|
25537
|
+
* grant that covers THAT camera at `create` — a `camera-viewer` (`view`
|
|
25538
|
+
* only) still cannot talk, and a grant on camera 5 cannot talk through
|
|
25539
|
+
* camera 7.
|
|
25540
|
+
*
|
|
25541
|
+
* Every method was `auth: 'admin'` from the initial commit, which made the
|
|
25542
|
+
* cap unreachable by every non-admin principal — `adminProcedure` throws
|
|
25543
|
+
* `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
|
|
25544
|
+
* machinery generated for this cap (`METHOD_ACCESS_MAP`,
|
|
25545
|
+
* `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
|
|
25546
|
+
* `camera-operator` scope preset has promised "PTZ control, intercom,
|
|
25547
|
+
* snapshots" since that same commit; the promise could not be kept. Recorded
|
|
25548
|
+
* as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
|
|
25549
|
+
* preset promises a cap no row of that preset can reach.
|
|
25550
|
+
*/
|
|
25422
25551
|
methods: {
|
|
25423
25552
|
/**
|
|
25424
25553
|
* Open a server-side WebRTC audio-only session. Returns an SDP
|
|
@@ -25431,7 +25560,7 @@ var intercomCapability = {
|
|
|
25431
25560
|
sdpOffer: string()
|
|
25432
25561
|
}), {
|
|
25433
25562
|
kind: "mutation",
|
|
25434
|
-
auth: "
|
|
25563
|
+
auth: "protected"
|
|
25435
25564
|
}),
|
|
25436
25565
|
handleAnswer: method(object({
|
|
25437
25566
|
deviceId: number(),
|
|
@@ -25439,7 +25568,7 @@ var intercomCapability = {
|
|
|
25439
25568
|
sdpAnswer: string()
|
|
25440
25569
|
}), _void(), {
|
|
25441
25570
|
kind: "mutation",
|
|
25442
|
-
auth: "
|
|
25571
|
+
auth: "protected"
|
|
25443
25572
|
}),
|
|
25444
25573
|
/** Close explicitly. Server also auto-closes on 30s idle. */
|
|
25445
25574
|
stopSession: method(object({
|
|
@@ -25447,7 +25576,7 @@ var intercomCapability = {
|
|
|
25447
25576
|
sessionId: string()
|
|
25448
25577
|
}), _void(), {
|
|
25449
25578
|
kind: "mutation",
|
|
25450
|
-
auth: "
|
|
25579
|
+
auth: "protected"
|
|
25451
25580
|
}),
|
|
25452
25581
|
/**
|
|
25453
25582
|
* Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
|
|
@@ -25460,7 +25589,7 @@ var intercomCapability = {
|
|
|
25460
25589
|
*/
|
|
25461
25590
|
startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
|
|
25462
25591
|
kind: "mutation",
|
|
25463
|
-
auth: "
|
|
25592
|
+
auth: "protected"
|
|
25464
25593
|
}),
|
|
25465
25594
|
/**
|
|
25466
25595
|
* Push one chunk of talk-back audio onto the active talk session.
|
|
@@ -25495,12 +25624,12 @@ var intercomCapability = {
|
|
|
25495
25624
|
sequenceNumber: number().int()
|
|
25496
25625
|
}), object({ accepted: boolean() }), {
|
|
25497
25626
|
kind: "mutation",
|
|
25498
|
-
auth: "
|
|
25627
|
+
auth: "protected"
|
|
25499
25628
|
}),
|
|
25500
25629
|
/** Close the raw-PCM talk session. Idempotent. */
|
|
25501
25630
|
endTalkSession: method(object({ deviceId: number() }), _void(), {
|
|
25502
25631
|
kind: "mutation",
|
|
25503
|
-
auth: "
|
|
25632
|
+
auth: "protected"
|
|
25504
25633
|
})
|
|
25505
25634
|
},
|
|
25506
25635
|
events: { onStatusChanged: { data: object({
|
|
@@ -35181,6 +35310,12 @@ Object.freeze({
|
|
|
35181
35310
|
addonId: null,
|
|
35182
35311
|
access: "create"
|
|
35183
35312
|
},
|
|
35313
|
+
"pipelineAnalytics.countUnstampedEventMedia": {
|
|
35314
|
+
capName: "pipeline-analytics",
|
|
35315
|
+
capScope: "device",
|
|
35316
|
+
addonId: null,
|
|
35317
|
+
access: "view"
|
|
35318
|
+
},
|
|
35184
35319
|
"pipelineAnalytics.deleteDeviceEvents": {
|
|
35185
35320
|
capName: "pipeline-analytics",
|
|
35186
35321
|
capScope: "device",
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
//#endregion
|
|
6
|
-
const require_dist = require("../dist-
|
|
6
|
+
const require_dist = require("../dist-DuEiH0D0.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
//#region src/ha-export/topics.ts
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-
|
|
1
|
+
import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-DQlMgQbg.mjs";
|
|
2
2
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
3
3
|
//#region src/ha-export/topics.ts
|
|
4
4
|
/**
|