@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/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']),
|
|
@@ -1812,7 +1839,14 @@ export const textassetTextAssetSchema = z.object({
|
|
|
1812
1839
|
});
|
|
1813
1840
|
export const textAssetSchema = textassetTextAssetSchema;
|
|
1814
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
|
+
*
|
|
1815
1846
|
* The TextToImageAsset lets you create a dynamic image from a text prompt.
|
|
1847
|
+
*
|
|
1848
|
+
*
|
|
1849
|
+
* @deprecated
|
|
1816
1850
|
*/
|
|
1817
1851
|
export const texttoimageassetTextToImageAssetSchema = z.object({
|
|
1818
1852
|
type: z.enum(['text-to-image']),
|
|
@@ -1855,7 +1889,7 @@ export const thumbnailThumbnailSchema = z.object({
|
|
|
1855
1889
|
}).strict();
|
|
1856
1890
|
export const thumbnailSchema = thumbnailThumbnailSchema;
|
|
1857
1891
|
/**
|
|
1858
|
-
* The output format, render range and type of media to generate.
|
|
1892
|
+
* 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.
|
|
1859
1893
|
*/
|
|
1860
1894
|
export const outputOutputSchema = z.object({
|
|
1861
1895
|
format: z.enum([
|
|
@@ -1916,7 +1950,18 @@ export const outputOutputSchema = z.object({
|
|
|
1916
1950
|
poster: z.optional(posterPosterSchema),
|
|
1917
1951
|
thumbnail: z.optional(thumbnailThumbnailSchema),
|
|
1918
1952
|
destinations: z.optional(z.array(destinationsDestinationsSchema))
|
|
1919
|
-
}).strict()
|
|
1953
|
+
}).strict().superRefine((val, ctx) => {
|
|
1954
|
+
var isMp3 = val.format === "mp3";
|
|
1955
|
+
if (!isMp3 && val.size != null && (val.size.width == null || val.size.height == null)) {
|
|
1956
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["size"], message: "size requires both width and height" });
|
|
1957
|
+
return;
|
|
1958
|
+
}
|
|
1959
|
+
var hasResolution = typeof val.resolution === "string";
|
|
1960
|
+
var hasSize = val.size != null && val.size.width != null && val.size.height != null;
|
|
1961
|
+
if (!isMp3 && !hasResolution && !hasSize) {
|
|
1962
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'output requires either "resolution" or "size" (with width and height)' });
|
|
1963
|
+
}
|
|
1964
|
+
});
|
|
1920
1965
|
export const outputSchema = outputOutputSchema;
|
|
1921
1966
|
/**
|
|
1922
1967
|
* In and out transitions for a clip - i.e. fade in and fade out
|
|
@@ -2117,11 +2162,26 @@ export const tweenTweenSchema = z.object({
|
|
|
2117
2162
|
}).strict();
|
|
2118
2163
|
export const tweenSchema = tweenTweenSchema;
|
|
2119
2164
|
/**
|
|
2120
|
-
* The AudioAsset
|
|
2165
|
+
* The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
|
|
2166
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
2167
|
+
* `prompt` must be provided.
|
|
2168
|
+
*
|
|
2169
|
+
* - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
|
|
2170
|
+
* - **Generated speech:** set `prompt` to the spoken text and `voice` to a voice
|
|
2171
|
+
* identifier (text-to-speech). Optionally set `language`/`newscaster`.
|
|
2172
|
+
* - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.
|
|
2173
|
+
* - Use `model` to choose the generator. The generated `src` is filled in
|
|
2174
|
+
* automatically.
|
|
2175
|
+
*
|
|
2121
2176
|
*/
|
|
2122
2177
|
export const audioassetAudioAssetSchema = z.object({
|
|
2123
2178
|
type: z.enum(['audio']),
|
|
2124
|
-
src: z.string().min(1).regex(/\S/),
|
|
2179
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
2180
|
+
prompt: z.optional(z.string().max(4000)),
|
|
2181
|
+
voice: z.optional(z.string()),
|
|
2182
|
+
language: z.optional(z.string()),
|
|
2183
|
+
newscaster: z.optional(z.boolean()).default(false),
|
|
2184
|
+
model: z.optional(z.string()),
|
|
2125
2185
|
trim: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2126
2186
|
return undefined; if (Array.isArray(v))
|
|
2127
2187
|
return v; if (typeof v === 'string') {
|
|
@@ -2152,7 +2212,17 @@ export const audioassetAudioAssetSchema = z.object({
|
|
|
2152
2212
|
'fadeOut',
|
|
2153
2213
|
'fadeInFadeOut'
|
|
2154
2214
|
]))
|
|
2155
|
-
}).strict()
|
|
2215
|
+
}).strict().superRefine((data, ctx) => {
|
|
2216
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
2217
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
2218
|
+
if (!hasSrc && !hasPrompt) {
|
|
2219
|
+
ctx.addIssue({
|
|
2220
|
+
code: z.ZodIssueCode.custom,
|
|
2221
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
2222
|
+
path: ["src"],
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
});
|
|
2156
2226
|
export const audioAssetSchema = audioassetAudioAssetSchema;
|
|
2157
2227
|
/**
|
|
2158
2228
|
* Offsets the position of an asset horizontally or vertically by a relative distance.
|
|
@@ -2223,7 +2293,17 @@ export const skewtransformationSkewTransformationSchema = z.object({
|
|
|
2223
2293
|
}).strict();
|
|
2224
2294
|
export const skewTransformationSchema = skewtransformationSkewTransformationSchema;
|
|
2225
2295
|
/**
|
|
2226
|
-
*
|
|
2296
|
+
* **Notice: TextToSpeechAsset is deprecated. Use [AudioAsset](#tocs_audioasset)
|
|
2297
|
+
* with `prompt` (the spoken text) and `voice` instead.** This type continues to
|
|
2298
|
+
* function and is internally rewritten to AudioAsset; no behaviour change for
|
|
2299
|
+
* existing integrations.
|
|
2300
|
+
*
|
|
2301
|
+
* The TextToSpeechAsset lets you generate a voice over from text using a text-to-speech service.
|
|
2302
|
+
* The generated audio can be trimmed, faded and have its volume and speed adjusted using the
|
|
2303
|
+
* same properties available on the AudioAsset.
|
|
2304
|
+
*
|
|
2305
|
+
*
|
|
2306
|
+
* @deprecated
|
|
2227
2307
|
*/
|
|
2228
2308
|
export const texttospeechassetTextToSpeechAssetSchema = z.object({
|
|
2229
2309
|
type: z.enum(['text-to-speech']),
|
|
@@ -2321,11 +2401,23 @@ export const transformationTransformationSchema = z.object({
|
|
|
2321
2401
|
}).strict();
|
|
2322
2402
|
export const transformationSchema = transformationTransformationSchema;
|
|
2323
2403
|
/**
|
|
2324
|
-
* The VideoAsset
|
|
2404
|
+
* The VideoAsset adds a video to a Clip. The video can be sourced from a URL
|
|
2405
|
+
* (`src`) or generated from a text prompt (`prompt`), optionally seeded from a
|
|
2406
|
+
* starting image (`seed`). Exactly one of `src` or `prompt` must be provided.
|
|
2407
|
+
*
|
|
2408
|
+
* - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
|
|
2409
|
+
* - **Generated:** set `prompt` to describe the motion. Optionally set `seed` to
|
|
2410
|
+
* a starting image URL (image-to-video). Use `model` to choose the generator
|
|
2411
|
+
* (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in
|
|
2412
|
+
* automatically.
|
|
2413
|
+
*
|
|
2325
2414
|
*/
|
|
2326
2415
|
export const videoassetVideoAssetSchema = z.object({
|
|
2327
2416
|
type: z.enum(['video']),
|
|
2328
|
-
src: z.string().min(1).regex(/\S/),
|
|
2417
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
2418
|
+
prompt: z.optional(z.string().max(4000)),
|
|
2419
|
+
seed: z.optional(z.string().min(1)),
|
|
2420
|
+
model: z.optional(z.string()),
|
|
2329
2421
|
transcode: z.optional(z.boolean()),
|
|
2330
2422
|
trim: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2331
2423
|
return undefined; if (Array.isArray(v))
|
|
@@ -2359,7 +2451,17 @@ export const videoassetVideoAssetSchema = z.object({
|
|
|
2359
2451
|
} return v; }), z.number().gte(0).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2360
2452
|
crop: z.optional(cropCropSchema),
|
|
2361
2453
|
chromaKey: z.optional(chromakeyChromaKeySchema)
|
|
2362
|
-
}).strict()
|
|
2454
|
+
}).strict().superRefine((data, ctx) => {
|
|
2455
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
2456
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
2457
|
+
if (!hasSrc && !hasPrompt) {
|
|
2458
|
+
ctx.addIssue({
|
|
2459
|
+
code: z.ZodIssueCode.custom,
|
|
2460
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
2461
|
+
path: ["src"],
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
});
|
|
2363
2465
|
export const videoAssetSchema = videoassetVideoAssetSchema;
|
|
2364
2466
|
/**
|
|
2365
2467
|
* 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']),
|
|
@@ -1454,7 +1481,14 @@ export const textassetTextAssetSchema = z.object({
|
|
|
1454
1481
|
export const textAssetSchema = textassetTextAssetSchema;
|
|
1455
1482
|
|
|
1456
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
|
+
*
|
|
1457
1488
|
* The TextToImageAsset lets you create a dynamic image from a text prompt.
|
|
1489
|
+
*
|
|
1490
|
+
*
|
|
1491
|
+
* @deprecated
|
|
1458
1492
|
*/
|
|
1459
1493
|
export const texttoimageassetTextToImageAssetSchema = z.object({
|
|
1460
1494
|
type: z.enum(['text-to-image']),
|
|
@@ -1477,7 +1511,7 @@ export const thumbnailThumbnailSchema = z.object({
|
|
|
1477
1511
|
export const thumbnailSchema = thumbnailThumbnailSchema;
|
|
1478
1512
|
|
|
1479
1513
|
/**
|
|
1480
|
-
* The output format, render range and type of media to generate.
|
|
1514
|
+
* 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.
|
|
1481
1515
|
*/
|
|
1482
1516
|
export const outputOutputSchema = z.object({
|
|
1483
1517
|
format: z.enum([
|
|
@@ -1538,7 +1572,18 @@ export const outputOutputSchema = z.object({
|
|
|
1538
1572
|
poster: z.optional(posterPosterSchema),
|
|
1539
1573
|
thumbnail: z.optional(thumbnailThumbnailSchema),
|
|
1540
1574
|
destinations: z.optional(z.array(destinationsDestinationsSchema))
|
|
1541
|
-
}).strict()
|
|
1575
|
+
}).strict().superRefine((val, ctx) => {
|
|
1576
|
+
var isMp3 = val.format === "mp3";
|
|
1577
|
+
if (!isMp3 && val.size != null && (val.size.width == null || val.size.height == null)) {
|
|
1578
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["size"], message: "size requires both width and height" });
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
var hasResolution = typeof val.resolution === "string";
|
|
1582
|
+
var hasSize = val.size != null && val.size.width != null && val.size.height != null;
|
|
1583
|
+
if (!isMp3 && !hasResolution && !hasSize) {
|
|
1584
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'output requires either "resolution" or "size" (with width and height)' });
|
|
1585
|
+
}
|
|
1586
|
+
});
|
|
1542
1587
|
|
|
1543
1588
|
export const outputSchema = outputOutputSchema;
|
|
1544
1589
|
|
|
@@ -1733,11 +1778,26 @@ export const tweenTweenSchema = z.object({
|
|
|
1733
1778
|
export const tweenSchema = tweenTweenSchema;
|
|
1734
1779
|
|
|
1735
1780
|
/**
|
|
1736
|
-
* The AudioAsset
|
|
1781
|
+
* The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
|
|
1782
|
+
* (`src`) or generated from a text prompt (`prompt`). Exactly one of `src` or
|
|
1783
|
+
* `prompt` must be provided.
|
|
1784
|
+
*
|
|
1785
|
+
* - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
|
|
1786
|
+
* - **Generated speech:** set `prompt` to the spoken text and `voice` to a voice
|
|
1787
|
+
* identifier (text-to-speech). Optionally set `language`/`newscaster`.
|
|
1788
|
+
* - **Generated music or SFX:** set `prompt` describing the sound; omit `voice`.
|
|
1789
|
+
* - Use `model` to choose the generator. The generated `src` is filled in
|
|
1790
|
+
* automatically.
|
|
1791
|
+
*
|
|
1737
1792
|
*/
|
|
1738
1793
|
export const audioassetAudioAssetSchema = z.object({
|
|
1739
1794
|
type: z.enum(['audio']),
|
|
1740
|
-
src: z.string().min(1).regex(/\S/),
|
|
1795
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
1796
|
+
prompt: z.optional(z.string().max(4000)),
|
|
1797
|
+
voice: z.optional(z.string()),
|
|
1798
|
+
language: z.optional(z.string()),
|
|
1799
|
+
newscaster: z.optional(z.boolean()).default(false),
|
|
1800
|
+
model: z.optional(z.string()),
|
|
1741
1801
|
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*\}\}$/)])),
|
|
1742
1802
|
volume: z.optional(z.union([
|
|
1743
1803
|
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*\}\}$/)]),
|
|
@@ -1750,7 +1810,17 @@ export const audioassetAudioAssetSchema = z.object({
|
|
|
1750
1810
|
'fadeOut',
|
|
1751
1811
|
'fadeInFadeOut'
|
|
1752
1812
|
]))
|
|
1753
|
-
}).strict()
|
|
1813
|
+
}).strict().superRefine((data, ctx) => {
|
|
1814
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
1815
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
1816
|
+
if (!hasSrc && !hasPrompt) {
|
|
1817
|
+
ctx.addIssue({
|
|
1818
|
+
code: z.ZodIssueCode.custom,
|
|
1819
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
1820
|
+
path: ["src"],
|
|
1821
|
+
});
|
|
1822
|
+
}
|
|
1823
|
+
});
|
|
1754
1824
|
|
|
1755
1825
|
export const audioAssetSchema = audioassetAudioAssetSchema;
|
|
1756
1826
|
|
|
@@ -1799,7 +1869,17 @@ export const skewtransformationSkewTransformationSchema = z.object({
|
|
|
1799
1869
|
export const skewTransformationSchema = skewtransformationSkewTransformationSchema;
|
|
1800
1870
|
|
|
1801
1871
|
/**
|
|
1802
|
-
*
|
|
1872
|
+
* **Notice: TextToSpeechAsset is deprecated. Use [AudioAsset](#tocs_audioasset)
|
|
1873
|
+
* with `prompt` (the spoken text) and `voice` instead.** This type continues to
|
|
1874
|
+
* function and is internally rewritten to AudioAsset; no behaviour change for
|
|
1875
|
+
* existing integrations.
|
|
1876
|
+
*
|
|
1877
|
+
* The TextToSpeechAsset lets you generate a voice over from text using a text-to-speech service.
|
|
1878
|
+
* The generated audio can be trimmed, faded and have its volume and speed adjusted using the
|
|
1879
|
+
* same properties available on the AudioAsset.
|
|
1880
|
+
*
|
|
1881
|
+
*
|
|
1882
|
+
* @deprecated
|
|
1803
1883
|
*/
|
|
1804
1884
|
export const texttospeechassetTextToSpeechAssetSchema = z.object({
|
|
1805
1885
|
type: z.enum(['text-to-speech']),
|
|
@@ -1885,11 +1965,23 @@ export const transformationTransformationSchema = z.object({
|
|
|
1885
1965
|
export const transformationSchema = transformationTransformationSchema;
|
|
1886
1966
|
|
|
1887
1967
|
/**
|
|
1888
|
-
* The VideoAsset
|
|
1968
|
+
* The VideoAsset adds a video to a Clip. The video can be sourced from a URL
|
|
1969
|
+
* (`src`) or generated from a text prompt (`prompt`), optionally seeded from a
|
|
1970
|
+
* starting image (`seed`). Exactly one of `src` or `prompt` must be provided.
|
|
1971
|
+
*
|
|
1972
|
+
* - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
|
|
1973
|
+
* - **Generated:** set `prompt` to describe the motion. Optionally set `seed` to
|
|
1974
|
+
* a starting image URL (image-to-video). Use `model` to choose the generator
|
|
1975
|
+
* (e.g. `luma-ray-3`, `runpod-itv-mini`). The generated `src` is filled in
|
|
1976
|
+
* automatically.
|
|
1977
|
+
*
|
|
1889
1978
|
*/
|
|
1890
1979
|
export const videoassetVideoAssetSchema = z.object({
|
|
1891
1980
|
type: z.enum(['video']),
|
|
1892
|
-
src: z.string().min(1).regex(/\S/),
|
|
1981
|
+
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
1982
|
+
prompt: z.optional(z.string().max(4000)),
|
|
1983
|
+
seed: z.optional(z.string().min(1)),
|
|
1984
|
+
model: z.optional(z.string()),
|
|
1893
1985
|
transcode: z.optional(z.boolean()),
|
|
1894
1986
|
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*\}\}$/)])),
|
|
1895
1987
|
volume: z.optional(z.union([
|
|
@@ -1905,7 +1997,17 @@ export const videoassetVideoAssetSchema = z.object({
|
|
|
1905
1997
|
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*\}\}$/)])),
|
|
1906
1998
|
crop: z.optional(cropCropSchema),
|
|
1907
1999
|
chromaKey: z.optional(chromakeyChromaKeySchema)
|
|
1908
|
-
}).strict()
|
|
2000
|
+
}).strict().superRefine((data, ctx) => {
|
|
2001
|
+
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
2002
|
+
var hasPrompt = typeof data.prompt === "string" && data.prompt.trim().length > 0;
|
|
2003
|
+
if (!hasSrc && !hasPrompt) {
|
|
2004
|
+
ctx.addIssue({
|
|
2005
|
+
code: z.ZodIssueCode.custom,
|
|
2006
|
+
message: "A media asset requires either \"src\" (a source URL) or \"prompt\" (to generate the asset). Provide one.",
|
|
2007
|
+
path: ["src"],
|
|
2008
|
+
});
|
|
2009
|
+
}
|
|
2010
|
+
});
|
|
1909
2011
|
|
|
1910
2012
|
export const videoAssetSchema = videoassetVideoAssetSchema;
|
|
1911
2013
|
|