@shotstack/schemas 1.3.8 → 1.4.0

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.
@@ -2056,7 +2056,7 @@
2056
2056
  ]
2057
2057
  },
2058
2058
  "SvgAsset": {
2059
- "description": "The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.\nIt provides a comprehensive set of primitive shapes and custom paths with full\nstyling support including fills, strokes, gradients, and shadows.\n\n**Available Shapes:**\n- `rectangle` - Rectangles with optional rounded corners\n- `circle` - Perfect circles\n- `ellipse` - Ellipses/ovals with separate x and y radii\n- `line` - Straight lines with configurable thickness\n- `polygon` - Regular polygons (triangle, pentagon, hexagon, etc.)\n- `star` - Multi-pointed stars\n- `arrow` - Directional arrows\n- `heart` - Heart shapes\n- `cross` - Plus/cross shapes\n- `ring` - Donut/ring shapes\n- `path` - Custom shapes using SVG path data\n\n**Styling Options:**\n- Fill with solid colors or linear/radial gradients\n- Stroke with configurable width, color, dash patterns, and line caps/joins\n- Drop shadows with blur, offset, and opacity\n- Transform properties for positioning, rotation, and scaling\n\nSee [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.\n",
2059
+ "description": "The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.\nIt provides two mutually exclusive ways to define shapes:\n\n**Option 1: Import SVG markup using `src`**\n```json\n{\n \"type\": \"svg\",\n \"src\": \"<svg width=\\\"100\\\" height=\\\"100\\\"><circle cx=\\\"50\\\" cy=\\\"50\\\" r=\\\"40\\\" fill=\\\"#FF0000\\\"/></svg>\"\n}\n```\nWhen using `src`, no other properties are allowed. The fill, stroke, and dimensions\nare automatically extracted from the SVG markup.\n\n**Option 2: Define shapes programmatically using `shape`**\n```json\n{\n \"type\": \"svg\",\n \"shape\": { \"type\": \"circle\", \"radius\": 50 },\n \"fill\": { \"type\": \"solid\", \"color\": \"#FF0000\" }\n}\n```\nWhen using `shape`, you can customize fill, stroke, shadow, transform, and other properties.\nThe `src` property is not allowed in this mode.\n\n**Important:** You must provide either `src` OR `shape`, but not both.\nThese two modes are mutually exclusive.\n\n**Available Shapes (Option 2 only):**\n- `rectangle` - Rectangles with optional rounded corners\n- `circle` - Perfect circles\n- `ellipse` - Ellipses/ovals with separate x and y radii\n- `line` - Straight lines with configurable thickness\n- `polygon` - Regular polygons (triangle, pentagon, hexagon, etc.)\n- `star` - Multi-pointed stars\n- `arrow` - Directional arrows\n- `heart` - Heart shapes\n- `cross` - Plus/cross shapes\n- `ring` - Donut/ring shapes\n- `path` - Custom shapes using SVG path data\n\nSee [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.\n",
2060
2060
  "type": "object",
2061
2061
  "properties": {
2062
2062
  "type": {
@@ -2068,28 +2068,35 @@
2068
2068
  "default": "svg",
2069
2069
  "example": "svg"
2070
2070
  },
2071
+ "src": {
2072
+ "description": "Raw SVG markup string to import. When provided, the shape is extracted\nautomatically from the SVG content.\n\n**Supported elements:** `<path>`, `<rect>`, `<circle>`, `<ellipse>`,\n`<line>`, `<polygon>`, `<polyline>`\n\n**Automatically extracted:**\n- Path data (converted to a single combined path)\n- Fill color (from `fill` attribute or `style`)\n- Stroke color and width (from attributes or `style`)\n- Dimensions (from `width`/`height` or `viewBox`)\n- Opacity (from `opacity` attribute)\n\n**Important:** When using `src`, no other properties (shape, fill, stroke, etc.)\nare allowed. All styling must be defined within the SVG markup itself.\n",
2073
+ "type": "string",
2074
+ "minLength": 1,
2075
+ "maxLength": 500000,
2076
+ "example": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#3498db\"/></svg>"
2077
+ },
2071
2078
  "shape": {
2072
- "description": "The shape definition. The `type` property within determines the shape kind\nand its specific properties. See individual shape documentation for details.\n",
2079
+ "description": "The shape definition using primitives. The `type` property within determines\nthe shape kind and its specific properties.\n\n**Important:** When using `shape`, the `src` property is not allowed.\n",
2073
2080
  "$ref": "#/components/schemas/SvgShape"
2074
2081
  },
2075
2082
  "fill": {
2076
- "description": "Fill properties for the shape interior.\nCan be a solid color or a gradient (linear/radial).\nIf omitted, the shape will have no fill (transparent interior).\n",
2083
+ "description": "Fill properties for the shape interior.\nCan be a solid color or a gradient (linear/radial).\nIf omitted, the shape will have no fill (transparent interior).\n\n**Note:** Only allowed when using `shape`, not with `src`.\n",
2077
2084
  "$ref": "#/components/schemas/SvgFill"
2078
2085
  },
2079
2086
  "stroke": {
2080
- "description": "Stroke (outline) properties for the shape.\nIf omitted, the shape will have no stroke (no outline).\n",
2087
+ "description": "Stroke (outline) properties for the shape.\nIf omitted, the shape will have no stroke (no outline).\n\n**Note:** Only allowed when using `shape`, not with `src`.\n",
2081
2088
  "$ref": "#/components/schemas/SvgStroke"
2082
2089
  },
2083
2090
  "shadow": {
2084
- "description": "Drop shadow properties for the shape.\nCreates a shadow effect behind the shape.\n",
2091
+ "description": "Drop shadow properties for the shape.\nCreates a shadow effect behind the shape.\n\n**Note:** Only allowed when using `shape`, not with `src`.\n",
2085
2092
  "$ref": "#/components/schemas/SvgShadow"
2086
2093
  },
2087
2094
  "transform": {
2088
- "description": "Transform properties for positioning, rotating, and scaling the shape.\nThe transform is applied relative to the transformation origin.\n",
2095
+ "description": "Transform properties for positioning, rotating, and scaling the shape.\nThe transform is applied relative to the transformation origin.\n\n**Note:** Only allowed when using `shape`, not with `src`.\n",
2089
2096
  "$ref": "#/components/schemas/SvgTransform"
2090
2097
  },
2091
2098
  "opacity": {
2092
- "description": "The overall opacity of the entire shape (including fill, stroke, and shadow).\n`1` is fully opaque, `0` is fully transparent.\nThis is applied on top of individual fill/stroke/shadow opacity values.\n",
2099
+ "description": "The overall opacity of the entire shape (including fill, stroke, and shadow).\n`1` is fully opaque, `0` is fully transparent.\nThis is applied on top of individual fill/stroke/shadow opacity values.\n\n**Note:** Only allowed when using `shape`, not with `src`.\n",
2093
2100
  "type": "number",
2094
2101
  "minimum": 0,
2095
2102
  "maximum": 1,
@@ -2097,14 +2104,14 @@
2097
2104
  "example": 1
2098
2105
  },
2099
2106
  "width": {
2100
- "description": "The width of the bounding box in pixels.\nIf specified, the shape may be scaled to fit within this width.\nIf omitted, the shape uses its natural dimensions.\n",
2107
+ "description": "The width of the bounding box in pixels.\nIf specified, the shape may be scaled to fit within this width.\nIf omitted, the shape uses its natural dimensions.\n\n**Note:** Only allowed when using `shape`, not with `src`.\n",
2101
2108
  "type": "integer",
2102
2109
  "minimum": 1,
2103
2110
  "maximum": 4096,
2104
2111
  "example": 400
2105
2112
  },
2106
2113
  "height": {
2107
- "description": "The height of the bounding box in pixels.\nIf specified, the shape may be scaled to fit within this height.\nIf omitted, the shape uses its natural dimensions.\n",
2114
+ "description": "The height of the bounding box in pixels.\nIf specified, the shape may be scaled to fit within this height.\nIf omitted, the shape uses its natural dimensions.\n\n**Note:** Only allowed when using `shape`, not with `src`.\n",
2108
2115
  "type": "integer",
2109
2116
  "minimum": 1,
2110
2117
  "maximum": 4096,
@@ -2112,8 +2119,7 @@
2112
2119
  }
2113
2120
  },
2114
2121
  "required": [
2115
- "type",
2116
- "shape"
2122
+ "type"
2117
2123
  ],
2118
2124
  "example": {
2119
2125
  "type": "svg",
@@ -3134,7 +3140,7 @@
3134
3140
  "description": "Rotate a clip by the specified angle in degrees. Use a number or an array of [Tween](./#tocs_tween) objects to create a custom animation.",
3135
3141
  "oneOf": [
3136
3142
  {
3137
- "type": "integer",
3143
+ "type": "number",
3138
3144
  "description": "The angle to rotate the clip. Can be 0 to 360, or 0 to -360. Using a positive number rotates the clip clockwise, negative numbers counter-clockwise.",
3139
3145
  "format": "float",
3140
3146
  "minimum": -360,
@@ -6223,7 +6229,7 @@
6223
6229
  },
6224
6230
  "height": {
6225
6231
  "description": "The height in pixels of the ingested source file, if a video or image.",
6226
- "type": "string",
6232
+ "type": "integer",
6227
6233
  "example": 1080
6228
6234
  },
6229
6235
  "duration": {
package/dist/schema.d.ts CHANGED
@@ -1149,10 +1149,33 @@ export interface components {
1149
1149
  };
1150
1150
  /**
1151
1151
  * @description The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.
1152
- * It provides a comprehensive set of primitive shapes and custom paths with full
1153
- * styling support including fills, strokes, gradients, and shadows.
1152
+ * It provides two mutually exclusive ways to define shapes:
1154
1153
  *
1155
- * **Available Shapes:**
1154
+ * **Option 1: Import SVG markup using `src`**
1155
+ * ```json
1156
+ * {
1157
+ * "type": "svg",
1158
+ * "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
1159
+ * }
1160
+ * ```
1161
+ * When using `src`, no other properties are allowed. The fill, stroke, and dimensions
1162
+ * are automatically extracted from the SVG markup.
1163
+ *
1164
+ * **Option 2: Define shapes programmatically using `shape`**
1165
+ * ```json
1166
+ * {
1167
+ * "type": "svg",
1168
+ * "shape": { "type": "circle", "radius": 50 },
1169
+ * "fill": { "type": "solid", "color": "#FF0000" }
1170
+ * }
1171
+ * ```
1172
+ * When using `shape`, you can customize fill, stroke, shadow, transform, and other properties.
1173
+ * The `src` property is not allowed in this mode.
1174
+ *
1175
+ * **Important:** You must provide either `src` OR `shape`, but not both.
1176
+ * These two modes are mutually exclusive.
1177
+ *
1178
+ * **Available Shapes (Option 2 only):**
1156
1179
  * - `rectangle` - Rectangles with optional rounded corners
1157
1180
  * - `circle` - Perfect circles
1158
1181
  * - `ellipse` - Ellipses/ovals with separate x and y radii
@@ -1165,12 +1188,6 @@ export interface components {
1165
1188
  * - `ring` - Donut/ring shapes
1166
1189
  * - `path` - Custom shapes using SVG path data
1167
1190
  *
1168
- * **Styling Options:**
1169
- * - Fill with solid colors or linear/radial gradients
1170
- * - Stroke with configurable width, color, dash patterns, and line caps/joins
1171
- * - Drop shadows with blur, offset, and opacity
1172
- * - Transform properties for positioning, rotation, and scaling
1173
- *
1174
1191
  * See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
1175
1192
  * @example {
1176
1193
  * "type": "svg",
@@ -1218,35 +1235,66 @@ export interface components {
1218
1235
  */
1219
1236
  type: "svg";
1220
1237
  /**
1221
- * @description The shape definition. The `type` property within determines the shape kind
1222
- * and its specific properties. See individual shape documentation for details.
1238
+ * @description Raw SVG markup string to import. When provided, the shape is extracted
1239
+ * automatically from the SVG content.
1240
+ *
1241
+ * **Supported elements:** `<path>`, `<rect>`, `<circle>`, `<ellipse>`,
1242
+ * `<line>`, `<polygon>`, `<polyline>`
1243
+ *
1244
+ * **Automatically extracted:**
1245
+ * - Path data (converted to a single combined path)
1246
+ * - Fill color (from `fill` attribute or `style`)
1247
+ * - Stroke color and width (from attributes or `style`)
1248
+ * - Dimensions (from `width`/`height` or `viewBox`)
1249
+ * - Opacity (from `opacity` attribute)
1250
+ *
1251
+ * **Important:** When using `src`, no other properties (shape, fill, stroke, etc.)
1252
+ * are allowed. All styling must be defined within the SVG markup itself.
1253
+ * @example <svg width="100" height="100"><circle cx="50" cy="50" r="40" fill="#3498db"/></svg>
1223
1254
  */
1224
- shape: components["schemas"]["SvgShape"];
1255
+ src?: string;
1256
+ /**
1257
+ * @description The shape definition using primitives. The `type` property within determines
1258
+ * the shape kind and its specific properties.
1259
+ *
1260
+ * **Important:** When using `shape`, the `src` property is not allowed.
1261
+ */
1262
+ shape?: components["schemas"]["SvgShape"];
1225
1263
  /**
1226
1264
  * @description Fill properties for the shape interior.
1227
1265
  * Can be a solid color or a gradient (linear/radial).
1228
1266
  * If omitted, the shape will have no fill (transparent interior).
1267
+ *
1268
+ * **Note:** Only allowed when using `shape`, not with `src`.
1229
1269
  */
1230
1270
  fill?: components["schemas"]["SvgFill"];
1231
1271
  /**
1232
1272
  * @description Stroke (outline) properties for the shape.
1233
1273
  * If omitted, the shape will have no stroke (no outline).
1274
+ *
1275
+ * **Note:** Only allowed when using `shape`, not with `src`.
1234
1276
  */
1235
1277
  stroke?: components["schemas"]["SvgStroke"];
1236
1278
  /**
1237
1279
  * @description Drop shadow properties for the shape.
1238
1280
  * Creates a shadow effect behind the shape.
1281
+ *
1282
+ * **Note:** Only allowed when using `shape`, not with `src`.
1239
1283
  */
1240
1284
  shadow?: components["schemas"]["SvgShadow"];
1241
1285
  /**
1242
1286
  * @description Transform properties for positioning, rotating, and scaling the shape.
1243
1287
  * The transform is applied relative to the transformation origin.
1288
+ *
1289
+ * **Note:** Only allowed when using `shape`, not with `src`.
1244
1290
  */
1245
1291
  transform?: components["schemas"]["SvgTransform"];
1246
1292
  /**
1247
1293
  * @description The overall opacity of the entire shape (including fill, stroke, and shadow).
1248
1294
  * `1` is fully opaque, `0` is fully transparent.
1249
1295
  * This is applied on top of individual fill/stroke/shadow opacity values.
1296
+ *
1297
+ * **Note:** Only allowed when using `shape`, not with `src`.
1250
1298
  * @default 1
1251
1299
  * @example 1
1252
1300
  */
@@ -1255,6 +1303,8 @@ export interface components {
1255
1303
  * @description The width of the bounding box in pixels.
1256
1304
  * If specified, the shape may be scaled to fit within this width.
1257
1305
  * If omitted, the shape uses its natural dimensions.
1306
+ *
1307
+ * **Note:** Only allowed when using `shape`, not with `src`.
1258
1308
  * @example 400
1259
1309
  */
1260
1310
  width?: number;
@@ -1262,6 +1312,8 @@ export interface components {
1262
1312
  * @description The height of the bounding box in pixels.
1263
1313
  * If specified, the shape may be scaled to fit within this height.
1264
1314
  * If omitted, the shape uses its natural dimensions.
1315
+ *
1316
+ * **Note:** Only allowed when using `shape`, not with `src`.
1265
1317
  * @example 300
1266
1318
  */
1267
1319
  height?: number;
@@ -4130,7 +4182,7 @@ export interface components {
4130
4182
  * @description The height in pixels of the ingested source file, if a video or image.
4131
4183
  * @example 1080
4132
4184
  */
4133
- height?: string;
4185
+ height?: number;
4134
4186
  /**
4135
4187
  * Format: float
4136
4188
  * @description The duration in seconds of the ingested source file, if a video or audio file.
@@ -1430,7 +1430,7 @@ exports.sourceresponseattributesSourceResponseAttributesSchema = zod_1.z.object(
1430
1430
  status: zod_1.z.optional(zod_1.z.enum(["queued", "importing", "ready", "failed", "deleted", "overwritten"])),
1431
1431
  outputs: zod_1.z.optional(exports.outputsresponseOutputsResponseSchema),
1432
1432
  width: zod_1.z.optional(zod_1.z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), zod_1.z.coerce.number().int())),
1433
- height: zod_1.z.optional(zod_1.z.string()),
1433
+ height: zod_1.z.optional(zod_1.z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), zod_1.z.coerce.number().int())),
1434
1434
  duration: zod_1.z.optional(zod_1.z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), zod_1.z.coerce.number())),
1435
1435
  fps: zod_1.z.optional(zod_1.z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), zod_1.z.coerce.number())),
1436
1436
  created: zod_1.z.optional(zod_1.z.string()),
@@ -1734,10 +1734,33 @@ exports.svgshapesSvgShapeSchema = zod_1.z.discriminatedUnion("type", [
1734
1734
  exports.svgShapeSchema = exports.svgshapesSvgShapeSchema;
1735
1735
  /**
1736
1736
  * The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.
1737
- * It provides a comprehensive set of primitive shapes and custom paths with full
1738
- * styling support including fills, strokes, gradients, and shadows.
1737
+ * It provides two mutually exclusive ways to define shapes:
1738
+ *
1739
+ * **Option 1: Import SVG markup using `src`**
1740
+ * ```json
1741
+ * {
1742
+ * "type": "svg",
1743
+ * "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
1744
+ * }
1745
+ * ```
1746
+ * When using `src`, no other properties are allowed. The fill, stroke, and dimensions
1747
+ * are automatically extracted from the SVG markup.
1748
+ *
1749
+ * **Option 2: Define shapes programmatically using `shape`**
1750
+ * ```json
1751
+ * {
1752
+ * "type": "svg",
1753
+ * "shape": { "type": "circle", "radius": 50 },
1754
+ * "fill": { "type": "solid", "color": "#FF0000" }
1755
+ * }
1756
+ * ```
1757
+ * When using `shape`, you can customize fill, stroke, shadow, transform, and other properties.
1758
+ * The `src` property is not allowed in this mode.
1739
1759
  *
1740
- * **Available Shapes:**
1760
+ * **Important:** You must provide either `src` OR `shape`, but not both.
1761
+ * These two modes are mutually exclusive.
1762
+ *
1763
+ * **Available Shapes (Option 2 only):**
1741
1764
  * - `rectangle` - Rectangles with optional rounded corners
1742
1765
  * - `circle` - Perfect circles
1743
1766
  * - `ellipse` - Ellipses/ovals with separate x and y radii
@@ -1750,18 +1773,13 @@ exports.svgShapeSchema = exports.svgshapesSvgShapeSchema;
1750
1773
  * - `ring` - Donut/ring shapes
1751
1774
  * - `path` - Custom shapes using SVG path data
1752
1775
  *
1753
- * **Styling Options:**
1754
- * - Fill with solid colors or linear/radial gradients
1755
- * - Stroke with configurable width, color, dash patterns, and line caps/joins
1756
- * - Drop shadows with blur, offset, and opacity
1757
- * - Transform properties for positioning, rotation, and scaling
1758
- *
1759
1776
  * See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
1760
1777
  *
1761
1778
  */
1762
1779
  exports.svgassetSvgAssetSchema = zod_1.z.object({
1763
1780
  type: zod_1.z.enum(["svg"]),
1764
- shape: exports.svgshapesSvgShapeSchema,
1781
+ src: zod_1.z.optional(zod_1.z.string().min(1).max(500000)),
1782
+ shape: zod_1.z.optional(exports.svgshapesSvgShapeSchema),
1765
1783
  fill: zod_1.z.optional(exports.svgpropertiesSvgFillSchema),
1766
1784
  stroke: zod_1.z.optional(exports.svgpropertiesSvgStrokeSchema),
1767
1785
  shadow: zod_1.z.optional(exports.svgpropertiesSvgShadowSchema),
@@ -1769,6 +1787,35 @@ exports.svgassetSvgAssetSchema = zod_1.z.object({
1769
1787
  opacity: zod_1.z.optional(zod_1.z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), zod_1.z.coerce.number().gte(0).lte(1))).default(1),
1770
1788
  width: zod_1.z.optional(zod_1.z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), zod_1.z.coerce.number().int().gte(1).lte(4096))),
1771
1789
  height: zod_1.z.optional(zod_1.z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), zod_1.z.coerce.number().int().gte(1).lte(4096))),
1790
+ }).superRefine((data, ctx) => {
1791
+ const hasShape = data.shape !== undefined;
1792
+ const hasSrc = data.src !== undefined && data.src.trim() !== "";
1793
+ if (!hasShape && !hasSrc) {
1794
+ ctx.addIssue({
1795
+ code: zod_1.z.ZodIssueCode.custom,
1796
+ message: "Either 'src' or 'shape' must be provided",
1797
+ path: [],
1798
+ });
1799
+ }
1800
+ if (hasShape && hasSrc) {
1801
+ ctx.addIssue({
1802
+ code: zod_1.z.ZodIssueCode.custom,
1803
+ message: "Provide either 'src' or 'shape', not both",
1804
+ path: ["src"],
1805
+ });
1806
+ }
1807
+ if (hasSrc) {
1808
+ const disallowedProps = ["shape", "fill", "stroke", "shadow", "transform", "width", "height"];
1809
+ for (const prop of disallowedProps) {
1810
+ if (data[prop] !== undefined) {
1811
+ ctx.addIssue({
1812
+ code: zod_1.z.ZodIssueCode.custom,
1813
+ message: `'${prop}' is not allowed when using 'src'. Only 'type' and 'src' are allowed in import mode`,
1814
+ path: [prop],
1815
+ });
1816
+ }
1817
+ }
1818
+ }
1772
1819
  });
1773
1820
  exports.svgAssetSchema = exports.svgassetSvgAssetSchema;
1774
1821
  /**
@@ -2097,7 +2144,7 @@ exports.offsetSchema = exports.offsetOffsetSchema;
2097
2144
  * Rotate a clip by the specified angle in degrees. Rotation origin is set based on the clips `position`.
2098
2145
  */
2099
2146
  exports.rotatetransformationRotateTransformationSchema = zod_1.z.object({
2100
- angle: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), zod_1.z.coerce.number().int().gte(-360).lte(360)), zod_1.z.array(exports.tweenTweenSchema)])),
2147
+ angle: zod_1.z.optional(zod_1.z.union([zod_1.z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), zod_1.z.coerce.number().gte(-360).lte(360)), zod_1.z.array(exports.tweenTweenSchema)])),
2101
2148
  });
