@camstack/addon-provider-homeassistant 1.2.54 → 1.2.55

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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("./dist-D24orV6m.js");
2
+ const require_dist = require("./dist-Dt7YuyK3.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-BfdeH6US.mjs";
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-BpQG6lq7.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
@@ -25419,6 +25419,33 @@ var intercomCapability = {
25419
25419
  deviceNative: true,
25420
25420
  mode: "singleton",
25421
25421
  deviceTypes: [DeviceType.Camera],
25422
+ /**
25423
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25424
+ *
25425
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25426
+ * cap has no configuration surface at all: all six methods open, feed and
25427
+ * close one live audio session against one `deviceId`. That is the same
25428
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25429
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25430
+ * `admin` because they change what the device IS.
25431
+ *
25432
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25433
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25434
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25435
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25436
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25437
+ * camera 7.
25438
+ *
25439
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25440
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25441
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25442
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25443
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25444
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25445
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25446
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25447
+ * preset promises a cap no row of that preset can reach.
25448
+ */
25422
25449
  methods: {
25423
25450
  /**
25424
25451
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -25431,7 +25458,7 @@ var intercomCapability = {
25431
25458
  sdpOffer: string()
25432
25459
  }), {
25433
25460
  kind: "mutation",
25434
- auth: "admin"
25461
+ auth: "protected"
25435
25462
  }),
25436
25463
  handleAnswer: method(object({
25437
25464
  deviceId: number(),
@@ -25439,7 +25466,7 @@ var intercomCapability = {
25439
25466
  sdpAnswer: string()
25440
25467
  }), _void(), {
25441
25468
  kind: "mutation",
25442
- auth: "admin"
25469
+ auth: "protected"
25443
25470
  }),
25444
25471
  /** Close explicitly. Server also auto-closes on 30s idle. */
25445
25472
  stopSession: method(object({
@@ -25447,7 +25474,7 @@ var intercomCapability = {
25447
25474
  sessionId: string()
25448
25475
  }), _void(), {
25449
25476
  kind: "mutation",
25450
- auth: "admin"
25477
+ auth: "protected"
25451
25478
  }),
25452
25479
  /**
25453
25480
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25460,7 +25487,7 @@ var intercomCapability = {
25460
25487
  */
25461
25488
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25462
25489
  kind: "mutation",
25463
- auth: "admin"
25490
+ auth: "protected"
25464
25491
  }),
25465
25492
  /**
25466
25493
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25495,12 +25522,12 @@ var intercomCapability = {
25495
25522
  sequenceNumber: number().int()
25496
25523
  }), object({ accepted: boolean() }), {
25497
25524
  kind: "mutation",
25498
- auth: "admin"
25525
+ auth: "protected"
25499
25526
  }),
25500
25527
  /** Close the raw-PCM talk session. Idempotent. */
25501
25528
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25502
25529
  kind: "mutation",
25503
- auth: "admin"
25530
+ auth: "protected"
25504
25531
  })
25505
25532
  },
25506
25533
  events: { onStatusChanged: { data: object({
@@ -25419,6 +25419,33 @@ var intercomCapability = {
25419
25419
  deviceNative: true,
25420
25420
  mode: "singleton",
25421
25421
  deviceTypes: [DeviceType.Camera],
25422
+ /**
25423
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25424
+ *
25425
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25426
+ * cap has no configuration surface at all: all six methods open, feed and
25427
+ * close one live audio session against one `deviceId`. That is the same
25428
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25429
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25430
+ * `admin` because they change what the device IS.
25431
+ *
25432
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25433
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25434
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25435
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25436
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25437
+ * camera 7.
25438
+ *
25439
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25440
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25441
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25442
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25443
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25444
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25445
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25446
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25447
+ * preset promises a cap no row of that preset can reach.
25448
+ */
25422
25449
  methods: {
25423
25450
  /**
25424
25451
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -25431,7 +25458,7 @@ var intercomCapability = {
25431
25458
  sdpOffer: string()
25432
25459
  }), {
25433
25460
  kind: "mutation",
25434
- auth: "admin"
25461
+ auth: "protected"
25435
25462
  }),
25436
25463
  handleAnswer: method(object({
25437
25464
  deviceId: number(),
@@ -25439,7 +25466,7 @@ var intercomCapability = {
25439
25466
  sdpAnswer: string()
25440
25467
  }), _void(), {
25441
25468
  kind: "mutation",
25442
- auth: "admin"
25469
+ auth: "protected"
25443
25470
  }),
25444
25471
  /** Close explicitly. Server also auto-closes on 30s idle. */
25445
25472
  stopSession: method(object({
@@ -25447,7 +25474,7 @@ var intercomCapability = {
25447
25474
  sessionId: string()
25448
25475
  }), _void(), {
25449
25476
  kind: "mutation",
25450
- auth: "admin"
25477
+ auth: "protected"
25451
25478
  }),
25452
25479
  /**
25453
25480
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25460,7 +25487,7 @@ var intercomCapability = {
25460
25487
  */
25461
25488
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25462
25489
  kind: "mutation",
25463
- auth: "admin"
25490
+ auth: "protected"
25464
25491
  }),
25465
25492
  /**
25466
25493
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25495,12 +25522,12 @@ var intercomCapability = {
25495
25522
  sequenceNumber: number().int()
25496
25523
  }), object({ accepted: boolean() }), {
25497
25524
  kind: "mutation",
25498
- auth: "admin"
25525
+ auth: "protected"
25499
25526
  }),
25500
25527
  /** Close the raw-PCM talk session. Idempotent. */
25501
25528
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25502
25529
  kind: "mutation",
25503
- auth: "admin"
25530
+ auth: "protected"
25504
25531
  })
25505
25532
  },
25506
25533
  events: { onStatusChanged: { data: object({
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#endregion
6
- const require_dist = require("../dist-D24orV6m.js");
6
+ const require_dist = require("../dist-Dt7YuyK3.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-BfdeH6US.mjs";
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-BpQG6lq7.mjs";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  //#region src/ha-export/topics.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.2.54",
3
+ "version": "1.2.55",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",