@shotstack/schemas 1.8.5 → 1.8.7

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.
@@ -814,7 +814,7 @@ export const akamaiNetStorageDestinationOptionsAkamaiNetStorageDestinationOption
814
814
  * Send videos and assets to [Akamai NetStorage](https://techdocs.akamai.com/netstorage-usage/docs). Send files to your NetStorage upload directory with a custom path and filename. Akamai credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/akamai-netstorage), not in the request.
815
815
  */
816
816
  export const akamaiNetStorageDestinationAkamaiNetStorageDestinationSchema = z.object({
817
- provider: z.string().default("akamai-netstorage"),
817
+ provider: z.literal("akamai-netstorage"),
818
818
  options: z.optional(akamaiNetStorageDestinationOptionsAkamaiNetStorageDestinationOptionsSchema),
819
819
  }).strict();
820
820
  /**
@@ -830,7 +830,7 @@ export const azureBlobStorageDestinationOptionsAzureBlobStorageDestinationOption
830
830
  * Send videos and assets to [Azure Blob Storage](https://learn.microsoft.com/en-us/azure/storage/blobs/). Send files to any container with a custom prefix and filename. Azure credentials are required and added via the [dashboard](https://dashboard.shotstack.io/integrations/azure-blob-storage), not in the request.
831
831
  */
832
832
  export const azureBlobStorageDestinationAzureBlobStorageDestinationSchema = z.object({
833
- provider: z.string().default("azure-blob-storage"),
833
+ provider: z.literal("azure-blob-storage"),
834
834
  options: z.optional(azureBlobStorageDestinationOptionsAzureBlobStorageDestinationOptionsSchema),
835
835
  }).strict();
836
836
  /**
@@ -967,7 +967,9 @@ export const destinationsDestinationsSchema = z.discriminatedUnion("provider", [
967
967
  googleCloudStorageDestinationGoogleCloudStorageDestinationSchema,
968
968
  googleDriveDestinationGoogleDriveDestinationSchema,
969
969
  vimeoDestinationVimeoDestinationSchema,
970
- tiktokDestinationTiktokDestinationSchema
970
+ tiktokDestinationTiktokDestinationSchema,
971
+ akamaiNetStorageDestinationAkamaiNetStorageDestinationSchema,
972
+ azureBlobStorageDestinationAzureBlobStorageDestinationSchema
971
973
  ]);
972
974
  export const destinationsSchema = destinationsDestinationsSchema;
973
975
  /**
@@ -1354,6 +1356,29 @@ export const richcaptionpropertiesRichCaptionActiveFontSchema = z.object({
1354
1356
  } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
1355
1357
  }).strict();
1356
1358
  export const richCaptionActiveFontSchema = richcaptionpropertiesRichCaptionActiveFontSchema;
1359
+ /**
1360
+ * Font properties for rich captions. Defaults to Roboto.
1361
+ */
1362
+ export const richcaptionpropertiesRichCaptionFontSchema = z.object({
1363
+ family: z.optional(z.string()).default("Roboto"),
1364
+ size: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1365
+ return undefined; if (Array.isArray(v))
1366
+ return v; if (typeof v === 'string') {
1367
+ if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1368
+ return v;
1369
+ return Number(v);
1370
+ } return v; }), z.number().int().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),
1371
+ weight: z.optional(z.unknown()).default("400"),
1372
+ color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#ffffff"),
1373
+ opacity: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1374
+ return undefined; if (Array.isArray(v))
1375
+ return v; if (typeof v === 'string') {
1376
+ if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1377
+ return v;
1378
+ return Number(v);
1379
+ } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(1),
1380
+ background: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1381
+ }).strict();
1357
1382
  /**
1358
1383
  * Word-level animation properties for caption effects.
1359
1384
  */
@@ -1378,34 +1403,6 @@ export const richcaptionpropertiesRichCaptionWordAnimationSchema = z.object({
1378
1403
  direction: z.optional(z.enum(["left", "right", "up", "down"])),
1379
1404
  }).strict();
1380
1405
  export const richCaptionWordAnimationSchema = richcaptionpropertiesRichCaptionWordAnimationSchema;
1381
- /**
1382
- * Word-level timing information for caption animation.
1383
- */
1384
- export const richcaptionpropertiesWordTimingSchema = z.object({
1385
- text: z.string().min(1),
1386
- start: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1387
- return undefined; if (Array.isArray(v))
1388
- return v; if (typeof v === 'string') {
1389
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1390
- return v;
1391
- return Number(v);
1392
- } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
1393
- end: z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1394
- return undefined; if (Array.isArray(v))
1395
- return v; if (typeof v === 'string') {
1396
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1397
- return v;
1398
- return Number(v);
1399
- } return v; }), z.number().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]),
1400
- confidence: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1401
- return undefined; if (Array.isArray(v))
1402
- return v; if (typeof v === 'string') {
1403
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1404
- return v;
1405
- return Number(v);
1406
- } return v; }), z.number().gte(0).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1407
- }).strict();
1408
- export const wordTimingSchema = richcaptionpropertiesWordTimingSchema;
1409
1406
  /**
1410
1407
  * Text alignment properties (horizontal and vertical).
1411
1408
  */
