@shotstack/schemas 1.10.6 → 1.10.8

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.
@@ -1803,7 +1803,7 @@
1803
1803
  ]
1804
1804
  },
1805
1805
  "RichCaptionAsset": {
1806
- "description": "The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports\nkaraoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT\nfiles or auto-transcription via aliases.\n",
1806
+ "description": "The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports\nkaraoke-style highlighting, word-by-word animations, and advanced typography. Captions can be\nsourced from SRT/VTT/TTML subtitle files, from audio/video media URLs (auto-transcribed), or\nfrom alias references to other clips in the same timeline.\n",
1807
1807
  "type": "object",
1808
1808
  "properties": {
1809
1809
  "type": {
@@ -1815,7 +1815,7 @@
1815
1815
  "type": "string"
1816
1816
  },
1817
1817
  "src": {
1818
- "description": "The URL to an SRT or VTT subtitles file, or an alias reference to auto-generate captions from an audio or video clip. For file URLs, the URL must be publicly accessible or include credentials. For auto-captioning, use the format `alias://clip-name` where clip-name is the alias of an audio, video, or text-to-speech clip.",
1818
+ "description": "Source for the caption words. Accepts three formats: (1) the URL to a subtitle file (`.srt`, `.vtt`, `.ttml`, or `.dfxp`) which is parsed directly; (2) the URL to an audio or video media file (`.mp4`, `.mov`, `.webm`, `.mp3`, `.wav`, `.m4a`, `.flac`, `.aac`, `.ogg`, and related formats) which is auto-transcribed; (3) an alias reference in the form `alias://clip-name` where `clip-name` is the alias of another audio, video, or text-to-speech clip in the same timeline — the referenced clip's source is auto-transcribed. For file URLs, the URL must be publicly accessible or include credentials. Content is classified at runtime and unsupported content types (HTML, PDF, images, archives) are rejected with a structured error.",
1819
1819
  "type": "string",
1820
1820
  "minLength": 1,
1821
1821
  "example": "alias://audio"
@@ -3132,6 +3132,12 @@
3132
3132
  "minimum": 0,
3133
3133
  "default": 0,
3134
3134
  "example": 10
3135
+ },
3136
+ "wrap": {
3137
+ "description": "When true, the background pill shrinks to fit the rendered text bounding box plus the\nasset's padding (and stroke width, if present), producing a pill or badge effect. When\nfalse (default), the background fills the full asset content area. Available on\nrich-text and rich-caption assets only; not supported on legacy `type: text`.\n",
3138
+ "type": "boolean",
3139
+ "default": false,
3140
+ "example": true
3135
3141
  }
3136
3142
  },
3137
3143
  "additionalProperties": false,
@@ -1006,6 +1006,16 @@
1006
1006
  "type": "null"
1007
1007
  }
1008
1008
  ]
1009
+ },
1010
+ "wrap": {
1011
+ "anyOf": [
1012
+ {
1013
+ "type": "boolean"
1014
+ },
1015
+ {
1016
+ "type": "null"
1017
+ }
1018
+ ]
1009
1019
  }
1010
1020
  },
1011
1021
  "additionalProperties": false,
@@ -1013,7 +1023,8 @@
1013
1023
  "required": [
1014
1024
  "color",
1015
1025
  "opacity",
1016
- "borderRadius"
1026
+ "borderRadius",
1027
+ "wrap"
1017
1028
  ]
1018
1029
  },
1019
1030
  "RichTextAlignment": {
@@ -1238,6 +1238,16 @@
1238
1238
  "type": "null"
1239
1239
  }
1240
1240
  ]
1241
+ },
1242
+ "wrap": {
1243
+ "anyOf": [
1244
+ {
1245
+ "type": "boolean"
1246
+ },
1247
+ {
1248
+ "type": "null"
1249
+ }
1250
+ ]
1241
1251
  }
1242
1252
  },
1243
1253
  "additionalProperties": false,
@@ -1245,7 +1255,8 @@
1245
1255
  "required": [
1246
1256
  "color",
1247
1257
  "opacity",
1248
- "borderRadius"
1258
+ "borderRadius",
1259
+ "wrap"
1249
1260
  ]
1250
1261
  },
1251
1262
  "RichTextAlignment": {
@@ -1422,6 +1422,16 @@
1422
1422
  "type": "null"
1423
1423
  }
1424
1424
  ]
1425
+ },
1426
+ "wrap": {
1427
+ "anyOf": [
1428
+ {
1429
+ "type": "boolean"
1430
+ },
1431
+ {
1432
+ "type": "null"
1433
+ }
1434
+ ]
1425
1435
  }
