@camstack/addon-provider-tuya 0.1.11 → 0.1.12

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 CHANGED
@@ -3,7 +3,7 @@ let crypto$1 = require("crypto");
3
3
  let net = require("net");
4
4
  let events = require("events");
5
5
  let dgram = require("dgram");
6
- //#region ../types/dist/event-category-H4AVePnn.mjs
6
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
7
7
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
8
8
  EventCategory["SystemBoot"] = "system.boot";
9
9
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -156,6 +156,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
156
156
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
157
157
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
158
158
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
159
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
160
+ * progress bar the client reconciles via `recordingExport.getExport`. */
161
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
162
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
163
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
159
164
  EventCategory["DetectionEvent"] = "detection.event";
160
165
  EventCategory["SessionTrackNew"] = "session.track.new";
161
166
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -445,6 +450,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
445
450
  */
446
451
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
447
452
  /**
453
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
454
+ * a package zone — a newly-appeared stationary object of a package class
455
+ * that cleared the class / zone / dwell / size gates. Payload:
456
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
457
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
458
+ * Telemetry (D8): the durable record is the `package-events` store row;
459
+ * this bus topic drives notifier rules + live UI. See
460
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
461
+ */
462
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
463
+ /**
464
+ * Fired by `addon-post-analysis` when a previously-delivered package
465
+ * leaves its zone (the stationary entry departed — moved or swept).
466
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
467
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
468
+ * Telemetry (D8). See package-zones-design §5.2.
469
+ */
470
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
471
+ /**
448
472
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
449
473
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
450
474
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5197,6 +5221,25 @@ function preprocess(fn, schema) {
5197
5221
  out: schema
5198
5222
  });
5199
5223
  }
5224
+ //#endregion
5225
+ //#region ../../node_modules/zod/v4/classic/compat.js
5226
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5227
+ var ZodIssueCode = {
5228
+ invalid_type: "invalid_type",
5229
+ too_big: "too_big",
5230
+ too_small: "too_small",
5231
+ invalid_format: "invalid_format",
5232
+ not_multiple_of: "not_multiple_of",
5233
+ unrecognized_keys: "unrecognized_keys",
5234
+ invalid_union: "invalid_union",
5235
+ invalid_key: "invalid_key",
5236
+ invalid_element: "invalid_element",
5237
+ invalid_value: "invalid_value",
5238
+ custom: "custom"
5239
+ };
5240
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5241
+ var ZodFirstPartyTypeKind;
5242
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5200
5243
  Object.fromEntries([
5201
5244
  {
5202
5245
  id: "overview",
@@ -14674,7 +14717,11 @@ array(ZoneRuleSchema).readonly();
14674
14717
  * Extend the enum here when a new gating consumer comes online (audio
14675
14718
  * gating, alert filtering, …) — no other surface needs to change.
14676
14719
  */
14677
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
14720
+ var ZoneRuleStageEnum = _enum([
14721
+ "motion",
14722
+ "detection",
14723
+ "package"
14724
+ ]);
14678
14725
  /**
14679
14726
  * Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
14680
14727
  * `state` getter looks up the cap definition here to construct a
@@ -14768,16 +14815,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
14768
14815
  })
14769
14816
  },
14770
14817
  /**
14771
- * Runtime-state slice — both stages mirrored together so consumers
14818
+ * Runtime-state slice — every stage mirrored together so consumers
14772
14819
  * see one reactive handle (`device.state.zoneRules.value`) instead
14773
- * of two. Bulk-replace mutations on either stage write the full
14774
- * `{motion, detection}` shape, so subscribers always get the
14820
+ * of one per stage. Bulk-replace mutations on any stage write the full
14821
+ * `{motion, detection, package}` shape, so subscribers always get the
14775
14822
  * complete current set. Consumers that only care about one stage
14776
14823
  * just read the matching property.
14824
+ *
14825
+ * `package` backs the package-drop detector — a package zone is a
14826
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
14827
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14828
+ * The orchestrator provider that writes this stage lands in a later
14829
+ * slice; until then the mirror carries only `{motion, detection}` and
14830
+ * consumers read `package` as absent (treat as `[]`).
14777
14831
  */
14778
14832
  runtimeState: object({
14779
14833
  motion: array(ZoneRuleSchema).readonly(),
14780
- detection: array(ZoneRuleSchema).readonly()
14834
+ detection: array(ZoneRuleSchema).readonly(),
14835
+ package: array(ZoneRuleSchema).readonly()
14781
14836
  })
