magic-hour 0.18.0 → 0.20.0

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.
Files changed (89) hide show
  1. package/README.md +4 -0
  2. package/dist/client.d.ts +6 -3
  3. package/dist/client.js +8 -2
  4. package/dist/core/core-client.d.ts +10 -1
  5. package/dist/core/core-client.js +17 -7
  6. package/dist/core/index.d.ts +1 -1
  7. package/dist/core/query.d.ts +2 -1
  8. package/dist/core/query.js +1 -1
  9. package/dist/environment.d.ts +1 -1
  10. package/dist/environment.js +1 -1
  11. package/dist/resources/v1/ai-clothes-changer/resource-client.d.ts +2 -2
  12. package/dist/resources/v1/ai-clothes-changer/resource-client.js +2 -2
  13. package/dist/resources/v1/ai-face-editor/resource-client.d.ts +2 -2
  14. package/dist/resources/v1/ai-face-editor/resource-client.js +2 -2
  15. package/dist/resources/v1/ai-gif-generator/index.d.ts +2 -0
  16. package/dist/resources/v1/ai-gif-generator/index.js +5 -0
  17. package/dist/resources/v1/ai-gif-generator/request-types.d.ts +25 -0
  18. package/dist/resources/v1/ai-gif-generator/request-types.js +72 -0
  19. package/dist/resources/v1/ai-gif-generator/resource-client.d.ts +14 -0
  20. package/dist/resources/v1/ai-gif-generator/resource-client.js +30 -0
  21. package/dist/resources/v1/ai-headshot-generator/resource-client.d.ts +2 -2
  22. package/dist/resources/v1/ai-headshot-generator/resource-client.js +2 -2
  23. package/dist/resources/v1/ai-image-generator/resource-client.d.ts +2 -2
  24. package/dist/resources/v1/ai-image-generator/resource-client.js +2 -2
  25. package/dist/resources/v1/ai-image-upscaler/resource-client.d.ts +2 -2
  26. package/dist/resources/v1/ai-image-upscaler/resource-client.js +2 -2
  27. package/dist/resources/v1/ai-meme-generator/resource-client.d.ts +2 -2
  28. package/dist/resources/v1/ai-meme-generator/resource-client.js +2 -2
  29. package/dist/resources/v1/ai-photo-editor/resource-client.d.ts +2 -2
  30. package/dist/resources/v1/ai-photo-editor/resource-client.js +2 -2
  31. package/dist/resources/v1/ai-qr-code-generator/resource-client.d.ts +2 -2
  32. package/dist/resources/v1/ai-qr-code-generator/resource-client.js +2 -2
  33. package/dist/resources/v1/ai-talking-photo/resource-client.d.ts +2 -2
  34. package/dist/resources/v1/ai-talking-photo/resource-client.js +2 -2
  35. package/dist/resources/v1/animation/resource-client.d.ts +2 -2
  36. package/dist/resources/v1/animation/resource-client.js +2 -2
  37. package/dist/resources/v1/face-swap/resource-client.d.ts +2 -2
  38. package/dist/resources/v1/face-swap/resource-client.js +2 -2
  39. package/dist/resources/v1/face-swap-photo/resource-client.d.ts +2 -2
  40. package/dist/resources/v1/face-swap-photo/resource-client.js +2 -2
  41. package/dist/resources/v1/files/resource-client.d.ts +4 -3
  42. package/dist/resources/v1/files/resource-client.js +9 -4
  43. package/dist/resources/v1/files/upload-urls/resource-client.d.ts +2 -2
  44. package/dist/resources/v1/files/upload-urls/resource-client.js +2 -2
  45. package/dist/resources/v1/image-background-remover/resource-client.d.ts +2 -2
  46. package/dist/resources/v1/image-background-remover/resource-client.js +2 -2
  47. package/dist/resources/v1/image-projects/resource-client.d.ts +10 -10
  48. package/dist/resources/v1/image-projects/resource-client.js +18 -18
  49. package/dist/resources/v1/image-to-video/resource-client.d.ts +2 -2
  50. package/dist/resources/v1/image-to-video/resource-client.js +2 -2
  51. package/dist/resources/v1/index.d.ts +1 -0
  52. package/dist/resources/v1/index.js +2 -1
  53. package/dist/resources/v1/lip-sync/resource-client.d.ts +2 -2
  54. package/dist/resources/v1/lip-sync/resource-client.js +2 -2
  55. package/dist/resources/v1/photo-colorizer/resource-client.d.ts +2 -2
  56. package/dist/resources/v1/photo-colorizer/resource-client.js +2 -2
  57. package/dist/resources/v1/resource-client.d.ts +47 -23
  58. package/dist/resources/v1/resource-client.js +132 -44
  59. package/dist/resources/v1/text-to-video/resource-client.d.ts +2 -2
  60. package/dist/resources/v1/text-to-video/resource-client.js +2 -2
  61. package/dist/resources/v1/video-projects/resource-client.d.ts +10 -10
  62. package/dist/resources/v1/video-projects/resource-client.js +18 -18
  63. package/dist/resources/v1/video-to-video/request-types.d.ts +20 -6
  64. package/dist/resources/v1/video-to-video/request-types.js +4 -4
  65. package/dist/resources/v1/video-to-video/resource-client.d.ts +2 -2
  66. package/dist/resources/v1/video-to-video/resource-client.js +2 -2
  67. package/dist/types/index.d.ts +9 -0
  68. package/dist/types/v1-ai-gif-generator-create-body-style.d.ts +22 -0
  69. package/dist/types/v1-ai-gif-generator-create-body-style.js +67 -0
  70. package/dist/types/v1-ai-gif-generator-create-body.d.ts +25 -0
  71. package/dist/types/v1-ai-gif-generator-create-body.js +72 -0
  72. package/dist/types/v1-ai-gif-generator-create-response.d.ts +27 -0
  73. package/dist/types/v1-ai-gif-generator-create-response.js +71 -0
  74. package/dist/types/v1-ai-gif-generator-create-response400.d.ts +19 -0
  75. package/dist/types/v1-ai-gif-generator-create-response400.js +67 -0
  76. package/dist/types/v1-ai-gif-generator-create-response401-message-enum.d.ts +4 -0
  77. package/dist/types/v1-ai-gif-generator-create-response401-message-enum.js +2 -0
  78. package/dist/types/v1-ai-gif-generator-create-response401.d.ts +19 -0
  79. package/dist/types/v1-ai-gif-generator-create-response401.js +67 -0
  80. package/dist/types/v1-ai-gif-generator-create-response404-message-enum.d.ts +4 -0
  81. package/dist/types/v1-ai-gif-generator-create-response404-message-enum.js +2 -0
  82. package/dist/types/v1-ai-gif-generator-create-response404.d.ts +19 -0
  83. package/dist/types/v1-ai-gif-generator-create-response404.js +67 -0
  84. package/dist/types/v1-ai-gif-generator-create-response422.d.ts +19 -0
  85. package/dist/types/v1-ai-gif-generator-create-response422.js +67 -0
  86. package/dist/types/v1-image-projects-get-response.d.ts +1 -1
  87. package/dist/types/v1-video-to-video-create-body.d.ts +20 -6
  88. package/dist/types/v1-video-to-video-create-body.js +4 -4
  89. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Requested resource is not found
