@shotstack/schemas 1.8.3 → 1.8.4

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.
Files changed (37) hide show
  1. package/dist/api.bundled.json +204 -972
  2. package/dist/json-schema/asset.json +3 -936
  3. package/dist/json-schema/clip.json +3 -936
  4. package/dist/json-schema/destinations.json +111 -23
  5. package/dist/json-schema/edit.json +256 -1083
  6. package/dist/json-schema/output.json +106 -0
  7. package/dist/json-schema/rich-caption-asset.json +140 -221
  8. package/dist/json-schema/schemas.json +295 -1207
  9. package/dist/json-schema/svg-asset.json +6 -857
  10. package/dist/json-schema/timeline.json +3 -936
  11. package/dist/json-schema/track.json +3 -936
  12. package/dist/schema.d.ts +68 -695
  13. package/dist/zod/zod.gen.cjs +44 -625
  14. package/dist/zod/zod.gen.d.ts +543 -8241
  15. package/dist/zod/zod.gen.js +38 -618
  16. package/dist/zod/zod.gen.ts +50 -382
  17. package/package.json +1 -1
  18. package/dist/json-schema/svg-arrow-shape.json +0 -49
  19. package/dist/json-schema/svg-circle-shape.json +0 -28
  20. package/dist/json-schema/svg-cross-shape.json +0 -42
  21. package/dist/json-schema/svg-ellipse-shape.json +0 -35
  22. package/dist/json-schema/svg-fill.json +0 -169
  23. package/dist/json-schema/svg-gradient-stop.json +0 -25
  24. package/dist/json-schema/svg-heart-shape.json +0 -28
  25. package/dist/json-schema/svg-line-shape.json +0 -35
  26. package/dist/json-schema/svg-linear-gradient-fill.json +0 -80
  27. package/dist/json-schema/svg-path-shape.json +0 -26
  28. package/dist/json-schema/svg-polygon-shape.json +0 -35
  29. package/dist/json-schema/svg-radial-gradient-fill.json +0 -66
  30. package/dist/json-schema/svg-rectangle-shape.json +0 -49
  31. package/dist/json-schema/svg-ring-shape.json +0 -35
  32. package/dist/json-schema/svg-shadow.json +0 -79
  33. package/dist/json-schema/svg-shape.json +0 -404
  34. package/dist/json-schema/svg-solid-fill.json +0 -40
  35. package/dist/json-schema/svg-star-shape.json +0 -42
  36. package/dist/json-schema/svg-stroke.json +0 -115
  37. package/dist/json-schema/svg-transform.json +0 -93
@@ -801,6 +801,38 @@ export const cropCropSchema = z.object({
801
801
  } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
802
802
  }).strict();
803
803
  export const cropSchema = cropCropSchema;
804
+ /**
805
+ * Pass additional options to control how files are stored in Akamai NetStorage.
806
+ */
807
+ export const akamaiNetStorageDestinationOptionsAkamaiNetStorageDestinationOptionsSchema = z.object({
808
+ host: z.string(),
809
+ cpCode: z.string(),
810
+ path: z.optional(z.unknown()),
811
+ filename: z.optional(z.unknown()),
812
+ }).strict();
813
+ /**
814
+ * Send videos and assets to [Akamai NetStorage](https://techdocs.akamai.com/netstorage-usage/docs). Send files to your NetStorage upload directory with a custom path and filename. Akamai credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/akamai-netstorage), not in the request.
815
+ */
816
+ export const akamaiNetStorageDestinationAkamaiNetStorageDestinationSchema = z.object({
817
+ provider: z.string().default("akamai-netstorage"),
818
+ options: z.optional(akamaiNetStorageDestinationOptionsAkamaiNetStorageDestinationOptionsSchema),
819
+ }).strict();
820
+ /**
821
+ * Pass additional options to control how files are stored in Azure Blob Storage.
822
+ */
823
+ export const azureBlobStorageDestinationOptionsAzureBlobStorageDestinationOptionsSchema = z.object({
824
+ accountName: z.string(),
825
+ container: z.string(),
826
+ prefix: z.optional(z.unknown()),
827
+ filename: z.optional(z.unknown()),
828
+ }).strict();
829
+ /**
830
+ * Send videos and assets to [Azure Blob Storage](https://learn.microsoft.com/en-us/azure/storage/blobs/). Send files to any container with a custom prefix and filename. Azure credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/azure-blob-storage), not in the request.
831
+ */
832
+ export const azureBlobStorageDestinationAzureBlobStorageDestinationSchema = z.object({
833
+ provider: z.string().default("azure-blob-storage"),
834
+ options: z.optional(azureBlobStorageDestinationOptionsAzureBlobStorageDestinationOptionsSchema),
835
+ }).strict();
804
836
  /**
805
837
  * Pass additional options to control how files are stored in Google Cloud Storage.
806
838
  */
