@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.
Files changed (162) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +27 -23
  3. package/dist/audience.js +93 -0
  4. package/dist/audience.mjs +9 -0
  5. package/dist/camera-control.js +95 -0
  6. package/dist/camera-control.mjs +71 -0
  7. package/dist/captions-types.js +18 -0
  8. package/dist/captions-types.mjs +0 -0
  9. package/dist/captions.js +266 -0
  10. package/dist/captions.mjs +9 -0
  11. package/dist/chapters-types.js +18 -0
  12. package/dist/chapters-types.mjs +0 -0
  13. package/dist/chapters.js +280 -0
  14. package/dist/chapters.mjs +9 -0
  15. package/dist/chunk-362MRITF.mjs +46 -0
  16. package/dist/chunk-3ZLK4J3V.mjs +69 -0
  17. package/dist/chunk-4DG4OBRD.mjs +52 -0
  18. package/dist/chunk-4G7FMCMJ.mjs +68 -0
  19. package/dist/chunk-4KD5F6E3.mjs +0 -0
  20. package/dist/chunk-7M6XVUUK.mjs +241 -0
  21. package/dist/chunk-A344OOT7.mjs +243 -0
  22. package/dist/chunk-AI64YR5W.mjs +173 -0
  23. package/dist/chunk-C2GQ756E.mjs +57 -0
  24. package/dist/chunk-CO2VB72Z.mjs +255 -0
  25. package/dist/chunk-DWXWAILB.mjs +44 -0
  26. package/dist/chunk-FLEFYLDM.mjs +71 -0
  27. package/dist/chunk-H2YYTNUH.mjs +266 -0
  28. package/dist/chunk-IGDBED5P.mjs +246 -0
  29. package/dist/chunk-IL2SGWBC.mjs +0 -0
  30. package/dist/chunk-IVFZ5X4W.mjs +68 -0
  31. package/dist/chunk-JC32PG3T.mjs +114 -0
  32. package/dist/chunk-K5X42NLD.mjs +54 -0
  33. package/dist/chunk-KCEPNS2U.mjs +276 -0
  34. package/dist/chunk-LVOVF6XC.mjs +54 -0
  35. package/dist/chunk-M4Z33V3N.mjs +247 -0
  36. package/dist/chunk-M6FKIX75.mjs +0 -0
  37. package/dist/chunk-M744Z327.mjs +244 -0
  38. package/dist/chunk-MRFDPPFK.mjs +61 -0
  39. package/dist/chunk-MXU3Q23F.mjs +68 -0
  40. package/dist/chunk-NCVUZ746.mjs +60 -0
  41. package/dist/chunk-NLQVD2LF.mjs +210 -0
  42. package/dist/chunk-O6DOGYP5.mjs +238 -0
  43. package/dist/chunk-S25NY5GE.mjs +124 -0
  44. package/dist/chunk-TFHXBICQ.mjs +305 -0
  45. package/dist/chunk-TXWOA2VR.mjs +57 -0
  46. package/dist/chunk-UCDSNV22.mjs +63 -0
  47. package/dist/chunk-V5DWA5P4.mjs +279 -0
  48. package/dist/chunk-VLQQDYGP.mjs +173 -0
  49. package/dist/chunk-VPKZUXZW.mjs +53 -0
  50. package/dist/chunk-WS3PEFYJ.mjs +60 -0
  51. package/dist/chunk-XGAYMWRH.mjs +74 -0
  52. package/dist/chunk-XMM5J57W.mjs +0 -0
  53. package/dist/chunk-XWABBOSX.mjs +278 -0
  54. package/dist/chunk-Y6FXYEAI.mjs +10 -0
  55. package/dist/chunk-YBLXHI3M.mjs +257 -0
  56. package/dist/chunk-YEK26SSO.mjs +100 -0
  57. package/dist/chunk-YLCQKCZL.mjs +0 -0
  58. package/dist/chunk-YRKO4XI7.mjs +0 -0
  59. package/dist/chunk-ZJO7AP4Q.mjs +0 -0
  60. package/dist/client-types.js +18 -0
  61. package/dist/client-types.mjs +0 -0
  62. package/dist/client.js +311 -0
  63. package/dist/client.mjs +14 -0
  64. package/dist/clips-types.js +18 -0
  65. package/dist/clips-types.mjs +0 -0
  66. package/dist/clips.js +198 -0
  67. package/dist/clips.mjs +9 -0
  68. package/dist/cloud-switcher.js +80 -0
  69. package/dist/cloud-switcher.mjs +56 -0
  70. package/dist/collab-types.js +18 -0
  71. package/dist/collab-types.mjs +1 -0
  72. package/dist/collab.js +304 -0
  73. package/dist/collab.mjs +10 -0
  74. package/dist/connect.js +85 -0
  75. package/dist/connect.mjs +9 -0
  76. package/dist/creator.js +79 -0
  77. package/dist/creator.mjs +9 -0
  78. package/dist/desktop.js +77 -0
  79. package/dist/desktop.mjs +9 -0
  80. package/dist/distribution.js +88 -0
  81. package/dist/distribution.mjs +9 -0
  82. package/dist/drm.js +85 -0
  83. package/dist/drm.mjs +9 -0
  84. package/dist/edge.js +93 -0
  85. package/dist/edge.mjs +9 -0
  86. package/dist/editor-types.js +18 -0
  87. package/dist/editor-types.mjs +1 -0
  88. package/dist/editor.js +330 -0
  89. package/dist/editor.mjs +10 -0
  90. package/dist/fleet.js +149 -0
  91. package/dist/fleet.mjs +9 -0
  92. package/dist/ghost.js +139 -0
  93. package/dist/ghost.mjs +9 -0
  94. package/dist/index.js +0 -250
  95. package/dist/index.mjs +161 -5445
  96. package/dist/marketplace.js +82 -0
  97. package/dist/marketplace.mjs +9 -0
  98. package/dist/mesh.js +198 -0
  99. package/dist/mesh.mjs +9 -0
  100. package/dist/notifications.js +79 -0
  101. package/dist/notifications.mjs +9 -0
  102. package/dist/phone-types.js +18 -0
  103. package/dist/phone-types.mjs +0 -0
  104. package/dist/phone.js +269 -0
  105. package/dist/phone.mjs +9 -0
  106. package/dist/pipeline-types.js +18 -0
  107. package/dist/pipeline-types.mjs +0 -0
  108. package/dist/pipeline.js +263 -0
  109. package/dist/pipeline.mjs +9 -0
  110. package/dist/podcast.js +94 -0
  111. package/dist/podcast.mjs +9 -0
  112. package/dist/prism.js +82 -0
  113. package/dist/prism.mjs +9 -0
  114. package/dist/prompter.js +99 -0
  115. package/dist/prompter.mjs +76 -0
  116. package/dist/pulse.js +99 -0
  117. package/dist/pulse.mjs +9 -0
  118. package/dist/qr.js +71 -0
  119. package/dist/qr.mjs +9 -0
  120. package/dist/replay.js +62 -0
  121. package/dist/replay.mjs +38 -0
  122. package/dist/scene-types.js +18 -0
  123. package/dist/scene-types.mjs +1 -0
  124. package/dist/scene.js +271 -0
  125. package/dist/scene.mjs +10 -0
  126. package/dist/search-types.js +18 -0
  127. package/dist/search-types.mjs +1 -0
  128. package/dist/search.js +268 -0
  129. package/dist/search.mjs +10 -0
  130. package/dist/sentiment-types.js +18 -0
  131. package/dist/sentiment-types.mjs +0 -0
  132. package/dist/sentiment.js +235 -0
  133. package/dist/sentiment.mjs +9 -0
  134. package/dist/signage.js +93 -0
  135. package/dist/signage.mjs +9 -0
  136. package/dist/slides.js +78 -0
  137. package/dist/slides.mjs +9 -0
  138. package/dist/studio-ai-types.js +18 -0
  139. package/dist/studio-ai-types.mjs +1 -0
  140. package/dist/studio-ai.js +301 -0
  141. package/dist/studio-ai.mjs +10 -0
  142. package/dist/studio-types.js +18 -0
  143. package/dist/studio-types.mjs +1 -0
  144. package/dist/studio.js +303 -0
  145. package/dist/studio.mjs +10 -0
  146. package/dist/telemetry.js +124 -0
  147. package/dist/telemetry.mjs +15 -0
  148. package/dist/transcribe-types.js +18 -0
  149. package/dist/transcribe-types.mjs +1 -0
  150. package/dist/transcribe.js +282 -0
  151. package/dist/transcribe.mjs +10 -0
  152. package/dist/usb.js +69 -0
  153. package/dist/usb.mjs +9 -0
  154. package/dist/vault.js +96 -0
  155. package/dist/vault.mjs +9 -0
  156. package/dist/voice-types.js +18 -0
  157. package/dist/voice-types.mjs +0 -0
  158. package/dist/voice.js +272 -0
  159. package/dist/voice.mjs +9 -0
  160. package/dist/zoom.js +86 -0
  161. package/dist/zoom.mjs +9 -0
  162. package/package.json +3 -3
