@wave-av/sdk 2.0.0 → 2.0.2
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/CHANGELOG.md +1 -1
- package/README.md +27 -23
- package/dist/audience.js +93 -0
- package/dist/audience.mjs +9 -0
- package/dist/camera-control.js +95 -0
- package/dist/camera-control.mjs +71 -0
- package/dist/captions-types.js +18 -0
- package/dist/captions-types.mjs +0 -0
- package/dist/captions.js +266 -0
- package/dist/captions.mjs +9 -0
- package/dist/chapters-types.js +18 -0
- package/dist/chapters-types.mjs +0 -0
- package/dist/chapters.js +280 -0
- package/dist/chapters.mjs +9 -0
- package/dist/chunk-362MRITF.mjs +46 -0
- package/dist/chunk-3ZLK4J3V.mjs +69 -0
- package/dist/chunk-4DG4OBRD.mjs +52 -0
- package/dist/chunk-4G7FMCMJ.mjs +68 -0
- package/dist/chunk-4KD5F6E3.mjs +0 -0
- package/dist/chunk-7M6XVUUK.mjs +241 -0
- package/dist/chunk-A344OOT7.mjs +243 -0
- package/dist/chunk-AI64YR5W.mjs +173 -0
- package/dist/chunk-C2GQ756E.mjs +57 -0
- package/dist/chunk-CO2VB72Z.mjs +255 -0
- package/dist/chunk-DWXWAILB.mjs +44 -0
- package/dist/chunk-FLEFYLDM.mjs +71 -0
- package/dist/chunk-H2YYTNUH.mjs +266 -0
- package/dist/chunk-IGDBED5P.mjs +246 -0
- package/dist/chunk-IL2SGWBC.mjs +0 -0
- package/dist/chunk-IVFZ5X4W.mjs +68 -0
- package/dist/chunk-JC32PG3T.mjs +114 -0
- package/dist/chunk-K5X42NLD.mjs +54 -0
- package/dist/chunk-KCEPNS2U.mjs +276 -0
- package/dist/chunk-LVOVF6XC.mjs +54 -0
- package/dist/chunk-M4Z33V3N.mjs +247 -0
- package/dist/chunk-M6FKIX75.mjs +0 -0
- package/dist/chunk-M744Z327.mjs +244 -0
- package/dist/chunk-MRFDPPFK.mjs +61 -0
- package/dist/chunk-MXU3Q23F.mjs +68 -0
- package/dist/chunk-NCVUZ746.mjs +60 -0
- package/dist/chunk-NLQVD2LF.mjs +210 -0
- package/dist/chunk-O6DOGYP5.mjs +238 -0
- package/dist/chunk-S25NY5GE.mjs +124 -0
- package/dist/chunk-TFHXBICQ.mjs +305 -0
- package/dist/chunk-TXWOA2VR.mjs +57 -0
- package/dist/chunk-UCDSNV22.mjs +63 -0
- package/dist/chunk-V5DWA5P4.mjs +279 -0
- package/dist/chunk-VLQQDYGP.mjs +173 -0
- package/dist/chunk-VPKZUXZW.mjs +53 -0
- package/dist/chunk-WS3PEFYJ.mjs +60 -0
- package/dist/chunk-XGAYMWRH.mjs +74 -0
- package/dist/chunk-XMM5J57W.mjs +0 -0
- package/dist/chunk-XWABBOSX.mjs +278 -0
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/chunk-YBLXHI3M.mjs +257 -0
- package/dist/chunk-YEK26SSO.mjs +100 -0
- package/dist/chunk-YLCQKCZL.mjs +0 -0
- package/dist/chunk-YRKO4XI7.mjs +0 -0
- package/dist/chunk-ZJO7AP4Q.mjs +0 -0
- package/dist/client-types.js +18 -0
- package/dist/client-types.mjs +0 -0
- package/dist/client.js +311 -0
- package/dist/client.mjs +14 -0
- package/dist/clips-types.js +18 -0
- package/dist/clips-types.mjs +0 -0
- package/dist/clips.js +198 -0
- package/dist/clips.mjs +9 -0
- package/dist/cloud-switcher.js +80 -0
- package/dist/cloud-switcher.mjs +56 -0
- package/dist/collab-types.js +18 -0
- package/dist/collab-types.mjs +1 -0
- package/dist/collab.js +304 -0
- package/dist/collab.mjs +10 -0
- package/dist/connect.js +85 -0
- package/dist/connect.mjs +9 -0
- package/dist/creator.js +79 -0
- package/dist/creator.mjs +9 -0
- package/dist/desktop.js +77 -0
- package/dist/desktop.mjs +9 -0
- package/dist/distribution.js +88 -0
- package/dist/distribution.mjs +9 -0
- package/dist/drm.js +85 -0
- package/dist/drm.mjs +9 -0
- package/dist/edge.js +93 -0
- package/dist/edge.mjs +9 -0
- package/dist/editor-types.js +18 -0
- package/dist/editor-types.mjs +1 -0
- package/dist/editor.js +330 -0
- package/dist/editor.mjs +10 -0
- package/dist/fleet.js +149 -0
- package/dist/fleet.mjs +9 -0
- package/dist/ghost.js +139 -0
- package/dist/ghost.mjs +9 -0
- package/dist/index.js +0 -250
- package/dist/index.mjs +161 -5445
- package/dist/marketplace.js +82 -0
- package/dist/marketplace.mjs +9 -0
- package/dist/mesh.js +198 -0
- package/dist/mesh.mjs +9 -0
- package/dist/notifications.js +79 -0
- package/dist/notifications.mjs +9 -0
- package/dist/phone-types.js +18 -0
- package/dist/phone-types.mjs +0 -0
- package/dist/phone.js +269 -0
- package/dist/phone.mjs +9 -0
- package/dist/pipeline-types.js +18 -0
- package/dist/pipeline-types.mjs +0 -0
- package/dist/pipeline.js +263 -0
- package/dist/pipeline.mjs +9 -0
- package/dist/podcast.js +94 -0
- package/dist/podcast.mjs +9 -0
- package/dist/prism.js +82 -0
- package/dist/prism.mjs +9 -0
- package/dist/prompter.js +99 -0
- package/dist/prompter.mjs +76 -0
- package/dist/pulse.js +99 -0
- package/dist/pulse.mjs +9 -0
- package/dist/qr.js +71 -0
- package/dist/qr.mjs +9 -0
- package/dist/replay.js +62 -0
- package/dist/replay.mjs +38 -0
- package/dist/scene-types.js +18 -0
- package/dist/scene-types.mjs +1 -0
- package/dist/scene.js +271 -0
- package/dist/scene.mjs +10 -0
- package/dist/search-types.js +18 -0
- package/dist/search-types.mjs +1 -0
- package/dist/search.js +268 -0
- package/dist/search.mjs +10 -0
- package/dist/sentiment-types.js +18 -0
- package/dist/sentiment-types.mjs +0 -0
- package/dist/sentiment.js +235 -0
- package/dist/sentiment.mjs +9 -0
- package/dist/signage.js +93 -0
- package/dist/signage.mjs +9 -0
- package/dist/slides.js +78 -0
- package/dist/slides.mjs +9 -0
- package/dist/studio-ai-types.js +18 -0
- package/dist/studio-ai-types.mjs +1 -0
- package/dist/studio-ai.js +301 -0
- package/dist/studio-ai.mjs +10 -0
- package/dist/studio-types.js +18 -0
- package/dist/studio-types.mjs +1 -0
- package/dist/studio.js +303 -0
- package/dist/studio.mjs +10 -0
- package/dist/telemetry.js +124 -0
- package/dist/telemetry.mjs +15 -0
- package/dist/transcribe-types.js +18 -0
- package/dist/transcribe-types.mjs +1 -0
- package/dist/transcribe.js +282 -0
- package/dist/transcribe.mjs +10 -0
- package/dist/usb.js +69 -0
- package/dist/usb.mjs +9 -0
- package/dist/vault.js +96 -0
- package/dist/vault.mjs +9 -0
- package/dist/voice-types.js +18 -0
- package/dist/voice-types.mjs +0 -0
- package/dist/voice.js +272 -0
- package/dist/voice.mjs +9 -0
- package/dist/zoom.js +86 -0
- package/dist/zoom.mjs +9 -0
- package/package.json +3 -3
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/marketplace.ts
|
|
21
|
+
var marketplace_exports = {};
|
|
22
|
+
__export(marketplace_exports, {
|
|
23
|
+
MarketplaceAPI: () => MarketplaceAPI,
|
|
24
|
+
createMarketplaceAPI: () => createMarketplaceAPI
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(marketplace_exports);
|
|
27
|
+
var MarketplaceAPI = class {
|
|
28
|
+
client;
|
|
29
|
+
basePath = "/v1/marketplace";
|
|
30
|
+
constructor(client) {
|
|
31
|
+
this.client = client;
|
|
32
|
+
}
|
|
33
|
+
async list(params) {
|
|
34
|
+
return this.client.get(this.basePath, {
|
|
35
|
+
params
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async get(itemId) {
|
|
39
|
+
return this.client.get(`${this.basePath}/${itemId}`);
|
|
40
|
+
}
|
|
41
|
+
async install(itemId) {
|
|
42
|
+
return this.client.post(`${this.basePath}/${itemId}/install`);
|
|
43
|
+
}
|
|
44
|
+
async uninstall(itemId) {
|
|
45
|
+
await this.client.delete(`${this.basePath}/${itemId}/install`);
|
|
46
|
+
}
|
|
47
|
+
async listInstalled(params) {
|
|
48
|
+
return this.client.get(`${this.basePath}/installed`, {
|
|
49
|
+
params
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async publish(request) {
|
|
53
|
+
return this.client.post(this.basePath, request);
|
|
54
|
+
}
|
|
55
|
+
async update(itemId, updates) {
|
|
56
|
+
return this.client.patch(`${this.basePath}/${itemId}`, updates);
|
|
57
|
+
}
|
|
58
|
+
async deprecate(itemId) {
|
|
59
|
+
await this.client.post(`${this.basePath}/${itemId}/deprecate`);
|
|
60
|
+
}
|
|
61
|
+
async getReviews(itemId, params) {
|
|
62
|
+
return this.client.get(`${this.basePath}/${itemId}/reviews`, {
|
|
63
|
+
params
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
async addReview(itemId, review) {
|
|
67
|
+
return this.client.post(`${this.basePath}/${itemId}/reviews`, review);
|
|
68
|
+
}
|
|
69
|
+
async search(query, params) {
|
|
70
|
+
return this.client.get(`${this.basePath}/search`, {
|
|
71
|
+
params: { q: query, ...params }
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
function createMarketplaceAPI(client) {
|
|
76
|
+
return new MarketplaceAPI(client);
|
|
77
|
+
}
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
MarketplaceAPI,
|
|
81
|
+
createMarketplaceAPI
|
|
82
|
+
});
|
package/dist/mesh.js
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/mesh.ts
|
|
21
|
+
var mesh_exports = {};
|
|
22
|
+
__export(mesh_exports, {
|
|
23
|
+
MeshAPI: () => MeshAPI,
|
|
24
|
+
createMeshAPI: () => createMeshAPI
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(mesh_exports);
|
|
27
|
+
var MeshAPI = class {
|
|
28
|
+
client;
|
|
29
|
+
basePath = "/v1/mesh";
|
|
30
|
+
constructor(client) {
|
|
31
|
+
this.client = client;
|
|
32
|
+
}
|
|
33
|
+
// ==========================================================================
|
|
34
|
+
// Regions
|
|
35
|
+
// ==========================================================================
|
|
36
|
+
/**
|
|
37
|
+
* List mesh regions with optional filters
|
|
38
|
+
*
|
|
39
|
+
* Requires: mesh:read permission
|
|
40
|
+
*/
|
|
41
|
+
async listRegions(params) {
|
|
42
|
+
const queryParams = {
|
|
43
|
+
limit: params?.limit,
|
|
44
|
+
offset: params?.offset,
|
|
45
|
+
cursor: params?.cursor,
|
|
46
|
+
status: params?.status,
|
|
47
|
+
provider: params?.provider
|
|
48
|
+
};
|
|
49
|
+
return this.client.get(`${this.basePath}/regions`, {
|
|
50
|
+
params: queryParams
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get a region by ID
|
|
55
|
+
*
|
|
56
|
+
* Requires: mesh:read permission
|
|
57
|
+
*/
|
|
58
|
+
async getRegion(regionId) {
|
|
59
|
+
return this.client.get(`${this.basePath}/regions/${regionId}`);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get health details for a region
|
|
63
|
+
*
|
|
64
|
+
* Requires: mesh:read permission
|
|
65
|
+
*/
|
|
66
|
+
async getRegionHealth(regionId) {
|
|
67
|
+
return this.client.get(`${this.basePath}/regions/${regionId}/health`);
|
|
68
|
+
}
|
|
69
|
+
// ==========================================================================
|
|
70
|
+
// Peers
|
|
71
|
+
// ==========================================================================
|
|
72
|
+
/**
|
|
73
|
+
* List mesh peers, optionally filtered by region
|
|
74
|
+
*
|
|
75
|
+
* Requires: mesh:read permission
|
|
76
|
+
*/
|
|
77
|
+
async listPeers(regionId) {
|
|
78
|
+
const queryParams = {
|
|
79
|
+
region_id: regionId
|
|
80
|
+
};
|
|
81
|
+
return this.client.get(`${this.basePath}/peers`, {
|
|
82
|
+
params: queryParams
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Add a peer to a region
|
|
87
|
+
*
|
|
88
|
+
* Requires: mesh:create permission
|
|
89
|
+
*/
|
|
90
|
+
async addPeer(regionId, endpoint) {
|
|
91
|
+
return this.client.post(`${this.basePath}/peers`, {
|
|
92
|
+
region_id: regionId,
|
|
93
|
+
endpoint
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Remove a peer
|
|
98
|
+
*
|
|
99
|
+
* Requires: mesh:remove permission (server-side RBAC enforced)
|
|
100
|
+
*/
|
|
101
|
+
async removePeer(peerId) {
|
|
102
|
+
await this.client.delete(`${this.basePath}/peers/${peerId}`);
|
|
103
|
+
}
|
|
104
|
+
// ==========================================================================
|
|
105
|
+
// Failover Policies
|
|
106
|
+
// ==========================================================================
|
|
107
|
+
/**
|
|
108
|
+
* Create a failover policy
|
|
109
|
+
*
|
|
110
|
+
* Requires: mesh:create permission
|
|
111
|
+
*/
|
|
112
|
+
async createPolicy(request) {
|
|
113
|
+
return this.client.post(`${this.basePath}/policies`, request);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Update a failover policy
|
|
117
|
+
*
|
|
118
|
+
* Requires: mesh:update permission
|
|
119
|
+
*/
|
|
120
|
+
async updatePolicy(policyId, updates) {
|
|
121
|
+
return this.client.patch(`${this.basePath}/policies/${policyId}`, updates);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Remove a failover policy
|
|
125
|
+
*
|
|
126
|
+
* Requires: mesh:remove permission (server-side RBAC enforced)
|
|
127
|
+
*/
|
|
128
|
+
async removePolicy(policyId) {
|
|
129
|
+
await this.client.delete(`${this.basePath}/policies/${policyId}`);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* List failover policies
|
|
133
|
+
*
|
|
134
|
+
* Requires: mesh:read permission
|
|
135
|
+
*/
|
|
136
|
+
async listPolicies(params) {
|
|
137
|
+
return this.client.get(`${this.basePath}/policies`, {
|
|
138
|
+
params
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
// ==========================================================================
|
|
142
|
+
// Failover Operations
|
|
143
|
+
// ==========================================================================
|
|
144
|
+
/**
|
|
145
|
+
* Trigger a manual failover to a target region
|
|
146
|
+
*
|
|
147
|
+
* Requires: mesh:failover permission
|
|
148
|
+
*/
|
|
149
|
+
async triggerFailover(policyId, targetRegion) {
|
|
150
|
+
return this.client.post(`${this.basePath}/policies/${policyId}/failover`, {
|
|
151
|
+
target_region: targetRegion
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Get failover event history for a policy
|
|
156
|
+
*
|
|
157
|
+
* Requires: mesh:read permission
|
|
158
|
+
*/
|
|
159
|
+
async getFailoverHistory(policyId, params) {
|
|
160
|
+
return this.client.get(
|
|
161
|
+
`${this.basePath}/policies/${policyId}/events`,
|
|
162
|
+
{ params }
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
// ==========================================================================
|
|
166
|
+
// Replication & Topology
|
|
167
|
+
// ==========================================================================
|
|
168
|
+
/**
|
|
169
|
+
* Get replication status between regions
|
|
170
|
+
*
|
|
171
|
+
* Requires: mesh:read permission
|
|
172
|
+
*/
|
|
173
|
+
async getReplicationStatus(sourceRegion, targetRegion) {
|
|
174
|
+
const queryParams = {
|
|
175
|
+
source_region: sourceRegion,
|
|
176
|
+
target_region: targetRegion
|
|
177
|
+
};
|
|
178
|
+
return this.client.get(`${this.basePath}/replication`, {
|
|
179
|
+
params: queryParams
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Get the full mesh topology (regions, peers, and policies)
|
|
184
|
+
*
|
|
185
|
+
* Requires: mesh:read permission
|
|
186
|
+
*/
|
|
187
|
+
async getTopology() {
|
|
188
|
+
return this.client.get(`${this.basePath}/topology`);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
function createMeshAPI(client) {
|
|
192
|
+
return new MeshAPI(client);
|
|
193
|
+
}
|
|
194
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
195
|
+
0 && (module.exports = {
|
|
196
|
+
MeshAPI,
|
|
197
|
+
createMeshAPI
|
|
198
|
+
});
|
package/dist/mesh.mjs
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/notifications.ts
|
|
21
|
+
var notifications_exports = {};
|
|
22
|
+
__export(notifications_exports, {
|
|
23
|
+
NotificationsAPI: () => NotificationsAPI,
|
|
24
|
+
createNotificationsAPI: () => createNotificationsAPI
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(notifications_exports);
|
|
27
|
+
var NotificationsAPI = class {
|
|
28
|
+
client;
|
|
29
|
+
basePath = "/v1/notifications";
|
|
30
|
+
constructor(client) {
|
|
31
|
+
this.client = client;
|
|
32
|
+
}
|
|
33
|
+
/** List notifications with optional filters. */
|
|
34
|
+
async list(params) {
|
|
35
|
+
return this.client.get(this.basePath, {
|
|
36
|
+
params
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/** Get a single notification by ID. */
|
|
40
|
+
async get(notificationId) {
|
|
41
|
+
return this.client.get(`${this.basePath}/${notificationId}`);
|
|
42
|
+
}
|
|
43
|
+
/** Mark a notification as read. */
|
|
44
|
+
async markAsRead(notificationId) {
|
|
45
|
+
return this.client.post(`${this.basePath}/${notificationId}/read`);
|
|
46
|
+
}
|
|
47
|
+
/** Mark all notifications as read. */
|
|
48
|
+
async markAllRead() {
|
|
49
|
+
return this.client.post(`${this.basePath}/mark-all-read`);
|
|
50
|
+
}
|
|
51
|
+
/** Archive a notification. */
|
|
52
|
+
async archive(notificationId) {
|
|
53
|
+
return this.client.post(`${this.basePath}/${notificationId}/archive`);
|
|
54
|
+
}
|
|
55
|
+
/** Delete a notification. */
|
|
56
|
+
async remove(notificationId) {
|
|
57
|
+
await this.client.delete(`${this.basePath}/${notificationId}`);
|
|
58
|
+
}
|
|
59
|
+
/** Get unread count. */
|
|
60
|
+
async getUnreadCount() {
|
|
61
|
+
return this.client.get(`${this.basePath}/unread-count`);
|
|
62
|
+
}
|
|
63
|
+
/** Get notification preferences. */
|
|
64
|
+
async getPreferences() {
|
|
65
|
+
return this.client.get(`${this.basePath}/preferences`);
|
|
66
|
+
}
|
|
67
|
+
/** Update notification preferences. */
|
|
68
|
+
async updatePreferences(preferences) {
|
|
69
|
+
return this.client.patch(`${this.basePath}/preferences`, preferences);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function createNotificationsAPI(client) {
|
|
73
|
+
return new NotificationsAPI(client);
|
|
74
|
+
}
|
|
75
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
+
0 && (module.exports = {
|
|
77
|
+
NotificationsAPI,
|
|
78
|
+
createNotificationsAPI
|
|
79
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/phone-types.ts
|
|
17
|
+
var phone_types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(phone_types_exports);
|
|
File without changes
|
package/dist/phone.js
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/phone.ts
|
|
21
|
+
var phone_exports = {};
|
|
22
|
+
__export(phone_exports, {
|
|
23
|
+
PhoneAPI: () => PhoneAPI,
|
|
24
|
+
createPhoneAPI: () => createPhoneAPI
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(phone_exports);
|
|
27
|
+
var PhoneAPI = class {
|
|
28
|
+
client;
|
|
29
|
+
basePath = "/v1/phone";
|
|
30
|
+
constructor(client) {
|
|
31
|
+
this.client = client;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* List owned phone numbers
|
|
35
|
+
*
|
|
36
|
+
* Requires: phone:read permission
|
|
37
|
+
*/
|
|
38
|
+
async listNumbers(params) {
|
|
39
|
+
return this.client.get(
|
|
40
|
+
`${this.basePath}/numbers`,
|
|
41
|
+
{ params }
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get a phone number by ID
|
|
46
|
+
*
|
|
47
|
+
* Requires: phone:read permission
|
|
48
|
+
*/
|
|
49
|
+
async getNumber(numberId) {
|
|
50
|
+
return this.client.get(`${this.basePath}/numbers/${numberId}`);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Search for available phone numbers to purchase
|
|
54
|
+
*
|
|
55
|
+
* Requires: phone:read permission
|
|
56
|
+
*/
|
|
57
|
+
async searchAvailableNumbers(request) {
|
|
58
|
+
return this.client.post(
|
|
59
|
+
`${this.basePath}/numbers/available`,
|
|
60
|
+
request
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Purchase a phone number
|
|
65
|
+
*
|
|
66
|
+
* Requires: phone:purchase permission
|
|
67
|
+
*/
|
|
68
|
+
async purchaseNumber(number, options) {
|
|
69
|
+
return this.client.post(`${this.basePath}/numbers/purchase`, {
|
|
70
|
+
number,
|
|
71
|
+
...options
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Update a phone number
|
|
76
|
+
*
|
|
77
|
+
* Requires: phone:update permission
|
|
78
|
+
*/
|
|
79
|
+
async updateNumber(numberId, updates) {
|
|
80
|
+
return this.client.patch(
|
|
81
|
+
`${this.basePath}/numbers/${numberId}`,
|
|
82
|
+
updates
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Release a phone number
|
|
87
|
+
*
|
|
88
|
+
* Requires: phone:release permission (server-side RBAC enforced)
|
|
89
|
+
*/
|
|
90
|
+
async releaseNumber(numberId) {
|
|
91
|
+
await this.client.delete(
|
|
92
|
+
`${this.basePath}/numbers/${numberId}`,
|
|
93
|
+
{ method: "DELETE" }
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Make an outbound call
|
|
98
|
+
*
|
|
99
|
+
* Requires: phone:call permission
|
|
100
|
+
*/
|
|
101
|
+
async makeCall(request) {
|
|
102
|
+
return this.client.post(`${this.basePath}/calls`, request);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get a call by ID
|
|
106
|
+
*
|
|
107
|
+
* Requires: phone:read permission
|
|
108
|
+
*/
|
|
109
|
+
async getCall(callId) {
|
|
110
|
+
return this.client.get(`${this.basePath}/calls/${callId}`);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* List calls
|
|
114
|
+
*
|
|
115
|
+
* Requires: phone:read permission
|
|
116
|
+
*/
|
|
117
|
+
async listCalls(params) {
|
|
118
|
+
return this.client.get(
|
|
119
|
+
`${this.basePath}/calls`,
|
|
120
|
+
{ params }
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Update an active call
|
|
125
|
+
*
|
|
126
|
+
* Requires: phone:call permission
|
|
127
|
+
*/
|
|
128
|
+
async updateCall(callId, updates) {
|
|
129
|
+
return this.client.patch(`${this.basePath}/calls/${callId}`, updates);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* End an active call
|
|
133
|
+
*
|
|
134
|
+
* Requires: phone:call permission
|
|
135
|
+
*/
|
|
136
|
+
async endCall(callId) {
|
|
137
|
+
return this.updateCall(callId, { status: "completed" });
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get call recording
|
|
141
|
+
*
|
|
142
|
+
* Requires: phone:read permission
|
|
143
|
+
*/
|
|
144
|
+
async getRecording(callId) {
|
|
145
|
+
return this.client.get(`${this.basePath}/calls/${callId}/recording`);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Wait for call to end
|
|
149
|
+
*/
|
|
150
|
+
async waitForCallEnd(callId, options) {
|
|
151
|
+
const pollInterval = options?.pollInterval || 2e3;
|
|
152
|
+
const timeout = options?.timeout || 36e5;
|
|
153
|
+
const startTime = Date.now();
|
|
154
|
+
const terminalStatuses = [
|
|
155
|
+
"completed",
|
|
156
|
+
"failed",
|
|
157
|
+
"busy",
|
|
158
|
+
"no_answer",
|
|
159
|
+
"canceled"
|
|
160
|
+
];
|
|
161
|
+
while (Date.now() - startTime < timeout) {
|
|
162
|
+
const call = await this.getCall(callId);
|
|
163
|
+
if (options?.onUpdate) {
|
|
164
|
+
options.onUpdate(call);
|
|
165
|
+
}
|
|
166
|
+
if (terminalStatuses.includes(call.status)) {
|
|
167
|
+
return call;
|
|
168
|
+
}
|
|
169
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
170
|
+
}
|
|
171
|
+
throw new Error(`Call wait timed out after ${timeout}ms`);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Create a conference room
|
|
175
|
+
*
|
|
176
|
+
* Requires: phone:conference permission
|
|
177
|
+
*/
|
|
178
|
+
async createConference(options) {
|
|
179
|
+
return this.client.post(`${this.basePath}/conferences`, options);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Get a conference by ID
|
|
183
|
+
*
|
|
184
|
+
* Requires: phone:read permission
|
|
185
|
+
*/
|
|
186
|
+
async getConference(conferenceId) {
|
|
187
|
+
return this.client.get(
|
|
188
|
+
`${this.basePath}/conferences/${conferenceId}`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* List conferences
|
|
193
|
+
*
|
|
194
|
+
* Requires: phone:read permission
|
|
195
|
+
*/
|
|
196
|
+
async listConferences(params) {
|
|
197
|
+
return this.client.get(
|
|
198
|
+
`${this.basePath}/conferences`,
|
|
199
|
+
{ params }
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Add a participant to a conference
|
|
204
|
+
*
|
|
205
|
+
* Requires: phone:conference permission
|
|
206
|
+
*/
|
|
207
|
+
async addConferenceParticipant(conferenceId, options) {
|
|
208
|
+
return this.client.post(
|
|
209
|
+
`${this.basePath}/conferences/${conferenceId}/participants`,
|
|
210
|
+
options
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Update a conference participant
|
|
215
|
+
*
|
|
216
|
+
* Requires: phone:conference permission
|
|
217
|
+
*/
|
|
218
|
+
async updateConferenceParticipant(conferenceId, callId, updates) {
|
|
219
|
+
return this.client.patch(
|
|
220
|
+
`${this.basePath}/conferences/${conferenceId}/participants/${callId}`,
|
|
221
|
+
updates
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Remove a participant from a conference
|
|
226
|
+
*
|
|
227
|
+
* Requires: phone:conference permission (server-side RBAC enforced)
|
|
228
|
+
*/
|
|
229
|
+
async removeConferenceParticipant(conferenceId, callId) {
|
|
230
|
+
await this.client.delete(
|
|
231
|
+
`${this.basePath}/conferences/${conferenceId}/participants/${callId}`,
|
|
232
|
+
{ method: "DELETE" }
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* End a conference
|
|
237
|
+
*
|
|
238
|
+
* Requires: phone:conference permission
|
|
239
|
+
*/
|
|
240
|
+
async endConference(conferenceId) {
|
|
241
|
+
return this.client.post(
|
|
242
|
+
`${this.basePath}/conferences/${conferenceId}/end`
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Validate a phone number
|
|
247
|
+
*
|
|
248
|
+
* Requires: phone:read permission
|
|
249
|
+
*/
|
|
250
|
+
async validateNumber(number) {
|
|
251
|
+
return this.client.post(`${this.basePath}/validate`, { number });
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Get supported countries
|
|
255
|
+
*
|
|
256
|
+
* Requires: phone:read permission
|
|
257
|
+
*/
|
|
258
|
+
async getSupportedCountries() {
|
|
259
|
+
return this.client.get(`${this.basePath}/countries`);
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
function createPhoneAPI(client) {
|
|
263
|
+
return new PhoneAPI(client);
|
|
264
|
+
}
|
|
265
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
266
|
+
0 && (module.exports = {
|
|
267
|
+
PhoneAPI,
|
|
268
|
+
createPhoneAPI
|
|
269
|
+
});
|