@shotstack/schemas 1.9.6 → 1.9.8
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 +1492 -3430
- package/dist/json-schema/asset.json +1 -853
- package/dist/json-schema/clip.json +1 -853
- package/dist/json-schema/destinations.json +28 -12
- package/dist/json-schema/edit.json +31 -867
- package/dist/json-schema/output.json +28 -12
- package/dist/json-schema/schemas.json +38 -967
- package/dist/json-schema/svg-asset.json +6 -857
- package/dist/json-schema/timeline.json +2 -854
- package/dist/json-schema/track.json +2 -854
- package/dist/schema.d.ts +914 -2451
- package/dist/zod/zod.gen.cjs +97 -1285
- package/dist/zod/zod.gen.d.ts +613 -12248
- package/dist/zod/zod.gen.js +91 -1277
- package/dist/zod/zod.gen.ts +27 -992
- package/package.json +1 -1
- package/dist/json-schema/svg-arrow-shape.json +0 -49
- package/dist/json-schema/svg-circle-shape.json +0 -28
- package/dist/json-schema/svg-cross-shape.json +0 -42
- package/dist/json-schema/svg-ellipse-shape.json +0 -35
- package/dist/json-schema/svg-fill.json +0 -169
- package/dist/json-schema/svg-gradient-stop.json +0 -25
- package/dist/json-schema/svg-heart-shape.json +0 -28
- package/dist/json-schema/svg-line-shape.json +0 -35
- package/dist/json-schema/svg-linear-gradient-fill.json +0 -80
- package/dist/json-schema/svg-path-shape.json +0 -26
- package/dist/json-schema/svg-polygon-shape.json +0 -35
- package/dist/json-schema/svg-radial-gradient-fill.json +0 -66
- package/dist/json-schema/svg-rectangle-shape.json +0 -49
- package/dist/json-schema/svg-ring-shape.json +0 -35
- package/dist/json-schema/svg-shadow.json +0 -79
- package/dist/json-schema/svg-shape.json +0 -404
- package/dist/json-schema/svg-solid-fill.json +0 -40
- package/dist/json-schema/svg-star-shape.json +0 -42
- package/dist/json-schema/svg-stroke.json +0 -115
- package/dist/json-schema/svg-transform.json +0 -93
package/dist/zod/zod.gen.js
CHANGED
|
@@ -5,8 +5,6 @@ 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 generateassetRootSchema = z.unknown();
|
|
9
|
-
export const generateassetidRootSchema = z.unknown();
|
|
10
8
|
export const probeRootSchema = z.unknown();
|
|
11
9
|
export const renderRootSchema = z.unknown();
|
|
12
10
|
export const renderidRootSchema = z.unknown();
|
|
@@ -163,597 +161,6 @@ export const chromakeyChromaKeySchema = z.object({
|
|
|
163
161
|
} return v; }), z.number().int().gte(0).lte(250)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
164
162
|
}).strict();
|
|
165
163
|
export const chromaKeySchema = chromakeyChromaKeySchema;
|
|
166
|
-
/**
|
|
167
|
-
* Options for the D-ID text-to-avatar service. Set the text to be converted to an avatar and configure the avatar and background. The output will be generated as an MP4 video file.
|
|
168
|
-
*/
|
|
169
|
-
export const didTextToAvatarOptionsDidTextToAvatarOptionsSchema = z.object({
|
|
170
|
-
type: z.enum(['text-to-avatar']),
|
|
171
|
-
text: z.string(),
|
|
172
|
-
avatar: z.enum([
|
|
173
|
-
'jack',
|
|
174
|
-
'lana',
|
|
175
|
-
'lily',
|
|
176
|
-
'matt',
|
|
177
|
-
'rian'
|
|
178
|
-
]),
|
|
179
|
-
background: z.optional(z.string())
|
|
180
|
-
}).strict();
|
|
181
|
-
export const didTextToAvatarOptionsSchema = didTextToAvatarOptionsDidTextToAvatarOptionsSchema;
|
|
182
|
-
/**
|
|
183
|
-
* Generate assets using the third party D-ID provider AI services.
|
|
184
|
-
*
|
|
185
|
-
* The following AI generation services are available: <ul>
|
|
186
|
-
* <li><a href="#tocs_didtexttoavataroptions">DidTextToAvatarOptions</a></li>
|
|
187
|
-
* </ul>
|
|
188
|
-
*/
|
|
189
|
-
export const didGeneratedAssetOptionsDidGeneratedAssetOptionsSchema = z.object({
|
|
190
|
-
type: z.literal('didTextToAvatarOptions_DIDTextToAvatarOptions')
|
|
191
|
-
}).strict().and(didTextToAvatarOptionsDidTextToAvatarOptionsSchema);
|
|
192
|
-
export const didGeneratedAssetOptionsSchema = didGeneratedAssetOptionsDidGeneratedAssetOptionsSchema;
|
|
193
|
-
/**
|
|
194
|
-
* Generate assets using D-ID. D-ID provide a text-to-avatar service. The D-ID provider works on a bring-your-own-key basis, credentials are required and must be added via the [dashboard](https://dashboard.shotstack.io/integrations/d-id), not in the request.
|
|
195
|
-
*/
|
|
196
|
-
export const didGeneratedAssetDidGeneratedAssetSchema = z.object({
|
|
197
|
-
provider: z.enum(['d-id']),
|
|
198
|
-
options: didGeneratedAssetOptionsDidGeneratedAssetOptionsSchema
|
|
199
|
-
}).strict();
|
|
200
|
-
export const didGeneratedAssetSchema = didGeneratedAssetDidGeneratedAssetSchema;
|
|
201
|
-
/**
|
|
202
|
-
* Options for the ElevenLabs text-to-speech service. Set the text to be converted to speech and choose a voice to set the speaking style. The output will be generated as an MP3 audio file available at the URL returned in the response.
|
|
203
|
-
*/
|
|
204
|
-
export const elevenlabsTextToSpeechOptionsElevenLabsTextToSpeechOptionsSchema = z.object({
|
|
205
|
-
type: z.enum(['text-to-speech']),
|
|
206
|
-
text: z.string(),
|
|
207
|
-
voice: z.enum([
|
|
208
|
-
'Adam',
|
|
209
|
-
'Antoni',
|
|
210
|
-
'Arnold',
|
|
211
|
-
'Bella',
|
|
212
|
-
'Domi',
|
|
213
|
-
'Elli',
|
|
214
|
-
'Josh',
|
|
215
|
-
'Rachel',
|
|
216
|
-
'Sam'
|
|
217
|
-
])
|
|
218
|
-
}).strict();
|
|
219
|
-
export const elevenLabsTextToSpeechOptionsSchema = elevenlabsTextToSpeechOptionsElevenLabsTextToSpeechOptionsSchema;
|
|
220
|
-
/**
|
|
221
|
-
* Generate assets using the third party ElevenLabs provider AI services.
|
|
222
|
-
*
|
|
223
|
-
* The following AI generation services are available: <ul>
|
|
224
|
-
* <li><a href="#tocs_elevenlabstexttospeechoptions">ElevenLabsTextToSpeechOptions</a></li>
|
|
225
|
-
* </ul>
|
|
226
|
-
*/
|
|
227
|
-
export const elevenlabsGeneratedAssetOptionsElevenLabsGeneratedAssetOptionsSchema = z.object({
|
|
228
|
-
type: z.literal('elevenlabsTextToSpeechOptions_ElevenLabsTextToSpeechOptions')
|
|
229
|
-
}).strict().and(elevenlabsTextToSpeechOptionsElevenLabsTextToSpeechOptionsSchema);
|
|
230
|
-
export const elevenLabsGeneratedAssetOptionsSchema = elevenlabsGeneratedAssetOptionsElevenLabsGeneratedAssetOptionsSchema;
|
|
231
|
-
/**
|
|
232
|
-
* Generate assets using ElevenLabs. ElevenLabs provide a text-to-speech service. The ElevenLabs provider works on a bring-your-own-key basis, credentials are required and must be added via the [dashboard](https://dashboard.shotstack.io/integrations/elevenlabs), not in the request.
|
|
233
|
-
*/
|
|
234
|
-
export const elevenlabsGeneratedAssetElevenLabsGeneratedAssetSchema = z.object({
|
|
235
|
-
provider: z.enum(['elevenlabs']),
|
|
236
|
-
options: elevenlabsGeneratedAssetOptionsElevenLabsGeneratedAssetOptionsSchema
|
|
237
|
-
}).strict();
|
|
238
|
-
export const elevenLabsGeneratedAssetSchema = elevenlabsGeneratedAssetElevenLabsGeneratedAssetSchema;
|
|
239
|
-
/**
|
|
240
|
-
* Options for the HeyGen text-to-avatar service. Set the text to be converted to an avatar and configure the avatars voice, speaking style, appearance and background. The output will be generated as an MP4 video file available at the URL returned in the response.
|
|
241
|
-
*/
|
|
242
|
-
export const heygenTextToAvatarOptionsHeyGenTextToAvatarOptionsSchema = z.object({
|
|
243
|
-
type: z.enum(['text-to-avatar']),
|
|
244
|
-
text: z.string(),
|
|
245
|
-
avatar: z.enum([
|
|
246
|
-
'Angela',
|
|
247
|
-
'Bill',
|
|
248
|
-
'Daisy',
|
|
249
|
-
'Derek',
|
|
250
|
-
'Eva',
|
|
251
|
-
'Jake',
|
|
252
|
-
'Jeff',
|
|
253
|
-
'Jerome',
|
|
254
|
-
'Joon',
|
|
255
|
-
'Kayla',
|
|
256
|
-
'Kent',
|
|
257
|
-
'Luna',
|
|
258
|
-
'Mark',
|
|
259
|
-
'Matthew',
|
|
260
|
-
'Monica',
|
|
261
|
-
'Peter',
|
|
262
|
-
'Selina',
|
|
263
|
-
'Tanya',
|
|
264
|
-
'Thomas',
|
|
265
|
-
'Tina',
|
|
266
|
-
'Tyler',
|
|
267
|
-
'Vanessa',
|
|
268
|
-
'Vera',
|
|
269
|
-
'Wilson',
|
|
270
|
-
'Zoey'
|
|
271
|
-
]),
|
|
272
|
-
voice: z.enum([
|
|
273
|
-
'Abbi - Natural',
|
|
274
|
-
'Adam - Natural',
|
|
275
|
-
'Aiston - Friendly',
|
|
276
|
-
'Alice - Newscaster',
|
|
277
|
-
'Alison - Cheerful',
|
|
278
|
-
'Amber - Friendly',
|
|
279
|
-
'Amy - Warm',
|
|
280
|
-
'Ana - Cheerful',
|
|
281
|
-
'Antoni - Friendly',
|
|
282
|
-
'Aria - Newscaster',
|
|
283
|
-
'Arnold - Cheerful',
|
|
284
|
-
'Arthur - Natural',
|
|
285
|
-
'Bella - Friendly',
|
|
286
|
-
'Belle - Natural',
|
|
287
|
-
'Brandon - Warm',
|
|
288
|
-
'Brian - Natural',
|
|
289
|
-
'Bruce - Natural',
|
|
290
|
-
'Cerise - Cheerful',
|
|
291
|
-
'Christopher - Calm',
|
|
292
|
-
'Clara - Professional',
|
|
293
|
-
'Connor - Natural',
|
|
294
|
-
'Dahlia - Friendly',
|
|
295
|
-
'Davis - Professional',
|
|
296
|
-
'Dean - Natural',
|
|
297
|
-
'Delbert - Cheerful',
|
|
298
|
-
'Edward - Friendly',
|
|
299
|
-
'Elaine - Calm',
|
|
300
|
-
'Emily - Natural',
|
|
301
|
-
'Emma - Newscaster',
|
|
302
|
-
'Eric - Newscaster',
|
|
303
|
-
'Grace - Natural',
|
|
304
|
-
'Hailey - Calm',
|
|
305
|
-
'Indira - Cheerful',
|
|
306
|
-
'Isabella - Cheerful',
|
|
307
|
-
'Jacob - Natural',
|
|
308
|
-
'Jahmai - Friendly',
|
|
309
|
-
'Jane - Serious',
|
|
310
|
-
'Jason - Serious',
|
|
311
|
-
'Jelle - Friendly',
|
|
312
|
-
'Jen - Natural',
|
|
313
|
-
'Jenny - Professional',
|
|
314
|
-
'Jodi - Cheerful',
|
|
315
|
-
'Joey - Calm',
|
|
316
|
-
'Johan - Friendly',
|
|
317
|
-
'Josie - Cheerful',
|
|
318
|
-
'Keanan - Natural',
|
|
319
|
-
'Keith - Cheerful',
|
|
320
|
-
'Kellie - Friendly',
|
|
321
|
-
'Lauren - Friendly',
|
|
322
|
-
'Leah - Natural',
|
|
323
|
-
'Liam - Professional',
|
|
324
|
-
'Libby - Natural',
|
|
325
|
-
'Lily - Professional',
|
|
326
|
-
'Lucas - Natural',
|
|
327
|
-
'Luke - Professional',
|
|
328
|
-
'Luna - Natural',
|
|
329
|
-
'Marieke - Natural',
|
|
330
|
-
'Matthew - Professional',
|
|
331
|
-
'Michelle - Natural',
|
|
332
|
-
'Mitchell - Natural',
|
|
333
|
-
'Molly - Newscaster',
|
|
334
|
-
'Monica - Calm',
|
|
335
|
-
'Natasha - Professional',
|
|
336
|
-
'Neerja - Newscaster',
|
|
337
|
-
'Noah - Serious',
|
|
338
|
-
'Oliver - Newscaster',
|
|
339
|
-
'Olivia - Calm',
|
|
340
|
-
'Paul - Natural',
|
|
341
|
-
'Prabhat - Natural',
|
|
342
|
-
'Raveena - Natural',
|
|
343
|
-
'Rudi - Friendly',
|
|
344
|
-
'Ryan - Professional',
|
|
345
|
-
'Sam - Natural',
|
|
346
|
-
'Sara - Cheerful',
|
|
347
|
-
'Sherry - Friendly',
|
|
348
|
-
'Sonia - Warm',
|
|
349
|
-
'Thomas - Natural',
|
|
350
|
-
'Todd - Professional',
|
|
351
|
-
'Tony - Professional',
|
|
352
|
-
'Tracy - Cheerful',
|
|
353
|
-
'Wayne - Natural',
|
|
354
|
-
'Wilder - Natural',
|
|
355
|
-
'Wille - Natural',
|
|
356
|
-
'William - Friendly'
|
|
357
|
-
]),
|
|
358
|
-
avatarStyle: z.optional(z.enum(['normal', 'circle'])),
|
|
359
|
-
background: z.optional(z.string()),
|
|
360
|
-
ratio: z.optional(z.enum(['16:9', '9:16'])),
|
|
361
|
-
test: z.optional(z.boolean())
|
|
362
|
-
}).strict();
|
|
363
|
-
export const heyGenTextToAvatarOptionsSchema = heygenTextToAvatarOptionsHeyGenTextToAvatarOptionsSchema;
|
|
364
|
-
/**
|
|
365
|
-
* Generate assets using the third party HeyGen provider AI services.
|
|
366
|
-
*
|
|
367
|
-
* The following AI generation services are available: <ul>
|
|
368
|
-
* <li><a href="#tocs_heygentexttoavataroptions">HeyGenTextToAvatarOptions</a></li>
|
|
369
|
-
* </ul>
|
|
370
|
-
*/
|
|
371
|
-
export const heygenGeneratedAssetOptionsHeyGenGeneratedAssetOptionsSchema = z.object({
|
|
372
|
-
type: z.literal('heygenTextToAvatarOptions_HeyGenTextToAvatarOptions')
|
|
373
|
-
}).strict().and(heygenTextToAvatarOptionsHeyGenTextToAvatarOptionsSchema);
|
|
374
|
-
export const heyGenGeneratedAssetOptionsSchema = heygenGeneratedAssetOptionsHeyGenGeneratedAssetOptionsSchema;
|
|
375
|
-
/**
|
|
376
|
-
* Generate assets using HeyGen. HeyGen provide a text-to-avatar service. The HeyGen provider works on a bring-your-own-key basis, credentials are required and must be added via the [dashboard](https://dashboard.shotstack.io/integrations/heygen), not in the request.
|
|
377
|
-
*/
|
|
378
|
-
export const heygenGeneratedAssetHeyGenGeneratedAssetSchema = z.object({
|
|
379
|
-
provider: z.enum(['heygen']),
|
|
380
|
-
options: heygenGeneratedAssetOptionsHeyGenGeneratedAssetOptionsSchema
|
|
381
|
-
}).strict();
|
|
382
|
-
export const heyGenGeneratedAssetSchema = heygenGeneratedAssetHeyGenGeneratedAssetSchema;
|
|
383
|
-
/**
|
|
384
|
-
* Options for the OpenAI text-generator service. Set a text prompt that will be used to generate a new body of text. The output will be generated as a text (txt) file available at the URL returned in the response.
|
|
385
|
-
*/
|
|
386
|
-
export const openaiTextGeneratorOptionsOpenAiTextGeneratorOptionsSchema = z.object({
|
|
387
|
-
type: z.enum(['text-generator']),
|
|
388
|
-
prompt: z.string(),
|
|
389
|
-
model: z.enum(['gpt-3.5-turbo', 'gpt-4']),
|
|
390
|
-
systemPrompt: z.optional(z.string())
|
|
391
|
-
}).strict();
|
|
392
|
-
export const openAiTextGeneratorOptionsSchema = openaiTextGeneratorOptionsOpenAiTextGeneratorOptionsSchema;
|
|
393
|
-
/**
|
|
394
|
-
* Generate assets using OpenAI provider AI services.
|
|
395
|
-
*
|
|
396
|
-
* The following AI generation services are available: <ul>
|
|
397
|
-
* <li><a href="#tocs_openaitextgeneratoroptions">OpenAiTextGeneratorOptions</a></li>
|
|
398
|
-
* </ul>
|
|
399
|
-
*/
|
|
400
|
-
export const openaiGeneratedAssetOptionsOpenAiGeneratedAssetOptionsSchema = z.object({
|
|
401
|
-
type: z.literal('openaiTextGeneratorOptions_OpenAiTextGeneratorOptions')
|
|
402
|
-
}).strict().and(openaiTextGeneratorOptionsOpenAiTextGeneratorOptionsSchema);
|
|
403
|
-
export const openAiGeneratedAssetOptionsSchema = openaiGeneratedAssetOptionsOpenAiGeneratedAssetOptionsSchema;
|
|
404
|
-
/**
|
|
405
|
-
* Generate assets using OpenAI. OpenAI provide a text generation service using ChatGPT 3.5 and 4. The OpenAI provider works on a bring-your-own-key basis, credentials are required and must be added via the [dashboard](https://dashboard.shotstack.io/integrations/openai), not in the request.
|
|
406
|
-
*/
|
|
407
|
-
export const openaiGeneratedAssetOpenAiGeneratedAssetSchema = z.object({
|
|
408
|
-
provider: z.enum(['openai']),
|
|
409
|
-
options: openaiGeneratedAssetOptionsOpenAiGeneratedAssetOptionsSchema
|
|
410
|
-
}).strict();
|
|
411
|
-
export const openAiGeneratedAssetSchema = openaiGeneratedAssetOpenAiGeneratedAssetSchema;
|
|
412
|
-
/**
|
|
413
|
-
* Individual errors returned by the Create API.
|
|
414
|
-
*/
|
|
415
|
-
export const generatedAssetErrorResponseDataGeneratedAssetErrorResponseDataSchema = z.object({
|
|
416
|
-
status: z.string(),
|
|
417
|
-
title: z.string(),
|
|
418
|
-
detail: z.string()
|
|
419
|
-
}).strict();
|
|
420
|
-
export const generatedAssetErrorResponseDataSchema = generatedAssetErrorResponseDataGeneratedAssetErrorResponseDataSchema;
|
|
421
|
-
/**
|
|
422
|
-
* Error response data for validation and other errors returned by the Create API.
|
|
423
|
-
*/
|
|
424
|
-
export const generatedAssetErrorResponseGeneratedAssetErrorResponseSchema = z.object({
|
|
425
|
-
errors: z.array(generatedAssetErrorResponseDataGeneratedAssetErrorResponseDataSchema)
|
|
426
|
-
}).strict();
|
|
427
|
-
export const generatedAssetErrorResponseSchema = generatedAssetErrorResponseGeneratedAssetErrorResponseSchema;
|
|
428
|
-
/**
|
|
429
|
-
* The id and attributes of the generated asset.
|
|
430
|
-
*/
|
|
431
|
-
export const generatedAssetResponseAttributesGeneratedAssetResponseAttributesSchema = z.object({
|
|
432
|
-
owner: z.string(),
|
|
433
|
-
provider: z.enum([
|
|
434
|
-
'shotstack',
|
|
435
|
-
'elevenlabs',
|
|
436
|
-
'heygen',
|
|
437
|
-
'd-id'
|
|
438
|
-
]),
|
|
439
|
-
type: z.enum(['text-to-speech', 'text-to-avatar']),
|
|
440
|
-
url: z.optional(z.string()),
|
|
441
|
-
status: z.enum([
|
|
442
|
-
'queued',
|
|
443
|
-
'processing',
|
|
444
|
-
'saving',
|
|
445
|
-
'done',
|
|
446
|
-
'failed'
|
|
447
|
-
]),
|
|
448
|
-
created: z.string(),
|
|
449
|
-
updated: z.string()
|
|
450
|
-
}).strict();
|
|
451
|
-
export const generatedAssetResponseAttributesSchema = generatedAssetResponseAttributesGeneratedAssetResponseAttributesSchema;
|
|
452
|
-
/**
|
|
453
|
-
* The type of resource (an asset), it's id and attributes of the generated file.
|
|
454
|
-
*/
|
|
455
|
-
export const generatedAssetResponseDataGeneratedAssetResponseDataSchema = z.object({
|
|
456
|
-
type: z.string(),
|
|
457
|
-
id: z.string(),
|
|
458
|
-
attributes: generatedAssetResponseAttributesGeneratedAssetResponseAttributesSchema
|
|
459
|
-
}).strict();
|
|
460
|
-
export const generatedAssetResponseDataSchema = generatedAssetResponseDataGeneratedAssetResponseDataSchema;
|
|
461
|
-
/**
|
|
462
|
-
* The response returned by the Create API [generate asset](#generate-asset) and [get generated asset](#get-generated-asset) requests. Includes status and details of the generated asset. The response follows the [json:api](https://jsonapi.org/) specification.
|
|
463
|
-
*/
|
|
464
|
-
export const generatedAssetResponseGeneratedAssetResponseSchema = z.object({
|
|
465
|
-
data: generatedAssetResponseDataGeneratedAssetResponseDataSchema
|
|
466
|
-
}).strict();
|
|
467
|
-
export const generatedAssetResponseSchema = generatedAssetResponseGeneratedAssetResponseSchema;
|
|
468
|
-
/**
|
|
469
|
-
* Options for the Shotstack image-to-video service. Set the URL of an image to convert in to a video. The output will be generated as an MP4 file available at the URL returned in the response.
|
|
470
|
-
*/
|
|
471
|
-
export const shotstackImageToVideoOptionsShotstackImageToVideoOptionsSchema = z.object({
|
|
472
|
-
type: z.enum(['image-to-video']),
|
|
473
|
-
imageUrl: z.string(),
|
|
474
|
-
guidanceScale: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
475
|
-
return undefined; if (Array.isArray(v))
|
|
476
|
-
return v; if (typeof v === 'string') {
|
|
477
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
478
|
-
return v;
|
|
479
|
-
return Number(v);
|
|
480
|
-
} return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1.8),
|
|
481
|
-
motion: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
482
|
-
return undefined; if (Array.isArray(v))
|
|
483
|
-
return v; if (typeof v === 'string') {
|
|
484
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
485
|
-
return v;
|
|
486
|
-
return Number(v);
|
|
487
|
-
} return v; }), z.number().int()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(127)
|
|
488
|
-
}).strict();
|
|
489
|
-
export const shotstackImageToVideoOptionsSchema = shotstackImageToVideoOptionsShotstackImageToVideoOptionsSchema;
|
|
490
|
-
/**
|
|
491
|
-
* Options for the Shotstack text-generator service. Set a text prompt that will be used to generate a new body of text. The output will be generated as a text (txt) file available at the URL returned in the response.
|
|
492
|
-
*/
|
|
493
|
-
export const shotstackTextGeneratorOptionsShotstackTextGeneratorOptionsSchema = z.object({
|
|
494
|
-
type: z.enum(['text-generator']),
|
|
495
|
-
prompt: z.string()
|
|
496
|
-
}).strict();
|
|
497
|
-
export const shotstackTextGeneratorOptionsSchema = shotstackTextGeneratorOptionsShotstackTextGeneratorOptionsSchema;
|
|
498
|
-
/**
|
|
499
|
-
* Options for the Shotstack text-to-image service. Set a text prompt to generate an image from. The output will be generated as a PNG file available at the URL returned in the response.
|
|
500
|
-
*/
|
|
501
|
-
export const shotstackTextToImageOptionsShotstackTextToImageOptionsSchema = z.object({
|
|
502
|
-
type: z.enum(['text-to-image']),
|
|
503
|
-
prompt: z.string(),
|
|
504
|
-
width: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
505
|
-
return undefined; if (Array.isArray(v))
|
|
506
|
-
return v; if (typeof v === 'string') {
|
|
507
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
508
|
-
return v;
|
|
509
|
-
return Number(v);
|
|
510
|
-
} return v; }), z.number().int()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
511
|
-
height: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
512
|
-
return undefined; if (Array.isArray(v))
|
|
513
|
-
return v; if (typeof v === 'string') {
|
|
514
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
515
|
-
return v;
|
|
516
|
-
return Number(v);
|
|
517
|
-
} return v; }), z.number().int()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
518
|
-
}).strict();
|
|
519
|
-
export const shotstackTextToImageOptionsSchema = shotstackTextToImageOptionsShotstackTextToImageOptionsSchema;
|
|
520
|
-
/**
|
|
521
|
-
* Options for the Shotstack text-to-speech service. Set the text to be converted to speech and choose a voice to set the speaking style. The output will be generated as an MP3 audio file available at the URL returned in the response.
|
|
522
|
-
*/
|
|
523
|
-
export const shotstackTextToSpeechOptionsShotstackTextToSpeechOptionsSchema = z.object({
|
|
524
|
-
type: z.enum(['text-to-speech']),
|
|
525
|
-
text: z.string(),
|
|
526
|
-
voice: z.enum([
|
|
527
|
-
'Hala',
|
|
528
|
-
'Lisa',
|
|
529
|
-
'Arlet',
|
|
530
|
-
'Hiujin',
|
|
531
|
-
'Zhiyu',
|
|
532
|
-
'Sofie',
|
|
533
|
-
'Laura',
|
|
534
|
-
'Olivia',
|
|
535
|
-
'Amy',
|
|
536
|
-
'Emma',
|
|
537
|
-
'Brian',
|
|
538
|
-
'Arthur',
|
|
539
|
-
'Kajal',
|
|
540
|
-
'Niamh',
|
|
541
|
-
'Aria',
|
|
542
|
-
'Ayanda',
|
|
543
|
-
'Ivy',
|
|
544
|
-
'Joanna',
|
|
545
|
-
'Kendra',
|
|
546
|
-
'Kimberly',
|
|
547
|
-
'Salli',
|
|
548
|
-
'Joey',
|
|
549
|
-
'Justin',
|
|
550
|
-
'Kevin',
|
|
551
|
-
'Matthew',
|
|
552
|
-
'Ruth',
|
|
553
|
-
'Stephen',
|
|
554
|
-
'Suvi',
|
|
555
|
-
'Léa',
|
|
556
|
-
'Rémi',
|
|
557
|
-
'Gabrielle',
|
|
558
|
-
'Liam',
|
|
559
|
-
'Vicki',
|
|
560
|
-
'Daniel',
|
|
561
|
-
'Hannah',
|
|
562
|
-
'Kajal',
|
|
563
|
-
'Bianca',
|
|
564
|
-
'Adriano',
|
|
565
|
-
'Takumi',
|
|
566
|
-
'Kazuha',
|
|
567
|
-
'Tomoko',
|
|
568
|
-
'Seoyeon',
|
|
569
|
-
'Ida',
|
|
570
|
-
'Ola',
|
|
571
|
-
'Camila',
|
|
572
|
-
'Vitória',
|
|
573
|
-
'Vitoria',
|
|
574
|
-
'Thiago',
|
|
575
|
-
'Inês',
|
|
576
|
-
'Ines',
|
|
577
|
-
'Lucia',
|
|
578
|
-
'Sergio',
|
|
579
|
-
'Mia',
|
|
580
|
-
'Andrés',
|
|
581
|
-
'Lupe',
|
|
582
|
-
'Pedro',
|
|
583
|
-
'Elin'
|
|
584
|
-
]),
|
|
585
|
-
language: z.optional(z.enum([
|
|
586
|
-
'cmn-CN',
|
|
587
|
-
'da-DK',
|
|
588
|
-
'de-DE',
|
|
589
|
-
'en-AU',
|
|
590
|
-
'en-GB',
|
|
591
|
-
'en-IN',
|
|
592
|
-
'en-US',
|
|
593
|
-
'es-ES',
|
|
594
|
-
'es-MX',
|
|
595
|
-
'es-US',
|
|
596
|
-
'fr-CA',
|
|
597
|
-
'fr-FR',
|
|
598
|
-
'it-IT',
|
|
599
|
-
'ja-JP',
|
|
600
|
-
'hi-IN',
|
|
601
|
-
'ko-KR',
|
|
602
|
-
'nb-NO',
|
|
603
|
-
'nl-NL',
|
|
604
|
-
'pl-PL',
|
|
605
|
-
'pt-BR',
|
|
606
|
-
'pt-PT',
|
|
607
|
-
'sv-SE',
|
|
608
|
-
'en-NZ',
|
|
609
|
-
'en-ZA',
|
|
610
|
-
'ca-ES',
|
|
611
|
-
'de-AT',
|
|
612
|
-
'yue-CN',
|
|
613
|
-
'ar-AE',
|
|
614
|
-
'fi-FI'
|
|
615
|
-
])),
|
|
616
|
-
newscaster: z.optional(z.boolean()).default(false)
|
|
617
|
-
}).strict();
|
|
618
|
-
export const shotstackTextToSpeechOptionsSchema = shotstackTextToSpeechOptionsShotstackTextToSpeechOptionsSchema;
|
|
619
|
-
/**
|
|
620
|
-
* Generate assets using the native Shotstack provider AI services.
|
|
621
|
-
*/
|
|
622
|
-
export const shotstackGeneratedAssetOptionsShotstackGeneratedAssetOptionsSchema = z.union([
|
|
623
|
-
z.object({
|
|
624
|
-
type: z.literal('shotstackTextToSpeechOptions_ShotstackTextToSpeechOptions')
|
|
625
|
-
}).strict().and(shotstackTextToSpeechOptionsShotstackTextToSpeechOptionsSchema),
|
|
626
|
-
z.object({
|
|
627
|
-
type: z.literal('shotstackTextToImageOptions_ShotstackTextToImageOptions')
|
|
628
|
-
}).strict().and(shotstackTextToImageOptionsShotstackTextToImageOptionsSchema),
|
|
629
|
-
z.object({
|
|
630
|
-
type: z.literal('shotstackTextGeneratorOptions_ShotstackTextGeneratorOptions')
|
|
631
|
-
}).strict().and(shotstackTextGeneratorOptionsShotstackTextGeneratorOptionsSchema),
|
|
632
|
-
z.object({
|
|
633
|
-
type: z.literal('shotstackImageToVideoOptions_ShotstackImageToVideoOptions')
|
|
634
|
-
}).strict().and(shotstackImageToVideoOptionsShotstackImageToVideoOptionsSchema)
|
|
635
|
-
]);
|
|
636
|
-
export const shotstackGeneratedAssetOptionsSchema = shotstackGeneratedAssetOptionsShotstackGeneratedAssetOptionsSchema;
|
|
637
|
-
/**
|
|
638
|
-
* Generate assets using the native Shotstack provider. Shotstack provides a text-to-speech and a text-to-image service. The Shotstack provider works natively with your existing API key, no additional credentials are required.
|
|
639
|
-
*/
|
|
640
|
-
export const shotstackGeneratedAssetShotstackGeneratedAssetSchema = z.object({
|
|
641
|
-
provider: z.enum(['shotstack']),
|
|
642
|
-
options: shotstackGeneratedAssetOptionsShotstackGeneratedAssetOptionsSchema
|
|
643
|
-
}).strict();
|
|
644
|
-
export const shotstackGeneratedAssetSchema = shotstackGeneratedAssetShotstackGeneratedAssetSchema;
|
|
645
|
-
/**
|
|
646
|
-
* Options for the Stability AI text-to-image service. Set a text prompt to generate an image from plus other engine and configuration options. The output will be generated as a JPG file available at the URL returned in the response.
|
|
647
|
-
*/
|
|
648
|
-
export const stabilityAiTextToImageOptionsStabilityAiTextToImageOptionsSchema = z.object({
|
|
649
|
-
type: z.enum(['text-to-image']),
|
|
650
|
-
prompt: z.string(),
|
|
651
|
-
engine: z.optional(z.enum([
|
|
652
|
-
'stable-diffusion-xl-1024-v0-9',
|
|
653
|
-
'stable-diffusion-xl-1024-v1-0',
|
|
654
|
-
'stable-diffusion-v1-6',
|
|
655
|
-
'stable-diffusion-512-v2-1',
|
|
656
|
-
'stable-diffusion-xl-beta-v2-2-2'
|
|
657
|
-
])),
|
|
658
|
-
width: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
659
|
-
return undefined; if (Array.isArray(v))
|
|
660
|
-
return v; if (typeof v === 'string') {
|
|
661
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
662
|
-
return v;
|
|
663
|
-
return Number(v);
|
|
664
|
-
} return v; }), z.number().int()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
665
|
-
height: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
666
|
-
return undefined; if (Array.isArray(v))
|
|
667
|
-
return v; if (typeof v === 'string') {
|
|
668
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
669
|
-
return v;
|
|
670
|
-
return Number(v);
|
|
671
|
-
} return v; }), z.number().int()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
672
|
-
steps: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
673
|
-
return undefined; if (Array.isArray(v))
|
|
674
|
-
return v; if (typeof v === 'string') {
|
|
675
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
676
|
-
return v;
|
|
677
|
-
return Number(v);
|
|
678
|
-
} return v; }), z.number().int()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(30),
|
|
679
|
-
seed: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
680
|
-
return undefined; if (Array.isArray(v))
|
|
681
|
-
return v; if (typeof v === 'string') {
|
|
682
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
683
|
-
return v;
|
|
684
|
-
return Number(v);
|
|
685
|
-
} return v; }), z.number().int()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
686
|
-
cfgScale: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
687
|
-
return undefined; if (Array.isArray(v))
|
|
688
|
-
return v; if (typeof v === 'string') {
|
|
689
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
690
|
-
return v;
|
|
691
|
-
return Number(v);
|
|
692
|
-
} return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(7),
|
|
693
|
-
stylePreset: z.optional(z.enum([
|
|
694
|
-
'3d-model',
|
|
695
|
-
'analog-film',
|
|
696
|
-
'anime',
|
|
697
|
-
'cinematic',
|
|
698
|
-
'comic-book',
|
|
699
|
-
'digital-art',
|
|
700
|
-
'enhance',
|
|
701
|
-
'fantasy-art',
|
|
702
|
-
'isometric',
|
|
703
|
-
'line-art',
|
|
704
|
-
'low-poly',
|
|
705
|
-
'modeling-compound',
|
|
706
|
-
'neon-punk',
|
|
707
|
-
'origami',
|
|
708
|
-
'photographic',
|
|
709
|
-
'pixel-art',
|
|
710
|
-
'tile-texture'
|
|
711
|
-
]))
|
|
712
|
-
}).strict();
|
|
713
|
-
export const stabilityAiTextToImageOptionsSchema = stabilityAiTextToImageOptionsStabilityAiTextToImageOptionsSchema;
|
|
714
|
-
/**
|
|
715
|
-
* Generate assets using Stability AI provider AI services.
|
|
716
|
-
*
|
|
717
|
-
* The following AI generation services are available: <ul>
|
|
718
|
-
* <li><a href="#tocs_stabilityaitexttoimageoptions">StabilityAiTextToImageOptions</a></li>
|
|
719
|
-
* </ul>
|
|
720
|
-
*/
|
|
721
|
-
export const stabilityAiGeneratedAssetOptionsStabilityAiGeneratedAssetOptionsSchema = z.object({
|
|
722
|
-
type: z.literal('stabilityAiTextToImageOptions_StabilityAiTextToImageOptions')
|
|
723
|
-
}).strict().and(stabilityAiTextToImageOptionsStabilityAiTextToImageOptionsSchema);
|
|
724
|
-
export const stabilityAiGeneratedAssetOptionsSchema = stabilityAiGeneratedAssetOptionsStabilityAiGeneratedAssetOptionsSchema;
|
|
725
|
-
/**
|
|
726
|
-
* Generate assets using Stability AI. Stability AI provide a text-to-image service using Stable Diffusion. The Stability AI provider works on a bring-your-own-key basis, credentials are required and must be added via the [dashboard](https://dashboard.shotstack.io/integrations/stability-ai), not in the request.
|
|
727
|
-
*/
|
|
728
|
-
export const stabilityAiGeneratedAssetStabilityAiGeneratedAssetSchema = z.object({
|
|
729
|
-
provider: z.enum(['stability-ai']),
|
|
730
|
-
options: stabilityAiGeneratedAssetOptionsStabilityAiGeneratedAssetOptionsSchema
|
|
731
|
-
}).strict();
|
|
732
|
-
export const stabilityAiGeneratedAssetSchema = stabilityAiGeneratedAssetStabilityAiGeneratedAssetSchema;
|
|
733
|
-
/**
|
|
734
|
-
* A generated asset is a media asset created by the Create API. You can use native or third party providers to generate video, audio and image files using Generative AI services like text-to-speech and text-to-avatar.
|
|
735
|
-
*/
|
|
736
|
-
export const generatedAssetGeneratedAssetSchema = z.union([
|
|
737
|
-
z.object({
|
|
738
|
-
provider: z.literal('shotstackGeneratedAsset_ShotstackGeneratedAsset')
|
|
739
|
-
}).strict().and(shotstackGeneratedAssetShotstackGeneratedAssetSchema),
|
|
740
|
-
z.object({
|
|
741
|
-
provider: z.literal('didGeneratedAsset_DIDGeneratedAsset')
|
|
742
|
-
}).strict().and(didGeneratedAssetDidGeneratedAssetSchema),
|
|
743
|
-
z.object({
|
|
744
|
-
provider: z.literal('elevenlabsGeneratedAsset_ElevenLabsGeneratedAsset')
|
|
745
|
-
}).strict().and(elevenlabsGeneratedAssetElevenLabsGeneratedAssetSchema),
|
|
746
|
-
z.object({
|
|
747
|
-
provider: z.literal('heygenGeneratedAsset_HeyGenGeneratedAsset')
|
|
748
|
-
}).strict().and(heygenGeneratedAssetHeyGenGeneratedAssetSchema),
|
|
749
|
-
z.object({
|
|
750
|
-
provider: z.literal('openaiGeneratedAsset_OpenAiGeneratedAsset')
|
|
751
|
-
}).strict().and(openaiGeneratedAssetOpenAiGeneratedAssetSchema),
|
|
752
|
-
z.object({
|
|
753
|
-
provider: z.literal('stabilityAiGeneratedAsset_StabilityAiGeneratedAsset')
|
|
754
|
-
}).strict().and(stabilityAiGeneratedAssetStabilityAiGeneratedAssetSchema)
|
|
755
|
-
]);
|
|
756
|
-
export const generatedAssetSchema = generatedAssetGeneratedAssetSchema;
|
|
757
164
|
/**
|
|
758
165
|
* Crop the sides of an asset by a relative amount. The size of the crop is specified using a scale between 0 and 1, relative to the screen width - i.e a left crop of 0.5 will crop half of the asset from the left, a top crop of 0.25 will crop the top by quarter of the asset.
|
|
759
166
|
*/
|
|
@@ -794,8 +201,14 @@ export const cropSchema = cropCropSchema;
|
|
|
794
201
|
export const akamaiNetStorageDestinationOptionsAkamaiNetStorageDestinationOptionsSchema = z.object({
|
|
795
202
|
host: z.string(),
|
|
796
203
|
cpCode: z.string(),
|
|
797
|
-
path: z.optional(z.
|
|
798
|
-
|
|
204
|
+
path: z.optional(z.union([
|
|
205
|
+
z.string(),
|
|
206
|
+
z.null()
|
|
207
|
+
])),
|
|
208
|
+
filename: z.optional(z.union([
|
|
209
|
+
z.string(),
|
|
210
|
+
z.null()
|
|
211
|
+
]))
|
|
799
212
|
}).strict();
|
|
800
213
|
/**
|
|
801
214
|
* Send videos and assets to [Akamai NetStorage](https://techdocs.akamai.com/netstorage-usage/docs). Send files to your NetStorage upload directory with a custom path and filename. Akamai credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/akamai-netstorage), not in the request.
|
|
@@ -810,8 +223,14 @@ export const akamaiNetStorageDestinationAkamaiNetStorageDestinationSchema = z.ob
|
|
|
810
223
|
export const azureBlobStorageDestinationOptionsAzureBlobStorageDestinationOptionsSchema = z.object({
|
|
811
224
|
accountName: z.string(),
|
|
812
225
|
container: z.string(),
|
|
813
|
-
prefix: z.optional(z.
|
|
814
|
-
|
|
226
|
+
prefix: z.optional(z.union([
|
|
227
|
+
z.string(),
|
|
228
|
+
z.null()
|
|
229
|
+
])),
|
|
230
|
+
filename: z.optional(z.union([
|
|
231
|
+
z.string(),
|
|
232
|
+
z.null()
|
|
233
|
+
]))
|
|
815
234
|
}).strict();
|
|
816
235
|
/**
|
|
817
236
|
* Send videos and assets to [Azure Blob Storage](https://learn.microsoft.com/en-us/azure/storage/blobs/). Send files to any container with a custom prefix and filename. Azure credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/azure-blob-storage), not in the request.
|
|
@@ -2204,704 +1623,119 @@ export const soundtrackSoundtrackSchema = z.object({
|
|
|
2204
1623
|
}).strict();
|
|
2205
1624
|
export const soundtrackSchema = soundtrackSoundtrackSchema;
|
|
2206
1625
|
/**
|
|
2207
|
-
*
|
|
2208
|
-
*
|
|
1626
|
+
* The SvgAsset is used to add scalable vector graphics (SVG) to a video using raw SVG markup.
|
|
1627
|
+
*
|
|
1628
|
+
* ```json
|
|
1629
|
+
* {
|
|
1630
|
+
* "type": "svg",
|
|
1631
|
+
* "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
|
|
1632
|
+
* }
|
|
1633
|
+
* ```
|
|
1634
|
+
*
|
|
1635
|
+
* **Supported elements:** `<path>`, `<rect>`, `<circle>`, `<ellipse>`,
|
|
1636
|
+
* `<line>`, `<polygon>`, `<polyline>`
|
|
1637
|
+
*
|
|
1638
|
+
* **Automatically extracted from SVG markup:**
|
|
1639
|
+
* - Path data (converted to a single combined path)
|
|
1640
|
+
* - Fill color (from `fill` attribute or `style`)
|
|
1641
|
+
* - Stroke color and width (from attributes or `style`)
|
|
1642
|
+
* - Dimensions (from `width`/`height` or `viewBox`)
|
|
1643
|
+
* - Opacity (from `opacity` attribute)
|
|
1644
|
+
*
|
|
1645
|
+
* See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
|
|
2209
1646
|
*
|
|
2210
1647
|
*/
|
|
2211
|
-
export const
|
|
2212
|
-
|
|
1648
|
+
export const svgassetSvgAssetSchema = z.object({
|
|
1649
|
+
type: z.enum(["svg"]),
|
|
1650
|
+
src: z.string().min(1).max(500000),
|
|
1651
|
+
}).strict();
|
|
1652
|
+
export const svgAssetSchema = svgassetSvgAssetSchema;
|
|
1653
|
+
/**
|
|
1654
|
+
* Configure the id and optional merge fields to render a template by id.
|
|
1655
|
+
*/
|
|
1656
|
+
export const templaterenderTemplateRenderSchema = z.object({
|
|
1657
|
+
id: z.string(),
|
|
1658
|
+
merge: z.optional(z.array(mergefieldMergeFieldSchema))
|
|
1659
|
+
}).strict();
|
|
1660
|
+
export const templateRenderSchema = templaterenderTemplateRenderSchema;
|
|
1661
|
+
/**
|
|
1662
|
+
* Horizontal and vertical alignment properties for text.
|
|
1663
|
+
*/
|
|
1664
|
+
export const textpropertiesTextAlignmentSchema = z.object({
|
|
1665
|
+
horizontal: z.optional(z.enum([
|
|
1666
|
+
'left',
|
|
1667
|
+
'center',
|
|
1668
|
+
'right'
|
|
1669
|
+
])),
|
|
1670
|
+
vertical: z.optional(z.enum([
|
|
1671
|
+
'top',
|
|
1672
|
+
'center',
|
|
1673
|
+
'bottom'
|
|
1674
|
+
]))
|
|
1675
|
+
}).strict();
|
|
1676
|
+
export const textAlignmentSchema = textpropertiesTextAlignmentSchema;
|
|
1677
|
+
/**
|
|
1678
|
+
* Animation properties for text entrance effects.
|
|
1679
|
+
*/
|
|
1680
|
+
export const textpropertiesTextAnimationSchema = z.object({
|
|
1681
|
+
preset: z.enum(['typewriter']),
|
|
1682
|
+
duration: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2213
1683
|
return undefined; if (Array.isArray(v))
|
|
2214
1684
|
return v; if (typeof v === 'string') {
|
|
2215
1685
|
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2216
1686
|
return v;
|
|
2217
1687
|
return Number(v);
|
|
2218
|
-
} return v; }), z.number().gte(0).lte(
|
|
2219
|
-
color: z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
1688
|
+
} return v; }), z.number().gte(0.1).lte(30)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
2220
1689
|
}).strict();
|
|
2221
|
-
export const svgGradientStopSchema = svgpropertiesSvgGradientStopSchema;
|
|
2222
1690
|
/**
|
|
2223
|
-
*
|
|
2224
|
-
* The gradient direction is controlled by the `angle` property.
|
|
2225
|
-
*
|
|
1691
|
+
* Displays a background box behind the text.
|
|
2226
1692
|
*/
|
|
2227
|
-
export const
|
|
2228
|
-
|
|
2229
|
-
|
|
1693
|
+
export const textpropertiesTextBackgroundSchema = z.object({
|
|
1694
|
+
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1695
|
+
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2230
1696
|
return undefined; if (Array.isArray(v))
|
|
2231
1697
|
return v; if (typeof v === 'string') {
|
|
2232
1698
|
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2233
1699
|
return v;
|
|
2234
1700
|
return Number(v);
|
|
2235
|
-
} return v; }), z.number().gte(0).lte(
|
|
2236
|
-
|
|
2237
|
-
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
1701
|
+
} return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1702
|
+
padding: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2238
1703
|
return undefined; if (Array.isArray(v))
|
|
2239
1704
|
return v; if (typeof v === 'string') {
|
|
2240
1705
|
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2241
1706
|
return v;
|
|
2242
1707
|
return Number(v);
|
|
2243
|
-
} return v; }), z.number().gte(0).lte(
|
|
2244
|
-
|
|
2245
|
-
export const svgLinearGradientFillSchema = svgpropertiesSvgLinearGradientFillSchema;
|
|
2246
|
-
/**
|
|
2247
|
-
* A radial gradient fill that transitions colors radiating outward from a center point.
|
|
2248
|
-
* The gradient creates a circular or elliptical color transition.
|
|
2249
|
-
*
|
|
2250
|
-
*/
|
|
2251
|
-
export const svgpropertiesSvgRadialGradientFillSchema = z.object({
|
|
2252
|
-
type: z.enum(['radial']),
|
|
2253
|
-
stops: z.array(svgpropertiesSvgGradientStopSchema).min(2),
|
|
2254
|
-
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
1708
|
+
} return v; }), z.number().gte(0).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1709
|
+
borderRadius: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2255
1710
|
return undefined; if (Array.isArray(v))
|
|
2256
1711
|
return v; if (typeof v === 'string') {
|
|
2257
1712
|
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2258
1713
|
return v;
|
|
2259
1714
|
return Number(v);
|
|
2260
|
-
} return v; }), z.number().gte(0)
|
|
1715
|
+
} return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
2261
1716
|
}).strict();
|
|
2262
|
-
export const
|
|
1717
|
+
export const textBackgroundSchema = textpropertiesTextBackgroundSchema;
|
|
2263
1718
|
/**
|
|
2264
|
-
*
|
|
2265
|
-
*
|
|
1719
|
+
* Font properties for text.
|
|
2266
1720
|
*/
|
|
2267
|
-
export const
|
|
2268
|
-
|
|
1721
|
+
export const textpropertiesTextFontSchema = z.object({
|
|
1722
|
+
family: z.optional(z.string()),
|
|
1723
|
+
color: z.optional(z.string()),
|
|
1724
|
+
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2269
1725
|
return undefined; if (Array.isArray(v))
|
|
2270
1726
|
return v; if (typeof v === 'string') {
|
|
2271
1727
|
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2272
1728
|
return v;
|
|
2273
1729
|
return Number(v);
|
|
2274
|
-
} return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
2275
|
-
|
|
1730
|
+
} return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1731
|
+
size: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2276
1732
|
return undefined; if (Array.isArray(v))
|
|
2277
1733
|
return v; if (typeof v === 'string') {
|
|
2278
1734
|
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2279
1735
|
return v;
|
|
2280
1736
|
return Number(v);
|
|
2281
|
-
} return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
2282
|
-
|
|
2283
|
-
return undefined; if (Array.isArray(v))
|
|
2284
|
-
return v; if (typeof v === 'string') {
|
|
2285
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2286
|
-
return v;
|
|
2287
|
-
return Number(v);
|
|
2288
|
-
} return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2289
|
-
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default('#000000'),
|
|
2290
|
-
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2291
|
-
return undefined; if (Array.isArray(v))
|
|
2292
|
-
return v; if (typeof v === 'string') {
|
|
2293
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2294
|
-
return v;
|
|
2295
|
-
return Number(v);
|
|
2296
|
-
} return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5)
|
|
2297
|
-
}).strict();
|
|
2298
|
-
export const svgShadowSchema = svgpropertiesSvgShadowSchema;
|
|
2299
|
-
/**
|
|
2300
|
-
* A solid color fill for SVG shapes.
|
|
2301
|
-
*/
|
|
2302
|
-
export const svgpropertiesSvgSolidFillSchema = z.object({
|
|
2303
|
-
type: z.enum(['solid']),
|
|
2304
|
-
color: z.string().regex(/^#[A-Fa-f0-9]{6}$/).default('#000000'),
|
|
2305
|
-
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2306
|
-
return undefined; if (Array.isArray(v))
|
|
2307
|
-
return v; if (typeof v === 'string') {
|
|
2308
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2309
|
-
return v;
|
|
2310
|
-
return Number(v);
|
|
2311
|
-
} return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1)
|
|
2312
|
-
}).strict();
|
|
2313
|
-
export const svgSolidFillSchema = svgpropertiesSvgSolidFillSchema;
|
|
2314
|
-
/**
|
|
2315
|
-
* Fill properties for SVG shapes. Supports solid colors and gradients.
|
|
2316
|
-
* The fill defines how the interior of a shape is painted.
|
|
2317
|
-
*
|
|
2318
|
-
*/
|
|
2319
|
-
export const svgpropertiesSvgFillSchema = z.discriminatedUnion("type", [
|
|
2320
|
-
svgpropertiesSvgSolidFillSchema,
|
|
2321
|
-
svgpropertiesSvgLinearGradientFillSchema,
|
|
2322
|
-
svgpropertiesSvgRadialGradientFillSchema,
|
|
2323
|
-
]);
|
|
2324
|
-
export const svgFillSchema = svgpropertiesSvgFillSchema;
|
|
2325
|
-
/**
|
|
2326
|
-
* Stroke (outline) properties for SVG shapes. The stroke defines how the outline
|
|
2327
|
-
* of a shape is painted, including its color, width, and line style.
|
|
2328
|
-
*
|
|
2329
|
-
*/
|
|
2330
|
-
export const svgpropertiesSvgStrokeSchema = z.object({
|
|
2331
|
-
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default('#000000'),
|
|
2332
|
-
width: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2333
|
-
return undefined; if (Array.isArray(v))
|
|
2334
|
-
return v; if (typeof v === 'string') {
|
|
2335
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2336
|
-
return v;
|
|
2337
|
-
return Number(v);
|
|
2338
|
-
} return v; }), z.number().gte(0).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2339
|
-
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2340
|
-
return undefined; if (Array.isArray(v))
|
|
2341
|
-
return v; if (typeof v === 'string') {
|
|
2342
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2343
|
-
return v;
|
|
2344
|
-
return Number(v);
|
|
2345
|
-
} return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2346
|
-
lineCap: z.optional(z.enum([
|
|
2347
|
-
'butt',
|
|
2348
|
-
'round',
|
|
2349
|
-
'square'
|
|
2350
|
-
])),
|
|
2351
|
-
lineJoin: z.optional(z.enum([
|
|
2352
|
-
'miter',
|
|
2353
|
-
'round',
|
|
2354
|
-
'bevel'
|
|
2355
|
-
])),
|
|
2356
|
-
dashArray: z.optional(z.array(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2357
|
-
return undefined; if (Array.isArray(v))
|
|
2358
|
-
return v; if (typeof v === 'string') {
|
|
2359
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2360
|
-
return v;
|
|
2361
|
-
return Number(v);
|
|
2362
|
-
} return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))),
|
|
2363
|
-
dashOffset: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2364
|
-
return undefined; if (Array.isArray(v))
|
|
2365
|
-
return v; if (typeof v === 'string') {
|
|
2366
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2367
|
-
return v;
|
|
2368
|
-
return Number(v);
|
|
2369
|
-
} return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)
|
|
2370
|
-
}).strict();
|
|
2371
|
-
export const svgStrokeSchema = svgpropertiesSvgStrokeSchema;
|
|
2372
|
-
/**
|
|
2373
|
-
* Transformation properties for positioning, rotating, and scaling SVG shapes.
|
|
2374
|
-
*
|
|
2375
|
-
*/
|
|
2376
|
-
export const svgpropertiesSvgTransformSchema = z.object({
|
|
2377
|
-
x: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2378
|
-
return undefined; if (Array.isArray(v))
|
|
2379
|
-
return v; if (typeof v === 'string') {
|
|
2380
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2381
|
-
return v;
|
|
2382
|
-
return Number(v);
|
|
2383
|
-
} return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2384
|
-
y: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2385
|
-
return undefined; if (Array.isArray(v))
|
|
2386
|
-
return v; if (typeof v === 'string') {
|
|
2387
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2388
|
-
return v;
|
|
2389
|
-
return Number(v);
|
|
2390
|
-
} return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2391
|
-
rotation: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2392
|
-
return undefined; if (Array.isArray(v))
|
|
2393
|
-
return v; if (typeof v === 'string') {
|
|
2394
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2395
|
-
return v;
|
|
2396
|
-
return Number(v);
|
|
2397
|
-
} return v; }), z.number().gte(-360).lte(360)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2398
|
-
scale: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2399
|
-
return undefined; if (Array.isArray(v))
|
|
2400
|
-
return v; if (typeof v === 'string') {
|
|
2401
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2402
|
-
return v;
|
|
2403
|
-
return Number(v);
|
|
2404
|
-
} return v; }), z.number().gte(0.01).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2405
|
-
originX: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2406
|
-
return undefined; if (Array.isArray(v))
|
|
2407
|
-
return v; if (typeof v === 'string') {
|
|
2408
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2409
|
-
return v;
|
|
2410
|
-
return Number(v);
|
|
2411
|
-
} return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5),
|
|
2412
|
-
originY: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2413
|
-
return undefined; if (Array.isArray(v))
|
|
2414
|
-
return v; if (typeof v === 'string') {
|
|
2415
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2416
|
-
return v;
|
|
2417
|
-
return Number(v);
|
|
2418
|
-
} return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5)
|
|
2419
|
-
}).strict();
|
|
2420
|
-
export const svgTransformSchema = svgpropertiesSvgTransformSchema;
|
|
2421
|
-
/**
|
|
2422
|
-
* An arrow shape pointing to the right by default.
|
|
2423
|
-
* Use transform rotation to change direction.
|
|
2424
|
-
*
|
|
2425
|
-
*/
|
|
2426
|
-
export const svgshapesSvgArrowShapeSchema = z.object({
|
|
2427
|
-
type: z.enum(['arrow']),
|
|
2428
|
-
length: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2429
|
-
return undefined; if (Array.isArray(v))
|
|
2430
|
-
return v; if (typeof v === 'string') {
|
|
2431
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2432
|
-
return v;
|
|
2433
|
-
return Number(v);
|
|
2434
|
-
} return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2435
|
-
headWidth: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2436
|
-
return undefined; if (Array.isArray(v))
|
|
2437
|
-
return v; if (typeof v === 'string') {
|
|
2438
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2439
|
-
return v;
|
|
2440
|
-
return Number(v);
|
|
2441
|
-
} return v; }), z.number().gte(1).lte(1000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2442
|
-
headLength: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2443
|
-
return undefined; if (Array.isArray(v))
|
|
2444
|
-
return v; if (typeof v === 'string') {
|
|
2445
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2446
|
-
return v;
|
|
2447
|
-
return Number(v);
|
|
2448
|
-
} return v; }), z.number().gte(1).lte(1000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2449
|
-
shaftWidth: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2450
|
-
return undefined; if (Array.isArray(v))
|
|
2451
|
-
return v; if (typeof v === 'string') {
|
|
2452
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2453
|
-
return v;
|
|
2454
|
-
return Number(v);
|
|
2455
|
-
} return v; }), z.number().gte(1).lte(1000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2456
|
-
}).strict();
|
|
2457
|
-
export const svgArrowShapeSchema = svgshapesSvgArrowShapeSchema;
|
|
2458
|
-
/**
|
|
2459
|
-
* A perfect circle shape defined by its radius.
|
|
2460
|
-
* The circle is centered at the shape's position.
|
|
2461
|
-
*
|
|
2462
|
-
*/
|
|
2463
|
-
export const svgshapesSvgCircleShapeSchema = z.object({
|
|
2464
|
-
type: z.enum(['circle']),
|
|
2465
|
-
radius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2466
|
-
return undefined; if (Array.isArray(v))
|
|
2467
|
-
return v; if (typeof v === 'string') {
|
|
2468
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2469
|
-
return v;
|
|
2470
|
-
return Number(v);
|
|
2471
|
-
} return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2472
|
-
}).strict();
|
|
2473
|
-
export const svgCircleShapeSchema = svgshapesSvgCircleShapeSchema;
|
|
2474
|
-
/**
|
|
2475
|
-
* A cross or plus shape with equal or different arm lengths.
|
|
2476
|
-
* Can be styled as a plus sign (+) or a cross (x with rotation).
|
|
2477
|
-
*
|
|
2478
|
-
*/
|
|
2479
|
-
export const svgshapesSvgCrossShapeSchema = z.object({
|
|
2480
|
-
type: z.enum(['cross']),
|
|
2481
|
-
width: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2482
|
-
return undefined; if (Array.isArray(v))
|
|
2483
|
-
return v; if (typeof v === 'string') {
|
|
2484
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2485
|
-
return v;
|
|
2486
|
-
return Number(v);
|
|
2487
|
-
} return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2488
|
-
height: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2489
|
-
return undefined; if (Array.isArray(v))
|
|
2490
|
-
return v; if (typeof v === 'string') {
|
|
2491
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2492
|
-
return v;
|
|
2493
|
-
return Number(v);
|
|
2494
|
-
} return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2495
|
-
thickness: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2496
|
-
return undefined; if (Array.isArray(v))
|
|
2497
|
-
return v; if (typeof v === 'string') {
|
|
2498
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2499
|
-
return v;
|
|
2500
|
-
return Number(v);
|
|
2501
|
-
} return v; }), z.number().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2502
|
-
}).strict();
|
|
2503
|
-
export const svgCrossShapeSchema = svgshapesSvgCrossShapeSchema;
|
|
2504
|
-
/**
|
|
2505
|
-
* An ellipse (oval) shape with separate horizontal and vertical radii.
|
|
2506
|
-
* The ellipse is centered at the shape's position.
|
|
2507
|
-
*
|
|
2508
|
-
*/
|
|
2509
|
-
export const svgshapesSvgEllipseShapeSchema = z.object({
|
|
2510
|
-
type: z.enum(['ellipse']),
|
|
2511
|
-
radiusX: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2512
|
-
return undefined; if (Array.isArray(v))
|
|
2513
|
-
return v; if (typeof v === 'string') {
|
|
2514
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2515
|
-
return v;
|
|
2516
|
-
return Number(v);
|
|
2517
|
-
} return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2518
|
-
radiusY: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2519
|
-
return undefined; if (Array.isArray(v))
|
|
2520
|
-
return v; if (typeof v === 'string') {
|
|
2521
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2522
|
-
return v;
|
|
2523
|
-
return Number(v);
|
|
2524
|
-
} return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2525
|
-
}).strict();
|
|
2526
|
-
export const svgEllipseShapeSchema = svgshapesSvgEllipseShapeSchema;
|
|
2527
|
-
/**
|
|
2528
|
-
* A heart shape commonly used for love/like icons.
|
|
2529
|
-
* The heart is defined by a single size parameter.
|
|
2530
|
-
*
|
|
2531
|
-
*/
|
|
2532
|
-
export const svgshapesSvgHeartShapeSchema = z.object({
|
|
2533
|
-
type: z.enum(['heart']),
|
|
2534
|
-
size: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2535
|
-
return undefined; if (Array.isArray(v))
|
|
2536
|
-
return v; if (typeof v === 'string') {
|
|
2537
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2538
|
-
return v;
|
|
2539
|
-
return Number(v);
|
|
2540
|
-
} return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2541
|
-
}).strict();
|
|
2542
|
-
export const svgHeartShapeSchema = svgshapesSvgHeartShapeSchema;
|
|
2543
|
-
/**
|
|
2544
|
-
* A straight line shape with a specified length and thickness.
|
|
2545
|
-
* The line is drawn horizontally by default and can be rotated using transform.
|
|
2546
|
-
*
|
|
2547
|
-
*/
|
|
2548
|
-
export const svgshapesSvgLineShapeSchema = z.object({
|
|
2549
|
-
type: z.enum(['line']),
|
|
2550
|
-
length: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2551
|
-
return undefined; if (Array.isArray(v))
|
|
2552
|
-
return v; if (typeof v === 'string') {
|
|
2553
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2554
|
-
return v;
|
|
2555
|
-
return Number(v);
|
|
2556
|
-
} return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2557
|
-
thickness: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2558
|
-
return undefined; if (Array.isArray(v))
|
|
2559
|
-
return v; if (typeof v === 'string') {
|
|
2560
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2561
|
-
return v;
|
|
2562
|
-
return Number(v);
|
|
2563
|
-
} return v; }), z.number().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2564
|
-
}).strict();
|
|
2565
|
-
export const svgLineShapeSchema = svgshapesSvgLineShapeSchema;
|
|
2566
|
-
/**
|
|
2567
|
-
* A custom shape defined by SVG path data.
|
|
2568
|
-
* Supports all standard SVG path commands for creating complex shapes.
|
|
2569
|
-
*
|
|
2570
|
-
* **Path Commands:**
|
|
2571
|
-
* - `M x y` / `m dx dy` - Move to (absolute/relative)
|
|
2572
|
-
* - `L x y` / `l dx dy` - Line to
|
|
2573
|
-
* - `H x` / `h dx` - Horizontal line to
|
|
2574
|
-
* - `V y` / `v dy` - Vertical line to
|
|
2575
|
-
* - `C x1 y1 x2 y2 x y` / `c` - Cubic Bezier curve
|
|
2576
|
-
* - `S x2 y2 x y` / `s` - Smooth cubic Bezier
|
|
2577
|
-
* - `Q x1 y1 x y` / `q` - Quadratic Bezier curve
|
|
2578
|
-
* - `T x y` / `t` - Smooth quadratic Bezier
|
|
2579
|
-
* - `A rx ry angle large-arc sweep x y` / `a` - Elliptical arc
|
|
2580
|
-
* - `Z` / `z` - Close path
|
|
2581
|
-
*
|
|
2582
|
-
*/
|
|
2583
|
-
export const svgshapesSvgPathShapeSchema = z.object({
|
|
2584
|
-
type: z.enum(['path']),
|
|
2585
|
-
d: z.string().min(1).max(100000)
|
|
2586
|
-
}).strict();
|
|
2587
|
-
export const svgPathShapeSchema = svgshapesSvgPathShapeSchema;
|
|
2588
|
-
/**
|
|
2589
|
-
* A regular polygon shape with a specified number of sides.
|
|
2590
|
-
* Examples: triangle (3), square (4), pentagon (5), hexagon (6), etc.
|
|
2591
|
-
* The polygon is inscribed in a circle of the given radius.
|
|
2592
|
-
*
|
|
2593
|
-
*/
|
|
2594
|
-
export const svgshapesSvgPolygonShapeSchema = z.object({
|
|
2595
|
-
type: z.enum(['polygon']),
|
|
2596
|
-
sides: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2597
|
-
return undefined; if (Array.isArray(v))
|
|
2598
|
-
return v; if (typeof v === 'string') {
|
|
2599
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2600
|
-
return v;
|
|
2601
|
-
return Number(v);
|
|
2602
|
-
} return v; }), z.number().int().gte(3).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2603
|
-
radius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2604
|
-
return undefined; if (Array.isArray(v))
|
|
2605
|
-
return v; if (typeof v === 'string') {
|
|
2606
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2607
|
-
return v;
|
|
2608
|
-
return Number(v);
|
|
2609
|
-
} return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2610
|
-
}).strict();
|
|
2611
|
-
export const svgPolygonShapeSchema = svgshapesSvgPolygonShapeSchema;
|
|
2612
|
-
/**
|
|
2613
|
-
* A rectangle shape with optional rounded corners.
|
|
2614
|
-
* The rectangle is defined by its width and height dimensions.
|
|
2615
|
-
*
|
|
2616
|
-
*/
|
|
2617
|
-
export const svgshapesSvgRectangleShapeSchema = z.object({
|
|
2618
|
-
type: z.enum(['rectangle']),
|
|
2619
|
-
width: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2620
|
-
return undefined; if (Array.isArray(v))
|
|
2621
|
-
return v; if (typeof v === 'string') {
|
|
2622
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2623
|
-
return v;
|
|
2624
|
-
return Number(v);
|
|
2625
|
-
} return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2626
|
-
height: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2627
|
-
return undefined; if (Array.isArray(v))
|
|
2628
|
-
return v; if (typeof v === 'string') {
|
|
2629
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2630
|
-
return v;
|
|
2631
|
-
return Number(v);
|
|
2632
|
-
} return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2633
|
-
cornerRadius: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2634
|
-
return undefined; if (Array.isArray(v))
|
|
2635
|
-
return v; if (typeof v === 'string') {
|
|
2636
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2637
|
-
return v;
|
|
2638
|
-
return Number(v);
|
|
2639
|
-
} return v; }), z.number().gte(0).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)
|
|
2640
|
-
}).strict();
|
|
2641
|
-
export const svgRectangleShapeSchema = svgshapesSvgRectangleShapeSchema;
|
|
2642
|
-
/**
|
|
2643
|
-
* A ring (donut/annulus) shape - a circle with a circular hole in the center.
|
|
2644
|
-
* The ring is defined by outer and inner radii.
|
|
2645
|
-
*
|
|
2646
|
-
*/
|
|
2647
|
-
export const svgshapesSvgRingShapeSchema = z.object({
|
|
2648
|
-
type: z.enum(['ring']),
|
|
2649
|
-
outerRadius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2650
|
-
return undefined; if (Array.isArray(v))
|
|
2651
|
-
return v; if (typeof v === 'string') {
|
|
2652
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2653
|
-
return v;
|
|
2654
|
-
return Number(v);
|
|
2655
|
-
} return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2656
|
-
innerRadius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2657
|
-
return undefined; if (Array.isArray(v))
|
|
2658
|
-
return v; if (typeof v === 'string') {
|
|
2659
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2660
|
-
return v;
|
|
2661
|
-
return Number(v);
|
|
2662
|
-
} return v; }), z.number().gte(0).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2663
|
-
}).strict();
|
|
2664
|
-
export const svgRingShapeSchema = svgshapesSvgRingShapeSchema;
|
|
2665
|
-
/**
|
|
2666
|
-
* A star shape with a specified number of points.
|
|
2667
|
-
* The star is defined by outer and inner radii, creating the characteristic
|
|
2668
|
-
* pointed appearance.
|
|
2669
|
-
*
|
|
2670
|
-
*/
|
|
2671
|
-
export const svgshapesSvgStarShapeSchema = z.object({
|
|
2672
|
-
type: z.enum(['star']),
|
|
2673
|
-
points: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2674
|
-
return undefined; if (Array.isArray(v))
|
|
2675
|
-
return v; if (typeof v === 'string') {
|
|
2676
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2677
|
-
return v;
|
|
2678
|
-
return Number(v);
|
|
2679
|
-
} return v; }), z.number().int().gte(3).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2680
|
-
outerRadius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2681
|
-
return undefined; if (Array.isArray(v))
|
|
2682
|
-
return v; if (typeof v === 'string') {
|
|
2683
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2684
|
-
return v;
|
|
2685
|
-
return Number(v);
|
|
2686
|
-
} return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2687
|
-
innerRadius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2688
|
-
return undefined; if (Array.isArray(v))
|
|
2689
|
-
return v; if (typeof v === 'string') {
|
|
2690
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2691
|
-
return v;
|
|
2692
|
-
return Number(v);
|
|
2693
|
-
} return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2694
|
-
}).strict();
|
|
2695
|
-
export const svgStarShapeSchema = svgshapesSvgStarShapeSchema;
|
|
2696
|
-
/**
|
|
2697
|
-
* The shape definition for an SVG asset. Each shape type has its own specific
|
|
2698
|
-
* properties. The `type` field determines which shape is rendered.
|
|
2699
|
-
*
|
|
2700
|
-
*/
|
|
2701
|
-
export const svgshapesSvgShapeSchema = z.discriminatedUnion("type", [
|
|
2702
|
-
svgshapesSvgRectangleShapeSchema,
|
|
2703
|
-
svgshapesSvgCircleShapeSchema,
|
|
2704
|
-
svgshapesSvgEllipseShapeSchema,
|
|
2705
|
-
svgshapesSvgLineShapeSchema,
|
|
2706
|
-
svgshapesSvgPolygonShapeSchema,
|
|
2707
|
-
svgshapesSvgStarShapeSchema,
|
|
2708
|
-
svgshapesSvgArrowShapeSchema,
|
|
2709
|
-
svgshapesSvgHeartShapeSchema,
|
|
2710
|
-
svgshapesSvgCrossShapeSchema,
|
|
2711
|
-
svgshapesSvgRingShapeSchema,
|
|
2712
|
-
svgshapesSvgPathShapeSchema,
|
|
2713
|
-
]);
|
|
2714
|
-
export const svgShapeSchema = svgshapesSvgShapeSchema;
|
|
2715
|
-
/**
|
|
2716
|
-
* The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.
|
|
2717
|
-
* It provides two mutually exclusive ways to define shapes:
|
|
2718
|
-
*
|
|
2719
|
-
* **Option 1: Import SVG markup using `src`**
|
|
2720
|
-
* ```json
|
|
2721
|
-
* {
|
|
2722
|
-
* "type": "svg",
|
|
2723
|
-
* "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
|
|
2724
|
-
* }
|
|
2725
|
-
* ```
|
|
2726
|
-
* When using `src`, no other properties are allowed. The fill, stroke, and dimensions
|
|
2727
|
-
* are automatically extracted from the SVG markup.
|
|
2728
|
-
*
|
|
2729
|
-
* **Option 2: Define shapes programmatically using `shape`**
|
|
2730
|
-
* ```json
|
|
2731
|
-
* {
|
|
2732
|
-
* "type": "svg",
|
|
2733
|
-
* "shape": { "type": "circle", "radius": 50 },
|
|
2734
|
-
* "fill": { "type": "solid", "color": "#FF0000" }
|
|
2735
|
-
* }
|
|
2736
|
-
* ```
|
|
2737
|
-
* When using `shape`, you can customize fill, stroke, shadow, transform, and other properties.
|
|
2738
|
-
* The `src` property is not allowed in this mode.
|
|
2739
|
-
*
|
|
2740
|
-
* **Important:** You must provide either `src` OR `shape`, but not both.
|
|
2741
|
-
* These two modes are mutually exclusive.
|
|
2742
|
-
*
|
|
2743
|
-
* **Available Shapes (Option 2 only):**
|
|
2744
|
-
* - `rectangle` - Rectangles with optional rounded corners
|
|
2745
|
-
* - `circle` - Perfect circles
|
|
2746
|
-
* - `ellipse` - Ellipses/ovals with separate x and y radii
|
|
2747
|
-
* - `line` - Straight lines with configurable thickness
|
|
2748
|
-
* - `polygon` - Regular polygons (triangle, pentagon, hexagon, etc.)
|
|
2749
|
-
* - `star` - Multi-pointed stars
|
|
2750
|
-
* - `arrow` - Directional arrows
|
|
2751
|
-
* - `heart` - Heart shapes
|
|
2752
|
-
* - `cross` - Plus/cross shapes
|
|
2753
|
-
* - `ring` - Donut/ring shapes
|
|
2754
|
-
* - `path` - Custom shapes using SVG path data
|
|
2755
|
-
*
|
|
2756
|
-
* See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
|
|
2757
|
-
*
|
|
2758
|
-
*/
|
|
2759
|
-
export const svgassetSvgAssetSchema = z.object({
|
|
2760
|
-
type: z.enum(["svg"]),
|
|
2761
|
-
src: z.optional(z.string().min(1).max(500000)),
|
|
2762
|
-
shape: z.optional(svgshapesSvgShapeSchema),
|
|
2763
|
-
fill: z.optional(svgpropertiesSvgFillSchema),
|
|
2764
|
-
stroke: z.optional(svgpropertiesSvgStrokeSchema),
|
|
2765
|
-
shadow: z.optional(svgpropertiesSvgShadowSchema),
|
|
2766
|
-
transform: z.optional(svgpropertiesSvgTransformSchema),
|
|
2767
|
-
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2768
|
-
return undefined; if (Array.isArray(v))
|
|
2769
|
-
return v; if (typeof v === 'string') {
|
|
2770
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2771
|
-
return v;
|
|
2772
|
-
return Number(v);
|
|
2773
|
-
} return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2774
|
-
width: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2775
|
-
return undefined; if (Array.isArray(v))
|
|
2776
|
-
return v; if (typeof v === 'string') {
|
|
2777
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2778
|
-
return v;
|
|
2779
|
-
return Number(v);
|
|
2780
|
-
} return v; }), z.number().int().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2781
|
-
height: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2782
|
-
return undefined; if (Array.isArray(v))
|
|
2783
|
-
return v; if (typeof v === 'string') {
|
|
2784
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2785
|
-
return v;
|
|
2786
|
-
return Number(v);
|
|
2787
|
-
} return v; }), z.number().int().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2788
|
-
}).strict().superRefine((data, ctx) => {
|
|
2789
|
-
const hasShape = data.shape !== undefined;
|
|
2790
|
-
const hasSrc = data.src !== undefined && data.src.trim() !== "";
|
|
2791
|
-
if (!hasShape && !hasSrc) {
|
|
2792
|
-
ctx.addIssue({
|
|
2793
|
-
code: z.ZodIssueCode.custom,
|
|
2794
|
-
message: "Either 'src' or 'shape' must be provided",
|
|
2795
|
-
path: [],
|
|
2796
|
-
});
|
|
2797
|
-
}
|
|
2798
|
-
if (hasShape && hasSrc) {
|
|
2799
|
-
ctx.addIssue({
|
|
2800
|
-
code: z.ZodIssueCode.custom,
|
|
2801
|
-
message: "Provide either 'src' or 'shape', not both",
|
|
2802
|
-
path: ["src"],
|
|
2803
|
-
});
|
|
2804
|
-
}
|
|
2805
|
-
if (hasSrc) {
|
|
2806
|
-
const disallowedProps = ["shape", "fill", "stroke", "shadow", "transform", "width", "height"];
|
|
2807
|
-
for (const prop of disallowedProps) {
|
|
2808
|
-
if (data[prop] !== undefined) {
|
|
2809
|
-
ctx.addIssue({
|
|
2810
|
-
code: z.ZodIssueCode.custom,
|
|
2811
|
-
message: `'${prop}' is not allowed when using 'src'. Only 'type' and 'src' are allowed in import mode`,
|
|
2812
|
-
path: [prop],
|
|
2813
|
-
});
|
|
2814
|
-
}
|
|
2815
|
-
}
|
|
2816
|
-
}
|
|
2817
|
-
});
|
|
2818
|
-
export const svgAssetSchema = svgassetSvgAssetSchema;
|
|
2819
|
-
/**
|
|
2820
|
-
* Configure the id and optional merge fields to render a template by id.
|
|
2821
|
-
*/
|
|
2822
|
-
export const templaterenderTemplateRenderSchema = z.object({
|
|
2823
|
-
id: z.string(),
|
|
2824
|
-
merge: z.optional(z.array(mergefieldMergeFieldSchema))
|
|
2825
|
-
}).strict();
|
|
2826
|
-
export const templateRenderSchema = templaterenderTemplateRenderSchema;
|
|
2827
|
-
/**
|
|
2828
|
-
* Horizontal and vertical alignment properties for text.
|
|
2829
|
-
*/
|
|
2830
|
-
export const textpropertiesTextAlignmentSchema = z.object({
|
|
2831
|
-
horizontal: z.optional(z.enum([
|
|
2832
|
-
'left',
|
|
2833
|
-
'center',
|
|
2834
|
-
'right'
|
|
2835
|
-
])),
|
|
2836
|
-
vertical: z.optional(z.enum([
|
|
2837
|
-
'top',
|
|
2838
|
-
'center',
|
|
2839
|
-
'bottom'
|
|
2840
|
-
]))
|
|
2841
|
-
}).strict();
|
|
2842
|
-
export const textAlignmentSchema = textpropertiesTextAlignmentSchema;
|
|
2843
|
-
/**
|
|
2844
|
-
* Animation properties for text entrance effects.
|
|
2845
|
-
*/
|
|
2846
|
-
export const textpropertiesTextAnimationSchema = z.object({
|
|
2847
|
-
preset: z.enum(['typewriter']),
|
|
2848
|
-
duration: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2849
|
-
return undefined; if (Array.isArray(v))
|
|
2850
|
-
return v; if (typeof v === 'string') {
|
|
2851
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2852
|
-
return v;
|
|
2853
|
-
return Number(v);
|
|
2854
|
-
} return v; }), z.number().gte(0.1).lte(30)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
2855
|
-
}).strict();
|
|
2856
|
-
/**
|
|
2857
|
-
* Displays a background box behind the text.
|
|
2858
|
-
*/
|
|
2859
|
-
export const textpropertiesTextBackgroundSchema = z.object({
|
|
2860
|
-
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2861
|
-
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2862
|
-
return undefined; if (Array.isArray(v))
|
|
2863
|
-
return v; if (typeof v === 'string') {
|
|
2864
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2865
|
-
return v;
|
|
2866
|
-
return Number(v);
|
|
2867
|
-
} return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2868
|
-
padding: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2869
|
-
return undefined; if (Array.isArray(v))
|
|
2870
|
-
return v; if (typeof v === 'string') {
|
|
2871
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2872
|
-
return v;
|
|
2873
|
-
return Number(v);
|
|
2874
|
-
} return v; }), z.number().gte(0).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2875
|
-
borderRadius: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2876
|
-
return undefined; if (Array.isArray(v))
|
|
2877
|
-
return v; if (typeof v === 'string') {
|
|
2878
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2879
|
-
return v;
|
|
2880
|
-
return Number(v);
|
|
2881
|
-
} return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
2882
|
-
}).strict();
|
|
2883
|
-
export const textBackgroundSchema = textpropertiesTextBackgroundSchema;
|
|
2884
|
-
/**
|
|
2885
|
-
* Font properties for text.
|
|
2886
|
-
*/
|
|
2887
|
-
export const textpropertiesTextFontSchema = z.object({
|
|
2888
|
-
family: z.optional(z.string()),
|
|
2889
|
-
color: z.optional(z.string()),
|
|
2890
|
-
opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2891
|
-
return undefined; if (Array.isArray(v))
|
|
2892
|
-
return v; if (typeof v === 'string') {
|
|
2893
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2894
|
-
return v;
|
|
2895
|
-
return Number(v);
|
|
2896
|
-
} return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2897
|
-
size: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2898
|
-
return undefined; if (Array.isArray(v))
|
|
2899
|
-
return v; if (typeof v === 'string') {
|
|
2900
|
-
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
2901
|
-
return v;
|
|
2902
|
-
return Number(v);
|
|
2903
|
-
} return v; }), z.number().int()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2904
|
-
weight: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
1737
|
+
} return v; }), z.number().int()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1738
|
+
weight: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
|
|
2905
1739
|
return undefined; if (Array.isArray(v))
|
|
2906
1740
|
return v; if (typeof v === 'string') {
|
|
2907
1741
|
if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
|
|
@@ -3956,23 +2790,3 @@ export const getUploadSignedUrlRequest = z.object({
|
|
|
3956
2790
|
* The id and signed URL to upload to.
|
|
3957
2791
|
*/
|
|
3958
2792
|
export const getUploadSignedUrlResponse = uploadresponseUploadResponseSchema;
|
|
3959
|
-
export const postGenerateAssetRequest = z.object({
|
|
3960
|
-
body: generatedAssetGeneratedAssetSchema,
|
|
3961
|
-
path: z.optional(z.never()),
|
|
3962
|
-
query: z.optional(z.never())
|
|
3963
|
-
}).strict();
|
|
3964
|
-
/**
|
|
3965
|
-
* The generated asset details
|
|
3966
|
-
*/
|
|
3967
|
-
export const postGenerateAssetResponse = generatedAssetResponseGeneratedAssetResponseSchema;
|
|
3968
|
-
export const getGeneratedAssetRequest = z.object({
|
|
3969
|
-
body: z.optional(z.never()),
|
|
3970
|
-
path: z.object({
|
|
3971
|
-
id: z.union([z.string().regex(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
3972
|
-
}),
|
|
3973
|
-
query: z.optional(z.never())
|
|
3974
|
-
}).strict();
|
|
3975
|
-
/**
|
|
3976
|
-
* The generated asset details
|
|
3977
|
-
*/
|
|
3978
|
-
export const getGeneratedAssetResponse = generatedAssetResponseGeneratedAssetResponseSchema;
|