2102
2149
  exports.rotateTransformationSchema = exports.rotatetransformationRotateTransformationSchema;
2103
2150
  /**
@@ -6107,7 +6107,7 @@ export declare const sourceresponseattributesSourceResponseAttributesSchema: z.Z
6107
6107
  }, z.core.$strip>>>;
6108
6108
  }, z.core.$strip>>;
6109
6109
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6110
- height: z.ZodOptional<z.ZodString>;
6110
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6111
6111
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6112
6112
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6113
6113
  created: z.ZodOptional<z.ZodString>;
@@ -6211,7 +6211,7 @@ export declare const sourceResponseAttributesSchema: z.ZodObject<{
6211
6211
  }, z.core.$strip>>>;
6212
6212
  }, z.core.$strip>>;
6213
6213
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6214
- height: z.ZodOptional<z.ZodString>;
6214
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6215
6215
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6216
6216
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6217
6217
  created: z.ZodOptional<z.ZodString>;
@@ -6321,7 +6321,7 @@ export declare const sourceresponsedataSourceResponseDataSchema: z.ZodObject<{
6321
6321
  }, z.core.$strip>>>;
6322
6322
  }, z.core.$strip>>;
6323
6323
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6324
- height: z.ZodOptional<z.ZodString>;
6324
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6325
6325
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6326
6326
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6327
6327
  created: z.ZodOptional<z.ZodString>;
@@ -6429,7 +6429,7 @@ export declare const sourceResponseDataSchema: z.ZodObject<{
6429
6429
  }, z.core.$strip>>>;
6430
6430
  }, z.core.$strip>>;
6431
6431
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6432
- height: z.ZodOptional<z.ZodString>;
6432
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6433
6433
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6434
6434
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6435
6435
  created: z.ZodOptional<z.ZodString>;
@@ -6541,7 +6541,7 @@ export declare const sourcelistresponseSourceListResponseSchema: z.ZodObject<{
6541
6541
  }, z.core.$strip>>>;
6542
6542
  }, z.core.$strip>>;
6543
6543
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6544
- height: z.ZodOptional<z.ZodString>;
6544
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6545
6545
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6546
6546
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6547
6547
  created: z.ZodOptional<z.ZodString>;
@@ -6651,7 +6651,7 @@ export declare const sourceListResponseSchema: z.ZodObject<{
6651
6651
  }, z.core.$strip>>>;
6652
6652
  }, z.core.$strip>>;
6653
6653
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6654
- height: z.ZodOptional<z.ZodString>;
6654
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6655
6655
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6656
6656
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6657
6657
  created: z.ZodOptional<z.ZodString>;
@@ -6764,7 +6764,7 @@ export declare const sourceresponseSourceResponseSchema: z.ZodObject<{
6764
6764
  }, z.core.$strip>>>;
6765
6765
  }, z.core.$strip>>;
6766
6766
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6767
- height: z.ZodOptional<z.ZodString>;
6767
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6768
6768
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6769
6769
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6770
6770
  created: z.ZodOptional<z.ZodString>;
@@ -6874,7 +6874,7 @@ export declare const sourceResponseSchema: z.ZodObject<{
6874
6874
  }, z.core.$strip>>>;
6875
6875
  }, z.core.$strip>>;
6876
6876
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6877
- height: z.ZodOptional<z.ZodString>;
6877
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6878
6878
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6879
6879
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
6880
6880
  created: z.ZodOptional<z.ZodString>;
@@ -7825,10 +7825,33 @@ export declare const svgShapeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7825
7825
  }, z.core.$strip>], "type">;
7826
7826
  /**
7827
7827
  * The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.
7828
- * It provides a comprehensive set of primitive shapes and custom paths with full
7829
- * styling support including fills, strokes, gradients, and shadows.
7828
+ * It provides two mutually exclusive ways to define shapes:
7829
+ *
7830
+ * **Option 1: Import SVG markup using `src`**
7831
+ * ```json
7832
+ * {
7833
+ * "type": "svg",
7834
+ * "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
7835
+ * }
7836
+ * ```
7837
+ * When using `src`, no other properties are allowed. The fill, stroke, and dimensions
7838
+ * are automatically extracted from the SVG markup.
7839
+ *
7840
+ * **Option 2: Define shapes programmatically using `shape`**
7841
+ * ```json
7842
+ * {
7843
+ * "type": "svg",
7844
+ * "shape": { "type": "circle", "radius": 50 },
7845
+ * "fill": { "type": "solid", "color": "#FF0000" }
7846
+ * }
7847
+ * ```
7848
+ * When using `shape`, you can customize fill, stroke, shadow, transform, and other properties.
7849
+ * The `src` property is not allowed in this mode.
7850
+ *
7851
+ * **Important:** You must provide either `src` OR `shape`, but not both.
7852
+ * These two modes are mutually exclusive.
7830
7853
  *
7831
- * **Available Shapes:**
7854
+ * **Available Shapes (Option 2 only):**
7832
7855
  * - `rectangle` - Rectangles with optional rounded corners
7833
7856
  * - `circle` - Perfect circles
7834
7857
  * - `ellipse` - Ellipses/ovals with separate x and y radii
@@ -7841,12 +7864,6 @@ export declare const svgShapeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7841
7864
  * - `ring` - Donut/ring shapes
7842
7865
  * - `path` - Custom shapes using SVG path data
7843
7866
  *
7844
- * **Styling Options:**
7845
- * - Fill with solid colors or linear/radial gradients
7846
- * - Stroke with configurable width, color, dash patterns, and line caps/joins
7847
- * - Drop shadows with blur, offset, and opacity
7848
- * - Transform properties for positioning, rotation, and scaling
7849
- *
7850
7867
  * See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
7851
7868
  *
7852
7869
  */
