@picsart/ai-sdk 1.138.1 → 1.139.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/_cli.js +30 -67
- package/index.d.ts +8 -15
- package/index.js +30 -61
- package/package.json +1 -1
package/_cli.js
CHANGED
|
@@ -583,8 +583,14 @@ function validateDescriptor(key, d, val, required) {
|
|
|
583
583
|
}
|
|
584
584
|
break;
|
|
585
585
|
case "file":
|
|
586
|
-
if (d.
|
|
586
|
+
if (d.array) {
|
|
587
587
|
if (!Array.isArray(val)) throw new Error(`"${key}" must be an array of URLs`);
|
|
588
|
+
if (d.array.min != null && val.length < d.array.min) {
|
|
589
|
+
throw new Error(`"${key}" needs at least ${d.array.min} items`);
|
|
590
|
+
}
|
|
591
|
+
if (d.array.max != null && val.length > d.array.max) {
|
|
592
|
+
throw new Error(`"${key}" allows at most ${d.array.max} items`);
|
|
593
|
+
}
|
|
588
594
|
} else {
|
|
589
595
|
if (typeof val !== "string") throw new Error(`"${key}" must be a string URL`);
|
|
590
596
|
}
|
|
@@ -907,7 +913,7 @@ var init_presets = __esm({
|
|
|
907
913
|
descriptor: {
|
|
908
914
|
kind: "file",
|
|
909
915
|
accept,
|
|
910
|
-
|
|
916
|
+
...opts?.array ? { array: opts.array } : {}
|
|
911
917
|
}
|
|
912
918
|
}
|
|
913
919
|
};
|
|
@@ -1103,7 +1109,7 @@ var init_define = __esm({
|
|
|
1103
1109
|
videoId: p.videoId,
|
|
1104
1110
|
language: p.language,
|
|
1105
1111
|
// File presets — key matches the runtime GenerationContext field name:
|
|
1106
|
-
imageInput: (max = 1, label = "Start Image", required = false) => p.file("imageUrls", "image", { max, label, required }),
|
|
1112
|
+
imageInput: (max = 1, label = "Start Image", required = false) => p.file("imageUrls", "image", { array: { max }, label, required }),
|
|
1107
1113
|
videoInput: (label = "Source Video") => p.file("videoUrl", "video", { label, required: true }),
|
|
1108
1114
|
audioInput: (label = "Audio Track", required = false) => p.file("audioUrl", "audio", { label, required }),
|
|
1109
1115
|
startFrame: (label = "Start Frame", required = false) => p.file("startFrame", "image", { label, required }),
|
|
@@ -2552,7 +2558,6 @@ var init_wan = __esm({
|
|
|
2552
2558
|
estimatedTime: 26,
|
|
2553
2559
|
mode: "video",
|
|
2554
2560
|
inputType: "v2v",
|
|
2555
|
-
disabled: true,
|
|
2556
2561
|
badge: ["popular", "new"],
|
|
2557
2562
|
description: "Wan 2.7 Video Edit \u2014 restyle or modify existing video with reference images.",
|
|
2558
2563
|
features: [feat("Video Input", "input"), feat("Image Input", "input"), feat("1080P", "resolution")],
|
|
@@ -4276,7 +4281,7 @@ var init_elevenlabs = __esm({
|
|
|
4276
4281
|
buildPayload: buildElevenLabsSTSPayload,
|
|
4277
4282
|
toolId: "audio-gen.eleven-sts-v2",
|
|
4278
4283
|
creditPrice: { "audio-gen.eleven-sts-v2": 1 },
|
|
4279
|
-
pricingUnit: "
|
|
4284
|
+
pricingUnit: "per_minute",
|
|
4280
4285
|
estimatedTime: 15,
|
|
4281
4286
|
mode: "audio",
|
|
4282
4287
|
inputType: "sts",
|
|
@@ -5353,6 +5358,7 @@ var init_picsart = __esm({
|
|
|
5353
5358
|
buildPayload: buildRemoveBgPayload,
|
|
5354
5359
|
toolId: "image-to-image.picsart-sod",
|
|
5355
5360
|
creditPrice: { "image-to-image.picsart-sod": 1 },
|
|
5361
|
+
pricingUnit: "per_image",
|
|
5356
5362
|
outputSchema: sodOutputSchema,
|
|
5357
5363
|
mode: "image",
|
|
5358
5364
|
inputType: "i2i",
|
|
@@ -5367,6 +5373,7 @@ var init_picsart = __esm({
|
|
|
5367
5373
|
buildPayload: buildEnhancePayload,
|
|
5368
5374
|
toolId: "image-to-image.picsart-enhance",
|
|
5369
5375
|
creditPrice: { "image-to-image.picsart-enhance": 1 },
|
|
5376
|
+
pricingUnit: "per_image",
|
|
5370
5377
|
mode: "image",
|
|
5371
5378
|
inputType: "i2i",
|
|
5372
5379
|
estimatedTime: 30,
|
|
@@ -6361,52 +6368,6 @@ var init_client = __esm({
|
|
|
6361
6368
|
}
|
|
6362
6369
|
});
|
|
6363
6370
|
|
|
6364
|
-
// src/core/descriptors/param-access.ts
|
|
6365
|
-
function getEnumOptions(model, key) {
|
|
6366
|
-
const entry = model.paramConfig[key];
|
|
6367
|
-
if (!entry) return null;
|
|
6368
|
-
const d = entry.descriptor;
|
|
6369
|
-
if (d.kind === "enum") {
|
|
6370
|
-
return d.options.map((o) => o.id);
|
|
6371
|
-
}
|
|
6372
|
-
return null;
|
|
6373
|
-
}
|
|
6374
|
-
function getDefault(model, key) {
|
|
6375
|
-
const entry = model.paramConfig[key];
|
|
6376
|
-
if (!entry) return void 0;
|
|
6377
|
-
const d = entry.descriptor;
|
|
6378
|
-
return "default" in d ? d.default : void 0;
|
|
6379
|
-
}
|
|
6380
|
-
function getRange(model, key) {
|
|
6381
|
-
const entry = model.paramConfig[key];
|
|
6382
|
-
if (!entry) return null;
|
|
6383
|
-
const d = entry.descriptor;
|
|
6384
|
-
if (d.kind === "range") {
|
|
6385
|
-
const r = d;
|
|
6386
|
-
return { min: r.min, max: r.max, step: r.step, default: r.default };
|
|
6387
|
-
}
|
|
6388
|
-
return null;
|
|
6389
|
-
}
|
|
6390
|
-
function getFileParam(model, key) {
|
|
6391
|
-
const entry = model.paramConfig[key];
|
|
6392
|
-
if (!entry) return null;
|
|
6393
|
-
const d = entry.descriptor;
|
|
6394
|
-
if (d.kind === "file") {
|
|
6395
|
-
const f = d;
|
|
6396
|
-
return {
|
|
6397
|
-
required: entry.required ?? false,
|
|
6398
|
-
max: f.max,
|
|
6399
|
-
label: entry.label,
|
|
6400
|
-
accept: f.accept
|
|
6401
|
-
};
|
|
6402
|
-
}
|
|
6403
|
-
return null;
|
|
6404
|
-
}
|
|
6405
|
-
var init_param_access = __esm({
|
|
6406
|
-
"src/core/descriptors/param-access.ts"() {
|
|
6407
|
-
}
|
|
6408
|
-
});
|
|
6409
|
-
|
|
6410
6371
|
// src/core/descriptors/model-accessor.ts
|
|
6411
6372
|
function _model(id) {
|
|
6412
6373
|
return new ModelDescriptorImpl(resolveModel(id));
|
|
@@ -6431,7 +6392,6 @@ function _search(query) {
|
|
|
6431
6392
|
var ModelParamsAccessorImpl, ModelMetaImpl, ModelDescriptorImpl, Model;
|
|
6432
6393
|
var init_model_accessor = __esm({
|
|
6433
6394
|
"src/core/descriptors/model-accessor.ts"() {
|
|
6434
|
-
init_param_access();
|
|
6435
6395
|
init_utils();
|
|
6436
6396
|
init_resolve();
|
|
6437
6397
|
init_catalog();
|
|
@@ -6441,7 +6401,10 @@ var init_model_accessor = __esm({
|
|
|
6441
6401
|
this.def = def;
|
|
6442
6402
|
}
|
|
6443
6403
|
param(key) {
|
|
6444
|
-
|
|
6404
|
+
const entry = this.def.paramConfig[key];
|
|
6405
|
+
if (!entry) return void 0;
|
|
6406
|
+
const { descriptor, ...meta } = entry;
|
|
6407
|
+
return { ...meta, ...descriptor };
|
|
6445
6408
|
}
|
|
6446
6409
|
hasParam(key) {
|
|
6447
6410
|
return key in this.def.paramConfig;
|
|
@@ -6494,19 +6457,19 @@ var init_model_accessor = __esm({
|
|
|
6494
6457
|
return Object.values(this.def.paramConfig).some((e) => e.descriptor.kind === "file");
|
|
6495
6458
|
}
|
|
6496
6459
|
getDefault(key) {
|
|
6497
|
-
|
|
6460
|
+
const entry = this.def.paramConfig[key];
|
|
6461
|
+
if (!entry) return void 0;
|
|
6462
|
+
const d = entry.descriptor;
|
|
6463
|
+
return "default" in d ? d.default : void 0;
|
|
6498
6464
|
}
|
|
6499
6465
|
getDefaults() {
|
|
6500
6466
|
return extractDefaults(this.def.paramConfig);
|
|
6501
6467
|
}
|
|
6468
|
+
/** @deprecated Use `enum(key)` instead. */
|
|
6502
6469
|
getEnumOptions(key) {
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
return getRange(this.def, key);
|
|
6507
|
-
}
|
|
6508
|
-
getFileParam(key) {
|
|
6509
|
-
return getFileParam(this.def, key);
|
|
6470
|
+
const entry = this.def.paramConfig[key];
|
|
6471
|
+
if (!entry || entry.descriptor.kind !== "enum") return null;
|
|
6472
|
+
return entry.descriptor.options.map((o) => o.id);
|
|
6510
6473
|
}
|
|
6511
6474
|
toSchema() {
|
|
6512
6475
|
return descriptorsToSchema(this.def.paramConfig);
|
|
@@ -6516,9 +6479,8 @@ var init_model_accessor = __esm({
|
|
|
6516
6479
|
}
|
|
6517
6480
|
narrow(key, kind) {
|
|
6518
6481
|
const entry = this.param(key);
|
|
6519
|
-
if (!entry || entry.
|
|
6520
|
-
|
|
6521
|
-
return { ...meta, ...descriptor };
|
|
6482
|
+
if (!entry || entry.kind !== kind) return void 0;
|
|
6483
|
+
return entry;
|
|
6522
6484
|
}
|
|
6523
6485
|
};
|
|
6524
6486
|
ModelMetaImpl = class {
|
|
@@ -6880,9 +6842,11 @@ var init_model_constants = __esm({
|
|
|
6880
6842
|
toSchema(id) {
|
|
6881
6843
|
return Model(id).params().toSchema();
|
|
6882
6844
|
},
|
|
6883
|
-
/** @deprecated Use `Model(id).params().
|
|
6845
|
+
/** @deprecated Use `Model(id).params().file(key)` instead. */
|
|
6884
6846
|
getFileParam(id, key) {
|
|
6885
|
-
|
|
6847
|
+
const f = Model(id).params().file(key);
|
|
6848
|
+
if (!f) return null;
|
|
6849
|
+
return { required: f.required ?? false, max: f.array?.max ?? 1, label: f.label, accept: f.accept };
|
|
6886
6850
|
},
|
|
6887
6851
|
/** @deprecated Use `Model(id).params().hasParam(key)` instead. */
|
|
6888
6852
|
hasParam(id, key) {
|
|
@@ -6897,7 +6861,6 @@ var init_descriptors = __esm({
|
|
|
6897
6861
|
"src/core/descriptors/index.ts"() {
|
|
6898
6862
|
init_utils();
|
|
6899
6863
|
init_presets();
|
|
6900
|
-
init_param_access();
|
|
6901
6864
|
init_model_accessor();
|
|
6902
6865
|
}
|
|
6903
6866
|
});
|
package/index.d.ts
CHANGED
|
@@ -1122,7 +1122,11 @@ interface TextDescriptor {
|
|
|
1122
1122
|
interface FileDescriptor {
|
|
1123
1123
|
kind: 'file';
|
|
1124
1124
|
accept: 'image' | 'video' | 'audio' | 'media';
|
|
1125
|
-
max
|
|
1125
|
+
/** Present = array; absent = single. `min`/`max` bound the array length. */
|
|
1126
|
+
array?: {
|
|
1127
|
+
min?: number;
|
|
1128
|
+
max?: number;
|
|
1129
|
+
};
|
|
1126
1130
|
}
|
|
1127
1131
|
interface ObjectDescriptor {
|
|
1128
1132
|
kind: 'object';
|
|
@@ -1175,7 +1179,7 @@ interface ModelMeta {
|
|
|
1175
1179
|
}
|
|
1176
1180
|
/** Parameter operations — fluent access to model params, schemas, defaults. */
|
|
1177
1181
|
interface ModelParamsAccessor {
|
|
1178
|
-
param(key: string):
|
|
1182
|
+
param(key: string): (EntryMeta & ParamDescriptor) | undefined;
|
|
1179
1183
|
hasParam(key: string): boolean;
|
|
1180
1184
|
all(): FlatParamEntry[];
|
|
1181
1185
|
enum(key: string): EnumEntry | undefined;
|
|
@@ -1193,19 +1197,8 @@ interface ModelParamsAccessor {
|
|
|
1193
1197
|
hasFileInput(): boolean;
|
|
1194
1198
|
getDefault(key: string): unknown;
|
|
1195
1199
|
getDefaults(): Record<string, unknown>;
|
|
1200
|
+
/** @deprecated Use `enum(key)` instead — returns full `EnumEntry` with `.options`, `.default`, etc. */
|
|
1196
1201
|
getEnumOptions(key: string): (string | number)[] | null;
|
|
1197
|
-
getRange(key: string): {
|
|
1198
|
-
min: number;
|
|
1199
|
-
max: number;
|
|
1200
|
-
step?: number;
|
|
1201
|
-
default: number;
|
|
1202
|
-
} | null;
|
|
1203
|
-
getFileParam(key: string): {
|
|
1204
|
-
required: boolean;
|
|
1205
|
-
max: number;
|
|
1206
|
-
label?: string;
|
|
1207
|
-
accept?: string;
|
|
1208
|
-
} | null;
|
|
1209
1202
|
toSchema(): ModelParamSchema;
|
|
1210
1203
|
transferValues(prev: Record<string, unknown>): Record<string, unknown>;
|
|
1211
1204
|
}
|
|
@@ -1579,7 +1572,7 @@ declare const Models: {
|
|
|
1579
1572
|
readonly validate: (model: string, input: unknown) => ValidationResult;
|
|
1580
1573
|
/** @deprecated Use `Model(id).params().toSchema()` instead. */
|
|
1581
1574
|
readonly toSchema: (id: string) => ModelParamSchema;
|
|
1582
|
-
/** @deprecated Use `Model(id).params().
|
|
1575
|
+
/** @deprecated Use `Model(id).params().file(key)` instead. */
|
|
1583
1576
|
readonly getFileParam: (id: string, key: string) => {
|
|
1584
1577
|
required: boolean;
|
|
1585
1578
|
max: number;
|
package/index.js
CHANGED
|
@@ -176,8 +176,14 @@ function validateDescriptor(key, d, val, required) {
|
|
|
176
176
|
}
|
|
177
177
|
break;
|
|
178
178
|
case "file":
|
|
179
|
-
if (d.
|
|
179
|
+
if (d.array) {
|
|
180
180
|
if (!Array.isArray(val)) throw new Error(`"${key}" must be an array of URLs`);
|
|
181
|
+
if (d.array.min != null && val.length < d.array.min) {
|
|
182
|
+
throw new Error(`"${key}" needs at least ${d.array.min} items`);
|
|
183
|
+
}
|
|
184
|
+
if (d.array.max != null && val.length > d.array.max) {
|
|
185
|
+
throw new Error(`"${key}" allows at most ${d.array.max} items`);
|
|
186
|
+
}
|
|
181
187
|
} else {
|
|
182
188
|
if (typeof val !== "string") throw new Error(`"${key}" must be a string URL`);
|
|
183
189
|
}
|
|
@@ -488,7 +494,7 @@ var p = {
|
|
|
488
494
|
descriptor: {
|
|
489
495
|
kind: "file",
|
|
490
496
|
accept,
|
|
491
|
-
|
|
497
|
+
...opts?.array ? { array: opts.array } : {}
|
|
492
498
|
}
|
|
493
499
|
}
|
|
494
500
|
};
|
|
@@ -668,7 +674,7 @@ var params = {
|
|
|
668
674
|
videoId: p.videoId,
|
|
669
675
|
language: p.language,
|
|
670
676
|
// File presets — key matches the runtime GenerationContext field name:
|
|
671
|
-
imageInput: (max = 1, label = "Start Image", required = false) => p.file("imageUrls", "image", { max, label, required }),
|
|
677
|
+
imageInput: (max = 1, label = "Start Image", required = false) => p.file("imageUrls", "image", { array: { max }, label, required }),
|
|
672
678
|
videoInput: (label = "Source Video") => p.file("videoUrl", "video", { label, required: true }),
|
|
673
679
|
audioInput: (label = "Audio Track", required = false) => p.file("audioUrl", "audio", { label, required }),
|
|
674
680
|
startFrame: (label = "Start Frame", required = false) => p.file("startFrame", "image", { label, required }),
|
|
@@ -2056,7 +2062,6 @@ var { MODELS: MODELS10} = defineModels("wan", [
|
|
|
2056
2062
|
estimatedTime: 26,
|
|
2057
2063
|
mode: "video",
|
|
2058
2064
|
inputType: "v2v",
|
|
2059
|
-
disabled: true,
|
|
2060
2065
|
badge: ["popular", "new"],
|
|
2061
2066
|
description: "Wan 2.7 Video Edit \u2014 restyle or modify existing video with reference images.",
|
|
2062
2067
|
features: [feat("Video Input", "input"), feat("Image Input", "input"), feat("1080P", "resolution")],
|
|
@@ -3689,7 +3694,7 @@ var { MODELS: MODELS23} = defineModels("elevenlabs", [
|
|
|
3689
3694
|
buildPayload: buildElevenLabsSTSPayload,
|
|
3690
3695
|
toolId: "audio-gen.eleven-sts-v2",
|
|
3691
3696
|
creditPrice: { "audio-gen.eleven-sts-v2": 1 },
|
|
3692
|
-
pricingUnit: "
|
|
3697
|
+
pricingUnit: "per_minute",
|
|
3693
3698
|
estimatedTime: 15,
|
|
3694
3699
|
mode: "audio",
|
|
3695
3700
|
inputType: "sts",
|
|
@@ -4710,6 +4715,7 @@ var { MODELS: MODELS31} = defineModels("picsart", [
|
|
|
4710
4715
|
buildPayload: buildRemoveBgPayload,
|
|
4711
4716
|
toolId: "image-to-image.picsart-sod",
|
|
4712
4717
|
creditPrice: { "image-to-image.picsart-sod": 1 },
|
|
4718
|
+
pricingUnit: "per_image",
|
|
4713
4719
|
outputSchema: sodOutputSchema,
|
|
4714
4720
|
mode: "image",
|
|
4715
4721
|
inputType: "i2i",
|
|
@@ -4724,6 +4730,7 @@ var { MODELS: MODELS31} = defineModels("picsart", [
|
|
|
4724
4730
|
buildPayload: buildEnhancePayload,
|
|
4725
4731
|
toolId: "image-to-image.picsart-enhance",
|
|
4726
4732
|
creditPrice: { "image-to-image.picsart-enhance": 1 },
|
|
4733
|
+
pricingUnit: "per_image",
|
|
4727
4734
|
mode: "image",
|
|
4728
4735
|
inputType: "i2i",
|
|
4729
4736
|
estimatedTime: 30,
|
|
@@ -5624,48 +5631,6 @@ function createClient(config) {
|
|
|
5624
5631
|
};
|
|
5625
5632
|
}
|
|
5626
5633
|
|
|
5627
|
-
// src/core/descriptors/param-access.ts
|
|
5628
|
-
function getEnumOptions(model, key) {
|
|
5629
|
-
const entry = model.paramConfig[key];
|
|
5630
|
-
if (!entry) return null;
|
|
5631
|
-
const d = entry.descriptor;
|
|
5632
|
-
if (d.kind === "enum") {
|
|
5633
|
-
return d.options.map((o) => o.id);
|
|
5634
|
-
}
|
|
5635
|
-
return null;
|
|
5636
|
-
}
|
|
5637
|
-
function getDefault(model, key) {
|
|
5638
|
-
const entry = model.paramConfig[key];
|
|
5639
|
-
if (!entry) return void 0;
|
|
5640
|
-
const d = entry.descriptor;
|
|
5641
|
-
return "default" in d ? d.default : void 0;
|
|
5642
|
-
}
|
|
5643
|
-
function getRange(model, key) {
|
|
5644
|
-
const entry = model.paramConfig[key];
|
|
5645
|
-
if (!entry) return null;
|
|
5646
|
-
const d = entry.descriptor;
|
|
5647
|
-
if (d.kind === "range") {
|
|
5648
|
-
const r = d;
|
|
5649
|
-
return { min: r.min, max: r.max, step: r.step, default: r.default };
|
|
5650
|
-
}
|
|
5651
|
-
return null;
|
|
5652
|
-
}
|
|
5653
|
-
function getFileParam(model, key) {
|
|
5654
|
-
const entry = model.paramConfig[key];
|
|
5655
|
-
if (!entry) return null;
|
|
5656
|
-
const d = entry.descriptor;
|
|
5657
|
-
if (d.kind === "file") {
|
|
5658
|
-
const f = d;
|
|
5659
|
-
return {
|
|
5660
|
-
required: entry.required ?? false,
|
|
5661
|
-
max: f.max,
|
|
5662
|
-
label: entry.label,
|
|
5663
|
-
accept: f.accept
|
|
5664
|
-
};
|
|
5665
|
-
}
|
|
5666
|
-
return null;
|
|
5667
|
-
}
|
|
5668
|
-
|
|
5669
5634
|
// src/core/descriptors/model-accessor.ts
|
|
5670
5635
|
var ModelParamsAccessorImpl = class {
|
|
5671
5636
|
def;
|
|
@@ -5673,7 +5638,10 @@ var ModelParamsAccessorImpl = class {
|
|
|
5673
5638
|
this.def = def;
|
|
5674
5639
|
}
|
|
5675
5640
|
param(key) {
|
|
5676
|
-
|
|
5641
|
+
const entry = this.def.paramConfig[key];
|
|
5642
|
+
if (!entry) return void 0;
|
|
5643
|
+
const { descriptor, ...meta } = entry;
|
|
5644
|
+
return { ...meta, ...descriptor };
|
|
5677
5645
|
}
|
|
5678
5646
|
hasParam(key) {
|
|
5679
5647
|
return key in this.def.paramConfig;
|
|
@@ -5726,19 +5694,19 @@ var ModelParamsAccessorImpl = class {
|
|
|
5726
5694
|
return Object.values(this.def.paramConfig).some((e) => e.descriptor.kind === "file");
|
|
5727
5695
|
}
|
|
5728
5696
|
getDefault(key) {
|
|
5729
|
-
|
|
5697
|
+
const entry = this.def.paramConfig[key];
|
|
5698
|
+
if (!entry) return void 0;
|
|
5699
|
+
const d = entry.descriptor;
|
|
5700
|
+
return "default" in d ? d.default : void 0;
|
|
5730
5701
|
}
|
|
5731
5702
|
getDefaults() {
|
|
5732
5703
|
return extractDefaults(this.def.paramConfig);
|
|
5733
5704
|
}
|
|
5705
|
+
/** @deprecated Use `enum(key)` instead. */
|
|
5734
5706
|
getEnumOptions(key) {
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
return getRange(this.def, key);
|
|
5739
|
-
}
|
|
5740
|
-
getFileParam(key) {
|
|
5741
|
-
return getFileParam(this.def, key);
|
|
5707
|
+
const entry = this.def.paramConfig[key];
|
|
5708
|
+
if (!entry || entry.descriptor.kind !== "enum") return null;
|
|
5709
|
+
return entry.descriptor.options.map((o) => o.id);
|
|
5742
5710
|
}
|
|
5743
5711
|
toSchema() {
|
|
5744
5712
|
return descriptorsToSchema(this.def.paramConfig);
|
|
@@ -5748,9 +5716,8 @@ var ModelParamsAccessorImpl = class {
|
|
|
5748
5716
|
}
|
|
5749
5717
|
narrow(key, kind) {
|
|
5750
5718
|
const entry = this.param(key);
|
|
5751
|
-
if (!entry || entry.
|
|
5752
|
-
|
|
5753
|
-
return { ...meta, ...descriptor };
|
|
5719
|
+
if (!entry || entry.kind !== kind) return void 0;
|
|
5720
|
+
return entry;
|
|
5754
5721
|
}
|
|
5755
5722
|
};
|
|
5756
5723
|
var ModelMetaImpl = class {
|
|
@@ -6123,9 +6090,11 @@ var Models = {
|
|
|
6123
6090
|
toSchema(id) {
|
|
6124
6091
|
return Model(id).params().toSchema();
|
|
6125
6092
|
},
|
|
6126
|
-
/** @deprecated Use `Model(id).params().
|
|
6093
|
+
/** @deprecated Use `Model(id).params().file(key)` instead. */
|
|
6127
6094
|
getFileParam(id, key) {
|
|
6128
|
-
|
|
6095
|
+
const f = Model(id).params().file(key);
|
|
6096
|
+
if (!f) return null;
|
|
6097
|
+
return { required: f.required ?? false, max: f.array?.max ?? 1, label: f.label, accept: f.accept };
|
|
6129
6098
|
},
|
|
6130
6099
|
/** @deprecated Use `Model(id).params().hasParam(key)` instead. */
|
|
6131
6100
|
hasParam(id, key) {
|