1426
1436
  },
1427
1437
  "additionalProperties": false,
@@ -1429,7 +1439,8 @@
1429
1439
  "required": [
1430
1440
  "color",
1431
1441
  "opacity",
1432
- "borderRadius"
1442
+ "borderRadius",
1443
+ "wrap"
1433
1444
  ]
1434
1445
  },
1435
1446
  "RichTextAlignment": {
@@ -509,6 +509,16 @@
509
509
  "type": "null"
510
510
  }
511
511
  ]
512
+ },
513
+ "wrap": {
514
+ "anyOf": [
515
+ {
516
+ "type": "boolean"
517
+ },
518
+ {
519
+ "type": "null"
520
+ }
521
+ ]
512
522
  }
513
523
  },
514
524
  "additionalProperties": false,
@@ -516,7 +526,8 @@
516
526
  "required": [
517
527
  "color",
518
528
  "opacity",
519
- "borderRadius"
529
+ "borderRadius",
530
+ "wrap"
520
531
  ]
521
532
  },
522
533
  "RichTextAsset": {
@@ -617,6 +617,16 @@
617
617
  "type": "null"
618
618
  }
619
619
  ]
620
+ },
621
+ "wrap": {
622
+ "anyOf": [
623
+ {
624
+ "type": "boolean"
625
+ },
626
+ {
627
+ "type": "null"
628
+ }
629
+ ]
620
630
  }
621
631
  },
622
632
  "additionalProperties": false,
@@ -624,7 +634,8 @@
624
634
  "required": [
625
635
  "color",
626
636
  "opacity",
627
- "borderRadius"
637
+ "borderRadius",
638
+ "wrap"
628
639
  ]
629
640
  },
630
641
  "RichTextAlignment": {
@@ -39,6 +39,17 @@
39
39
  "type": "null"
40
40
  }
41
41
  ]
42
+ },
43
+ "wrap": {
44
+ "anyOf": [
45
+ {
46
+ "type": "boolean",
47
+ "description": "When true, the background pill shrinks to fit the rendered text bounding box plus the\nasset's padding (and stroke width, if present), producing a pill or badge effect. When\nfalse (default), the background fills the full asset content area. Available on\nrich-text and rich-caption assets only; not supported on legacy `type: text`.\n"
48
+ },
49
+ {
50
+ "type": "null"
51
+ }
52
+ ]
42
53
  }
43
54
  },
44
55
  "additionalProperties": false,
@@ -46,7 +57,8 @@
46
57
  "required": [
47
58
  "color",
48
59
  "opacity",
49
- "borderRadius"
60
+ "borderRadius",
61
+ "wrap"
50
62
  ]
51
63
  }
52
64
  }
@@ -315,6 +315,16 @@
315
315
  "type": "null"
316
316
  }
317
317
  ]
318
+ },
319
+ "wrap": {
320
+ "anyOf": [
321
+ {
322
+ "type": "boolean"
323
+ },
324
+ {
325
+ "type": "null"
326
+ }
327
+ ]
318
328
  }
319
329
  },
320
330
  "additionalProperties": false,
@@ -322,7 +332,8 @@
322
332
  "required": [
323
333
  "color",
324
334
  "opacity",
325
- "borderRadius"
335
+ "borderRadius",
336
+ "wrap"
326
337
  ]
327
338
  },
328
339
  "RichTextAlignment": {
@@ -1488,6 +1488,17 @@
1488
1488
  "type": "null"
1489
1489
  }
1490
1490
  ]
1491
+ },
1492
+ "wrap": {
1493
+ "anyOf": [
1494
+ {
1495
+ "type": "boolean",
1496
+ "description": "When true, the background pill shrinks to fit the rendered text bounding box plus the\nasset's padding (and stroke width, if present), producing a pill or badge effect. When\nfalse (default), the background fills the full asset content area. Available on\nrich-text and rich-caption assets only; not supported on legacy `type: text`.\n"
1497
+ },
1498
+ {
1499
+ "type": "null"
1500
+ }
1501
+ ]
1491
1502
  }
1492
1503
  },
1493
1504
  "additionalProperties": false,
@@ -1495,7 +1506,8 @@
1495
1506
  "required": [
1496
1507
  "color",
1497
1508
  "opacity",
1498
- "borderRadius"
1509
+ "borderRadius",
1510
+ "wrap"
1499
1511
  ]
1500
1512
  },
1501
1513
  "RichTextAlignment": {
@@ -2013,7 +2025,7 @@
2013
2025
  ]
2014
2026
  },
