@camstack/addon-provider-tuya 0.2.41 → 0.2.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/addon.js CHANGED
@@ -25787,6 +25787,33 @@ var intercomCapability = {
25787
25787
  deviceNative: true,
25788
25788
  mode: "singleton",
25789
25789
  deviceTypes: [DeviceType.Camera],
25790
+ /**
25791
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25792
+ *
25793
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25794
+ * cap has no configuration surface at all: all six methods open, feed and
25795
+ * close one live audio session against one `deviceId`. That is the same
25796
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25797
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25798
+ * `admin` because they change what the device IS.
25799
+ *
25800
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25801
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25802
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25803
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25804
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25805
+ * camera 7.
25806
+ *
25807
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25808
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25809
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25810
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25811
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25812
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25813
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25814
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25815
+ * preset promises a cap no row of that preset can reach.
25816
+ */
25790
25817
  methods: {
25791
25818
  /**
25792
25819
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -25799,7 +25826,7 @@ var intercomCapability = {
25799
25826
  sdpOffer: string()
25800
25827
  }), {
25801
25828
  kind: "mutation",
25802
- auth: "admin"
25829
+ auth: "protected"
25803
25830
  }),
25804
25831
  handleAnswer: method(object({
25805
25832
  deviceId: number(),
@@ -25807,7 +25834,7 @@ var intercomCapability = {
25807
25834
  sdpAnswer: string()
25808
25835
  }), _void(), {
25809
25836
  kind: "mutation",
25810
- auth: "admin"
25837
+ auth: "protected"
25811
25838
  }),
25812
25839
  /** Close explicitly. Server also auto-closes on 30s idle. */
25813
25840
  stopSession: method(object({
@@ -25815,7 +25842,7 @@ var intercomCapability = {
25815
25842
  sessionId: string()
25816
25843
  }), _void(), {
25817
25844
  kind: "mutation",
25818
- auth: "admin"
25845
+ auth: "protected"
25819
25846
  }),
25820
25847
  /**
25821
25848
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25828,7 +25855,7 @@ var intercomCapability = {
25828
25855
  */
25829
25856
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25830
25857
  kind: "mutation",
25831
- auth: "admin"
25858
+ auth: "protected"
25832
25859
  }),
25833
25860
  /**
25834
25861
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25863,12 +25890,12 @@ var intercomCapability = {
25863
25890
  sequenceNumber: number().int()
25864
25891
  }), object({ accepted: boolean() }), {
25865
25892
  kind: "mutation",
25866
- auth: "admin"
25893
+ auth: "protected"
25867
25894
  }),
25868
25895
  /** Close the raw-PCM talk session. Idempotent. */
25869
25896
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25870
25897
  kind: "mutation",
25871
- auth: "admin"
25898
+ auth: "protected"
25872
25899
  })
25873
25900
  },
25874
25901
  events: { onStatusChanged: { data: object({
package/dist/addon.mjs CHANGED
@@ -25786,6 +25786,33 @@ var intercomCapability = {
25786
25786
  deviceNative: true,
25787
25787
  mode: "singleton",
25788
25788
  deviceTypes: [DeviceType.Camera],
25789
+ /**
25790
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
25791
+ *
25792
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
25793
+ * cap has no configuration surface at all: all six methods open, feed and
25794
+ * close one live audio session against one `deviceId`. That is the same
25795
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
25796
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
25797
+ * `admin` because they change what the device IS.
25798
+ *
25799
+ * `protected` does not mean ungated: `protectedProcedure` runs the
25800
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
25801
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
25802
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
25803
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
25804
+ * camera 7.
25805
+ *
25806
+ * Every method was `auth: 'admin'` from the initial commit, which made the
25807
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
25808
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
25809
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
25810
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
25811
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
25812
+ * snapshots" since that same commit; the promise could not be kept. Recorded
25813
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
25814
+ * preset promises a cap no row of that preset can reach.
25815
+ */
25789
25816
  methods: {
25790
25817
  /**
25791
25818
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -25798,7 +25825,7 @@ var intercomCapability = {
25798
25825
  sdpOffer: string()
25799
25826
  }), {
25800
25827
  kind: "mutation",
25801
- auth: "admin"
25828
+ auth: "protected"
25802
25829
  }),
25803
25830
  handleAnswer: method(object({
25804
25831
  deviceId: number(),
@@ -25806,7 +25833,7 @@ var intercomCapability = {
25806
25833
  sdpAnswer: string()
25807
25834
  }), _void(), {
25808
25835
  kind: "mutation",
25809
- auth: "admin"
25836
+ auth: "protected"
25810
25837
  }),
25811
25838
  /** Close explicitly. Server also auto-closes on 30s idle. */
25812
25839
  stopSession: method(object({
@@ -25814,7 +25841,7 @@ var intercomCapability = {
25814
25841
  sessionId: string()
25815
25842
  }), _void(), {
25816
25843
  kind: "mutation",
25817
- auth: "admin"
25844
+ auth: "protected"
25818
25845
  }),
25819
25846
  /**
25820
25847
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -25827,7 +25854,7 @@ var intercomCapability = {
25827
25854
  */
25828
25855
  startTalkSession: method(object({ deviceId: number() }), object({ sessionId: string() }), {
25829
25856
  kind: "mutation",
25830
- auth: "admin"
25857
+ auth: "protected"
25831
25858
  }),
25832
25859
  /**
25833
25860
  * Push one chunk of talk-back audio onto the active talk session.
@@ -25862,12 +25889,12 @@ var intercomCapability = {
25862
25889
  sequenceNumber: number().int()
25863
25890
  }), object({ accepted: boolean() }), {
25864
25891
  kind: "mutation",
25865
- auth: "admin"
25892
+ auth: "protected"
25866
25893
  }),
25867
25894
  /** Close the raw-PCM talk session. Idempotent. */
25868
25895
  endTalkSession: method(object({ deviceId: number() }), _void(), {
25869
25896
  kind: "mutation",
25870
- auth: "admin"
25897
+ auth: "protected"
25871
25898
  })
25872
25899
  },
25873
25900
  events: { onStatusChanged: { data: object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.41",
3
+ "version": "0.2.42",
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",