magic-hour 0.24.0 → 0.26.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 (60) hide show
  1. package/README.md +4 -0
  2. package/dist/core/auth.d.ts +11 -26
  3. package/dist/core/auth.js +48 -62
  4. package/dist/core/index.d.ts +1 -1
  5. package/dist/core/index.js +2 -4
  6. package/dist/environment.d.ts +1 -1
  7. package/dist/environment.js +1 -1
  8. package/dist/resources/v1/ai-gif-generator/resource-client.d.ts +1 -1
  9. package/dist/resources/v1/ai-gif-generator/resource-client.js +1 -1
  10. package/dist/resources/v1/ai-image-editor/index.d.ts +2 -0
  11. package/dist/resources/v1/ai-image-editor/index.js +5 -0
  12. package/dist/resources/v1/ai-image-editor/request-types.d.ts +31 -0
  13. package/dist/resources/v1/ai-image-editor/request-types.js +77 -0
  14. package/dist/resources/v1/ai-image-editor/resource-client.d.ts +14 -0
  15. package/dist/resources/v1/ai-image-editor/resource-client.js +30 -0
  16. package/dist/resources/v1/files/upload-urls/resource-client.d.ts +3 -4
  17. package/dist/resources/v1/files/upload-urls/resource-client.js +3 -4
  18. package/dist/resources/v1/image-to-video/request-types.d.ts +10 -0
  19. package/dist/resources/v1/image-to-video/request-types.js +4 -0
  20. package/dist/resources/v1/index.d.ts +1 -0
  21. package/dist/resources/v1/index.js +2 -1
  22. package/dist/resources/v1/resource-client.d.ts +3 -0
  23. package/dist/resources/v1/resource-client.js +6 -0
  24. package/dist/resources/v1/text-to-video/request-types.d.ts +10 -0
  25. package/dist/resources/v1/text-to-video/request-types.js +4 -0
  26. package/dist/types/index.d.ts +12 -0
  27. package/dist/types/v1-ai-image-editor-create-body-assets.d.ts +22 -0
  28. package/dist/types/v1-ai-image-editor-create-body-assets.js +67 -0
  29. package/dist/types/v1-ai-image-editor-create-body-style.d.ts +22 -0
  30. package/dist/types/v1-ai-image-editor-create-body-style.js +67 -0
  31. package/dist/types/v1-ai-image-editor-create-body.d.ts +31 -0
  32. package/dist/types/v1-ai-image-editor-create-body.js +77 -0
  33. package/dist/types/v1-ai-image-editor-create-response.d.ts +34 -0
  34. package/dist/types/v1-ai-image-editor-create-response.js +75 -0
  35. package/dist/types/v1-ai-image-editor-create-response400.d.ts +19 -0
  36. package/dist/types/v1-ai-image-editor-create-response400.js +67 -0
  37. package/dist/types/v1-ai-image-editor-create-response401-message-enum.d.ts +4 -0
  38. package/dist/types/v1-ai-image-editor-create-response401-message-enum.js +2 -0
  39. package/dist/types/v1-ai-image-editor-create-response401.d.ts +19 -0
  40. package/dist/types/v1-ai-image-editor-create-response401.js +67 -0
  41. package/dist/types/v1-ai-image-editor-create-response404-message-enum.d.ts +4 -0
  42. package/dist/types/v1-ai-image-editor-create-response404-message-enum.js +2 -0
  43. package/dist/types/v1-ai-image-editor-create-response404.d.ts +19 -0
  44. package/dist/types/v1-ai-image-editor-create-response404.js +67 -0
  45. package/dist/types/v1-ai-image-editor-create-response422.d.ts +19 -0
  46. package/dist/types/v1-ai-image-editor-create-response422.js +67 -0
  47. package/dist/types/v1-image-projects-get-response.d.ts +1 -1
  48. package/dist/types/v1-image-to-video-create-body-resolution-enum.d.ts +9 -0
  49. package/dist/types/v1-image-to-video-create-body-resolution-enum.js +2 -0
  50. package/dist/types/v1-image-to-video-create-body-style-quality-mode-enum.d.ts +5 -2
  51. package/dist/types/v1-image-to-video-create-body-style.d.ts +10 -3
  52. package/dist/types/v1-image-to-video-create-body.d.ts +10 -0
  53. package/dist/types/v1-image-to-video-create-body.js +4 -0
  54. package/dist/types/v1-text-to-video-create-body-resolution-enum.d.ts +9 -0
  55. package/dist/types/v1-text-to-video-create-body-resolution-enum.js +2 -0
  56. package/dist/types/v1-text-to-video-create-body-style-quality-mode-enum.d.ts +5 -2
  57. package/dist/types/v1-text-to-video-create-body-style.d.ts +5 -2
  58. package/dist/types/v1-text-to-video-create-body.d.ts +10 -0
  59. package/dist/types/v1-text-to-video-create-body.js +4 -0
  60. package/package.json +1 -1
