@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.ts
CHANGED
|
@@ -12,10 +12,6 @@ export const assetsidRootSchema = z.unknown();
|
|
|
12
12
|
|
|
13
13
|
export const assetsrenderidRootSchema = z.unknown();
|
|
14
14
|
|
|
15
|
-
export const generateassetRootSchema = z.unknown();
|
|
16
|
-
|
|
17
|
-
export const generateassetidRootSchema = z.unknown();
|
|
18
|
-
|
|
19
15
|
export const probeRootSchema = z.unknown();
|
|
20
16
|
|
|
21
17
|
export const renderRootSchema = z.unknown();
|
|
@@ -107,597 +103,6 @@ export const chromakeyChromaKeySchema = z.object({
|
|
|
107
103
|
|
|
108
104
|
export const chromaKeySchema = chromakeyChromaKeySchema;
|
|
109
105
|
|
|
110
|
-
/**
|
|
111
|
-
* 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.
|
|
112
|
-
*/
|
|
113
|
-
export const didTextToAvatarOptionsDidTextToAvatarOptionsSchema = z.object({
|
|
114
|
-
type: z.enum(['text-to-avatar']),
|
|
115
|
-
text: z.string(),
|
|
116
|
-
avatar: z.enum([
|
|
117
|
-
'jack',
|
|
118
|
-
'lana',
|
|
119
|
-
'lily',
|
|
120
|
-
'matt',
|
|
121
|
-
'rian'
|
|
122
|
-
]),
|
|
123
|
-
background: z.optional(z.string())
|
|
124
|
-
}).strict();
|
|
125
|
-
|
|
126
|
-
export const didTextToAvatarOptionsSchema = didTextToAvatarOptionsDidTextToAvatarOptionsSchema;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Generate assets using the third party D-ID provider AI services.
|
|
130
|
-
*
|
|
131
|
-
* The following AI generation services are available: <ul>
|
|
132
|
-
* <li><a href="#tocs_didtexttoavataroptions">DidTextToAvatarOptions</a></li>
|
|
133
|
-
* </ul>
|
|
134
|
-
*/
|
|
135
|
-
export const didGeneratedAssetOptionsDidGeneratedAssetOptionsSchema = z.object({
|
|
136
|
-
type: z.literal('didTextToAvatarOptions_DIDTextToAvatarOptions')
|
|
137
|
-
}).strict().and(didTextToAvatarOptionsDidTextToAvatarOptionsSchema);
|
|
138
|
-
|
|
139
|
-
export const didGeneratedAssetOptionsSchema = didGeneratedAssetOptionsDidGeneratedAssetOptionsSchema;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* 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.
|
|
143
|
-
*/
|
|
144
|
-
export const didGeneratedAssetDidGeneratedAssetSchema = z.object({
|
|
145
|
-
provider: z.enum(['d-id']),
|
|
146
|
-
options: didGeneratedAssetOptionsDidGeneratedAssetOptionsSchema
|
|
147
|
-
}).strict();
|
|
148
|
-
|
|
149
|
-
export const didGeneratedAssetSchema = didGeneratedAssetDidGeneratedAssetSchema;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* 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.
|
|
153
|
-
*/
|
|
154
|
-
export const elevenlabsTextToSpeechOptionsElevenLabsTextToSpeechOptionsSchema = z.object({
|
|
155
|
-
type: z.enum(['text-to-speech']),
|
|
156
|
-
text: z.string(),
|
|
157
|
-
voice: z.enum([
|
|
158
|
-
'Adam',
|
|
159
|
-
'Antoni',
|
|
160
|
-
'Arnold',
|
|
161
|
-
'Bella',
|
|
162
|
-
'Domi',
|
|
163
|
-
'Elli',
|
|
164
|
-
'Josh',
|
|
165
|
-
'Rachel',
|
|
166
|
-
'Sam'
|
|
167
|
-
])
|
|
168
|
-
}).strict();
|
|
169
|
-
|
|
170
|
-
export const elevenLabsTextToSpeechOptionsSchema = elevenlabsTextToSpeechOptionsElevenLabsTextToSpeechOptionsSchema;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Generate assets using the third party ElevenLabs provider AI services.
|
|
174
|
-
*
|
|
175
|
-
* The following AI generation services are available: <ul>
|
|
176
|
-
* <li><a href="#tocs_elevenlabstexttospeechoptions">ElevenLabsTextToSpeechOptions</a></li>
|
|
177
|
-
* </ul>
|
|
178
|
-
*/
|
|
179
|
-
export const elevenlabsGeneratedAssetOptionsElevenLabsGeneratedAssetOptionsSchema = z.object({
|
|
180
|
-
type: z.literal('elevenlabsTextToSpeechOptions_ElevenLabsTextToSpeechOptions')
|
|
181
|
-
}).strict().and(elevenlabsTextToSpeechOptionsElevenLabsTextToSpeechOptionsSchema);
|
|
182
|
-
|
|
183
|
-
export const elevenLabsGeneratedAssetOptionsSchema = elevenlabsGeneratedAssetOptionsElevenLabsGeneratedAssetOptionsSchema;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* 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.
|
|
187
|
-
*/
|
|
188
|
-
export const elevenlabsGeneratedAssetElevenLabsGeneratedAssetSchema = z.object({
|
|
189
|
-
provider: z.enum(['elevenlabs']),
|
|
190
|
-
options: elevenlabsGeneratedAssetOptionsElevenLabsGeneratedAssetOptionsSchema
|
|
191
|
-
}).strict();
|
|
192
|
-
|
|
193
|
-
export const elevenLabsGeneratedAssetSchema = elevenlabsGeneratedAssetElevenLabsGeneratedAssetSchema;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* 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.
|
|
197
|
-
*/
|
|
198
|
-
export const heygenTextToAvatarOptionsHeyGenTextToAvatarOptionsSchema = z.object({
|
|
199
|
-
type: z.enum(['text-to-avatar']),
|
|
200
|
-
text: z.string(),
|
|
201
|
-
avatar: z.enum([
|
|
202
|
-
'Angela',
|
|
203
|
-
'Bill',
|
|
204
|
-
'Daisy',
|
|
205
|
-
'Derek',
|
|
206
|
-
'Eva',
|
|
207
|
-
'Jake',
|
|
208
|
-
'Jeff',
|
|
209
|
-
'Jerome',
|
|
210
|
-
'Joon',
|
|
211
|
-
'Kayla',
|
|
212
|
-
'Kent',
|
|
213
|
-
'Luna',
|
|
214
|
-
'Mark',
|
|
215
|
-
'Matthew',
|
|
216
|
-
'Monica',
|
|
217
|
-
'Peter',
|
|
218
|
-
'Selina',
|
|
219
|
-
'Tanya',
|
|
220
|
-
'Thomas',
|
|
221
|
-
'Tina',
|
|
222
|
-
'Tyler',
|
|
223
|
-
'Vanessa',
|
|
224
|
-
'Vera',
|
|
225
|
-
'Wilson',
|
|
226
|
-
'Zoey'
|
|
227
|
-
]),
|
|
228
|
-
voice: z.enum([
|
|
229
|
-
'Abbi - Natural',
|
|
230
|
-
'Adam - Natural',
|
|
231
|
-
'Aiston - Friendly',
|
|
232
|
-
'Alice - Newscaster',
|
|
233
|
-
'Alison - Cheerful',
|
|
234
|
-
'Amber - Friendly',
|
|
235
|
-
'Amy - Warm',
|
|
236
|
-
'Ana - Cheerful',
|
|
237
|
-
'Antoni - Friendly',
|
|
238
|
-
'Aria - Newscaster',
|
|
239
|
-
'Arnold - Cheerful',
|
|
240
|
-
'Arthur - Natural',
|
|
241
|
-
'Bella - Friendly',
|
|
242
|
-
'Belle - Natural',
|
|
243
|
-
'Brandon - Warm',
|
|
244
|
-
'Brian - Natural',
|
|
245
|
-
'Bruce - Natural',
|
|
246
|
-
'Cerise - Cheerful',
|
|
247
|
-
'Christopher - Calm',
|
|
248
|
-
'Clara - Professional',
|
|
249
|
-
'Connor - Natural',
|
|
250
|
-
'Dahlia - Friendly',
|
|
251
|
-
'Davis - Professional',
|
|
252
|
-
'Dean - Natural',
|
|
253
|
-
'Delbert - Cheerful',
|
|
254
|
-
'Edward - Friendly',
|
|
255
|
-
'Elaine - Calm',
|
|
256
|
-
'Emily - Natural',
|
|
257
|
-
'Emma - Newscaster',
|
|
258
|
-
'Eric - Newscaster',
|
|
259
|
-
'Grace - Natural',
|
|
260
|
-
'Hailey - Calm',
|
|
261
|
-
'Indira - Cheerful',
|
|
262
|
-
'Isabella - Cheerful',
|
|
263
|
-
'Jacob - Natural',
|
|
264
|
-
'Jahmai - Friendly',
|
|
265
|
-
'Jane - Serious',
|
|
266
|
-
'Jason - Serious',
|
|
267
|
-
'Jelle - Friendly',
|
|
268
|
-
'Jen - Natural',
|
|
269
|
-
'Jenny - Professional',
|
|
270
|
-
'Jodi - Cheerful',
|
|
271
|
-
'Joey - Calm',
|
|
272
|
-
'Johan - Friendly',
|
|
273
|
-
'Josie - Cheerful',
|
|
274
|
-
'Keanan - Natural',
|
|
275
|
-
'Keith - Cheerful',
|
|
276
|
-
'Kellie - Friendly',
|
|
277
|
-
'Lauren - Friendly',
|
|
278
|
-
'Leah - Natural',
|
|
279
|
-
'Liam - Professional',
|
|
280
|
-
'Libby - Natural',
|
|
281
|
-
'Lily - Professional',
|
|
282
|
-
'Lucas - Natural',
|
|
283
|
-
'Luke - Professional',
|
|
284
|
-
'Luna - Natural',
|
|
285
|
-
'Marieke - Natural',
|
|
286
|
-
'Matthew - Professional',
|
|
287
|
-
'Michelle - Natural',
|
|
288
|
-
'Mitchell - Natural',
|
|
289
|
-
'Molly - Newscaster',
|
|
290
|
-
'Monica - Calm',
|
|
291
|
-
'Natasha - Professional',
|
|
292
|
-
'Neerja - Newscaster',
|
|
293
|
-
'Noah - Serious',
|
|
294
|
-
'Oliver - Newscaster',
|
|
295
|
-
'Olivia - Calm',
|
|
296
|
-
'Paul - Natural',
|
|
297
|
-
'Prabhat - Natural',
|
|
298
|
-
'Raveena - Natural',
|
|
299
|
-
'Rudi - Friendly',
|
|
300
|
-
'Ryan - Professional',
|
|
301
|
-
'Sam - Natural',
|
|
302
|
-
'Sara - Cheerful',
|
|
303
|
-
'Sherry - Friendly',
|
|
304
|
-
'Sonia - Warm',
|
|
305
|
-
'Thomas - Natural',
|
|
306
|
-
'Todd - Professional',
|
|
307
|
-
'Tony - Professional',
|
|
308
|
-
'Tracy - Cheerful',
|
|
309
|
-
'Wayne - Natural',
|
|
310
|
-
'Wilder - Natural',
|
|
311
|
-
'Wille - Natural',
|
|
312
|
-
'William - Friendly'
|
|
313
|
-
]),
|
|
314
|
-
avatarStyle: z.optional(z.enum(['normal', 'circle'])),
|
|
315
|
-
background: z.optional(z.string()),
|
|
316
|
-
ratio: z.optional(z.enum(['16:9', '9:16'])),
|
|
317
|
-
test: z.optional(z.boolean())
|
|
318
|
-
}).strict();
|
|
319
|
-
|
|
320
|
-
export const heyGenTextToAvatarOptionsSchema = heygenTextToAvatarOptionsHeyGenTextToAvatarOptionsSchema;
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Generate assets using the third party HeyGen provider AI services.
|
|
324
|
-
*
|
|
325
|
-
* The following AI generation services are available: <ul>
|
|
326
|
-
* <li><a href="#tocs_heygentexttoavataroptions">HeyGenTextToAvatarOptions</a></li>
|
|
327
|
-
* </ul>
|
|
328
|
-
*/
|
|
329
|
-
export const heygenGeneratedAssetOptionsHeyGenGeneratedAssetOptionsSchema = z.object({
|
|
330
|
-
type: z.literal('heygenTextToAvatarOptions_HeyGenTextToAvatarOptions')
|
|
331
|
-
}).strict().and(heygenTextToAvatarOptionsHeyGenTextToAvatarOptionsSchema);
|
|
332
|
-
|
|
333
|
-
export const heyGenGeneratedAssetOptionsSchema = heygenGeneratedAssetOptionsHeyGenGeneratedAssetOptionsSchema;
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* 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.
|
|
337
|
-
*/
|
|
338
|
-
export const heygenGeneratedAssetHeyGenGeneratedAssetSchema = z.object({
|
|
339
|
-
provider: z.enum(['heygen']),
|
|
340
|
-
options: heygenGeneratedAssetOptionsHeyGenGeneratedAssetOptionsSchema
|
|
341
|
-
}).strict();
|
|
342
|
-
|
|
343
|
-
export const heyGenGeneratedAssetSchema = heygenGeneratedAssetHeyGenGeneratedAssetSchema;
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* 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.
|
|
347
|
-
*/
|
|
348
|
-
export const openaiTextGeneratorOptionsOpenAiTextGeneratorOptionsSchema = z.object({
|
|
349
|
-
type: z.enum(['text-generator']),
|
|
350
|
-
prompt: z.string(),
|
|
351
|
-
model: z.enum(['gpt-3.5-turbo', 'gpt-4']),
|
|
352
|
-
systemPrompt: z.optional(z.string())
|
|
353
|
-
}).strict();
|
|
354
|
-
|
|
355
|
-
export const openAiTextGeneratorOptionsSchema = openaiTextGeneratorOptionsOpenAiTextGeneratorOptionsSchema;
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* Generate assets using OpenAI provider AI services.
|
|
359
|
-
*
|
|
360
|
-
* The following AI generation services are available: <ul>
|
|
361
|
-
* <li><a href="#tocs_openaitextgeneratoroptions">OpenAiTextGeneratorOptions</a></li>
|
|
362
|
-
* </ul>
|
|
363
|
-
*/
|
|
364
|
-
export const openaiGeneratedAssetOptionsOpenAiGeneratedAssetOptionsSchema = z.object({
|
|
365
|
-
type: z.literal('openaiTextGeneratorOptions_OpenAiTextGeneratorOptions')
|
|
366
|
-
}).strict().and(openaiTextGeneratorOptionsOpenAiTextGeneratorOptionsSchema);
|
|
367
|
-
|
|
368
|
-
export const openAiGeneratedAssetOptionsSchema = openaiGeneratedAssetOptionsOpenAiGeneratedAssetOptionsSchema;
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* 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.
|
|
372
|
-
*/
|
|
373
|
-
export const openaiGeneratedAssetOpenAiGeneratedAssetSchema = z.object({
|
|
374
|
-
provider: z.enum(['openai']),
|
|
375
|
-
options: openaiGeneratedAssetOptionsOpenAiGeneratedAssetOptionsSchema
|
|
376
|
-
}).strict();
|
|
377
|
-
|
|
378
|
-
export const openAiGeneratedAssetSchema = openaiGeneratedAssetOpenAiGeneratedAssetSchema;
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Individual errors returned by the Create API.
|
|
382
|
-
*/
|
|
383
|
-
export const generatedAssetErrorResponseDataGeneratedAssetErrorResponseDataSchema = z.object({
|
|
384
|
-
status: z.string(),
|
|
385
|
-
title: z.string(),
|
|
386
|
-
detail: z.string()
|
|
387
|
-
}).strict();
|
|
388
|
-
|
|
389
|
-
export const generatedAssetErrorResponseDataSchema = generatedAssetErrorResponseDataGeneratedAssetErrorResponseDataSchema;
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Error response data for validation and other errors returned by the Create API.
|
|
393
|
-
*/
|
|
394
|
-
export const generatedAssetErrorResponseGeneratedAssetErrorResponseSchema = z.object({
|
|
395
|
-
errors: z.array(generatedAssetErrorResponseDataGeneratedAssetErrorResponseDataSchema)
|
|
396
|
-
}).strict();
|
|
397
|
-
|
|
398
|
-
export const generatedAssetErrorResponseSchema = generatedAssetErrorResponseGeneratedAssetErrorResponseSchema;
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* The id and attributes of the generated asset.
|
|
402
|
-
*/
|
|
403
|
-
export const generatedAssetResponseAttributesGeneratedAssetResponseAttributesSchema = z.object({
|
|
404
|
-
owner: z.string(),
|
|
405
|
-
provider: z.enum([
|
|
406
|
-
'shotstack',
|
|
407
|
-
'elevenlabs',
|
|
408
|
-
'heygen',
|
|
409
|
-
'd-id'
|
|
410
|
-
]),
|
|
411
|
-
type: z.enum(['text-to-speech', 'text-to-avatar']),
|
|
412
|
-
url: z.optional(z.string()),
|
|
413
|
-
status: z.enum([
|
|
414
|
-
'queued',
|
|
415
|
-
'processing',
|
|
416
|
-
'saving',
|
|
417
|
-
'done',
|
|
418
|
-
'failed'
|
|
419
|
-
]),
|
|
420
|
-
created: z.string(),
|
|
421
|
-
updated: z.string()
|
|
422
|
-
}).strict();
|
|
423
|
-
|
|
424
|
-
export const generatedAssetResponseAttributesSchema = generatedAssetResponseAttributesGeneratedAssetResponseAttributesSchema;
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* The type of resource (an asset), it's id and attributes of the generated file.
|
|
428
|
-
*/
|
|
429
|
-
export const generatedAssetResponseDataGeneratedAssetResponseDataSchema = z.object({
|
|
430
|
-
type: z.string(),
|
|
431
|
-
id: z.string(),
|
|
432
|
-
attributes: generatedAssetResponseAttributesGeneratedAssetResponseAttributesSchema
|
|
433
|
-
}).strict();
|
|
434
|
-
|
|
435
|
-
export const generatedAssetResponseDataSchema = generatedAssetResponseDataGeneratedAssetResponseDataSchema;
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* 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.
|
|
439
|
-
*/
|
|
440
|
-
export const generatedAssetResponseGeneratedAssetResponseSchema = z.object({
|
|
441
|
-
data: generatedAssetResponseDataGeneratedAssetResponseDataSchema
|
|
442
|
-
}).strict();
|
|
443
|
-
|
|
444
|
-
export const generatedAssetResponseSchema = generatedAssetResponseGeneratedAssetResponseSchema;
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* 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.
|
|
448
|
-
*/
|
|
449
|
-
export const shotstackImageToVideoOptionsShotstackImageToVideoOptionsSchema = z.object({
|
|
450
|
-
type: z.enum(['image-to-video']),
|
|
451
|
-
imageUrl: z.string(),
|
|
452
|
-
guidanceScale: 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*\}\}$/)])).default(1.8),
|
|
453
|
-
motion: 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()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(127)
|
|
454
|
-
}).strict();
|
|
455
|
-
|
|
456
|
-
export const shotstackImageToVideoOptionsSchema = shotstackImageToVideoOptionsShotstackImageToVideoOptionsSchema;
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* 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.
|
|
460
|
-
*/
|
|
461
|
-
export const shotstackTextGeneratorOptionsShotstackTextGeneratorOptionsSchema = z.object({
|
|
462
|
-
type: z.enum(['text-generator']),
|
|
463
|
-
prompt: z.string()
|
|
464
|
-
}).strict();
|
|
465
|
-
|
|
466
|
-
export const shotstackTextGeneratorOptionsSchema = shotstackTextGeneratorOptionsShotstackTextGeneratorOptionsSchema;
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* 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.
|
|
470
|
-
*/
|
|
471
|
-
export const shotstackTextToImageOptionsShotstackTextToImageOptionsSchema = z.object({
|
|
472
|
-
type: z.enum(['text-to-image']),
|
|
473
|
-
prompt: z.string(),
|
|
474
|
-
width: 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()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
475
|
-
height: 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()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
476
|
-
}).strict();
|
|
477
|
-
|
|
478
|
-
export const shotstackTextToImageOptionsSchema = shotstackTextToImageOptionsShotstackTextToImageOptionsSchema;
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* 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.
|
|
482
|
-
*/
|
|
483
|
-
export const shotstackTextToSpeechOptionsShotstackTextToSpeechOptionsSchema = z.object({
|
|
484
|
-
type: z.enum(['text-to-speech']),
|
|
485
|
-
text: z.string(),
|
|
486
|
-
voice: z.enum([
|
|
487
|
-
'Hala',
|
|
488
|
-
'Lisa',
|
|
489
|
-
'Arlet',
|
|
490
|
-
'Hiujin',
|
|
491
|
-
'Zhiyu',
|
|
492
|
-
'Sofie',
|
|
493
|
-
'Laura',
|
|
494
|
-
'Olivia',
|
|
495
|
-
'Amy',
|
|
496
|
-
'Emma',
|
|
497
|
-
'Brian',
|
|
498
|
-
'Arthur',
|
|
499
|
-
'Kajal',
|
|
500
|
-
'Niamh',
|
|
501
|
-
'Aria',
|
|
502
|
-
'Ayanda',
|
|
503
|
-
'Ivy',
|
|
504
|
-
'Joanna',
|
|
505
|
-
'Kendra',
|
|
506
|
-
'Kimberly',
|
|
507
|
-
'Salli',
|
|
508
|
-
'Joey',
|
|
509
|
-
'Justin',
|
|
510
|
-
'Kevin',
|
|
511
|
-
'Matthew',
|
|
512
|
-
'Ruth',
|
|
513
|
-
'Stephen',
|
|
514
|
-
'Suvi',
|
|
515
|
-
'Léa',
|
|
516
|
-
'Rémi',
|
|
517
|
-
'Gabrielle',
|
|
518
|
-
'Liam',
|
|
519
|
-
'Vicki',
|
|
520
|
-
'Daniel',
|
|
521
|
-
'Hannah',
|
|
522
|
-
'Kajal',
|
|
523
|
-
'Bianca',
|
|
524
|
-
'Adriano',
|
|
525
|
-
'Takumi',
|
|
526
|
-
'Kazuha',
|
|
527
|
-
'Tomoko',
|
|
528
|
-
'Seoyeon',
|
|
529
|
-
'Ida',
|
|
530
|
-
'Ola',
|
|
531
|
-
'Camila',
|
|
532
|
-
'Vitória',
|
|
533
|
-
'Vitoria',
|
|
534
|
-
'Thiago',
|
|
535
|
-
'Inês',
|
|
536
|
-
'Ines',
|
|
537
|
-
'Lucia',
|
|
538
|
-
'Sergio',
|
|
539
|
-
'Mia',
|
|
540
|
-
'Andrés',
|
|
541
|
-
'Lupe',
|
|
542
|
-
'Pedro',
|
|
543
|
-
'Elin'
|
|
544
|
-
]),
|
|
545
|
-
language: z.optional(z.enum([
|
|
546
|
-
'cmn-CN',
|
|
547
|
-
'da-DK',
|
|
548
|
-
'de-DE',
|
|
549
|
-
'en-AU',
|
|
550
|
-
'en-GB',
|
|
551
|
-
'en-IN',
|
|
552
|
-
'en-US',
|
|
553
|
-
'es-ES',
|
|
554
|
-
'es-MX',
|
|
555
|
-
'es-US',
|
|
556
|
-
'fr-CA',
|
|
557
|
-
'fr-FR',
|
|
558
|
-
'it-IT',
|
|
559
|
-
'ja-JP',
|
|
560
|
-
'hi-IN',
|
|
561
|
-
'ko-KR',
|
|
562
|
-
'nb-NO',
|
|
563
|
-
'nl-NL',
|
|
564
|
-
'pl-PL',
|
|
565
|
-
'pt-BR',
|
|
566
|
-
'pt-PT',
|
|
567
|
-
'sv-SE',
|
|
568
|
-
'en-NZ',
|
|
569
|
-
'en-ZA',
|
|
570
|
-
'ca-ES',
|
|
571
|
-
'de-AT',
|
|
572
|
-
'yue-CN',
|
|
573
|
-
'ar-AE',
|
|
574
|
-
'fi-FI'
|
|
575
|
-
])),
|
|
576
|
-
newscaster: z.optional(z.boolean()).default(false)
|
|
577
|
-
}).strict();
|
|
578
|
-
|
|
579
|
-
export const shotstackTextToSpeechOptionsSchema = shotstackTextToSpeechOptionsShotstackTextToSpeechOptionsSchema;
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Generate assets using the native Shotstack provider AI services.
|
|
583
|
-
*/
|
|
584
|
-
export const shotstackGeneratedAssetOptionsShotstackGeneratedAssetOptionsSchema = z.union([
|
|
585
|
-
z.object({
|
|
586
|
-
type: z.literal('shotstackTextToSpeechOptions_ShotstackTextToSpeechOptions')
|
|
587
|
-
}).strict().and(shotstackTextToSpeechOptionsShotstackTextToSpeechOptionsSchema),
|
|
588
|
-
z.object({
|
|
589
|
-
type: z.literal('shotstackTextToImageOptions_ShotstackTextToImageOptions')
|
|
590
|
-
}).strict().and(shotstackTextToImageOptionsShotstackTextToImageOptionsSchema),
|
|
591
|
-
z.object({
|
|
592
|
-
type: z.literal('shotstackTextGeneratorOptions_ShotstackTextGeneratorOptions')
|
|
593
|
-
}).strict().and(shotstackTextGeneratorOptionsShotstackTextGeneratorOptionsSchema),
|
|
594
|
-
z.object({
|
|
595
|
-
type: z.literal('shotstackImageToVideoOptions_ShotstackImageToVideoOptions')
|
|
596
|
-
}).strict().and(shotstackImageToVideoOptionsShotstackImageToVideoOptionsSchema)
|
|
597
|
-
]);
|
|
598
|
-
|
|
599
|
-
export const shotstackGeneratedAssetOptionsSchema = shotstackGeneratedAssetOptionsShotstackGeneratedAssetOptionsSchema;
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* 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.
|
|
603
|
-
*/
|
|
604
|
-
export const shotstackGeneratedAssetShotstackGeneratedAssetSchema = z.object({
|
|
605
|
-
provider: z.enum(['shotstack']),
|
|
606
|
-
options: shotstackGeneratedAssetOptionsShotstackGeneratedAssetOptionsSchema
|
|
607
|
-
}).strict();
|
|
608
|
-
|
|
609
|
-
export const shotstackGeneratedAssetSchema = shotstackGeneratedAssetShotstackGeneratedAssetSchema;
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* 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.
|
|
613
|
-
*/
|
|
614
|
-
export const stabilityAiTextToImageOptionsStabilityAiTextToImageOptionsSchema = z.object({
|
|
615
|
-
type: z.enum(['text-to-image']),
|
|
616
|
-
prompt: z.string(),
|
|
617
|
-
engine: z.optional(z.enum([
|
|
618
|
-
'stable-diffusion-xl-1024-v0-9',
|
|
619
|
-
'stable-diffusion-xl-1024-v1-0',
|
|
620
|
-
'stable-diffusion-v1-6',
|
|
621
|
-
'stable-diffusion-512-v2-1',
|
|
622
|
-
'stable-diffusion-xl-beta-v2-2-2'
|
|
623
|
-
])),
|
|
624
|
-
width: 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()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
625
|
-
height: 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()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
626
|
-
steps: 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()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(30),
|
|
627
|
-
seed: 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()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
628
|
-
cfgScale: 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*\}\}$/)])).default(7),
|
|
629
|
-
stylePreset: z.optional(z.enum([
|
|
630
|
-
'3d-model',
|
|
631
|
-
'analog-film',
|
|
632
|
-
'anime',
|
|
633
|
-
'cinematic',
|
|
634
|
-
'comic-book',
|
|
635
|
-
'digital-art',
|
|
636
|
-
'enhance',
|
|
637
|
-
'fantasy-art',
|
|
638
|
-
'isometric',
|
|
639
|
-
'line-art',
|
|
640
|
-
'low-poly',
|
|
641
|
-
'modeling-compound',
|
|
642
|
-
'neon-punk',
|
|
643
|
-
'origami',
|
|
644
|
-
'photographic',
|
|
645
|
-
'pixel-art',
|
|
646
|
-
'tile-texture'
|
|
647
|
-
]))
|
|
648
|
-
}).strict();
|
|
649
|
-
|
|
650
|
-
export const stabilityAiTextToImageOptionsSchema = stabilityAiTextToImageOptionsStabilityAiTextToImageOptionsSchema;
|
|
651
|
-
|
|
652
|
-
/**
|
|
653
|
-
* Generate assets using Stability AI provider AI services.
|
|
654
|
-
*
|
|
655
|
-
* The following AI generation services are available: <ul>
|
|
656
|
-
* <li><a href="#tocs_stabilityaitexttoimageoptions">StabilityAiTextToImageOptions</a></li>
|
|
657
|
-
* </ul>
|
|
658
|
-
*/
|
|
659
|
-
export const stabilityAiGeneratedAssetOptionsStabilityAiGeneratedAssetOptionsSchema = z.object({
|
|
660
|
-
type: z.literal('stabilityAiTextToImageOptions_StabilityAiTextToImageOptions')
|
|
661
|
-
}).strict().and(stabilityAiTextToImageOptionsStabilityAiTextToImageOptionsSchema);
|
|
662
|
-
|
|
663
|
-
export const stabilityAiGeneratedAssetOptionsSchema = stabilityAiGeneratedAssetOptionsStabilityAiGeneratedAssetOptionsSchema;
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* 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.
|
|
667
|
-
*/
|
|
668
|
-
export const stabilityAiGeneratedAssetStabilityAiGeneratedAssetSchema = z.object({
|
|
669
|
-
provider: z.enum(['stability-ai']),
|
|
670
|
-
options: stabilityAiGeneratedAssetOptionsStabilityAiGeneratedAssetOptionsSchema
|
|
671
|
-
}).strict();
|
|
672
|
-
|
|
673
|
-
export const stabilityAiGeneratedAssetSchema = stabilityAiGeneratedAssetStabilityAiGeneratedAssetSchema;
|
|
674
|
-
|
|
675
|
-
/**
|
|
676
|
-
* 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.
|
|
677
|
-
*/
|
|
678
|
-
export const generatedAssetGeneratedAssetSchema = z.union([
|
|
679
|
-
z.object({
|
|
680
|
-
provider: z.literal('shotstackGeneratedAsset_ShotstackGeneratedAsset')
|
|
681
|
-
}).strict().and(shotstackGeneratedAssetShotstackGeneratedAssetSchema),
|
|
682
|
-
z.object({
|
|
683
|
-
provider: z.literal('didGeneratedAsset_DIDGeneratedAsset')
|
|
684
|
-
}).strict().and(didGeneratedAssetDidGeneratedAssetSchema),
|
|
685
|
-
z.object({
|
|
686
|
-
provider: z.literal('elevenlabsGeneratedAsset_ElevenLabsGeneratedAsset')
|
|
687
|
-
}).strict().and(elevenlabsGeneratedAssetElevenLabsGeneratedAssetSchema),
|
|
688
|
-
z.object({
|
|
689
|
-
provider: z.literal('heygenGeneratedAsset_HeyGenGeneratedAsset')
|
|
690
|
-
}).strict().and(heygenGeneratedAssetHeyGenGeneratedAssetSchema),
|
|
691
|
-
z.object({
|
|
692
|
-
provider: z.literal('openaiGeneratedAsset_OpenAiGeneratedAsset')
|
|
693
|
-
}).strict().and(openaiGeneratedAssetOpenAiGeneratedAssetSchema),
|
|
694
|
-
z.object({
|
|
695
|
-
provider: z.literal('stabilityAiGeneratedAsset_StabilityAiGeneratedAsset')
|
|
696
|
-
}).strict().and(stabilityAiGeneratedAssetStabilityAiGeneratedAssetSchema)
|
|
697
|
-
]);
|
|
698
|
-
|
|
699
|
-
export const generatedAssetSchema = generatedAssetGeneratedAssetSchema;
|
|
700
|
-
|
|
701
106
|
/**
|
|
702
107
|
* 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.
|
|
703
108
|
*/
|
|
@@ -716,8 +121,14 @@ export const cropSchema = cropCropSchema;
|
|
|
716
121
|
export const akamaiNetStorageDestinationOptionsAkamaiNetStorageDestinationOptionsSchema = z.object({
|
|
717
122
|
host: z.string(),
|
|
718
123
|
cpCode: z.string(),
|
|
719
|
-
path: z.optional(z.
|
|
720
|
-
|
|
124
|
+
path: z.optional(z.union([
|
|
125
|
+
z.string(),
|
|
126
|
+
z.null()
|
|
127
|
+
])),
|
|
128
|
+
filename: z.optional(z.union([
|
|
129
|
+
z.string(),
|
|
130
|
+
z.null()
|
|
131
|
+
]))
|
|
721
132
|
}).strict();
|
|
722
133
|
|
|
723
134
|
/**
|
|
@@ -734,8 +145,14 @@ export const akamaiNetStorageDestinationAkamaiNetStorageDestinationSchema = z.ob
|
|
|
734
145
|
export const azureBlobStorageDestinationOptionsAzureBlobStorageDestinationOptionsSchema = z.object({
|
|
735
146
|
accountName: z.string(),
|
|
736
147
|
container: z.string(),
|
|
737
|
-
prefix: z.optional(z.
|
|
738
|
-
|
|
148
|
+
prefix: z.optional(z.union([
|
|
149
|
+
z.string(),
|
|
150
|
+
z.null()
|
|
151
|
+
])),
|
|
152
|
+
filename: z.optional(z.union([
|
|
153
|
+
z.string(),
|
|
154
|
+
z.null()
|
|
155
|
+
]))
|
|
739
156
|
}).strict();
|
|
740
157
|
|
|
741
158
|
/**
|
|
@@ -1898,390 +1315,32 @@ export const soundtrackSoundtrackSchema = z.object({
|
|
|
1898
1315
|
export const soundtrackSchema = soundtrackSoundtrackSchema;
|
|
1899
1316
|
|
|
1900
1317
|
/**
|
|
1901
|
-
*
|
|
1902
|
-
* along the gradient vector. Gradients require at least 2 stops.
|
|
1903
|
-
*
|
|
1904
|
-
*/
|
|
1905
|
-
export const svgpropertiesSvgGradientStopSchema = z.object({
|
|
1906
|
-
offset: 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*\}\}$/)]),
|
|
1907
|
-
color: z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
1908
|
-
}).strict();
|
|
1909
|
-
|
|
1910
|
-
export const svgGradientStopSchema = svgpropertiesSvgGradientStopSchema;
|
|
1911
|
-
|
|
1912
|
-
/**
|
|
1913
|
-
* A linear gradient fill that transitions colors along a straight line.
|
|
1914
|
-
* The gradient direction is controlled by the `angle` property.
|
|
1915
|
-
*
|
|
1916
|
-
*/
|
|
1917
|
-
export const svgpropertiesSvgLinearGradientFillSchema = z.object({
|
|
1918
|
-
type: z.enum(['linear']),
|
|
1919
|
-
angle: 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(360)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
1920
|
-
stops: z.array(svgpropertiesSvgGradientStopSchema).min(2),
|
|
1921
|
-
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)
|
|
1922
|
-
}).strict();
|
|
1923
|
-
|
|
1924
|
-
export const svgLinearGradientFillSchema = svgpropertiesSvgLinearGradientFillSchema;
|
|
1925
|
-
|
|
1926
|
-
/**
|
|
1927
|
-
* A radial gradient fill that transitions colors radiating outward from a center point.
|
|
1928
|
-
* The gradient creates a circular or elliptical color transition.
|
|
1929
|
-
*
|
|
1930
|
-
*/
|
|
1931
|
-
export const svgpropertiesSvgRadialGradientFillSchema = z.object({
|
|
1932
|
-
type: z.enum(['radial']),
|
|
1933
|
-
stops: z.array(svgpropertiesSvgGradientStopSchema).min(2),
|
|
1934
|
-
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)
|
|
1935
|
-
}).strict();
|
|
1936
|
-
|
|
1937
|
-
export const svgRadialGradientFillSchema = svgpropertiesSvgRadialGradientFillSchema;
|
|
1938
|
-
|
|
1939
|
-
/**
|
|
1940
|
-
* Drop shadow properties for SVG shapes. Creates a shadow effect behind the shape.
|
|
1941
|
-
*
|
|
1942
|
-
*/
|
|
1943
|
-
export const svgpropertiesSvgShadowSchema = z.object({
|
|
1944
|
-
offsetX: 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*\}\}$/)])).default(0),
|
|
1945
|
-
offsetY: 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*\}\}$/)])).default(0),
|
|
1946
|
-
blur: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
1947
|
-
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default('#000000'),
|
|
1948
|
-
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(0.5)
|
|
1949
|
-
}).strict();
|
|
1950
|
-
|
|
1951
|
-
export const svgShadowSchema = svgpropertiesSvgShadowSchema;
|
|
1952
|
-
|
|
1953
|
-
/**
|
|
1954
|
-
* A solid color fill for SVG shapes.
|
|
1955
|
-
*/
|
|
1956
|
-
export const svgpropertiesSvgSolidFillSchema = z.object({
|
|
1957
|
-
type: z.enum(['solid']),
|
|
1958
|
-
color: z.string().regex(/^#[A-Fa-f0-9]{6}$/).default('#000000'),
|
|
1959
|
-
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)
|
|
1960
|
-
}).strict();
|
|
1961
|
-
|
|
1962
|
-
export const svgSolidFillSchema = svgpropertiesSvgSolidFillSchema;
|
|
1963
|
-
|
|
1964
|
-
/**
|
|
1965
|
-
* Fill properties for SVG shapes. Supports solid colors and gradients.
|
|
1966
|
-
* The fill defines how the interior of a shape is painted.
|
|
1967
|
-
*
|
|
1968
|
-
*/
|
|
1969
|
-
export const svgpropertiesSvgFillSchema = z.discriminatedUnion("type", [
|
|
1970
|
-
svgpropertiesSvgSolidFillSchema,
|
|
1971
|
-
svgpropertiesSvgLinearGradientFillSchema,
|
|
1972
|
-
svgpropertiesSvgRadialGradientFillSchema,
|
|
1973
|
-
]);
|
|
1974
|
-
|
|
1975
|
-
export const svgFillSchema = svgpropertiesSvgFillSchema;
|
|
1976
|
-
|
|
1977
|
-
/**
|
|
1978
|
-
* Stroke (outline) properties for SVG shapes. The stroke defines how the outline
|
|
1979
|
-
* of a shape is painted, including its color, width, and line style.
|
|
1980
|
-
*
|
|
1981
|
-
*/
|
|
1982
|
-
export const svgpropertiesSvgStrokeSchema = z.object({
|
|
1983
|
-
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default('#000000'),
|
|
1984
|
-
width: 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(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
1985
|
-
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),
|
|
1986
|
-
lineCap: z.optional(z.enum([
|
|
1987
|
-
'butt',
|
|
1988
|
-
'round',
|
|
1989
|
-
'square'
|
|
1990
|
-
])),
|
|
1991
|
-
lineJoin: z.optional(z.enum([
|
|
1992
|
-
'miter',
|
|
1993
|
-
'round',
|
|
1994
|
-
'bevel'
|
|
1995
|
-
])),
|
|
1996
|
-
dashArray: z.optional(z.array(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))),
|
|
1997
|
-
dashOffset: 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*\}\}$/)])).default(0)
|
|
1998
|
-
}).strict();
|
|
1999
|
-
|
|
2000
|
-
export const svgStrokeSchema = svgpropertiesSvgStrokeSchema;
|
|
2001
|
-
|
|
2002
|
-
/**
|
|
2003
|
-
* Transformation properties for positioning, rotating, and scaling SVG shapes.
|
|
2004
|
-
*
|
|
2005
|
-
*/
|
|
2006
|
-
export const svgpropertiesSvgTransformSchema = z.object({
|
|
2007
|
-
x: 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*\}\}$/)])).default(0),
|
|
2008
|
-
y: 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*\}\}$/)])).default(0),
|
|
2009
|
-
rotation: 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(-360).lte(360)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
|
|
2010
|
-
scale: 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.01).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
|
|
2011
|
-
originX: 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(0.5),
|
|
2012
|
-
originY: 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(0.5)
|
|
2013
|
-
}).strict();
|
|
2014
|
-
|
|
2015
|
-
export const svgTransformSchema = svgpropertiesSvgTransformSchema;
|
|
2016
|
-
|
|
2017
|
-
/**
|
|
2018
|
-
* An arrow shape pointing to the right by default.
|
|
2019
|
-
* Use transform rotation to change direction.
|
|
2020
|
-
*
|
|
2021
|
-
*/
|
|
2022
|
-
export const svgshapesSvgArrowShapeSchema = z.object({
|
|
2023
|
-
type: z.enum(['arrow']),
|
|
2024
|
-
length: 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(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2025
|
-
headWidth: 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(1).lte(1000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2026
|
-
headLength: 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(1).lte(1000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2027
|
-
shaftWidth: 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(1).lte(1000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2028
|
-
}).strict();
|
|
2029
|
-
|
|
2030
|
-
export const svgArrowShapeSchema = svgshapesSvgArrowShapeSchema;
|
|
2031
|
-
|
|
2032
|
-
/**
|
|
2033
|
-
* A perfect circle shape defined by its radius.
|
|
2034
|
-
* The circle is centered at the shape's position.
|
|
2035
|
-
*
|
|
2036
|
-
*/
|
|
2037
|
-
export const svgshapesSvgCircleShapeSchema = z.object({
|
|
2038
|
-
type: z.enum(['circle']),
|
|
2039
|
-
radius: 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(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2040
|
-
}).strict();
|
|
2041
|
-
|
|
2042
|
-
export const svgCircleShapeSchema = svgshapesSvgCircleShapeSchema;
|
|
2043
|
-
|
|
2044
|
-
/**
|
|
2045
|
-
* A cross or plus shape with equal or different arm lengths.
|
|
2046
|
-
* Can be styled as a plus sign (+) or a cross (x with rotation).
|
|
2047
|
-
*
|
|
2048
|
-
*/
|
|
2049
|
-
export const svgshapesSvgCrossShapeSchema = z.object({
|
|
2050
|
-
type: z.enum(['cross']),
|
|
2051
|
-
width: 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(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2052
|
-
height: 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(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2053
|
-
thickness: 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(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2054
|
-
}).strict();
|
|
2055
|
-
|
|
2056
|
-
export const svgCrossShapeSchema = svgshapesSvgCrossShapeSchema;
|
|
2057
|
-
|
|
2058
|
-
/**
|
|
2059
|
-
* An ellipse (oval) shape with separate horizontal and vertical radii.
|
|
2060
|
-
* The ellipse is centered at the shape's position.
|
|
2061
|
-
*
|
|
2062
|
-
*/
|
|
2063
|
-
export const svgshapesSvgEllipseShapeSchema = z.object({
|
|
2064
|
-
type: z.enum(['ellipse']),
|
|
2065
|
-
radiusX: 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(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2066
|
-
radiusY: 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(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2067
|
-
}).strict();
|
|
2068
|
-
|
|
2069
|
-
export const svgEllipseShapeSchema = svgshapesSvgEllipseShapeSchema;
|
|
2070
|
-
|
|
2071
|
-
/**
|
|
2072
|
-
* A heart shape commonly used for love/like icons.
|
|
2073
|
-
* The heart is defined by a single size parameter.
|
|
2074
|
-
*
|
|
2075
|
-
*/
|
|
2076
|
-
export const svgshapesSvgHeartShapeSchema = z.object({
|
|
2077
|
-
type: z.enum(['heart']),
|
|
2078
|
-
size: 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(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2079
|
-
}).strict();
|
|
2080
|
-
|
|
2081
|
-
export const svgHeartShapeSchema = svgshapesSvgHeartShapeSchema;
|
|
2082
|
-
|
|
2083
|
-
/**
|
|
2084
|
-
* A straight line shape with a specified length and thickness.
|
|
2085
|
-
* The line is drawn horizontally by default and can be rotated using transform.
|
|
2086
|
-
*
|
|
2087
|
-
*/
|
|
2088
|
-
export const svgshapesSvgLineShapeSchema = z.object({
|
|
2089
|
-
type: z.enum(['line']),
|
|
2090
|
-
length: 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(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2091
|
-
thickness: 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(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2092
|
-
}).strict();
|
|
2093
|
-
|
|
2094
|
-
export const svgLineShapeSchema = svgshapesSvgLineShapeSchema;
|
|
2095
|
-
|
|
2096
|
-
/**
|
|
2097
|
-
* A custom shape defined by SVG path data.
|
|
2098
|
-
* Supports all standard SVG path commands for creating complex shapes.
|
|
2099
|
-
*
|
|
2100
|
-
* **Path Commands:**
|
|
2101
|
-
* - `M x y` / `m dx dy` - Move to (absolute/relative)
|
|
2102
|
-
* - `L x y` / `l dx dy` - Line to
|
|
2103
|
-
* - `H x` / `h dx` - Horizontal line to
|
|
2104
|
-
* - `V y` / `v dy` - Vertical line to
|
|
2105
|
-
* - `C x1 y1 x2 y2 x y` / `c` - Cubic Bezier curve
|
|
2106
|
-
* - `S x2 y2 x y` / `s` - Smooth cubic Bezier
|
|
2107
|
-
* - `Q x1 y1 x y` / `q` - Quadratic Bezier curve
|
|
2108
|
-
* - `T x y` / `t` - Smooth quadratic Bezier
|
|
2109
|
-
* - `A rx ry angle large-arc sweep x y` / `a` - Elliptical arc
|
|
2110
|
-
* - `Z` / `z` - Close path
|
|
2111
|
-
*
|
|
2112
|
-
*/
|
|
2113
|
-
export const svgshapesSvgPathShapeSchema = z.object({
|
|
2114
|
-
type: z.enum(['path']),
|
|
2115
|
-
d: z.string().min(1).max(100000)
|
|
2116
|
-
}).strict();
|
|
2117
|
-
|
|
2118
|
-
export const svgPathShapeSchema = svgshapesSvgPathShapeSchema;
|
|
2119
|
-
|
|
2120
|
-
/**
|
|
2121
|
-
* A regular polygon shape with a specified number of sides.
|
|
2122
|
-
* Examples: triangle (3), square (4), pentagon (5), hexagon (6), etc.
|
|
2123
|
-
* The polygon is inscribed in a circle of the given radius.
|
|
2124
|
-
*
|
|
2125
|
-
*/
|
|
2126
|
-
export const svgshapesSvgPolygonShapeSchema = z.object({
|
|
2127
|
-
type: z.enum(['polygon']),
|
|
2128
|
-
sides: 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(3).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2129
|
-
radius: 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(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2130
|
-
}).strict();
|
|
2131
|
-
|
|
2132
|
-
export const svgPolygonShapeSchema = svgshapesSvgPolygonShapeSchema;
|
|
2133
|
-
|
|
2134
|
-
/**
|
|
2135
|
-
* A rectangle shape with optional rounded corners.
|
|
2136
|
-
* The rectangle is defined by its width and height dimensions.
|
|
2137
|
-
*
|
|
2138
|
-
*/
|
|
2139
|
-
export const svgshapesSvgRectangleShapeSchema = z.object({
|
|
2140
|
-
type: z.enum(['rectangle']),
|
|
2141
|
-
width: 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(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2142
|
-
height: 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(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2143
|
-
cornerRadius: 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(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)
|
|
2144
|
-
}).strict();
|
|
2145
|
-
|
|
2146
|
-
export const svgRectangleShapeSchema = svgshapesSvgRectangleShapeSchema;
|
|
2147
|
-
|
|
2148
|
-
/**
|
|
2149
|
-
* A ring (donut/annulus) shape - a circle with a circular hole in the center.
|
|
2150
|
-
* The ring is defined by outer and inner radii.
|
|
2151
|
-
*
|
|
2152
|
-
*/
|
|
2153
|
-
export const svgshapesSvgRingShapeSchema = z.object({
|
|
2154
|
-
type: z.enum(['ring']),
|
|
2155
|
-
outerRadius: 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(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2156
|
-
innerRadius: 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(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2157
|
-
}).strict();
|
|
2158
|
-
|
|
2159
|
-
export const svgRingShapeSchema = svgshapesSvgRingShapeSchema;
|
|
2160
|
-
|
|
2161
|
-
/**
|
|
2162
|
-
* A star shape with a specified number of points.
|
|
2163
|
-
* The star is defined by outer and inner radii, creating the characteristic
|
|
2164
|
-
* pointed appearance.
|
|
2165
|
-
*
|
|
2166
|
-
*/
|
|
2167
|
-
export const svgshapesSvgStarShapeSchema = z.object({
|
|
2168
|
-
type: z.enum(['star']),
|
|
2169
|
-
points: 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(3).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2170
|
-
outerRadius: 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(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
|
|
2171
|
-
innerRadius: 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(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])
|
|
2172
|
-
}).strict();
|
|
2173
|
-
|
|
2174
|
-
export const svgStarShapeSchema = svgshapesSvgStarShapeSchema;
|
|
2175
|
-
|
|
2176
|
-
/**
|
|
2177
|
-
* The shape definition for an SVG asset. Each shape type has its own specific
|
|
2178
|
-
* properties. The `type` field determines which shape is rendered.
|
|
2179
|
-
*
|
|
2180
|
-
*/
|
|
2181
|
-
export const svgshapesSvgShapeSchema = z.discriminatedUnion("type", [
|
|
2182
|
-
svgshapesSvgRectangleShapeSchema,
|
|
2183
|
-
svgshapesSvgCircleShapeSchema,
|
|
2184
|
-
svgshapesSvgEllipseShapeSchema,
|
|
2185
|
-
svgshapesSvgLineShapeSchema,
|
|
2186
|
-
svgshapesSvgPolygonShapeSchema,
|
|
2187
|
-
svgshapesSvgStarShapeSchema,
|
|
2188
|
-
svgshapesSvgArrowShapeSchema,
|
|
2189
|
-
svgshapesSvgHeartShapeSchema,
|
|
2190
|
-
svgshapesSvgCrossShapeSchema,
|
|
2191
|
-
svgshapesSvgRingShapeSchema,
|
|
2192
|
-
svgshapesSvgPathShapeSchema,
|
|
2193
|
-
]);
|
|
2194
|
-
|
|
2195
|
-
export const svgShapeSchema = svgshapesSvgShapeSchema;
|
|
2196
|
-
|
|
2197
|
-
/**
|
|
2198
|
-
* The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.
|
|
2199
|
-
* It provides two mutually exclusive ways to define shapes:
|
|
1318
|
+
* The SvgAsset is used to add scalable vector graphics (SVG) to a video using raw SVG markup.
|
|
2200
1319
|
*
|
|
2201
|
-
* **Option 1: Import SVG markup using `src`**
|
|
2202
1320
|
* ```json
|
|
2203
1321
|
* {
|
|
2204
1322
|
* "type": "svg",
|
|
2205
1323
|
* "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
|
|
2206
1324
|
* }
|
|
2207
1325
|
* ```
|
|
2208
|
-
* When using `src`, no other properties are allowed. The fill, stroke, and dimensions
|
|
2209
|
-
* are automatically extracted from the SVG markup.
|
|
2210
1326
|
*
|
|
2211
|
-
* **
|
|
2212
|
-
*
|
|
2213
|
-
* {
|
|
2214
|
-
* "type": "svg",
|
|
2215
|
-
* "shape": { "type": "circle", "radius": 50 },
|
|
2216
|
-
* "fill": { "type": "solid", "color": "#FF0000" }
|
|
2217
|
-
* }
|
|
2218
|
-
* ```
|
|
2219
|
-
* When using `shape`, you can customize fill, stroke, shadow, transform, and other properties.
|
|
2220
|
-
* The `src` property is not allowed in this mode.
|
|
2221
|
-
*
|
|
2222
|
-
* **Important:** You must provide either `src` OR `shape`, but not both.
|
|
2223
|
-
* These two modes are mutually exclusive.
|
|
1327
|
+
* **Supported elements:** `<path>`, `<rect>`, `<circle>`, `<ellipse>`,
|
|
1328
|
+
* `<line>`, `<polygon>`, `<polyline>`
|
|
2224
1329
|
*
|
|
2225
|
-
* **
|
|
2226
|
-
* -
|
|
2227
|
-
* - `
|
|
2228
|
-
* -
|
|
2229
|
-
* - `
|
|
2230
|
-
* -
|
|
2231
|
-
* - `star` - Multi-pointed stars
|
|
2232
|
-
* - `arrow` - Directional arrows
|
|
2233
|
-
* - `heart` - Heart shapes
|
|
2234
|
-
* - `cross` - Plus/cross shapes
|
|
2235
|
-
* - `ring` - Donut/ring shapes
|
|
2236
|
-
* - `path` - Custom shapes using SVG path data
|
|
1330
|
+
* **Automatically extracted from SVG markup:**
|
|
1331
|
+
* - Path data (converted to a single combined path)
|
|
1332
|
+
* - Fill color (from `fill` attribute or `style`)
|
|
1333
|
+
* - Stroke color and width (from attributes or `style`)
|
|
1334
|
+
* - Dimensions (from `width`/`height` or `viewBox`)
|
|
1335
|
+
* - Opacity (from `opacity` attribute)
|
|
2237
1336
|
*
|
|
2238
1337
|
* See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
|
|
2239
1338
|
*
|
|
2240
1339
|
*/
|
|
2241
1340
|
export const svgassetSvgAssetSchema = z.object({
|
|
2242
1341
|
type: z.enum(["svg"]),
|
|
2243
|
-
src: z.
|
|
2244
|
-
|
|
2245
|
-
fill: z.optional(svgpropertiesSvgFillSchema),
|
|
2246
|
-
stroke: z.optional(svgpropertiesSvgStrokeSchema),
|
|
2247
|
-
shadow: z.optional(svgpropertiesSvgShadowSchema),
|
|
2248
|
-
transform: z.optional(svgpropertiesSvgTransformSchema),
|
|
2249
|
-
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),
|
|
2250
|
-
width: 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(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2251
|
-
height: 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(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
2252
|
-
}).strict().superRefine((data, ctx) => {
|
|
2253
|
-
const hasShape = data.shape !== undefined;
|
|
2254
|
-
const hasSrc = data.src !== undefined && data.src.trim() !== "";
|
|
2255
|
-
|
|
2256
|
-
if (!hasShape && !hasSrc) {
|
|
2257
|
-
ctx.addIssue({
|
|
2258
|
-
code: z.ZodIssueCode.custom,
|
|
2259
|
-
message: "Either 'src' or 'shape' must be provided",
|
|
2260
|
-
path: [],
|
|
2261
|
-
});
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
|
-
if (hasShape && hasSrc) {
|
|
2265
|
-
ctx.addIssue({
|
|
2266
|
-
code: z.ZodIssueCode.custom,
|
|
2267
|
-
message: "Provide either 'src' or 'shape', not both",
|
|
2268
|
-
path: ["src"],
|
|
2269
|
-
});
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
|
-
if (hasSrc) {
|
|
2273
|
-
const disallowedProps = ["shape", "fill", "stroke", "shadow", "transform", "width", "height"];
|
|
2274
|
-
for (const prop of disallowedProps) {
|
|
2275
|
-
if (data[prop] !== undefined) {
|
|
2276
|
-
ctx.addIssue({
|
|
2277
|
-
code: z.ZodIssueCode.custom,
|
|
2278
|
-
message: `'${prop}' is not allowed when using 'src'. Only 'type' and 'src' are allowed in import mode`,
|
|
2279
|
-
path: [prop],
|
|
2280
|
-
});
|
|
2281
|
-
}
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
});
|
|
1342
|
+
src: z.string().min(1).max(500000),
|
|
1343
|
+
}).strict();
|
|
2285
1344
|
|
|
2286
1345
|
export const svgAssetSchema = svgassetSvgAssetSchema;
|
|
2287
1346
|
|
|
@@ -3285,27 +2344,3 @@ export const getUploadSignedUrlRequest = z.object({
|
|
|
3285
2344
|
* The id and signed URL to upload to.
|
|
3286
2345
|
*/
|
|
3287
2346
|
export const getUploadSignedUrlResponse = uploadresponseUploadResponseSchema;
|
|
3288
|
-
|
|
3289
|
-
export const postGenerateAssetRequest = z.object({
|
|
3290
|
-
body: generatedAssetGeneratedAssetSchema,
|
|
3291
|
-
path: z.optional(z.never()),
|
|
3292
|
-
query: z.optional(z.never())
|
|
3293
|
-
}).strict();
|
|
3294
|
-
|
|
3295
|
-
/**
|
|
3296
|
-
* The generated asset details
|
|
3297
|
-
*/
|
|
3298
|
-
export const postGenerateAssetResponse = generatedAssetResponseGeneratedAssetResponseSchema;
|
|
3299
|
-
|
|
3300
|
-
export const getGeneratedAssetRequest = z.object({
|
|
3301
|
-
body: z.optional(z.never()),
|
|
3302
|
-
path: z.object({
|
|
3303
|
-
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*\}\}$/)])
|
|
3304
|
-
}),
|
|
3305
|
-
query: z.optional(z.never())
|
|
3306
|
-
}).strict();
|
|
3307
|
-
|
|
3308
|
-
/**
|
|
3309
|
-
* The generated asset details
|
|
3310
|
-
*/
|
|
3311
|
-
export const getGeneratedAssetResponse = generatedAssetResponseGeneratedAssetResponseSchema;
|