@byte_fluffy/nexra-sdk 0.1.0-alpha.26 → 0.1.0-alpha.27
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/README.md +37 -0
- package/dist/catalog.d.ts +2 -2
- package/dist/catalog.js +2 -2
- package/dist/{chunk-73CGYVFV.js → chunk-N622DGTD.js} +363 -2
- package/dist/{chunk-KEAAHI25.js → chunk-YQXMWTSV.js} +4 -0
- package/dist/index.d.ts +19 -5
- package/dist/index.js +35 -2
- package/dist/{media-geometry-CRCAkREf.d.ts → media-geometry-B7ip-nrA.d.ts} +1 -1
- package/dist/media.js +1 -1
- package/dist/{types-CmZz1KmL.d.ts → types-CGOhwG87.d.ts} +31 -2
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,43 @@ available from `@byte_fluffy/nexra-sdk/media`.
|
|
|
37
37
|
The default API base URL is `https://api.nexra-ai.com/v1`. When overriding
|
|
38
38
|
`baseUrl`, include the `/v1` API prefix.
|
|
39
39
|
|
|
40
|
+
## Private ElevenLabs voices
|
|
41
|
+
|
|
42
|
+
Voice design uses `elevenlabs/eleven_multilingual_ttv_v2`, with exactly one prompt
|
|
43
|
+
and one script content part. Preview IDs remain in `task.output.previews`; the
|
|
44
|
+
corresponding audio is returned in the ordered persisted `task.assets` list.
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
const design = await nexra.run("elevenlabs/eleven_multilingual_ttv_v2", {
|
|
48
|
+
content: [
|
|
49
|
+
{ type: "text", role: "prompt", text: "A warm, clear and natural narrator voice." },
|
|
50
|
+
{ type: "text", role: "script", text: previewScript },
|
|
51
|
+
],
|
|
52
|
+
}, { idempotencyKey: designKey });
|
|
53
|
+
const creation = await nexra.voices.create({
|
|
54
|
+
name: "Narrator",
|
|
55
|
+
source: { kind: "design", taskId: design.task.id, previewId: selectedPreviewId },
|
|
56
|
+
}, { idempotencyKey: saveKey });
|
|
57
|
+
await nexra.tasks.wait(creation.taskId);
|
|
58
|
+
const voice = await nexra.voices.get(creation.voice.id);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Cloning is a voice-resource operation, not a separate vendor model. Upload owned
|
|
62
|
+
audio through `nexra.assets.upload`, then call `nexra.voices.create` with
|
|
63
|
+
`source: { kind: "clone", samples: [sample.id] }`. The service accepts one to five
|
|
64
|
+
stored audio samples totaling at most 25 MiB. Retain the sample IDs and the same
|
|
65
|
+
idempotency key when retrying a creation.
|
|
66
|
+
|
|
67
|
+
`nexra.voices.list` and `get` read current authenticated resource state. Only an
|
|
68
|
+
active voice can be used for `elevenlabs/eleven_multilingual_v2` speech, using its
|
|
69
|
+
public `voice_` ID. Creation and synthesis settle separately; creation does not
|
|
70
|
+
imply verification or support for renewal, deletion, or voice conversion.
|
|
71
|
+
|
|
72
|
+
Applications using a shared API key must enforce their own end-user ownership
|
|
73
|
+
before reading or consuming a resource; API-key ownership covers the Nexra
|
|
74
|
+
account, not an application's individual users. Published model choices are
|
|
75
|
+
available through `nexra.models.resources(modelId, resource)`.
|
|
76
|
+
|
|
40
77
|
Static catalog APIs are also available from `@byte_fluffy/nexra-sdk/catalog`.
|
|
41
78
|
Exact non-negative decimal helpers are available from
|
|
42
79
|
`@byte_fluffy/nexra-sdk/decimal`.
|
package/dist/catalog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpTransport, N as NexraSalePriceList, C as CreateNexraQuoteRequest, a as NexraQuote, b as CreateNexraDisplayQuoteBatchRequest, c as NexraDisplayQuoteBatch, d as NexraCatalogRevision, e as NexraModelSpec, f as NexraModelSpecFilter } from './media-geometry-
|
|
2
|
-
export { M as MediaGeometryField, g as MediaGeometryProjection, h as NexraBillingCurrency, i as NexraModelEndpointSpec, j as NexraModelOperation, k as NexraSalePrice, l as NexraSettlement, U as UnifiedMediaGeometry, m as applyMediaGeometry, n as decodeMediaGeometry, o as encodeMediaGeometry, p as projectMediaGeometry } from './media-geometry-
|
|
1
|
+
import { H as HttpTransport, N as NexraSalePriceList, C as CreateNexraQuoteRequest, a as NexraQuote, b as CreateNexraDisplayQuoteBatchRequest, c as NexraDisplayQuoteBatch, d as NexraCatalogRevision, e as NexraModelSpec, f as NexraModelSpecFilter } from './media-geometry-B7ip-nrA.js';
|
|
2
|
+
export { M as MediaGeometryField, g as MediaGeometryProjection, h as NexraBillingCurrency, i as NexraModelEndpointSpec, j as NexraModelOperation, k as NexraSalePrice, l as NexraSettlement, U as UnifiedMediaGeometry, m as applyMediaGeometry, n as decodeMediaGeometry, o as encodeMediaGeometry, p as projectMediaGeometry } from './media-geometry-B7ip-nrA.js';
|
|
3
3
|
import './json-Drjj1OKl.js';
|
|
4
4
|
|
|
5
5
|
declare class CatalogClient {
|
package/dist/catalog.js
CHANGED
|
@@ -1,9 +1,370 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sortRatioDisplayOrder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YQXMWTSV.js";
|
|
4
4
|
|
|
5
5
|
// src/catalog/generated/audio.generated.json
|
|
6
6
|
var audio_generated_default = [
|
|
7
|
+
{
|
|
8
|
+
id: "elevenlabs/eleven_multilingual_ttv_v2",
|
|
9
|
+
contractVersion: 1,
|
|
10
|
+
developer: "elevenlabs",
|
|
11
|
+
displayName: "ElevenLabs Voice Design v2",
|
|
12
|
+
summary: "Design three voice previews from a voice description and preview script. Save a selected preview as a private voice for speech and voice conversion.",
|
|
13
|
+
kind: "audio",
|
|
14
|
+
family: "ElevenLabs Voice Design",
|
|
15
|
+
versionLabel: "2",
|
|
16
|
+
aliases: [],
|
|
17
|
+
capabilities: {
|
|
18
|
+
inputModalities: [
|
|
19
|
+
"text",
|
|
20
|
+
"audio"
|
|
21
|
+
],
|
|
22
|
+
outputModalities: [
|
|
23
|
+
"audio",
|
|
24
|
+
"voice"
|
|
25
|
+
],
|
|
26
|
+
inputModes: [
|
|
27
|
+
"text-to-audio"
|
|
28
|
+
],
|
|
29
|
+
features: [
|
|
30
|
+
"voice-design"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
operations: [
|
|
34
|
+
{
|
|
35
|
+
operation: "audio.generate",
|
|
36
|
+
inputModalities: [
|
|
37
|
+
"text"
|
|
38
|
+
],
|
|
39
|
+
outputModalities: [
|
|
40
|
+
"audio"
|
|
41
|
+
],
|
|
42
|
+
inputSchema: {
|
|
43
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: {
|
|
46
|
+
content: {
|
|
47
|
+
type: "array",
|
|
48
|
+
minItems: 2,
|
|
49
|
+
maxItems: 2,
|
|
50
|
+
items: {
|
|
51
|
+
oneOf: [
|
|
52
|
+
{
|
|
53
|
+
type: "object",
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
required: [
|
|
56
|
+
"type",
|
|
57
|
+
"role",
|
|
58
|
+
"text"
|
|
59
|
+
],
|
|
60
|
+
properties: {
|
|
61
|
+
type: {
|
|
62
|
+
const: "text"
|
|
63
|
+
},
|
|
64
|
+
role: {
|
|
65
|
+
const: "prompt"
|
|
66
|
+
},
|
|
67
|
+
text: {
|
|
68
|
+
type: "string",
|
|
69
|
+
minLength: 20,
|
|
70
|
+
maxLength: 1e3,
|
|
71
|
+
title: "\u97F3\u8272\u63CF\u8FF0"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: "object",
|
|
77
|
+
additionalProperties: false,
|
|
78
|
+
required: [
|
|
79
|
+
"type",
|
|
80
|
+
"role",
|
|
81
|
+
"text"
|
|
82
|
+
],
|
|
83
|
+
properties: {
|
|
84
|
+
type: {
|
|
85
|
+
const: "text"
|
|
86
|
+
},
|
|
87
|
+
role: {
|
|
88
|
+
const: "script"
|
|
89
|
+
},
|
|
90
|
+
text: {
|
|
91
|
+
type: "string",
|
|
92
|
+
minLength: 100,
|
|
93
|
+
maxLength: 1e3,
|
|
94
|
+
title: "\u8BD5\u542C\u6587\u672C"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
allOf: [
|
|
101
|
+
{
|
|
102
|
+
contains: {
|
|
103
|
+
type: "object",
|
|
104
|
+
additionalProperties: false,
|
|
105
|
+
required: [
|
|
106
|
+
"type",
|
|
107
|
+
"role",
|
|
108
|
+
"text"
|
|
109
|
+
],
|
|
110
|
+
properties: {
|
|
111
|
+
type: {
|
|
112
|
+
const: "text"
|
|
113
|
+
},
|
|
114
|
+
role: {
|
|
115
|
+
const: "prompt"
|
|
116
|
+
},
|
|
117
|
+
text: {
|
|
118
|
+
type: "string",
|
|
119
|
+
minLength: 20,
|
|
120
|
+
maxLength: 1e3,
|
|
121
|
+
title: "\u97F3\u8272\u63CF\u8FF0"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
minContains: 1,
|
|
126
|
+
maxContains: 1
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
contains: {
|
|
130
|
+
type: "object",
|
|
131
|
+
additionalProperties: false,
|
|
132
|
+
required: [
|
|
133
|
+
"type",
|
|
134
|
+
"role",
|
|
135
|
+
"text"
|
|
136
|
+
],
|
|
137
|
+
properties: {
|
|
138
|
+
type: {
|
|
139
|
+
const: "text"
|
|
140
|
+
},
|
|
141
|
+
role: {
|
|
142
|
+
const: "script"
|
|
143
|
+
},
|
|
144
|
+
text: {
|
|
145
|
+
type: "string",
|
|
146
|
+
minLength: 100,
|
|
147
|
+
maxLength: 1e3,
|
|
148
|
+
title: "\u8BD5\u542C\u6587\u672C"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
minContains: 1,
|
|
153
|
+
maxContains: 1
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
seed: {
|
|
158
|
+
type: [
|
|
159
|
+
"integer",
|
|
160
|
+
"null"
|
|
161
|
+
],
|
|
162
|
+
minimum: 0,
|
|
163
|
+
maximum: 2147483647,
|
|
164
|
+
"x-ui": {
|
|
165
|
+
order: 22,
|
|
166
|
+
control: "number"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
output_format: {
|
|
170
|
+
type: "string",
|
|
171
|
+
enum: [
|
|
172
|
+
"mp3_22050_32",
|
|
173
|
+
"mp3_24000_48",
|
|
174
|
+
"mp3_44100_32",
|
|
175
|
+
"mp3_44100_64",
|
|
176
|
+
"mp3_44100_96",
|
|
177
|
+
"mp3_44100_128",
|
|
178
|
+
"mp3_44100_192",
|
|
179
|
+
"pcm_8000",
|
|
180
|
+
"pcm_16000",
|
|
181
|
+
"pcm_22050",
|
|
182
|
+
"pcm_24000",
|
|
183
|
+
"pcm_32000",
|
|
184
|
+
"pcm_44100",
|
|
185
|
+
"pcm_48000",
|
|
186
|
+
"ulaw_8000",
|
|
187
|
+
"alaw_8000",
|
|
188
|
+
"opus_48000_32",
|
|
189
|
+
"opus_48000_64",
|
|
190
|
+
"opus_48000_96",
|
|
191
|
+
"opus_48000_128",
|
|
192
|
+
"opus_48000_192"
|
|
193
|
+
],
|
|
194
|
+
default: "mp3_44100_128"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
required: [
|
|
198
|
+
"content"
|
|
199
|
+
],
|
|
200
|
+
additionalProperties: false
|
|
201
|
+
},
|
|
202
|
+
outputSchema: {},
|
|
203
|
+
metering: {
|
|
204
|
+
schemaVersion: 1,
|
|
205
|
+
kind: "non_token",
|
|
206
|
+
metrics: [
|
|
207
|
+
{
|
|
208
|
+
metric: "requests",
|
|
209
|
+
requirement: "required"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
metric: "input_characters",
|
|
213
|
+
requirement: "required"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
metric: "output_audio_seconds",
|
|
217
|
+
requirement: "informational"
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
operation: "voice.create",
|
|
224
|
+
inputModalities: [
|
|
225
|
+
"text"
|
|
226
|
+
],
|
|
227
|
+
outputModalities: [
|
|
228
|
+
"voice"
|
|
229
|
+
],
|
|
230
|
+
inputSchema: {
|
|
231
|
+
type: "object",
|
|
232
|
+
additionalProperties: false,
|
|
233
|
+
required: [
|
|
234
|
+
"name",
|
|
235
|
+
"source"
|
|
236
|
+
],
|
|
237
|
+
properties: {
|
|
238
|
+
name: {
|
|
239
|
+
type: "string",
|
|
240
|
+
minLength: 1,
|
|
241
|
+
maxLength: 255
|
|
242
|
+
},
|
|
243
|
+
source: {
|
|
244
|
+
type: "object",
|
|
245
|
+
additionalProperties: false,
|
|
246
|
+
required: [
|
|
247
|
+
"kind",
|
|
248
|
+
"taskId",
|
|
249
|
+
"previewId"
|
|
250
|
+
],
|
|
251
|
+
properties: {
|
|
252
|
+
kind: {
|
|
253
|
+
const: "design"
|
|
254
|
+
},
|
|
255
|
+
taskId: {
|
|
256
|
+
type: "string",
|
|
257
|
+
minLength: 1
|
|
258
|
+
},
|
|
259
|
+
previewId: {
|
|
260
|
+
type: "string",
|
|
261
|
+
minLength: 1
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
outputSchema: {
|
|
268
|
+
type: "object",
|
|
269
|
+
required: [
|
|
270
|
+
"taskId",
|
|
271
|
+
"voice"
|
|
272
|
+
],
|
|
273
|
+
properties: {
|
|
274
|
+
taskId: {
|
|
275
|
+
type: "string"
|
|
276
|
+
},
|
|
277
|
+
voice: {
|
|
278
|
+
type: "object"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
metering: {
|
|
283
|
+
schemaVersion: 1,
|
|
284
|
+
kind: "non_token",
|
|
285
|
+
metrics: [
|
|
286
|
+
{
|
|
287
|
+
metric: "requests",
|
|
288
|
+
requirement: "required"
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
operation: "voice.clone",
|
|
295
|
+
inputModalities: [
|
|
296
|
+
"audio"
|
|
297
|
+
],
|
|
298
|
+
outputModalities: [
|
|
299
|
+
"voice"
|
|
300
|
+
],
|
|
301
|
+
inputSchema: {
|
|
302
|
+
type: "object",
|
|
303
|
+
additionalProperties: false,
|
|
304
|
+
required: [
|
|
305
|
+
"name",
|
|
306
|
+
"source"
|
|
307
|
+
],
|
|
308
|
+
properties: {
|
|
309
|
+
name: {
|
|
310
|
+
type: "string",
|
|
311
|
+
minLength: 1,
|
|
312
|
+
maxLength: 255
|
|
313
|
+
},
|
|
314
|
+
source: {
|
|
315
|
+
type: "object",
|
|
316
|
+
additionalProperties: false,
|
|
317
|
+
required: [
|
|
318
|
+
"kind",
|
|
319
|
+
"samples"
|
|
320
|
+
],
|
|
321
|
+
properties: {
|
|
322
|
+
kind: {
|
|
323
|
+
const: "clone"
|
|
324
|
+
},
|
|
325
|
+
samples: {
|
|
326
|
+
type: "array",
|
|
327
|
+
minItems: 1,
|
|
328
|
+
maxItems: 5,
|
|
329
|
+
uniqueItems: true,
|
|
330
|
+
items: {
|
|
331
|
+
type: "string",
|
|
332
|
+
format: "uuid"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
outputSchema: {
|
|
340
|
+
type: "object",
|
|
341
|
+
required: [
|
|
342
|
+
"taskId",
|
|
343
|
+
"voice"
|
|
344
|
+
],
|
|
345
|
+
properties: {
|
|
346
|
+
taskId: {
|
|
347
|
+
type: "string"
|
|
348
|
+
},
|
|
349
|
+
voice: {
|
|
350
|
+
type: "object"
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
metering: {
|
|
355
|
+
schemaVersion: 1,
|
|
356
|
+
kind: "non_token",
|
|
357
|
+
metrics: [
|
|
358
|
+
{
|
|
359
|
+
metric: "requests",
|
|
360
|
+
requirement: "required"
|
|
361
|
+
}
|
|
362
|
+
]
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
],
|
|
366
|
+
endpoints: []
|
|
367
|
+
},
|
|
7
368
|
{
|
|
8
369
|
id: "bytedance/doubao-tts-v1",
|
|
9
370
|
contractVersion: 1,
|
|
@@ -40753,7 +41114,7 @@ var NexraWaitTimeoutError = class extends Error {
|
|
|
40753
41114
|
};
|
|
40754
41115
|
|
|
40755
41116
|
// src/generated/version.generated.ts
|
|
40756
|
-
var SDK_VERSION = "0.1.0-alpha.
|
|
41117
|
+
var SDK_VERSION = "0.1.0-alpha.27";
|
|
40757
41118
|
|
|
40758
41119
|
// src/transport.ts
|
|
40759
41120
|
var DEFAULT_BASE_URL = "https://api.nexra-ai.com/v1";
|
|
@@ -231,6 +231,10 @@ function isNexraMediaInput(value) {
|
|
|
231
231
|
return Array.isArray(content) && content.length > 0 && content.every((part) => {
|
|
232
232
|
if (!part || typeof part !== "object" || Array.isArray(part)) return false;
|
|
233
233
|
if (part.type === "text") return typeof part.text === "string" && part.text.length > 0;
|
|
234
|
+
if (part.type === "draft_task") {
|
|
235
|
+
const reference = part.draft_task;
|
|
236
|
+
return Boolean(reference && typeof reference === "object" && !Array.isArray(reference) && typeof reference.id === "string" && reference.id.length > 0);
|
|
237
|
+
}
|
|
234
238
|
if (!["image", "video", "audio"].includes(String(part.type))) return false;
|
|
235
239
|
if (typeof part.source === "string") return part.source.length > 0;
|
|
236
240
|
return Boolean(part.source && typeof part.source === "object" && !Array.isArray(part.source) && typeof part.source.assetId === "string" && part.source.assetId.length > 0);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { a as AssetImportRequest, b as AssetInput, A as AssetReference, c as AssetUploadOptions, M as MEDIA_KINDS, d as MediaAsset, e as MediaAssetStatus, f as MediaKind } from './assets-dUJMQNJD.js';
|
|
2
|
-
import { H as HttpTransport, q as ModelSearchParams, T as TaskModelSummary, r as TaskModel, s as ModelSchema, t as NexraClientOptions } from './media-geometry-
|
|
3
|
-
export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, g as MediaGeometryProjection,
|
|
2
|
+
import { H as HttpTransport, q as ModelSearchParams, T as TaskModelSummary, r as TaskModel, s as ModelSchema, t as ModelResourceList, u as NexraClientOptions } from './media-geometry-B7ip-nrA.js';
|
|
3
|
+
export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, g as MediaGeometryProjection, v as ModelCapabilitySummary, w as ModelDateVersion, x as ModelEndpointSummary, y as ModelModality, z as ModelResourceOption, h as NexraBillingCurrency, d as NexraCatalogRevision, c as NexraDisplayQuoteBatch, A as NexraDisplayQuoteBatchEntry, j as NexraModelOperation, e as NexraModelSpec, f as NexraModelSpecFilter, a as NexraQuote, k as NexraSalePrice, N as NexraSalePriceList, l as NexraSettlement, U as UnifiedMediaGeometry, m as applyMediaGeometry, n as decodeMediaGeometry, o as encodeMediaGeometry, p as projectMediaGeometry } from './media-geometry-B7ip-nrA.js';
|
|
4
4
|
import { C as CursorPage, a as JsonValue } from './json-Drjj1OKl.js';
|
|
5
5
|
export { J as JsonObject, b as JsonPrimitive } from './json-Drjj1OKl.js';
|
|
6
|
-
import { A as AssetsClient, T as TasksClient, R as RunTaskOptions,
|
|
7
|
-
export {
|
|
6
|
+
import { V as Voice, C as CreateVoiceRequest, a as VoiceCreation, A as AssetsClient, T as TasksClient, R as RunTaskOptions, b as RunResult, c as ApiErrorPayload, d as TaskResult } from './types-CGOhwG87.js';
|
|
7
|
+
export { e as CreateTaskOptions, f as CreateTaskRequest, g as RequestDetails, h as TASK_STATUSES, i as Task, j as TaskCost, k as TaskError, l as TaskEvent, m as TaskEventType, n as TaskListParams, o as TaskPage, p as TaskProgress, q as TaskReceipt, r as TaskStatus, s as TaskTiming, t as TaskUsage, u as TaskWebhookConfig, v as TerminalTaskStatus, w as VerifyWebhookOptions, W as WaitTaskOptions, x as WatchTaskOptions, y as isTerminalTaskStatus, z as verifyWebhook } from './types-CGOhwG87.js';
|
|
8
8
|
import { CatalogClient } from './catalog.js';
|
|
9
9
|
export { getModelSpec, listModelSpecs } from './catalog.js';
|
|
10
10
|
export { ceilDecimal, multiplyDecimal } from './decimal.js';
|
|
@@ -15,6 +15,19 @@ declare class ModelsClient {
|
|
|
15
15
|
search(params?: ModelSearchParams, signal?: AbortSignal): Promise<CursorPage<TaskModelSummary>>;
|
|
16
16
|
get(model: string, signal?: AbortSignal): Promise<TaskModel>;
|
|
17
17
|
schema(model: string, signal?: AbortSignal): Promise<ModelSchema>;
|
|
18
|
+
resources(model: string, resource: string, signal?: AbortSignal): Promise<ModelResourceList>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type CreateVoiceOptions = Readonly<{
|
|
22
|
+
idempotencyKey: string;
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}>;
|
|
25
|
+
declare class VoicesClient {
|
|
26
|
+
private readonly transport;
|
|
27
|
+
constructor(transport: HttpTransport);
|
|
28
|
+
list(signal?: AbortSignal): Promise<readonly Voice[]>;
|
|
29
|
+
get(voiceId: string, signal?: AbortSignal): Promise<Voice>;
|
|
30
|
+
create(request: CreateVoiceRequest, options: CreateVoiceOptions): Promise<VoiceCreation>;
|
|
18
31
|
}
|
|
19
32
|
|
|
20
33
|
declare class NexraClient {
|
|
@@ -22,6 +35,7 @@ declare class NexraClient {
|
|
|
22
35
|
readonly catalog: CatalogClient;
|
|
23
36
|
readonly models: ModelsClient;
|
|
24
37
|
readonly tasks: TasksClient;
|
|
38
|
+
readonly voices: VoicesClient;
|
|
25
39
|
constructor(options?: NexraClientOptions);
|
|
26
40
|
run<TOutput = JsonValue, TInput = Record<string, unknown>>(model: string, input: TInput, options?: RunTaskOptions): Promise<RunResult<TOutput>>;
|
|
27
41
|
}
|
|
@@ -51,4 +65,4 @@ declare class NexraWaitTimeoutError extends Error {
|
|
|
51
65
|
constructor(taskId: string, timeoutMs: number);
|
|
52
66
|
}
|
|
53
67
|
|
|
54
|
-
export { ApiErrorPayload, AssetsClient, CatalogClient, CursorPage, JsonValue, ModelSchema, ModelSearchParams, ModelsClient, NexraApiError, NexraClient, NexraClientOptions, NexraTaskError, NexraWaitTimeoutError, RunResult, RunTaskOptions, TaskModel, TaskModelSummary, TaskResult, TasksClient, createNexra };
|
|
68
|
+
export { ApiErrorPayload, AssetsClient, CatalogClient, type CreateVoiceOptions, CreateVoiceRequest, CursorPage, JsonValue, ModelResourceList, ModelSchema, ModelSearchParams, ModelsClient, NexraApiError, NexraClient, NexraClientOptions, NexraTaskError, NexraWaitTimeoutError, RunResult, RunTaskOptions, TaskModel, TaskModelSummary, TaskResult, TasksClient, Voice, VoiceCreation, VoicesClient, createNexra };
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
projectMediaGeometry,
|
|
15
15
|
queryString,
|
|
16
16
|
sleep
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-N622DGTD.js";
|
|
18
18
|
import {
|
|
19
19
|
ceilDecimal,
|
|
20
20
|
multiplyDecimal
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
TASK_STATUSES,
|
|
25
25
|
createTaskRequest,
|
|
26
26
|
isTerminalTaskStatus
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-YQXMWTSV.js";
|
|
28
28
|
|
|
29
29
|
// src/assets.ts
|
|
30
30
|
var AssetsClient = class {
|
|
@@ -162,6 +162,36 @@ var ModelsClient = class {
|
|
|
162
162
|
{ signal }
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
|
+
resources(model, resource, signal) {
|
|
166
|
+
return this.transport.json(
|
|
167
|
+
`/models/${encodeURIComponent(model)}/resources/${encodeURIComponent(resource)}`,
|
|
168
|
+
{ signal }
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// src/voices.ts
|
|
174
|
+
var VoicesClient = class {
|
|
175
|
+
constructor(transport) {
|
|
176
|
+
this.transport = transport;
|
|
177
|
+
}
|
|
178
|
+
transport;
|
|
179
|
+
async list(signal) {
|
|
180
|
+
const response = await this.transport.json("/voices", { signal });
|
|
181
|
+
return response.data;
|
|
182
|
+
}
|
|
183
|
+
get(voiceId, signal) {
|
|
184
|
+
return this.transport.json(`/voices/${encodeURIComponent(voiceId)}`, { signal });
|
|
185
|
+
}
|
|
186
|
+
create(request, options) {
|
|
187
|
+
if (!options.idempotencyKey.trim()) throw new TypeError("Idempotency-Key is required");
|
|
188
|
+
return this.transport.json("/voices", {
|
|
189
|
+
method: "POST",
|
|
190
|
+
...jsonBody(request),
|
|
191
|
+
headers: { "content-type": "application/json", "idempotency-key": options.idempotencyKey },
|
|
192
|
+
signal: options.signal
|
|
193
|
+
}, { retryable: true });
|
|
194
|
+
}
|
|
165
195
|
};
|
|
166
196
|
|
|
167
197
|
// src/input.ts
|
|
@@ -434,12 +464,14 @@ var NexraClient = class {
|
|
|
434
464
|
catalog;
|
|
435
465
|
models;
|
|
436
466
|
tasks;
|
|
467
|
+
voices;
|
|
437
468
|
constructor(options = {}) {
|
|
438
469
|
const transport = new HttpTransport(options);
|
|
439
470
|
this.assets = new AssetsClient(transport);
|
|
440
471
|
this.catalog = new CatalogClient(transport);
|
|
441
472
|
this.models = new ModelsClient(transport);
|
|
442
473
|
this.tasks = new TasksClient(transport, this.assets);
|
|
474
|
+
this.voices = new VoicesClient(transport);
|
|
443
475
|
}
|
|
444
476
|
run(model, input, options = {}) {
|
|
445
477
|
return this.tasks.run(model, input, options);
|
|
@@ -501,6 +533,7 @@ export {
|
|
|
501
533
|
NexraWaitTimeoutError,
|
|
502
534
|
TASK_STATUSES,
|
|
503
535
|
TasksClient,
|
|
536
|
+
VoicesClient,
|
|
504
537
|
applyMediaGeometry,
|
|
505
538
|
ceilDecimal,
|
|
506
539
|
createNexra,
|
|
@@ -329,4 +329,4 @@ declare function decodeMediaGeometry(_inputSchema: JsonObject, input: JsonObject
|
|
|
329
329
|
/** Normalize the SDK convenience alias `ratio` without producing Native fields. */
|
|
330
330
|
declare function applyMediaGeometry(inputSchema: JsonObject, input: JsonObject): JsonObject;
|
|
331
331
|
|
|
332
|
-
export { type NexraDisplayQuoteBatchEntry as A, type CreateNexraQuoteRequest as C, type FetchLike as F, HttpTransport as H, type MediaGeometryField as M, type NexraSalePriceList as N, type TaskModelSummary as T, type UnifiedMediaGeometry as U, type NexraQuote as a, type CreateNexraDisplayQuoteBatchRequest as b, type NexraDisplayQuoteBatch as c, type NexraCatalogRevision as d, type NexraModelSpec as e, type NexraModelSpecFilter as f, type MediaGeometryProjection as g, type NexraBillingCurrency as h, type NexraModelEndpointSpec as i, type NexraModelOperation as j, type NexraSalePrice as k, type NexraSettlement as l, applyMediaGeometry as m, decodeMediaGeometry as n, encodeMediaGeometry as o, projectMediaGeometry as p, type ModelSearchParams as q, type TaskModel as r, type ModelSchema as s, type
|
|
332
|
+
export { type NexraDisplayQuoteBatchEntry as A, type CreateNexraQuoteRequest as C, type FetchLike as F, HttpTransport as H, type MediaGeometryField as M, type NexraSalePriceList as N, type TaskModelSummary as T, type UnifiedMediaGeometry as U, type NexraQuote as a, type CreateNexraDisplayQuoteBatchRequest as b, type NexraDisplayQuoteBatch as c, type NexraCatalogRevision as d, type NexraModelSpec as e, type NexraModelSpecFilter as f, type MediaGeometryProjection as g, type NexraBillingCurrency as h, type NexraModelEndpointSpec as i, type NexraModelOperation as j, type NexraSalePrice as k, type NexraSettlement as l, applyMediaGeometry as m, decodeMediaGeometry as n, encodeMediaGeometry as o, projectMediaGeometry as p, type ModelSearchParams as q, type TaskModel as r, type ModelSchema as s, type ModelResourceList as t, type NexraClientOptions as u, type ModelCapabilitySummary as v, type ModelDateVersion as w, type ModelEndpointSummary as x, type ModelModality as y, type ModelResourceOption as z };
|
package/dist/media.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as MediaAsset, c as AssetUploadOptions, a as AssetImportRequest, g as AssetCertificationRequest, h as AssetCertification, i as AssetCertificationWaitOptions } from './assets-dUJMQNJD.js';
|
|
2
|
-
import { l as NexraSettlement, H as HttpTransport } from './media-geometry-
|
|
2
|
+
import { l as NexraSettlement, H as HttpTransport } from './media-geometry-B7ip-nrA.js';
|
|
3
3
|
import { J as JsonObject, a as JsonValue, C as CursorPage } from './json-Drjj1OKl.js';
|
|
4
4
|
|
|
5
5
|
interface ApiErrorPayload {
|
|
@@ -237,6 +237,35 @@ interface RunResult<TOutput = JsonValue> {
|
|
|
237
237
|
}
|
|
238
238
|
declare function isTerminalTaskStatus(status: TaskStatus): status is TerminalTaskStatus;
|
|
239
239
|
|
|
240
|
+
type Voice = Readonly<{
|
|
241
|
+
id: string;
|
|
242
|
+
provider: "elevenlabs";
|
|
243
|
+
source: "design" | "clone";
|
|
244
|
+
sourceTaskId?: string;
|
|
245
|
+
previewId?: string;
|
|
246
|
+
name: string;
|
|
247
|
+
status: "processing" | "active" | "verification_required" | "failed" | "expired" | "deleted";
|
|
248
|
+
previewUrl?: string;
|
|
249
|
+
requiresVerification?: boolean;
|
|
250
|
+
createdAt: string;
|
|
251
|
+
expiresAt?: string;
|
|
252
|
+
}>;
|
|
253
|
+
type CreateVoiceRequest = Readonly<{
|
|
254
|
+
name: string;
|
|
255
|
+
source: Readonly<{
|
|
256
|
+
kind: "design";
|
|
257
|
+
taskId: string;
|
|
258
|
+
previewId: string;
|
|
259
|
+
}> | Readonly<{
|
|
260
|
+
kind: "clone";
|
|
261
|
+
samples: readonly string[];
|
|
262
|
+
}>;
|
|
263
|
+
}>;
|
|
264
|
+
type VoiceCreation = Readonly<{
|
|
265
|
+
taskId: string;
|
|
266
|
+
voice: Voice;
|
|
267
|
+
}>;
|
|
268
|
+
|
|
240
269
|
declare class AssetsClient {
|
|
241
270
|
private readonly transport;
|
|
242
271
|
constructor(transport: HttpTransport);
|
|
@@ -294,4 +323,4 @@ interface VerifyWebhookOptions {
|
|
|
294
323
|
/** @deprecated Only verifies legacy signed webhooks, not callback_url notifications. */
|
|
295
324
|
declare function verifyWebhook(request: Request, secret: string, options?: VerifyWebhookOptions): Promise<boolean>;
|
|
296
325
|
|
|
297
|
-
export { AssetsClient as A, type
|
|
326
|
+
export { AssetsClient as A, type CreateVoiceRequest as C, type RunTaskOptions as R, TasksClient as T, type Voice as V, type WaitTaskOptions as W, type VoiceCreation as a, type RunResult as b, type ApiErrorPayload as c, type TaskResult as d, type CreateTaskOptions as e, type CreateTaskRequest as f, type RequestDetails as g, TASK_STATUSES as h, type Task as i, type TaskCost as j, type TaskError as k, type TaskEvent as l, type TaskEventType as m, type TaskListParams as n, type TaskPage as o, type TaskProgress as p, type TaskReceipt as q, type TaskStatus as r, type TaskTiming as s, type TaskUsage as t, type TaskWebhookConfig as u, type TerminalTaskStatus as v, type VerifyWebhookOptions as w, type WatchTaskOptions as x, isTerminalTaskStatus as y, verifyWebhook as z };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { a as AssetImportRequest, b as AssetInput, A as AssetReference, c as AssetUploadOptions, d as MediaAsset, e as MediaAssetStatus, f as MediaKind } from './assets-dUJMQNJD.js';
|
|
2
|
-
export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, g as MediaGeometryProjection,
|
|
2
|
+
export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, g as MediaGeometryProjection, v as ModelCapabilitySummary, w as ModelDateVersion, x as ModelEndpointSummary, y as ModelModality, t as ModelResourceList, z as ModelResourceOption, s as ModelSchema, q as ModelSearchParams, h as NexraBillingCurrency, d as NexraCatalogRevision, u as NexraClientOptions, c as NexraDisplayQuoteBatch, A as NexraDisplayQuoteBatchEntry, j as NexraModelOperation, e as NexraModelSpec, f as NexraModelSpecFilter, a as NexraQuote, k as NexraSalePrice, N as NexraSalePriceList, l as NexraSettlement, r as TaskModel, T as TaskModelSummary, U as UnifiedMediaGeometry } from './media-geometry-B7ip-nrA.js';
|
|
3
3
|
export { C as CursorPage, J as JsonObject, b as JsonPrimitive, a as JsonValue } from './json-Drjj1OKl.js';
|
|
4
|
-
export {
|
|
4
|
+
export { c as ApiErrorPayload, e as CreateTaskOptions, f as CreateTaskRequest, C as CreateVoiceRequest, g as RequestDetails, b as RunResult, R as RunTaskOptions, i as Task, j as TaskCost, k as TaskError, l as TaskEvent, m as TaskEventType, n as TaskListParams, o as TaskPage, p as TaskProgress, q as TaskReceipt, d as TaskResult, r as TaskStatus, s as TaskTiming, t as TaskUsage, u as TaskWebhookConfig, v as TerminalTaskStatus, w as VerifyWebhookOptions, V as Voice, a as VoiceCreation, W as WaitTaskOptions, x as WatchTaskOptions } from './types-CGOhwG87.js';
|