@unboundcx/sdk 4.13.173 → 4.13.174

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/services/video.js +141 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.13.173",
3
+ "version": "4.13.174",
4
4
  "description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/services/video.js CHANGED
@@ -1667,4 +1667,145 @@ export class VideoService {
1667
1667
  );
1668
1668
  return result;
1669
1669
  }
1670
+
1671
+ /**
1672
+ * List the shared boards for a meeting.
1673
+ * @param {string} roomId
1674
+ * @returns {Promise<{boards: Array}>}
1675
+ */
1676
+ async listBoards(roomId) {
1677
+ this.sdk.validateParams(
1678
+ { roomId },
1679
+ { roomId: { type: 'string', required: true } },
1680
+ );
1681
+ return internalRequest(this.sdk, `/video/${roomId}/boards`, 'GET');
1682
+ }
1683
+
1684
+ /**
1685
+ * Create a board in a meeting. The first board is also created on demand
1686
+ * when the board is opened.
1687
+ * @param {string} roomId
1688
+ * @param {{name?: string}} [body]
1689
+ */
1690
+ async createBoard(roomId, body = {}) {
1691
+ this.sdk.validateParams(
1692
+ { roomId },
1693
+ { roomId: { type: 'string', required: true } },
1694
+ );
1695
+ return internalRequest(this.sdk, `/video/${roomId}/boards`, 'POST', {
1696
+ body,
1697
+ });
1698
+ }
1699
+
1700
+ /**
1701
+ * Current board document. Pass afterSeq to take the ops since a snapshot.
1702
+ * @param {string} roomId
1703
+ * @param {string} boardId
1704
+ * @param {{afterSeq?: number}} [options]
1705
+ */
1706
+ async getBoardState(roomId, boardId, options = {}) {
1707
+ this.sdk.validateParams(
1708
+ { roomId, boardId },
1709
+ {
1710
+ roomId: { type: 'string', required: true },
1711
+ boardId: { type: 'string', required: true },
1712
+ },
1713
+ );
1714
+ const query = {};
1715
+ if (options.afterSeq != null) query.afterSeq = options.afterSeq;
1716
+ return internalRequest(
1717
+ this.sdk,
1718
+ `/video/${roomId}/boards/${boardId}`,
1719
+ 'GET',
1720
+ { query },
1721
+ );
1722
+ }
1723
+
1724
+ /**
1725
+ * Append one board op (stroke, object, undo, lock, video transport).
1726
+ * @param {string} roomId
1727
+ * @param {string} boardId
1728
+ * @param {{clientOpId: string, opType: string, payload: object}} op
1729
+ */
1730
+ async postBoardOp(roomId, boardId, op) {
1731
+ this.sdk.validateParams(
1732
+ { roomId, boardId, clientOpId: op?.clientOpId, opType: op?.opType },
1733
+ {
1734
+ roomId: { type: 'string', required: true },
1735
+ boardId: { type: 'string', required: true },
1736
+ clientOpId: { type: 'string', required: true },
1737
+ opType: { type: 'string', required: true },
1738
+ },
1739
+ );
1740
+ return internalRequest(
1741
+ this.sdk,
1742
+ `/video/${roomId}/boards/${boardId}/ops`,
1743
+ 'POST',
1744
+ { body: op },
1745
+ );
1746
+ }
1747
+
1748
+ /**
1749
+ * Short code another screen types to become this person's board.
1750
+ * @param {string} roomId
1751
+ * @returns {Promise<{code: string, expiresAt: string}>}
1752
+ */
1753
+ async createBoardLink(roomId) {
1754
+ this.sdk.validateParams(
1755
+ { roomId },
1756
+ { roomId: { type: 'string', required: true } },
1757
+ );
1758
+ return internalRequest(this.sdk, `/video/${roomId}/board-link`, 'POST', {
1759
+ body: {},
1760
+ });
1761
+ }
1762
+
1763
+ /**
1764
+ * Claim a link code from the room screen.
1765
+ * @param {string} code
1766
+ */
1767
+ async redeemBoardLink(code) {
1768
+ this.sdk.validateParams(
1769
+ { code },
1770
+ { code: { type: 'string', required: true } },
1771
+ );
1772
+ return internalRequest(this.sdk, '/video/board-link/redeem', 'POST', {
1773
+ body: { code },
1774
+ });
1775
+ }
1776
+
1777
+ /**
1778
+ * Ask everyone to switch stage, or move them once.
1779
+ * @param {string} roomId
1780
+ * @param {{action: 'ask'|'force', target: {type: string, id?: string, name?: string}}} body
1781
+ */
1782
+ async postBoardStage(roomId, body) {
1783
+ this.sdk.validateParams(
1784
+ { roomId, action: body?.action },
1785
+ {
1786
+ roomId: { type: 'string', required: true },
1787
+ action: { type: 'string', required: true },
1788
+ },
1789
+ );
1790
+ return internalRequest(this.sdk, `/video/${roomId}/board-stage`, 'POST', {
1791
+ body,
1792
+ });
1793
+ }
1794
+
1795
+ /**
1796
+ * Name this always-on room screen.
1797
+ * @param {{name: string}} body
1798
+ */
1799
+ async createMeetRoom(body) {
1800
+ this.sdk.validateParams(
1801
+ { name: body?.name },
1802
+ { name: { type: 'string', required: true } },
1803
+ );
1804
+ return internalRequest(this.sdk, '/video/meet-rooms', 'POST', { body });
1805
+ }
1806
+
1807
+ /** @returns {Promise<{rooms: Array}>} */
1808
+ async listMeetRooms() {
1809
+ return internalRequest(this.sdk, '/video/meet-rooms', 'GET');
1810
+ }
1670
1811
  }