@shotstack/schemas 1.5.5 → 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.
@@ -3281,8 +3281,11 @@ 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
3284
+ });
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) => {
3286
3289
  if (clip.asset && typeof clip.asset === 'object' && 'type' in clip.asset) {
3287
3290
  const assetType = clip.asset.type;
3288
3291
  if (assetType === 'rich-text') {
@@ -3292,12 +3295,11 @@ export const clipClipSchema = z.object({
3292
3295
  }
3293
3296
  return clip;
3294
3297
  });
3295
- export const clipSchema = clipClipSchema;
3296
3298
  /**
3297
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.
3298
3300
  */
3299
3301
  export const trackTrackSchema = z.object({
3300
- clips: z.array(clipClipSchema).min(1),
3302
+ clips: z.array(clipClipSchemaWithFitFilter).min(1),
3301
3303
  });
3302
3304
  export const trackSchema = trackTrackSchema;
3303
3305
  /**
@@ -2800,8 +2800,13 @@ 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
2803
+ });
2804
+
2805
+ export const clipSchema = clipClipSchema;
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) => {
2805
2810
  if (clip.asset && typeof clip.asset === 'object' && 'type' in clip.asset) {
2806
2811
  const assetType = clip.asset.type;
2807
2812
  if (assetType === 'rich-text') {
@@ -2812,13 +2817,11 @@ export const clipClipSchema = z.object({
2812
2817
  return clip;
2813
2818
  });
2814
2819
 
2815
- export const clipSchema = clipClipSchema;
2816
-
2817
2820
  /**
2818
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.
2819
2822
  */
2820
2823
  export const trackTrackSchema = z.object({
2821
- clips: z.array(clipClipSchema).min(1),
2824
+ clips: z.array(clipClipSchemaWithFitFilter).min(1),
2822
2825
  });
2823
2826
 
2824
2827
  export const trackSchema = trackTrackSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.5.5",
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",