@@ -1678,13 +1675,13 @@ export const richTextStyleSchema = richtextpropertiesRichTextStyleSchema;
1678
1675
  */
1679
1676
  export const richcaptionassetRichCaptionAssetSchema = z.object({
1680
1677
  type: z.enum(["rich-caption"]),
1681
- src: z.optional(z.string().min(1)),
1682
- words: z.optional(z.array(richcaptionpropertiesWordTimingSchema).max(100000)),
1683
- font: z.optional(richtextpropertiesRichTextFontSchema),
1678
+ src: z.string().min(1),
1679
+ font: z.optional(richcaptionpropertiesRichCaptionFontSchema),
1684
1680
  style: z.optional(richtextpropertiesRichTextStyleSchema),
1685
1681
  stroke: z.optional(richtextpropertiesRichTextStrokeSchema),
1686
1682
  shadow: z.optional(richtextpropertiesRichTextShadowSchema),
1687
1683
  background: z.optional(richtextpropertiesRichTextBackgroundSchema),
1684
+ border: z.optional(richtextpropertiesRichTextBorderSchema),
1688
1685
  padding: z.optional(z.union([z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1689
1686
  return undefined; if (Array.isArray(v))
1690
1687
  return v; if (typeof v === 'string') {
@@ -1695,21 +1692,6 @@ export const richcaptionassetRichCaptionAssetSchema = z.object({
1695
1692
  align: z.optional(richtextpropertiesRichTextAlignmentSchema),
1696
1693
  active: z.optional(richcaptionpropertiesRichCaptionActiveSchema),
1697
1694
  wordAnimation: z.optional(richcaptionpropertiesRichCaptionWordAnimationSchema),
1698
- position: z.optional(z.enum(["top", "center", "bottom"])),
1699
- maxWidth: z.optional(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.1).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.9),
1706
- maxLines: z.optional(z.union([z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1707
- return undefined; if (Array.isArray(v))
1708
- return v; if (typeof v === 'string') {
1709
- if (/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/.test(v))
1710
- return v;
1711
- return Number(v);
1712
- } return v; }), z.number().int().gte(1).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(2),
1713
1695
  }).strict();
1714
1696
  export const richCaptionAssetSchema = richcaptionassetRichCaptionAssetSchema;
1715
1697
  /**
@@ -804,7 +804,7 @@ export const akamaiNetStorageDestinationOptionsAkamaiNetStorageDestinationOption
804
804
  */
805
805
  export const akamaiNetStorageDestinationAkamaiNetStorageDestinationSchema =
806
806
  z.object({
807
- provider: z.string().default("akamai-netstorage"),
807
+ provider: z.literal("akamai-netstorage"),
808
808
  options: z.optional(
809
809
  akamaiNetStorageDestinationOptionsAkamaiNetStorageDestinationOptionsSchema,
810
810
  ),
@@ -826,7 +826,7 @@ export const azureBlobStorageDestinationOptionsAzureBlobStorageDestinationOption
826
826
  */
827
827
  export const azureBlobStorageDestinationAzureBlobStorageDestinationSchema =
828
828
  z.object({
829
- provider: z.string().default("azure-blob-storage"),
829
+ provider: z.literal("azure-blob-storage"),
830
830
  options: z.optional(
831
831
  azureBlobStorageDestinationOptionsAzureBlobStorageDestinationOptionsSchema,
832
832
  ),
@@ -1011,7 +1011,9 @@ export const destinationsDestinationsSchema = z.discriminatedUnion("provider", [
1011
1011
  googleCloudStorageDestinationGoogleCloudStorageDestinationSchema,
1012
1012
  googleDriveDestinationGoogleDriveDestinationSchema,
1013
1013
  vimeoDestinationVimeoDestinationSchema,
1014
- tiktokDestinationTiktokDestinationSchema
1014
+ tiktokDestinationTiktokDestinationSchema,
1015
+ akamaiNetStorageDestinationAkamaiNetStorageDestinationSchema,
1016
+ azureBlobStorageDestinationAzureBlobStorageDestinationSchema
1015
1017
  ]);
1016
1018
 
1017
1019
  export const destinationsSchema = destinationsDestinationsSchema;
@@ -1436,6 +1438,18 @@ export const richcaptionpropertiesRichCaptionActiveFontSchema = z.object({
1436
1438
  export const richCaptionActiveFontSchema =
1437
1439
  richcaptionpropertiesRichCaptionActiveFontSchema;
1438
1440
 
1441
+ /**
1442
+ * Font properties for rich captions. Defaults to Roboto.
1443
+ */
1444
+ export const richcaptionpropertiesRichCaptionFontSchema = z.object({
1445
+ family: z.optional(z.string()).default("Roboto"),
1446
+ size: 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().int().gte(1).lte(500)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(24),
1447
+ weight: z.optional(z.unknown()).default("400"),
1448
+ color: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default("#ffffff"),
1449
+ 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*\}\}$/)])).default(1),
1450
+ background: z.optional(z.union([z.string().regex(/^#[A-Fa-f0-9]{6}$/), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])),
1451
+ }).strict();
1452
+
1439
1453
  /**
1440
1454
  * Word-level animation properties for caption effects.
1441
1455
  */
@@ -1457,18 +1471,6 @@ export const richcaptionpropertiesRichCaptionWordAnimationSchema = z.object({
1457
1471
  export const richCaptionWordAnimationSchema =
1458
1472
  richcaptionpropertiesRichCaptionWordAnimationSchema;
1459
1473
 
1460
- /**
1461
- * Word-level timing information for caption animation.
1462
- */
1463
- export const richcaptionpropertiesWordTimingSchema = z.object({
1464
- text: z.string().min(1),
1465
- start: 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*\}\}$/)]),
1466
- end: 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*\}\}$/)]),
1467
- confidence: 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*\}\}$/)])),
1468
- }).strict();
1469
-
1470
- export const wordTimingSchema = richcaptionpropertiesWordTimingSchema;
1471
-
1472
1474
  /**
1473
1475
  * Text alignment properties (horizontal and vertical).
1474
1476
  */
