@shotstack/schemas 1.3.3 → 1.3.4

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.
@@ -66,8 +66,8 @@ export const captionassetCaptionAssetSchema = z.object({
66
66
  font: z.optional(captionpropertiesCaptionFontSchema),
67
67
  background: z.optional(captionpropertiesCaptionBackgroundSchema),
68
68
  margin: z.optional(captionpropertiesCaptionMarginSchema),
69
- trim: z.optional(z.number()),
70
- speed: z.optional(z.number().gte(0).lte(10)),
69
+ trim: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
70
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
71
71
  });
72
72
  export const captionAssetSchema = captionassetCaptionAssetSchema;
73
73
  /**
@@ -864,7 +864,7 @@ export const imagetovideoassetImageToVideoAssetSchema = z.object({
864
864
  src: z.optional(z.string()),
865
865
  prompt: z.optional(z.string()),
866
866
  aspectRatio: z.optional(z.enum(["1:1", "4:3", "16:9", "9:16", "3:4", "21:9", "9:21"])),
867
- speed: z.optional(z.number().gte(0).lte(10)),
867
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
868
868
  crop: z.optional(cropCropSchema),
869
869
  });
870
870
  export const imageToVideoAssetSchema = imagetovideoassetImageToVideoAssetSchema;
@@ -972,7 +972,7 @@ export const uploadResponseSchema = uploadresponseUploadResponseSchema;
972
972
  * Set the playback speed of a video or audio file. Allows you to preserve the pitch of the audio so that it is sped up without sounding too high pitched or too low.
973
973
  */
974
974
  export const speedSpeedSchema = z.object({
975
- speed: z.optional(z.number().gte(0).lte(10)),
975
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
976
976
  preservePitch: z.optional(z.boolean()),
977
977
  });
978
978
  export const speedSchema = speedSpeedSchema;
@@ -989,7 +989,7 @@ export const transcriptionSchema = transcriptionTranscriptionSchema;
989
989
  export const lumaassetLumaAssetSchema = z.object({
990
990
  type: z.enum(["luma"]),
991
991
  src: z.string(),
992
- trim: z.optional(z.number()),
992
+ trim: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
993
993
  });
994
994
  export const lumaAssetSchema = lumaassetLumaAssetSchema;
995
995
  /**
@@ -1778,9 +1778,9 @@ export const tweenSchema = tweenTweenSchema;
1778
1778
  export const audioassetAudioAssetSchema = z.object({
1779
1779
  type: z.enum(["audio"]),
1780
1780
  src: z.string(),
1781
- trim: z.optional(z.number()),
1781
+ trim: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
1782
1782
  volume: z.optional(z.union([z.number().gte(0).lte(1), z.array(tweenTweenSchema)])),
1783
- speed: z.optional(z.number().gte(0).lte(10)),
1783
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
1784
1784
  effect: z.optional(z.enum(["none", "fadeIn", "fadeOut", "fadeInFadeOut"])),
1785
1785
  });
1786
1786
  export const audioAssetSchema = audioassetAudioAssetSchema;
@@ -1871,10 +1871,10 @@ export const videoassetVideoAssetSchema = z.object({
1871
1871
  type: z.enum(["video"]),
1872
1872
  src: z.string(),
1873
1873
  transcode: z.optional(z.boolean()).default(false),
1874
- trim: z.optional(z.number()),
1874
+ trim: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
1875
1875
  volume: z.optional(z.union([z.number().gte(0).lte(1), z.array(tweenTweenSchema)])),
1876
1876
  volumeEffect: z.optional(z.enum(["none", "fadeIn", "fadeOut", "fadeInFadeOut"])),
1877
- speed: z.optional(z.number().gte(0).lte(10)),
1877
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
1878
1878
  crop: z.optional(cropCropSchema),
1879
1879
  chromaKey: z.optional(chromakeyChromaKeySchema),
1880
1880
  });
@@ -1902,10 +1902,10 @@ export const assetSchema = assetAssetSchema;
1902
1902
  */
1903
1903
  export const clipClipSchema = z.object({
1904
1904
  asset: assetAssetSchema,
1905
- start: z.union([z.number(), z.enum(["auto"])]),
1906
- length: z.union([z.number(), z.literal("auto"), z.literal("end")]),
1905
+ start: z.union([z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number()), z.enum(["auto"])]),
1906
+ length: z.union([z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number()), z.literal("auto"), z.literal("end")]),
1907
1907
  fit: z.optional(z.enum(["cover", "contain", "crop", "none"])),
1908
- scale: z.optional(z.number()),
1908
+ scale: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
1909
1909
  width: z.optional(z.int().gte(1).lte(3840)),
1910
1910
  height: z.optional(z.int().gte(1).lte(2160)),
