@shotstack/schemas 1.8.4 → 1.8.6

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