@camstack/types 1.2.122 → 1.2.123

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.
@@ -69,6 +69,33 @@ export declare const intercomCapability: {
69
69
  readonly deviceNative: true;
70
70
  readonly mode: "singleton";
71
71
  readonly deviceTypes: readonly [DeviceType.Camera];
72
+ /**
73
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
74
+ *
75
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
76
+ * cap has no configuration surface at all: all six methods open, feed and
77
+ * close one live audio session against one `deviceId`. That is the same
78
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
79
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
80
+ * `admin` because they change what the device IS.
81
+ *
82
+ * `protected` does not mean ungated: `protectedProcedure` runs the
83
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
84
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
85
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
86
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
87
+ * camera 7.
88
+ *
89
+ * Every method was `auth: 'admin'` from the initial commit, which made the
90
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
91
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
92
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
93
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
94
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
95
+ * snapshots" since that same commit; the promise could not be kept. Recorded
96
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
97
+ * preset promises a cap no row of that preset can reach.
98
+ */
72
99
  readonly methods: {
73
100
  /**
74
101
  * Open a server-side WebRTC audio-only session. Returns an SDP
package/dist/index.js CHANGED
@@ -26657,6 +26657,33 @@ var intercomCapability = {
26657
26657
  deviceNative: true,
26658
26658
  mode: "singleton",
26659
26659
  deviceTypes: [require_sleep.DeviceType.Camera],
26660
+ /**
26661
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
26662
+ *
26663
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
26664
+ * cap has no configuration surface at all: all six methods open, feed and
26665
+ * close one live audio session against one `deviceId`. That is the same
26666
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
26667
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
26668
+ * `admin` because they change what the device IS.
26669
+ *
26670
+ * `protected` does not mean ungated: `protectedProcedure` runs the
26671
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
26672
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
26673
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
26674
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
26675
+ * camera 7.
26676
+ *
26677
+ * Every method was `auth: 'admin'` from the initial commit, which made the
26678
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
26679
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
26680
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
26681
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
26682
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
26683
+ * snapshots" since that same commit; the promise could not be kept. Recorded
26684
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
26685
+ * preset promises a cap no row of that preset can reach.
26686
+ */
26660
26687
  methods: {
26661
26688
  /**
26662
26689
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -26669,7 +26696,7 @@ var intercomCapability = {
26669
26696
  sdpOffer: zod.z.string()
26670
26697
  }), {
26671
26698
  kind: "mutation",
26672
- auth: "admin"
26699
+ auth: "protected"
26673
26700
  }),
26674
26701
  handleAnswer: require_sleep.method(zod.z.object({
26675
26702
  deviceId: zod.z.number(),
@@ -26677,7 +26704,7 @@ var intercomCapability = {
26677
26704
  sdpAnswer: zod.z.string()
26678
26705
  }), zod.z.void(), {
26679
26706
  kind: "mutation",
26680
- auth: "admin"
26707
+ auth: "protected"
26681
26708
  }),
26682
26709
  /** Close explicitly. Server also auto-closes on 30s idle. */
26683
26710
  stopSession: require_sleep.method(zod.z.object({
@@ -26685,7 +26712,7 @@ var intercomCapability = {
26685
26712
  sessionId: zod.z.string()
26686
26713
  }), zod.z.void(), {
26687
26714
  kind: "mutation",
26688
- auth: "admin"
26715
+ auth: "protected"
26689
26716
  }),
26690
26717
  /**
26691
26718
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -26698,7 +26725,7 @@ var intercomCapability = {
26698
26725
  */
26699
26726
  startTalkSession: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.object({ sessionId: zod.z.string() }), {
26700
26727
  kind: "mutation",
26701
- auth: "admin"
26728
+ auth: "protected"
26702
26729
  }),
26703
26730
  /**
26704
26731
  * Push one chunk of talk-back audio onto the active talk session.
@@ -26733,12 +26760,12 @@ var intercomCapability = {
26733
26760
  sequenceNumber: zod.z.number().int()
26734
26761
  }), zod.z.object({ accepted: zod.z.boolean() }), {
26735
26762
  kind: "mutation",
26736
- auth: "admin"
26763
+ auth: "protected"
26737
26764
  }),
26738
26765
  /** Close the raw-PCM talk session. Idempotent. */
26739
26766
  endTalkSession: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), {
26740
26767
  kind: "mutation",
26741
- auth: "admin"
26768
+ auth: "protected"
26742
26769
  })
26743
26770
  },