2015
2027
  "RichCaptionAsset": {
2016
- "description": "The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports\nkaraoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT\nfiles or auto-transcription via aliases.\n",
2028
+ "description": "The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports\nkaraoke-style highlighting, word-by-word animations, and advanced typography. Captions can be\nsourced from SRT/VTT/TTML subtitle files, from audio/video media URLs (auto-transcribed), or\nfrom alias references to other clips in the same timeline.\n",
2017
2029
  "type": "object",
2018
2030
  "properties": {
2019
2031
  "type": {
@@ -2024,7 +2036,7 @@
2024
2036
  "type": "string"
2025
2037
  },
2026
2038
  "src": {
2027
- "description": "The URL to an SRT or VTT subtitles file, or an alias reference to auto-generate captions from an audio or video clip. For file URLs, the URL must be publicly accessible or include credentials. For auto-captioning, use the format `alias://clip-name` where clip-name is the alias of an audio, video, or text-to-speech clip.",
2039
+ "description": "Source for the caption words. Accepts three formats: (1) the URL to a subtitle file (`.srt`, `.vtt`, `.ttml`, or `.dfxp`) which is parsed directly; (2) the URL to an audio or video media file (`.mp4`, `.mov`, `.webm`, `.mp3`, `.wav`, `.m4a`, `.flac`, `.aac`, `.ogg`, and related formats) which is auto-transcribed; (3) an alias reference in the form `alias://clip-name` where `clip-name` is the alias of another audio, video, or text-to-speech clip in the same timeline — the referenced clip's source is auto-transcribed. For file URLs, the URL must be publicly accessible or include credentials. Content is classified at runtime and unsupported content types (HTML, PDF, images, archives) are rejected with a structured error.",
2028
2040
  "type": "string"
2029
2041
  },
2030
2042
  "font": {
@@ -1366,6 +1366,16 @@
1366
1366
  "type": "null"
1367
1367
  }
1368
1368
  ]
1369
+ },
1370
+ "wrap": {
1371
+ "anyOf": [
1372
+ {
1373
+ "type": "boolean"
1374
+ },
1375
+ {
1376
+ "type": "null"
1377
+ }
1378
+ ]
1369
1379
  }
1370
1380
  },
1371
1381
  "additionalProperties": false,
@@ -1373,7 +1383,8 @@
1373
1383
  "required": [
1374
1384
  "color",
1375
1385
  "opacity",
1376
- "borderRadius"
1386
+ "borderRadius",
1387
+ "wrap"
1377
1388
  ]
1378
1389
  },
1379
1390
  "RichTextAlignment": {
@@ -1253,6 +1253,16 @@
1253
1253
  "type": "null"
1254
1254
  }
1255
1255
  ]
1256
+ },
1257
+ "wrap": {
1258
+ "anyOf": [
1259
+ {
1260
+ "type": "boolean"
1261
+ },
1262
+ {
1263
+ "type": "null"
1264
+ }
1265
+ ]
1256
1266
  }
1257
1267
  },
1258
1268
  "additionalProperties": false,
@@ -1260,7 +1270,8 @@
1260
1270
  "required": [
1261
1271
  "color",
1262
1272
  "opacity",
1263
- "borderRadius"
1273
+ "borderRadius",
1274
+ "wrap"
1264
1275
  ]
1265
1276
  },
