@shotstack/schemas 1.5.4 → 1.5.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.
@@ -3283,11 +3283,23 @@ export const clipClipSchema = z.object({
3283
3283
  alias: z.optional(z.union([z.string().regex(/^[A-Za-z0-9_-]+$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
3284
3284
  });
3285
3285
  export const clipSchema = clipClipSchema;
3286
+ // Clip schema with fit property filter for rich-text assets
3287
+ // This removes the 'fit' property when asset type is 'rich-text'
3288
+ const clipClipSchemaWithFitFilter = clipClipSchema.transform((clip) => {
3289
+ if (clip.asset && typeof clip.asset === 'object' && 'type' in clip.asset) {
3290
+ const assetType = clip.asset.type;
3291
+ if (assetType === 'rich-text') {
3292
+ const { fit, ...rest } = clip;
3293
+ return rest;
3294
+ }
3295
+ }
3296
+ return clip;
3297
+ });
3286
3298
  /**
3287
3299
  * A track contains an array of clips. Tracks are layered on top of each other in the order in the array. The top most track will render on top of those below it.
3288
3300
  */
3289
3301
  export const trackTrackSchema = z.object({
3290
- clips: z.array(clipClipSchema).min(1),
3302
+ clips: z.array(clipClipSchemaWithFitFilter).min(1),
3291
3303
  });
3292
3304
  export const trackSchema = trackTrackSchema;
3293
3305
  /**
@@ -2804,11 +2804,24 @@ export const clipClipSchema = z.object({
2804
2804
 
2805
2805
  export const clipSchema = clipClipSchema;
2806
2806
 
2807
+ // Clip schema with fit property filter for rich-text assets
2808
+ // This removes the 'fit' property when asset type is 'rich-text'
2809
+ const clipClipSchemaWithFitFilter = clipClipSchema.transform((clip) => {
2810
+ if (clip.asset && typeof clip.asset === 'object' && 'type' in clip.asset) {
2811
+ const assetType = clip.asset.type;
2812
+ if (assetType === 'rich-text') {
2813
+ const { fit, ...rest } = clip;
2814
+ return rest;
2815
+ }
2816
+ }
2817
+ return clip;
2818
+ });
2819
+
2807
2820
  /**
2808
2821
  * A track contains an array of clips. Tracks are layered on top of each other in the order in the array. The top most track will render on top of those below it.
2809
2822
  */
2810
2823
  export const trackTrackSchema = z.object({
2811
- clips: z.array(clipClipSchema).min(1),
2824
+ clips: z.array(clipClipSchemaWithFitFilter).min(1),
2812
2825
  });
2813
2826
 
2814
2827
  export const trackSchema = trackTrackSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",