@@ -0,0 +1,278 @@
1
+ // src/studio.ts
2
+ var StudioAPI = class {
3
+ client;
4
+ basePath = "/v1/productions";
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Create a new production
10
+ *
11
+ * Requires: productions:create permission
12
+ */
13
+ async create(request) {
14
+ return this.client.post(this.basePath, request);
15
+ }
16
+ /**
17
+ * Get a production by ID
18
+ *
19
+ * Requires: productions:read permission
20
+ */
21
+ async get(productionId) {
22
+ return this.client.get(`${this.basePath}/${productionId}`);
23
+ }
24
+ /**
25
+ * Update a production
26
+ *
27
+ * Requires: productions:update permission
28
+ */
29
+ async update(productionId, request) {
30
+ return this.client.patch(`${this.basePath}/${productionId}`, request);
31
+ }
32
+ /**
33
+ * Remove a production
34
+ *
35
+ * Requires: productions:remove permission (server-side RBAC enforced)
36
+ */
37
+ async remove(productionId) {
38
+ await this.client.delete(`${this.basePath}/${productionId}`);
39
+ }
40
+ /**
41
+ * List productions with optional filters
42
+ *
43
+ * Requires: productions: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
+ created_after: params?.created_after,
52
+ created_before: params?.created_before,
53
+ order_by: params?.order_by,
54
+ order: params?.order
55
+ };
56
+ return this.client.get(this.basePath, {
57
+ params: queryParams
58
+ });
59
+ }
60
+ /**
61
+ * Start a production (go live)
62
+ *
63
+ * Transitions the production from 'idle' or 'rehearsal' to 'live'.
64
+ *
65
+ * Requires: productions:control permission
66
+ */
67
+ async start(productionId) {
68
+ return this.client.post(`${this.basePath}/${productionId}/start`);
69
+ }
70
+ /**
71
+ * Stop a production (end broadcast)
72
+ *
73
+ * Transitions the production to 'ending' and then 'ended'.
74
+ *
75
+ * Requires: productions:control permission
76
+ */
77
+ async stop(productionId) {
78
+ return this.client.post(`${this.basePath}/${productionId}/stop`);
79
+ }
80
+ /**
81
+ * Start a rehearsal session
82
+ *
83
+ * Allows testing sources, scenes, and transitions without going live.
84
+ * Transitions the production from 'idle' to 'rehearsal'.
85
+ *
86
+ * Requires: productions:control permission
87
+ */
88
+ async startRehearsal(productionId) {
89
+ return this.client.post(`${this.basePath}/${productionId}/rehearsal`);
90
+ }
91
+ /**
92
+ * Add an input source to a production
93
+ *
94
+ * Requires: productions:sources:create permission
95
+ */
96
+ async addSource(productionId, source) {
97
+ return this.client.post(`${this.basePath}/${productionId}/sources`, source);
98
+ }
99
+ /**
100
+ * Remove a source from a production
101
+ *
102
+ * Requires: productions:sources:remove permission
103
+ */
104
+ async removeSource(productionId, sourceId) {
105
+ await this.client.delete(`${this.basePath}/${productionId}/sources/${sourceId}`);
106
+ }
107
+ /**
108
+ * List all sources for a production
109
+ *
110
+ * Requires: productions:sources:read permission
111
+ */
112
+ async listSources(productionId) {
113
+ return this.client.get(`${this.basePath}/${productionId}/sources`);
114
+ }
115
+ /**
116
+ * Get a specific source by ID
117
+ *
118
+ * Requires: productions:sources:read permission
119
+ */
120
+ async getSource(productionId, sourceId) {
121
+ return this.client.get(`${this.basePath}/${productionId}/sources/${sourceId}`);
122
+ }
123
+ /**
124
+ * Create a new scene in a production
125
+ *
126
+ * Requires: productions:scenes:create permission
127
+ */
128
+ async createScene(productionId, scene) {
129
+ return this.client.post(`${this.basePath}/${productionId}/scenes`, scene);
130
+ }
131
+ /**
132
+ * Update an existing scene
133
+ *
134
+ * Requires: productions:scenes:update permission
135
+ */
136
+ async updateScene(productionId, sceneId, updates) {
137
+ return this.client.patch(`${this.basePath}/${productionId}/scenes/${sceneId}`, updates);
138
+ }
139
+ /**
140
+ * Remove a scene from a production
141
+ *
142
+ * Requires: productions:scenes:remove permission
143
+ */
144
+ async removeScene(productionId, sceneId) {
145
+ await this.client.delete(`${this.basePath}/${productionId}/scenes/${sceneId}`);
146
+ }
147
+ /**
148
+ * List all scenes for a production
149
+ *
150
+ * Requires: productions:scenes:read permission
151
+ */
152
+ async listScenes(productionId) {
153
+ return this.client.get(`${this.basePath}/${productionId}/scenes`);
154
+ }
155
+ /**
156
+ * Activate a scene with an optional transition
157
+ *
158
+ * Sets the scene as the active scene for the production output.
159
+ *
160
+ * Requires: productions:scenes:control permission
161
+ */
162
+ async activateScene(productionId, sceneId, transition) {
163
+ return this.client.post(
164
+ `${this.basePath}/${productionId}/scenes/${sceneId}/activate`,
165
+ transition ? { transition } : void 0
166
+ );
167
+ }
168
+ /**
169
+ * Set the program (live) source with an optional transition
170
+ *
171
+ * Switches the currently live output to the specified source.
172
+ *
173
+ * Requires: productions:control permission
174
+ */
175
+ async setProgram(productionId, sourceId, transition) {
176
+ await this.client.post(`${this.basePath}/${productionId}/program`, {
177
+ source_id: sourceId,
178
+ transition
179
+ });
180
+ }
181
+ /**
182
+ * Set the preview source
183
+ *
184
+ * Loads a source into the preview output for inspection before going live.
185
+ *
186
+ * Requires: productions:control permission
187
+ */
188
+ async setPreview(productionId, sourceId) {
189
+ await this.client.post(`${this.basePath}/${productionId}/preview`, { source_id: sourceId });
190
+ }
191
+ /**
192
+ * Execute a transition between preview and program
193
+ *
194
+ * Swaps the current preview source into program using the specified transition.
195
+ *
196
+ * Requires: productions:control permission
197
+ */
198
+ async transition(productionId, config) {
199
+ await this.client.post(`${this.basePath}/${productionId}/transition`, config);
200
+ }
201
+ /**
202
+ * Add a graphic overlay to a production
203
+ *
204
+ * Requires: productions:graphics:create permission
205
+ */
206
+ async addGraphic(productionId, graphic) {
207
+ return this.client.post(`${this.basePath}/${productionId}/graphics`, graphic);
208
+ }
209
+ /**
210
+ * Update an existing graphic
211
+ *
212
+ * Requires: productions:graphics:update permission
213
+ */
214
+ async updateGraphic(productionId, graphicId, updates) {
215
+ return this.client.patch(
216
+ `${this.basePath}/${productionId}/graphics/${graphicId}`,
217
+ updates
218
+ );
219
+ }
220
+ /**
221
+ * Remove a graphic from a production
222
+ *
223
+ * Requires: productions:graphics:remove permission
224
+ */
225
+ async removeGraphic(productionId, graphicId) {
226
+ await this.client.delete(`${this.basePath}/${productionId}/graphics/${graphicId}`);
227
+ }
228
+ /**
229
+ * Show a graphic on the production output
230
+ *
231
+ * Makes the graphic visible on the live output.
232
+ *
233
+ * Requires: productions:graphics:control permission
234
+ */
235
+ async showGraphic(productionId, graphicId) {
236
+ await this.client.post(`${this.basePath}/${productionId}/graphics/${graphicId}/show`);
237
+ }
238
+ /**
239
+ * Hide a graphic from the production output
240
+ *
241
+ * Removes the graphic from the live output without deleting it.
242
+ *
243
+ * Requires: productions:graphics:control permission
244
+ */
245
+ async hideGraphic(productionId, graphicId) {
246
+ await this.client.post(`${this.basePath}/${productionId}/graphics/${graphicId}/hide`);
247
+ }
248
+ /**
249
+ * Get the current audio mix for a production
250
+ *
251
+ * Returns volume, mute, solo, pan, and processing settings for all channels.
252
+ *
253
+ * Requires: productions:audio:read permission
254
+ */
255
+ async getAudioMix(productionId) {
256
+ return this.client.get(`${this.basePath}/${productionId}/audio-mix`);
257
+ }
258
+ /**
259
+ * Set the audio mix for a production
260
+ *
261
+ * Updates volume, mute, solo, pan, and processing settings for channels.
262
+ *
263
+ * Requires: productions:audio:control permission
264
+ */
265
+ async setAudioMix(productionId, channels) {
266
+ return this.client.put(`${this.basePath}/${productionId}/audio-mix`, {
267
+ channels
268
+ });
269
+ }
270
+ };
271
+ function createStudioAPI(client) {
272
+ return new StudioAPI(client);
273
+ }
274
+
275
+ export {
276
+ StudioAPI,
277
+ createStudioAPI
278
+ };
@@ -0,0 +1,10 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ export {
9
+ __require
10
+ };
@@ -0,0 +1,257 @@
1
+ // src/transcribe.ts
2
+ var TranscribeAPI = class {
3
+ client;
4
+ basePath = "/v1/transcribe";
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Create a transcription job
10
+ *
11
+ * Requires: transcribe:create permission
12
+ */
13
+ async create(request) {
14
+ return this.client.post(this.basePath, request);
15
+ }
16
+ /**
17
+ * Get a transcription by ID
18
+ *
19
+ * Requires: transcribe:read permission
20
+ */
21
+ async get(transcriptionId) {
22
+ return this.client.get(`${this.basePath}/${transcriptionId}`);
23
+ }
24
+ /**
25
+ * Update a transcription
26
+ *
27
+ * Requires: transcribe:update permission
28
+ */
29
+ async update(transcriptionId, request) {
30
+ return this.client.patch(
31
+ `${this.basePath}/${transcriptionId}`,
32
+ request
33
+ );
34
+ }
35
+ /**
36
+ * Remove a transcription
37
+ *
38
+ * Requires: transcribe:remove permission (server-side RBAC enforced)
39
+ */
40
+ async remove(transcriptionId) {
41
+ await this.client.delete(
42
+ `${this.basePath}/${transcriptionId}`,
43
+ { method: "DELETE" }
44
+ );
45
+ }
46
+ /**
47
+ * List transcriptions
48
+ *
49
+ * Requires: transcribe:read permission
50
+ */
51
+ async list(params) {
52
+ return this.client.get(this.basePath, {
53
+ params
54
+ });
55
+ }
56
+ /**
57
+ * Get transcription segments
58
+ *
59
+ * Requires: transcribe:read permission
60
+ */
61
+ async getSegments(transcriptionId, params) {
62
+ return this.client.get(
63
+ `${this.basePath}/${transcriptionId}/segments`,
64
+ { params }
65
+ );
66
+ }
67
+ /**
68
+ * Update a segment
69
+ *
70
+ * Requires: transcribe:update permission
71
+ */
72
+ async updateSegment(transcriptionId, segmentId, updates) {
73
+ return this.client.patch(
74
+ `${this.basePath}/${transcriptionId}/segments/${segmentId}`,
75
+ updates
76
+ );
77
+ }
78
+ /**
79
+ * Merge segments
80
+ *
81
+ * Requires: transcribe:update permission
82
+ */
83
+ async mergeSegments(transcriptionId, segmentIds) {
84
+ return this.client.post(
85
+ `${this.basePath}/${transcriptionId}/segments/merge`,
86
+ { segment_ids: segmentIds }
87
+ );
88
+ }
89
+ /**
90
+ * Split a segment
91
+ *
92
+ * Requires: transcribe:update permission
93
+ */
94
+ async splitSegment(transcriptionId, segmentId, splitTime) {
95
+ return this.client.post(
96
+ `${this.basePath}/${transcriptionId}/segments/${segmentId}/split`,
97
+ { split_time: splitTime }
98
+ );
99
+ }
100
+ /**
101
+ * Get speakers
102
+ *
103
+ * Requires: transcribe:read permission
104
+ */
105
+ async getSpeakers(transcriptionId) {
106
+ return this.client.get(
107
+ `${this.basePath}/${transcriptionId}/speakers`
108
+ );
109
+ }
110
+ /**
111
+ * Update speaker label
112
+ *
113
+ * Requires: transcribe:update permission
114
+ */
115
+ async updateSpeaker(transcriptionId, speakerId, label) {
116
+ return this.client.patch(
117
+ `${this.basePath}/${transcriptionId}/speakers/${speakerId}`,
118
+ { label }
119
+ );
120
+ }
121
+ /**
122
+ * Merge speakers
123
+ *
124
+ * Requires: transcribe:update permission
125
+ */
126
+ async mergeSpeakers(transcriptionId, speakerIds, newLabel) {
127
+ return this.client.post(
128
+ `${this.basePath}/${transcriptionId}/speakers/merge`,
129
+ { speaker_ids: speakerIds, label: newLabel }
130
+ );
131
+ }
132
+ /**
133
+ * Export transcription
134
+ *
135
+ * Requires: transcribe:read permission
136
+ */
137
+ async exportTranscription(transcriptionId, format, options) {
138
+ return this.client.post(`${this.basePath}/${transcriptionId}/export`, {
139
+ format,
140
+ ...options
141
+ });
142
+ }
143
+ /**
144
+ * Get plain text transcript
145
+ *
146
+ * Requires: transcribe:read permission
147
+ */
148
+ async getText(transcriptionId, options) {
149
+ const result = await this.client.get(
150
+ `${this.basePath}/${transcriptionId}/text`,
151
+ { params: options }
152
+ );
153
+ return result.text;
154
+ }
155
+ /**
156
+ * Search within a transcription
157
+ *
158
+ * Requires: transcribe:read permission
159
+ */
160
+ async search(transcriptionId, query, options) {
161
+ return this.client.post(`${this.basePath}/${transcriptionId}/search`, {
162
+ query,
163
+ ...options
164
+ });
165
+ }
166
+ /**
167
+ * Start real-time transcription
168
+ *
169
+ * Requires: transcribe:realtime permission
170
+ */
171
+ async startRealtime(streamId, options) {
172
+ return this.client.post(`${this.basePath}/realtime/start`, {
173
+ stream_id: streamId,
174
+ ...options
175
+ });
176
+ }
177
+ /**
178
+ * Stop real-time transcription
179
+ *
180
+ * Requires: transcribe:realtime permission
181
+ */
182
+ async stopRealtime(sessionId) {
183
+ return this.client.post(
184
+ `${this.basePath}/realtime/${sessionId}/stop`
185
+ );
186
+ }
187
+ /**
188
+ * Get real-time session status
189
+ *
190
+ * Requires: transcribe:read permission
191
+ */
192
+ async getRealtimeStatus(sessionId) {
193
+ return this.client.get(`${this.basePath}/realtime/${sessionId}`);
194
+ }
195
+ /**
196
+ * Wait for transcription to complete
197
+ */
198
+ async waitForReady(transcriptionId, options) {
199
+ const pollInterval = options?.pollInterval || 2e3;
200
+ const timeout = options?.timeout || 18e5;
201
+ const startTime = Date.now();
202
+ while (Date.now() - startTime < timeout) {
203
+ const transcription = await this.get(transcriptionId);
204
+ if (options?.onProgress) {
205
+ options.onProgress(transcription);
206
+ }
207
+ if (transcription.status === "ready") {
208
+ return transcription;
209
+ }
210
+ if (transcription.status === "failed") {
211
+ throw new Error(
212
+ `Transcription failed: ${transcription.error || "Unknown error"}`
213
+ );
214
+ }
215
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
216
+ }
217
+ throw new Error(`Transcription timed out after ${timeout}ms`);
218
+ }
219
+ /**
220
+ * Detect language from audio
221
+ *
222
+ * Requires: transcribe:read permission
223
+ */
224
+ async detectLanguage(sourceUrl) {
225
+ return this.client.post(`${this.basePath}/detect-language`, {
226
+ source_url: sourceUrl
227
+ });
228
+ }
229
+ /**
230
+ * Get supported languages
231
+ *
232
+ * Requires: transcribe:read permission
233
+ */
234
+ async getSupportedLanguages() {
235
+ return this.client.get(`${this.basePath}/languages`);
236
+ }
237
+ /**
238
+ * Estimate transcription cost
239
+ *
240
+ * Requires: transcribe:read permission
241
+ */
242
+ async estimateCost(durationSeconds, model = "standard", options) {
243
+ return this.client.post(`${this.basePath}/estimate`, {
244
+ duration_seconds: durationSeconds,
245
+ model,
246
+ ...options
247
+ });
248
+ }
249
+ };
250
+ function createTranscribeAPI(client) {
251
+ return new TranscribeAPI(client);
252
+ }
253
+
254
+ export {
255
+ TranscribeAPI,
256
+ createTranscribeAPI
257
+ };
@@ -0,0 +1,100 @@
1
+ import {
2
+ __require
3
+ } from "./chunk-Y6FXYEAI.mjs";
4
+
5
+ // src/telemetry.ts
6
+ var SPAN_STATUS_OK = 1;
7
+ var SPAN_STATUS_ERROR = 2;
8
+ var resolvedTracer = null;
9
+ var telemetryEnabled = false;
10
+ function initTelemetry(config) {
11
+ if (!config.enabled) {
12
+ telemetryEnabled = false;
13
+ resolvedTracer = null;
14
+ return;
15
+ }
16
+ try {
17
+ const otelApi = __require("@opentelemetry/api");
18
+ const serviceName = config.serviceName ?? "@wave/sdk";
19
+ resolvedTracer = otelApi.trace.getTracer(serviceName, "2.0.0");
20
+ telemetryEnabled = true;
21
+ } catch {
22
+ telemetryEnabled = false;
23
+ resolvedTracer = null;
24
+ }
25
+ }
26
+ function resetTelemetry() {
27
+ telemetryEnabled = false;
28
+ resolvedTracer = null;
29
+ }
30
+ function isTelemetryEnabled() {
31
+ return telemetryEnabled;
32
+ }
33
+ async function withTelemetry(operationName, fn, attributes) {
34
+ if (!telemetryEnabled || !resolvedTracer) {
35
+ return fn();
36
+ }
37
+ const span = resolvedTracer.startSpan(`wave.sdk.${operationName}`);
38
+ const startTime = performance.now();
39
+ try {
40
+ if (attributes) {
41
+ for (const [key, value] of Object.entries(attributes)) {
42
+ span.setAttribute(key, value);
43
+ }
44
+ }
45
+ const result = await fn();
46
+ const durationMs = performance.now() - startTime;
47
+ span.setAttribute("wave.sdk.method", operationName);
48
+ span.setAttribute("wave.sdk.duration_ms", Math.round(durationMs));
49
+ span.setStatus({ code: SPAN_STATUS_OK });
50
+ span.end();
51
+ return result;
52
+ } catch (error) {
53
+ const durationMs = performance.now() - startTime;
54
+ span.setAttribute("wave.sdk.method", operationName);
55
+ span.setAttribute("wave.sdk.duration_ms", Math.round(durationMs));
56
+ const errorType = error instanceof Error ? error.constructor.name : "UnknownError";
57
+ span.setAttribute("wave.sdk.error_type", errorType);
58
+ span.setStatus({ code: SPAN_STATUS_ERROR });
59
+ span.end();
60
+ throw error;
61
+ }
62
+ }
63
+ function withTelemetrySync(operationName, fn, attributes) {
64
+ if (!telemetryEnabled || !resolvedTracer) {
65
+ return fn();
66
+ }
67
+ const span = resolvedTracer.startSpan(`wave.sdk.${operationName}`);
68
+ const startTime = performance.now();
69
+ try {
70
+ if (attributes) {
71
+ for (const [key, value] of Object.entries(attributes)) {
72
+ span.setAttribute(key, value);
73
+ }
74
+ }
75
+ const result = fn();
76
+ const durationMs = performance.now() - startTime;
77
+ span.setAttribute("wave.sdk.method", operationName);
78
+ span.setAttribute("wave.sdk.duration_ms", Math.round(durationMs));
79
+ span.setStatus({ code: SPAN_STATUS_OK });
80
+ span.end();
81
+ return result;
82
+ } catch (error) {
83
+ const durationMs = performance.now() - startTime;
84
+ span.setAttribute("wave.sdk.method", operationName);
85
+ span.setAttribute("wave.sdk.duration_ms", Math.round(durationMs));
86
+ const errorType = error instanceof Error ? error.constructor.name : "UnknownError";
87
+ span.setAttribute("wave.sdk.error_type", errorType);
88
+ span.setStatus({ code: SPAN_STATUS_ERROR });
89
+ span.end();
90
+ throw error;
91
+ }
92
+ }
93
+
94
+ export {
95
+ initTelemetry,
96
+ resetTelemetry,
97
+ isTelemetryEnabled,
98
+ withTelemetry,
99
+ withTelemetrySync
100
+ };
File without changes
File without changes
File without changes
@@ -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/client-types.ts
17
+ var client_types_exports = {};
18
+ module.exports = __toCommonJS(client_types_exports);
File without changes