@@ -7854,7 +7871,8 @@ export declare const svgassetSvgAssetSchema: z.ZodObject<{
7854
7871
  type: z.ZodEnum<{
7855
7872
  svg: "svg";
7856
7873
  }>;
7857
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
7874
+ src: z.ZodOptional<z.ZodString>;
7875
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
7858
7876
  type: z.ZodEnum<{
7859
7877
  rectangle: "rectangle";
7860
7878
  }>;
@@ -7922,7 +7940,7 @@ export declare const svgassetSvgAssetSchema: z.ZodObject<{
7922
7940
  path: "path";
7923
7941
  }>;
7924
7942
  d: z.ZodString;
7925
- }, z.core.$strip>], "type">;
7943
+ }, z.core.$strip>], "type">>;
7926
7944
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
7927
7945
  type: z.ZodEnum<{
7928
7946
  solid: "solid";
@@ -7989,7 +8007,8 @@ export declare const svgAssetSchema: z.ZodObject<{
7989
8007
  type: z.ZodEnum<{
7990
8008
  svg: "svg";
7991
8009
  }>;
7992
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
8010
+ src: z.ZodOptional<z.ZodString>;
8011
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
7993
8012
  type: z.ZodEnum<{
7994
8013
  rectangle: "rectangle";
7995
8014
  }>;
@@ -8057,7 +8076,7 @@ export declare const svgAssetSchema: z.ZodObject<{
8057
8076
  path: "path";
8058
8077
  }>;
8059
8078
  d: z.ZodString;
8060
- }, z.core.$strip>], "type">;
8079
+ }, z.core.$strip>], "type">>;
8061
8080
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
8062
8081
  type: z.ZodEnum<{
8063
8082
  solid: "solid";
@@ -10698,7 +10717,8 @@ export declare const assetAssetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10698
10717
  type: z.ZodEnum<{
10699
10718
  svg: "svg";
10700
10719
  }>;
10701
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
10720
+ src: z.ZodOptional<z.ZodString>;
10721
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
10702
10722
  type: z.ZodEnum<{
10703
10723
  rectangle: "rectangle";
10704
10724
  }>;
@@ -10766,7 +10786,7 @@ export declare const assetAssetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10766
10786
  path: "path";
10767
10787
  }>;
