@shotstack/schemas 1.9.2 → 1.9.3

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.
@@ -1538,6 +1538,37 @@ export const richtextpropertiesRichTextGradientSchema = z.object({
1538
1538
  })).min(2)
1539
1539
  }).strict();
1540
1540
  export const richTextGradientSchema = richtextpropertiesRichTextGradientSchema;
1541
+ /**
1542
+ * Text style properties for rich captions. Same as RichTextStyle but without wordSpacing.
1543
+ */
1544
+ export const richcaptionpropertiesRichCaptionStyleSchema = z.object({
1545
+ letterSpacing: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1546
+ return undefined; if (Array.isArray(v))
1547
+ return v; if (typeof v === 'string') {
1548
+ if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1549
+ return v;
1550
+ return Number(v);
1551
+ } return v; }), z.number()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
1552
+ lineHeight: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1553
+ return undefined; if (Array.isArray(v))
1554
+ return v; if (typeof v === 'string') {
1555
+ if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1556
+ return v;
1557
+ return Number(v);
1558
+ } return v; }), z.number().gte(0).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1.2),
1559
+ textTransform: z.optional(z.enum([
1560
+ 'none',
1561
+ 'uppercase',
1562
+ 'lowercase',
1563
+ 'capitalize'
1564
+ ])),
1565
+ textDecoration: z.optional(z.enum([
1566
+ 'none',
1567
+ 'underline',
1568
+ 'line-through'
1569
+ ])),
1570
+ gradient: z.optional(richtextpropertiesRichTextGradientSchema)
1571
+ }).strict();
1541
1572
  /**
1542
1573
  * Padding properties for individual sides of the text bounding box.
1543
1574
  */
@@ -1649,6 +1680,36 @@ export const richcaptionpropertiesRichCaptionActiveSchema = z.object({
1649
1680
  } return v; }), z.number().gte(0.5).lte(2)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1)
1650
1681
  }).strict();
1651
1682
  export const richCaptionActiveSchema = richcaptionpropertiesRichCaptionActiveSchema;
1683
+ /**
1684
+ * The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports
1685
+ * karaoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT
1686
+ * files or auto-transcription via aliases.
1687
+ *
1688
+ */
1689
+ export const richcaptionassetRichCaptionAssetSchema = z.object({
1690
+ type: z.enum(['rich-caption']),
1691
+ src: z.string().min(1),
1692
+ font: z.optional(richcaptionpropertiesRichCaptionFontSchema),
1693
+ style: z.optional(richcaptionpropertiesRichCaptionStyleSchema),
1694
+ stroke: z.optional(richtextpropertiesRichTextStrokeSchema),
1695
+ shadow: z.optional(richtextpropertiesRichTextShadowSchema),
1696
+ background: z.optional(richtextpropertiesRichTextBackgroundSchema),
1697
+ border: z.optional(richtextpropertiesRichTextBorderSchema),
1698
+ padding: z.optional(z.union([
1699
+ z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1700
+ return undefined; if (Array.isArray(v))
1701
+ return v; if (typeof v === 'string') {
1702
+ if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1703
+ return v;
1704
+ return Number(v);
1705
+ } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
1706
+ richtextpropertiesRichTextPaddingSchema
1707
+ ])),
1708
+ align: z.optional(richtextpropertiesRichTextAlignmentSchema),
1709
+ active: z.optional(richcaptionpropertiesRichCaptionActiveSchema),
1710
+ wordAnimation: z.optional(richcaptionpropertiesRichCaptionWordAnimationSchema)
1711
+ }).strict();
1712
+ export const richCaptionAssetSchema = richcaptionassetRichCaptionAssetSchema;
1652
1713
  /**
1653
1714
  * Font properties for rich text.
1654
1715
  */
@@ -1713,36 +1774,6 @@ export const richtextpropertiesRichTextStyleSchema = z.object({
1713
1774
  gradient: z.optional(richtextpropertiesRichTextGradientSchema)
1714
1775
  }).strict();
1715
1776
  export const richTextStyleSchema = richtextpropertiesRichTextStyleSchema;