14782
14837
  },
14783
14838
  zones: zonesCapability
@@ -18756,6 +18811,7 @@ var EventKindIconSchema = _enum([
18756
18811
  "smoke",
18757
18812
  "water",
18758
18813
  "button",
18814
+ "package",
18759
18815
  "generic"
18760
18816
  ]);
18761
18817
  var EventKindCategorySchema = _enum([
@@ -18763,7 +18819,8 @@ var EventKindCategorySchema = _enum([
18763
18819
  "audio",
18764
18820
  "detection",
18765
18821
  "sensor",
18766
- "custom"
18822
+ "custom",
18823
+ "package"
18767
18824
  ]);
18768
18825
  var EventKindDescriptorSchema = object({
18769
18826
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -22409,6 +22466,108 @@ method(object({
22409
22466
  auth: "admin"
22410
22467
  });
22411
22468
  /**
22469
+ * `recordingExport` cap — render a footage time range into a single downloadable
22470
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
22471
+ * bounded lifetime with a durable history, auto-expiry, and optional
22472
+ * delete-after-download.
22473
+ *
22474
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
22475
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
22476
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
22477
+ * input and dispatch to that single provider; the render runs on the node that
22478
+ * owns the footage (no cross-node segment transfer). Download rides the
22479
+ * framework addon data-plane. State persists in a DurableState blob (NOT
22480
+ * SQLite); history rows survive file deletion for audit.
22481
+ */
22482
+ /** Playback-speed multiplier for the render (1 = realtime). */
22483
+ var ExportSpeedSchema = number().min(.25).max(32);
22484
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
22485
+ var ExportTimelapseSchema = object({
22486
+ everyMs: number().int().positive(),
22487
+ outputFps: number().int().min(1).max(60).optional()
22488
+ });
22489
+ /**
22490
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
22491
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
22492
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
22493
+ * `deleteAfterDownload` removes it shortly after the first complete download.
22494
+ */
22495
+ var ExportOptionsSchema = object({
22496
+ speed: ExportSpeedSchema.optional(),
22497
+ timelapse: ExportTimelapseSchema.optional(),
22498
+ includeAudio: boolean(),
22499
+ maxLifeMs: number().int().positive(),
22500
+ deleteAfterDownload: boolean(),
22501
+ title: string().max(200).optional()
22502
+ }).superRefine((v, ctx) => {
22503
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
22504
+ code: ZodIssueCode.custom,
22505
+ message: "speed and timelapse are mutually exclusive",
22506
+ path: ["timelapse"]
22507
+ });
22508
+ });
22509
+ var ExportStateSchema = _enum([
22510
+ "queued",
22511
+ "rendering",
22512
+ "ready",
22513
+ "failed",
22514
+ "expired",
22515
+ "deleted"
22516
+ ]);
22517
+ /** One export job / history row. */
22518
+ var ExportRecordSchema = object({
22519
+ id: string(),
22520
+ deviceId: number(),
22521
+ profile: string(),
22522
+ fromMs: number(),
22523
+ toMs: number(),
22524
+ options: ExportOptionsSchema,
22525
+ state: ExportStateSchema,
22526
+ /** 0–100 while rendering; null otherwise. */
22527
+ progressPct: number().nullable(),
22528
+ /** File size once ready; null before. */
22529
+ fileBytes: number().nullable(),
22530
+ expiresAt: number(),
22531
+ deleteAfterDownload: boolean(),
22532
+ /** Epoch of the first complete download; null until then. */
22533
+ downloadedAt: number().nullable(),
22534
+ createdAt: number(),
22535
+ /** User id/name that requested the export. */
22536
+ createdBy: string(),
22537
+ /** Failure reason when state is 'failed'; null otherwise. */
22538
+ error: string().nullable()
22539
+ });
22540
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
22541
+ var ExportDownloadSchema = object({
22542
+ url: string(),
22543
+ endpoints: array(string())
22544
+ });
22545
+ method(object({
22546
+ deviceId: number(),
22547
+ profile: string(),
22548
+ fromMs: number(),
22549
+ toMs: number(),
22550
+ options: ExportOptionsSchema
22551
+ }), ExportRecordSchema, {
22552
+ kind: "mutation",
22553
+ auth: "protected"
22554
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
22555
+ kind: "query",
22556
+ auth: "protected"
22557
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22558
+ kind: "query",
22559
+ auth: "protected"
22560
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22561
+ kind: "mutation",
22562
+ auth: "protected"
22563
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22564
+ kind: "mutation",
22565
+ auth: "protected"
22566
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
22567
+ kind: "query",
22568
+ auth: "protected"
22569
+ });
22570
+ /**
22412
22571
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
22413
22572
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
22414
22573
  * `deviceId`.
@@ -26332,6 +26491,42 @@ Object.freeze({
26332
26491
  addonId: null,
26333
26492
  access: "create"
26334
26493
  },
26494
+ "recordingExport.cancelExport": {
26495
+ capName: "recordingExport",
26496
+ capScope: "system",
26497
+ addonId: null,
26498
+ access: "create"
26499
+ },
26500
+ "recordingExport.createExport": {
26501
+ capName: "recordingExport",
26502
+ capScope: "system",
26503
+ addonId: null,
26504
+ access: "create"
26505
+ },
26506
+ "recordingExport.deleteExport": {
26507
+ capName: "recordingExport",
26508
+ capScope: "system",
26509
+ addonId: null,
26510
+ access: "delete"
26511
+ },
26512
+ "recordingExport.getDownloadUrl": {
26513
+ capName: "recordingExport",
26514
+ capScope: "system",
26515
+ addonId: null,
26516
+ access: "view"
26517
+ },
26518
+ "recordingExport.getExport": {
26519
+ capName: "recordingExport",
26520
+ capScope: "system",
26521
+ addonId: null,
26522
+ access: "view"
26523
+ },
26524
+ "recordingExport.listExports": {
26525
+ capName: "recordingExport",
26526
+ capScope: "system",
26527
+ addonId: null,
26528
+ access: "view"
26529
+ },
26335
26530
  "sceneMonitor.captureReference": {
26336
26531
  capName: "scene-monitor",
26337
26532
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -2,7 +2,7 @@ import { createCipheriv, createDecipheriv, createHash, createHmac } from "crypto
2
2
  import { Socket } from "net";
3
3
  import { EventEmitter } from "events";
4
4
  import { createSocket } from "dgram";
5
- //#region ../types/dist/event-category-H4AVePnn.mjs
5
+ //#region ../types/dist/event-category-D4HJq7Mw.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -155,6 +155,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
155
155
  /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
156
156
  * thumb is a scrub gap the recorder's keyframe backfill covers. */
157
157
  EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
158
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
159
+ * progress bar the client reconciles via `recordingExport.getExport`. */
160
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
161
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
162
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
158
163
  EventCategory["DetectionEvent"] = "detection.event";
159
164
  EventCategory["SessionTrackNew"] = "session.track.new";
160
165
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -444,6 +449,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
444
449
  */
445
450
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
446
451
  /**
452
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
453
+ * a package zone — a newly-appeared stationary object of a package class
454
+ * that cleared the class / zone / dwell / size gates. Payload:
455
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
456
+ * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
457
+ * Telemetry (D8): the durable record is the `package-events` store row;
458
+ * this bus topic drives notifier rules + live UI. See
459
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
460
+ */
461
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
462
+ /**
463
+ * Fired by `addon-post-analysis` when a previously-delivered package
464
+ * leaves its zone (the stationary entry departed — moved or swept).
465
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
466
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
467
+ * Telemetry (D8). See package-zones-design §5.2.
468
+ */
469
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
470
+ /**
447
471
  * Fired by `addon-post-analysis` whenever a gallery face row changes:
448
472
  * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
449
473
  * `'unassigned'` its identity link changed, `'deleted'` the row was
@@ -5196,6 +5220,25 @@ function preprocess(fn, schema) {
5196
5220
  out: schema
5197
5221
  });
5198
5222
  }
5223
+ //#endregion
5224
+ //#region ../../node_modules/zod/v4/classic/compat.js
5225
+ /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
5226
+ var ZodIssueCode = {
5227
+ invalid_type: "invalid_type",
5228
+ too_big: "too_big",
5229
+ too_small: "too_small",
5230
+ invalid_format: "invalid_format",
5231
+ not_multiple_of: "not_multiple_of",
5232
+ unrecognized_keys: "unrecognized_keys",
5233
+ invalid_union: "invalid_union",
5234
+ invalid_key: "invalid_key",
5235
+ invalid_element: "invalid_element",
5236
+ invalid_value: "invalid_value",
5237
+ custom: "custom"
5238
+ };
5239
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
5240
+ var ZodFirstPartyTypeKind;
5241
+ ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5199
5242
  Object.fromEntries([
5200
5243
  {
5201
5244
  id: "overview",
@@ -14673,7 +14716,11 @@ array(ZoneRuleSchema).readonly();
14673
14716
  * Extend the enum here when a new gating consumer comes online (audio
14674
14717
  * gating, alert filtering, …) — no other surface needs to change.
14675
14718
  */
14676
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
14719
+ var ZoneRuleStageEnum = _enum([
14720
+ "motion",
14721
+ "detection",
14722
+ "package"
14723
+ ]);
14677
14724
  /**
14678
14725
  * Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
14679
14726
  * `state` getter looks up the cap definition here to construct a
@@ -14767,16 +14814,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
14767
14814
  })
14768
14815
  },
14769
14816
  /**
14770
- * Runtime-state slice — both stages mirrored together so consumers
14817
+ * Runtime-state slice — every stage mirrored together so consumers
14771
14818
  * see one reactive handle (`device.state.zoneRules.value`) instead
14772
- * of two. Bulk-replace mutations on either stage write the full
14773
- * `{motion, detection}` shape, so subscribers always get the
14819
+ * of one per stage. Bulk-replace mutations on any stage write the full
14820
+ * `{motion, detection, package}` shape, so subscribers always get the
14774
14821
  * complete current set. Consumers that only care about one stage
14775
14822
  * just read the matching property.
14823
+ *
14824
+ * `package` backs the package-drop detector — a package zone is a
14825
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
14826
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14827
+ * The orchestrator provider that writes this stage lands in a later
14828
+ * slice; until then the mirror carries only `{motion, detection}` and
14829
+ * consumers read `package` as absent (treat as `[]`).
14776
14830
  */
14777
14831
  runtimeState: object({
14778
14832
  motion: array(ZoneRuleSchema).readonly(),
14779
- detection: array(ZoneRuleSchema).readonly()
14833
+ detection: array(ZoneRuleSchema).readonly(),
14834
+ package: array(ZoneRuleSchema).readonly()
14780
14835
  })
14781
14836
  },
14782
14837
  zones: zonesCapability
@@ -18755,6 +18810,7 @@ var EventKindIconSchema = _enum([
18755
18810
  "smoke",
18756
18811
  "water",
18757
18812
  "button",
18813
+ "package",
18758
18814
  "generic"
18759
18815
  ]);
18760
18816
  var EventKindCategorySchema = _enum([
@@ -18762,7 +18818,8 @@ var EventKindCategorySchema = _enum([
18762
18818
  "audio",
18763
18819
  "detection",
18764
18820
  "sensor",
18765
- "custom"
18821
+ "custom",
18822
+ "package"
18766
18823
  ]);
18767
18824
  var EventKindDescriptorSchema = object({
18768
18825
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -22408,6 +22465,108 @@ method(object({
22408
22465
  auth: "admin"
22409
22466
  });
22410
22467
  /**
22468
+ * `recordingExport` cap — render a footage time range into a single downloadable
22469
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
22470
+ * bounded lifetime with a durable history, auto-expiry, and optional
22471
+ * delete-after-download.
22472
+ *
22473
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
22474
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
22475
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
22476
+ * input and dispatch to that single provider; the render runs on the node that
22477
+ * owns the footage (no cross-node segment transfer). Download rides the
22478
+ * framework addon data-plane. State persists in a DurableState blob (NOT
22479
+ * SQLite); history rows survive file deletion for audit.
22480
+ */
22481
+ /** Playback-speed multiplier for the render (1 = realtime). */
22482
+ var ExportSpeedSchema = number().min(.25).max(32);
22483
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
22484
+ var ExportTimelapseSchema = object({
22485
+ everyMs: number().int().positive(),
22486
+ outputFps: number().int().min(1).max(60).optional()
22487
+ });
22488
+ /**
22489
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
22490
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
22491
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
22492
+ * `deleteAfterDownload` removes it shortly after the first complete download.
22493
+ */
22494
+ var ExportOptionsSchema = object({
22495
+ speed: ExportSpeedSchema.optional(),
22496
+ timelapse: ExportTimelapseSchema.optional(),
22497
+ includeAudio: boolean(),
22498
+ maxLifeMs: number().int().positive(),
22499
+ deleteAfterDownload: boolean(),
22500
+ title: string().max(200).optional()
22501
+ }).superRefine((v, ctx) => {
22502
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
22503
+ code: ZodIssueCode.custom,
22504
+ message: "speed and timelapse are mutually exclusive",
22505
+ path: ["timelapse"]
22506
+ });
22507
+ });
22508
+ var ExportStateSchema = _enum([
22509
+ "queued",
22510
+ "rendering",
22511
+ "ready",
22512
+ "failed",
22513
+ "expired",
22514
+ "deleted"
22515
+ ]);
22516
+ /** One export job / history row. */
22517
+ var ExportRecordSchema = object({
22518
+ id: string(),
22519
+ deviceId: number(),
22520
+ profile: string(),
22521
+ fromMs: number(),
22522
+ toMs: number(),
22523
+ options: ExportOptionsSchema,
22524
+ state: ExportStateSchema,
22525
+ /** 0–100 while rendering; null otherwise. */
22526
+ progressPct: number().nullable(),
22527
+ /** File size once ready; null before. */
22528
+ fileBytes: number().nullable(),
22529
+ expiresAt: number(),
22530
+ deleteAfterDownload: boolean(),
22531
+ /** Epoch of the first complete download; null until then. */
22532
+ downloadedAt: number().nullable(),
22533
+ createdAt: number(),
22534
+ /** User id/name that requested the export. */
22535
+ createdBy: string(),
22536
+ /** Failure reason when state is 'failed'; null otherwise. */
22537
+ error: string().nullable()
22538
+ });
22539
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
22540
+ var ExportDownloadSchema = object({
22541
+ url: string(),
22542
+ endpoints: array(string())
22543
+ });
22544
+ method(object({
22545
+ deviceId: number(),
22546
+ profile: string(),
22547
+ fromMs: number(),
22548
+ toMs: number(),
22549
+ options: ExportOptionsSchema
22550
+ }), ExportRecordSchema, {
22551
+ kind: "mutation",
22552
+ auth: "protected"
22553
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
22554
+ kind: "query",
22555
+ auth: "protected"
22556
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22557
+ kind: "query",
22558
+ auth: "protected"
22559
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22560
+ kind: "mutation",
22561
+ auth: "protected"
22562
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22563
+ kind: "mutation",
22564
+ auth: "protected"
22565
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
22566
+ kind: "query",
22567
+ auth: "protected"
22568
+ });
22569
+ /**
22411
22570
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
22412
22571
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
22413
22572
  * `deviceId`.
@@ -26331,6 +26490,42 @@ Object.freeze({
26331
26490
  addonId: null,
26332
26491
  access: "create"
26333
26492
  },
26493
+ "recordingExport.cancelExport": {
26494
+ capName: "recordingExport",
26495
+ capScope: "system",
26496
+ addonId: null,
26497
+ access: "create"
26498
+ },
26499
+ "recordingExport.createExport": {
26500
+ capName: "recordingExport",
26501
+ capScope: "system",
26502
+ addonId: null,
26503
+ access: "create"
26504
+ },
26505
+ "recordingExport.deleteExport": {
26506
+ capName: "recordingExport",
26507
+ capScope: "system",
26508
+ addonId: null,
26509
+ access: "delete"
26510
+ },
26511
+ "recordingExport.getDownloadUrl": {
26512
+ capName: "recordingExport",
26513
+ capScope: "system",
26514
+ addonId: null,
26515
+ access: "view"
26516
+ },
26517
+ "recordingExport.getExport": {
26518
+ capName: "recordingExport",
26519
+ capScope: "system",
26520
+ addonId: null,
26521
+ access: "view"
26522
+ },
26523
+ "recordingExport.listExports": {
26524
+ capName: "recordingExport",
26525
+ capScope: "system",
26526
+ addonId: null,
26527
+ access: "view"
26528
+ },
26334
26529
  "sceneMonitor.captureReference": {
26335
26530
  capName: "scene-monitor",
26336
26531
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
5
5
  "keywords": [
6
6
  "camstack",