@unboundcx/sdk 4.13.173 → 4.13.175
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/package.json +1 -1
- package/services/video.js +142 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.175",
|
|
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,146 @@ 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, full?: boolean}} [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
|
+
if (options.full) query.full = '1';
|
|
1717
|
+
return internalRequest(
|
|
1718
|
+
this.sdk,
|
|
1719
|
+
`/video/${roomId}/boards/${boardId}`,
|
|
1720
|
+
'GET',
|
|
1721
|
+
{ query },
|
|
1722
|
+
);
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* Append one board op (stroke, object, undo, lock, video transport).
|
|
1727
|
+
* @param {string} roomId
|
|
1728
|
+
* @param {string} boardId
|
|
1729
|
+
* @param {{clientOpId: string, opType: string, payload: object}} op
|
|
1730
|
+
*/
|
|
1731
|
+
async postBoardOp(roomId, boardId, op) {
|
|
1732
|
+
this.sdk.validateParams(
|
|
1733
|
+
{ roomId, boardId, clientOpId: op?.clientOpId, opType: op?.opType },
|
|
1734
|
+
{
|
|
1735
|
+
roomId: { type: 'string', required: true },
|
|
1736
|
+
boardId: { type: 'string', required: true },
|
|
1737
|
+
clientOpId: { type: 'string', required: true },
|
|
1738
|
+
opType: { type: 'string', required: true },
|
|
1739
|
+
},
|
|
1740
|
+
);
|
|
1741
|
+
return internalRequest(
|
|
1742
|
+
this.sdk,
|
|
1743
|
+
`/video/${roomId}/boards/${boardId}/ops`,
|
|
1744
|
+
'POST',
|
|
1745
|
+
{ body: op },
|
|
1746
|
+
);
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
/**
|
|
1750
|
+
* Short code another screen types to become this person's board.
|
|
1751
|
+
* @param {string} roomId
|
|
1752
|
+
* @returns {Promise<{code: string, expiresAt: string}>}
|
|
1753
|
+
*/
|
|
1754
|
+
async createBoardLink(roomId) {
|
|
1755
|
+
this.sdk.validateParams(
|
|
1756
|
+
{ roomId },
|
|
1757
|
+
{ roomId: { type: 'string', required: true } },
|
|
1758
|
+
);
|
|
1759
|
+
return internalRequest(this.sdk, `/video/${roomId}/board-link`, 'POST', {
|
|
1760
|
+
body: {},
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
/**
|
|
1765
|
+
* Claim a link code from the room screen.
|
|
1766
|
+
* @param {string} code
|
|
1767
|
+
*/
|
|
1768
|
+
async redeemBoardLink(code) {
|
|
1769
|
+
this.sdk.validateParams(
|
|
1770
|
+
{ code },
|
|
1771
|
+
{ code: { type: 'string', required: true } },
|
|
1772
|
+
);
|
|
1773
|
+
return internalRequest(this.sdk, '/video/board-link/redeem', 'POST', {
|
|
1774
|
+
body: { code },
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* Ask everyone to switch stage, or move them once.
|
|
1780
|
+
* @param {string} roomId
|
|
1781
|
+
* @param {{action: 'ask'|'force', target: {type: string, id?: string, name?: string}}} body
|
|
1782
|
+
*/
|
|
1783
|
+
async postBoardStage(roomId, body) {
|
|
1784
|
+
this.sdk.validateParams(
|
|
1785
|
+
{ roomId, action: body?.action },
|
|
1786
|
+
{
|
|
1787
|
+
roomId: { type: 'string', required: true },
|
|
1788
|
+
action: { type: 'string', required: true },
|
|
1789
|
+
},
|
|
1790
|
+
);
|
|
1791
|
+
return internalRequest(this.sdk, `/video/${roomId}/board-stage`, 'POST', {
|
|
1792
|
+
body,
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
/**
|
|
1797
|
+
* Name this always-on room screen.
|
|
1798
|
+
* @param {{name: string}} body
|
|
1799
|
+
*/
|
|
1800
|
+
async createMeetRoom(body) {
|
|
1801
|
+
this.sdk.validateParams(
|
|
1802
|
+
{ name: body?.name },
|
|
1803
|
+
{ name: { type: 'string', required: true } },
|
|
1804
|
+
);
|
|
1805
|
+
return internalRequest(this.sdk, '/video/meet-rooms', 'POST', { body });
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
/** @returns {Promise<{rooms: Array}>} */
|
|
1809
|
+
async listMeetRooms() {
|
|
1810
|
+
return internalRequest(this.sdk, '/video/meet-rooms', 'GET');
|
|
1811
|
+
}
|
|
1670
1812
|
}
|