10768
10788
  d: z.ZodString;
10769
- }, z.core.$strip>], "type">;
10789
+ }, z.core.$strip>], "type">>;
10770
10790
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
10771
10791
  type: z.ZodEnum<{
10772
10792
  solid: "solid";
@@ -11352,7 +11372,8 @@ export declare const assetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
11352
11372
  type: z.ZodEnum<{
11353
11373
  svg: "svg";
11354
11374
  }>;
11355
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
11375
+ src: z.ZodOptional<z.ZodString>;
11376
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
11356
11377
  type: z.ZodEnum<{
11357
11378
  rectangle: "rectangle";
11358
11379
  }>;
@@ -11420,7 +11441,7 @@ export declare const assetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
11420
11441
  path: "path";
11421
11442
  }>;
11422
11443
  d: z.ZodString;
11423
- }, z.core.$strip>], "type">;
11444
+ }, z.core.$strip>], "type">>;
11424
11445
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
11425
11446
  type: z.ZodEnum<{
11426
11447
  solid: "solid";
@@ -12010,7 +12031,8 @@ export declare const clipClipSchema: z.ZodObject<{
12010
12031
  type: z.ZodEnum<{
12011
12032
  svg: "svg";
12012
12033
  }>;
12013
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
12034
+ src: z.ZodOptional<z.ZodString>;
12035
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
12014
12036
  type: z.ZodEnum<{
12015
12037
  rectangle: "rectangle";
12016
12038
  }>;
@@ -12078,7 +12100,7 @@ export declare const clipClipSchema: z.ZodObject<{
12078
12100
  path: "path";
12079
12101
  }>;
12080
12102
  d: z.ZodString;
12081
- }, z.core.$strip>], "type">;
12103
+ }, z.core.$strip>], "type">>;
12082
12104
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
12083
12105
  type: z.ZodEnum<{
12084
12106
  solid: "solid";
@@ -13110,7 +13132,8 @@ export declare const clipSchema: z.ZodObject<{
13110
13132
  type: z.ZodEnum<{
13111
13133
  svg: "svg";
13112
13134
  }>;
13113
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
13135
+ src: z.ZodOptional<z.ZodString>;
13136
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
13114
13137
  type: z.ZodEnum<{
13115
13138
  rectangle: "rectangle";
13116
13139
  }>;
@@ -13178,7 +13201,7 @@ export declare const clipSchema: z.ZodObject<{
13178
13201
  path: "path";
13179
13202
  }>;
13180
13203
  d: z.ZodString;
13181
- }, z.core.$strip>], "type">;
13204
+ }, z.core.$strip>], "type">>;
13182
13205
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
13183
13206
  type: z.ZodEnum<{
13184
13207
  solid: "solid";
@@ -14214,7 +14237,8 @@ export declare const trackTrackSchema: z.ZodObject<{
14214
14237
  type: z.ZodEnum<{
14215
14238
  svg: "svg";
14216
14239
  }>;
14217
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
14240
+ src: z.ZodOptional<z.ZodString>;
14241
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
14218
14242
  type: z.ZodEnum<{
14219
14243
  rectangle: "rectangle";
14220
14244
  }>;
@@ -14282,7 +14306,7 @@ export declare const trackTrackSchema: z.ZodObject<{
14282
14306
  path: "path";
14283
14307
  }>;
14284
14308
  d: z.ZodString;
14285
- }, z.core.$strip>], "type">;
14309
+ }, z.core.$strip>], "type">>;
14286
14310
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
14287
14311
  type: z.ZodEnum<{
14288
14312
  solid: "solid";
@@ -15316,7 +15340,8 @@ export declare const trackSchema: z.ZodObject<{
15316
15340
  type: z.ZodEnum<{
15317
15341
  svg: "svg";
15318
15342
  }>;
15319
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
15343
+ src: z.ZodOptional<z.ZodString>;
15344
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
15320
15345
  type: z.ZodEnum<{
15321
15346
  rectangle: "rectangle";
15322
15347
  }>;
@@ -15384,7 +15409,7 @@ export declare const trackSchema: z.ZodObject<{
15384
15409
  path: "path";
15385
15410
  }>;
15386
15411
  d: z.ZodString;
15387
- }, z.core.$strip>], "type">;
15412
+ }, z.core.$strip>], "type">>;
15388
15413
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
15389
15414
  type: z.ZodEnum<{
15390
15415
  solid: "solid";
@@ -16435,7 +16460,8 @@ export declare const timelineTimelineSchema: z.ZodObject<{
16435
16460
  type: z.ZodEnum<{
16436
16461
  svg: "svg";
16437
16462
  }>;
16438
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
16463
+ src: z.ZodOptional<z.ZodString>;
16464
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
16439
16465
  type: z.ZodEnum<{
16440
16466
  rectangle: "rectangle";
16441
16467
  }>;
@@ -16503,7 +16529,7 @@ export declare const timelineTimelineSchema: z.ZodObject<{
16503
16529
  path: "path";
16504
16530
  }>;
16505
16531
  d: z.ZodString;
16506
- }, z.core.$strip>], "type">;
16532
+ }, z.core.$strip>], "type">>;
16507
16533
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
16508
16534
  type: z.ZodEnum<{
16509
16535
  solid: "solid";
@@ -17553,7 +17579,8 @@ export declare const timelineSchema: z.ZodObject<{
17553
17579
  type: z.ZodEnum<{
17554
17580
  svg: "svg";
17555
17581
  }>;
17556
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
17582
+ src: z.ZodOptional<z.ZodString>;
17583
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
17557
17584
  type: z.ZodEnum<{
17558
17585
  rectangle: "rectangle";
17559
17586
  }>;
@@ -17621,7 +17648,7 @@ export declare const timelineSchema: z.ZodObject<{
17621
17648
  path: "path";
17622
17649
  }>;
17623
17650
  d: z.ZodString;
17624
- }, z.core.$strip>], "type">;
17651
+ }, z.core.$strip>], "type">>;
17625
17652
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
17626
17653
  type: z.ZodEnum<{
17627
17654
  solid: "solid";
@@ -18675,7 +18702,8 @@ export declare const editEditSchema: z.ZodObject<{
18675
18702
  type: z.ZodEnum<{
18676
18703
  svg: "svg";
18677
18704
  }>;
18678
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
18705
+ src: z.ZodOptional<z.ZodString>;
18706
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
18679
18707
  type: z.ZodEnum<{
18680
18708
  rectangle: "rectangle";
18681
18709
  }>;
@@ -18743,7 +18771,7 @@ export declare const editEditSchema: z.ZodObject<{
18743
18771
  path: "path";
18744
18772
  }>;
18745
18773
  d: z.ZodString;
18746
- }, z.core.$strip>], "type">;
18774
+ }, z.core.$strip>], "type">>;
18747
18775
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
18748
18776
  type: z.ZodEnum<{
18749
18777
  solid: "solid";
@@ -19950,7 +19978,8 @@ export declare const editSchema: z.ZodObject<{
19950
19978
  type: z.ZodEnum<{
19951
19979
  svg: "svg";
19952
19980
  }>;
19953
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
19981
+ src: z.ZodOptional<z.ZodString>;
19982
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
19954
19983
  type: z.ZodEnum<{
19955
19984
  rectangle: "rectangle";
19956
19985
  }>;
@@ -20018,7 +20047,7 @@ export declare const editSchema: z.ZodObject<{
20018
20047
  path: "path";
20019
20048
  }>;
20020
20049
  d: z.ZodString;
20021
- }, z.core.$strip>], "type">;
20050
+ }, z.core.$strip>], "type">>;
20022
20051
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
20023
20052
  type: z.ZodEnum<{
20024
20053
  solid: "solid";
@@ -21247,7 +21276,8 @@ export declare const renderresponsedataRenderResponseDataSchema: z.ZodObject<{
21247
21276
  type: z.ZodEnum<{
21248
21277
  svg: "svg";
21249
21278
  }>;
21250
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
21279
+ src: z.ZodOptional<z.ZodString>;
21280
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
21251
21281
  type: z.ZodEnum<{
21252
21282
  rectangle: "rectangle";
21253
21283
  }>;
@@ -21315,7 +21345,7 @@ export declare const renderresponsedataRenderResponseDataSchema: z.ZodObject<{
21315
21345
  path: "path";
21316
21346
  }>;
21317
21347
  d: z.ZodString;
21318
- }, z.core.$strip>], "type">;
21348
+ }, z.core.$strip>], "type">>;
21319
21349
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
21320
21350
  type: z.ZodEnum<{
21321
21351
  solid: "solid";
@@ -22544,7 +22574,8 @@ export declare const renderResponseDataSchema: z.ZodObject<{
22544
22574
  type: z.ZodEnum<{
22545
22575
  svg: "svg";
22546
22576
  }>;
22547
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
22577
+ src: z.ZodOptional<z.ZodString>;
22578
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
22548
22579
  type: z.ZodEnum<{
22549
22580
  rectangle: "rectangle";
22550
22581
  }>;
@@ -22612,7 +22643,7 @@ export declare const renderResponseDataSchema: z.ZodObject<{
22612
22643
  path: "path";
22613
22644
  }>;
22614
22645
  d: z.ZodString;
22615
- }, z.core.$strip>], "type">;
22646
+ }, z.core.$strip>], "type">>;
22616
22647
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
22617
22648
  type: z.ZodEnum<{
22618
22649
  solid: "solid";
@@ -23847,7 +23878,8 @@ export declare const renderresponseRenderResponseSchema: z.ZodObject<{
23847
23878
  type: z.ZodEnum<{
23848
23879
  svg: "svg";
23849
23880
  }>;
23850
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
23881
+ src: z.ZodOptional<z.ZodString>;
23882
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
23851
23883
  type: z.ZodEnum<{
23852
23884
  rectangle: "rectangle";
23853
23885
  }>;
@@ -23915,7 +23947,7 @@ export declare const renderresponseRenderResponseSchema: z.ZodObject<{
23915
23947
  path: "path";
23916
23948
  }>;
23917
23949
  d: z.ZodString;
23918
- }, z.core.$strip>], "type">;
23950
+ }, z.core.$strip>], "type">>;
23919
23951
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
23920
23952
  type: z.ZodEnum<{
23921
23953
  solid: "solid";
@@ -25148,7 +25180,8 @@ export declare const renderResponseSchema: z.ZodObject<{
25148
25180
  type: z.ZodEnum<{
25149
25181
  svg: "svg";
25150
25182
  }>;
25151
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
25183
+ src: z.ZodOptional<z.ZodString>;
25184
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
25152
25185
  type: z.ZodEnum<{
25153
25186
  rectangle: "rectangle";
25154
25187
  }>;
@@ -25216,7 +25249,7 @@ export declare const renderResponseSchema: z.ZodObject<{
25216
25249
  path: "path";
25217
25250
  }>;
25218
25251
  d: z.ZodString;
25219
- }, z.core.$strip>], "type">;
25252
+ }, z.core.$strip>], "type">>;
25220
25253
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
25221
25254
  type: z.ZodEnum<{
25222
25255
  solid: "solid";
@@ -26434,7 +26467,8 @@ export declare const templatedataresponsedataTemplateDataResponseDataSchema: z.Z
26434
26467
  type: z.ZodEnum<{
26435
26468
  svg: "svg";
26436
26469
  }>;
26437
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
26470
+ src: z.ZodOptional<z.ZodString>;
26471
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
26438
26472
  type: z.ZodEnum<{
26439
26473
  rectangle: "rectangle";
26440
26474
  }>;
@@ -26502,7 +26536,7 @@ export declare const templatedataresponsedataTemplateDataResponseDataSchema: z.Z
26502
26536
  path: "path";
26503
26537
  }>;