1716
- /**
1717
- * The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports
1718
- * karaoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT
1719
- * files or auto-transcription via aliases.
1720
- *
1721
- */
1722
- export const richcaptionassetRichCaptionAssetSchema = z.object({
1723
- type: z.enum(['rich-caption']),
1724
- src: z.string().min(1),
1725
- font: z.optional(richcaptionpropertiesRichCaptionFontSchema),
1726
- style: z.optional(richtextpropertiesRichTextStyleSchema),
1727
- stroke: z.optional(richtextpropertiesRichTextStrokeSchema),
1728
- shadow: z.optional(richtextpropertiesRichTextShadowSchema),
1729
- background: z.optional(richtextpropertiesRichTextBackgroundSchema),
1730
- border: z.optional(richtextpropertiesRichTextBorderSchema),
1731
- padding: z.optional(z.union([
1732
- z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1733
- return undefined; if (Array.isArray(v))
1734
- return v; if (typeof v === 'string') {
1735
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1736
- return v;
1737
- return Number(v);
1738
- } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
1739
- richtextpropertiesRichTextPaddingSchema
1740
- ])),
1741
- align: z.optional(richtextpropertiesRichTextAlignmentSchema),
1742
- active: z.optional(richcaptionpropertiesRichCaptionActiveSchema),
1743
- wordAnimation: z.optional(richcaptionpropertiesRichCaptionWordAnimationSchema)
1744
- }).strict();
1745
- export const richCaptionAssetSchema = richcaptionassetRichCaptionAssetSchema;
1746
1777
  /**
1747
1778
  * The RichTextAsset provides advanced text rendering with support for custom fonts, gradients, shadows, strokes,
1748
1779
  * animations, and styling options. It offers more flexibility and visual effects than the basic TextAsset.
@@ -1460,6 +1460,26 @@ export const richtextpropertiesRichTextGradientSchema = z.object({
1460
1460
 
1461
1461
  export const richTextGradientSchema = richtextpropertiesRichTextGradientSchema;
1462
1462
 
1463
+ /**
1464
+ * Text style properties for rich captions. Same as RichTextStyle but without wordSpacing.
1465
+ */
1466
+ export const richcaptionpropertiesRichCaptionStyleSchema = z.object({
1467
+ letterSpacing: 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()), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
1468
+ lineHeight: 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(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1.2),
1469
+ textTransform: z.optional(z.enum([
1470
+ 'none',
1471
+ 'uppercase',
1472
+ 'lowercase',
1473
+ 'capitalize'
1474
+ ])),
1475
+ textDecoration: z.optional(z.enum([
1476
+ 'none',
1477
+ 'underline',
1478
+ 'line-through'
1479
+ ])),
1480
+ gradient: z.optional(richtextpropertiesRichTextGradientSchema)
1481
+ }).strict();
1482
+
1463
1483
  /**
1464
1484
  * Padding properties for individual sides of the text bounding box.
1465
1485
  */
@@ -1512,6 +1532,32 @@ export const richcaptionpropertiesRichCaptionActiveSchema = z.object({
1512
1532
 
1513
1533
  export const richCaptionActiveSchema = richcaptionpropertiesRichCaptionActiveSchema;
1514
1534
 
1535
+ /**
1536
+ * The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports
1537
+ * karaoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT
1538
+ * files or auto-transcription via aliases.
1539
+ *
1540
+ */
1541
+ export const richcaptionassetRichCaptionAssetSchema = z.object({
1542
+ type: z.enum(['rich-caption']),
1543
+ src: z.string().min(1),
1544
+ font: z.optional(richcaptionpropertiesRichCaptionFontSchema),
1545
+ style: z.optional(richcaptionpropertiesRichCaptionStyleSchema),
1546
+ stroke: z.optional(richtextpropertiesRichTextStrokeSchema),
1547
+ shadow: z.optional(richtextpropertiesRichTextShadowSchema),
1548
+ background: z.optional(richtextpropertiesRichTextBackgroundSchema),
1549
+ border: z.optional(richtextpropertiesRichTextBorderSchema),
1550
+ padding: z.optional(z.union([
1551
+ 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*\}\}$/)]),
1552
+ richtextpropertiesRichTextPaddingSchema
1553
+ ])),
1554
+ align: z.optional(richtextpropertiesRichTextAlignmentSchema),
1555
+ active: z.optional(richcaptionpropertiesRichCaptionActiveSchema),
1556
+ wordAnimation: z.optional(richcaptionpropertiesRichCaptionWordAnimationSchema)
1557
+ }).strict();
1558
+
1559
+ export const richCaptionAssetSchema = richcaptionassetRichCaptionAssetSchema;
1560
+
1515
1561
  /**
1516
1562
  * Font properties for rich text.
1517
1563
  */
@@ -1550,32 +1596,6 @@ export const richtextpropertiesRichTextStyleSchema = z.object({
1550
1596
 
1551
1597
  export const richTextStyleSchema = richtextpropertiesRichTextStyleSchema;
1552
1598
 
1553
- /**
1554
- * The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports
1555
- * karaoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT
1556
- * files or auto-transcription via aliases.
1557
- *
1558
- */
1559
- export const richcaptionassetRichCaptionAssetSchema = z.object({
1560
- type: z.enum(['rich-caption']),
1561
- src: z.string().min(1),
1562
- font: z.optional(richcaptionpropertiesRichCaptionFontSchema),
1563
- style: z.optional(richtextpropertiesRichTextStyleSchema),
1564
- stroke: z.optional(richtextpropertiesRichTextStrokeSchema),
1565
- shadow: z.optional(richtextpropertiesRichTextShadowSchema),
1566
- background: z.optional(richtextpropertiesRichTextBackgroundSchema),
1567
- border: z.optional(richtextpropertiesRichTextBorderSchema),
1568
- padding: z.optional(z.union([
1569
- 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*\}\}$/)]),
1570
- richtextpropertiesRichTextPaddingSchema
1571
- ])),
1572
- align: z.optional(richtextpropertiesRichTextAlignmentSchema),
1573
- active: z.optional(richcaptionpropertiesRichCaptionActiveSchema),
1574
- wordAnimation: z.optional(richcaptionpropertiesRichCaptionWordAnimationSchema)
1575
- }).strict();
1576
-
1577
- export const richCaptionAssetSchema = richcaptionassetRichCaptionAssetSchema;
1578
-
1579
1599
  /**
1580
1600
  * The RichTextAsset provides advanced text rendering with support for custom fonts, gradients, shadows, strokes,
1581
1601
  * animations, and styling options. It offers more flexibility and visual effects than the basic TextAsset.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",