26744
26771
  events: { onStatusChanged: { data: zod.z.object({
@@ -45954,7 +45981,7 @@ var SCOPE_PRESETS = [
45954
45981
  {
45955
45982
  id: "camera-operator",
45956
45983
  label: "Camera operator",
45957
- description: "Everything `camera-viewer` does plus PTZ control, intercom, snapshots and recording start/stop. Cannot delete devices or recordings.",
45984
+ description: "Everything `camera-viewer` does plus live control of every granted camera — PTZ movement, intercom talk-back and on-demand snapshots. Cannot delete devices, and grants nothing on system-scope caps (recording control, users, addons).",
45958
45985
  rows: [{
45959
45986
  type: "category",
45960
45987
  target: "device",
package/dist/index.mjs CHANGED
@@ -26656,6 +26656,33 @@ var intercomCapability = {
26656
26656
  deviceNative: true,
26657
26657
  mode: "singleton",
26658
26658
  deviceTypes: [DeviceType.Camera],
26659
+ /**
26660
+ * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
26661
+ *
26662
+ * Talking through a camera is an OPERATE action, not a CONFIGURE one. This
26663
+ * cap has no configuration surface at all: all six methods open, feed and
26664
+ * close one live audio session against one `deviceId`. That is the same
26665
+ * authority as `ptz.move` or `snapshot.getSnapshot`, both `protected` — and
26666
+ * the opposite of `ptz.savePreset` / `snapshot.invalidateCache`, which are
26667
+ * `admin` because they change what the device IS.
26668
+ *
26669
+ * `protected` does not mean ungated: `protectedProcedure` runs the
26670
+ * `METHOD_ACCESS_MAP` scope check, and every method here is `scope: 'device'`
26671
+ * with `access: 'create'` and a `deviceId` in its input. So a caller needs a
26672
+ * grant that covers THAT camera at `create` — a `camera-viewer` (`view`
26673
+ * only) still cannot talk, and a grant on camera 5 cannot talk through
26674
+ * camera 7.
26675
+ *
26676
+ * Every method was `auth: 'admin'` from the initial commit, which made the
26677
+ * cap unreachable by every non-admin principal — `adminProcedure` throws
26678
+ * `FORBIDDEN: Admin required` BEFORE the scope check runs, so the scope
26679
+ * machinery generated for this cap (`METHOD_ACCESS_MAP`,
26680
+ * `DEVICE_SCOPED_CAPS`, `METHOD_DEVICE_SELECTORS`) was complete and dead. The
26681
+ * `camera-operator` scope preset has promised "PTZ control, intercom,
26682
+ * snapshots" since that same commit; the promise could not be kept. Recorded
26683
+ * as D289; `scripts/check-scope-preset-promises.ts` now fails the build if a
26684
+ * preset promises a cap no row of that preset can reach.
26685
+ */
26659
26686
  methods: {
26660
26687
  /**
26661
26688
  * Open a server-side WebRTC audio-only session. Returns an SDP
@@ -26668,7 +26695,7 @@ var intercomCapability = {
26668
26695
  sdpOffer: z.string()
26669
26696
  }), {
26670
26697
  kind: "mutation",
26671
- auth: "admin"
26698
+ auth: "protected"
26672
26699
  }),
26673
26700
  handleAnswer: method(z.object({
26674
26701
  deviceId: z.number(),
@@ -26676,7 +26703,7 @@ var intercomCapability = {
26676
26703
  sdpAnswer: z.string()
26677
26704
  }), z.void(), {
26678
26705
  kind: "mutation",
26679
- auth: "admin"
26706
+ auth: "protected"
26680
26707
  }),
26681
26708
  /** Close explicitly. Server also auto-closes on 30s idle. */
26682
26709
  stopSession: method(z.object({
@@ -26684,7 +26711,7 @@ var intercomCapability = {
26684
26711
  sessionId: z.string()
26685
26712
  }), z.void(), {
26686
26713
  kind: "mutation",
26687
- auth: "admin"
26714
+ auth: "protected"
26688
26715
  }),
26689
26716
  /**
26690
26717
  * Open a raw-PCM talk session (no WebRTC SDP plumbing). Used by
@@ -26697,7 +26724,7 @@ var intercomCapability = {
26697
26724
  */
26698
26725
  startTalkSession: method(z.object({ deviceId: z.number() }), z.object({ sessionId: z.string() }), {
26699
26726
  kind: "mutation",
26700
- auth: "admin"
26727
+ auth: "protected"
26701
26728
  }),
26702
26729
  /**
26703
26730
  * Push one chunk of talk-back audio onto the active talk session.
@@ -26732,12 +26759,12 @@ var intercomCapability = {
26732
26759
  sequenceNumber: z.number().int()
26733
26760
  }), z.object({ accepted: z.boolean() }), {
26734
26761
  kind: "mutation",
26735
- auth: "admin"
26762
+ auth: "protected"
26736
26763
  }),
26737
26764
  /** Close the raw-PCM talk session. Idempotent. */
26738
26765
  endTalkSession: method(z.object({ deviceId: z.number() }), z.void(), {
26739
26766
  kind: "mutation",
26740
- auth: "admin"
26767
+ auth: "protected"
26741
26768
  })
26742
26769
  },
26743
26770
  events: { onStatusChanged: { data: z.object({
@@ -45946,7 +45973,7 @@ var SCOPE_PRESETS = [
45946
45973
  {
45947
45974
  id: "camera-operator",
45948
45975
  label: "Camera operator",
45949
- description: "Everything `camera-viewer` does plus PTZ control, intercom, snapshots and recording start/stop. Cannot delete devices or recordings.",
45976
+ description: "Everything `camera-viewer` does plus live control of every granted camera — PTZ movement, intercom talk-back and on-demand snapshots. Cannot delete devices, and grants nothing on system-scope caps (recording control, users, addons).",
45950
45977
  rows: [{
45951
45978
  type: "category",
45952
45979
  target: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.122",
3
+ "version": "1.2.123",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",