1911
1911
  position: z.optional(z.enum([
@@ -90,8 +90,8 @@ export const captionassetCaptionAssetSchema = z.object({
90
90
  font: z.optional(captionpropertiesCaptionFontSchema),
91
91
  background: z.optional(captionpropertiesCaptionBackgroundSchema),
92
92
  margin: z.optional(captionpropertiesCaptionMarginSchema),
93
- trim: z.optional(z.number()),
94
- speed: z.optional(z.number().gte(0).lte(10)),
93
+ trim: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
94
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
95
95
  });
96
96
 
97
97
  export const captionAssetSchema = captionassetCaptionAssetSchema;
@@ -1081,7 +1081,7 @@ export const imagetovideoassetImageToVideoAssetSchema = z.object({
1081
1081
  aspectRatio: z.optional(
1082
1082
  z.enum(["1:1", "4:3", "16:9", "9:16", "3:4", "21:9", "9:21"])
1083
1083
  ),
1084
- speed: z.optional(z.number().gte(0).lte(10)),
1084
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
1085
1085
  crop: z.optional(cropCropSchema),
1086
1086
  });
1087
1087
 
@@ -1220,7 +1220,7 @@ export const uploadResponseSchema = uploadresponseUploadResponseSchema;
1220
1220
  * Set the playback speed of a video or audio file. Allows you to preserve the pitch of the audio so that it is sped up without sounding too high pitched or too low.
1221
1221
  */
1222
1222
  export const speedSpeedSchema = z.object({
1223
- speed: z.optional(z.number().gte(0).lte(10)),
1223
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
1224
1224
  preservePitch: z.optional(z.boolean()),
1225
1225
  });
1226
1226
 
@@ -1241,7 +1241,7 @@ export const transcriptionSchema = transcriptionTranscriptionSchema;
1241
1241
  export const lumaassetLumaAssetSchema = z.object({
1242
1242
  type: z.enum(["luma"]),
1243
1243
  src: z.string(),
1244
- trim: z.optional(z.number()),
1244
+ trim: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
1245
1245
  });
1246
1246
 
1247
1247
  export const lumaAssetSchema = lumaassetLumaAssetSchema;
@@ -2192,11 +2192,11 @@ export const tweenSchema = tweenTweenSchema;
2192
2192
  export const audioassetAudioAssetSchema = z.object({
2193
2193
  type: z.enum(["audio"]),
2194
2194
  src: z.string(),
2195
- trim: z.optional(z.number()),
2195
+ trim: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
2196
2196
  volume: z.optional(
2197
2197
  z.union([z.number().gte(0).lte(1), z.array(tweenTweenSchema)])
2198
2198
  ),
2199
- speed: z.optional(z.number().gte(0).lte(10)),
2199
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
2200
2200
  effect: z.optional(z.enum(["none", "fadeIn", "fadeOut", "fadeInFadeOut"])),
2201
2201
  });
2202
2202
 
@@ -2317,14 +2317,14 @@ export const videoassetVideoAssetSchema = z.object({
2317
2317
  type: z.enum(["video"]),
2318
2318
  src: z.string(),
2319
2319
  transcode: z.optional(z.boolean()).default(false),
2320
- trim: z.optional(z.number()),
2320
+ trim: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
2321
2321
  volume: z.optional(
2322
2322
  z.union([z.number().gte(0).lte(1), z.array(tweenTweenSchema)])
2323
2323
  ),
2324
2324
  volumeEffect: z.optional(
2325
2325
  z.enum(["none", "fadeIn", "fadeOut", "fadeInFadeOut"])
2326
2326
  ),
2327
- speed: z.optional(z.number().gte(0).lte(10)),
2327
+ speed: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number().gte(0).lte(10))),
2328
2328
  crop: z.optional(cropCropSchema),
2329
2329
  chromaKey: z.optional(chromakeyChromaKeySchema),
2330
2330
  });
@@ -2356,10 +2356,10 @@ export const assetSchema = assetAssetSchema;
2356
2356
  */
2357
2357
  export const clipClipSchema = z.object({
2358
2358
  asset: assetAssetSchema,
2359
- start: z.union([z.number(), z.enum(["auto"])]),
2360
- length: z.union([z.number(), z.literal("auto"), z.literal("end")]),
2359
+ start: z.union([z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number()), z.enum(["auto"])]),
2360
+ length: z.union([z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number()), z.literal("auto"), z.literal("end")]),
2361
2361
  fit: z.optional(z.enum(["cover", "contain", "crop", "none"])),
2362
- scale: z.optional(z.number()),
2362
+ scale: z.optional(z.preprocess((val) => typeof val === 'string' && val !== '' && !isNaN(Number(val)) ? Number(val) : val, z.number())),
2363
2363
  width: z.optional(z.int().gte(1).lte(3840)),
2364
2364
  height: z.optional(z.int().gte(1).lte(2160)),
2365
2365
  position: z.optional(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",