1266
1277
  "RichTextAlignment": {
package/dist/schema.d.ts CHANGED
@@ -931,8 +931,9 @@ export interface components {
931
931
  };
932
932
  /**
933
933
  * @description The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports
934
- * karaoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT
935
- * files or auto-transcription via aliases.
934
+ * karaoke-style highlighting, word-by-word animations, and advanced typography. Captions can be
935
+ * sourced from SRT/VTT/TTML subtitle files, from audio/video media URLs (auto-transcribed), or
936
+ * from alias references to other clips in the same timeline.
936
937
  */
937
938
  RichCaptionAsset: {
938
939
  /**
@@ -941,7 +942,7 @@ export interface components {
941
942
  */
942
943
  type: "rich-caption";
943
944
  /**
944
- * @description The URL to an SRT or VTT subtitles file, or an alias reference to auto-generate captions from an audio or video clip. For file URLs, the URL must be publicly accessible or include credentials. For auto-captioning, use the format `alias://clip-name` where clip-name is the alias of an audio, video, or text-to-speech clip.
945
+ * @description Source for the caption words. Accepts three formats: (1) the URL to a subtitle file (`.srt`, `.vtt`, `.ttml`, or `.dfxp`) which is parsed directly; (2) the URL to an audio or video media file (`.mp4`, `.mov`, `.webm`, `.mp3`, `.wav`, `.m4a`, `.flac`, `.aac`, `.ogg`, and related formats) which is auto-transcribed; (3) an alias reference in the form `alias://clip-name` where `clip-name` is the alias of another audio, video, or text-to-speech clip in the same timeline — the referenced clip's source is auto-transcribed. For file URLs, the URL must be publicly accessible or include credentials. Content is classified at runtime and unsupported content types (HTML, PDF, images, archives) are rejected with a structured error.
945
946
  * @example alias://audio
946
947
  */
947
948
  src: string;
@@ -1750,6 +1751,15 @@ export interface components {
1750
1751
  * @example 10
1751
1752
  */
1752
1753
  borderRadius?: number;
1754
+ /**
1755
+ * @description When true, the background pill shrinks to fit the rendered text bounding box plus the
1756
+ * asset's padding (and stroke width, if present), producing a pill or badge effect. When
1757
+ * false (default), the background fills the full asset content area. Available on
1758
+ * rich-text and rich-caption assets only; not supported on legacy `type: text`.
1759
+ * @default false
1760
+ * @example true
1761
+ */
1762
+ wrap?: boolean;
1753
1763
  };
1754
1764
  /** @description Text alignment properties (horizontal and vertical). */
1755
1765
  RichTextAlignment: {
@@ -920,7 +920,8 @@ exports.richtextpropertiesRichTextBackgroundSchema = zod_1.z.object({
920
920
  if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
921
921
  return v;
922
922
  return Number(v);
923
- } return v; }), zod_1.z.number().gte(0)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0)
923
+ } return v; }), zod_1.z.number().gte(0)), zod_1.z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0),
924
+ wrap: zod_1.z.optional(zod_1.z.boolean()).default(false)
924
925
  }).strict();
925
926
  exports.richTextBackgroundSchema = exports.richtextpropertiesRichTextBackgroundSchema;
926
927
  /**
@@ -1118,8 +1119,9 @@ exports.richcaptionpropertiesRichCaptionActiveSchema = zod_1.z.object({
1118
1119
  exports.richCaptionActiveSchema = exports.richcaptionpropertiesRichCaptionActiveSchema;
1119
1120
  /**
1120
1121
  * The RichCaptionAsset provides word-level caption animations with rich-text styling. It supports
1121
- * karaoke-style highlighting, word-by-word animations, and advanced typography. Use with SRT/VTT
1122
- * files or auto-transcription via aliases.
1122
+ * karaoke-style highlighting, word-by-word animations, and advanced typography. Captions can be
1123
+ * sourced from SRT/VTT/TTML subtitle files, from audio/video media URLs (auto-transcribed), or
1124
+ * from alias references to other clips in the same timeline.
1123
1125
  *
1124
1126
  */
1125
1127
  exports.richcaptionassetRichCaptionAssetSchema = zod_1.z.object({
@@ -1144,22 +1146,7 @@ exports.richcaptionassetRichCaptionAssetSchema = zod_1.z.object({
1144
1146
  align: zod_1.z.optional(exports.richtextpropertiesRichTextAlignmentSchema),
1145
1147
  active: zod_1.z.optional(exports.richcaptionpropertiesRichCaptionActiveSchema),
1146
1148
  animation: zod_1.z.optional(exports.richcaptionpropertiesRichCaptionAnimationSchema)
1147
- }).strict().superRefine((data, ctx) => {
1148
- if (data.src) {
1149
- try {
1150
- const pathname = new URL(data.src).pathname.toLowerCase();
1151
- const mediaExts = [".m4a", ".mp3", ".wav", ".aac", ".ogg", ".flac", ".wma", ".mp4", ".mov", ".avi", ".mkv", ".webm", ".wmv", ".flv", ".3gp"];
1152
- if (mediaExts.some((ext) => pathname.endsWith(ext))) {
1153
- ctx.addIssue({
1154
- code: zod_1.z.ZodIssueCode.custom,
1155
- message: "Caption src must be an SRT or VTT subtitle file. To generate captions from a media asset, use an alias reference (e.g. \"alias://my-clip\") instead of a direct URL. See: https://shotstack.io/docs/guide/architecting-an-application/rich-captions/",
1156
- path: ["src"],
1157
- });
1158
- }
1159
- }
1160
- catch { }
1161
- }
1162
- });
1149
+ }).strict();
1163
1150
  exports.richCaptionAssetSchema = exports.richcaptionassetRichCaptionAssetSchema;
1164
1151
  /**
1165
1152
  * Font properties for rich text.