4
+ */
5
+ export type V1AiGifGeneratorCreateResponse404 = {
6
+ message: "Not Found";
7
+ };
8
+ /**
9
+ * @internal
10
+ * V1AiGifGeneratorCreateResponse404 without any key transformation, this is what
11
+ * we expect to come in as network data
12
+ */
13
+ export type External$V1AiGifGeneratorCreateResponse404 = {
14
+ message: "Not Found";
15
+ };
16
+ export declare const Schemas$V1AiGifGeneratorCreateResponse404: {
17
+ in: z.ZodType<V1AiGifGeneratorCreateResponse404, z.ZodTypeDef, unknown>;
18
+ out: z.ZodType<External$V1AiGifGeneratorCreateResponse404, z.ZodTypeDef, V1AiGifGeneratorCreateResponse404>;
19
+ };
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1AiGifGeneratorCreateResponse404 = void 0;
37
+ const core_1 = require("../core");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1AiGifGeneratorCreateResponse404
41
+ */
42
+ const SchemaIn$V1AiGifGeneratorCreateResponse404 = z
43
+ .object({
44
+ message: z.enum(["Not Found"]),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, core_1.zodTransform)(obj, {
48
+ message: "message",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiGifGeneratorCreateResponse404
54
+ */
55
+ const SchemaOut$V1AiGifGeneratorCreateResponse404 = z
56
+ .object({
57
+ message: z.enum(["Not Found"]),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, core_1.zodTransform)(obj, {
61
+ message: "message",
62
+ });
63
+ });
64
+ exports.Schemas$V1AiGifGeneratorCreateResponse404 = {
65
+ in: SchemaIn$V1AiGifGeneratorCreateResponse404,
66
+ out: SchemaOut$V1AiGifGeneratorCreateResponse404,
67
+ };
@@ -0,0 +1,19 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Unprocessable Entity
4
+ */
5
+ export type V1AiGifGeneratorCreateResponse422 = {
6
+ message: string;
7
+ };
8
+ /**
9
+ * @internal
10
+ * V1AiGifGeneratorCreateResponse422 without any key transformation, this is what
11
+ * we expect to come in as network data
12
+ */
13
+ export type External$V1AiGifGeneratorCreateResponse422 = {
14
+ message: string;
15
+ };
16
+ export declare const Schemas$V1AiGifGeneratorCreateResponse422: {
17
+ in: z.ZodType<V1AiGifGeneratorCreateResponse422, z.ZodTypeDef, unknown>;
18
+ out: z.ZodType<External$V1AiGifGeneratorCreateResponse422, z.ZodTypeDef, V1AiGifGeneratorCreateResponse422>;
19
+ };
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1AiGifGeneratorCreateResponse422 = void 0;
37
+ const core_1 = require("../core");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1AiGifGeneratorCreateResponse422
41
+ */
42
+ const SchemaIn$V1AiGifGeneratorCreateResponse422 = z
43
+ .object({
44
+ message: z.string(),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, core_1.zodTransform)(obj, {
48
+ message: "message",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiGifGeneratorCreateResponse422
54
+ */
55
+ const SchemaOut$V1AiGifGeneratorCreateResponse422 = z
56
+ .object({
57
+ message: z.string(),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, core_1.zodTransform)(obj, {
61
+ message: "message",
62
+ });
63
+ });
64
+ exports.Schemas$V1AiGifGeneratorCreateResponse422 = {
65
+ in: SchemaIn$V1AiGifGeneratorCreateResponse422,
66
+ out: SchemaOut$V1AiGifGeneratorCreateResponse422,
67
+ };
@@ -36,7 +36,7 @@ export type V1ImageProjectsGetResponse = {
36
36
  */
37
37
  totalFrameCost: number;
38
38
  /**
39
- * The type of the image project. Possible values are AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR, PHOTO_COLORIZER
39
+ * The type of the image project. Possible values are AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR, PHOTO_COLORIZER, AI_GIF
40
40
  */
41
41
  type: string;
42
42
  };
@@ -20,9 +20,16 @@ export type V1VideoToVideoCreateBody = {
20
20
  */
21
21
  fpsResolution?: ("FULL" | "HALF") | undefined;
22
22
  /**
23
- * The height of the final output video. Must be divisible by 64. The maximum height depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
23
+ * Used to determine the dimensions of the output video.
24
+ *
25
+ * * If height is provided, width will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
26
+ * * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
27
+ *
28
+ * Note: if the video's original resolution is less than the maximum, the video will not be resized.
29
+ *
30
+ * See our [pricing page](https://magichour.ai/pricing) for more details.
24
31
  */
25
- height: number;
32
+ height?: number | undefined;
26
33
  /**
27
34
  * The name of video
28
35
  */
@@ -33,9 +40,16 @@ export type V1VideoToVideoCreateBody = {
33
40
  startSeconds: number;
34
41
  style: V1VideoToVideoCreateBodyStyle;
35
42
  /**
36
- * The width of the final output video. Must be divisible by 64. The maximum width depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
43
+ * Used to determine the dimensions of the output video.
44
+ *
45
+ * * If width is provided, height will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
46
+ * * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
47
+ *
48
+ * Note: if the video's original resolution is less than the maximum, the video will not be resized.
49
+ *
50
+ * See our [pricing page](https://magichour.ai/pricing) for more details.
37
51
  */
38
- width: number;
52
+ width?: number | undefined;
39
53
  };
40
54
  /**
41
55
  * @internal
@@ -46,11 +60,11 @@ export type External$V1VideoToVideoCreateBody = {
46
60
  assets: External$V1VideoToVideoCreateBodyAssets;
47
61
  end_seconds: number;
48
62
  fps_resolution?: ("FULL" | "HALF") | undefined;
49
- height: number;
63
+ height?: number | undefined;
50
64
  name?: string | undefined;
51
65
  start_seconds: number;
52
66
  style: External$V1VideoToVideoCreateBodyStyle;
53
- width: number;
67
+ width?: number | undefined;
54
68
  };
55
69
  export declare const Schemas$V1VideoToVideoCreateBody: {
56
70
  in: z.ZodType<V1VideoToVideoCreateBody, z.ZodTypeDef, unknown>;
@@ -46,11 +46,11 @@ const SchemaIn$V1VideoToVideoCreateBody = z
46
46
  assets: v1_video_to_video_create_body_assets_1.Schemas$V1VideoToVideoCreateBodyAssets.in,
47
47
  end_seconds: z.number(),
48
48
  fps_resolution: z.enum(["FULL", "HALF"]).optional(),
49
- height: z.number().int(),
49
+ height: z.number().int().optional(),
50
50
  name: z.string().optional(),
51
51
  start_seconds: z.number(),
52
52
  style: v1_video_to_video_create_body_style_1.Schemas$V1VideoToVideoCreateBodyStyle.in,
53
- width: z.number().int(),
53
+ width: z.number().int().optional(),
54
54
  })
55
55
  .transform((obj) => {
56
56
  return (0, core_1.zodTransform)(obj, {
@@ -73,11 +73,11 @@ const SchemaOut$V1VideoToVideoCreateBody = z
73
73
  assets: v1_video_to_video_create_body_assets_1.Schemas$V1VideoToVideoCreateBodyAssets.out,
74
74
  endSeconds: z.number(),
75
75
  fpsResolution: z.enum(["FULL", "HALF"]).optional(),
76
- height: z.number().int(),
76
+ height: z.number().int().optional(),
77
77
  name: z.string().optional(),
78
78
  startSeconds: z.number(),
79
79
  style: v1_video_to_video_create_body_style_1.Schemas$V1VideoToVideoCreateBodyStyle.out,
80
- width: z.number().int(),
80
+ width: z.number().int().optional(),
81
81
  })
82
82
  .transform((obj) => {
83
83
  return (0, core_1.zodTransform)(obj, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-hour",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {