@shotstack/schemas 1.5.3 → 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.
@@ -1559,6 +1559,7 @@ export const richtextassetRichTextAssetSchema = z.object({
1559
1559
  text: z.string().max(5000),
1560
1560
  font: z.optional(richtextpropertiesRichTextFontSchema),
1561
1561
  style: z.optional(richtextpropertiesRichTextStyleSchema),
1562
+ stroke: z.optional(richtextpropertiesRichTextStrokeSchema),
1562
1563
  shadow: z.optional(richtextpropertiesRichTextShadowSchema),
1563
1564
  background: z.optional(richtextpropertiesRichTextBackgroundSchema),
1564
1565
  border: z.optional(richtextpropertiesRichTextBorderSchema),
@@ -3280,6 +3281,16 @@ export const clipClipSchema = z.object({
3280
3281
  } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]), z.array(tweenTweenSchema)])),
3281
3282
  transform: z.optional(transformationTransformationSchema),
3282
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;
3283
3294
  });
3284
3295
  export const clipSchema = clipClipSchema;
3285
3296
  /**
@@ -1525,6 +1525,7 @@ export const richtextassetRichTextAssetSchema = z.object({
1525
1525
  text: z.string().max(5000),
1526
1526
  font: z.optional(richtextpropertiesRichTextFontSchema),
1527
1527
  style: z.optional(richtextpropertiesRichTextStyleSchema),
1528
+ stroke: z.optional(richtextpropertiesRichTextStrokeSchema),
1528
1529
  shadow: z.optional(richtextpropertiesRichTextShadowSchema),
1529
1530
  background: z.optional(richtextpropertiesRichTextBackgroundSchema),
1530
1531
  border: z.optional(richtextpropertiesRichTextBorderSchema),
@@ -2799,6 +2800,16 @@ export const clipClipSchema = z.object({
2799
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)])),
2800
2801
  transform: z.optional(transformationTransformationSchema),
2801
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;
2802
2813
  });
2803
2814
 
2804
2815
  export const clipSchema = clipClipSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.5.3",
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",