@shotstack/schemas 1.15.1 → 1.17.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 +217 -122
- package/dist/json-schema/edit.json +62 -134
- package/dist/json-schema/index.cjs +1 -1
- package/dist/json-schema/index.js +1 -1
- package/dist/schema.d.ts +222 -88
- package/dist/zod/zod.gen.cjs +80 -79
- package/dist/zod/zod.gen.d.ts +837 -2032
- package/dist/zod/zod.gen.js +74 -73
- package/dist/zod/zod.gen.ts +81 -67
- package/package.json +1 -1
package/dist/zod/zod.gen.js
CHANGED
|
@@ -5,6 +5,8 @@ export const sourceRootSchema = z.unknown();
|
|
|
5
5
|
export const assetsRootSchema = z.unknown();
|
|
6
6
|
export const assetsidRootSchema = z.unknown();
|
|
7
7
|
export const assetsrenderidRootSchema = z.unknown();
|
|
8
|
+
export const generateRootSchema = z.unknown();
|
|
9
|
+
export const generateidRootSchema = z.unknown();
|
|
8
10
|
export const probeRootSchema = z.unknown();
|
|
9
11
|
export const renderRootSchema = z.unknown();
|
|
10
12
|
export const renderidRootSchema = z.unknown();
|
|
@@ -466,12 +468,16 @@ export const htmlassetHtmlAssetSchema = z.object({
|
|
|
466
468
|
export const htmlAssetSchema = htmlassetHtmlAssetSchema;
|
|
467
469
|
/**
|
|
468
470
|
* The ImageAsset adds an image to a Clip. The image can be sourced from a URL
|
|
469
|
-
* (`src`)
|
|
470
|
-
* `prompt` must be provided.
|
|
471
|
+
* (`src`), generated from a text prompt (`prompt`), or both. At least one of
|
|
472
|
+
* `src` or `prompt` must be provided.
|
|
471
473
|
*
|
|
472
474
|
* - **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.
|
|
473
|
-
* - **Generated:** set `prompt` to describe the image
|
|
474
|
-
*
|
|
475
|
+
* - **Generated:** set `prompt` to describe the image. Choose a generator with
|
|
476
|
+
* `model` and configure it with model-specific `options`; the engine fills
|
|
477
|
+
* `src` in automatically.
|
|
478
|
+
* - **Both:** `src` acts as a preview placeholder while `prompt` drives
|
|
479
|
+
* generation — the image is regenerated from the prompt at render time.
|
|
480
|
+
* Unchanged prompts and options resolve from the generation cache.
|
|
475
481
|
*
|
|
476
482
|
*/
|
|
477
483
|
export const imageassetImageAssetSchema = z.object({
|
|
@@ -479,20 +485,7 @@ export const imageassetImageAssetSchema = z.object({
|
|
|
479
485
|
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
480
486
|
prompt: z.optional(z.string().max(4000)),
|
|
481
487
|
model: z.optional(z.string()),
|
|
482
|
-
|
|
483
|
-
'1K',
|
|
484
|
-
'2K',
|
|
485
|
-
'4K'
|
|
486
|
-
])),
|
|
487
|
-
aspectRatio: z.optional(z.enum([
|
|
488
|
-
'1:1',
|
|
489
|
-
'16:9',
|
|
490
|
-
'9:16',
|
|
491
|
-
'4:3',
|
|
492
|
-
'3:4',
|
|
493
|
-
'21:9',
|
|
494
|
-
'9:21'
|
|
495
|
-
])),
|
|
488
|
+
options: z.optional(z.record(z.string(), z.unknown())),
|
|
496
489
|
crop: z.optional(cropCropSchema)
|
|
497
490
|
}).strict().superRefine((data, ctx) => {
|
|
498
491
|
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
@@ -758,6 +751,20 @@ export const assetresponseAssetResponseSchema = z.object({
|
|
|
758
751
|
data: assetresponsedataAssetResponseDataSchema
|
|
759
752
|
}).strict();
|
|
760
753
|
export const assetResponseSchema = assetresponseAssetResponseSchema;
|
|
754
|
+
/**
|
|
755
|
+
* The status of an on-demand asset generation job. Completed jobs include the public URL of the generated asset.
|
|
756
|
+
*/
|
|
757
|
+
export const generationresponseGenerationResponseSchema = z.object({
|
|
758
|
+
id: z.string(),
|
|
759
|
+
status: z.enum([
|
|
760
|
+
'queued',
|
|
761
|
+
'processing',
|
|
762
|
+
'done',
|
|
763
|
+
'failed'
|
|
764
|
+
]),
|
|
765
|
+
url: z.optional(z.string()),
|
|
766
|
+
error: z.optional(z.string())
|
|
767
|
+
}).strict();
|
|
761
768
|
/**
|
|
762
769
|
* The response received after a [probe request](#inspect-media) is submitted. The probe requests returns data from FFprobe formatted as JSON.
|
|
763
770
|
*/
|
|
@@ -892,6 +899,7 @@ export const richcaptionpropertiesRichCaptionFontSchema = z.object({
|
|
|
892
899
|
return Number(v);
|
|
893
900
|
} return v; }), z.number().int().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),
|
|
894
901
|
weight: z.optional(z.unknown()).default('400'),
|
|
902
|
+
style: z.optional(z.enum(['normal', 'italic'])),
|
|
895
903
|
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default('#ffffff'),
|
|
896
904
|
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
897
905
|
return undefined; if (Array.isArray(v))
|
|
@@ -1212,6 +1220,7 @@ export const richtextpropertiesRichTextFontSchema = z.object({
|
|
|
1212
1220
|
return Number(v);
|
|
1213
1221
|
} return v; }), z.number().int().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),
|
|
1214
1222
|
weight: z.optional(z.unknown()).default('400'),
|
|
1223
|
+
style: z.optional(z.enum(['normal', 'italic'])),
|
|
1215
1224
|
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default('#000000'),
|
|
1216
1225
|
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
1217
1226
|
return undefined; if (Array.isArray(v))
|
|
@@ -2185,34 +2194,27 @@ export const tweenTweenSchema = z.object({
|
|
|
2185
2194
|
export const tweenSchema = tweenTweenSchema;
|
|
2186
2195
|
/**
|
|
2187
2196
|
* The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
|
|
2188
|
-
* (`src`)
|
|
2189
|
-
* `prompt` must be provided.
|
|
2197
|
+
* (`src`), generated from a text prompt (`prompt`), or both. At least one of
|
|
2198
|
+
* `src` or `prompt` must be provided.
|
|
2190
2199
|
*
|
|
2191
2200
|
* - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
|
|
2192
|
-
* - **Generated speech:** set `prompt` to the spoken text and
|
|
2193
|
-
*
|
|
2194
|
-
* - **Generated music or SFX:** set `prompt` describing the sound
|
|
2195
|
-
*
|
|
2196
|
-
*
|
|
2201
|
+
* - **Generated speech:** set `prompt` to the spoken text and choose a
|
|
2202
|
+
* text-to-speech `model`; set the voice via `options`.
|
|
2203
|
+
* - **Generated music or SFX:** set `prompt` describing the sound and choose
|
|
2204
|
+
* a music generation `model`.
|
|
2205
|
+
* - **Both:** `src` acts as a preview placeholder while `prompt` drives
|
|
2206
|
+
* generation — the audio is regenerated from the prompt at render time.
|
|
2207
|
+
* Unchanged prompts and options resolve from the generation cache.
|
|
2208
|
+
* - Use `model` to choose the generator and `options` to configure it. The
|
|
2209
|
+
* generated `src` is filled in automatically.
|
|
2197
2210
|
*
|
|
2198
2211
|
*/
|
|
2199
2212
|
export const audioassetAudioAssetSchema = z.object({
|
|
2200
2213
|
type: z.enum(['audio']),
|
|
2201
2214
|
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
2202
2215
|
prompt: z.optional(z.string().max(4000)),
|
|
2203
|
-
voice: z.optional(z.string()),
|
|
2204
|
-
language: z.optional(z.string()),
|
|
2205
|
-
newscaster: z.optional(z.boolean()).default(false),
|
|
2206
2216
|
model: z.optional(z.string()),
|
|
2207
|
-
|
|
2208
|
-
return undefined; if (Array.isArray(v))
|
|
2209
|
-
return v; if (typeof v === 'string') {
|
|
2210
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2211
|
-
return v;
|
|
2212
|
-
return Number(v);
|
|
2213
|
-
} return v; }), z.number().gte(3000).lte(600000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2214
|
-
forceInstrumental: z.optional(z.boolean()).default(false),
|
|
2215
|
-
compositionPlan: z.optional(z.string().max(4000)),
|
|
2217
|
+
options: z.optional(z.record(z.string(), z.unknown())),
|
|
2216
2218
|
trim: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2217
2219
|
return undefined; if (Array.isArray(v))
|
|
2218
2220
|
return v; if (typeof v === 'string') {
|
|
@@ -2433,52 +2435,25 @@ export const transformationTransformationSchema = z.object({
|
|
|
2433
2435
|
export const transformationSchema = transformationTransformationSchema;
|
|
2434
2436
|
/**
|
|
2435
2437
|
* The VideoAsset adds a video to a Clip. The video can be sourced from a URL
|
|
2436
|
-
* (`src`)
|
|
2437
|
-
*
|
|
2438
|
+
* (`src`), generated from a text prompt (`prompt`), or both. At least one of
|
|
2439
|
+
* `src` or `prompt` must be provided.
|
|
2438
2440
|
*
|
|
2439
2441
|
* - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
|
|
2440
|
-
* - **Generated:** set `prompt` to describe the motion.
|
|
2441
|
-
*
|
|
2442
|
-
*
|
|
2442
|
+
* - **Generated:** set `prompt` to describe the motion. Choose a generator
|
|
2443
|
+
* with `model` and configure it with model-specific `options` (including a
|
|
2444
|
+
* starting image for image-to-video). The generated `src` is filled in
|
|
2443
2445
|
* automatically.
|
|
2446
|
+
* - **Both:** `src` acts as a preview placeholder while `prompt` drives
|
|
2447
|
+
* generation — the video is regenerated from the prompt at render time.
|
|
2448
|
+
* Unchanged prompts and options resolve from the generation cache.
|
|
2444
2449
|
*
|
|
2445
2450
|
*/
|
|
2446
2451
|
export const videoassetVideoAssetSchema = z.object({
|
|
2447
2452
|
type: z.enum(['video']),
|
|
2448
2453
|
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
2449
2454
|
prompt: z.optional(z.string().max(4000)),
|
|
2450
|
-
inputSrc: z.optional(z.string().min(1)),
|
|
2451
2455
|
model: z.optional(z.string()),
|
|
2452
|
-
|
|
2453
|
-
'480p',
|
|
2454
|
-
'720p',
|
|
2455
|
-
'1080p'
|
|
2456
|
-
])),
|
|
2457
|
-
duration: z.optional(z.enum([
|
|
2458
|
-
'auto',
|
|
2459
|
-
'4',
|
|
2460
|
-
'5',
|
|
2461
|
-
'6',
|
|
2462
|
-
'7',
|
|
2463
|
-
'8',
|
|
2464
|
-
'9',
|
|
2465
|
-
'10',
|
|
2466
|
-
'11',
|
|
2467
|
-
'12',
|
|
2468
|
-
'13',
|
|
2469
|
-
'14',
|
|
2470
|
-
'15'
|
|
2471
|
-
])),
|
|
2472
|
-
aspectRatio: z.optional(z.enum([
|
|
2473
|
-
'1:1',
|
|
2474
|
-
'16:9',
|
|
2475
|
-
'9:16',
|
|
2476
|
-
'4:3',
|
|
2477
|
-
'3:4',
|
|
2478
|
-
'21:9',
|
|
2479
|
-
'9:21'
|
|
2480
|
-
])),
|
|
2481
|
-
generateAudio: z.optional(z.boolean()).default(false),
|
|
2456
|
+
options: z.optional(z.record(z.string(), z.unknown())),
|
|
2482
2457
|
transcode: z.optional(z.boolean()),
|
|
2483
2458
|
trim: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2484
2459
|
return undefined; if (Array.isArray(v))
|
|
@@ -2881,6 +2856,32 @@ export const probeRequest = z.object({
|
|
|
2881
2856
|
* FFprobe response formatted as JSON.
|
|
2882
2857
|
*/
|
|
2883
2858
|
export const probeResponse = proberesponseProbeResponseSchema;
|
|
2859
|
+
export const postGenerateRequest = z.object({
|
|
2860
|
+
body: z.optional(z.object({
|
|
2861
|
+
asset: z.union([
|
|
2862
|
+
imageassetImageAssetSchema,
|
|
2863
|
+
videoassetVideoAssetSchema,
|
|
2864
|
+
audioassetAudioAssetSchema
|
|
2865
|
+
])
|
|
2866
|
+
})),
|
|
2867
|
+
path: z.optional(z.never()),
|
|
2868
|
+
query: z.optional(z.never())
|
|
2869
|
+
}).strict();
|
|
2870
|
+
/**
|
|
2871
|
+
* The generated asset was already cached and is immediately available.
|
|
2872
|
+
*/
|
|
2873
|
+
export const postGenerateResponse = generationresponseGenerationResponseSchema;
|
|
2874
|
+
export const getGenerateRequest = z.object({
|
|
2875
|
+
body: z.optional(z.never()),
|
|
2876
|
+
path: z.object({
|
|
2877
|
+
id: z.string()
|
|
2878
|
+
}),
|
|
2879
|
+
query: z.optional(z.never())
|
|
2880
|
+
}).strict();
|
|
2881
|
+
/**
|
|
2882
|
+
* The generation job has finished (done or failed).
|
|
2883
|
+
*/
|
|
2884
|
+
export const getGenerateResponse = generationresponseGenerationResponseSchema;
|
|
2884
2885
|
export const deleteAssetRequest = z.object({
|
|
2885
2886
|
body: z.optional(z.never()),
|
|
2886
2887
|
path: z.object({
|
package/dist/zod/zod.gen.ts
CHANGED
|
@@ -12,6 +12,10 @@ export const assetsidRootSchema = z.unknown();
|
|
|
12
12
|
|
|
13
13
|
export const assetsrenderidRootSchema = z.unknown();
|
|
14
14
|
|
|
15
|
+
export const generateRootSchema = z.unknown();
|
|
16
|
+
|
|
17
|
+
export const generateidRootSchema = z.unknown();
|
|
18
|
+
|
|
15
19
|
export const probeRootSchema = z.unknown();
|
|
16
20
|
|
|
17
21
|
export const renderRootSchema = z.unknown();
|
|
@@ -414,12 +418,16 @@ export const htmlAssetSchema = htmlassetHtmlAssetSchema;
|
|
|
414
418
|
|
|
415
419
|
/**
|
|
416
420
|
* The ImageAsset adds an image to a Clip. The image can be sourced from a URL
|
|
417
|
-
* (`src`)
|
|
418
|
-
* `prompt` must be provided.
|
|
421
|
+
* (`src`), generated from a text prompt (`prompt`), or both. At least one of
|
|
422
|
+
* `src` or `prompt` must be provided.
|
|
419
423
|
*
|
|
420
424
|
* - **Source URL:** set `src` to the publicly accessible URL of a jpg or png file.
|
|
421
|
-
* - **Generated:** set `prompt` to describe the image
|
|
422
|
-
*
|
|
425
|
+
* - **Generated:** set `prompt` to describe the image. Choose a generator with
|
|
426
|
+
* `model` and configure it with model-specific `options`; the engine fills
|
|
427
|
+
* `src` in automatically.
|
|
428
|
+
* - **Both:** `src` acts as a preview placeholder while `prompt` drives
|
|
429
|
+
* generation — the image is regenerated from the prompt at render time.
|
|
430
|
+
* Unchanged prompts and options resolve from the generation cache.
|
|
423
431
|
*
|
|
424
432
|
*/
|
|
425
433
|
export const imageassetImageAssetSchema = z.object({
|
|
@@ -427,20 +435,7 @@ export const imageassetImageAssetSchema = z.object({
|
|
|
427
435
|
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
428
436
|
prompt: z.optional(z.string().max(4000)),
|
|
429
437
|
model: z.optional(z.string()),
|
|
430
|
-
|
|
431
|
-
'1K',
|
|
432
|
-
'2K',
|
|
433
|
-
'4K'
|
|
434
|
-
])),
|
|
435
|
-
aspectRatio: z.optional(z.enum([
|
|
436
|
-
'1:1',
|
|
437
|
-
'16:9',
|
|
438
|
-
'9:16',
|
|
439
|
-
'4:3',
|
|
440
|
-
'3:4',
|
|
441
|
-
'21:9',
|
|
442
|
-
'9:21'
|
|
443
|
-
])),
|
|
438
|
+
options: z.optional(z.record(z.string(), z.unknown())),
|
|
444
439
|
crop: z.optional(cropCropSchema)
|
|
445
440
|
}).strict().superRefine((data, ctx) => {
|
|
446
441
|
var hasSrc = typeof data.src === "string" && data.src.trim().length > 0;
|
|
@@ -716,6 +711,21 @@ export const assetresponseAssetResponseSchema = z.object({
|
|
|
716
711
|
|
|
717
712
|
export const assetResponseSchema = assetresponseAssetResponseSchema;
|
|
718
713
|
|
|
714
|
+
/**
|
|
715
|
+
* The status of an on-demand asset generation job. Completed jobs include the public URL of the generated asset.
|
|
716
|
+
*/
|
|
717
|
+
export const generationresponseGenerationResponseSchema = z.object({
|
|
718
|
+
id: z.string(),
|
|
719
|
+
status: z.enum([
|
|
720
|
+
'queued',
|
|
721
|
+
'processing',
|
|
722
|
+
'done',
|
|
723
|
+
'failed'
|
|
724
|
+
]),
|
|
725
|
+
url: z.optional(z.string()),
|
|
726
|
+
error: z.optional(z.string())
|
|
727
|
+
}).strict();
|
|
728
|
+
|
|
719
729
|
/**
|
|
720
730
|
* The response received after a [probe request](#inspect-media) is submitted. The probe requests returns data from FFprobe formatted as JSON.
|
|
721
731
|
*/
|
|
@@ -852,6 +862,7 @@ export const richcaptionpropertiesRichCaptionFontSchema = z.object({
|
|
|
852
862
|
family: z.optional(z.string()).default('Roboto'),
|
|
853
863
|
size: 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(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),
|
|
854
864
|
weight: z.optional(z.unknown()).default('400'),
|
|
865
|
+
style: z.optional(z.enum(['normal', 'italic'])),
|
|
855
866
|
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default('#ffffff'),
|
|
856
867
|
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),
|
|
857
868
|
background: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
@@ -1042,6 +1053,7 @@ export const richtextpropertiesRichTextFontSchema = z.object({
|
|
|
1042
1053
|
family: z.optional(z.string()).default('Open Sans'),
|
|
1043
1054
|
size: 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(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),
|
|
1044
1055
|
weight: z.optional(z.unknown()).default('400'),
|
|
1056
|
+
style: z.optional(z.enum(['normal', 'italic'])),
|
|
1045
1057
|
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default('#000000'),
|
|
1046
1058
|
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),
|
|
1047
1059
|
background: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
@@ -1801,28 +1813,27 @@ export const tweenSchema = tweenTweenSchema;
|
|
|
1801
1813
|
|
|
1802
1814
|
/**
|
|
1803
1815
|
* The AudioAsset adds audio to a Clip. The audio can be sourced from a URL
|
|
1804
|
-
* (`src`)
|
|
1805
|
-
* `prompt` must be provided.
|
|
1816
|
+
* (`src`), generated from a text prompt (`prompt`), or both. At least one of
|
|
1817
|
+
* `src` or `prompt` must be provided.
|
|
1806
1818
|
*
|
|
1807
1819
|
* - **Source URL:** set `src` to a publicly accessible audio URL (e.g. mp3).
|
|
1808
|
-
* - **Generated speech:** set `prompt` to the spoken text and
|
|
1809
|
-
*
|
|
1810
|
-
* - **Generated music or SFX:** set `prompt` describing the sound
|
|
1811
|
-
*
|
|
1812
|
-
*
|
|
1820
|
+
* - **Generated speech:** set `prompt` to the spoken text and choose a
|
|
1821
|
+
* text-to-speech `model`; set the voice via `options`.
|
|
1822
|
+
* - **Generated music or SFX:** set `prompt` describing the sound and choose
|
|
1823
|
+
* a music generation `model`.
|
|
1824
|
+
* - **Both:** `src` acts as a preview placeholder while `prompt` drives
|
|
1825
|
+
* generation — the audio is regenerated from the prompt at render time.
|
|
1826
|
+
* Unchanged prompts and options resolve from the generation cache.
|
|
1827
|
+
* - Use `model` to choose the generator and `options` to configure it. The
|
|
1828
|
+
* generated `src` is filled in automatically.
|
|
1813
1829
|
*
|
|
1814
1830
|
*/
|
|
1815
1831
|
export const audioassetAudioAssetSchema = z.object({
|
|
1816
1832
|
type: z.enum(['audio']),
|
|
1817
1833
|
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
1818
1834
|
prompt: z.optional(z.string().max(4000)),
|
|
1819
|
-
voice: z.optional(z.string()),
|
|
1820
|
-
language: z.optional(z.string()),
|
|
1821
|
-
newscaster: z.optional(z.boolean()).default(false),
|
|
1822
1835
|
model: z.optional(z.string()),
|
|
1823
|
-
|
|
1824
|
-
forceInstrumental: z.optional(z.boolean()).default(false),
|
|
1825
|
-
compositionPlan: z.optional(z.string().max(4000)),
|
|
1836
|
+
options: z.optional(z.record(z.string(), z.unknown())),
|
|
1826
1837
|
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*\}\}$/)])),
|
|
1827
1838
|
volume: z.optional(z.union([
|
|
1828
1839
|
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*\}\}$/)]),
|
|
@@ -1991,52 +2002,25 @@ export const transformationSchema = transformationTransformationSchema;
|
|
|
1991
2002
|
|
|
1992
2003
|
/**
|
|
1993
2004
|
* The VideoAsset adds a video to a Clip. The video can be sourced from a URL
|
|
1994
|
-
* (`src`)
|
|
1995
|
-
*
|
|
2005
|
+
* (`src`), generated from a text prompt (`prompt`), or both. At least one of
|
|
2006
|
+
* `src` or `prompt` must be provided.
|
|
1996
2007
|
*
|
|
1997
2008
|
* - **Source URL:** set `src` to the URL of an mp4 (or compatible) video file.
|
|
1998
|
-
* - **Generated:** set `prompt` to describe the motion.
|
|
1999
|
-
*
|
|
2000
|
-
*
|
|
2009
|
+
* - **Generated:** set `prompt` to describe the motion. Choose a generator
|
|
2010
|
+
* with `model` and configure it with model-specific `options` (including a
|
|
2011
|
+
* starting image for image-to-video). The generated `src` is filled in
|
|
2001
2012
|
* automatically.
|
|
2013
|
+
* - **Both:** `src` acts as a preview placeholder while `prompt` drives
|
|
2014
|
+
* generation — the video is regenerated from the prompt at render time.
|
|
2015
|
+
* Unchanged prompts and options resolve from the generation cache.
|
|
2002
2016
|
*
|
|
2003
2017
|
*/
|
|
2004
2018
|
export const videoassetVideoAssetSchema = z.object({
|
|
2005
2019
|
type: z.enum(['video']),
|
|
2006
2020
|
src: z.optional(z.string().min(1).regex(/\S/)),
|
|
2007
2021
|
prompt: z.optional(z.string().max(4000)),
|
|
2008
|
-
inputSrc: z.optional(z.string().min(1)),
|
|
2009
2022
|
model: z.optional(z.string()),
|
|
2010
|
-
|
|
2011
|
-
'480p',
|
|
2012
|
-
'720p',
|
|
2013
|
-
'1080p'
|
|
2014
|
-
])),
|
|
2015
|
-
duration: z.optional(z.enum([
|
|
2016
|
-
'auto',
|
|
2017
|
-
'4',
|
|
2018
|
-
'5',
|
|
2019
|
-
'6',
|
|
2020
|
-
'7',
|
|
2021
|
-
'8',
|
|
2022
|
-
'9',
|
|
2023
|
-
'10',
|
|
2024
|
-
'11',
|
|
2025
|
-
'12',
|
|
2026
|
-
'13',
|
|
2027
|
-
'14',
|
|
2028
|
-
'15'
|
|
2029
|
-
])),
|
|
2030
|
-
aspectRatio: z.optional(z.enum([
|
|
2031
|
-
'1:1',
|
|
2032
|
-
'16:9',
|
|
2033
|
-
'9:16',
|
|
2034
|
-
'4:3',
|
|
2035
|
-
'3:4',
|
|
2036
|
-
'21:9',
|
|
2037
|
-
'9:21'
|
|
2038
|
-
])),
|
|
2039
|
-
generateAudio: z.optional(z.boolean()).default(false),
|
|
2023
|
+
options: z.optional(z.record(z.string(), z.unknown())),
|
|
2040
2024
|
transcode: z.optional(z.boolean()),
|
|
2041
2025
|
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*\}\}$/)])),
|
|
2042
2026
|
volume: z.optional(z.union([
|
|
@@ -2414,6 +2398,36 @@ export const probeRequest = z.object({
|
|
|
2414
2398
|
*/
|
|
2415
2399
|
export const probeResponse = proberesponseProbeResponseSchema;
|
|
2416
2400
|
|
|
2401
|
+
export const postGenerateRequest = z.object({
|
|
2402
|
+
body: z.optional(z.object({
|
|
2403
|
+
asset: z.union([
|
|
2404
|
+
imageassetImageAssetSchema,
|
|
2405
|
+
videoassetVideoAssetSchema,
|
|
2406
|
+
audioassetAudioAssetSchema
|
|
2407
|
+
])
|
|
2408
|
+
})),
|
|
2409
|
+
path: z.optional(z.never()),
|
|
2410
|
+
query: z.optional(z.never())
|
|
2411
|
+
}).strict();
|
|
2412
|
+
|
|
2413
|
+
/**
|
|
2414
|
+
* The generated asset was already cached and is immediately available.
|
|
2415
|
+
*/
|
|
2416
|
+
export const postGenerateResponse = generationresponseGenerationResponseSchema;
|
|
2417
|
+
|
|
2418
|
+
export const getGenerateRequest = z.object({
|
|
2419
|
+
body: z.optional(z.never()),
|
|
2420
|
+
path: z.object({
|
|
2421
|
+
id: z.string()
|
|
2422
|
+
}),
|
|
2423
|
+
query: z.optional(z.never())
|
|
2424
|
+
}).strict();
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
* The generation job has finished (done or failed).
|
|
2428
|
+
*/
|
|
2429
|
+
export const getGenerateResponse = generationresponseGenerationResponseSchema;
|
|
2430
|
+
|
|
2417
2431
|
export const deleteAssetRequest = z.object({
|
|
2418
2432
|
body: z.optional(z.never()),
|
|
2419
2433
|
path: z.object({
|