audiopod 2.1.0 → 2.2.0

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/dist/index.js CHANGED
@@ -110,7 +110,7 @@ var Transcription = class {
110
110
  if (urls.length === 0) {
111
111
  throw new Error("At least one URL is required");
112
112
  }
113
- return this.client.post("/api/v1/transcribe/transcribe", {
113
+ return this.client.post("/api/v1/transcription/transcribe", {
114
114
  source_urls: urls,
115
115
  language: params.language,
116
116
  enable_speaker_diarization: params.speakerDiarization ?? false,
@@ -131,7 +131,7 @@ var Transcription = class {
131
131
  * ```
132
132
  */
133
133
  async upload(params) {
134
- return this.client.upload("/api/v1/transcribe/transcribe-upload", params.file, "files", {
134
+ return this.client.upload("/api/v1/transcription/transcribe-upload", params.file, "files", {
135
135
  language: params.language,
136
136
  enable_speaker_diarization: params.speakerDiarization ?? false
137
137
  });
@@ -140,13 +140,13 @@ var Transcription = class {
140
140
  * Get a transcription job by ID
141
141
  */
142
142
  async get(jobId) {
143
- return this.client.get(`/api/v1/transcribe/jobs/${jobId}`);
143
+ return this.client.get(`/api/v1/transcription/jobs/${jobId}`);
144
144
  }
145
145
  /**
146
146
  * List transcription jobs
147
147
  */
148
148
  async list(params = {}) {
149
- return this.client.get("/api/v1/transcribe/jobs", {
149
+ return this.client.get("/api/v1/transcription/jobs", {
150
150
  offset: params.skip ?? 0,
151
151
  limit: params.limit ?? 50,
152
152
  status: params.status
@@ -156,7 +156,7 @@ var Transcription = class {
156
156
  * Delete a transcription job
157
157
  */
158
158
  async delete(jobId) {
159
- await this.client.delete(`/api/v1/transcribe/jobs/${jobId}`);
159
+ await this.client.delete(`/api/v1/transcription/jobs/${jobId}`);
160
160
  }
161
161
  /**
162
162
  * Get transcript content
@@ -164,7 +164,7 @@ var Transcription = class {
164
164
  * @param format - Output format: 'json', 'txt', 'srt', 'vtt'
165
165
  */
166
166
  async getTranscript(jobId, format = "json") {
167
- return this.client.get(`/api/v1/transcribe/jobs/${jobId}/transcript`, { format });
167
+ return this.client.get(`/api/v1/transcription/jobs/${jobId}/transcript`, { format });
168
168
  }
169
169
  /**
170
170
  * Wait for a transcription job to complete
@@ -213,13 +213,13 @@ var Voice = class {
213
213
  * List all voices
214
214
  */
215
215
  async list() {
216
- return this.client.get("/api/v1/voice/voices");
216
+ return this.client.get("/api/v1/voice/voice-profiles");
217
217
  }
218
218
  /**
219
219
  * Get a voice by ID
220
220
  */
221
221
  async get(voiceId) {
222
- return this.client.get(`/api/v1/voice/voices/${voiceId}`);
222
+ return this.client.get(`/api/v1/voice/voices/${voiceId}/status`);
223
223
  }
224
224
  /**
225
225
  * Create a new voice clone
@@ -233,7 +233,7 @@ var Voice = class {
233
233
  * ```
234
234
  */
235
235
  async create(params) {
236
- return this.client.upload("/api/v1/voice/voices", params.audioFile, "audio_file", {
236
+ return this.client.upload("/api/v1/voice/voice-profiles", params.audioFile, "file", {
237
237
  name: params.name,
238
238
  description: params.description
239
239
  });
@@ -256,9 +256,8 @@ var Voice = class {
256
256
  * ```
257
257
  */
258
258
  async speak(params) {
259
- return this.client.post("/api/v1/voice/tts/generate", {
260
- text: params.text,
261
- voice_id: params.voiceId,
259
+ return this.client.post(`/api/v1/voice/voices/${params.voiceId}/generate`, {
260
+ input_text: params.text,
262
261
  speed: params.speed ?? 1
263
262
  });
264
263
  }
@@ -266,7 +265,7 @@ var Voice = class {
266
265
  * Get TTS job status
267
266
  */
268
267
  async getJob(jobId) {
269
- return this.client.get(`/api/v1/voice/tts/status/${jobId}`);
268
+ return this.client.get(`/api/v1/voice/tts-jobs/${jobId}/status`);
270
269
  }
271
270
  /**
272
271
  * Wait for TTS job to complete
@@ -275,10 +274,11 @@ var Voice = class {
275
274
  const startTime = Date.now();
276
275
  while (Date.now() - startTime < timeout) {
277
276
  const job = await this.getJob(jobId);
278
- if (job.status === "COMPLETED") {
277
+ const status = job.status?.toLowerCase();
278
+ if (status === "completed") {
279
279
  return job;
280
280
  }
281
- if (job.status === "FAILED") {
281
+ if (status === "failed" || status === "error") {
282
282
  throw new Error(`TTS generation failed: ${job.error_message || "Unknown error"}`);
283
283
  }
284
284
  await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL2));
package/dist/index.mjs CHANGED
@@ -67,7 +67,7 @@ var Transcription = class {
67
67
  if (urls.length === 0) {
68
68
  throw new Error("At least one URL is required");
69
69
  }
70
- return this.client.post("/api/v1/transcribe/transcribe", {
70
+ return this.client.post("/api/v1/transcription/transcribe", {
71
71
  source_urls: urls,
72
72
  language: params.language,
73
73
  enable_speaker_diarization: params.speakerDiarization ?? false,
@@ -88,7 +88,7 @@ var Transcription = class {
88
88
  * ```
89
89
  */
90
90
  async upload(params) {
91
- return this.client.upload("/api/v1/transcribe/transcribe-upload", params.file, "files", {
91
+ return this.client.upload("/api/v1/transcription/transcribe-upload", params.file, "files", {
92
92
  language: params.language,
93
93
  enable_speaker_diarization: params.speakerDiarization ?? false
94
94
  });
@@ -97,13 +97,13 @@ var Transcription = class {
97
97
  * Get a transcription job by ID
98
98
  */
99
99
  async get(jobId) {
100
- return this.client.get(`/api/v1/transcribe/jobs/${jobId}`);
100
+ return this.client.get(`/api/v1/transcription/jobs/${jobId}`);
101
101
  }
102
102
  /**
103
103
  * List transcription jobs
104
104
  */
105
105
  async list(params = {}) {
106
- return this.client.get("/api/v1/transcribe/jobs", {
106
+ return this.client.get("/api/v1/transcription/jobs", {
107
107
  offset: params.skip ?? 0,
108
108
  limit: params.limit ?? 50,
109
109
  status: params.status
@@ -113,7 +113,7 @@ var Transcription = class {
113
113
  * Delete a transcription job
114
114
  */
115
115
  async delete(jobId) {
116
- await this.client.delete(`/api/v1/transcribe/jobs/${jobId}`);
116
+ await this.client.delete(`/api/v1/transcription/jobs/${jobId}`);
117
117
  }
118
118
  /**
119
119
  * Get transcript content
@@ -121,7 +121,7 @@ var Transcription = class {
121
121
  * @param format - Output format: 'json', 'txt', 'srt', 'vtt'
122
122
  */
123
123
  async getTranscript(jobId, format = "json") {
124
- return this.client.get(`/api/v1/transcribe/jobs/${jobId}/transcript`, { format });
124
+ return this.client.get(`/api/v1/transcription/jobs/${jobId}/transcript`, { format });
125
125
  }
126
126
  /**
127
127
  * Wait for a transcription job to complete
@@ -170,13 +170,13 @@ var Voice = class {
170
170
  * List all voices
171
171
  */
172
172
  async list() {
173
- return this.client.get("/api/v1/voice/voices");
173
+ return this.client.get("/api/v1/voice/voice-profiles");
174
174
  }
175
175
  /**
176
176
  * Get a voice by ID
177
177
  */
178
178
  async get(voiceId) {
179
- return this.client.get(`/api/v1/voice/voices/${voiceId}`);
179
+ return this.client.get(`/api/v1/voice/voices/${voiceId}/status`);
180
180
  }
181
181
  /**
182
182
  * Create a new voice clone
@@ -190,7 +190,7 @@ var Voice = class {
190
190
  * ```
191
191
  */
192
192
  async create(params) {
193
- return this.client.upload("/api/v1/voice/voices", params.audioFile, "audio_file", {
193
+ return this.client.upload("/api/v1/voice/voice-profiles", params.audioFile, "file", {
194
194
  name: params.name,
195
195
  description: params.description
196
196
  });
@@ -213,9 +213,8 @@ var Voice = class {
213
213
  * ```
214
214
  */
215
215
  async speak(params) {
216
- return this.client.post("/api/v1/voice/tts/generate", {
217
- text: params.text,
218
- voice_id: params.voiceId,
216
+ return this.client.post(`/api/v1/voice/voices/${params.voiceId}/generate`, {
217
+ input_text: params.text,
219
218
  speed: params.speed ?? 1
220
219
  });
221
220
  }
@@ -223,7 +222,7 @@ var Voice = class {
223
222
  * Get TTS job status
224
223
  */
225
224
  async getJob(jobId) {
226
- return this.client.get(`/api/v1/voice/tts/status/${jobId}`);
225
+ return this.client.get(`/api/v1/voice/tts-jobs/${jobId}/status`);
227
226
  }
228
227
  /**
229
228
  * Wait for TTS job to complete
@@ -232,10 +231,11 @@ var Voice = class {
232
231
  const startTime = Date.now();
233
232
  while (Date.now() - startTime < timeout) {
234
233
  const job = await this.getJob(jobId);
235
- if (job.status === "COMPLETED") {
234
+ const status = job.status?.toLowerCase();
235
+ if (status === "completed") {
236
236
  return job;
237
237
  }
238
- if (job.status === "FAILED") {
238
+ if (status === "failed" || status === "error") {
239
239
  throw new Error(`TTS generation failed: ${job.error_message || "Unknown error"}`);
240
240
  }
241
241
  await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "audiopod",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Official AudioPod SDK for Node.js - Professional Audio Processing powered by AI",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",