@@ -1322,29 +1354,6 @@ export const richcaptionpropertiesRichCaptionActiveFontSchema = z.object({
1322
1354
  } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
1323
1355
  }).strict();
1324
1356
  export const richCaptionActiveFontSchema = richcaptionpropertiesRichCaptionActiveFontSchema;
1325
- /**
1326
- * Font properties for rich captions. Defaults to Roboto.
1327
- */
1328
- export const richcaptionpropertiesRichCaptionFontSchema = z.object({
1329
- family: z.optional(z.string()).default("Roboto"),
1330
- size: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1331
- return undefined; if (Array.isArray(v))
1332
- return v; if (typeof v === 'string') {
1333
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1334
- return v;
1335
- return Number(v);
1336
- } return v; }), z.number().int().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),
1337
- weight: z.optional(z.unknown()).default("400"),
1338
- color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#ffffff"),
1339
- opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1340
- return undefined; if (Array.isArray(v))
1341
- return v; if (typeof v === 'string') {
1342
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1343
- return v;
1344
- return Number(v);
1345
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
1346
- background: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1347
- }).strict();
1348
1357
  /**
1349
1358
  * Word-level animation properties for caption effects.
1350
1359
  */
@@ -1671,7 +1680,7 @@ export const richcaptionassetRichCaptionAssetSchema = z.object({
1671
1680
  type: z.enum(["rich-caption"]),
1672
1681
  src: z.optional(z.string().min(1)),
1673
1682
  words: z.optional(z.array(richcaptionpropertiesWordTimingSchema).max(100000)),
1674
- font: z.optional(richcaptionpropertiesRichCaptionFontSchema),
1683
+ font: z.optional(richtextpropertiesRichTextFontSchema),
1675
1684
  style: z.optional(richtextpropertiesRichTextStyleSchema),
1676
1685
  stroke: z.optional(richtextpropertiesRichTextStrokeSchema),
1677
1686
  shadow: z.optional(richtextpropertiesRichTextShadowSchema),
@@ -2098,612 +2107,23 @@ export const soundtrackSoundtrackSchema = z.object({
2098
2107
  }).strict();
2099
2108
  export const soundtrackSchema = soundtrackSoundtrackSchema;
2100
2109
  /**
2101
- * A color stop in a gradient. Each stop defines a color at a specific position
2102
- * along the gradient vector. Gradients require at least 2 stops.
2103
- *
2104
- */
2105
- export const svgpropertiesSvgGradientStopSchema = z.object({
2106
- offset: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2107
- return undefined; if (Array.isArray(v))
2108
- return v; if (typeof v === 'string') {
2109
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2110
- return v;
2111
- return Number(v);
2112
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2113
- color: z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2114
- }).strict();
2115
- export const svgGradientStopSchema = svgpropertiesSvgGradientStopSchema;
2116
- /**
2117
- * A linear gradient fill that transitions colors along a straight line.
2118
- * The gradient direction is controlled by the `angle` property.
2119
- *
2120
- */
2121
- export const svgpropertiesSvgLinearGradientFillSchema = z.object({
2122
- type: z.enum(["linear"]),
2123
- angle: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2124
- return undefined; if (Array.isArray(v))
2125
- return v; if (typeof v === 'string') {
2126
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2127
- return v;
2128
- return Number(v);
2129
- } return v; }), z.number().gte(0).lte(360)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
2130
- stops: z.array(svgpropertiesSvgGradientStopSchema).min(2),
2131
- opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2132
- return undefined; if (Array.isArray(v))
2133
- return v; if (typeof v === 'string') {
2134
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2135
- return v;
2136
- return Number(v);
2137
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
2138
- }).strict();
2139
- export const svgLinearGradientFillSchema = svgpropertiesSvgLinearGradientFillSchema;
2140
- /**
2141
- * A radial gradient fill that transitions colors radiating outward from a center point.
2142
- * The gradient creates a circular or elliptical color transition.
2110
+ * The SvgAsset is used to create scalable vector graphic (SVG) assets using
2111
+ * raw SVG markup.
2143
2112
  *
2144
- */
2145
- export const svgpropertiesSvgRadialGradientFillSchema = z.object({
2146
- type: z.enum(["radial"]),
2147
- stops: z.array(svgpropertiesSvgGradientStopSchema).min(2),
2148
- opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2149
- return undefined; if (Array.isArray(v))
2150
- return v; if (typeof v === 'string') {
2151
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2152
- return v;
2153
- return Number(v);
2154
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
2155
- }).strict();
2156
- export const svgRadialGradientFillSchema = svgpropertiesSvgRadialGradientFillSchema;
2157
- /**
2158
- * Drop shadow properties for SVG shapes. Creates a shadow effect behind the shape.
2159
- *
2160
- */
2161
- export const svgpropertiesSvgShadowSchema = z.object({
2162
- offsetX: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2163
- return undefined; if (Array.isArray(v))
2164
- return v; if (typeof v === 'string') {
2165
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2166
- return v;
2167
- return Number(v);
2168
- } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
2169
- offsetY: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2170
- return undefined; if (Array.isArray(v))
2171
- return v; if (typeof v === 'string') {
2172
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2173
- return v;
2174
- return Number(v);
2175
- } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
2176
- blur: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2177
- return undefined; if (Array.isArray(v))
2178
- return v; if (typeof v === 'string') {
2179
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2180
- return v;
2181
- return Number(v);
2182
- } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
2183
- color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),
2184
- opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2185
- return undefined; if (Array.isArray(v))
2186
- return v; if (typeof v === 'string') {
2187
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2188
- return v;
2189
- return Number(v);
2190
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5),
2191
- }).strict();
2192
- export const svgShadowSchema = svgpropertiesSvgShadowSchema;
2193
- /**
2194
- * A solid color fill for SVG shapes.
2195
- */
2196
- export const svgpropertiesSvgSolidFillSchema = z.object({
2197
- type: z.enum(["solid"]),
2198
- color: z
2199
- .string()
2200
- .regex(/^#[A-Fa-f0-9]{6}$/)
2201
- .default("#000000"),
2202
- opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2203
- return undefined; if (Array.isArray(v))
2204
- return v; if (typeof v === 'string') {
2205
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2206
- return v;
2207
- return Number(v);
2208
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
2209
- }).strict();
2210
- export const svgSolidFillSchema = svgpropertiesSvgSolidFillSchema;
2211
- /**
2212
- * Fill properties for SVG shapes. Supports solid colors and gradients.
2213
- * The fill defines how the interior of a shape is painted.
2214
- *
2215
- */
2216
- export const svgpropertiesSvgFillSchema = z.discriminatedUnion("type", [
2217
- svgpropertiesSvgSolidFillSchema,
2218
- svgpropertiesSvgLinearGradientFillSchema,
2219
- svgpropertiesSvgRadialGradientFillSchema,
2220
- ]);
2221
- export const svgFillSchema = svgpropertiesSvgFillSchema;
2222
- /**
2223
- * Stroke (outline) properties for SVG shapes. The stroke defines how the outline
2224
- * of a shape is painted, including its color, width, and line style.
2225
- *
2226
- */
2227
- export const svgpropertiesSvgStrokeSchema = z.object({
2228
- color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#000000"),
2229
- width: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2230
- return undefined; if (Array.isArray(v))
2231
- return v; if (typeof v === 'string') {
2232
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2233
- return v;
2234
- return Number(v);
2235
- } return v; }), z.number().gte(0).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
2236
- opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2237
- return undefined; if (Array.isArray(v))
2238
- return v; if (typeof v === 'string') {
2239
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2240
- return v;
2241
- return Number(v);
2242
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
2243
- lineCap: z.optional(z.enum(["butt", "round", "square"])),
2244
- lineJoin: z.optional(z.enum(["miter", "round", "bevel"])),
2245
- dashArray: z.optional(z.array(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2246
- return undefined; if (Array.isArray(v))
2247
- return v; if (typeof v === 'string') {
2248
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2249
- return v;
2250
- return Number(v);
2251
- } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))),
2252
- dashOffset: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2253
- return undefined; if (Array.isArray(v))
2254
- return v; if (typeof v === 'string') {
2255
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2256
- return v;
2257
- return Number(v);
2258
- } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
2259
- }).strict();
2260
- export const svgStrokeSchema = svgpropertiesSvgStrokeSchema;
2261
- /**
2262
- * Transformation properties for positioning, rotating, and scaling SVG shapes.
2263
- *
2264
- */
2265
- export const svgpropertiesSvgTransformSchema = z.object({
2266
- x: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2267
- return undefined; if (Array.isArray(v))
2268
- return v; if (typeof v === 'string') {
2269
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2270
- return v;
2271
- return Number(v);
2272
- } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
2273
- y: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2274
- return undefined; if (Array.isArray(v))
2275
- return v; if (typeof v === 'string') {
2276
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2277
- return v;
2278
- return Number(v);
2279
- } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
2280
- rotation: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2281
- return undefined; if (Array.isArray(v))
2282
- return v; if (typeof v === 'string') {
2283
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2284
- return v;
2285
- return Number(v);
2286
- } return v; }), z.number().gte(-360).lte(360)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
2287
- scale: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2288
- return undefined; if (Array.isArray(v))
2289
- return v; if (typeof v === 'string') {
2290
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2291
- return v;
2292
- return Number(v);
2293
- } return v; }), z.number().gte(0.01).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
2294
- originX: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2295
- return undefined; if (Array.isArray(v))
2296
- return v; if (typeof v === 'string') {
2297
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2298
- return v;
2299
- return Number(v);
2300
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5),
2301
- originY: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2302
- return undefined; if (Array.isArray(v))
2303
- return v; if (typeof v === 'string') {
2304
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2305
- return v;
2306
- return Number(v);
2307
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.5),
2308
- }).strict();
2309
- export const svgTransformSchema = svgpropertiesSvgTransformSchema;
2310
- /**
2311
- * An arrow shape pointing to the right by default.
2312
- * Use transform rotation to change direction.
2313
- *
2314
- */
2315
- export const svgshapesSvgArrowShapeSchema = z.object({
2316
- type: z.enum(["arrow"]),
2317
- length: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2318
- return undefined; if (Array.isArray(v))
2319
- return v; if (typeof v === 'string') {
2320
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2321
- return v;
2322
- return Number(v);
2323
- } return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2324
- headWidth: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2325
- return undefined; if (Array.isArray(v))
2326
- return v; if (typeof v === 'string') {
2327
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2328
- return v;
2329
- return Number(v);
2330
- } return v; }), z.number().gte(1).lte(1000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2331
- headLength: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2332
- return undefined; if (Array.isArray(v))
2333
- return v; if (typeof v === 'string') {
2334
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2335
- return v;
2336
- return Number(v);
2337
- } return v; }), z.number().gte(1).lte(1000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2338
- shaftWidth: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2339
- return undefined; if (Array.isArray(v))
2340
- return v; if (typeof v === 'string') {
2341
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2342
- return v;
2343
- return Number(v);
2344
- } return v; }), z.number().gte(1).lte(1000)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2345
- }).strict();
2346
- export const svgArrowShapeSchema = svgshapesSvgArrowShapeSchema;
2347
- /**
2348
- * A perfect circle shape defined by its radius.
2349
- * The circle is centered at the shape's position.
2350
- *
2351
- */
2352
- export const svgshapesSvgCircleShapeSchema = z.object({
2353
- type: z.enum(["circle"]),
2354
- radius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2355
- return undefined; if (Array.isArray(v))
2356
- return v; if (typeof v === 'string') {
2357
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2358
- return v;
2359
- return Number(v);
2360
- } return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2361
- }).strict();
2362
- export const svgCircleShapeSchema = svgshapesSvgCircleShapeSchema;
2363
- /**
2364
- * A cross or plus shape with equal or different arm lengths.
2365
- * Can be styled as a plus sign (+) or a cross (x with rotation).
2366
- *
2367
- */
2368
- export const svgshapesSvgCrossShapeSchema = z.object({
2369
- type: z.enum(["cross"]),
2370
- width: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2371
- return undefined; if (Array.isArray(v))
2372
- return v; if (typeof v === 'string') {
2373
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2374
- return v;
2375
- return Number(v);
2376
- } return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2377
- height: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2378
- return undefined; if (Array.isArray(v))
2379
- return v; if (typeof v === 'string') {
2380
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2381
- return v;
2382
- return Number(v);
2383
- } return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2384
- thickness: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2385
- return undefined; if (Array.isArray(v))
2386
- return v; if (typeof v === 'string') {
2387
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2388
- return v;
2389
- return Number(v);
2390
- } return v; }), z.number().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2391
- }).strict();
2392
- export const svgCrossShapeSchema = svgshapesSvgCrossShapeSchema;
2393
- /**
2394
- * An ellipse (oval) shape with separate horizontal and vertical radii.
2395
- * The ellipse is centered at the shape's position.
2396
- *
2397
- */
2398
- export const svgshapesSvgEllipseShapeSchema = z.object({
2399
- type: z.enum(["ellipse"]),
2400
- radiusX: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2401
- return undefined; if (Array.isArray(v))
2402
- return v; if (typeof v === 'string') {
2403
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2404
- return v;
2405
- return Number(v);
2406
- } return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2407
- radiusY: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2408
- return undefined; if (Array.isArray(v))
2409
- return v; if (typeof v === 'string') {
2410
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2411
- return v;
2412
- return Number(v);
2413
- } return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2414
- }).strict();
2415
- export const svgEllipseShapeSchema = svgshapesSvgEllipseShapeSchema;
2416
- /**
2417
- * A heart shape commonly used for love/like icons.
2418
- * The heart is defined by a single size parameter.
2419
- *
2420
- */
2421
- export const svgshapesSvgHeartShapeSchema = z.object({
2422
- type: z.enum(["heart"]),
2423
- size: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2424
- return undefined; if (Array.isArray(v))
2425
- return v; if (typeof v === 'string') {
2426
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2427
- return v;
2428
- return Number(v);
2429
- } return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2430
- }).strict();
2431
- export const svgHeartShapeSchema = svgshapesSvgHeartShapeSchema;
2432
- /**
2433
- * A straight line shape with a specified length and thickness.
2434
- * The line is drawn horizontally by default and can be rotated using transform.
2435
- *
2436
- */
2437
- export const svgshapesSvgLineShapeSchema = z.object({
2438
- type: z.enum(["line"]),
2439
- length: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2440
- return undefined; if (Array.isArray(v))
2441
- return v; if (typeof v === 'string') {
2442
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2443
- return v;
2444
- return Number(v);
2445
- } return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2446
- thickness: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2447
- return undefined; if (Array.isArray(v))
2448
- return v; if (typeof v === 'string') {
2449
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2450
- return v;
2451
- return Number(v);
2452
- } return v; }), z.number().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2453
- }).strict();
2454
- export const svgLineShapeSchema = svgshapesSvgLineShapeSchema;
2455
- /**
2456
- * A custom shape defined by SVG path data.
2457
- * Supports all standard SVG path commands for creating complex shapes.
2458
- *
2459
- * **Path Commands:**
2460
- * - `M x y` / `m dx dy` - Move to (absolute/relative)
2461
- * - `L x y` / `l dx dy` - Line to
2462
- * - `H x` / `h dx` - Horizontal line to
2463
- * - `V y` / `v dy` - Vertical line to
2464
- * - `C x1 y1 x2 y2 x y` / `c` - Cubic Bezier curve
2465
- * - `S x2 y2 x y` / `s` - Smooth cubic Bezier
2466
- * - `Q x1 y1 x y` / `q` - Quadratic Bezier curve
2467
- * - `T x y` / `t` - Smooth quadratic Bezier
2468
- * - `A rx ry angle large-arc sweep x y` / `a` - Elliptical arc
2469
- * - `Z` / `z` - Close path
2470
- *
2471
- */
2472
- export const svgshapesSvgPathShapeSchema = z.object({
2473
- type: z.enum(["path"]),
2474
- d: z.string().min(1).max(100000),
2475
- }).strict();
2476
- export const svgPathShapeSchema = svgshapesSvgPathShapeSchema;
2477
- /**
2478
- * A regular polygon shape with a specified number of sides.
2479
- * Examples: triangle (3), square (4), pentagon (5), hexagon (6), etc.
2480
- * The polygon is inscribed in a circle of the given radius.
2481
- *
2482
- */
2483
- export const svgshapesSvgPolygonShapeSchema = z.object({
2484
- type: z.enum(["polygon"]),
2485
- sides: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2486
- return undefined; if (Array.isArray(v))
2487
- return v; if (typeof v === 'string') {
2488
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2489
- return v;
2490
- return Number(v);
2491
- } return v; }), z.number().int().gte(3).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2492
- radius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2493
- return undefined; if (Array.isArray(v))
2494
- return v; if (typeof v === 'string') {
2495
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2496
- return v;
2497
- return Number(v);
2498
- } return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2499
- }).strict();
2500
- export const svgPolygonShapeSchema = svgshapesSvgPolygonShapeSchema;
2501
- /**
2502
- * A rectangle shape with optional rounded corners.
2503
- * The rectangle is defined by its width and height dimensions.
2504
- *
2505
- */
2506
- export const svgshapesSvgRectangleShapeSchema = z.object({
2507
- type: z.enum(["rectangle"]),
2508
- width: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2509
- return undefined; if (Array.isArray(v))
2510
- return v; if (typeof v === 'string') {
2511
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2512
- return v;
2513
- return Number(v);
2514
- } return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2515
- height: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2516
- return undefined; if (Array.isArray(v))
2517
- return v; if (typeof v === 'string') {
2518
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2519
- return v;
2520
- return Number(v);
2521
- } return v; }), z.number().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2522
- cornerRadius: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2523
- return undefined; if (Array.isArray(v))
2524
- return v; if (typeof v === 'string') {
2525
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2526
- return v;
2527
- return Number(v);
2528
- } return v; }), z.number().gte(0).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
2529
- }).strict();
2530
- export const svgRectangleShapeSchema = svgshapesSvgRectangleShapeSchema;
2531
- /**
2532
- * A ring (donut/annulus) shape - a circle with a circular hole in the center.
2533
- * The ring is defined by outer and inner radii.
2534
- *
2535
- */
2536
- export const svgshapesSvgRingShapeSchema = z.object({
2537
- type: z.enum(["ring"]),
2538
- outerRadius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2539
- return undefined; if (Array.isArray(v))
2540
- return v; if (typeof v === 'string') {
2541
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2542
- return v;
2543
- return Number(v);
2544
- } return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2545
- innerRadius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2546
- return undefined; if (Array.isArray(v))
2547
- return v; if (typeof v === 'string') {
2548
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2549
- return v;
2550
- return Number(v);
2551
- } return v; }), z.number().gte(0).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2552
- }).strict();
2553
- export const svgRingShapeSchema = svgshapesSvgRingShapeSchema;
2554
- /**
2555
- * A star shape with a specified number of points.
2556
- * The star is defined by outer and inner radii, creating the characteristic
2557
- * pointed appearance.
2558
- *
2559
- */
2560
- export const svgshapesSvgStarShapeSchema = z.object({
2561
- type: z.enum(["star"]),
2562
- points: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2563
- return undefined; if (Array.isArray(v))
2564
- return v; if (typeof v === 'string') {
2565
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2566
- return v;
2567
- return Number(v);
2568
- } return v; }), z.number().int().gte(3).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2569
- outerRadius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2570
- return undefined; if (Array.isArray(v))
2571
- return v; if (typeof v === 'string') {
2572
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2573
- return v;
2574
- return Number(v);
2575
- } return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2576
- innerRadius: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2577
- return undefined; if (Array.isArray(v))
2578
- return v; if (typeof v === 'string') {
2579
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2580
- return v;
2581
- return Number(v);
2582
- } return v; }), z.number().gte(1).lte(2048)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
2583
- }).strict();
2584
- export const svgStarShapeSchema = svgshapesSvgStarShapeSchema;
2585
- /**
2586
- * The shape definition for an SVG asset. Each shape type has its own specific
2587
- * properties. The `type` field determines which shape is rendered.
2588
- *
2589
- */
2590
- export const svgshapesSvgShapeSchema = z.discriminatedUnion("type", [
2591
- svgshapesSvgRectangleShapeSchema,
2592
- svgshapesSvgCircleShapeSchema,
2593
- svgshapesSvgEllipseShapeSchema,
2594
- svgshapesSvgLineShapeSchema,
2595
- svgshapesSvgPolygonShapeSchema,
2596
- svgshapesSvgStarShapeSchema,
2597
- svgshapesSvgArrowShapeSchema,
2598
- svgshapesSvgHeartShapeSchema,
2599
- svgshapesSvgCrossShapeSchema,
2600
- svgshapesSvgRingShapeSchema,
2601
- svgshapesSvgPathShapeSchema,
2602
- ]);
2603
- export const svgShapeSchema = svgshapesSvgShapeSchema;
2604
- /**
2605
- * The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.
2606
- * It provides two mutually exclusive ways to define shapes:
2607
- *
2608
- * **Option 1: Import SVG markup using `src`**
2609
2113
  * ```json
2610
2114
  * {
2611
2115
  * "type": "svg",
2612
2116
  * "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
2613
2117
  * }
2614
2118
  * ```
2615
- * When using `src`, no other properties are allowed. The fill, stroke, and dimensions
2616
- * are automatically extracted from the SVG markup.
2617
- *
2618
- * **Option 2: Define shapes programmatically using `shape`**
2619
- * ```json
2620
- * {
2621
- * "type": "svg",
2622
- * "shape": { "type": "circle", "radius": 50 },
2623
- * "fill": { "type": "solid", "color": "#FF0000" }
2624
- * }
2625
- * ```
2626
- * When using `shape`, you can customize fill, stroke, shadow, transform, and other properties.
2627
- * The `src` property is not allowed in this mode.
2628
- *
2629
- * **Important:** You must provide either `src` OR `shape`, but not both.
2630
- * These two modes are mutually exclusive.
2631
- *
2632
- * **Available Shapes (Option 2 only):**
2633
- * - `rectangle` - Rectangles with optional rounded corners
2634
- * - `circle` - Perfect circles
2635
- * - `ellipse` - Ellipses/ovals with separate x and y radii
2636
- * - `line` - Straight lines with configurable thickness
2637
- * - `polygon` - Regular polygons (triangle, pentagon, hexagon, etc.)
2638
- * - `star` - Multi-pointed stars
2639
- * - `arrow` - Directional arrows
2640
- * - `heart` - Heart shapes
2641
- * - `cross` - Plus/cross shapes
2642
- * - `ring` - Donut/ring shapes
2643
- * - `path` - Custom shapes using SVG path data
2644
2119
  *
2645
- * See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
2120
+ * See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for SVG markup syntax.
2646
2121
  *
2647
2122
  */
