@shotstack/schemas 1.10.8 → 1.10.9

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.
@@ -1702,7 +1702,8 @@ export const textpropertiesTextBackgroundSchema = z.object({
1702
1702
  if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1703
1703
  return v;
1704
1704
  return Number(v);
1705
- } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
1705
+ } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1706
+ wrap: z.optional(z.boolean())
1706
1707
  }).strict();
1707
1708
  export const textBackgroundSchema = textpropertiesTextBackgroundSchema;
1708
1709
  /**
@@ -1782,7 +1783,15 @@ export const textassetTextAssetSchema = z.object({
1782
1783
  stroke: z.optional(textpropertiesTextStrokeSchema),
1783
1784
  animation: z.optional(textpropertiesTextAnimationSchema),
1784
1785
  ellipsis: z.optional(z.string())
1785
- }).strict();
1786
+ }).strict().superRefine((data, ctx) => {
1787
+ if (data.background && data.background.wrap === true) {
1788
+ ctx.addIssue({
1789
+ code: z.ZodIssueCode.custom,
1790
+ message: "background.wrap is only supported on rich-text and rich-caption assets. For type \"text\", migrate to type \"rich-text\" to use this feature.",
1791
+ path: ["background", "wrap"],
1792
+ });
1793
+ }
1794
+ });
1786
1795
  export const textAssetSchema = textassetTextAssetSchema;
1787
1796
  /**
1788
1797
  * The TextToImageAsset lets you create a dynamic image from a text prompt.
@@ -1383,7 +1383,8 @@ export const textpropertiesTextBackgroundSchema = z.object({
1383
1383
  color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1384
1384
  opacity: z.optional(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().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1385
1385
  padding: z.optional(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().gte(0).lte(100)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1386
- borderRadius: z.optional(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().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]))
1386
+ borderRadius: z.optional(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().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1387
+ wrap: z.optional(z.boolean())
1387
1388
  }).strict();
1388
1389
 
1389
1390
  export const textBackgroundSchema = textpropertiesTextBackgroundSchema;
@@ -1426,7 +1427,15 @@ export const textassetTextAssetSchema = z.object({
1426
1427
  stroke: z.optional(textpropertiesTextStrokeSchema),
1427
1428
  animation: z.optional(textpropertiesTextAnimationSchema),
1428
1429
  ellipsis: z.optional(z.string())
1429
- }).strict();
1430
+ }).strict().superRefine((data, ctx) => {
1431
+ if (data.background && data.background.wrap === true) {
1432
+ ctx.addIssue({
1433
+ code: z.ZodIssueCode.custom,
1434
+ message: "background.wrap is only supported on rich-text and rich-caption assets. For type \"text\", migrate to type \"rich-text\" to use this feature.",
1435
+ path: ["background", "wrap"],
1436
+ });
1437
+ }
1438
+ });
1430
1439
 
1431
1440
  export const textAssetSchema = textassetTextAssetSchema;
1432
1441
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.10.8",
3
+ "version": "1.10.9",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",