@shotstack/schemas 1.12.2 → 1.13.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 +73 -19
- package/dist/json-schema/asset.json +134 -3
- package/dist/json-schema/audio-asset.json +84 -17
- package/dist/json-schema/clip.json +134 -3
- package/dist/json-schema/edit.json +134 -3
- package/dist/json-schema/image-asset.json +34 -3
- package/dist/json-schema/image-to-video-asset.json +1 -1
- package/dist/json-schema/schemas.json +157 -16
- package/dist/json-schema/template.json +135 -4
- package/dist/json-schema/text-to-image-asset.json +1 -1
- package/dist/json-schema/text-to-speech-asset.json +19 -19
- package/dist/json-schema/timeline.json +134 -3
- package/dist/json-schema/track.json +134 -3
- package/dist/json-schema/video-asset.json +70 -27
- package/dist/schema.d.ts +120 -16
- package/dist/zod/zod.gen.cjs +114 -12
- package/dist/zod/zod.gen.d.ts +1835 -1094
- package/dist/zod/zod.gen.js +114 -12
- package/dist/zod/zod.gen.ts +114 -12
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -550,7 +550,17 @@ export interface components {
|
|
|
550
550
|
};
|
|
551
551
|
/** @description The type of asset to display for the duration of the Clip, i.e. a video clip or an image. Choose from one of the available asset types below. */
|
|
552
552
|
Asset: components["schemas"]["VideoAsset"] | components["schemas"]["ImageAsset"] | components["schemas"]["TextAsset"] | components["schemas"]["RichTextAsset"] | components["schemas"]["AudioAsset"] | components["schemas"]["LumaAsset"] | components["schemas"]["CaptionAsset"] | components["schemas"]["RichCaptionAsset"] | components["schemas"]["HtmlAsset"] | components["schemas"]["Html5Asset"] | components["schemas"]["TitleAsset"] | components["schemas"]["ShapeAsset"] | components["schemas"]["SvgAsset"] | components["schemas"]["TextToImageAsset"] | components["schemas"]["ImageToVideoAsset"] | components["schemas"]["TextToSpeechAsset"];
|
|
553
|
-
/**
|
|
553
|
+
/**
|
|
554
|
+
* @description The VideoAsset adds a video to a Clip. The video can be sourced from a URL
|
|
555
|
+
* (`src`) or generated from a text prompt (`prompt`), optionally seeded from a
|
|
556
|
+
* starting image (`seed`). Exactly one of `src` or `prompt` must be provided.
|
|
557
|
+
*
|
|
558
|
+
* - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
|
|
559
|
+
* - **Generated:** set `prompt` to describe the motion. Optionally set `seed` to
|
|
560
|
+
* a starting image URL (image-to-video). Use `model` to choose the generator
|
|
561
|
+
* (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in
|
|
562
|
+
* automatically.
|
|
563
|
+
*/
|
|
554
564
|
VideoAsset: {
|
|
555
565
|
/**
|
|
556
566
|
* @description The type of asset - set to `video` for videos. (enum property replaced by openapi-typescript)
|
|
@@ -558,10 +568,25 @@ export interface components {
|
|
|
558
568
|
*/
|
|
559
569
|
type: "video";
|
|
560
570
|
/**
|
|
561
|
-
* @description The video source URL. The URL must be publicly accessible or include credentials.
|
|
571
|
+
* @description The video source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
|
|
562
572
|
* @example https://s3-ap-northeast-1.amazonaws.com/my-bucket/video.mp4
|
|
563
573
|
*/
|
|
564
|
-
src
|
|
574
|
+
src?: string;
|
|
575
|
+
/**
|
|
576
|
+
* @description A text prompt to generate the video from. When set without `src`, the engine generates a video and fills `src` automatically. Optionally pair with `seed` for image-to-video. Use `model` to choose the generator.
|
|
577
|
+
* @example Slowly zoom out and orbit left around the object.
|
|
578
|
+
*/
|
|
579
|
+
prompt?: string;
|
|
580
|
+
/**
|
|
581
|
+
* @description Seed image URL for image-to-video generation. The image is used as the starting frame; `prompt` describes the motion. Has no effect unless `prompt` is set.
|
|
582
|
+
* @example https://s3-ap-northeast-1.amazonaws.com/my-bucket/seed-image.jpg
|
|
583
|
+
*/
|
|
584
|
+
seed?: string;
|
|
585
|
+
/**
|
|
586
|
+
* @description The generation model to use when `prompt` is set (e.g. `luma-ray-3`, `runpod-itv-mini`). Defaults to the platform's preferred generator if omitted.
|
|
587
|
+
* @example luma-ray-3
|
|
588
|
+
*/
|
|
589
|
+
model?: string;
|
|
565
590
|
/**
|
|
566
591
|
* @description Set to `true` to force re-encoding of the video during preprocessing. This can help resolve compatibility issues, fix rotation problems, synchronize audio, or convert formats. The video will be processed to ensure optimal compatibility with the rendering engine.
|
|
567
592
|
* @example false
|
|
@@ -585,14 +610,22 @@ export interface components {
|
|
|
585
610
|
volumeEffect?: "none" | "fadeIn" | "fadeOut" | "fadeInFadeOut";
|
|
586
611
|
/**
|
|
587
612
|
* Format: float
|
|
588
|
-
* @description Adjust the playback speed of the video clip between 0 (paused) and 10 (10x normal speed) where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to
|
|
613
|
+
* @description Adjust the playback speed of the video clip between 0 (paused) and 10 (10x normal speed) where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. For example, if you set speed to 0.5, the clip will need to be 2x as long to play the entire video (i.e. original length / 0.5). If you set speed to 2, the clip will need to be half as long to play the entire video (i.e. original length / 2).
|
|
589
614
|
* @example 1
|
|
590
615
|
*/
|
|
591
616
|
speed?: number;
|
|
592
617
|
crop?: components["schemas"]["Crop"];
|
|
593
618
|
chromaKey?: components["schemas"]["ChromaKey"];
|
|
594
619
|
};
|
|
595
|
-
/**
|
|
620
|
+
/**
|
|
621
|
+
* @description The ImageAsset adds an image to a Clip. The image can be sourced from a URL
|
|
622
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
623
|
+
* `prompt` must be provided.
|
|
624
|
+
*
|
|
625
|
+
* - **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.
|
|
626
|
+
* - **Generated:** set `prompt` to describe the image; the engine generates it
|
|
627
|
+
* using the provider chosen by `model` and fills `src` in automatically.
|
|
628
|
+
*/
|
|
596
629
|
ImageAsset: {
|
|
597
630
|
/**
|
|
598
631
|
* @description The type of asset - set to `image` for images. (enum property replaced by openapi-typescript)
|
|
@@ -600,10 +633,20 @@ export interface components {
|
|
|
600
633
|
*/
|
|
601
634
|
type: "image";
|
|
602
635
|
/**
|
|
603
|
-
* @description The image source URL. The URL must be publicly accessible or include credentials.
|
|
636
|
+
* @description The image source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
|
|
604
637
|
* @example https://s3-ap-northeast-1.amazonaws.com/my-bucket/image.jpg
|
|
605
638
|
*/
|
|
606
|
-
src
|
|
639
|
+
src?: string;
|
|
640
|
+
/**
|
|
641
|
+
* @description A text prompt to generate the image from. When set without `src`, the engine generates an image and fills `src` automatically. Use `model` to choose the generator.
|
|
642
|
+
* @example A serene landscape with a crystal-clear mountain lake at sunrise.
|
|
643
|
+
*/
|
|
644
|
+
prompt?: string;
|
|
645
|
+
/**
|
|
646
|
+
* @description The generation model to use when `prompt` is set (e.g. `flux-schnell`). Defaults to the platform's preferred generator if omitted.
|
|
647
|
+
* @example flux-schnell
|
|
648
|
+
*/
|
|
649
|
+
model?: string;
|
|
607
650
|
crop?: components["schemas"]["Crop"];
|
|
608
651
|
};
|
|
609
652
|
/**
|
|
@@ -756,7 +799,18 @@ export interface components {
|
|
|
756
799
|
/** @description Animation properties for text entrance effects. */
|
|
757
800
|
animation?: components["schemas"]["RichTextAnimation"];
|
|
758
801
|
};
|
|
759
|
-
/**
|
|
802
|
+
/**
|
|
803
|
+
* @description The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
|
|
804
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
805
|
+
* `prompt` must be provided.
|
|
806
|
+
*
|
|
807
|
+
* - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
|
|
808
|
+
* - **Generated speech:** set `prompt` to the spoken text and `voice` to a voice
|
|
809
|
+
* identifier (text-to-speech). Optionally set `language`/`newscaster`.
|
|
810
|
+
* - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.
|
|
811
|
+
* - Use `model` to choose the generator. The generated `src` is filled in
|
|
812
|
+
* automatically.
|
|
813
|
+
*/
|
|
760
814
|
AudioAsset: {
|
|
761
815
|
/**
|
|
762
816
|
* @description The type of asset - set to `audio` for audio assets. (enum property replaced by openapi-typescript)
|
|
@@ -764,17 +818,42 @@ export interface components {
|
|
|
764
818
|
*/
|
|
765
819
|
type: "audio";
|
|
766
820
|
/**
|
|
767
|
-
* @description The audio source URL. The URL must be publicly accessible or include credentials.
|
|
821
|
+
* @description The audio source URL. The URL must be publicly accessible or include credentials. Provide either `src` or `prompt`, not both.
|
|
768
822
|
* @example https://s3-ap-northeast-1.amazonaws.com/my-bucket/sound.mp3
|
|
769
823
|
*/
|
|
770
|
-
src
|
|
824
|
+
src?: string;
|
|
825
|
+
/**
|
|
826
|
+
* @description A text prompt. When `voice` is set, the prompt is the spoken text (text-to-speech). Without `voice`, the prompt describes generated music or sound effects. The generated `src` is filled in automatically.
|
|
827
|
+
* @example Welcome to today's broadcast.
|
|
828
|
+
*/
|
|
829
|
+
prompt?: string;
|
|
830
|
+
/**
|
|
831
|
+
* @description Voice identifier for text-to-speech generation (e.g. `Matthew`, `Joanna`). Only meaningful when `prompt` is set.
|
|
832
|
+
* @example Matthew
|
|
833
|
+
*/
|
|
834
|
+
voice?: string;
|
|
835
|
+
/**
|
|
836
|
+
* @description Optional BCP-47 language code (e.g. `en-US`) for text-to-speech. Only meaningful when `prompt` and `voice` are set.
|
|
837
|
+
* @example en-US
|
|
838
|
+
*/
|
|
839
|
+
language?: string;
|
|
840
|
+
/**
|
|
841
|
+
* @description Set to `true` to use the voice's newscaster mode when supported. Only meaningful when `prompt` and `voice` are set.
|
|
842
|
+
* @default false
|
|
843
|
+
*/
|
|
844
|
+
newscaster?: boolean;
|
|
845
|
+
/**
|
|
846
|
+
* @description The generation model to use when `prompt` is set (e.g. `polly-neural`). Defaults to the platform's preferred generator if omitted.
|
|
847
|
+
* @example polly-neural
|
|
848
|
+
*/
|
|
849
|
+
model?: string;
|
|
771
850
|
/** @description The start trim point of the audio clip, in seconds (defaults to 0). Audio will start from the in trim point. The audio will play until the file ends or the Clip length is reached. */
|
|
772
851
|
trim?: number;
|
|
773
852
|
/** @description Set the volume of the audio clip. Use a number or an array of [Tween](./#tocs_tween) objects to create custom volume transitions. */
|
|
774
853
|
volume?: number | components["schemas"]["Tween"][];
|
|
775
854
|
/**
|
|
776
855
|
* Format: float
|
|
777
|
-
* @description Adjust the playback speed of the audio clip between 0 (paused) and 10 (10x normal speed), where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to
|
|
856
|
+
* @description Adjust the playback speed of the audio clip between 0 (paused) and 10 (10x normal speed), where 1 is normal speed (defaults to 1). Adjusting the speed will also adjust the duration of the clip and may require you to adjust the Clip length. For example, if you set speed to 0.5, the clip will need to be 2x as long to play the entire audio (i.e. original length / 0.5). If you set speed to 2, the clip will need to be half as long to play the entire audio (i.e. original length / 2).
|
|
778
857
|
* @example 1
|
|
779
858
|
*/
|
|
780
859
|
speed?: number;
|
|
@@ -1117,7 +1196,14 @@ export interface components {
|
|
|
1117
1196
|
*/
|
|
1118
1197
|
direction?: "left" | "right" | "up" | "down";
|
|
1119
1198
|
};
|
|
1120
|
-
/**
|
|
1199
|
+
/**
|
|
1200
|
+
* @deprecated
|
|
1201
|
+
* @description **Notice: TextToImageAsset is deprecated. Use [ImageAsset](#tocs_imageasset)
|
|
1202
|
+
* with `prompt` instead.** This type continues to function and is internally
|
|
1203
|
+
* rewritten to ImageAsset; no behaviour change for existing integrations.
|
|
1204
|
+
*
|
|
1205
|
+
* The TextToImageAsset lets you create a dynamic image from a text prompt.
|
|
1206
|
+
*/
|
|
1121
1207
|
TextToImageAsset: {
|
|
1122
1208
|
/**
|
|
1123
1209
|
* @description The type of asset to generate - set to `text-to-image` for text-to-image. (enum property replaced by openapi-typescript)
|
|
@@ -1141,7 +1227,15 @@ export interface components {
|
|
|
1141
1227
|
height?: number;
|
|
1142
1228
|
crop?: components["schemas"]["Crop"];
|
|
1143
1229
|
};
|
|
1144
|
-
/**
|
|
1230
|
+
/**
|
|
1231
|
+
* @deprecated
|
|
1232
|
+
* @description **Notice: ImageToVideoAsset is deprecated. Use [VideoAsset](#tocs_videoasset)
|
|
1233
|
+
* with `prompt` and `seed` instead.** This type continues to function and is
|
|
1234
|
+
* internally rewritten to VideoAsset; no behaviour change for existing
|
|
1235
|
+
* integrations.
|
|
1236
|
+
*
|
|
1237
|
+
* The ImageToVideoAsset lets you create a video from an image and a text prompt.
|
|
1238
|
+
*/
|
|
1145
1239
|
ImageToVideoAsset: {
|
|
1146
1240
|
/**
|
|
1147
1241
|
* @description The type of asset to generate - set to `image-to-video` for image-to-video. (enum property replaced by openapi-typescript)
|
|
@@ -1172,7 +1266,17 @@ export interface components {
|
|
|
1172
1266
|
speed?: number;
|
|
1173
1267
|
crop?: components["schemas"]["Crop"];
|
|
1174
1268
|
};
|
|
1175
|
-
/**
|
|
1269
|
+
/**
|
|
1270
|
+
* @deprecated
|
|
1271
|
+
* @description **Notice: TextToSpeechAsset is deprecated. Use [AudioAsset](#tocs_audioasset)
|
|
1272
|
+
* with `prompt` (the spoken text) and `voice` instead.** This type continues to
|
|
1273
|
+
* function and is internally rewritten to AudioAsset; no behaviour change for
|
|
1274
|
+
* existing integrations.
|
|
1275
|
+
*
|
|
1276
|
+
* The TextToSpeechAsset lets you generate a voice over from text using a text-to-speech service.
|
|
1277
|
+
* The generated audio can be trimmed, faded and have its volume and speed adjusted using the
|
|
1278
|
+
* same properties available on the AudioAsset.
|
|
1279
|
+
*/
|
|
1176
1280
|
TextToSpeechAsset: {
|
|
1177
1281
|
/**
|
|
1178
1282
|
* @description The type of asset - set to `text-to-speech` for text-to-speech. (enum property replaced by openapi-typescript)
|
|
@@ -2015,7 +2119,7 @@ export interface components {
|
|
|
2015
2119
|
*/
|
|
2016
2120
|
replace: unknown;
|
|
2017
2121
|
};
|
|
2018
|
-
/** @description The output format, render range and type of media to generate. */
|
|
2122
|
+
/** @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. */
|
|
2019
2123
|
Output: {
|
|
2020
2124
|
/**
|
|
2021
2125
|
* @description The output format and type of media file to generate. <ul>
|
|
@@ -2031,7 +2135,7 @@ export interface components {
|
|
|
2031
2135
|
*/
|
|
2032
2136
|
format: "mp4" | "gif" | "mp3" | "jpg" | "png" | "bmp";
|
|
2033
2137
|
/**
|
|
2034
|
-
* @description The preset output resolution of the video or image. For custom sizes use the `size` property. <ul>
|
|
2138
|
+
* @description The preset output resolution of the video or image. For custom sizes use the `size` property. Either `resolution` or `size` (with both `width` and `height`) must be specified for all formats except `mp3`. <ul>
|
|
2035
2139
|
* <li>`preview` - 512px x 288px @ 15fps</li>
|
|
2036
2140
|
* <li>`mobile` - 640px x 360px @ 25fps</li>
|
|
2037
2141
|
* <li>`sd` - 1024px x 576px @ 25fps</li>
|
package/dist/zod/zod.gen.cjs
CHANGED
|
@@ -473,16 +473,43 @@ exports.htmlassetHtmlAssetSchema = zod_1.z.object({
|
|
|
473
473
|
}).strict();
|
|
474
474
|
exports.htmlAssetSchema = exports.htmlassetHtmlAssetSchema;
|
|
475
475
|
/**
|
|
476
|
-
* The ImageAsset
|
|
476
|
+
* The ImageAsset adds an image to a Clip. The image can be sourced from a URL
|
|
477
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
478
|
+
* `prompt` must be provided.
|
|
479
|
+
*
|
|
480
|
+
* - **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.
|
|
481
|
+
* - **Generated:** set `prompt` to describe the image; the engine generates it
|
|
482
|
+
* using the provider chosen by `model` and fills `src` in automatically.
|
|
483
|
+
*
|
|
477
484
|
*/
|
|
478
485
|
exports.imageassetImageAssetSchema = zod_1.z.object({
|
|
479
486
|
type: zod_1.z.enum(['image']),
|
|
480
|
-
src: zod_1.z.string().min(1).regex(/\S/),
|
|
487
|
+
src: zod_1.z.optional(zod_1.z.string().min(1).regex(/\S/)),
|
|
488
|
+
prompt: zod_1.z.optional(zod_1.z.string().max(4000)),
|
|
489
|
+
model: zod_1.z.optional(zod_1.z.string()),
|
|
481
490
|
crop: zod_1.z.optional(exports.cropCropSchema)
|
|
482
|
-
}).strict()
|
|
491
|
+
}).strict().superRefine((data, ctx) => {
|
|
492
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
493
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
494
|
+
if (!hasSrc && !hasPrompt) {
|
|
495
|
+
ctx.addIssue({
|
|
496
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
497
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
498
|
+
path: ["src"],
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
});
|
|
483
502
|
exports.imageAssetSchema = exports.imageassetImageAssetSchema;
|
|
484
503
|
/**
|
|
504
|
+
* **Notice: ImageToVideoAsset is deprecated. Use [VideoAsset](#tocs_videoasset)
|
|
505
|
+
* with `prompt` and `seed` instead.** This type continues to function and is
|
|
506
|
+
* internally rewritten to VideoAsset; no behaviour change for existing
|
|
507
|
+
* integrations.
|
|
508
|
+
*
|
|
485
509
|
* The ImageToVideoAsset lets you create a video from an image and a text prompt.
|
|
510
|
+
*
|
|
511
|
+
*
|
|
512
|
+
* @deprecated
|
|
486
513
|
*/
|
|
487
514
|
exports.imagetovideoassetImageToVideoAssetSchema = zod_1.z.object({
|
|
488
515
|
type: zod_1.z.enum(['image-to-video']),
|
|
@@ -1820,7 +1847,14 @@ exports.textassetTextAssetSchema = zod_1.z.object({
|
|
|
1820
1847
|
});
|
|
1821
1848
|
exports.textAssetSchema = exports.textassetTextAssetSchema;
|
|
1822
1849
|
/**
|
|
1850
|
+
* **Notice: TextToImageAsset is deprecated. Use [ImageAsset](#tocs_imageasset)
|
|
1851
|
+
* with `prompt` instead.** This type continues to function and is internally
|
|
1852
|
+
* rewritten to ImageAsset; no behaviour change for existing integrations.
|
|
1853
|
+
*
|
|
1823
1854
|
* The TextToImageAsset lets you create a dynamic image from a text prompt.
|
|
1855
|
+
*
|
|
1856
|
+
*
|
|
1857
|
+
* @deprecated
|
|
1824
1858
|
*/
|
|
1825
1859
|
exports.texttoimageassetTextToImageAssetSchema = zod_1.z.object({
|
|
1826
1860
|
type: zod_1.z.enum(['text-to-image']),
|
|
@@ -1863,7 +1897,7 @@ exports.thumbnailThumbnailSchema = zod_1.z.object({
|
|
|
1863
1897
|
}).strict();
|
|
1864
1898
|
exports.thumbnailSchema = exports.thumbnailThumbnailSchema;
|
|
1865
1899
|
/**
|
|
1866
|
-
* The output format, render range and type of media to generate.
|
|
1900
|
+
* 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.
|
|
1867
1901
|
*/
|
|
1868
1902
|
exports.outputOutputSchema = zod_1.z.object({
|
|
1869
1903
|
format: zod_1.z.enum([
|
|
@@ -1924,7 +1958,18 @@ exports.outputOutputSchema = zod_1.z.object({
|
|
|
1924
1958
|
poster: zod_1.z.optional(exports.posterPosterSchema),
|
|
1925
1959
|
thumbnail: zod_1.z.optional(exports.thumbnailThumbnailSchema),
|
|
1926
1960
|
destinations: zod_1.z.optional(zod_1.z.array(exports.destinationsDestinationsSchema))
|
|
1927
|
-
}).strict()
|
|
1961
|
+
}).strict().superRefine((val, ctx) => {
|
|
1962
|
+
var isMp3 = val.format === "mp3";
|
|
1963
|
+
if (!isMp3 && val.size != null && (val.size.width == null || val.size.height == null)) {
|
|
1964
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["size"], message: "size requires both width and height" });
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1967
|
+
var hasResolution = typeof val.resolution === "string";
|
|
1968
|
+
var hasSize = val.size != null && val.size.width != null && val.size.height != null;
|
|
1969
|
+
if (!isMp3 && !hasResolution && !hasSize) {
|
|
1970
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, message: 'output requires either "resolution" or "size" (with width and height)' });
|
|
1971
|
+
}
|
|
1972
|
+
});
|
|
1928
1973
|
exports.outputSchema = exports.outputOutputSchema;
|
|
1929
1974
|
/**
|
|
1930
1975
|
* In and out transitions for a clip - i.e. fade in and fade out
|
|
@@ -2125,11 +2170,26 @@ exports.tweenTweenSchema = zod_1.z.object({
|
|
|
2125
2170
|
}).strict();
|
|
2126
2171
|
exports.tweenSchema = exports.tweenTweenSchema;
|
|
2127
2172
|
/**
|
|
2128
|
-
* The AudioAsset
|
|
2173
|
+
* The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
|
|
2174
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
2175
|
+
* `prompt` must be provided.
|
|
2176
|
+
*
|
|
2177
|
+
* - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
|
|
2178
|
+
* - **Generated speech:** set `prompt` to the spoken text and `voice` to a voice
|
|
2179
|
+
* identifier (text-to-speech). Optionally set `language`/`newscaster`.
|
|
2180
|
+
* - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.
|
|
2181
|
+
* - Use `model` to choose the generator. The generated `src` is filled in
|
|
2182
|
+
* automatically.
|
|
2183
|
+
*
|
|
2129
2184
|
*/
|
|
2130
2185
|
exports.audioassetAudioAssetSchema = zod_1.z.object({
|
|
2131
2186
|
type: zod_1.z.enum(['audio']),
|
|
2132
|
-
src: zod_1.z.string().min(1).regex(/\S/),
|
|
2187
|
+
src: zod_1.z.optional(zod_1.z.string().min(1).regex(/\S/)),
|
|
2188
|
+
prompt: zod_1.z.optional(zod_1.z.string().max(4000)),
|
|
2189
|
+
voice: zod_1.z.optional(zod_1.z.string()),
|
|
2190
|
+
language: zod_1.z.optional(zod_1.z.string()),
|
|
2191
|
+
newscaster: zod_1.z.optional(zod_1.z.boolean()).default(false),
|
|
2192
|
+
model: zod_1.z.optional(zod_1.z.string()),
|
|
2133
2193
|
trim: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2134
2194
|
return undefined; if (Array.isArray(v))
|
|
2135
2195
|
return v; if (typeof v === 'string') {
|
|
@@ -2160,7 +2220,17 @@ exports.audioassetAudioAssetSchema = zod_1.z.object({
|
|
|
2160
2220
|
'fadeOut',
|
|
2161
2221
|
'fadeInFadeOut'
|
|
2162
2222
|
]))
|
|
2163
|
-
}).strict()
|
|
2223
|
+
}).strict().superRefine((data, ctx) => {
|
|
2224
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
2225
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
2226
|
+
if (!hasSrc && !hasPrompt) {
|
|
2227
|
+
ctx.addIssue({
|
|
2228
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
2229
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
2230
|
+
path: ["src"],
|
|
2231
|
+
});
|
|
2232
|
+
}
|
|
2233
|
+
});
|
|
2164
2234
|
exports.audioAssetSchema = exports.audioassetAudioAssetSchema;
|
|
2165
2235
|
/**
|
|
2166
2236
|
* Offsets the position of an asset horizontally or vertically by a relative distance.
|
|
@@ -2231,7 +2301,17 @@ exports.skewtransformationSkewTransformationSchema = zod_1.z.object({
|
|
|
2231
2301
|
}).strict();
|
|
2232
2302
|
exports.skewTransformationSchema = exports.skewtransformationSkewTransformationSchema;
|
|
2233
2303
|
/**
|
|
2234
|
-
*
|
|
2304
|
+
* **Notice: TextToSpeechAsset is deprecated. Use [AudioAsset](#tocs_audioasset)
|
|
2305
|
+
* with `prompt` (the spoken text) and `voice` instead.** This type continues to
|
|
2306
|
+
* function and is internally rewritten to AudioAsset; no behaviour change for
|
|
2307
|
+
* existing integrations.
|
|
2308
|
+
*
|
|
2309
|
+
* The TextToSpeechAsset lets you generate a voice over from text using a text-to-speech service.
|
|
2310
|
+
* The generated audio can be trimmed, faded and have its volume and speed adjusted using the
|
|
2311
|
+
* same properties available on the AudioAsset.
|
|
2312
|
+
*
|
|
2313
|
+
*
|
|
2314
|
+
* @deprecated
|
|
2235
2315
|
*/
|
|
2236
2316
|
exports.texttospeechassetTextToSpeechAssetSchema = zod_1.z.object({
|
|
2237
2317
|
type: zod_1.z.enum(['text-to-speech']),
|
|
@@ -2329,11 +2409,23 @@ exports.transformationTransformationSchema = zod_1.z.object({
|
|
|
2329
2409
|
}).strict();
|
|
2330
2410
|
exports.transformationSchema = exports.transformationTransformationSchema;
|
|
2331
2411
|
/**
|
|
2332
|
-
* The VideoAsset
|
|
2412
|
+
* The VideoAsset adds a video to a Clip. The video can be sourced from a URL
|
|
2413
|
+
* (`src`) or generated from a text prompt (`prompt`), optionally seeded from a
|
|
2414
|
+
* starting image (`seed`). Exactly one of `src` or `prompt` must be provided.
|
|
2415
|
+
*
|
|
2416
|
+
* - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
|
|
2417
|
+
* - **Generated:** set `prompt` to describe the motion. Optionally set `seed` to
|
|
2418
|
+
* a starting image URL (image-to-video). Use `model` to choose the generator
|
|
2419
|
+
* (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in
|
|
2420
|
+
* automatically.
|
|
2421
|
+
*
|
|
2333
2422
|
*/
|
|
2334
2423
|
exports.videoassetVideoAssetSchema = zod_1.z.object({
|
|
2335
2424
|
type: zod_1.z.enum(['video']),
|
|
2336
|
-
src: zod_1.z.string().min(1).regex(/\S/),
|
|
2425
|
+
src: zod_1.z.optional(zod_1.z.string().min(1).regex(/\S/)),
|
|
2426
|
+
prompt: zod_1.z.optional(zod_1.z.string().max(4000)),
|
|
2427
|
+
seed: zod_1.z.optional(zod_1.z.string().min(1)),
|
|
2428
|
+
model: zod_1.z.optional(zod_1.z.string()),
|
|
2337
2429
|
transcode: zod_1.z.optional(zod_1.z.boolean()),
|
|
2338
2430
|
trim: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2339
2431
|
return undefined; if (Array.isArray(v))
|
|
@@ -2367,7 +2459,17 @@ exports.videoassetVideoAssetSchema = zod_1.z.object({
|
|
|
2367
2459
|
} return v; }), zod_1.z.number().gte(0).lte(10)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2368
2460
|
crop: zod_1.z.optional(exports.cropCropSchema),
|
|
2369
2461
|
chromaKey: zod_1.z.optional(exports.chromakeyChromaKeySchema)
|
|
2370
|
-
}).strict()
|
|
2462
|
+
}).strict().superRefine((data, ctx) => {
|
|
2463
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
2464
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
2465
|
+
if (!hasSrc && !hasPrompt) {
|
|
2466
|
+
ctx.addIssue({
|
|
2467
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
2468
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
2469
|
+
path: ["src"],
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2472
|
+
});
|
|
2371
2473
|
exports.videoAssetSchema = exports.videoassetVideoAssetSchema;
|
|
2372
2474
|
/**
|
|
2373
2475
|
* The type of asset to display for the duration of the Clip, i.e. a video clip or an image. Choose from one of the available asset types below.
|