26504
26538
  d: z.ZodString;
26505
- }, z.core.$strip>], "type">;
26539
+ }, z.core.$strip>], "type">>;
26506
26540
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
26507
26541
  type: z.ZodEnum<{
26508
26542
  solid: "solid";
@@ -27714,7 +27748,8 @@ export declare const templateDataResponseDataSchema: z.ZodObject<{
27714
27748
  type: z.ZodEnum<{
27715
27749
  svg: "svg";
27716
27750
  }>;
27717
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
27751
+ src: z.ZodOptional<z.ZodString>;
27752
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
27718
27753
  type: z.ZodEnum<{
27719
27754
  rectangle: "rectangle";
27720
27755
  }>;
@@ -27782,7 +27817,7 @@ export declare const templateDataResponseDataSchema: z.ZodObject<{
27782
27817
  path: "path";
27783
27818
  }>;
27784
27819
  d: z.ZodString;
27785
- }, z.core.$strip>], "type">;
27820
+ }, z.core.$strip>], "type">>;
27786
27821
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
27787
27822
  type: z.ZodEnum<{
27788
27823
  solid: "solid";
@@ -29000,7 +29035,8 @@ export declare const templatedataresponseTemplateDataResponseSchema: z.ZodObject
29000
29035
  type: z.ZodEnum<{
29001
29036
  svg: "svg";
29002
29037
  }>;
29003
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
29038
+ src: z.ZodOptional<z.ZodString>;
29039
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
29004
29040
  type: z.ZodEnum<{
29005
29041
  rectangle: "rectangle";
29006
29042
  }>;
@@ -29068,7 +29104,7 @@ export declare const templatedataresponseTemplateDataResponseSchema: z.ZodObject
29068
29104
  path: "path";
29069
29105
  }>;
