@shotstack/schemas 1.12.1 → 1.13.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/dist/api.bundled.json +78 -17
- package/dist/json-schema/asset.json +148 -4
- package/dist/json-schema/audio-asset.json +84 -17
- package/dist/json-schema/clip.json +148 -4
- package/dist/json-schema/edit.json +148 -4
- package/dist/json-schema/image-asset.json +34 -3
- package/dist/json-schema/image-to-video-asset.json +1 -1
- package/dist/json-schema/rich-caption-asset.json +14 -1
- package/dist/json-schema/rich-text-asset.json +14 -1
- package/dist/json-schema/rich-text-background.json +15 -1
- package/dist/json-schema/rich-text-content.json +14 -1
- package/dist/json-schema/schemas.json +170 -15
- 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 +148 -4
- package/dist/json-schema/track.json +148 -4
- package/dist/json-schema/video-asset.json +70 -27
- package/dist/schema.d.ts +127 -14
- package/dist/zod/zod.gen.cjs +109 -11
- package/dist/zod/zod.gen.d.ts +2162 -1281
- package/dist/zod/zod.gen.js +109 -11
- package/dist/zod/zod.gen.ts +103 -11
- 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)
|
|
@@ -1793,6 +1897,15 @@ export interface components {
|
|
|
1793
1897
|
* @example true
|
|
1794
1898
|
*/
|
|
1795
1899
|
wrap?: boolean;
|
|
1900
|
+
/**
|
|
1901
|
+
* @description Inner padding in pixels between the wrap pill edge and the rendered text. Only takes
|
|
1902
|
+
* effect when `wrap: true`. When omitted, the renderer applies a sensible default
|
|
1903
|
+
* proportional to the font size (approximately 12% of the active page font size on
|
|
1904
|
+
* rich-caption assets). Set to 0 for a pill that hugs the text exactly. Available on
|
|
1905
|
+
* rich-text and rich-caption assets only.
|
|
1906
|
+
* @example 12
|
|
1907
|
+
*/
|
|
1908
|
+
padding?: number;
|
|
1796
1909
|
};
|
|
1797
1910
|
/** @description Text alignment properties (horizontal and vertical). */
|
|
1798
1911
|
RichTextAlignment: {
|
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']),
|
|
@@ -932,7 +959,14 @@ exports.richtextpropertiesRichTextBackgroundSchema = zod_1.z.object({
|
|
|
932
959
|
return v;
|
|
933
960
|
return Number(v);
|
|
934
961
|
} return v; }), zod_1.z.number().gte(0)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
935
|
-
wrap: zod_1.z.optional(zod_1.z.boolean()).default(false)
|
|
962
|
+
wrap: zod_1.z.optional(zod_1.z.boolean()).default(false),
|
|
963
|
+
padding: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
964
|
+
return undefined; if (Array.isArray(v))
|
|
965
|
+
return v; if (typeof v === 'string') {
|
|
966
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
967
|
+
return v;
|
|
968
|
+
return Number(v);
|
|
969
|
+
} return v; }), zod_1.z.number().int().gte(0).lte(200)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
936
970
|
}).strict();
|
|
937
971
|
exports.richTextBackgroundSchema = exports.richtextpropertiesRichTextBackgroundSchema;
|
|
938
972
|
/**
|
|
@@ -1813,7 +1847,14 @@ exports.textassetTextAssetSchema = zod_1.z.object({
|
|
|
1813
1847
|
});
|
|
1814
1848
|
exports.textAssetSchema = exports.textassetTextAssetSchema;
|
|
1815
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
|
+
*
|
|
1816
1854
|
* The TextToImageAsset lets you create a dynamic image from a text prompt.
|
|
1855
|
+
*
|
|
1856
|
+
*
|
|
1857
|
+
* @deprecated
|
|
1817
1858
|
*/
|
|
1818
1859
|
exports.texttoimageassetTextToImageAssetSchema = zod_1.z.object({
|
|
1819
1860
|
type: zod_1.z.enum(['text-to-image']),
|
|
@@ -2118,11 +2159,26 @@ exports.tweenTweenSchema = zod_1.z.object({
|
|
|
2118
2159
|
}).strict();
|
|
2119
2160
|
exports.tweenSchema = exports.tweenTweenSchema;
|
|
2120
2161
|
/**
|
|
2121
|
-
* The AudioAsset
|
|
2162
|
+
* The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
|
|
2163
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
2164
|
+
* `prompt` must be provided.
|
|
2165
|
+
*
|
|
2166
|
+
* - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
|
|
2167
|
+
* - **Generated speech:** set `prompt` to the spoken text and `voice` to a voice
|
|
2168
|
+
* identifier (text-to-speech). Optionally set `language`/`newscaster`.
|
|
2169
|
+
* - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.
|
|
2170
|
+
* - Use `model` to choose the generator. The generated `src` is filled in
|
|
2171
|
+
* automatically.
|
|
2172
|
+
*
|
|
2122
2173
|
*/
|
|
2123
2174
|
exports.audioassetAudioAssetSchema = zod_1.z.object({
|
|
2124
2175
|
type: zod_1.z.enum(['audio']),
|
|
2125
|
-
src: zod_1.z.string().min(1).regex(/\S/),
|
|
2176
|
+
src: zod_1.z.optional(zod_1.z.string().min(1).regex(/\S/)),
|
|
2177
|
+
prompt: zod_1.z.optional(zod_1.z.string().max(4000)),
|
|
2178
|
+
voice: zod_1.z.optional(zod_1.z.string()),
|
|
2179
|
+
language: zod_1.z.optional(zod_1.z.string()),
|
|
2180
|
+
newscaster: zod_1.z.optional(zod_1.z.boolean()).default(false),
|
|
2181
|
+
model: zod_1.z.optional(zod_1.z.string()),
|
|
2126
2182
|
trim: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2127
2183
|
return undefined; if (Array.isArray(v))
|
|
2128
2184
|
return v; if (typeof v === 'string') {
|
|
@@ -2153,7 +2209,17 @@ exports.audioassetAudioAssetSchema = zod_1.z.object({
|
|
|
2153
2209
|
'fadeOut',
|
|
2154
2210
|
'fadeInFadeOut'
|
|
2155
2211
|
]))
|
|
2156
|
-
}).strict()
|
|
2212
|
+
}).strict().superRefine((data, ctx) => {
|
|
2213
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
2214
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
2215
|
+
if (!hasSrc && !hasPrompt) {
|
|
2216
|
+
ctx.addIssue({
|
|
2217
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
2218
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
2219
|
+
path: ["src"],
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
});
|
|
2157
2223
|
exports.audioAssetSchema = exports.audioassetAudioAssetSchema;
|
|
2158
2224
|
/**
|
|
2159
2225
|
* Offsets the position of an asset horizontally or vertically by a relative distance.
|
|
@@ -2224,7 +2290,17 @@ exports.skewtransformationSkewTransformationSchema = zod_1.z.object({
|
|
|
2224
2290
|
}).strict();
|
|
2225
2291
|
exports.skewTransformationSchema = exports.skewtransformationSkewTransformationSchema;
|
|
2226
2292
|
/**
|
|
2227
|
-
*
|
|
2293
|
+
* **Notice: TextToSpeechAsset is deprecated. Use [AudioAsset](#tocs_audioasset)
|
|
2294
|
+
* with `prompt` (the spoken text) and `voice` instead.** This type continues to
|
|
2295
|
+
* function and is internally rewritten to AudioAsset; no behaviour change for
|
|
2296
|
+
* existing integrations.
|
|
2297
|
+
*
|
|
2298
|
+
* The TextToSpeechAsset lets you generate a voice over from text using a text-to-speech service.
|
|
2299
|
+
* The generated audio can be trimmed, faded and have its volume and speed adjusted using the
|
|
2300
|
+
* same properties available on the AudioAsset.
|
|
2301
|
+
*
|
|
2302
|
+
*
|
|
2303
|
+
* @deprecated
|
|
2228
2304
|
*/
|
|
2229
2305
|
exports.texttospeechassetTextToSpeechAssetSchema = zod_1.z.object({
|
|
2230
2306
|
type: zod_1.z.enum(['text-to-speech']),
|
|
@@ -2322,11 +2398,23 @@ exports.transformationTransformationSchema = zod_1.z.object({
|
|
|
2322
2398
|
}).strict();
|
|
2323
2399
|
exports.transformationSchema = exports.transformationTransformationSchema;
|
|
2324
2400
|
/**
|
|
2325
|
-
* The VideoAsset
|
|
2401
|
+
* The VideoAsset adds a video to a Clip. The video can be sourced from a URL
|
|
2402
|
+
* (`src`) or generated from a text prompt (`prompt`), optionally seeded from a
|
|
2403
|
+
* starting image (`seed`). Exactly one of `src` or `prompt` must be provided.
|
|
2404
|
+
*
|
|
2405
|
+
* - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
|
|
2406
|
+
* - **Generated:** set `prompt` to describe the motion. Optionally set `seed` to
|
|
2407
|
+
* a starting image URL (image-to-video). Use `model` to choose the generator
|
|
2408
|
+
* (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in
|
|
2409
|
+
* automatically.
|
|
2410
|
+
*
|
|
2326
2411
|
*/
|
|
2327
2412
|
exports.videoassetVideoAssetSchema = zod_1.z.object({
|
|
2328
2413
|
type: zod_1.z.enum(['video']),
|
|
2329
|
-
src: zod_1.z.string().min(1).regex(/\S/),
|
|
2414
|
+
src: zod_1.z.optional(zod_1.z.string().min(1).regex(/\S/)),
|
|
2415
|
+
prompt: zod_1.z.optional(zod_1.z.string().max(4000)),
|
|
2416
|
+
seed: zod_1.z.optional(zod_1.z.string().min(1)),
|
|
2417
|
+
model: zod_1.z.optional(zod_1.z.string()),
|
|
2330
2418
|
transcode: zod_1.z.optional(zod_1.z.boolean()),
|
|
2331
2419
|
trim: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2332
2420
|
return undefined; if (Array.isArray(v))
|
|
@@ -2360,7 +2448,17 @@ exports.videoassetVideoAssetSchema = zod_1.z.object({
|
|
|
2360
2448
|
} return v; }), zod_1.z.number().gte(0).lte(10)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2361
2449
|
crop: zod_1.z.optional(exports.cropCropSchema),
|
|
2362
2450
|
chromaKey: zod_1.z.optional(exports.chromakeyChromaKeySchema)
|
|
2363
|
-
}).strict()
|
|
2451
|
+
}).strict().superRefine((data, ctx) => {
|
|
2452
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
2453
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
2454
|
+
if (!hasSrc && !hasPrompt) {
|
|
2455
|
+
ctx.addIssue({
|
|
2456
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
2457
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
2458
|
+
path: ["src"],
|
|
2459
|
+
});
|
|
2460
|
+
}
|
|
2461
|
+
});
|
|
2364
2462
|
exports.videoAssetSchema = exports.videoassetVideoAssetSchema;
|
|
2365
2463
|
/**
|
|
2366
2464
|
* 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.
|