@shotstack/schemas 1.13.0 → 1.13.1

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.
@@ -3545,7 +3545,7 @@
3545
3545
  ]
3546
3546
  },
3547
3547
  "Output": {
3548
- "description": "The output format, render range and type of media to generate.",
3548
+ "description": "The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.",
3549
3549
  "properties": {
3550
3550
  "format": {
3551
3551
  "description": "The output format and type of media file to generate. <ul>\n <li>`mp4` - mp4 video file</li>\n <li>`gif` - animated gif</li>\n <li>`jpg` - jpg image file</li>\n <li>`png` - png image file</li>\n <li>`bmp` - bmp image file</li>\n <li>`mp3` - mp3 audio file (audio only)</li>\n</ul>",
@@ -3561,7 +3561,7 @@
3561
3561
  "example": "mp4"
3562
3562
  },
3563
3563
  "resolution": {
3564
- "description": "The preset output resolution of the video or image. For custom sizes use the `size` property. <ul>\n <li>`preview` - 512px x 288px @ 15fps</li>\n <li>`mobile` - 640px x 360px @ 25fps</li>\n <li>`sd` - 1024px x 576px @ 25fps</li>\n <li>`hd` - 1280px x 720px @ 25fps</li>\n <li>`1080` - 1920px x 1080px @ 25fps</li>\n <li>`4k` - 3840px x 2160px @ 25fps</li>\n</ul>",
3564
+ "description": "The preset output resolution of the video or image. For custom sizes use the `size` property. Either `resolution` or `size` (with both `width` and `height`) must be specified for all formats except `mp3`. <ul>\n <li>`preview` - 512px x 288px @ 15fps</li>\n <li>`mobile` - 640px x 360px @ 25fps</li>\n <li>`sd` - 1024px x 576px @ 25fps</li>\n <li>`hd` - 1280px x 720px @ 25fps</li>\n <li>`1080` - 1920px x 1080px @ 25fps</li>\n <li>`4k` - 3840px x 2160px @ 25fps</li>\n</ul>",
3565
3565
  "enum": [
3566
3566
  "preview",
3567
3567
  "mobile",
@@ -3509,7 +3509,7 @@
3509
3509
  ]
3510
3510
  },
3511
3511
  "Output": {
3512
- "description": "The output format, render range and type of media to generate.",
3512
+ "description": "The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.",
3513
3513
  "properties": {
3514
3514
  "format": {
3515
3515
  "description": "The output format and type of media file to generate. <ul>\n <li>`mp4` - mp4 video file</li>\n <li>`gif` - animated gif</li>\n <li>`jpg` - jpg image file</li>\n <li>`png` - png image file</li>\n <li>`bmp` - bmp image file</li>\n <li>`mp3` - mp3 audio file (audio only)</li>\n</ul>",
@@ -3527,7 +3527,7 @@
3527
3527
  "anyOf": [
3528
3528
  {
3529
3529
  "type": "string",
3530
- "description": "The preset output resolution of the video or image. For custom sizes use the `size` property. <ul>\n <li>`preview` - 512px x 288px @ 15fps</li>\n <li>`mobile` - 640px x 360px @ 25fps</li>\n <li>`sd` - 1024px x 576px @ 25fps</li>\n <li>`hd` - 1280px x 720px @ 25fps</li>\n <li>`1080` - 1920px x 1080px @ 25fps</li>\n <li>`4k` - 3840px x 2160px @ 25fps</li>\n</ul>",
3530
+ "description": "The preset output resolution of the video or image. For custom sizes use the `size` property. Either `resolution` or `size` (with both `width` and `height`) must be specified for all formats except `mp3`. <ul>\n <li>`preview` - 512px x 288px @ 15fps</li>\n <li>`mobile` - 640px x 360px @ 25fps</li>\n <li>`sd` - 1024px x 576px @ 25fps</li>\n <li>`hd` - 1280px x 720px @ 25fps</li>\n <li>`1080` - 1920px x 1080px @ 25fps</li>\n <li>`4k` - 3840px x 2160px @ 25fps</li>\n</ul>",
3531
3531
  "enum": [
3532
3532
  "preview",
3533
3533
  "mobile",
package/dist/schema.d.ts CHANGED
@@ -2119,7 +2119,7 @@ export interface components {
2119
2119
  */
2120
2120
  replace: unknown;
2121
2121
  };
2122
- /** @description The output format, render range and type of media to generate. */
2122
+ /** @description The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified. */
2123
2123
  Output: {
2124
2124
  /**
2125
2125
  * @description The output format and type of media file to generate. <ul>
@@ -2135,7 +2135,7 @@ export interface components {
2135
2135
  */
2136
2136
  format: "mp4" | "gif" | "mp3" | "jpg" | "png" | "bmp";
2137
2137
  /**
2138
- * @description The preset output resolution of the video or image. For custom sizes use the `size` property. <ul>
2138
+ * @description The preset output resolution of the video or image. For custom sizes use the `size` property. Either `resolution` or `size` (with both `width` and `height`) must be specified for all formats except `mp3`. <ul>
2139
2139
  * <li>`preview` - 512px x 288px @ 15fps</li>
2140
2140
  * <li>`mobile` - 640px x 360px @ 25fps</li>
2141
2141
  * <li>`sd` - 1024px x 576px @ 25fps</li>
@@ -1897,7 +1897,7 @@ exports.thumbnailThumbnailSchema = zod_1.z.object({
1897
1897
  }).strict();
1898
1898
  exports.thumbnailSchema = exports.thumbnailThumbnailSchema;
1899
1899
  /**
1900
- * The output format, render range and type of media to generate.
1900
+ * The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.
1901
1901
  */
1902
1902
  exports.outputOutputSchema = zod_1.z.object({
1903
1903
  format: zod_1.z.enum([
@@ -1958,7 +1958,18 @@ exports.outputOutputSchema = zod_1.z.object({
1958
1958
  poster: zod_1.z.optional(exports.posterPosterSchema),
1959
1959
  thumbnail: zod_1.z.optional(exports.thumbnailThumbnailSchema),
1960
1960
  destinations: zod_1.z.optional(zod_1.z.array(exports.destinationsDestinationsSchema))
1961
- }).strict();
1961
+ }).strict().superRefine((val, ctx) => {
1962
+ var isMp3 = val.format === "mp3";
1963
+ if (!isMp3 && val.size != null && (val.size.width == null || val.size.height == null)) {
1964
+ ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["size"], message: "size requires both width and height" });
1965
+ return;
1966
+ }
1967
+ var hasResolution = typeof val.resolution === "string";
1968
+ var hasSize = val.size != null && val.size.width != null && val.size.height != null;
1969
+ if (!isMp3 && !hasResolution && !hasSize) {
1970
+ ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, message: 'output requires either "resolution" or "size" (with width and height)' });
1971
+ }
1972
+ });
1962
1973
  exports.outputSchema = exports.outputOutputSchema;
1963
1974
  /**
1964
1975
  * In and out transitions for a clip - i.e. fade in and fade out
@@ -4973,7 +4973,7 @@ export declare const thumbnailSchema: z.ZodObject<{
4973
4973
  scale: z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>;
4974
4974
  }, z.core.$strict>;
4975
4975
  /**
4976
- * The output format, render range and type of media to generate.
4976
+ * The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.
4977
4977
  */
4978
4978
  export declare const outputOutputSchema: z.ZodObject<{
4979
4979
  format: z.ZodEnum<{
@@ -1889,7 +1889,7 @@ export const thumbnailThumbnailSchema = z.object({
1889
1889
  }).strict();
1890
1890
  export const thumbnailSchema = thumbnailThumbnailSchema;
1891
1891
  /**
1892
- * The output format, render range and type of media to generate.
1892
+ * The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.
1893
1893
  */
1894
1894
  export const outputOutputSchema = z.object({
1895
1895
  format: z.enum([
@@ -1950,7 +1950,18 @@ export const outputOutputSchema = z.object({
1950
1950
  poster: z.optional(posterPosterSchema),
1951
1951
  thumbnail: z.optional(thumbnailThumbnailSchema),
1952
1952
  destinations: z.optional(z.array(destinationsDestinationsSchema))
1953
- }).strict();
1953
+ }).strict().superRefine((val, ctx) => {
1954
+ var isMp3 = val.format === "mp3";
1955
+ if (!isMp3 && val.size != null && (val.size.width == null || val.size.height == null)) {
1956
+ ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["size"], message: "size requires both width and height" });
1957
+ return;
1958
+ }
1959
+ var hasResolution = typeof val.resolution === "string";
1960
+ var hasSize = val.size != null && val.size.width != null && val.size.height != null;
1961
+ if (!isMp3 && !hasResolution && !hasSize) {
1962
+ ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'output requires either "resolution" or "size" (with width and height)' });
1963
+ }
1964
+ });
1954
1965
  export const outputSchema = outputOutputSchema;
1955
1966
  /**
1956
1967
  * In and out transitions for a clip - i.e. fade in and fade out
@@ -1511,7 +1511,7 @@ export const thumbnailThumbnailSchema = z.object({
1511
1511
  export const thumbnailSchema = thumbnailThumbnailSchema;
1512
1512
 
1513
1513
  /**
1514
- * The output format, render range and type of media to generate.
1514
+ * The output format, render range and type of media to generate. For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified.
1515
1515
  */
1516
1516
  export const outputOutputSchema = z.object({
1517
1517
  format: z.enum([
@@ -1572,7 +1572,18 @@ export const outputOutputSchema = z.object({
1572
1572
  poster: z.optional(posterPosterSchema),
1573
1573
  thumbnail: z.optional(thumbnailThumbnailSchema),
1574
1574
  destinations: z.optional(z.array(destinationsDestinationsSchema))
1575
- }).strict();
1575
+ }).strict().superRefine((val, ctx) => {
1576
+ var isMp3 = val.format === "mp3";
1577
+ if (!isMp3 && val.size != null && (val.size.width == null || val.size.height == null)) {
1578
+ ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["size"], message: "size requires both width and height" });
1579
+ return;
1580
+ }
1581
+ var hasResolution = typeof val.resolution === "string";
1582
+ var hasSize = val.size != null && val.size.width != null && val.size.height != null;
1583
+ if (!isMp3 && !hasResolution && !hasSize) {
1584
+ ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'output requires either "resolution" or "size" (with width and height)' });
1585
+ }
1586
+ });
1576
1587
 
1577
1588
  export const outputSchema = outputOutputSchema;
1578
1589
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/schemas",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Centralized OpenAPI schemas and TypeScript types for Shotstack API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",