29070
29106
  d: z.ZodString;
29071
- }, z.core.$strip>], "type">;
29107
+ }, z.core.$strip>], "type">>;
29072
29108
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
29073
29109
  type: z.ZodEnum<{
29074
29110
  solid: "solid";
@@ -30284,7 +30320,8 @@ export declare const templateDataResponseSchema: z.ZodObject<{
30284
30320
  type: z.ZodEnum<{
30285
30321
  svg: "svg";
30286
30322
  }>;
30287
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
30323
+ src: z.ZodOptional<z.ZodString>;
30324
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
30288
30325
  type: z.ZodEnum<{
30289
30326
  rectangle: "rectangle";
30290
30327
  }>;
@@ -30352,7 +30389,7 @@ export declare const templateDataResponseSchema: z.ZodObject<{
30352
30389
  path: "path";
30353
30390
  }>;
30354
30391
  d: z.ZodString;
30355
- }, z.core.$strip>], "type">;
30392
+ }, z.core.$strip>], "type">>;
30356
30393
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
30357
30394
  type: z.ZodEnum<{
30358
30395
  solid: "solid";
@@ -31566,7 +31603,8 @@ export declare const templateTemplateSchema: z.ZodObject<{
31566
31603
  type: z.ZodEnum<{
31567
31604
  svg: "svg";
31568
31605
  }>;
31569
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
31606
+ src: z.ZodOptional<z.ZodString>;
31607
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
31570
31608
  type: z.ZodEnum<{
31571
31609
  rectangle: "rectangle";
31572
31610
  }>;
@@ -31634,7 +31672,7 @@ export declare const templateTemplateSchema: z.ZodObject<{
31634
31672
  path: "path";
31635
31673
  }>;
31636
31674
  d: z.ZodString;
31637
- }, z.core.$strip>], "type">;
31675
+ }, z.core.$strip>], "type">>;
31638
31676
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
31639
31677
  type: z.ZodEnum<{
31640
31678
  solid: "solid";
@@ -32844,7 +32882,8 @@ export declare const templateSchema: z.ZodObject<{
32844
32882
  type: z.ZodEnum<{
32845
32883
  svg: "svg";
32846
32884
  }>;
32847
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
32885
+ src: z.ZodOptional<z.ZodString>;
32886
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
32848
32887
  type: z.ZodEnum<{
32849
32888
  rectangle: "rectangle";
32850
32889
  }>;
@@ -32912,7 +32951,7 @@ export declare const templateSchema: z.ZodObject<{
32912
32951
  path: "path";
32913
32952
  }>;
32914
32953
  d: z.ZodString;
32915
- }, z.core.$strip>], "type">;
32954
+ }, z.core.$strip>], "type">>;
32916
32955
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
32917
32956
  type: z.ZodEnum<{
32918
32957
  solid: "solid";
@@ -34121,7 +34160,8 @@ export declare const postRenderRequest: z.ZodObject<{
34121
34160
  type: z.ZodEnum<{
34122
34161
  svg: "svg";
34123
34162
  }>;
34124
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
34163
+ src: z.ZodOptional<z.ZodString>;
34164
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
34125
34165
  type: z.ZodEnum<{
34126
34166
  rectangle: "rectangle";
34127
34167
  }>;
@@ -34189,7 +34229,7 @@ export declare const postRenderRequest: z.ZodObject<{
34189
34229
  path: "path";
34190
34230
  }>;
34191
34231
  d: z.ZodString;
34192
- }, z.core.$strip>], "type">;
34232
+ }, z.core.$strip>], "type">>;
34193
34233
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
34194
34234
  type: z.ZodEnum<{
34195
34235
  solid: "solid";
@@ -35445,7 +35485,8 @@ export declare const getRenderResponse: z.ZodObject<{
35445
35485
  type: z.ZodEnum<{
35446
35486
  svg: "svg";
35447
35487
  }>;
35448
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
35488
+ src: z.ZodOptional<z.ZodString>;
35489
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
35449
35490
  type: z.ZodEnum<{
35450
35491
  rectangle: "rectangle";
35451
35492
  }>;
@@ -35513,7 +35554,7 @@ export declare const getRenderResponse: z.ZodObject<{
35513
35554
  path: "path";
35514
35555
  }>;
35515
35556
  d: z.ZodString;
35516
- }, z.core.$strip>], "type">;
35557
+ }, z.core.$strip>], "type">>;
35517
35558
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
35518
35559
  type: z.ZodEnum<{
35519
35560
  solid: "solid";
@@ -36748,7 +36789,8 @@ export declare const postTemplateRequest: z.ZodObject<{
36748
36789
  type: z.ZodEnum<{
36749
36790
  svg: "svg";
36750
36791
  }>;
36751
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
36792
+ src: z.ZodOptional<z.ZodString>;
36793
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
36752
36794
  type: z.ZodEnum<{
36753
36795
  rectangle: "rectangle";
36754
36796
  }>;
@@ -36816,7 +36858,7 @@ export declare const postTemplateRequest: z.ZodObject<{
36816
36858
  path: "path";
36817
36859
  }>;
36818
36860
  d: z.ZodString;
36819
- }, z.core.$strip>], "type">;
36861
+ }, z.core.$strip>], "type">>;
36820
36862
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
36821
36863
  type: z.ZodEnum<{
36822
36864
  solid: "solid";
@@ -38066,7 +38108,8 @@ export declare const getTemplateResponse: z.ZodObject<{
38066
38108
  type: z.ZodEnum<{
38067
38109
  svg: "svg";
38068
38110
  }>;
38069
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
38111
+ src: z.ZodOptional<z.ZodString>;
38112
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
38070
38113
  type: z.ZodEnum<{
38071
38114
  rectangle: "rectangle";
38072
38115
  }>;
@@ -38134,7 +38177,7 @@ export declare const getTemplateResponse: z.ZodObject<{
38134
38177
  path: "path";
38135
38178
  }>;
38136
38179
  d: z.ZodString;
38137
- }, z.core.$strip>], "type">;
38180
+ }, z.core.$strip>], "type">>;
38138
38181
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
38139
38182
  type: z.ZodEnum<{
38140
38183
  solid: "solid";
@@ -39346,7 +39389,8 @@ export declare const putTemplateRequest: z.ZodObject<{
39346
39389
  type: z.ZodEnum<{
39347
39390
  svg: "svg";
39348
39391
  }>;
39349
- shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
39392
+ src: z.ZodOptional<z.ZodString>;
39393
+ shape: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
39350
39394
  type: z.ZodEnum<{
39351
39395
  rectangle: "rectangle";
39352
39396
  }>;
@@ -39414,7 +39458,7 @@ export declare const putTemplateRequest: z.ZodObject<{
39414
39458
  path: "path";
39415
39459
  }>;
39416
39460
  d: z.ZodString;
39417
- }, z.core.$strip>], "type">;
39461
+ }, z.core.$strip>], "type">>;
39418
39462
  fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