@@ -12,6 +12,7 @@ class V1Client extends core_1.CoreResourceClient {
12
12
  this.aiFaceEditor;
13
13
  this.aiGifGenerator;
14
14
  this.aiHeadshotGenerator;
15
+ this.aiImageEditor;
15
16
  this.aiImageGenerator;
16
17
  this.aiImageUpscaler;
17
18
  this.aiMemeGenerator;
@@ -60,6 +61,11 @@ class V1Client extends core_1.CoreResourceClient {
60
61
  return ((_a = this._aiHeadshotGeneratorLazy) !== null && _a !== void 0 ? _a : (this._aiHeadshotGeneratorLazy =
61
62
  new (require("./ai-headshot-generator").AiHeadshotGeneratorClient)(this._client, this._opts)));
62
63
  }
64
+ get aiImageEditor() {
65
+ var _a;
66
+ return ((_a = this._aiImageEditorLazy) !== null && _a !== void 0 ? _a : (this._aiImageEditorLazy =
67
+ new (require("./ai-image-editor").AiImageEditorClient)(this._client, this._opts)));
68
+ }
63
69
  get aiImageGenerator() {
64
70
  var _a;
65
71
  return ((_a = this._aiImageGeneratorLazy) !== null && _a !== void 0 ? _a : (this._aiImageGeneratorLazy =
@@ -16,6 +16,15 @@ export type CreateRequest = {
16
16
  * Determines the orientation of the output video
17
17
  */
18
18
  orientation: "landscape" | "portrait" | "square";
19
+ /**
20
+ * Controls the output video resolution. Defaults to `720p` if not specified.
21
+ *
22
+ * **Options:**
23
+ * - `480p` - Supports only 5 or 10 second videos. Output: 24fps. Cost: 120 credits per 5 seconds.
24
+ * - `720p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 300 credits per 5 seconds.
25
+ * - `1080p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 600 credits per 5 seconds. **Requires** `pro` or `business` tier.
26
+ */
27
+ resolution?: ("1080p" | "480p" | "720p") | undefined;
19
28
  style: V1TextToVideoCreateBodyStyle;
20
29
  };
21
30
  /**
@@ -27,6 +36,7 @@ export type External$CreateRequest = {
27
36
  end_seconds: number;
28
37
  name?: string | undefined;
29
38
  orientation: "landscape" | "portrait" | "square";
39
+ resolution?: ("1080p" | "480p" | "720p") | undefined;
30
40
  style: External$V1TextToVideoCreateBodyStyle;
31
41
  };
32
42
  export declare const Schemas$CreateRequest: {
@@ -45,6 +45,7 @@ const SchemaIn$CreateRequest = z
45
45
  end_seconds: z.number(),
46
46
  name: z.string().optional(),
47
47
  orientation: z.enum(["landscape", "portrait", "square"]),
48
+ resolution: z.enum(["1080p", "480p", "720p"]).optional(),
48
49
  style: v1_text_to_video_create_body_style_1.Schemas$V1TextToVideoCreateBodyStyle.in,
49
50
  })
50
51
  .transform((obj) => {
@@ -52,6 +53,7 @@ const SchemaIn$CreateRequest = z
52
53
  end_seconds: "endSeconds",
53
54
  name: "name",
54
55
  orientation: "orientation",
56
+ resolution: "resolution",
55
57
  style: "style",
56
58
  });
57
59
  });
@@ -64,6 +66,7 @@ const SchemaOut$CreateRequest = z
64
66
  endSeconds: z.number(),
65
67
  name: z.string().optional(),
66
68
  orientation: z.enum(["landscape", "portrait", "square"]),
69
+ resolution: z.enum(["1080p", "480p", "720p"]).optional(),
67
70
  style: v1_text_to_video_create_body_style_1.Schemas$V1TextToVideoCreateBodyStyle.out,
68
71
  })
69
72
  .transform((obj) => {
@@ -71,6 +74,7 @@ const SchemaOut$CreateRequest = z
71
74
  endSeconds: "end_seconds",
72
75
  name: "name",
73
76
  orientation: "orientation",
77
+ resolution: "resolution",
74
78
  style: "style",
75
79
  });
76
80
  });
@@ -37,6 +37,16 @@ export { V1AiHeadshotGeneratorCreateResponse401MessageEnum } from "./v1-ai-heads
37
37
  export { V1AiHeadshotGeneratorCreateResponse404 } from "./v1-ai-headshot-generator-create-response404";
38
38
  export { V1AiHeadshotGeneratorCreateResponse404MessageEnum } from "./v1-ai-headshot-generator-create-response404-message-enum";
39
39
  export { V1AiHeadshotGeneratorCreateResponse422 } from "./v1-ai-headshot-generator-create-response422";
40
+ export { V1AiImageEditorCreateBody } from "./v1-ai-image-editor-create-body";
41
+ export { V1AiImageEditorCreateBodyAssets } from "./v1-ai-image-editor-create-body-assets";
42
+ export { V1AiImageEditorCreateBodyStyle } from "./v1-ai-image-editor-create-body-style";
43
+ export { V1AiImageEditorCreateResponse } from "./v1-ai-image-editor-create-response";
44
+ export { V1AiImageEditorCreateResponse400 } from "./v1-ai-image-editor-create-response400";
45
+ export { V1AiImageEditorCreateResponse401 } from "./v1-ai-image-editor-create-response401";
46
+ export { V1AiImageEditorCreateResponse401MessageEnum } from "./v1-ai-image-editor-create-response401-message-enum";
47
+ export { V1AiImageEditorCreateResponse404 } from "./v1-ai-image-editor-create-response404";
48
+ export { V1AiImageEditorCreateResponse404MessageEnum } from "./v1-ai-image-editor-create-response404-message-enum";
49
+ export { V1AiImageEditorCreateResponse422 } from "./v1-ai-image-editor-create-response422";
40
50
  export { V1AiImageGeneratorCreateBody } from "./v1-ai-image-generator-create-body";
41
51
  export { V1AiImageGeneratorCreateBodyOrientationEnum } from "./v1-ai-image-generator-create-body-orientation-enum";
42
52
  export { V1AiImageGeneratorCreateBodyStyle } from "./v1-ai-image-generator-create-body-style";
@@ -168,6 +178,7 @@ export { V1ImageProjectsGetResponse404 } from "./v1-image-projects-get-response4
168
178
  export { V1ImageProjectsGetResponse404MessageEnum } from "./v1-image-projects-get-response404-message-enum";
169
179
  export { V1ImageToVideoCreateBody } from "./v1-image-to-video-create-body";
170
180
  export { V1ImageToVideoCreateBodyAssets } from "./v1-image-to-video-create-body-assets";
181
+ export { V1ImageToVideoCreateBodyResolutionEnum } from "./v1-image-to-video-create-body-resolution-enum";
171
182
  export { V1ImageToVideoCreateBodyStyle } from "./v1-image-to-video-create-body-style";
172
183
  export { V1ImageToVideoCreateBodyStyleQualityModeEnum } from "./v1-image-to-video-create-body-style-quality-mode-enum";
173
184
  export { V1ImageToVideoCreateResponse } from "./v1-image-to-video-create-response";
@@ -198,6 +209,7 @@ export { V1PhotoColorizerCreateResponse404MessageEnum } from "./v1-photo-coloriz
198
209
  export { V1PhotoColorizerCreateResponse422 } from "./v1-photo-colorizer-create-response422";
199
210
  export { V1TextToVideoCreateBody } from "./v1-text-to-video-create-body";
200
211
  export { V1TextToVideoCreateBodyOrientationEnum } from "./v1-text-to-video-create-body-orientation-enum";
212
+ export { V1TextToVideoCreateBodyResolutionEnum } from "./v1-text-to-video-create-body-resolution-enum";
201
213
  export { V1TextToVideoCreateBodyStyle } from "./v1-text-to-video-create-body-style";
202
214
  export { V1TextToVideoCreateBodyStyleQualityModeEnum } from "./v1-text-to-video-create-body-style-quality-mode-enum";
203
215
  export { V1TextToVideoCreateResponse } from "./v1-text-to-video-create-response";
@@ -0,0 +1,22 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Provide the assets for image edit
4
+ */
5
+ export type V1AiImageEditorCreateBodyAssets = {
6
+ /**
7
+ * The image used in the edit. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
8
+ */
9
+ imageFilePath: string;
10
+ };
11
+ /**
12
+ * @internal
13
+ * V1AiImageEditorCreateBodyAssets without any key transformation, this is what
14
+ * we expect to come in as network data
15
+ */
16
+ export type External$V1AiImageEditorCreateBodyAssets = {
17
+ image_file_path: string;
18
+ };
19
+ export declare const Schemas$V1AiImageEditorCreateBodyAssets: {
20
+ in: z.ZodType<V1AiImageEditorCreateBodyAssets, z.ZodTypeDef, unknown>;
21
+ out: z.ZodType<External$V1AiImageEditorCreateBodyAssets, z.ZodTypeDef, V1AiImageEditorCreateBodyAssets>;
22
+ };
@@ -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$V1AiImageEditorCreateBodyAssets = 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 V1AiImageEditorCreateBodyAssets
41
+ */
42
+ const SchemaIn$V1AiImageEditorCreateBodyAssets = z
43
+ .object({
44
+ image_file_path: z.string(),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, core_1.zodTransform)(obj, {
48
+ image_file_path: "imageFilePath",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiImageEditorCreateBodyAssets
54
+ */
55
+ const SchemaOut$V1AiImageEditorCreateBodyAssets = z
56
+ .object({
57
+ imageFilePath: z.string(),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, core_1.zodTransform)(obj, {
61
+ imageFilePath: "image_file_path",
62
+ });
63
+ });
64
+ exports.Schemas$V1AiImageEditorCreateBodyAssets = {
65
+ in: SchemaIn$V1AiImageEditorCreateBodyAssets,
66
+ out: SchemaOut$V1AiImageEditorCreateBodyAssets,
67
+ };
@@ -0,0 +1,22 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * V1AiImageEditorCreateBodyStyle
4
+ */
5
+ export type V1AiImageEditorCreateBodyStyle = {
6
+ /**
7
+ * The prompt used to edit the image.
8
+ */
9
+ prompt: string;
10
+ };
11
+ /**
12
+ * @internal
13
+ * V1AiImageEditorCreateBodyStyle without any key transformation, this is what
14
+ * we expect to come in as network data
15
+ */
16
+ export type External$V1AiImageEditorCreateBodyStyle = {
17
+ prompt: string;
18
+ };
19
+ export declare const Schemas$V1AiImageEditorCreateBodyStyle: {
20
+ in: z.ZodType<V1AiImageEditorCreateBodyStyle, z.ZodTypeDef, unknown>;
21
+ out: z.ZodType<External$V1AiImageEditorCreateBodyStyle, z.ZodTypeDef, V1AiImageEditorCreateBodyStyle>;
22
+ };
@@ -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$V1AiImageEditorCreateBodyStyle = 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 V1AiImageEditorCreateBodyStyle
41
+ */
42
+ const SchemaIn$V1AiImageEditorCreateBodyStyle = z
43
+ .object({
44
+ prompt: z.string(),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, core_1.zodTransform)(obj, {
48
+ prompt: "prompt",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiImageEditorCreateBodyStyle
54
+ */
55
+ const SchemaOut$V1AiImageEditorCreateBodyStyle = z
56
+ .object({
57
+ prompt: z.string(),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, core_1.zodTransform)(obj, {
61
+ prompt: "prompt",
62
+ });
63
+ });
64
+ exports.Schemas$V1AiImageEditorCreateBodyStyle = {
65
+ in: SchemaIn$V1AiImageEditorCreateBodyStyle,
66
+ out: SchemaOut$V1AiImageEditorCreateBodyStyle,
67
+ };
@@ -0,0 +1,31 @@
1
+ import { External$V1AiImageEditorCreateBodyAssets, V1AiImageEditorCreateBodyAssets } from "./v1-ai-image-editor-create-body-assets";
2
+ import { External$V1AiImageEditorCreateBodyStyle, V1AiImageEditorCreateBodyStyle } from "./v1-ai-image-editor-create-body-style";
3
+ import * as z from "zod";
4
+ /**
5
+ * V1AiImageEditorCreateBody
6
+ */
7
+ export type V1AiImageEditorCreateBody = {
8
+ /**
9
+ * Provide the assets for image edit
10
+ */
11
+ assets: V1AiImageEditorCreateBodyAssets;
12
+ /**
13
+ * The name of image
14
+ */
15
+ name?: string | undefined;
16
+ style: V1AiImageEditorCreateBodyStyle;
17
+ };
18
+ /**
19
+ * @internal
20
+ * V1AiImageEditorCreateBody without any key transformation, this is what
21
+ * we expect to come in as network data
22
+ */
23
+ export type External$V1AiImageEditorCreateBody = {
24
+ assets: External$V1AiImageEditorCreateBodyAssets;
25
+ name?: string | undefined;
26
+ style: External$V1AiImageEditorCreateBodyStyle;
27
+ };
28
+ export declare const Schemas$V1AiImageEditorCreateBody: {
29
+ in: z.ZodType<V1AiImageEditorCreateBody, z.ZodTypeDef, unknown>;
30
+ out: z.ZodType<External$V1AiImageEditorCreateBody, z.ZodTypeDef, V1AiImageEditorCreateBody>;
31
+ };
@@ -0,0 +1,77 @@
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$V1AiImageEditorCreateBody = void 0;
37
+ const v1_ai_image_editor_create_body_assets_1 = require("./v1-ai-image-editor-create-body-assets");
38
+ const v1_ai_image_editor_create_body_style_1 = require("./v1-ai-image-editor-create-body-style");
39
+ const core_1 = require("../core");
40
+ const z = __importStar(require("zod"));
41
+ /**
42
+ * Takes network data, validates it, and transforms keys to match typescript object V1AiImageEditorCreateBody
43
+ */
44
+ const SchemaIn$V1AiImageEditorCreateBody = z
45
+ .object({
46
+ assets: v1_ai_image_editor_create_body_assets_1.Schemas$V1AiImageEditorCreateBodyAssets.in,
47
+ name: z.string().optional(),
48
+ style: v1_ai_image_editor_create_body_style_1.Schemas$V1AiImageEditorCreateBodyStyle.in,
49
+ })
50
+ .transform((obj) => {
51
+ return (0, core_1.zodTransform)(obj, {
52
+ assets: "assets",
53
+ name: "name",
54
+ style: "style",
55
+ });
56
+ });
57
+ /**
58
+ * @internal
59
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiImageEditorCreateBody
60
+ */
61
+ const SchemaOut$V1AiImageEditorCreateBody = z
62
+ .object({
63
+ assets: v1_ai_image_editor_create_body_assets_1.Schemas$V1AiImageEditorCreateBodyAssets.out,
64
+ name: z.string().optional(),
65
+ style: v1_ai_image_editor_create_body_style_1.Schemas$V1AiImageEditorCreateBodyStyle.out,
66
+ })
67
+ .transform((obj) => {
68
+ return (0, core_1.zodTransform)(obj, {
69
+ assets: "assets",
70
+ name: "name",
71
+ style: "style",
72
+ });
73
+ });
74
+ exports.Schemas$V1AiImageEditorCreateBody = {
75
+ in: SchemaIn$V1AiImageEditorCreateBody,
76
+ out: SchemaOut$V1AiImageEditorCreateBody,
77
+ };
@@ -0,0 +1,34 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Success
4
+ */
5
+ export type V1AiImageEditorCreateResponse = {
6
+ /**
7
+ * The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
8
+ *
9
+ * If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
10
+ */
11
+ creditsCharged: number;
12
+ /**
13
+ * Deprecated: Previously represented the number of frames (original name of our credit system) used for image generation. Use 'credits_charged' instead.
14
+ */
15
+ frameCost: number;
16
+ /**
17
+ * Unique ID of the image. This value can be used in the [get image project API](https://docs.magichour.ai/api-reference/image-projects/get-image-details) to fetch additional details such as status
18
+ */
19
+ id: string;
20
+ };
21
+ /**
22
+ * @internal
23
+ * V1AiImageEditorCreateResponse without any key transformation, this is what
24
+ * we expect to come in as network data
25
+ */
26
+ export type External$V1AiImageEditorCreateResponse = {
27
+ credits_charged: number;
28
+ frame_cost: number;
29
+ id: string;
30
+ };
31
+ export declare const Schemas$V1AiImageEditorCreateResponse: {
32
+ in: z.ZodType<V1AiImageEditorCreateResponse, z.ZodTypeDef, unknown>;
33
+ out: z.ZodType<External$V1AiImageEditorCreateResponse, z.ZodTypeDef, V1AiImageEditorCreateResponse>;
34
+ };
@@ -0,0 +1,75 @@
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$V1AiImageEditorCreateResponse = 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 V1AiImageEditorCreateResponse
41
+ */
42
+ const SchemaIn$V1AiImageEditorCreateResponse = z
43
+ .object({
44
+ credits_charged: z.number().int(),
45
+ frame_cost: z.number().int(),
46
+ id: z.string(),
47
+ })
48
+ .transform((obj) => {
49
+ return (0, core_1.zodTransform)(obj, {
50
+ credits_charged: "creditsCharged",
51
+ frame_cost: "frameCost",
52
+ id: "id",
53
+ });
54
+ });
55
+ /**
56
+ * @internal
57
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiImageEditorCreateResponse
58
+ */
59
+ const SchemaOut$V1AiImageEditorCreateResponse = z
60
+ .object({
61
+ creditsCharged: z.number().int(),
62
+ frameCost: z.number().int(),
63
+ id: z.string(),
64
+ })
65
+ .transform((obj) => {
66
+ return (0, core_1.zodTransform)(obj, {
67
+ creditsCharged: "credits_charged",
68
+ frameCost: "frame_cost",
69
+ id: "id",
70
+ });
71
+ });
72
+ exports.Schemas$V1AiImageEditorCreateResponse = {
73
+ in: SchemaIn$V1AiImageEditorCreateResponse,
74
+ out: SchemaOut$V1AiImageEditorCreateResponse,
75
+ };
@@ -0,0 +1,19 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * The request is invalid
4
+ */
5
+ export type V1AiImageEditorCreateResponse400 = {
6
+ message: string;
7
+ };
8
+ /**
9
+ * @internal
10
+ * V1AiImageEditorCreateResponse400 without any key transformation, this is what
11
+ * we expect to come in as network data
12
+ */
13
+ export type External$V1AiImageEditorCreateResponse400 = {
14
+ message: string;
15
+ };
16
+ export declare const Schemas$V1AiImageEditorCreateResponse400: {
17
+ in: z.ZodType<V1AiImageEditorCreateResponse400, z.ZodTypeDef, unknown>;
18
+ out: z.ZodType<External$V1AiImageEditorCreateResponse400, z.ZodTypeDef, V1AiImageEditorCreateResponse400>;
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$V1AiImageEditorCreateResponse400 = 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 V1AiImageEditorCreateResponse400
41
+ */
42
+ const SchemaIn$V1AiImageEditorCreateResponse400 = 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$V1AiImageEditorCreateResponse400
54
+ */
55
+ const SchemaOut$V1AiImageEditorCreateResponse400 = 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$V1AiImageEditorCreateResponse400 = {
65
+ in: SchemaIn$V1AiImageEditorCreateResponse400,
66
+ out: SchemaOut$V1AiImageEditorCreateResponse400,
67
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * V1AiImageEditorCreateResponse401MessageEnum
3
+ */
4
+ export type V1AiImageEditorCreateResponse401MessageEnum = "Unauthorized";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * The request is not properly authenticated
4
+ */
5
+ export type V1AiImageEditorCreateResponse401 = {
6
+ message: "Unauthorized";
7
+ };
8
+ /**
9
+ * @internal
10
+ * V1AiImageEditorCreateResponse401 without any key transformation, this is what
11
+ * we expect to come in as network data
12
+ */
13
+ export type External$V1AiImageEditorCreateResponse401 = {
14
+ message: "Unauthorized";
15
+ };
16
+ export declare const Schemas$V1AiImageEditorCreateResponse401: {
17
+ in: z.ZodType<V1AiImageEditorCreateResponse401, z.ZodTypeDef, unknown>;
18
+ out: z.ZodType<External$V1AiImageEditorCreateResponse401, z.ZodTypeDef, V1AiImageEditorCreateResponse401>;
19
+ };