@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,173 @@
|
|
|
1
|
+
// src/clips.ts
|
|
2
|
+
var ClipsAPI = class {
|
|
3
|
+
client;
|
|
4
|
+
basePath = "/v1/clips";
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Create a new clip
|
|
10
|
+
*
|
|
11
|
+
* Requires: clips:create permission
|
|
12
|
+
*/
|
|
13
|
+
async create(request) {
|
|
14
|
+
return this.client.post(this.basePath, request);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get a clip by ID
|
|
18
|
+
*
|
|
19
|
+
* Requires: clips:read permission
|
|
20
|
+
*/
|
|
21
|
+
async get(clipId) {
|
|
22
|
+
return this.client.get(`${this.basePath}/${clipId}`);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update a clip
|
|
26
|
+
*
|
|
27
|
+
* Requires: clips:update permission
|
|
28
|
+
*/
|
|
29
|
+
async update(clipId, request) {
|
|
30
|
+
return this.client.patch(`${this.basePath}/${clipId}`, request);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Remove a clip
|
|
34
|
+
*
|
|
35
|
+
* Requires: clips:remove permission (server-side RBAC enforced)
|
|
36
|
+
*/
|
|
37
|
+
async remove(clipId) {
|
|
38
|
+
await this.client.delete(`${this.basePath}/${clipId}`);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* List clips with optional filters
|
|
42
|
+
*
|
|
43
|
+
* Requires: clips:read permission
|
|
44
|
+
*/
|
|
45
|
+
async list(params) {
|
|
46
|
+
const queryParams = {
|
|
47
|
+
limit: params?.limit,
|
|
48
|
+
offset: params?.offset,
|
|
49
|
+
cursor: params?.cursor,
|
|
50
|
+
status: params?.status,
|
|
51
|
+
source_type: params?.source_type,
|
|
52
|
+
source_id: params?.source_id,
|
|
53
|
+
created_after: params?.created_after,
|
|
54
|
+
created_before: params?.created_before,
|
|
55
|
+
order_by: params?.order_by,
|
|
56
|
+
order: params?.order
|
|
57
|
+
};
|
|
58
|
+
if (params?.tags?.length) {
|
|
59
|
+
queryParams["tags"] = params.tags.join(",");
|
|
60
|
+
}
|
|
61
|
+
return this.client.get(this.basePath, {
|
|
62
|
+
params: queryParams
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Export a clip to a different format
|
|
67
|
+
*
|
|
68
|
+
* Requires: clips:export permission
|
|
69
|
+
*/
|
|
70
|
+
async exportClip(clipId, request) {
|
|
71
|
+
return this.client.post(
|
|
72
|
+
`${this.basePath}/${clipId}/export`,
|
|
73
|
+
request
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get export job status
|
|
78
|
+
*
|
|
79
|
+
* Requires: clips:read permission
|
|
80
|
+
*/
|
|
81
|
+
async getExport(clipId, exportId) {
|
|
82
|
+
return this.client.get(
|
|
83
|
+
`${this.basePath}/${clipId}/exports/${exportId}`
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* List all exports for a clip
|
|
88
|
+
*
|
|
89
|
+
* Requires: clips:read permission
|
|
90
|
+
*/
|
|
91
|
+
async listExports(clipId, params) {
|
|
92
|
+
return this.client.get(
|
|
93
|
+
`${this.basePath}/${clipId}/exports`,
|
|
94
|
+
{ params }
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Detect highlights in source content
|
|
99
|
+
*
|
|
100
|
+
* Requires: clips:analyze permission
|
|
101
|
+
*/
|
|
102
|
+
async detectHighlights(sourceType, sourceId, options) {
|
|
103
|
+
return this.client.post(
|
|
104
|
+
`${this.basePath}/highlights/detect`,
|
|
105
|
+
{
|
|
106
|
+
source_type: sourceType,
|
|
107
|
+
source_id: sourceId,
|
|
108
|
+
...options
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Generate clips from detected highlights
|
|
114
|
+
*
|
|
115
|
+
* Requires: clips:create permission
|
|
116
|
+
*/
|
|
117
|
+
async createFromHighlights(sourceType, sourceId, options) {
|
|
118
|
+
return this.client.post(`${this.basePath}/highlights/create`, {
|
|
119
|
+
source_type: sourceType,
|
|
120
|
+
source_id: sourceId,
|
|
121
|
+
...options
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Wait for a clip to be ready
|
|
126
|
+
*/
|
|
127
|
+
async waitForReady(clipId, options) {
|
|
128
|
+
const pollInterval = options?.pollInterval || 2e3;
|
|
129
|
+
const timeout = options?.timeout || 3e5;
|
|
130
|
+
const startTime = Date.now();
|
|
131
|
+
while (Date.now() - startTime < timeout) {
|
|
132
|
+
const clip = await this.get(clipId);
|
|
133
|
+
if (options?.onProgress) {
|
|
134
|
+
options.onProgress(clip);
|
|
135
|
+
}
|
|
136
|
+
if (clip.status === "ready") {
|
|
137
|
+
return clip;
|
|
138
|
+
}
|
|
139
|
+
if (clip.status === "failed") {
|
|
140
|
+
throw new Error(`Clip processing failed: ${clip.error || "Unknown error"}`);
|
|
141
|
+
}
|
|
142
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
143
|
+
}
|
|
144
|
+
throw new Error(`Clip processing timed out after ${timeout}ms`);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Wait for an export to be ready
|
|
148
|
+
*/
|
|
149
|
+
async waitForExport(clipId, exportId, options) {
|
|
150
|
+
const pollInterval = options?.pollInterval || 2e3;
|
|
151
|
+
const timeout = options?.timeout || 3e5;
|
|
152
|
+
const startTime = Date.now();
|
|
153
|
+
while (Date.now() - startTime < timeout) {
|
|
154
|
+
const exportJob = await this.getExport(clipId, exportId);
|
|
155
|
+
if (exportJob.status === "ready") {
|
|
156
|
+
return exportJob;
|
|
157
|
+
}
|
|
158
|
+
if (exportJob.status === "failed") {
|
|
159
|
+
throw new Error(`Export failed: ${exportJob.error || "Unknown error"}`);
|
|
160
|
+
}
|
|
161
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
162
|
+
}
|
|
163
|
+
throw new Error(`Export timed out after ${timeout}ms`);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
function createClipsAPI(client) {
|
|
167
|
+
return new ClipsAPI(client);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export {
|
|
171
|
+
ClipsAPI,
|
|
172
|
+
createClipsAPI
|
|
173
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/prism.ts
|
|
2
|
+
var PrismAPI = class {
|
|
3
|
+
client;
|
|
4
|
+
basePath = "/v1/prism";
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
async createDevice(request) {
|
|
9
|
+
return this.client.post(`${this.basePath}/devices`, request);
|
|
10
|
+
}
|
|
11
|
+
async getDevice(deviceId) {
|
|
12
|
+
return this.client.get(`${this.basePath}/devices/${deviceId}`);
|
|
13
|
+
}
|
|
14
|
+
async updateDevice(deviceId, request) {
|
|
15
|
+
return this.client.patch(`${this.basePath}/devices/${deviceId}`, request);
|
|
16
|
+
}
|
|
17
|
+
async removeDevice(deviceId) {
|
|
18
|
+
await this.client.delete(`${this.basePath}/devices/${deviceId}`);
|
|
19
|
+
}
|
|
20
|
+
async listDevices(params) {
|
|
21
|
+
return this.client.get(`${this.basePath}/devices`, {
|
|
22
|
+
params
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async startDevice(deviceId) {
|
|
26
|
+
return this.client.post(`${this.basePath}/devices/${deviceId}/start`);
|
|
27
|
+
}
|
|
28
|
+
async stopDevice(deviceId) {
|
|
29
|
+
return this.client.post(`${this.basePath}/devices/${deviceId}/stop`);
|
|
30
|
+
}
|
|
31
|
+
async getHealth(deviceId) {
|
|
32
|
+
return this.client.get(`${this.basePath}/devices/${deviceId}/health`);
|
|
33
|
+
}
|
|
34
|
+
async discoverSources(options) {
|
|
35
|
+
return this.client.post(`${this.basePath}/discovery`, options);
|
|
36
|
+
}
|
|
37
|
+
async getPresets(deviceId) {
|
|
38
|
+
return this.client.get(`${this.basePath}/devices/${deviceId}/presets`);
|
|
39
|
+
}
|
|
40
|
+
async setPreset(deviceId, request) {
|
|
41
|
+
return this.client.put(`${this.basePath}/devices/${deviceId}/presets`, request);
|
|
42
|
+
}
|
|
43
|
+
async removePreset(deviceId, slotNumber) {
|
|
44
|
+
await this.client.delete(`${this.basePath}/devices/${deviceId}/presets/${slotNumber}`);
|
|
45
|
+
}
|
|
46
|
+
async recallPreset(deviceId, slotNumber) {
|
|
47
|
+
await this.client.post(`${this.basePath}/devices/${deviceId}/presets/${slotNumber}/recall`);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function createPrismAPI(client) {
|
|
51
|
+
return new PrismAPI(client);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
PrismAPI,
|
|
56
|
+
createPrismAPI
|
|
57
|
+
};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// src/chapters.ts
|
|
2
|
+
var ChaptersAPI = class {
|
|
3
|
+
client;
|
|
4
|
+
basePath = "/v1/chapters";
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
// Chapter Sets
|
|
9
|
+
/**
|
|
10
|
+
* Generate chapters using AI
|
|
11
|
+
*
|
|
12
|
+
* Requires: chapters:generate permission
|
|
13
|
+
*/
|
|
14
|
+
async generate(request) {
|
|
15
|
+
return this.client.post(`${this.basePath}/generate`, request);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a chapter set manually
|
|
19
|
+
*
|
|
20
|
+
* Requires: chapters:create permission
|
|
21
|
+
*/
|
|
22
|
+
async createSet(request) {
|
|
23
|
+
return this.client.post(this.basePath, request);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get a chapter set by ID
|
|
27
|
+
*
|
|
28
|
+
* Requires: chapters:read permission
|
|
29
|
+
*/
|
|
30
|
+
async getSet(setId) {
|
|
31
|
+
return this.client.get(`${this.basePath}/${setId}`);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Update a chapter set
|
|
35
|
+
*
|
|
36
|
+
* Requires: chapters:update permission
|
|
37
|
+
*/
|
|
38
|
+
async updateSet(setId, request) {
|
|
39
|
+
return this.client.patch(`${this.basePath}/${setId}`, request);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Remove a chapter set
|
|
43
|
+
*
|
|
44
|
+
* Requires: chapters:remove permission (canDelete verified server-side)
|
|
45
|
+
*/
|
|
46
|
+
async removeSet(setId) {
|
|
47
|
+
await this.client.delete(`${this.basePath}/${setId}`);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* List chapter sets
|
|
51
|
+
*
|
|
52
|
+
* Requires: chapters:read permission
|
|
53
|
+
*/
|
|
54
|
+
async listSets(params) {
|
|
55
|
+
return this.client.get(this.basePath, { params });
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the default chapter set for a media
|
|
59
|
+
*
|
|
60
|
+
* Requires: chapters:read permission
|
|
61
|
+
*/
|
|
62
|
+
async getDefaultSet(mediaId, mediaType) {
|
|
63
|
+
try {
|
|
64
|
+
return await this.client.get(`${this.basePath}/default`, {
|
|
65
|
+
params: { media_id: mediaId, media_type: mediaType }
|
|
66
|
+
});
|
|
67
|
+
} catch (error) {
|
|
68
|
+
if (error.statusCode === 404) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Duplicate a chapter set
|
|
76
|
+
*
|
|
77
|
+
* Requires: chapters:create permission
|
|
78
|
+
*/
|
|
79
|
+
async duplicateSet(setId, name) {
|
|
80
|
+
return this.client.post(`${this.basePath}/${setId}/duplicate`, { name });
|
|
81
|
+
}
|
|
82
|
+
// Individual Chapters
|
|
83
|
+
/**
|
|
84
|
+
* Add a chapter to a set
|
|
85
|
+
*
|
|
86
|
+
* Requires: chapters:update permission
|
|
87
|
+
*/
|
|
88
|
+
async addChapter(setId, chapter) {
|
|
89
|
+
return this.client.post(`${this.basePath}/${setId}/chapters`, chapter);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get a chapter by ID
|
|
93
|
+
*
|
|
94
|
+
* Requires: chapters:read permission
|
|
95
|
+
*/
|
|
96
|
+
async getChapter(setId, chapterId) {
|
|
97
|
+
return this.client.get(`${this.basePath}/${setId}/chapters/${chapterId}`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Update a chapter
|
|
101
|
+
*
|
|
102
|
+
* Requires: chapters:update permission
|
|
103
|
+
*/
|
|
104
|
+
async updateChapter(setId, chapterId, request) {
|
|
105
|
+
return this.client.patch(
|
|
106
|
+
`${this.basePath}/${setId}/chapters/${chapterId}`,
|
|
107
|
+
request
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Remove a chapter
|
|
112
|
+
*
|
|
113
|
+
* Requires: chapters:update permission (server-side RBAC enforced)
|
|
114
|
+
*/
|
|
115
|
+
async removeChapter(setId, chapterId) {
|
|
116
|
+
await this.client.delete(
|
|
117
|
+
`${this.basePath}/${setId}/chapters/${chapterId}`,
|
|
118
|
+
{ method: "DELETE" }
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Reorder chapters
|
|
123
|
+
*
|
|
124
|
+
* Requires: chapters:update permission
|
|
125
|
+
*/
|
|
126
|
+
async reorderChapters(setId, chapterIds) {
|
|
127
|
+
return this.client.post(
|
|
128
|
+
`${this.basePath}/${setId}/chapters/reorder`,
|
|
129
|
+
{ chapter_ids: chapterIds }
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Bulk update chapters
|
|
134
|
+
*
|
|
135
|
+
* Requires: chapters:update permission
|
|
136
|
+
*/
|
|
137
|
+
async bulkUpdateChapters(setId, updates) {
|
|
138
|
+
return this.client.post(`${this.basePath}/${setId}/chapters/bulk`, { updates });
|
|
139
|
+
}
|
|
140
|
+
// Thumbnails
|
|
141
|
+
/**
|
|
142
|
+
* Generate thumbnail for a chapter
|
|
143
|
+
*
|
|
144
|
+
* Requires: chapters:update permission
|
|
145
|
+
*/
|
|
146
|
+
async generateThumbnail(setId, chapterId, options) {
|
|
147
|
+
return this.client.post(
|
|
148
|
+
`${this.basePath}/${setId}/chapters/${chapterId}/thumbnail`,
|
|
149
|
+
options
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Generate thumbnails for all chapters in a set
|
|
154
|
+
*
|
|
155
|
+
* Requires: chapters:update permission
|
|
156
|
+
*/
|
|
157
|
+
async generateAllThumbnails(setId) {
|
|
158
|
+
return this.client.post(`${this.basePath}/${setId}/thumbnails`);
|
|
159
|
+
}
|
|
160
|
+
// Export
|
|
161
|
+
/**
|
|
162
|
+
* Export chapters in various formats
|
|
163
|
+
*
|
|
164
|
+
* Requires: chapters:read permission
|
|
165
|
+
*/
|
|
166
|
+
async exportChapters(setId, format) {
|
|
167
|
+
return this.client.get(`${this.basePath}/${setId}/export`, {
|
|
168
|
+
params: { format }
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Import chapters from a format
|
|
173
|
+
*
|
|
174
|
+
* Requires: chapters:create permission
|
|
175
|
+
*/
|
|
176
|
+
async importChapters(mediaId, mediaType, format, content, options) {
|
|
177
|
+
return this.client.post(`${this.basePath}/import`, {
|
|
178
|
+
media_id: mediaId,
|
|
179
|
+
media_type: mediaType,
|
|
180
|
+
format,
|
|
181
|
+
content,
|
|
182
|
+
...options
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
// Utilities
|
|
186
|
+
/**
|
|
187
|
+
* Wait for chapter generation to complete
|
|
188
|
+
*/
|
|
189
|
+
async waitForReady(setId, options) {
|
|
190
|
+
const pollInterval = options?.pollInterval || 2e3;
|
|
191
|
+
const timeout = options?.timeout || 6e5;
|
|
192
|
+
const startTime = Date.now();
|
|
193
|
+
while (Date.now() - startTime < timeout) {
|
|
194
|
+
const set = await this.getSet(setId);
|
|
195
|
+
if (options?.onProgress) {
|
|
196
|
+
options.onProgress(set);
|
|
197
|
+
}
|
|
198
|
+
if (set.status === "ready") {
|
|
199
|
+
return set;
|
|
200
|
+
}
|
|
201
|
+
if (set.status === "failed") {
|
|
202
|
+
throw new Error(`Chapter generation failed: ${set.error || "Unknown error"}`);
|
|
203
|
+
}
|
|
204
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
205
|
+
}
|
|
206
|
+
throw new Error(`Chapter generation timed out after ${timeout}ms`);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Get chapter at a specific time
|
|
210
|
+
*
|
|
211
|
+
* Requires: chapters:read permission
|
|
212
|
+
*/
|
|
213
|
+
async getChapterAtTime(setId, time) {
|
|
214
|
+
try {
|
|
215
|
+
return await this.client.get(`${this.basePath}/${setId}/at`, {
|
|
216
|
+
params: { time }
|
|
217
|
+
});
|
|
218
|
+
} catch (error) {
|
|
219
|
+
if (error.statusCode === 404) {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
throw error;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Merge chapters
|
|
227
|
+
*
|
|
228
|
+
* Requires: chapters:update permission
|
|
229
|
+
*/
|
|
230
|
+
async mergeChapters(setId, chapterIds, options) {
|
|
231
|
+
return this.client.post(`${this.basePath}/${setId}/chapters/merge`, {
|
|
232
|
+
chapter_ids: chapterIds,
|
|
233
|
+
...options
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Split a chapter at a specific time
|
|
238
|
+
*
|
|
239
|
+
* Requires: chapters:update permission
|
|
240
|
+
*/
|
|
241
|
+
async splitChapter(setId, chapterId, splitTime, options) {
|
|
242
|
+
return this.client.post(`${this.basePath}/${setId}/chapters/${chapterId}/split`, {
|
|
243
|
+
split_time: splitTime,
|
|
244
|
+
...options
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
function createChaptersAPI(client) {
|
|
249
|
+
return new ChaptersAPI(client);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export {
|
|
253
|
+
ChaptersAPI,
|
|
254
|
+
createChaptersAPI
|
|
255
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/usb.ts
|
|
2
|
+
var UsbAPI = class {
|
|
3
|
+
client;
|
|
4
|
+
basePath = "/v1/usb";
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
async list(params) {
|
|
9
|
+
return this.client.get(`${this.basePath}/devices`, {
|
|
10
|
+
params
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
async get(deviceId) {
|
|
14
|
+
return this.client.get(`${this.basePath}/devices/${deviceId}`);
|
|
15
|
+
}
|
|
16
|
+
async claim(deviceId, request) {
|
|
17
|
+
return this.client.post(`${this.basePath}/devices/${deviceId}/claim`, request);
|
|
18
|
+
}
|
|
19
|
+
async release(deviceId) {
|
|
20
|
+
return this.client.post(`${this.basePath}/devices/${deviceId}/release`);
|
|
21
|
+
}
|
|
22
|
+
async getCapabilities(deviceId) {
|
|
23
|
+
return this.client.get(
|
|
24
|
+
`${this.basePath}/devices/${deviceId}/capabilities`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
async listByNode(nodeId, params) {
|
|
28
|
+
return this.client.get(
|
|
29
|
+
`${this.basePath}/nodes/${nodeId}/devices`,
|
|
30
|
+
{ params }
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
async configure(deviceId, config) {
|
|
34
|
+
return this.client.patch(`${this.basePath}/devices/${deviceId}/config`, config);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
function createUsbAPI(client) {
|
|
38
|
+
return new UsbAPI(client);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
UsbAPI,
|
|
43
|
+
createUsbAPI
|
|
44
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// src/vault.ts
|
|
2
|
+
var VaultAPI = class {
|
|
3
|
+
client;
|
|
4
|
+
basePath = "/v1/vault";
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
async list(params) {
|
|
9
|
+
return this.client.get(`${this.basePath}/recordings`, {
|
|
10
|
+
params
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
async get(recordingId) {
|
|
14
|
+
return this.client.get(`${this.basePath}/recordings/${recordingId}`);
|
|
15
|
+
}
|
|
16
|
+
async update(recordingId, updates) {
|
|
17
|
+
return this.client.patch(`${this.basePath}/recordings/${recordingId}`, updates);
|
|
18
|
+
}
|
|
19
|
+
async remove(recordingId) {
|
|
20
|
+
await this.client.delete(`${this.basePath}/recordings/${recordingId}`);
|
|
21
|
+
}
|
|
22
|
+
async getStorageUsage() {
|
|
23
|
+
return this.client.get(`${this.basePath}/storage`);
|
|
24
|
+
}
|
|
25
|
+
async createUpload(request) {
|
|
26
|
+
return this.client.post(`${this.basePath}/uploads`, request);
|
|
27
|
+
}
|
|
28
|
+
async completeUpload(uploadId) {
|
|
29
|
+
return this.client.post(`${this.basePath}/uploads/${uploadId}/complete`);
|
|
30
|
+
}
|
|
31
|
+
async startRecording(streamId, options) {
|
|
32
|
+
return this.client.post(`${this.basePath}/recordings`, {
|
|
33
|
+
stream_id: streamId,
|
|
34
|
+
...options
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async stopRecording(streamId) {
|
|
38
|
+
return this.client.post(`${this.basePath}/recordings/stop`, { stream_id: streamId });
|
|
39
|
+
}
|
|
40
|
+
async transcode(recordingId, request) {
|
|
41
|
+
return this.client.post(
|
|
42
|
+
`${this.basePath}/recordings/${recordingId}/transcode`,
|
|
43
|
+
request
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
async getTranscodeJob(jobId) {
|
|
47
|
+
return this.client.get(`${this.basePath}/transcode/${jobId}`);
|
|
48
|
+
}
|
|
49
|
+
async createArchivePolicy(policy) {
|
|
50
|
+
return this.client.post(`${this.basePath}/policies`, policy);
|
|
51
|
+
}
|
|
52
|
+
async listArchivePolicies() {
|
|
53
|
+
return this.client.get(`${this.basePath}/policies`);
|
|
54
|
+
}
|
|
55
|
+
async removeArchivePolicy(policyId) {
|
|
56
|
+
await this.client.delete(`${this.basePath}/policies/${policyId}`);
|
|
57
|
+
}
|
|
58
|
+
async getDownloadUrl(recordingId) {
|
|
59
|
+
return this.client.get(
|
|
60
|
+
`${this.basePath}/recordings/${recordingId}/download`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
function createVaultAPI(client) {
|
|
65
|
+
return new VaultAPI(client);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
VaultAPI,
|
|
70
|
+
createVaultAPI
|
|
71
|
+
};
|