@shotstack/schemas 1.4.5 → 1.4.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.
@@ -92,7 +92,7 @@ export const captionMarginSchema = captionpropertiesCaptionMarginSchema;
92
92
  */
93
93
  export const captionassetCaptionAssetSchema = z.object({
94
94
  type: z.enum(["caption"]),
95
- src: z.string(),
95
+ src: z.string().min(1).regex(/\S/),
96
96
  font: z.optional(captionpropertiesCaptionFontSchema),
97
97
  background: z.optional(captionpropertiesCaptionBackgroundSchema),
98
98
  margin: z.optional(captionpropertiesCaptionMarginSchema),
@@ -913,7 +913,7 @@ export const htmlAssetSchema = htmlassetHtmlAssetSchema;
913
913
  */
914
914
  export const imageassetImageAssetSchema = z.object({
915
915
  type: z.enum(["image"]),
916
- src: z.string(),
916
+ src: z.string().min(1).regex(/\S/),
917
917
  crop: z.optional(cropCropSchema),
918
918
  });
919
919
  export const imageAssetSchema = imageassetImageAssetSchema;
@@ -921,8 +921,8 @@ export const imageAssetSchema = imageassetImageAssetSchema;
921
921
  * The ImageToVideoAsset lets you create a video from an image and a text prompt.
922
922
  */
923
923
  export const imagetovideoassetImageToVideoAssetSchema = z.object({
924
- type: z.optional(z.enum(["image-to-video"])),
925
- src: z.optional(z.string()),
924
+ type: z.enum(["image-to-video"]),
925
+ src: z.string().min(1),
926
926
  prompt: z.optional(z.string()),
927
927
  aspectRatio: z.optional(z.enum(["1:1", "4:3", "16:9", "9:16", "3:4", "21:9", "9:21"])),
928
928
  speed: z.optional(z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
@@ -1055,7 +1055,7 @@ export const transcriptionSchema = transcriptionTranscriptionSchema;
1055
1055
  */
1056
1056
  export const lumaassetLumaAssetSchema = z.object({
1057
1057
  type: z.enum(["luma"]),
1058
- src: z.string(),
1058
+ src: z.string().min(1).regex(/\S/),
1059
1059
  trim: z.optional(z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1060
1060
  return undefined; if (Array.isArray(v))
1061
1061
  return v; if (typeof v === 'string')
@@ -1067,7 +1067,7 @@ export const lumaAssetSchema = lumaassetLumaAssetSchema;
1067
1067
  */
1068
1068
  export const mergefieldMergeFieldSchema = z.object({
1069
1069
  find: z.string(),
1070
- replace: z.unknown(),
1070
+ replace: z.union([z.string(), z.number(), z.boolean(), z.null(), z.record(z.string(), z.unknown()), z.array(z.unknown())]),
1071
1071
  });
1072
1072
  export const mergeFieldSchema = mergefieldMergeFieldSchema;
1073
1073
  /**
@@ -1222,10 +1222,6 @@ export const richtextpropertiesRichTextAnimationSchema = z.object({
1222
1222
  "shift",
1223
1223
  "movingLetters",
1224
1224
  ]),
1225
- speed: z.optional(z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1226
- return undefined; if (Array.isArray(v))
1227
- return v; if (typeof v === 'string')
1228
- return Number(v); return v; }), z.number().gte(0.1).lte(10))).default(1),
1229
1225
  duration: z.optional(z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1230
1226
  return undefined; if (Array.isArray(v))
1231
1227
  return v; if (typeof v === 'string')
@@ -1692,7 +1688,7 @@ export const sourceSchema = sourceSourceSchema;
1692
1688
  * A music or audio file in mp3 format that plays for the duration of the rendered video or the length of the audio file, which ever is shortest.
1693
1689
  */
1694
1690
  export const soundtrackSoundtrackSchema = z.object({
1695
- src: z.string(),
1691
+ src: z.string().min(1).regex(/\S/),
1696
1692
  effect: z.optional(z.enum(["fadeIn", "fadeOut", "fadeInFadeOut"])),
1697
1693
  volume: z.optional(z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
1698
1694
  return undefined; if (Array.isArray(v))
@@ -2540,7 +2536,7 @@ export const tweenSchema = tweenTweenSchema;
2540
2536
  */
2541
2537
  export const audioassetAudioAssetSchema = z.object({
2542
2538
  type: z.enum(["audio"]),
2543
- src: z.string(),
2539
+ src: z.string().min(1).regex(/\S/),
2544
2540
  trim: z.optional(z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2545
2541
  return undefined; if (Array.isArray(v))
2546
2542
  return v; if (typeof v === 'string')
@@ -2656,7 +2652,7 @@ export const transformationSchema = transformationTransformationSchema;
2656
2652
  */
2657
2653
  export const videoassetVideoAssetSchema = z.object({
2658
2654
  type: z.enum(["video"]),
2659
- src: z.string(),
2655
+ src: z.string().min(1).regex(/\S/),
2660
2656
  transcode: z.optional(z.boolean()),
2661
2657
  trim: z.optional(z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2662
2658
  return undefined; if (Array.isArray(v))
@@ -2703,14 +2699,14 @@ export const clipClipSchema = z.object({
2703
2699
  z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2704
2700
  return undefined; if (Array.isArray(v))
2705
2701
  return v; if (typeof v === 'string')
2706
- return Number(v); return v; }), z.number()),
2702
+ return Number(v); return v; }), z.number().gte(0)),
2707
2703
  z.string().regex(/^(auto|alias:\/\/[A-Za-z0-9_-]+)$/),
2708
2704
  ]),
2709
2705
  length: z.union([
2710
2706
  z.preprocess(((v) => { if (v === '' || v === null || v === undefined)
2711
2707
  return undefined; if (Array.isArray(v))
2712
2708
  return v; if (typeof v === 'string')
2713
- return Number(v); return v; }), z.number()),
2709
+ return Number(v); return v; }), z.number().gte(0)),
2714
2710
  z.string().regex(/^(auto|end|alias:\/\/[A-Za-z0-9_-]+)$/),
2715
2711
  ]),
2716
2712
  fit: z.optional(z.enum(["cover", "contain", "crop", "none"])),
@@ -2782,7 +2778,7 @@ export const clipSchema = clipClipSchema;
2782
2778
  * A track contains an array of clips. Tracks are layered on top of each other in the order in the array. The top most track will render on top of those below it.
2783
2779
  */
2784
2780
  export const trackTrackSchema = z.object({
2785
- clips: z.array(clipClipSchema),
2781
+ clips: z.array(clipClipSchema).min(1),
2786
2782
  });
2787
2783
  export const trackSchema = trackTrackSchema;
2788
2784
  /**
@@ -2792,7 +2788,7 @@ export const timelineTimelineSchema = z.object({
2792
2788
  soundtrack: z.optional(soundtrackSoundtrackSchema),
2793
2789
  background: z.optional(z.string()),
2794
2790
  fonts: z.optional(z.array(fontFontSchema)),
2795
- tracks: z.array(trackTrackSchema),
2791
+ tracks: z.array(trackTrackSchema).min(1),
2796
2792
  cache: z.optional(z.boolean()),
2797
2793
  });
2798
2794
  export const timelineSchema = timelineTimelineSchema;
@@ -86,7 +86,7 @@ export const captionMarginSchema = captionpropertiesCaptionMarginSchema;
86
86
  */
87
87
  export const captionassetCaptionAssetSchema = z.object({
88
88
  type: z.enum(["caption"]),
89
- src: z.string(),
89
+ src: z.string().min(1).regex(/\S/),
90
90
  font: z.optional(captionpropertiesCaptionFontSchema),
91
91
  background: z.optional(captionpropertiesCaptionBackgroundSchema),
92
92
  margin: z.optional(captionpropertiesCaptionMarginSchema),
@@ -1031,7 +1031,7 @@ export const htmlAssetSchema = htmlassetHtmlAssetSchema;
1031
1031
  */
1032
1032
  export const imageassetImageAssetSchema = z.object({
1033
1033
  type: z.enum(["image"]),
1034
- src: z.string(),
1034
+ src: z.string().min(1).regex(/\S/),
1035
1035
  crop: z.optional(cropCropSchema),
1036
1036
  });
1037
1037
 
@@ -1041,8 +1041,8 @@ export const imageAssetSchema = imageassetImageAssetSchema;
1041
1041
  * The ImageToVideoAsset lets you create a video from an image and a text prompt.
1042
1042
  */
1043
1043
  export const imagetovideoassetImageToVideoAssetSchema = z.object({
1044
- type: z.optional(z.enum(["image-to-video"])),
1045
- src: z.optional(z.string()),
1044
+ type: z.enum(["image-to-video"]),
1045
+ src: z.string().min(1),
1046
1046
  prompt: z.optional(z.string()),
1047
1047
  aspectRatio: z.optional(
1048
1048
  z.enum(["1:1", "4:3", "16:9", "9:16", "3:4", "21:9", "9:21"]),
@@ -1206,7 +1206,7 @@ export const transcriptionSchema = transcriptionTranscriptionSchema;
1206
1206
  */
1207
1207
  export const lumaassetLumaAssetSchema = z.object({
1208
1208
  type: z.enum(["luma"]),
1209
- src: z.string(),
1209
+ src: z.string().min(1).regex(/\S/),
1210
1210
  trim: z.optional(z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number())),
1211
1211
  });
1212
1212
 
@@ -1217,7 +1217,7 @@ export const lumaAssetSchema = lumaassetLumaAssetSchema;
1217
1217
  */
1218
1218
  export const mergefieldMergeFieldSchema = z.object({
1219
1219
  find: z.string(),
1220
- replace: z.unknown(),
1220
+ replace: z.union([z.string(), z.number(), z.boolean(), z.null(), z.record(z.string(), z.unknown()), z.array(z.unknown())]),
1221
1221
  });
1222
1222
 
1223
1223
  export const mergeFieldSchema = mergefieldMergeFieldSchema;
@@ -1403,7 +1403,6 @@ export const richtextpropertiesRichTextAnimationSchema = z.object({
1403
1403
  "shift",
1404
1404
  "movingLetters",
1405
1405
  ]),
1406
- speed: z.optional(z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number().gte(0.1).lte(10))).default(1),
1407
1406
  duration: z.optional(z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number().gte(0.1).lte(30))),
1408
1407
  style: z.optional(z.enum(["character", "word"])),
1409
1408
  direction: z.optional(z.enum(["left", "right", "up", "down"])),
@@ -1818,7 +1817,7 @@ export const sourceSchema = sourceSourceSchema;
1818
1817
  * A music or audio file in mp3 format that plays for the duration of the rendered video or the length of the audio file, which ever is shortest.
1819
1818
  */
1820
1819
  export const soundtrackSoundtrackSchema = z.object({
1821
- src: z.string(),
1820
+ src: z.string().min(1).regex(/\S/),
1822
1821
  effect: z.optional(z.enum(["fadeIn", "fadeOut", "fadeInFadeOut"])),
1823
1822
  volume: z.optional(z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number())),
1824
1823
  });
@@ -2549,7 +2548,7 @@ export const tweenSchema = tweenTweenSchema;
2549
2548
  */
2550
2549
  export const audioassetAudioAssetSchema = z.object({
2551
2550
  type: z.enum(["audio"]),
2552
- src: z.string(),
2551
+ src: z.string().min(1).regex(/\S/),
2553
2552
  trim: z.optional(z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number())),
2554
2553
  volume: z.optional(
2555
2554
  z.union([z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number().gte(0).lte(1)), z.array(tweenTweenSchema)]),
@@ -2673,7 +2672,7 @@ export const transformationSchema = transformationTransformationSchema;
2673
2672
  */
2674
2673
  export const videoassetVideoAssetSchema = z.object({
2675
2674
  type: z.enum(["video"]),
2676
- src: z.string(),
2675
+ src: z.string().min(1).regex(/\S/),
2677
2676
  transcode: z.optional(z.boolean()),
2678
2677
  trim: z.optional(z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number())),
2679
2678
  volume: z.optional(
@@ -2716,11 +2715,11 @@ export const assetSchema = assetAssetSchema;
2716
2715
  export const clipClipSchema = z.object({
2717
2716
  asset: assetAssetSchema,
2718
2717
  start: z.union([
2719
- z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number()),
2718
+ z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number().gte(0)),
2720
2719
  z.string().regex(/^(auto|alias:\/\/[A-Za-z0-9_-]+)$/),
2721
2720
  ]),
2722
2721
  length: z.union([
2723
- z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number()),
2722
+ z.preprocess(((v: unknown) => { if (v === '' || v === null || v === undefined) return undefined; if (Array.isArray(v)) return v; if (typeof v === 'string') return Number(v); return v; }), z.number().gte(0)),
2724
2723
  z.string().regex(/^(auto|end|alias:\/\/[A-Za-z0-9_-]+)$/),
2725
2724
  ]),
2726
2725
  fit: z.optional(z.enum(["cover", "contain", "crop", "none"])),
@@ -2788,7 +2787,7 @@ export const clipSchema = clipClipSchema;
2788
2787
  * A track contains an array of clips. Tracks are layered on top of each other in the order in the array. The top most track will render on top of those below it.
2789
2788
  */
2790
2789
  export const trackTrackSchema = z.object({
2791
- clips: z.array(clipClipSchema),
2790
+ clips: z.array(clipClipSchema).min(1),
2792
2791
  });
2793
2792
 
2794
2793
  export const trackSchema = trackTrackSchema;
@@ -2800,7 +2799,7 @@ export const timelineTimelineSchema = z.object({
2800
2799
  soundtrack: z.optional(soundtrackSoundtrackSchema),
2801
2800
  background: z.optional(z.string()),
2802
2801
  fonts: z.optional(z.array(fontFontSchema)),
2803
- tracks: z.array(trackTrackSchema),
2802
+ tracks: z.array(trackTrackSchema).min(1),
2804
2803
  cache: z.optional(z.boolean()),
2805
2804
  });
2806
2805
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",