@vargai/gateway 0.1.6 → 0.1.7
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/client.d.ts +29 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +76 -36
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -16,18 +16,35 @@ export interface WaitForJobOptions {
|
|
|
16
16
|
export interface VoiceInfo {
|
|
17
17
|
voice_id: string;
|
|
18
18
|
name: string;
|
|
19
|
-
category: string;
|
|
19
|
+
category: string | null;
|
|
20
20
|
labels: {
|
|
21
|
-
gender
|
|
22
|
-
age
|
|
23
|
-
accent
|
|
24
|
-
description
|
|
25
|
-
use_case
|
|
21
|
+
gender: string | null;
|
|
22
|
+
age: string | null;
|
|
23
|
+
accent: string | null;
|
|
24
|
+
description: string | null;
|
|
25
|
+
use_case: string | null;
|
|
26
26
|
};
|
|
27
|
-
preview_url
|
|
27
|
+
preview_url: string | null;
|
|
28
|
+
is_curated: boolean;
|
|
29
|
+
usage_count: number;
|
|
28
30
|
}
|
|
29
31
|
export interface VoiceListResponse {
|
|
30
32
|
voices: VoiceInfo[];
|
|
33
|
+
total: number;
|
|
34
|
+
page: number;
|
|
35
|
+
page_size: number;
|
|
36
|
+
}
|
|
37
|
+
export interface VoiceSearchParams {
|
|
38
|
+
search?: string;
|
|
39
|
+
category?: string;
|
|
40
|
+
gender?: string;
|
|
41
|
+
age?: string;
|
|
42
|
+
accent?: string;
|
|
43
|
+
is_curated?: boolean;
|
|
44
|
+
page?: number;
|
|
45
|
+
page_size?: number;
|
|
46
|
+
sort_by?: "usage_count" | "name" | "created_at";
|
|
47
|
+
sort_order?: "asc" | "desc";
|
|
31
48
|
}
|
|
32
49
|
export declare class VargGatewayError extends Error {
|
|
33
50
|
statusCode?: number | undefined;
|
|
@@ -47,7 +64,11 @@ export declare class VargClient {
|
|
|
47
64
|
createSpeech(params: SpeechRequest): Promise<JobResponse>;
|
|
48
65
|
createMusic(params: MusicRequest): Promise<JobResponse>;
|
|
49
66
|
uploadFile(file: Blob | Buffer, mediaType: string): Promise<FileUploadResponse>;
|
|
50
|
-
listVoices(): Promise<VoiceListResponse>;
|
|
67
|
+
listVoices(params?: VoiceSearchParams): Promise<VoiceListResponse>;
|
|
68
|
+
syncVoices(): Promise<{
|
|
69
|
+
status: string;
|
|
70
|
+
message: string;
|
|
71
|
+
}>;
|
|
51
72
|
getJob(id: string): Promise<JobResponse>;
|
|
52
73
|
cancelJob(id: string): Promise<void>;
|
|
53
74
|
waitForJob(id: string, options?: WaitForJobOptions): Promise<JobResponse>;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAEhB,KAAK,YAAY,EAEjB,KAAK,aAAa,EAElB,KAAK,YAAY,EAElB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE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,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA2B/E,UAAU,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAmClE,UAAU,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAoB1D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAQxC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBpC,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;YASjE,aAAa;YA4Eb,cAAc;CAgB7B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { VargClient, VargGatewayError } from "./client.ts";
|
|
2
|
-
export type { VargClientConfig, WaitForJobOptions, VoiceInfo, VoiceListResponse } from "./client.ts";
|
|
3
|
-
export { createVarg } from "./provider.ts";
|
|
2
|
+
export type { VargClientConfig, WaitForJobOptions, VoiceInfo, VoiceListResponse, VoiceSearchParams, } from "./client.ts";
|
|
3
|
+
export { createVarg, varg } from "./provider.ts";
|
|
4
4
|
export type { VargProvider } from "./provider.ts";
|
|
5
5
|
export { ErrorResponseSchema, FileInputSchema, FileUploadResponseSchema, ImageRequestSchema, JobResponseSchema, JobStatusSchema, MusicRequestSchema, SpeechRequestSchema, VideoRequestSchema, } from "./schemas.ts";
|
|
6
6
|
export type { ErrorResponse, FileInput, FileUploadResponse, ImageRequest, JobResponse, JobStatus, MusicRequest, SpeechRequest, VideoRequest, } from "./schemas.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3D,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3D,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,SAAS,EACT,YAAY,EACZ,aAAa,EACb,YAAY,GACb,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -267,7 +267,7 @@ __export(exports_core2, {
|
|
|
267
267
|
safeDecode: () => safeDecode,
|
|
268
268
|
registry: () => registry,
|
|
269
269
|
regexes: () => exports_regexes,
|
|
270
|
-
process: () =>
|
|
270
|
+
process: () => process2,
|
|
271
271
|
prettifyError: () => prettifyError,
|
|
272
272
|
parseAsync: () => parseAsync,
|
|
273
273
|
parse: () => parse,
|
|
@@ -10731,7 +10731,7 @@ function initializeContext(params) {
|
|
|
10731
10731
|
external: params?.external ?? undefined
|
|
10732
10732
|
};
|
|
10733
10733
|
}
|
|
10734
|
-
function
|
|
10734
|
+
function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
10735
10735
|
var _a2;
|
|
10736
10736
|
const def = schema._zod.def;
|
|
10737
10737
|
const seen = ctx.seen.get(schema);
|
|
@@ -10768,7 +10768,7 @@ function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
10768
10768
|
if (parent) {
|
|
10769
10769
|
if (!result.ref)
|
|
10770
10770
|
result.ref = parent;
|
|
10771
|
-
|
|
10771
|
+
process2(parent, ctx, params);
|
|
10772
10772
|
ctx.seen.get(parent).isParent = true;
|
|
10773
10773
|
}
|
|
10774
10774
|
}
|
|
@@ -11044,14 +11044,14 @@ function isTransforming(_schema, _ctx) {
|
|
|
11044
11044
|
}
|
|
11045
11045
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
11046
11046
|
const ctx = initializeContext({ ...params, processors });
|
|
11047
|
-
|
|
11047
|
+
process2(schema, ctx);
|
|
11048
11048
|
extractDefs(ctx, schema);
|
|
11049
11049
|
return finalize(ctx, schema);
|
|
11050
11050
|
};
|
|
11051
11051
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
11052
11052
|
const { libraryOptions, target } = params ?? {};
|
|
11053
11053
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
11054
|
-
|
|
11054
|
+
process2(schema, ctx);
|
|
11055
11055
|
extractDefs(ctx, schema);
|
|
11056
11056
|
return finalize(ctx, schema);
|
|
11057
11057
|
};
|
|
@@ -11302,7 +11302,7 @@ var arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
11302
11302
|
if (typeof maximum === "number")
|
|
11303
11303
|
json.maxItems = maximum;
|
|
11304
11304
|
json.type = "array";
|
|
11305
|
-
json.items =
|
|
11305
|
+
json.items = process2(def.element, ctx, { ...params, path: [...params.path, "items"] });
|
|
11306
11306
|
};
|
|
11307
11307
|
var objectProcessor = (schema, ctx, _json, params) => {
|
|
11308
11308
|
const json = _json;
|
|
@@ -11311,7 +11311,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
11311
11311
|
json.properties = {};
|
|
11312
11312
|
const shape = def.shape;
|
|
11313
11313
|
for (const key in shape) {
|
|
11314
|
-
json.properties[key] =
|
|
11314
|
+
json.properties[key] = process2(shape[key], ctx, {
|
|
11315
11315
|
...params,
|
|
11316
11316
|
path: [...params.path, "properties", key]
|
|
11317
11317
|
});
|
|
@@ -11334,7 +11334,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
11334
11334
|
if (ctx.io === "output")
|
|
11335
11335
|
json.additionalProperties = false;
|
|
11336
11336
|
} else if (def.catchall) {
|
|
11337
|
-
json.additionalProperties =
|
|
11337
|
+
json.additionalProperties = process2(def.catchall, ctx, {
|
|
11338
11338
|
...params,
|
|
11339
11339
|
path: [...params.path, "additionalProperties"]
|
|
11340
11340
|
});
|
|
@@ -11343,7 +11343,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
11343
11343
|
var unionProcessor = (schema, ctx, json, params) => {
|
|
11344
11344
|
const def = schema._zod.def;
|
|
11345
11345
|
const isExclusive = def.inclusive === false;
|
|
11346
|
-
const options = def.options.map((x, i) =>
|
|
11346
|
+
const options = def.options.map((x, i) => process2(x, ctx, {
|
|
11347
11347
|
...params,
|
|
11348
11348
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
11349
11349
|
}));
|
|
@@ -11355,11 +11355,11 @@ var unionProcessor = (schema, ctx, json, params) => {
|
|
|
11355
11355
|
};
|
|
11356
11356
|
var intersectionProcessor = (schema, ctx, json, params) => {
|
|
11357
11357
|
const def = schema._zod.def;
|
|
11358
|
-
const a =
|
|
11358
|
+
const a = process2(def.left, ctx, {
|
|
11359
11359
|
...params,
|
|
11360
11360
|
path: [...params.path, "allOf", 0]
|
|
11361
11361
|
});
|
|
11362
|
-
const b =
|
|
11362
|
+
const b = process2(def.right, ctx, {
|
|
11363
11363
|
...params,
|
|
11364
11364
|
path: [...params.path, "allOf", 1]
|
|
11365
11365
|
});
|
|
@@ -11376,11 +11376,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
11376
11376
|
json.type = "array";
|
|
11377
11377
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
11378
11378
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
11379
|
-
const prefixItems = def.items.map((x, i) =>
|
|
11379
|
+
const prefixItems = def.items.map((x, i) => process2(x, ctx, {
|
|
11380
11380
|
...params,
|
|
11381
11381
|
path: [...params.path, prefixPath, i]
|
|
11382
11382
|
}));
|
|
11383
|
-
const rest = def.rest ?
|
|
11383
|
+
const rest = def.rest ? process2(def.rest, ctx, {
|
|
11384
11384
|
...params,
|
|
11385
11385
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
11386
11386
|
}) : null;
|
|
@@ -11420,7 +11420,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
11420
11420
|
const keyBag = keyType._zod.bag;
|
|
11421
11421
|
const patterns = keyBag?.patterns;
|
|
11422
11422
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
11423
|
-
const valueSchema =
|
|
11423
|
+
const valueSchema = process2(def.valueType, ctx, {
|
|
11424
11424
|
...params,
|
|
11425
11425
|
path: [...params.path, "patternProperties", "*"]
|
|
11426
11426
|
});
|
|
@@ -11430,12 +11430,12 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
11430
11430
|
}
|
|
11431
11431
|
} else {
|
|
11432
11432
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
11433
|
-
json.propertyNames =
|
|
11433
|
+
json.propertyNames = process2(def.keyType, ctx, {
|
|
11434
11434
|
...params,
|
|
11435
11435
|
path: [...params.path, "propertyNames"]
|
|
11436
11436
|
});
|
|
11437
11437
|
}
|
|
11438
|
-
json.additionalProperties =
|
|
11438
|
+
json.additionalProperties = process2(def.valueType, ctx, {
|
|
11439
11439
|
...params,
|
|
11440
11440
|
path: [...params.path, "additionalProperties"]
|
|
11441
11441
|
});
|
|
@@ -11450,7 +11450,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
11450
11450
|
};
|
|
11451
11451
|
var nullableProcessor = (schema, ctx, json, params) => {
|
|
11452
11452
|
const def = schema._zod.def;
|
|
11453
|
-
const inner =
|
|
11453
|
+
const inner = process2(def.innerType, ctx, params);
|
|
11454
11454
|
const seen = ctx.seen.get(schema);
|
|
11455
11455
|
if (ctx.target === "openapi-3.0") {
|
|
11456
11456
|
seen.ref = def.innerType;
|
|
@@ -11461,20 +11461,20 @@ var nullableProcessor = (schema, ctx, json, params) => {
|
|
|
11461
11461
|
};
|
|
11462
11462
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
11463
11463
|
const def = schema._zod.def;
|
|
11464
|
-
|
|
11464
|
+
process2(def.innerType, ctx, params);
|
|
11465
11465
|
const seen = ctx.seen.get(schema);
|
|
11466
11466
|
seen.ref = def.innerType;
|
|
11467
11467
|
};
|
|
11468
11468
|
var defaultProcessor = (schema, ctx, json, params) => {
|
|
11469
11469
|
const def = schema._zod.def;
|
|
11470
|
-
|
|
11470
|
+
process2(def.innerType, ctx, params);
|
|
11471
11471
|
const seen = ctx.seen.get(schema);
|
|
11472
11472
|
seen.ref = def.innerType;
|
|
11473
11473
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
11474
11474
|
};
|
|
11475
11475
|
var prefaultProcessor = (schema, ctx, json, params) => {
|
|
11476
11476
|
const def = schema._zod.def;
|
|
11477
|
-
|
|
11477
|
+
process2(def.innerType, ctx, params);
|
|
11478
11478
|
const seen = ctx.seen.get(schema);
|
|
11479
11479
|
seen.ref = def.innerType;
|
|
11480
11480
|
if (ctx.io === "input")
|
|
@@ -11482,7 +11482,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
|
|
|
11482
11482
|
};
|
|
11483
11483
|
var catchProcessor = (schema, ctx, json, params) => {
|
|
11484
11484
|
const def = schema._zod.def;
|
|
11485
|
-
|
|
11485
|
+
process2(def.innerType, ctx, params);
|
|
11486
11486
|
const seen = ctx.seen.get(schema);
|
|
11487
11487
|
seen.ref = def.innerType;
|
|
11488
11488
|
let catchValue;
|
|
@@ -11496,32 +11496,32 @@ var catchProcessor = (schema, ctx, json, params) => {
|
|
|
11496
11496
|
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
11497
11497
|
const def = schema._zod.def;
|
|
11498
11498
|
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
11499
|
-
|
|
11499
|
+
process2(innerType, ctx, params);
|
|
11500
11500
|
const seen = ctx.seen.get(schema);
|
|
11501
11501
|
seen.ref = innerType;
|
|
11502
11502
|
};
|
|
11503
11503
|
var readonlyProcessor = (schema, ctx, json, params) => {
|
|
11504
11504
|
const def = schema._zod.def;
|
|
11505
|
-
|
|
11505
|
+
process2(def.innerType, ctx, params);
|
|
11506
11506
|
const seen = ctx.seen.get(schema);
|
|
11507
11507
|
seen.ref = def.innerType;
|
|
11508
11508
|
json.readOnly = true;
|
|
11509
11509
|
};
|
|
11510
11510
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
11511
11511
|
const def = schema._zod.def;
|
|
11512
|
-
|
|
11512
|
+
process2(def.innerType, ctx, params);
|
|
11513
11513
|
const seen = ctx.seen.get(schema);
|
|
11514
11514
|
seen.ref = def.innerType;
|
|
11515
11515
|
};
|
|
11516
11516
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
11517
11517
|
const def = schema._zod.def;
|
|
11518
|
-
|
|
11518
|
+
process2(def.innerType, ctx, params);
|
|
11519
11519
|
const seen = ctx.seen.get(schema);
|
|
11520
11520
|
seen.ref = def.innerType;
|
|
11521
11521
|
};
|
|
11522
11522
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
11523
11523
|
const innerType = schema._zod.innerType;
|
|
11524
|
-
|
|
11524
|
+
process2(innerType, ctx, params);
|
|
11525
11525
|
const seen = ctx.seen.get(schema);
|
|
11526
11526
|
seen.ref = innerType;
|
|
11527
11527
|
};
|
|
@@ -11573,7 +11573,7 @@ function toJSONSchema(input, params) {
|
|
|
11573
11573
|
const defs = {};
|
|
11574
11574
|
for (const entry of registry2._idmap.entries()) {
|
|
11575
11575
|
const [_, schema] = entry;
|
|
11576
|
-
|
|
11576
|
+
process2(schema, ctx2);
|
|
11577
11577
|
}
|
|
11578
11578
|
const schemas = {};
|
|
11579
11579
|
const external = {
|
|
@@ -11596,7 +11596,7 @@ function toJSONSchema(input, params) {
|
|
|
11596
11596
|
return { schemas };
|
|
11597
11597
|
}
|
|
11598
11598
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
11599
|
-
|
|
11599
|
+
process2(input, ctx);
|
|
11600
11600
|
extractDefs(ctx, input);
|
|
11601
11601
|
return finalize(ctx, input);
|
|
11602
11602
|
}
|
|
@@ -11642,7 +11642,7 @@ class JSONSchemaGenerator {
|
|
|
11642
11642
|
});
|
|
11643
11643
|
}
|
|
11644
11644
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
11645
|
-
return
|
|
11645
|
+
return process2(schema, this.ctx, _params);
|
|
11646
11646
|
}
|
|
11647
11647
|
emit(schema, _params) {
|
|
11648
11648
|
if (_params) {
|
|
@@ -13604,7 +13604,8 @@ var JobResponse = exports_external.object({
|
|
|
13604
13604
|
completed_at: exports_external.string().optional(),
|
|
13605
13605
|
output: exports_external.object({
|
|
13606
13606
|
url: exports_external.string(),
|
|
13607
|
-
media_type: exports_external.string()
|
|
13607
|
+
media_type: exports_external.string(),
|
|
13608
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
13608
13609
|
}).optional(),
|
|
13609
13610
|
cache: exports_external.object({
|
|
13610
13611
|
hit: exports_external.boolean(),
|
|
@@ -13738,8 +13739,31 @@ class VargClient {
|
|
|
13738
13739
|
});
|
|
13739
13740
|
return this.handleResponse(response, FileUploadResponse);
|
|
13740
13741
|
}
|
|
13741
|
-
async listVoices() {
|
|
13742
|
-
const
|
|
13742
|
+
async listVoices(params) {
|
|
13743
|
+
const searchParams = new URLSearchParams;
|
|
13744
|
+
if (params?.search)
|
|
13745
|
+
searchParams.set("search", params.search);
|
|
13746
|
+
if (params?.category)
|
|
13747
|
+
searchParams.set("category", params.category);
|
|
13748
|
+
if (params?.gender)
|
|
13749
|
+
searchParams.set("gender", params.gender);
|
|
13750
|
+
if (params?.age)
|
|
13751
|
+
searchParams.set("age", params.age);
|
|
13752
|
+
if (params?.accent)
|
|
13753
|
+
searchParams.set("accent", params.accent);
|
|
13754
|
+
if (params?.is_curated !== undefined)
|
|
13755
|
+
searchParams.set("is_curated", String(params.is_curated));
|
|
13756
|
+
if (params?.page)
|
|
13757
|
+
searchParams.set("page", String(params.page));
|
|
13758
|
+
if (params?.page_size)
|
|
13759
|
+
searchParams.set("page_size", String(params.page_size));
|
|
13760
|
+
if (params?.sort_by)
|
|
13761
|
+
searchParams.set("sort_by", params.sort_by);
|
|
13762
|
+
if (params?.sort_order)
|
|
13763
|
+
searchParams.set("sort_order", params.sort_order);
|
|
13764
|
+
const qs = searchParams.toString();
|
|
13765
|
+
const url2 = `${this.baseUrl}/voices${qs ? `?${qs}` : ""}`;
|
|
13766
|
+
const response = await fetch(url2, {
|
|
13743
13767
|
method: "GET",
|
|
13744
13768
|
headers: this.getHeaders()
|
|
13745
13769
|
});
|
|
@@ -13750,6 +13774,18 @@ class VargClient {
|
|
|
13750
13774
|
}
|
|
13751
13775
|
return await response.json();
|
|
13752
13776
|
}
|
|
13777
|
+
async syncVoices() {
|
|
13778
|
+
const response = await fetch(`${this.baseUrl}/voices/sync`, {
|
|
13779
|
+
method: "POST",
|
|
13780
|
+
headers: this.getHeaders()
|
|
13781
|
+
});
|
|
13782
|
+
if (!response.ok) {
|
|
13783
|
+
const raw = await response.json().catch(() => null);
|
|
13784
|
+
const errorData = (raw?.error ?? raw) || {};
|
|
13785
|
+
throw new VargGatewayError(errorData?.message ?? `gateway returned ${response.status}`, response.status);
|
|
13786
|
+
}
|
|
13787
|
+
return await response.json();
|
|
13788
|
+
}
|
|
13753
13789
|
async getJob(id) {
|
|
13754
13790
|
const response = await fetch(`${this.baseUrl}/jobs/${id}`, {
|
|
13755
13791
|
method: "GET",
|
|
@@ -14193,7 +14229,8 @@ async function executeJob(client, capability, params) {
|
|
|
14193
14229
|
return {
|
|
14194
14230
|
data: new Uint8Array(await res2.arrayBuffer()),
|
|
14195
14231
|
mediaType: job.output.media_type,
|
|
14196
|
-
jobId: job.job_id
|
|
14232
|
+
jobId: job.job_id,
|
|
14233
|
+
metadata: job.output.metadata
|
|
14197
14234
|
};
|
|
14198
14235
|
}
|
|
14199
14236
|
const completed = await client.waitForJob(job.job_id);
|
|
@@ -14211,10 +14248,11 @@ async function executeJob(client, capability, params) {
|
|
|
14211
14248
|
return {
|
|
14212
14249
|
data: new Uint8Array(await res.arrayBuffer()),
|
|
14213
14250
|
mediaType: output.media_type,
|
|
14214
|
-
jobId: job.job_id
|
|
14251
|
+
jobId: job.job_id,
|
|
14252
|
+
metadata: output.metadata
|
|
14215
14253
|
};
|
|
14216
14254
|
}
|
|
14217
|
-
|
|
14255
|
+
var varg_provider = createVarg({ apiKey: process.env.VARG_API_KEY ?? "" });
|
|
14218
14256
|
class VargVideoModel {
|
|
14219
14257
|
specificationVersion = "v3";
|
|
14220
14258
|
provider = "varg";
|
|
@@ -14339,7 +14377,8 @@ class VargSpeechModel {
|
|
|
14339
14377
|
response: {
|
|
14340
14378
|
timestamp: new Date,
|
|
14341
14379
|
modelId: this.modelId
|
|
14342
|
-
}
|
|
14380
|
+
},
|
|
14381
|
+
providerMetadata: result.metadata
|
|
14343
14382
|
};
|
|
14344
14383
|
}
|
|
14345
14384
|
}
|
|
@@ -14377,6 +14416,7 @@ class VargMusicModel {
|
|
|
14377
14416
|
}
|
|
14378
14417
|
}
|
|
14379
14418
|
export {
|
|
14419
|
+
varg_provider as varg,
|
|
14380
14420
|
createVarg,
|
|
14381
14421
|
VideoRequest as VideoRequestSchema,
|
|
14382
14422
|
VargGatewayError,
|
package/dist/provider.d.ts
CHANGED
|
@@ -8,4 +8,6 @@ export interface VargProvider extends ProviderV3 {
|
|
|
8
8
|
musicModel(modelId: string): MusicModelV3;
|
|
9
9
|
}
|
|
10
10
|
export declare function createVarg(config: VargClientConfig): VargProvider;
|
|
11
|
+
declare const varg_provider: VargProvider;
|
|
12
|
+
export { varg_provider as varg };
|
|
11
13
|
//# sourceMappingURL=provider.d.ts.map
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EAIjB,KAAK,UAAU,EAEf,KAAK,aAAa,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,YAAY,EAEZ,YAAY,EAEb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAAC;IAC1C,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAAC;IAC1C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAAC;IAC5C,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAAC;CAC3C;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,YAAY,CAgBjE"}
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EAIjB,KAAK,UAAU,EAEf,KAAK,aAAa,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,YAAY,EAEZ,YAAY,EAEb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,UA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