@shotstack/schemas 1.5.4 → 1.5.5

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.
@@ -3281,6 +3281,16 @@ export const clipClipSchema = z.object({
3281
3281
  } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]), z.array(tweenTweenSchema)])),
3282
3282
  transform: z.optional(transformationTransformationSchema),
3283
3283
  alias: z.optional(z.union([z.string().regex(/^[A-Za-z0-9_-]+$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
3284
+ }).transform((clip) => {
3285
+ // Remove 'fit' property for asset types that don't support it
3286
+ if (clip.asset && typeof clip.asset === 'object' && 'type' in clip.asset) {
3287
+ const assetType = clip.asset.type;
3288
+ if (assetType === 'rich-text') {
3289
+ const { fit, ...rest } = clip;
3290
+ return rest;
3291
+ }
3292
+ }
3293
+ return clip;
3284
3294
  });
3285
3295
  export const clipSchema = clipClipSchema;
3286
3296
  /**
@@ -2800,6 +2800,16 @@ export const clipClipSchema = z.object({
2800
2800
  opacity: z.optional(z.union([z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') { if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v)) return v; return Number(v); } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]), z.array(tweenTweenSchema)])),
2801
2801
  transform: z.optional(transformationTransformationSchema),
2802
2802
  alias: z.optional(z.union([z.string().regex(/^[A-Za-z0-9_-]+$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
2803
+ }).transform((clip) => {
2804
+ // Remove 'fit' property for asset types that don't support it
2805
+ if (clip.asset && typeof clip.asset === 'object' && 'type' in clip.asset) {
2806
+ const assetType = clip.asset.type;
2807
+ if (assetType === 'rich-text') {
2808
+ const { fit, ...rest } = clip;
2809
+ return rest;
2810
+ }
2811
+ }
2812
+ return clip;
2803
2813
  });
2804
2814
 
2805
2815
  export const clipSchema = clipClipSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",