@shotstack/schemas 1.22.0 → 1.23.1
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/api.bundled.json +13 -9
- package/dist/json-schema/edit.json +3 -3
- package/dist/json-schema/index.cjs +1 -1
- package/dist/json-schema/index.js +1 -1
- package/dist/schema.d.ts +14 -9
- package/dist/zod/zod.gen.cjs +16 -5
- package/dist/zod/zod.gen.d.ts +15 -9
- package/dist/zod/zod.gen.js +16 -5
- package/dist/zod/zod.gen.ts +16 -5
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -202,8 +202,8 @@ export interface paths {
|
|
|
202
202
|
put?: never;
|
|
203
203
|
/**
|
|
204
204
|
* Generate Asset
|
|
205
|
-
* @description Generate a single image, video or audio asset from a
|
|
206
|
-
* rendering a full edit. Submit a prompt
|
|
205
|
+
* @description Generate a single image, video or audio asset from a prompt or, for some models, a source file, without
|
|
206
|
+
* rendering a full edit. Submit an asset with a prompt or source file; the response is
|
|
207
207
|
* immediate when an identical asset has been generated before (results are
|
|
208
208
|
* cached by prompt, model and options), otherwise the job is queued and can
|
|
209
209
|
* be polled via the status endpoint.
|
|
@@ -290,7 +290,7 @@ export interface paths {
|
|
|
290
290
|
/**
|
|
291
291
|
* List Generation Models
|
|
292
292
|
* @description List the generation models available for `prompt`-bearing image, video and audio
|
|
293
|
-
* assets, with the options each accepts. Use `POST /generate/quote` for a credit estimate.
|
|
293
|
+
* assets generated from a prompt or, for some models, a source file, with the options each accepts. Use `POST /generate/quote` for a credit estimate.
|
|
294
294
|
*
|
|
295
295
|
* Use this to populate a model picker and render its option fields, rather than
|
|
296
296
|
* hard coding a model list. A newly launched model appears here without any change
|
|
@@ -2323,7 +2323,7 @@ export interface components {
|
|
|
2323
2323
|
*/
|
|
2324
2324
|
replace: unknown;
|
|
2325
2325
|
};
|
|
2326
|
-
/** @description The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified. */
|
|
2326
|
+
/** @description The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified. A custom `size` can be up to 3840px on each side, or 1920px for `gif`. Video can be up to 3840 × 2160 pixels (8,294,400) in any shape, for example 2160 × 3840 for vertical 4K; larger sizes are rejected. Video above 1920 × 1080 pixels, including the `4k` resolution, needs a plan that includes 4K. */
|
|
2327
2327
|
Output: {
|
|
2328
2328
|
/**
|
|
2329
2329
|
* @description The output format and type of media file to generate. <ul>
|
|
@@ -2426,12 +2426,12 @@ export interface components {
|
|
|
2426
2426
|
/** @description Set a custom size for a video or image in pixels. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications. */
|
|
2427
2427
|
Size: {
|
|
2428
2428
|
/**
|
|
2429
|
-
* @description Set a custom width for the video or image file in pixels. Value must be divisible by 2.
|
|
2429
|
+
* @description Set a custom width for the video or image file in pixels. Value must be divisible by 2.
|
|
2430
2430
|
* @example 1200
|
|
2431
2431
|
*/
|
|
2432
2432
|
width?: number;
|
|
2433
2433
|
/**
|
|
2434
|
-
* @description Set a custom height for the video or image file in pixels. Value must be divisible by 2.
|
|
2434
|
+
* @description Set a custom height for the video or image file in pixels. Value must be divisible by 2.
|
|
2435
2435
|
* @example 800
|
|
2436
2436
|
*/
|
|
2437
2437
|
height?: number;
|
|
@@ -3000,7 +3000,7 @@ export interface components {
|
|
|
3000
3000
|
/** @description Specify the storage locations and hosting services to send the file to. */
|
|
3001
3001
|
destinations: components["schemas"]["Destinations"][];
|
|
3002
3002
|
};
|
|
3003
|
-
/** @description An
|
|
3003
|
+
/** @description An asset to generate, from a text `prompt` or, for models that take one, a source `src`. */
|
|
3004
3004
|
GenerationAsset: {
|
|
3005
3005
|
/**
|
|
3006
3006
|
* @description The kind of asset to generate.
|
|
@@ -3012,7 +3012,12 @@ export interface components {
|
|
|
3012
3012
|
* @description A description of the asset to generate. For text-to-speech models it is the text spoken.
|
|
3013
3013
|
* @example A lighthouse on a rocky coast at sunset, cinematic lighting
|
|
3014
3014
|
*/
|
|
3015
|
-
prompt
|
|
3015
|
+
prompt?: string;
|
|
3016
|
+
/**
|
|
3017
|
+
* Format: uri
|
|
3018
|
+
* @description The source file for models that take one instead of a prompt, such as `shotstack-music-analysis`. A public HTTPS URL.
|
|
3019
|
+
*/
|
|
3020
|
+
src?: string;
|
|
3016
3021
|
/**
|
|
3017
3022
|
* @description The generation model. Defaults to `nano-banana-2` for images, `seedance-2.0-text-to-video` for video and `elevenlabs-multilingual-v2` for audio. `GET /models` lists the models for each type.
|
|
3018
3023
|
* @example nano-banana-2
|
|
@@ -3028,7 +3033,7 @@ export interface components {
|
|
|
3028
3033
|
[key: string]: unknown;
|
|
3029
3034
|
};
|
|
3030
3035
|
};
|
|
3031
|
-
/** @description A generation model available to
|
|
3036
|
+
/** @description A generation model available to image, video and audio assets generated from a prompt or, for some models, a source file, with the options it accepts. Use `POST /generate/quote` for a credit estimate. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release. */
|
|
3032
3037
|
GenerationModel: {
|
|
3033
3038
|
/**
|
|
3034
3039
|
* @description The identifier to set as the asset `model`. Carries no provider name, so routing can change without a public rename.
|
package/dist/zod/zod.gen.cjs
CHANGED
|
@@ -442,7 +442,7 @@ exports.fontFontSchema = zod_1.z.object({
|
|
|
442
442
|
}).strict();
|
|
443
443
|
exports.fontSchema = exports.fontFontSchema;
|
|
444
444
|
/**
|
|
445
|
-
* An
|
|
445
|
+
* An asset to generate, from a text `prompt` or, for models that take one, a source `src`.
|
|
446
446
|
*/
|
|
447
447
|
exports.generationassetGenerationAssetSchema = zod_1.z.object({
|
|
448
448
|
type: zod_1.z.enum([
|
|
@@ -450,13 +450,24 @@ exports.generationassetGenerationAssetSchema = zod_1.z.object({
|
|
|
450
450
|
'video',
|
|
451
451
|
'audio'
|
|
452
452
|
]),
|
|
453
|
-
prompt: zod_1.z.string().min(1).max(4000).regex(/\S/),
|
|
453
|
+
prompt: zod_1.z.optional(zod_1.z.string().min(1).max(4000).regex(/\S/)),
|
|
454
|
+
src: zod_1.z.optional(zod_1.z.url()),
|
|
454
455
|
model: zod_1.z.optional(zod_1.z.string()),
|
|
455
456
|
options: zod_1.z.optional(zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()))
|
|
456
|
-
}).strict()
|
|
457
|
+
}).strict().superRefine((data, ctx) => {
|
|
458
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
459
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
460
|
+
if (!hasSrc && !hasPrompt) {
|
|
461
|
+
ctx.addIssue({
|
|
462
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
463
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
464
|
+
path: ["src"],
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
});
|
|
457
468
|
exports.generationAssetSchema = exports.generationassetGenerationAssetSchema;
|
|
458
469
|
/**
|
|
459
|
-
* A generation model available to
|
|
470
|
+
* A generation model available to image, video and audio assets generated from a prompt or, for some models, a source file, with the options it accepts. Use `POST /generate/quote` for a credit estimate. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release.
|
|
460
471
|
*/
|
|
461
472
|
exports.generationmodelGenerationModelSchema = zod_1.z.object({
|
|
462
473
|
model: zod_1.z.string(),
|
|
@@ -2044,7 +2055,7 @@ exports.thumbnailThumbnailSchema = zod_1.z.object({
|
|
|
2044
2055
|
}).strict();
|
|
2045
2056
|
exports.thumbnailSchema = exports.thumbnailThumbnailSchema;
|
|
2046
2057
|
/**
|
|
2047
|
-
* The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.
|
|
2058
|
+
* The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified. A custom `size` can be up to 3840px on each side, or 1920px for `gif`. Video can be up to 3840 × 2160 pixels (8,294,400) in any shape, for example 2160 × 3840 for vertical 4K; larger sizes are rejected. Video above 1920 × 1080 pixels, including the `4k` resolution, needs a plan that includes 4K.
|
|
2048
2059
|
*/
|
|
2049
2060
|
exports.outputOutputSchema = zod_1.z.object({
|
|
2050
2061
|
format: zod_1.z.enum([
|
package/dist/zod/zod.gen.d.ts
CHANGED
|
@@ -774,7 +774,7 @@ export declare const fontSchema: z.ZodObject<{
|
|
|
774
774
|
src: z.ZodString;
|
|
775
775
|
}, z.core.$strict>;
|
|
776
776
|
/**
|
|
777
|
-
* An
|
|
777
|
+
* An asset to generate, from a text `prompt` or, for models that take one, a source `src`.
|
|
778
778
|
*/
|
|
779
779
|
export declare const generationassetGenerationAssetSchema: z.ZodObject<{
|
|
780
780
|
type: z.ZodEnum<{
|
|
@@ -782,7 +782,8 @@ export declare const generationassetGenerationAssetSchema: z.ZodObject<{
|
|
|
782
782
|
video: "video";
|
|
783
783
|
audio: "audio";
|
|
784
784
|
}>;
|
|
785
|
-
prompt: z.ZodString
|
|
785
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
786
|
+
src: z.ZodOptional<z.ZodURL>;
|
|
786
787
|
model: z.ZodOptional<z.ZodString>;
|
|
787
788
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
788
789
|
}, z.core.$strict>;
|
|
@@ -792,12 +793,13 @@ export declare const generationAssetSchema: z.ZodObject<{
|
|
|
792
793
|
video: "video";
|
|
793
794
|
audio: "audio";
|
|
794
795
|
}>;
|
|
795
|
-
prompt: z.ZodString
|
|
796
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
797
|
+
src: z.ZodOptional<z.ZodURL>;
|
|
796
798
|
model: z.ZodOptional<z.ZodString>;
|
|
797
799
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
798
800
|
}, z.core.$strict>;
|
|
799
801
|
/**
|
|
800
|
-
* A generation model available to
|
|
802
|
+
* A generation model available to image, video and audio assets generated from a prompt or, for some models, a source file, with the options it accepts. Use `POST /generate/quote` for a credit estimate. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release.
|
|
801
803
|
*/
|
|
802
804
|
export declare const generationmodelGenerationModelSchema: z.ZodObject<{
|
|
803
805
|
model: z.ZodString;
|
|
@@ -840,7 +842,8 @@ export declare const generationrequestGenerationRequestSchema: z.ZodObject<{
|
|
|
840
842
|
video: "video";
|
|
841
843
|
audio: "audio";
|
|
842
844
|
}>;
|
|
843
|
-
prompt: z.ZodString
|
|
845
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
846
|
+
src: z.ZodOptional<z.ZodURL>;
|
|
844
847
|
model: z.ZodOptional<z.ZodString>;
|
|
845
848
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
846
849
|
}, z.core.$strict>;
|
|
@@ -853,7 +856,8 @@ export declare const generationRequestSchema: z.ZodObject<{
|
|
|
853
856
|
video: "video";
|
|
854
857
|
audio: "audio";
|
|
855
858
|
}>;
|
|
856
|
-
prompt: z.ZodString
|
|
859
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
860
|
+
src: z.ZodOptional<z.ZodURL>;
|
|
857
861
|
model: z.ZodOptional<z.ZodString>;
|
|
858
862
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
859
863
|
}, z.core.$strict>;
|
|
@@ -5246,7 +5250,7 @@ export declare const thumbnailSchema: z.ZodObject<{
|
|
|
5246
5250
|
scale: z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>;
|
|
5247
5251
|
}, z.core.$strict>;
|
|
5248
5252
|
/**
|
|
5249
|
-
* The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.
|
|
5253
|
+
* The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified. A custom `size` can be up to 3840px on each side, or 1920px for `gif`. Video can be up to 3840 × 2160 pixels (8,294,400) in any shape, for example 2160 × 3840 for vertical 4K; larger sizes are rejected. Video above 1920 × 1080 pixels, including the `4k` resolution, needs a plan that includes 4K.
|
|
5250
5254
|
*/
|
|
5251
5255
|
export declare const outputOutputSchema: z.ZodObject<{
|
|
5252
5256
|
format: z.ZodEnum<{
|
|
@@ -61823,7 +61827,8 @@ export declare const postGenerateRequest: z.ZodObject<{
|
|
|
61823
61827
|
video: "video";
|
|
61824
61828
|
audio: "audio";
|
|
61825
61829
|
}>;
|
|
61826
|
-
prompt: z.ZodString
|
|
61830
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
61831
|
+
src: z.ZodOptional<z.ZodURL>;
|
|
61827
61832
|
model: z.ZodOptional<z.ZodString>;
|
|
61828
61833
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
61829
61834
|
}, z.core.$strict>;
|
|
@@ -61857,7 +61862,8 @@ export declare const postGenerateQuoteRequest: z.ZodObject<{
|
|
|
61857
61862
|
video: "video";
|
|
61858
61863
|
audio: "audio";
|
|
61859
61864
|
}>;
|
|
61860
|
-
prompt: z.ZodString
|
|
61865
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
61866
|
+
src: z.ZodOptional<z.ZodURL>;
|
|
61861
61867
|
model: z.ZodOptional<z.ZodString>;
|
|
61862
61868
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
61863
61869
|
}, z.core.$strict>;
|
package/dist/zod/zod.gen.js
CHANGED
|
@@ -433,7 +433,7 @@ export const fontFontSchema = z.object({
|
|
|
433
433
|
}).strict();
|
|
434
434
|
export const fontSchema = fontFontSchema;
|
|
435
435
|
/**
|
|
436
|
-
* An
|
|
436
|
+
* An asset to generate, from a text `prompt` or, for models that take one, a source `src`.
|
|
437
437
|
*/
|
|
438
438
|
export const generationassetGenerationAssetSchema = z.object({
|
|
439
439
|
type: z.enum([
|
|
@@ -441,13 +441,24 @@ export const generationassetGenerationAssetSchema = z.object({
|
|
|
441
441
|
'video',
|
|
442
442
|
'audio'
|
|
443
443
|
]),
|
|
444
|
-
prompt: z.string().min(1).max(4000).regex(/\S/),
|
|
444
|
+
prompt: z.optional(z.string().min(1).max(4000).regex(/\S/)),
|
|
445
|
+
src: z.optional(z.url()),
|
|
445
446
|
model: z.optional(z.string()),
|
|
446
447
|
options: z.optional(z.record(z.string(), z.unknown()))
|
|
447
|
-
}).strict()
|
|
448
|
+
}).strict().superRefine((data, ctx) => {
|
|
449
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
450
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
451
|
+
if (!hasSrc && !hasPrompt) {
|
|
452
|
+
ctx.addIssue({
|
|
453
|
+
code: z.ZodIssueCode.custom,
|
|
454
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
455
|
+
path: ["src"],
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
});
|
|
448
459
|
export const generationAssetSchema = generationassetGenerationAssetSchema;
|
|
449
460
|
/**
|
|
450
|
-
* A generation model available to
|
|
461
|
+
* A generation model available to image, video and audio assets generated from a prompt or, for some models, a source file, with the options it accepts. Use `POST /generate/quote` for a credit estimate. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release.
|
|
451
462
|
*/
|
|
452
463
|
export const generationmodelGenerationModelSchema = z.object({
|
|
453
464
|
model: z.string(),
|
|
@@ -2035,7 +2046,7 @@ export const thumbnailThumbnailSchema = z.object({
|
|
|
2035
2046
|
}).strict();
|
|
2036
2047
|
export const thumbnailSchema = thumbnailThumbnailSchema;
|
|
2037
2048
|
/**
|
|
2038
|
-
* The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.
|
|
2049
|
+
* The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified. A custom `size` can be up to 3840px on each side, or 1920px for `gif`. Video can be up to 3840 × 2160 pixels (8,294,400) in any shape, for example 2160 × 3840 for vertical 4K; larger sizes are rejected. Video above 1920 × 1080 pixels, including the `4k` resolution, needs a plan that includes 4K.
|
|
2039
2050
|
*/
|
|
2040
2051
|
export const outputOutputSchema = z.object({
|
|
2041
2052
|
format: z.enum([
|
package/dist/zod/zod.gen.ts
CHANGED
|
@@ -394,7 +394,7 @@ export const fontFontSchema = z.object({
|
|
|
394
394
|
export const fontSchema = fontFontSchema;
|
|
395
395
|
|
|
396
396
|
/**
|
|
397
|
-
* An
|
|
397
|
+
* An asset to generate, from a text `prompt` or, for models that take one, a source `src`.
|
|
398
398
|
*/
|
|
399
399
|
export const generationassetGenerationAssetSchema = z.object({
|
|
400
400
|
type: z.enum([
|
|
@@ -402,15 +402,26 @@ export const generationassetGenerationAssetSchema = z.object({
|
|
|
402
402
|
'video',
|
|
403
403
|
'audio'
|
|
404
404
|
]),
|
|
405
|
-
prompt: z.string().min(1).max(4000).regex(/\S/),
|
|
405
|
+
prompt: z.optional(z.string().min(1).max(4000).regex(/\S/)),
|
|
406
|
+
src: z.optional(z.url()),
|
|
406
407
|
model: z.optional(z.string()),
|
|
407
408
|
options: z.optional(z.record(z.string(), z.unknown()))
|
|
408
|
-
}).strict()
|
|
409
|
+
}).strict().superRefine((data, ctx) => {
|
|
410
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
411
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
412
|
+
if (!hasSrc && !hasPrompt) {
|
|
413
|
+
ctx.addIssue({
|
|
414
|
+
code: z.ZodIssueCode.custom,
|
|
415
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
416
|
+
path: ["src"],
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
});
|
|
409
420
|
|
|
410
421
|
export const generationAssetSchema = generationassetGenerationAssetSchema;
|
|
411
422
|
|
|
412
423
|
/**
|
|
413
|
-
* A generation model available to
|
|
424
|
+
* A generation model available to image, video and audio assets generated from a prompt or, for some models, a source file, with the options it accepts. Use `POST /generate/quote` for a credit estimate. Render a model picker and its option fields from this rather than hard coding a model list, so a newly launched model is available without a client release.
|
|
414
425
|
*/
|
|
415
426
|
export const generationmodelGenerationModelSchema = z.object({
|
|
416
427
|
model: z.string(),
|
|
@@ -1662,7 +1673,7 @@ export const thumbnailThumbnailSchema = z.object({
|
|
|
1662
1673
|
export const thumbnailSchema = thumbnailThumbnailSchema;
|
|
1663
1674
|
|
|
1664
1675
|
/**
|
|
1665
|
-
* The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.
|
|
1676
|
+
* The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified. A custom `size` can be up to 3840px on each side, or 1920px for `gif`. Video can be up to 3840 × 2160 pixels (8,294,400) in any shape, for example 2160 × 3840 for vertical 4K; larger sizes are rejected. Video above 1920 × 1080 pixels, including the `4k` resolution, needs a plan that includes 4K.
|
|
1666
1677
|
*/
|
|
1667
1678
|
export const outputOutputSchema = z.object({
|
|
1668
1679
|
format: z.enum([
|