@shotstack/schemas 1.9.5 → 1.9.7
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 +83 -1263
- package/dist/json-schema/asset.json +3 -858
- package/dist/json-schema/clip.json +3 -858
- package/dist/json-schema/edit.json +3 -858
- package/dist/json-schema/rich-caption-active-font.json +1 -4
- package/dist/json-schema/rich-caption-active.json +1 -4
- package/dist/json-schema/rich-caption-asset.json +1 -4
- package/dist/json-schema/schemas.json +6 -954
- package/dist/json-schema/svg-asset.json +6 -857
- package/dist/json-schema/timeline.json +3 -858
- package/dist/json-schema/track.json +3 -858
- package/dist/schema.d.ts +15 -1040
- package/dist/zod/zod.gen.cjs +36 -726
- package/dist/zod/zod.gen.d.ts +542 -11591
- package/dist/zod/zod.gen.js +29 -718
- package/dist/zod/zod.gen.ts +31 -711
- 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
|
*/
|
|
@@ -1335,7 +740,7 @@ export const templateResponseSchema = templateresponseTemplateResponseSchema;
|
|
|
1335
740
|
* Font properties for the active/highlighted word.
|
|
1336
741
|
*/
|
|
1337
742
|
export const richcaptionpropertiesRichCaptionActiveFontSchema = z.object({
|
|
1338
|
-
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
|
|
743
|
+
color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1339
744
|
background: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
1340
745
|
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),
|
|
1341
746
|
size: z.optional(z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
|
|
@@ -1897,6 +1302,36 @@ export const soundtrackSoundtrackSchema = z.object({
|
|
|
1897
1302
|
|
|
1898
1303
|
export const soundtrackSchema = soundtrackSoundtrackSchema;
|
|
1899
1304
|
|
|
1305
|
+
/**
|
|
1306
|
+
* The SvgAsset is used to add scalable vector graphics (SVG) to a video using raw SVG markup.
|
|
1307
|
+
*
|
|
1308
|
+
* ```json
|
|
1309
|
+
* {
|
|
1310
|
+
* "type": "svg",
|
|
1311
|
+
* "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
|
|
1312
|
+
* }
|
|
1313
|
+
* ```
|
|
1314
|
+
*
|
|
1315
|
+
* **Supported elements:** `<path>`, `<rect>`, `<circle>`, `<ellipse>`,
|
|
1316
|
+
* `<line>`, `<polygon>`, `<polyline>`
|
|
1317
|
+
*
|
|
1318
|
+
* **Automatically extracted from SVG markup:**
|
|
1319
|
+
* - Path data (converted to a single combined path)
|
|
1320
|
+
* - Fill color (from `fill` attribute or `style`)
|
|
1321
|
+
* - Stroke color and width (from attributes or `style`)
|
|
1322
|
+
* - Dimensions (from `width`/`height` or `viewBox`)
|
|
1323
|
+
* - Opacity (from `opacity` attribute)
|
|
1324
|
+
*
|
|
1325
|
+
* See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
|
|
1326
|
+
*
|
|
1327
|
+
*/
|
|
1328
|
+
export const svgassetSvgAssetSchema = z.object({
|
|
1329
|
+
type: z.enum(["svg"]),
|
|
1330
|
+
src: z.string().min(1).max(500000),
|
|
1331
|
+
}).strict();
|
|
1332
|
+
|
|
1333
|
+
export const svgAssetSchema = svgassetSvgAssetSchema;
|
|
1334
|
+
|
|
1900
1335
|
/**
|
|
1901
1336
|
* A color stop in a gradient. Each stop defines a color at a specific position
|
|
1902
1337
|
* along the gradient vector. Gradients require at least 2 stops.
|
|
@@ -2194,97 +1629,6 @@ export const svgshapesSvgShapeSchema = z.discriminatedUnion("type", [
|
|
|
2194
1629
|
|
|
2195
1630
|
export const svgShapeSchema = svgshapesSvgShapeSchema;
|
|
2196
1631
|
|
|
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:
|
|
2200
|
-
*
|
|
2201
|
-
* **Option 1: Import SVG markup using `src`**
|
|
2202
|
-
* ```json
|
|
2203
|
-
* {
|
|
2204
|
-
* "type": "svg",
|
|
2205
|
-
* "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
|
|
2206
|
-
* }
|
|
2207
|
-
* ```
|
|
2208
|
-
* When using `src`, no other properties are allowed. The fill, stroke, and dimensions
|
|
2209
|
-
* are automatically extracted from the SVG markup.
|
|
2210
|
-
*
|
|
2211
|
-
* **Option 2: Define shapes programmatically using `shape`**
|
|
2212
|
-
* ```json
|
|
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.
|
|
2224
|
-
*
|
|
2225
|
-
* **Available Shapes (Option 2 only):**
|
|
2226
|
-
* - `rectangle` - Rectangles with optional rounded corners
|
|
2227
|
-
* - `circle` - Perfect circles
|
|
2228
|
-
* - `ellipse` - Ellipses/ovals with separate x and y radii
|
|
2229
|
-
* - `line` - Straight lines with configurable thickness
|
|
2230
|
-
* - `polygon` - Regular polygons (triangle, pentagon, hexagon, etc.)
|
|
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
|
|
2237
|
-
*
|
|
2238
|
-
* See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
|
|
2239
|
-
*
|
|
2240
|
-
*/
|
|
2241
|
-
export const svgassetSvgAssetSchema = z.object({
|
|
2242
|
-
type: z.enum(["svg"]),
|
|
2243
|
-
src: z.optional(z.string().min(1).max(500000)),
|
|
2244
|
-
shape: z.optional(svgshapesSvgShapeSchema),
|
|
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
|
-
});
|
|
2285
|
-
|
|
2286
|
-
export const svgAssetSchema = svgassetSvgAssetSchema;
|
|
2287
|
-
|
|
2288
1632
|
/**
|
|
2289
1633
|
* Configure the id and optional merge fields to render a template by id.
|
|
2290
1634
|
*/
|
|
@@ -3285,27 +2629,3 @@ export const getUploadSignedUrlRequest = z.object({
|
|
|
3285
2629
|
* The id and signed URL to upload to.
|
|
3286
2630
|
*/
|
|
3287
2631
|
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;
|