@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/zod/zod.gen.js
CHANGED
|
@@ -465,16 +465,43 @@ export const htmlassetHtmlAssetSchema = z.object({
|
|
|
465
465
|
}).strict();
|
|
466
466
|
export const htmlAssetSchema = htmlassetHtmlAssetSchema;
|
|
467
467
|
/**
|
|
468
|
-
* The ImageAsset
|
|
468
|
+
* The ImageAsset adds an image to a Clip. The image can be sourced from a URL
|
|
469
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
470
|
+
* `prompt` must be provided.
|
|
471
|
+
*
|
|
472
|
+
* - **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.
|
|
473
|
+
* - **Generated:** set `prompt` to describe the image; the engine generates it
|
|
474
|
+
* using the provider chosen by `model` and fills `src` in automatically.
|
|
475
|
+
*
|
|
469
476
|
*/
|
|
470
477
|
export const imageassetImageAssetSchema = z.object({
|
|
471
478
|
type: z.enum(['image']),
|
|
472
|
-
src: z.string().min(1).regex(/\S/),
|
|
479
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
480
|
+
prompt: z.optional(z.string().max(4000)),
|
|
481
|
+
model: z.optional(z.string()),
|
|
473
482
|
crop: z.optional(cropCropSchema)
|
|
474
|
-
}).strict()
|
|
483
|
+
}).strict().superRefine((data, ctx) => {
|
|
484
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
485
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
486
|
+
if (!hasSrc && !hasPrompt) {
|
|
487
|
+
ctx.addIssue({
|
|
488
|
+
code: z.ZodIssueCode.custom,
|
|
489
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
490
|
+
path: ["src"],
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
});
|
|
475
494
|
export const imageAssetSchema = imageassetImageAssetSchema;
|
|
476
495
|
/**
|
|
496
|
+
* **Notice: ImageToVideoAsset is deprecated. Use [VideoAsset](#tocs_videoasset)
|
|
497
|
+
* with `prompt` and `seed` instead.** This type continues to function and is
|
|
498
|
+
* internally rewritten to VideoAsset; no behaviour change for existing
|
|
499
|
+
* integrations.
|
|
500
|
+
*
|
|
477
501
|
* The ImageToVideoAsset lets you create a video from an image and a text prompt.
|
|
502
|
+
*
|
|
503
|
+
*
|
|
504
|
+
* @deprecated
|
|
478
505
|
*/
|
|
479
506
|
export const imagetovideoassetImageToVideoAssetSchema = z.object({
|
|
480
507
|
type: z.enum(['image-to-video']),
|
|
@@ -924,7 +951,14 @@ export const richtextpropertiesRichTextBackgroundSchema = z.object({
|
|
|
924
951
|
return v;
|
|
925
952
|
return Number(v);
|
|
926
953
|
} return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
927
|
-
wrap: z.optional(z.boolean()).default(false)
|
|
954
|
+
wrap: z.optional(z.boolean()).default(false),
|
|
955
|
+
padding: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
956
|
+
return undefined; if (Array.isArray(v))
|
|
957
|
+
return v; if (typeof v === 'string') {
|
|
958
|
+
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
959
|
+
return v;
|
|
960
|
+
return Number(v);
|
|
961
|
+
} return v; }), z.number().int().gte(0).lte(200)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
928
962
|
}).strict();
|
|
929
963
|
export const richTextBackgroundSchema = richtextpropertiesRichTextBackgroundSchema;
|
|
930
964
|
/**
|
|
@@ -1805,7 +1839,14 @@ export const textassetTextAssetSchema = z.object({
|
|
|
1805
1839
|
});
|
|
1806
1840
|
export const textAssetSchema = textassetTextAssetSchema;
|
|
1807
1841
|
/**
|
|
1842
|
+
* **Notice: TextToImageAsset is deprecated. Use [ImageAsset](#tocs_imageasset)
|
|
1843
|
+
* with `prompt` instead.** This type continues to function and is internally
|
|
1844
|
+
* rewritten to ImageAsset; no behaviour change for existing integrations.
|
|
1845
|
+
*
|
|
1808
1846
|
* The TextToImageAsset lets you create a dynamic image from a text prompt.
|
|
1847
|
+
*
|
|
1848
|
+
*
|
|
1849
|
+
* @deprecated
|
|
1809
1850
|
*/
|
|
1810
1851
|
export const texttoimageassetTextToImageAssetSchema = z.object({
|
|
1811
1852
|
type: z.enum(['text-to-image']),
|
|
@@ -2110,11 +2151,26 @@ export const tweenTweenSchema = z.object({
|
|
|
2110
2151
|
}).strict();
|
|
2111
2152
|
export const tweenSchema = tweenTweenSchema;
|
|
2112
2153
|
/**
|
|
2113
|
-
* The AudioAsset
|
|
2154
|
+
* The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
|
|
2155
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
2156
|
+
* `prompt` must be provided.
|
|
2157
|
+
*
|
|
2158
|
+
* - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
|
|
2159
|
+
* - **Generated speech:** set `prompt` to the spoken text and `voice` to a voice
|
|
2160
|
+
* identifier (text-to-speech). Optionally set `language`/`newscaster`.
|
|
2161
|
+
* - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.
|
|
2162
|
+
* - Use `model` to choose the generator. The generated `src` is filled in
|
|
2163
|
+
* automatically.
|
|
2164
|
+
*
|
|
2114
2165
|
*/
|
|
2115
2166
|
export const audioassetAudioAssetSchema = z.object({
|
|
2116
2167
|
type: z.enum(['audio']),
|
|
2117
|
-
src: z.string().min(1).regex(/\S/),
|
|
2168
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
2169
|
+
prompt: z.optional(z.string().max(4000)),
|
|
2170
|
+
voice: z.optional(z.string()),
|
|
2171
|
+
language: z.optional(z.string()),
|
|
2172
|
+
newscaster: z.optional(z.boolean()).default(false),
|
|
2173
|
+
model: z.optional(z.string()),
|
|
2118
2174
|
trim: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2119
2175
|
return undefined; if (Array.isArray(v))
|
|
2120
2176
|
return v; if (typeof v === 'string') {
|
|
@@ -2145,7 +2201,17 @@ export const audioassetAudioAssetSchema = z.object({
|
|
|
2145
2201
|
'fadeOut',
|
|
2146
2202
|
'fadeInFadeOut'
|
|
2147
2203
|
]))
|
|
2148
|
-
}).strict()
|
|
2204
|
+
}).strict().superRefine((data, ctx) => {
|
|
2205
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
2206
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
2207
|
+
if (!hasSrc && !hasPrompt) {
|
|
2208
|
+
ctx.addIssue({
|
|
2209
|
+
code: z.ZodIssueCode.custom,
|
|
2210
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
2211
|
+
path: ["src"],
|
|
2212
|
+
});
|
|
2213
|
+
}
|
|
2214
|
+
});
|
|
2149
2215
|
export const audioAssetSchema = audioassetAudioAssetSchema;
|
|
2150
2216
|
/**
|
|
2151
2217
|
* Offsets the position of an asset horizontally or vertically by a relative distance.
|
|
@@ -2216,7 +2282,17 @@ export const skewtransformationSkewTransformationSchema = z.object({
|
|
|
2216
2282
|
}).strict();
|
|
2217
2283
|
export const skewTransformationSchema = skewtransformationSkewTransformationSchema;
|
|
2218
2284
|
/**
|
|
2219
|
-
*
|
|
2285
|
+
* **Notice: TextToSpeechAsset is deprecated. Use [AudioAsset](#tocs_audioasset)
|
|
2286
|
+
* with `prompt` (the spoken text) and `voice` instead.** This type continues to
|
|
2287
|
+
* function and is internally rewritten to AudioAsset; no behaviour change for
|
|
2288
|
+
* existing integrations.
|
|
2289
|
+
*
|
|
2290
|
+
* The TextToSpeechAsset lets you generate a voice over from text using a text-to-speech service.
|
|
2291
|
+
* The generated audio can be trimmed, faded and have its volume and speed adjusted using the
|
|
2292
|
+
* same properties available on the AudioAsset.
|
|
2293
|
+
*
|
|
2294
|
+
*
|
|
2295
|
+
* @deprecated
|
|
2220
2296
|
*/
|
|
2221
2297
|
export const texttospeechassetTextToSpeechAssetSchema = z.object({
|
|
2222
2298
|
type: z.enum(['text-to-speech']),
|
|
@@ -2314,11 +2390,23 @@ export const transformationTransformationSchema = z.object({
|
|
|
2314
2390
|
}).strict();
|
|
2315
2391
|
export const transformationSchema = transformationTransformationSchema;
|
|
2316
2392
|
/**
|
|
2317
|
-
* The VideoAsset
|
|
2393
|
+
* The VideoAsset adds a video to a Clip. The video can be sourced from a URL
|
|
2394
|
+
* (`src`) or generated from a text prompt (`prompt`), optionally seeded from a
|
|
2395
|
+
* starting image (`seed`). Exactly one of `src` or `prompt` must be provided.
|
|
2396
|
+
*
|
|
2397
|
+
* - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
|
|
2398
|
+
* - **Generated:** set `prompt` to describe the motion. Optionally set `seed` to
|
|
2399
|
+
* a starting image URL (image-to-video). Use `model` to choose the generator
|
|
2400
|
+
* (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in
|
|
2401
|
+
* automatically.
|
|
2402
|
+
*
|
|
2318
2403
|
*/
|
|
2319
2404
|
export const videoassetVideoAssetSchema = z.object({
|
|
2320
2405
|
type: z.enum(['video']),
|
|
2321
|
-
src: z.string().min(1).regex(/\S/),
|
|
2406
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
2407
|
+
prompt: z.optional(z.string().max(4000)),
|
|
2408
|
+
seed: z.optional(z.string().min(1)),
|
|
2409
|
+
model: z.optional(z.string()),
|
|
2322
2410
|
transcode: z.optional(z.boolean()),
|
|
2323
2411
|
trim: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2324
2412
|
return undefined; if (Array.isArray(v))
|
|
@@ -2352,7 +2440,17 @@ export const videoassetVideoAssetSchema = z.object({
|
|
|
2352
2440
|
} return v; }), z.number().gte(0).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2353
2441
|
crop: z.optional(cropCropSchema),
|
|
2354
2442
|
chromaKey: z.optional(chromakeyChromaKeySchema)
|
|
2355
|
-
}).strict()
|
|
2443
|
+
}).strict().superRefine((data, ctx) => {
|
|
2444
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
2445
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
2446
|
+
if (!hasSrc && !hasPrompt) {
|
|
2447
|
+
ctx.addIssue({
|
|
2448
|
+
code: z.ZodIssueCode.custom,
|
|
2449
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
2450
|
+
path: ["src"],
|
|
2451
|
+
});
|
|
2452
|
+
}
|
|
2453
|
+
});
|
|
2356
2454
|
export const videoAssetSchema = videoassetVideoAssetSchema;
|
|
2357
2455
|
/**
|
|
2358
2456
|
* 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.
|
package/dist/zod/zod.gen.ts
CHANGED
|
@@ -413,18 +413,45 @@ export const htmlassetHtmlAssetSchema = z.object({
|
|
|
413
413
|
export const htmlAssetSchema = htmlassetHtmlAssetSchema;
|
|
414
414
|
|
|
415
415
|
/**
|
|
416
|
-
* The ImageAsset
|
|
416
|
+
* The ImageAsset adds an image to a Clip. The image can be sourced from a URL
|
|
417
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
418
|
+
* `prompt` must be provided.
|
|
419
|
+
*
|
|
420
|
+
* - **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.
|
|
421
|
+
* - **Generated:** set `prompt` to describe the image; the engine generates it
|
|
422
|
+
* using the provider chosen by `model` and fills `src` in automatically.
|
|
423
|
+
*
|
|
417
424
|
*/
|
|
418
425
|
export const imageassetImageAssetSchema = z.object({
|
|
419
426
|
type: z.enum(['image']),
|
|
420
|
-
src: z.string().min(1).regex(/\S/),
|
|
427
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
428
|
+
prompt: z.optional(z.string().max(4000)),
|
|
429
|
+
model: z.optional(z.string()),
|
|
421
430
|
crop: z.optional(cropCropSchema)
|
|
422
|
-
}).strict()
|
|
431
|
+
}).strict().superRefine((data, ctx) => {
|
|
432
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
433
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
434
|
+
if (!hasSrc && !hasPrompt) {
|
|
435
|
+
ctx.addIssue({
|
|
436
|
+
code: z.ZodIssueCode.custom,
|
|
437
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
438
|
+
path: ["src"],
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
});
|
|
423
442
|
|
|
424
443
|
export const imageAssetSchema = imageassetImageAssetSchema;
|
|
425
444
|
|
|
426
445
|
/**
|
|
446
|
+
* **Notice: ImageToVideoAsset is deprecated. Use [VideoAsset](#tocs_videoasset)
|
|
447
|
+
* with `prompt` and `seed` instead.** This type continues to function and is
|
|
448
|
+
* internally rewritten to VideoAsset; no behaviour change for existing
|
|
449
|
+
* integrations.
|
|
450
|
+
*
|
|
427
451
|
* The ImageToVideoAsset lets you create a video from an image and a text prompt.
|
|
452
|
+
*
|
|
453
|
+
*
|
|
454
|
+
* @deprecated
|
|
428
455
|
*/
|
|
429
456
|
export const imagetovideoassetImageToVideoAssetSchema = z.object({
|
|
430
457
|
type: z.enum(['image-to-video']),
|
|
@@ -865,7 +892,8 @@ export const richtextpropertiesRichTextBackgroundSchema = z.object({
|
|
|
865
892
|
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
866
893
|
opacity: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
867
894
|
borderRadius: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
868
|
-
wrap: z.optional(z.boolean()).default(false)
|
|
895
|
+
wrap: z.optional(z.boolean()).default(false),
|
|
896
|
+
padding: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number().int().gte(0).lte(200)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
869
897
|
}).strict();
|
|
870
898
|
|
|
871
899
|
export const richTextBackgroundSchema = richtextpropertiesRichTextBackgroundSchema;
|
|
@@ -1453,7 +1481,14 @@ export const textassetTextAssetSchema = z.object({
|
|
|
1453
1481
|
export const textAssetSchema = textassetTextAssetSchema;
|
|
1454
1482
|
|
|
1455
1483
|
/**
|
|
1484
|
+
* **Notice: TextToImageAsset is deprecated. Use [ImageAsset](#tocs_imageasset)
|
|
1485
|
+
* with `prompt` instead.** This type continues to function and is internally
|
|
1486
|
+
* rewritten to ImageAsset; no behaviour change for existing integrations.
|
|
1487
|
+
*
|
|
1456
1488
|
* The TextToImageAsset lets you create a dynamic image from a text prompt.
|
|
1489
|
+
*
|
|
1490
|
+
*
|
|
1491
|
+
* @deprecated
|
|
1457
1492
|
*/
|
|
1458
1493
|
export const texttoimageassetTextToImageAssetSchema = z.object({
|
|
1459
1494
|
type: z.enum(['text-to-image']),
|
|
@@ -1732,11 +1767,26 @@ export const tweenTweenSchema = z.object({
|
|
|
1732
1767
|
export const tweenSchema = tweenTweenSchema;
|
|
1733
1768
|
|
|
1734
1769
|
/**
|
|
1735
|
-
* The AudioAsset
|
|
1770
|
+
* The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
|
|
1771
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
1772
|
+
* `prompt` must be provided.
|
|
1773
|
+
*
|
|
1774
|
+
* - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
|
|
1775
|
+
* - **Generated speech:** set `prompt` to the spoken text and `voice` to a voice
|
|
1776
|
+
* identifier (text-to-speech). Optionally set `language`/`newscaster`.
|
|
1777
|
+
* - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.
|
|
1778
|
+
* - Use `model` to choose the generator. The generated `src` is filled in
|
|
1779
|
+
* automatically.
|
|
1780
|
+
*
|
|
1736
1781
|
*/
|
|
1737
1782
|
export const audioassetAudioAssetSchema = z.object({
|
|
1738
1783
|
type: z.enum(['audio']),
|
|
1739
|
-
src: z.string().min(1).regex(/\S/),
|
|
1784
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
1785
|
+
prompt: z.optional(z.string().max(4000)),
|
|
1786
|
+
voice: z.optional(z.string()),
|
|
1787
|
+
language: z.optional(z.string()),
|
|
1788
|
+
newscaster: z.optional(z.boolean()).default(false),
|
|
1789
|
+
model: z.optional(z.string()),
|
|
1740
1790
|
trim: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1741
1791
|
volume: z.optional(z.union([
|
|
1742
1792
|
z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
@@ -1749,7 +1799,17 @@ export const audioassetAudioAssetSchema = z.object({
|
|
|
1749
1799
|
'fadeOut',
|
|
1750
1800
|
'fadeInFadeOut'
|
|
1751
1801
|
]))
|
|
1752
|
-
}).strict()
|
|
1802
|
+
}).strict().superRefine((data, ctx) => {
|
|
1803
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
1804
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
1805
|
+
if (!hasSrc && !hasPrompt) {
|
|
1806
|
+
ctx.addIssue({
|
|
1807
|
+
code: z.ZodIssueCode.custom,
|
|
1808
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
1809
|
+
path: ["src"],
|
|
1810
|
+
});
|
|
1811
|
+
}
|
|
1812
|
+
});
|
|
1753
1813
|
|
|
1754
1814
|
export const audioAssetSchema = audioassetAudioAssetSchema;
|
|
1755
1815
|
|
|
@@ -1798,7 +1858,17 @@ export const skewtransformationSkewTransformationSchema = z.object({
|
|
|
1798
1858
|
export const skewTransformationSchema = skewtransformationSkewTransformationSchema;
|
|
1799
1859
|
|
|
1800
1860
|
/**
|
|
1801
|
-
*
|
|
1861
|
+
* **Notice: TextToSpeechAsset is deprecated. Use [AudioAsset](#tocs_audioasset)
|
|
1862
|
+
* with `prompt` (the spoken text) and `voice` instead.** This type continues to
|
|
1863
|
+
* function and is internally rewritten to AudioAsset; no behaviour change for
|
|
1864
|
+
* existing integrations.
|
|
1865
|
+
*
|
|
1866
|
+
* The TextToSpeechAsset lets you generate a voice over from text using a text-to-speech service.
|
|
1867
|
+
* The generated audio can be trimmed, faded and have its volume and speed adjusted using the
|
|
1868
|
+
* same properties available on the AudioAsset.
|
|
1869
|
+
*
|
|
1870
|
+
*
|
|
1871
|
+
* @deprecated
|
|
1802
1872
|
*/
|
|
1803
1873
|
export const texttospeechassetTextToSpeechAssetSchema = z.object({
|
|
1804
1874
|
type: z.enum(['text-to-speech']),
|
|
@@ -1884,11 +1954,23 @@ export const transformationTransformationSchema = z.object({
|
|
|
1884
1954
|
export const transformationSchema = transformationTransformationSchema;
|
|
1885
1955
|
|
|
1886
1956
|
/**
|
|
1887
|
-
* The VideoAsset
|
|
1957
|
+
* The VideoAsset adds a video to a Clip. The video can be sourced from a URL
|
|
1958
|
+
* (`src`) or generated from a text prompt (`prompt`), optionally seeded from a
|
|
1959
|
+
* starting image (`seed`). Exactly one of `src` or `prompt` must be provided.
|
|
1960
|
+
*
|
|
1961
|
+
* - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
|
|
1962
|
+
* - **Generated:** set `prompt` to describe the motion. Optionally set `seed` to
|
|
1963
|
+
* a starting image URL (image-to-video). Use `model` to choose the generator
|
|
1964
|
+
* (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in
|
|
1965
|
+
* automatically.
|
|
1966
|
+
*
|
|
1888
1967
|
*/
|
|
1889
1968
|
export const videoassetVideoAssetSchema = z.object({
|
|
1890
1969
|
type: z.enum(['video']),
|
|
1891
|
-
src: z.string().min(1).regex(/\S/),
|
|
1970
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
1971
|
+
prompt: z.optional(z.string().max(4000)),
|
|
1972
|
+
seed: z.optional(z.string().min(1)),
|
|
1973
|
+
model: z.optional(z.string()),
|
|
1892
1974
|
transcode: z.optional(z.boolean()),
|
|
1893
1975
|
trim: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1894
1976
|
volume: z.optional(z.union([
|
|
@@ -1904,7 +1986,17 @@ export const videoassetVideoAssetSchema = z.object({
|
|
|
1904
1986
|
speed: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number().gte(0).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1905
1987
|
crop: z.optional(cropCropSchema),
|
|
1906
1988
|
chromaKey: z.optional(chromakeyChromaKeySchema)
|
|
1907
|
-
}).strict()
|
|
1989
|
+
}).strict().superRefine((data, ctx) => {
|
|
1990
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
1991
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
1992
|
+
if (!hasSrc && !hasPrompt) {
|
|
1993
|
+
ctx.addIssue({
|
|
1994
|
+
code: z.ZodIssueCode.custom,
|
|
1995
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
1996
|
+
path: ["src"],
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
});
|
|
1908
2000
|
|
|
1909
2001
|
export const videoAssetSchema = videoassetVideoAssetSchema;
|
|
1910
2002
|
|