2648
2123
  export const svgassetSvgAssetSchema = z.object({
2649
2124
  type: z.enum(["svg"]),
2650
- src: z.optional(z.string().min(1).max(500000)),
2651
- shape: z.optional(svgshapesSvgShapeSchema),
2652
- fill: z.optional(svgpropertiesSvgFillSchema),
2653
- stroke: z.optional(svgpropertiesSvgStrokeSchema),
2654
- shadow: z.optional(svgpropertiesSvgShadowSchema),
2655
- transform: z.optional(svgpropertiesSvgTransformSchema),
2656
- opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2657
- return undefined; if (Array.isArray(v))
2658
- return v; if (typeof v === 'string') {
2659
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2660
- return v;
2661
- return Number(v);
2662
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
2663
- width: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2664
- return undefined; if (Array.isArray(v))
2665
- return v; if (typeof v === 'string') {
2666
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2667
- return v;
2668
- return Number(v);
2669
- } return v; }), z.number().int().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
2670
- height: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2671
- return undefined; if (Array.isArray(v))
2672
- return v; if (typeof v === 'string') {
2673
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
2674
- return v;
2675
- return Number(v);
2676
- } return v; }), z.number().int().gte(1).lte(4096)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
2677
- }).strict().superRefine((data, ctx) => {
2678
- const hasShape = data.shape !== undefined;
2679
- const hasSrc = data.src !== undefined && data.src.trim() !== "";
2680
- if (!hasShape && !hasSrc) {
2681
- ctx.addIssue({
2682
- code: z.ZodIssueCode.custom,
2683
- message: "Either 'src' or 'shape' must be provided",
2684
- path: [],
2685
- });
2686
- }
2687
- if (hasShape && hasSrc) {
2688
- ctx.addIssue({
2689
- code: z.ZodIssueCode.custom,
2690
- message: "Provide either 'src' or 'shape', not both",
2691
- path: ["src"],
2692
- });
2693
- }
2694
- if (hasSrc) {
2695
- const disallowedProps = ["shape", "fill", "stroke", "shadow", "transform", "width", "height"];
2696
- for (const prop of disallowedProps) {
2697
- if (data[prop] !== undefined) {
2698
- ctx.addIssue({
2699
- code: z.ZodIssueCode.custom,
2700
- message: `'${prop}' is not allowed when using 'src'. Only 'type' and 'src' are allowed in import mode`,
2701
- path: [prop],
2702
- });
2703
- }
2704
- }
2705
- }
2706
- });
2125
+ src: z.string().min(1).max(500000),
2126
+ }).strict();
2707
2127
  export const svgAssetSchema = svgassetSvgAssetSchema;
2708
2128
  /**
2709
2129
  * Configure the id and optional merge fields to render a template by id.