@@ -1625,13 +1627,13 @@ export const richTextStyleSchema = richtextpropertiesRichTextStyleSchema;
1625
1627
  */
1626
1628
  export const richcaptionassetRichCaptionAssetSchema = z.object({
1627
1629
  type: z.enum(["rich-caption"]),
1628
- src: z.optional(z.string().min(1)),
1629
- words: z.optional(z.array(richcaptionpropertiesWordTimingSchema).max(100000)),
1630
- font: z.optional(richtextpropertiesRichTextFontSchema),
1630
+ src: z.string().min(1),
1631
+ font: z.optional(richcaptionpropertiesRichCaptionFontSchema),
1631
1632
  style: z.optional(richtextpropertiesRichTextStyleSchema),
1632
1633
  stroke: z.optional(richtextpropertiesRichTextStrokeSchema),
1633
1634
  shadow: z.optional(richtextpropertiesRichTextShadowSchema),
1634
1635
  background: z.optional(richtextpropertiesRichTextBackgroundSchema),
1636
+ border: z.optional(richtextpropertiesRichTextBorderSchema),
1635
1637
  padding: z.optional(
1636
1638
  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().gte(0)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)]), richtextpropertiesRichTextPaddingSchema]),
1637
1639
  ),
@@ -1640,9 +1642,6 @@ export const richcaptionassetRichCaptionAssetSchema = z.object({
1640
1642
  wordAnimation: z.optional(
1641
1643
  richcaptionpropertiesRichCaptionWordAnimationSchema,
1642
1644
  ),
1643
- position: z.optional(z.enum(["top", "center", "bottom"])),
1644
- maxWidth: 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.1).lte(1)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(0.9),
1645
- maxLines: 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().int().gte(1).lte(10)), z.string().regex(/^\{\{\s*[A-Za-z0-9_]+\s*\}\}$/)])).default(2),
1646
1645
  }).strict();
1647
1646
 
1648
1647
  export const richCaptionAssetSchema = richcaptionassetRichCaptionAssetSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.8.5",
3
+ "version": "1.8.7",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,44 +0,0 @@
1
- {
2
- "name": "WordTiming",
3
- "strict": true,
4
- "schema": {
5
- "description": "Word-level timing information for caption animation.",
6
- "type": "object",
7
- "properties": {
8
- "text": {
9
- "description": "The word text to display.",
10
- "type": "string"
11
- },
12
- "start": {
13
- "description": "Start time of the word in milliseconds.",
14
- "type": "number",
15
- "minimum": 0
16
- },
17
- "end": {
18
- "description": "End time of the word in milliseconds.",
19
- "type": "number",
20
- "minimum": 0
21
- },
22
- "confidence": {
23
- "anyOf": [
24
- {
25
- "type": "number",
26
- "description": "Speech-to-text confidence score between 0 and 1.",
27
- "minimum": 0,
28
- "maximum": 1
29
- },
30
- {
31
- "type": "null"
32
- }
33
- ]
34
- }
35
- },
36
- "additionalProperties": false,
37
- "required": [
38
- "text",
39
- "start",
40
- "end",
41
- "confidence"
42
- ]
43
- }
44
- }