39419
39463
  type: z.ZodEnum<{
39420
39464
  solid: "solid";
@@ -40468,7 +40512,7 @@ export declare const getSourcesResponse: z.ZodObject<{
40468
40512
  }, z.core.$strip>>>;
40469
40513
  }, z.core.$strip>>;
40470
40514
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
40471
- height: z.ZodOptional<z.ZodString>;
40515
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
40472
40516
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
40473
40517
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
40474
40518
  created: z.ZodOptional<z.ZodString>;
@@ -40777,7 +40821,7 @@ export declare const getSourceResponse: z.ZodObject<{
40777
40821
  }, z.core.$strip>>>;
40778
40822
  }, z.core.$strip>>;
40779
40823
  width: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
40780
- height: z.ZodOptional<z.ZodString>;
40824
+ height: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
40781
40825
  duration: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
40782
40826
  fps: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedNumber<unknown>>>;
40783
40827
  created: z.ZodOptional<z.ZodString>;
@@ -1420,7 +1420,7 @@ export const sourceresponseattributesSourceResponseAttributesSchema = z.object({
1420
1420
  status: z.optional(z.enum(["queued", "importing", "ready", "failed", "deleted", "overwritten"])),
1421
1421
  outputs: z.optional(outputsresponseOutputsResponseSchema),
1422
1422
  width: z.optional(z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int())),
1423
- height: z.optional(z.string()),
1423
+ height: z.optional(z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int())),
1424
1424
  duration: z.optional(z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number())),
1425
1425
  fps: z.optional(z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number())),
1426
1426
  created: z.optional(z.string()),
@@ -1724,10 +1724,33 @@ export const svgshapesSvgShapeSchema = z.discriminatedUnion("type", [
1724
1724
  export const svgShapeSchema = svgshapesSvgShapeSchema;
1725
1725
  /**
1726
1726
  * The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.
1727
- * It provides a comprehensive set of primitive shapes and custom paths with full
1728
- * styling support including fills, strokes, gradients, and shadows.
1727
+ * It provides two mutually exclusive ways to define shapes:
1728
+ *
1729
+ * **Option 1: Import SVG markup using `src`**
1730
+ * ```json
1731
+ * {
1732
+ * "type": "svg",
1733
+ * "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
1734
+ * }
1735
+ * ```
1736
+ * When using `src`, no other properties are allowed. The fill, stroke, and dimensions
1737
+ * are automatically extracted from the SVG markup.
1738
+ *
1739
+ * **Option 2: Define shapes programmatically using `shape`**
1740
+ * ```json
1741
+ * {
1742
+ * "type": "svg",
1743
+ * "shape": { "type": "circle", "radius": 50 },
1744
+ * "fill": { "type": "solid", "color": "#FF0000" }
1745
+ * }
1746
+ * ```
1747
+ * When using `shape`, you can customize fill, stroke, shadow, transform, and other properties.
1748
+ * The `src` property is not allowed in this mode.
1729
1749
  *
1730
- * **Available Shapes:**
1750
+ * **Important:** You must provide either `src` OR `shape`, but not both.
1751
+ * These two modes are mutually exclusive.
1752
+ *
1753
+ * **Available Shapes (Option 2 only):**
1731
1754
  * - `rectangle` - Rectangles with optional rounded corners
1732
1755
  * - `circle` - Perfect circles
1733
1756
  * - `ellipse` - Ellipses/ovals with separate x and y radii
@@ -1740,18 +1763,13 @@ export const svgShapeSchema = svgshapesSvgShapeSchema;
1740
1763
  * - `ring` - Donut/ring shapes
1741
1764
  * - `path` - Custom shapes using SVG path data
1742
1765
  *
1743
- * **Styling Options:**
1744
- * - Fill with solid colors or linear/radial gradients
1745
- * - Stroke with configurable width, color, dash patterns, and line caps/joins
1746
- * - Drop shadows with blur, offset, and opacity
1747
- * - Transform properties for positioning, rotation, and scaling
1748
- *
1749
1766
  * See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
1750
1767
  *
1751
1768
  */
1752
1769
  export const svgassetSvgAssetSchema = z.object({
1753
1770
  type: z.enum(["svg"]),
1754
- shape: svgshapesSvgShapeSchema,
1771
+ src: z.optional(z.string().min(1).max(500000)),
1772
+ shape: z.optional(svgshapesSvgShapeSchema),
1755
1773
  fill: z.optional(svgpropertiesSvgFillSchema),
1756
1774
  stroke: z.optional(svgpropertiesSvgStrokeSchema),
1757
1775
  shadow: z.optional(svgpropertiesSvgShadowSchema),
@@ -1759,6 +1777,35 @@ export const svgassetSvgAssetSchema = z.object({
1759
1777
  opacity: z.optional(z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().gte(0).lte(1))).default(1),
1760
1778
  width: z.optional(z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int().gte(1).lte(4096))),
1761
1779
  height: z.optional(z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int().gte(1).lte(4096))),
1780
+ }).superRefine((data, ctx) => {
1781
+ const hasShape = data.shape !== undefined;
1782
+ const hasSrc = data.src !== undefined && data.src.trim() !== "";
1783
+ if (!hasShape && !hasSrc) {
1784
+ ctx.addIssue({
1785
+ code: z.ZodIssueCode.custom,
1786
+ message: "Either 'src' or 'shape' must be provided",
1787
+ path: [],
1788
+ });
1789
+ }
1790
+ if (hasShape && hasSrc) {
1791
+ ctx.addIssue({
1792
+ code: z.ZodIssueCode.custom,
1793
+ message: "Provide either 'src' or 'shape', not both",
1794
+ path: ["src"],
1795
+ });
1796
+ }
1797
+ if (hasSrc) {
1798
+ const disallowedProps = ["shape", "fill", "stroke", "shadow", "transform", "width", "height"];
1799
+ for (const prop of disallowedProps) {
1800
+ if (data[prop] !== undefined) {
1801
+ ctx.addIssue({
1802
+ code: z.ZodIssueCode.custom,
1803
+ message: `'${prop}' is not allowed when using 'src'. Only 'type' and 'src' are allowed in import mode`,
1804
+ path: [prop],
1805
+ });
1806
+ }
1807
+ }
1808
+ }
1762
1809
  });
1763
1810
  export const svgAssetSchema = svgassetSvgAssetSchema;
1764
1811
  /**
@@ -2087,7 +2134,7 @@ export const offsetSchema = offsetOffsetSchema;
2087
2134
  * Rotate a clip by the specified angle in degrees. Rotation origin is set based on the clips `position`.
2088
2135
  */
2089
2136
  export const rotatetransformationRotateTransformationSchema = z.object({
2090
- angle: z.optional(z.union([z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int().gte(-360).lte(360)), z.array(tweenTweenSchema)])),
2137
+ angle: z.optional(z.union([z.preprocess(((v) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().gte(-360).lte(360)), z.array(tweenTweenSchema)])),
2091
2138
  });
2092
2139
  export const rotateTransformationSchema = rotatetransformationRotateTransformationSchema;
2093
2140
  /**
@@ -1787,7 +1787,7 @@ export const sourceresponseattributesSourceResponseAttributesSchema = z.object({
1787
1787
  ),
1788
1788
  outputs: z.optional(outputsresponseOutputsResponseSchema),
1789
1789
  width: z.optional(z.preprocess(((v: unknown) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int())),
1790
- height: z.optional(z.string()),
1790
+ height: z.optional(z.preprocess(((v: unknown) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int())),
1791
1791
  duration: z.optional(z.preprocess(((v: unknown) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number())),
1792
1792
  fps: z.optional(z.preprocess(((v: unknown) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number())),
1793
1793
  created: z.optional(z.string()),
@@ -2148,10 +2148,33 @@ export const svgShapeSchema = svgshapesSvgShapeSchema;
2148
2148
 
2149
2149
  /**
2150
2150
  * The SvgAsset is used to add scalable vector graphics (SVG) shapes to a video.
2151
- * It provides a comprehensive set of primitive shapes and custom paths with full
2152
- * styling support including fills, strokes, gradients, and shadows.
2151
+ * It provides two mutually exclusive ways to define shapes:
2152
+ *
2153
+ * **Option 1: Import SVG markup using `src`**
2154
+ * ```json
2155
+ * {
2156
+ * "type": "svg",
2157
+ * "src": "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#FF0000\"/></svg>"
2158
+ * }
2159
+ * ```
2160
+ * When using `src`, no other properties are allowed. The fill, stroke, and dimensions
2161
+ * are automatically extracted from the SVG markup.
2162
+ *
2163
+ * **Option 2: Define shapes programmatically using `shape`**
2164
+ * ```json
2165
+ * {
2166
+ * "type": "svg",
2167
+ * "shape": { "type": "circle", "radius": 50 },
2168
+ * "fill": { "type": "solid", "color": "#FF0000" }
2169
+ * }
2170
+ * ```
2171
+ * When using `shape`, you can customize fill, stroke, shadow, transform, and other properties.
2172
+ * The `src` property is not allowed in this mode.
2153
2173
  *
2154
- * **Available Shapes:**
2174
+ * **Important:** You must provide either `src` OR `shape`, but not both.
2175
+ * These two modes are mutually exclusive.
2176
+ *
2177
+ * **Available Shapes (Option 2 only):**
2155
2178
  * - `rectangle` - Rectangles with optional rounded corners
2156
2179
  * - `circle` - Perfect circles
2157
2180
  * - `ellipse` - Ellipses/ovals with separate x and y radii
@@ -2164,18 +2187,13 @@ export const svgShapeSchema = svgshapesSvgShapeSchema;
2164
2187
  * - `ring` - Donut/ring shapes
2165
2188
  * - `path` - Custom shapes using SVG path data
2166
2189
  *
2167
- * **Styling Options:**
2168
- * - Fill with solid colors or linear/radial gradients
2169
- * - Stroke with configurable width, color, dash patterns, and line caps/joins
2170
- * - Drop shadows with blur, offset, and opacity
2171
- * - Transform properties for positioning, rotation, and scaling
2172
- *
2173
2190
  * See [W3C SVG 2 Specification](https://www.w3.org/TR/SVG2/) for path data syntax.
2174
2191
  *
2175
2192
  */
2176
2193
  export const svgassetSvgAssetSchema = z.object({
2177
2194
  type: z.enum(["svg"]),
2178
- shape: svgshapesSvgShapeSchema,
2195
+ src: z.optional(z.string().min(1).max(500000)),
2196
+ shape: z.optional(svgshapesSvgShapeSchema),
2179
2197
  fill: z.optional(svgpropertiesSvgFillSchema),
2180
2198
  stroke: z.optional(svgpropertiesSvgStrokeSchema),
2181
2199
  shadow: z.optional(svgpropertiesSvgShadowSchema),
@@ -2183,6 +2201,38 @@ export const svgassetSvgAssetSchema = z.object({
2183
2201
  opacity: z.optional(z.preprocess(((v: unknown) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().gte(0).lte(1))).default(1),
2184
2202
  width: z.optional(z.preprocess(((v: unknown) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int().gte(1).lte(4096))),
2185
2203
  height: z.optional(z.preprocess(((v: unknown) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int().gte(1).lte(4096))),
2204
+ }).superRefine((data, ctx) => {
2205
+ const hasShape = data.shape !== undefined;
2206
+ const hasSrc = data.src !== undefined && data.src.trim() !== "";
2207
+
2208
+ if (!hasShape && !hasSrc) {
2209
+ ctx.addIssue({
2210
+ code: z.ZodIssueCode.custom,
2211
+ message: "Either 'src' or 'shape' must be provided",
2212
+ path: [],
2213
+ });
2214
+ }
2215
+
2216
+ if (hasShape && hasSrc) {
2217
+ ctx.addIssue({
2218
+ code: z.ZodIssueCode.custom,
2219
+ message: "Provide either 'src' or 'shape', not both",
2220
+ path: ["src"],
2221
+ });
2222
+ }
2223
+
2224
+ if (hasSrc) {
2225
+ const disallowedProps = ["shape", "fill", "stroke", "shadow", "transform", "width", "height"];
2226
+ for (const prop of disallowedProps) {
2227
+ if (data[prop] !== undefined) {
2228
+ ctx.addIssue({
2229
+ code: z.ZodIssueCode.custom,
2230
+ message: `'${prop}' is not allowed when using 'src'. Only 'type' and 'src' are allowed in import mode`,
2231
+ path: [prop],
2232
+ });
2233
+ }
2234
+ }
2235
+ }
2186
2236
  });
2187
2237
 
2188
2238
  export const svgAssetSchema = svgassetSvgAssetSchema;
@@ -2556,7 +2606,7 @@ export const offsetSchema = offsetOffsetSchema;
2556
2606
  */
2557
2607
  export const rotatetransformationRotateTransformationSchema = z.object({
2558
2608
  angle: z.optional(
2559
- z.union([z.preprocess(((v: unknown) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().int().gte(-360).lte(360)), z.array(tweenTweenSchema)])
2609
+ z.union([z.preprocess(((v: unknown) => v === '' || Array.isArray(v) ? NaN : v), z.coerce.number().gte(-360).lte(360)), z.array(tweenTweenSchema)])
2560
2610
  ),
2561
2611
  });
2562
2612
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.3.8",
3
+ "version": "1.4.0",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",