magic-hour 0.43.1 → 0.45.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 (167) hide show
  1. package/README.md +82 -77
  2. package/dist/core/api-error.d.ts +6 -0
  3. package/dist/core/api-error.js +11 -0
  4. package/dist/core/api-promise.d.ts +28 -0
  5. package/dist/core/api-promise.js +252 -0
  6. package/dist/core/auth.d.ts +76 -0
  7. package/dist/core/auth.js +232 -0
  8. package/dist/core/binary-response.d.ts +6 -0
  9. package/dist/core/binary-response.js +10 -0
  10. package/dist/core/content-type.d.ts +4 -0
  11. package/dist/core/content-type.js +12 -0
  12. package/dist/core/core-client.d.ts +58 -0
  13. package/dist/core/core-client.js +168 -0
  14. package/dist/core/form-data.d.ts +26 -0
  15. package/dist/core/form-data.js +83 -0
  16. package/dist/core/index.d.ts +9 -0
  17. package/dist/core/index.js +28 -0
  18. package/dist/core/logger.d.ts +48 -0
  19. package/dist/core/logger.js +82 -0
  20. package/dist/core/query.d.ts +8 -0
  21. package/dist/core/query.js +77 -0
  22. package/dist/core/runtime.d.ts +4 -0
  23. package/dist/core/runtime.js +20 -0
  24. package/dist/core/zod.d.ts +13 -0
  25. package/dist/core/zod.js +60 -0
  26. package/dist/environment.d.ts +1 -1
  27. package/dist/environment.js +1 -1
  28. package/dist/examples/logging-example.d.ts +10 -0
  29. package/dist/examples/logging-example.js +137 -0
  30. package/dist/logging-client.d.ts +39 -0
  31. package/dist/logging-client.js +116 -0
  32. package/dist/resources/v1/ai-clothes-changer/request-types.d.ts +1 -1
  33. package/dist/resources/v1/ai-face-editor/request-types.d.ts +1 -1
  34. package/dist/resources/v1/ai-gif-generator/request-types.d.ts +1 -1
  35. package/dist/resources/v1/ai-headshot-generator/request-types.d.ts +1 -1
  36. package/dist/resources/v1/ai-image-editor/request-types.d.ts +1 -1
  37. package/dist/resources/v1/ai-image-editor/resource-client.d.ts +1 -1
  38. package/dist/resources/v1/ai-image-editor/resource-client.js +1 -1
  39. package/dist/resources/v1/ai-image-generator/request-types.d.ts +1 -1
  40. package/dist/resources/v1/ai-image-upscaler/request-types.d.ts +1 -1
  41. package/dist/resources/v1/ai-photo-editor/request-types.d.ts +1 -1
  42. package/dist/resources/v1/ai-qr-code-generator/request-types.d.ts +1 -1
  43. package/dist/resources/v1/ai-talking-photo/request-types.d.ts +1 -1
  44. package/dist/resources/v1/ai-voice-cloner/index.d.ts +2 -0
  45. package/dist/resources/v1/ai-voice-cloner/index.js +5 -0
  46. package/dist/resources/v1/ai-voice-cloner/request-types.d.ts +31 -0
  47. package/dist/resources/v1/ai-voice-cloner/request-types.js +77 -0
  48. package/dist/resources/v1/ai-voice-cloner/resource-client.d.ts +55 -0
  49. package/dist/resources/v1/ai-voice-cloner/resource-client.js +99 -0
  50. package/dist/resources/v1/ai-voice-generator/request-types.d.ts +1 -1
  51. package/dist/resources/v1/animation/request-types.d.ts +1 -1
  52. package/dist/resources/v1/audio-projects/resource-client.d.ts +9 -10
  53. package/dist/resources/v1/audio-projects/resource-client.js +8 -9
  54. package/dist/resources/v1/auto-subtitle-generator/request-types.d.ts +3 -3
  55. package/dist/resources/v1/face-swap/request-types.d.ts +3 -3
  56. package/dist/resources/v1/face-swap/resource-client.d.ts +20 -2
  57. package/dist/resources/v1/face-swap/resource-client.js +20 -2
  58. package/dist/resources/v1/face-swap-photo/request-types.d.ts +1 -1
  59. package/dist/resources/v1/files/resource-client.d.ts +13 -3
  60. package/dist/resources/v1/files/resource-client.js +54 -3
  61. package/dist/resources/v1/files/resource-client.test.js +45 -0
  62. package/dist/resources/v1/image-background-remover/request-types.d.ts +1 -1
  63. package/dist/resources/v1/image-projects/resource-client.d.ts +9 -10
  64. package/dist/resources/v1/image-projects/resource-client.js +8 -9
  65. package/dist/resources/v1/image-to-video/request-types.d.ts +1 -1
  66. package/dist/resources/v1/image-to-video/resource-client.d.ts +20 -2
  67. package/dist/resources/v1/image-to-video/resource-client.js +20 -2
  68. package/dist/resources/v1/index.d.ts +1 -0
  69. package/dist/resources/v1/index.js +2 -1
  70. package/dist/resources/v1/lip-sync/request-types.d.ts +3 -3
  71. package/dist/resources/v1/lip-sync/resource-client.d.ts +20 -2
  72. package/dist/resources/v1/lip-sync/resource-client.js +20 -2
  73. package/dist/resources/v1/photo-colorizer/request-types.d.ts +1 -1
  74. package/dist/resources/v1/photo-colorizer/resource-client.d.ts +1 -1
  75. package/dist/resources/v1/photo-colorizer/resource-client.js +1 -1
  76. package/dist/resources/v1/resource-client.d.ts +3 -0
  77. package/dist/resources/v1/resource-client.js +6 -0
  78. package/dist/resources/v1/text-to-video/request-types.d.ts +1 -1
  79. package/dist/resources/v1/text-to-video/resource-client.d.ts +20 -2
  80. package/dist/resources/v1/text-to-video/resource-client.js +20 -2
  81. package/dist/resources/v1/video-projects/resource-client.d.ts +9 -10
  82. package/dist/resources/v1/video-projects/resource-client.js +8 -9
  83. package/dist/resources/v1/video-to-video/request-types.d.ts +3 -3
  84. package/dist/resources/v1/video-to-video/resource-client.d.ts +20 -2
  85. package/dist/resources/v1/video-to-video/resource-client.js +20 -2
  86. package/dist/types/index.d.ts +4 -0
  87. package/dist/types/v1-ai-clothes-changer-create-body-assets-garment-type-enum.d.ts +6 -2
  88. package/dist/types/v1-ai-clothes-changer-create-body-assets.d.ts +9 -5
  89. package/dist/types/v1-ai-clothes-changer-create-body-assets.js +6 -2
  90. package/dist/types/v1-ai-clothes-changer-create-body.d.ts +1 -1
  91. package/dist/types/v1-ai-clothes-changer-create-response.d.ts +1 -1
  92. package/dist/types/v1-ai-face-editor-create-body-assets.d.ts +1 -1
  93. package/dist/types/v1-ai-face-editor-create-body.d.ts +1 -1
  94. package/dist/types/v1-ai-face-editor-create-response.d.ts +1 -1
  95. package/dist/types/v1-ai-gif-generator-create-body.d.ts +1 -1
  96. package/dist/types/v1-ai-gif-generator-create-response.d.ts +1 -1
  97. package/dist/types/v1-ai-headshot-generator-create-body-assets.d.ts +1 -1
  98. package/dist/types/v1-ai-headshot-generator-create-body.d.ts +1 -1
  99. package/dist/types/v1-ai-headshot-generator-create-response.d.ts +1 -1
  100. package/dist/types/v1-ai-image-editor-create-body-assets.d.ts +2 -2
  101. package/dist/types/v1-ai-image-editor-create-body.d.ts +1 -1
  102. package/dist/types/v1-ai-image-editor-create-response.d.ts +1 -1
  103. package/dist/types/v1-ai-image-generator-create-body.d.ts +1 -1
  104. package/dist/types/v1-ai-image-generator-create-response.d.ts +1 -1
  105. package/dist/types/v1-ai-image-upscaler-create-body-assets.d.ts +1 -1
  106. package/dist/types/v1-ai-image-upscaler-create-body.d.ts +1 -1
  107. package/dist/types/v1-ai-image-upscaler-create-response.d.ts +1 -1
  108. package/dist/types/v1-ai-meme-generator-create-response.d.ts +1 -1
  109. package/dist/types/v1-ai-photo-editor-create-body-assets.d.ts +1 -1
  110. package/dist/types/v1-ai-photo-editor-create-body.d.ts +1 -1
  111. package/dist/types/v1-ai-photo-editor-create-response.d.ts +1 -1
  112. package/dist/types/v1-ai-qr-code-generator-create-body.d.ts +1 -1
  113. package/dist/types/v1-ai-qr-code-generator-create-response.d.ts +1 -1
  114. package/dist/types/v1-ai-talking-photo-create-body-assets.d.ts +2 -2
  115. package/dist/types/v1-ai-talking-photo-create-body.d.ts +1 -1
  116. package/dist/types/v1-ai-talking-photo-create-response.d.ts +1 -1
  117. package/dist/types/v1-ai-voice-cloner-create-body-assets.d.ts +27 -0
  118. package/dist/types/v1-ai-voice-cloner-create-body-assets.js +67 -0
  119. package/dist/types/v1-ai-voice-cloner-create-body-style.d.ts +22 -0
  120. package/dist/types/v1-ai-voice-cloner-create-body-style.js +67 -0
  121. package/dist/types/v1-ai-voice-cloner-create-body.d.ts +31 -0
  122. package/dist/types/v1-ai-voice-cloner-create-body.js +77 -0
  123. package/dist/types/v1-ai-voice-cloner-create-response.d.ts +29 -0
  124. package/dist/types/v1-ai-voice-cloner-create-response.js +71 -0
  125. package/dist/types/v1-ai-voice-generator-create-body.d.ts +1 -1
  126. package/dist/types/v1-ai-voice-generator-create-response.d.ts +1 -1
  127. package/dist/types/v1-animation-create-body-assets.d.ts +2 -2
  128. package/dist/types/v1-animation-create-body.d.ts +1 -1
  129. package/dist/types/v1-animation-create-response.d.ts +1 -1
  130. package/dist/types/v1-audio-projects-get-response.d.ts +2 -2
  131. package/dist/types/v1-auto-subtitle-generator-create-body-assets.d.ts +1 -1
  132. package/dist/types/v1-auto-subtitle-generator-create-body.d.ts +3 -3
  133. package/dist/types/v1-auto-subtitle-generator-create-response.d.ts +1 -1
  134. package/dist/types/v1-face-detection-create-body-assets.d.ts +1 -1
  135. package/dist/types/v1-face-swap-create-body-assets-face-mappings-item.d.ts +1 -1
  136. package/dist/types/v1-face-swap-create-body-assets-face-swap-mode-enum.d.ts +3 -3
  137. package/dist/types/v1-face-swap-create-body-assets-video-source-enum.d.ts +1 -1
  138. package/dist/types/v1-face-swap-create-body-assets.d.ts +10 -7
  139. package/dist/types/v1-face-swap-create-body.d.ts +3 -3
  140. package/dist/types/v1-face-swap-create-response.d.ts +1 -1
  141. package/dist/types/v1-face-swap-photo-create-body-assets-face-mappings-item.d.ts +1 -1
  142. package/dist/types/v1-face-swap-photo-create-body-assets-face-swap-mode-enum.d.ts +3 -3
  143. package/dist/types/v1-face-swap-photo-create-body-assets.d.ts +5 -5
  144. package/dist/types/v1-face-swap-photo-create-body.d.ts +1 -1
  145. package/dist/types/v1-face-swap-photo-create-response.d.ts +1 -1
  146. package/dist/types/v1-image-background-remover-create-body-assets.d.ts +2 -2
  147. package/dist/types/v1-image-background-remover-create-body.d.ts +1 -1
  148. package/dist/types/v1-image-background-remover-create-response.d.ts +1 -1
  149. package/dist/types/v1-image-projects-get-response.d.ts +2 -2
  150. package/dist/types/v1-image-to-video-create-body-assets.d.ts +1 -1
  151. package/dist/types/v1-image-to-video-create-body.d.ts +1 -1
  152. package/dist/types/v1-image-to-video-create-response.d.ts +1 -1
  153. package/dist/types/v1-lip-sync-create-body-assets-video-source-enum.d.ts +1 -1
  154. package/dist/types/v1-lip-sync-create-body-assets.d.ts +7 -4
  155. package/dist/types/v1-lip-sync-create-body.d.ts +3 -3
  156. package/dist/types/v1-lip-sync-create-response.d.ts +1 -1
  157. package/dist/types/v1-photo-colorizer-create-body-assets.d.ts +1 -1
  158. package/dist/types/v1-photo-colorizer-create-body.d.ts +1 -1
  159. package/dist/types/v1-photo-colorizer-create-response.d.ts +1 -1
  160. package/dist/types/v1-text-to-video-create-body.d.ts +1 -1
  161. package/dist/types/v1-text-to-video-create-response.d.ts +1 -1
  162. package/dist/types/v1-video-projects-get-response.d.ts +4 -4
  163. package/dist/types/v1-video-to-video-create-body-assets-video-source-enum.d.ts +1 -1
  164. package/dist/types/v1-video-to-video-create-body-assets.d.ts +6 -3
  165. package/dist/types/v1-video-to-video-create-body.d.ts +3 -3
  166. package/dist/types/v1-video-to-video-create-response.d.ts +1 -1
  167. package/package.json +2 -2
@@ -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$V1AiVoiceClonerCreateBodyStyle = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1AiVoiceClonerCreateBodyStyle
41
+ */
42
+ const SchemaIn$V1AiVoiceClonerCreateBodyStyle = z
43
+ .object({
44
+ prompt: z.string(),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, make_api_request_js_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$V1AiVoiceClonerCreateBodyStyle
54
+ */
55
+ const SchemaOut$V1AiVoiceClonerCreateBodyStyle = z
56
+ .object({
57
+ prompt: z.string(),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, make_api_request_js_1.zodTransform)(obj, {
61
+ prompt: "prompt",
62
+ });
63
+ });
64
+ exports.Schemas$V1AiVoiceClonerCreateBodyStyle = {
65
+ in: SchemaIn$V1AiVoiceClonerCreateBodyStyle,
66
+ out: SchemaOut$V1AiVoiceClonerCreateBodyStyle,
67
+ };
@@ -0,0 +1,31 @@
1
+ import * as z from "zod";
2
+ import { External$V1AiVoiceClonerCreateBodyAssets, V1AiVoiceClonerCreateBodyAssets } from "./v1-ai-voice-cloner-create-body-assets";
3
+ import { External$V1AiVoiceClonerCreateBodyStyle, V1AiVoiceClonerCreateBodyStyle } from "./v1-ai-voice-cloner-create-body-style";
4
+ /**
5
+ * V1AiVoiceClonerCreateBody
6
+ */
7
+ export type V1AiVoiceClonerCreateBody = {
8
+ /**
9
+ * Provide the assets for voice cloning.
10
+ */
11
+ assets: V1AiVoiceClonerCreateBodyAssets;
12
+ /**
13
+ * Give your audio a custom name for easy identification.
14
+ */
15
+ name?: string | undefined;
16
+ style: V1AiVoiceClonerCreateBodyStyle;
17
+ };
18
+ /**
19
+ * @internal
20
+ * V1AiVoiceClonerCreateBody without any key transformation, this is what
21
+ * we expect to come in as network data
22
+ */
23
+ export type External$V1AiVoiceClonerCreateBody = {
24
+ assets: External$V1AiVoiceClonerCreateBodyAssets;
25
+ name?: string | undefined;
26
+ style: External$V1AiVoiceClonerCreateBodyStyle;
27
+ };
28
+ export declare const Schemas$V1AiVoiceClonerCreateBody: {
29
+ in: z.ZodType<V1AiVoiceClonerCreateBody, z.ZodTypeDef, unknown>;
30
+ out: z.ZodType<External$V1AiVoiceClonerCreateBody, z.ZodTypeDef, V1AiVoiceClonerCreateBody>;
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$V1AiVoiceClonerCreateBody = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ const v1_ai_voice_cloner_create_body_assets_1 = require("./v1-ai-voice-cloner-create-body-assets");
40
+ const v1_ai_voice_cloner_create_body_style_1 = require("./v1-ai-voice-cloner-create-body-style");
41
+ /**
42
+ * Takes network data, validates it, and transforms keys to match typescript object V1AiVoiceClonerCreateBody
43
+ */
44
+ const SchemaIn$V1AiVoiceClonerCreateBody = z
45
+ .object({
46
+ assets: v1_ai_voice_cloner_create_body_assets_1.Schemas$V1AiVoiceClonerCreateBodyAssets.in,
47
+ name: z.string().optional(),
48
+ style: v1_ai_voice_cloner_create_body_style_1.Schemas$V1AiVoiceClonerCreateBodyStyle.in,
49
+ })
50
+ .transform((obj) => {
51
+ return (0, make_api_request_js_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$V1AiVoiceClonerCreateBody
60
+ */
61
+ const SchemaOut$V1AiVoiceClonerCreateBody = z
62
+ .object({
63
+ assets: v1_ai_voice_cloner_create_body_assets_1.Schemas$V1AiVoiceClonerCreateBodyAssets.out,
64
+ name: z.string().optional(),
65
+ style: v1_ai_voice_cloner_create_body_style_1.Schemas$V1AiVoiceClonerCreateBodyStyle.out,
66
+ })
67
+ .transform((obj) => {
68
+ return (0, make_api_request_js_1.zodTransform)(obj, {
69
+ assets: "assets",
70
+ name: "name",
71
+ style: "style",
72
+ });
73
+ });
74
+ exports.Schemas$V1AiVoiceClonerCreateBody = {
75
+ in: SchemaIn$V1AiVoiceClonerCreateBody,
76
+ out: SchemaOut$V1AiVoiceClonerCreateBody,
77
+ };
@@ -0,0 +1,29 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Success
4
+ */
5
+ export type V1AiVoiceClonerCreateResponse = {
6
+ /**
7
+ * The amount of credits deducted from your account to generate the audio. We charge credits right when the request is made.
8
+ *
9
+ * If an error occurred while generating the audio, credits will be refunded and this field will be updated to include the refund.
10
+ */
11
+ creditsCharged: number;
12
+ /**
13
+ * Unique ID of the audio. Use it with the [Get audio Project API](https://docs.magichour.ai/api-reference/audio-projects/get-audio-details) to fetch status and downloads.
14
+ */
15
+ id: string;
16
+ };
17
+ /**
18
+ * @internal
19
+ * V1AiVoiceClonerCreateResponse without any key transformation, this is what
20
+ * we expect to come in as network data
21
+ */
22
+ export type External$V1AiVoiceClonerCreateResponse = {
23
+ credits_charged: number;
24
+ id: string;
25
+ };
26
+ export declare const Schemas$V1AiVoiceClonerCreateResponse: {
27
+ in: z.ZodType<V1AiVoiceClonerCreateResponse, z.ZodTypeDef, unknown>;
28
+ out: z.ZodType<External$V1AiVoiceClonerCreateResponse, z.ZodTypeDef, V1AiVoiceClonerCreateResponse>;
29
+ };
@@ -0,0 +1,71 @@
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$V1AiVoiceClonerCreateResponse = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1AiVoiceClonerCreateResponse
41
+ */
42
+ const SchemaIn$V1AiVoiceClonerCreateResponse = z
43
+ .object({
44
+ credits_charged: z.number().int(),
45
+ id: z.string(),
46
+ })
47
+ .transform((obj) => {
48
+ return (0, make_api_request_js_1.zodTransform)(obj, {
49
+ credits_charged: "creditsCharged",
50
+ id: "id",
51
+ });
52
+ });
53
+ /**
54
+ * @internal
55
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiVoiceClonerCreateResponse
56
+ */
57
+ const SchemaOut$V1AiVoiceClonerCreateResponse = z
58
+ .object({
59
+ creditsCharged: z.number().int(),
60
+ id: z.string(),
61
+ })
62
+ .transform((obj) => {
63
+ return (0, make_api_request_js_1.zodTransform)(obj, {
64
+ creditsCharged: "credits_charged",
65
+ id: "id",
66
+ });
67
+ });
68
+ exports.Schemas$V1AiVoiceClonerCreateResponse = {
69
+ in: SchemaIn$V1AiVoiceClonerCreateResponse,
70
+ out: SchemaOut$V1AiVoiceClonerCreateResponse,
71
+ };
@@ -5,7 +5,7 @@ import { External$V1AiVoiceGeneratorCreateBodyStyle, V1AiVoiceGeneratorCreateBod
5
5
  */
6
6
  export type V1AiVoiceGeneratorCreateBody = {
7
7
  /**
8
- * The name of audio. This value is mainly used for your own identification of the audio.
8
+ * Give your audio a custom name for easy identification.
9
9
  */
10
10
  name?: string | undefined;
11
11
  /**
@@ -10,7 +10,7 @@ export type V1AiVoiceGeneratorCreateResponse = {
10
10
  */
11
11
  creditsCharged: number;
12
12
  /**
13
- * Unique ID of the audio. This value can be used in the [get audio project API](https://docs.magichour.ai/api-reference/audio-projects/get-audio-details) to fetch additional details such as status
13
+ * Unique ID of the audio. Use it with the [Get audio Project API](https://docs.magichour.ai/api-reference/audio-projects/get-audio-details) to fetch status and downloads.
14
14
  */
15
15
  id: string;
16
16
  };
@@ -8,7 +8,7 @@ export type V1AnimationCreateBodyAssets = {
8
8
  * - a direct URL to the video file
9
9
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
10
10
  *
11
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
11
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
12
12
  *
13
13
  */
14
14
  audioFilePath?: string | undefined;
@@ -21,7 +21,7 @@ export type V1AnimationCreateBodyAssets = {
21
21
  * - a direct URL to the video file
22
22
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
23
23
  *
24
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
24
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
25
25
  *
26
26
  */
27
27
  imageFilePath?: string | undefined;
@@ -22,7 +22,7 @@ export type V1AnimationCreateBody = {
22
22
  */
23
23
  height: number;
24
24
  /**
25
- * The name of video. This value is mainly used for your own identification of the video.
25
+ * Give your video a custom name for easy identification.
26
26
  */
27
27
  name?: string | undefined;
28
28
  /**
@@ -16,7 +16,7 @@ export type V1AnimationCreateResponse = {
16
16
  */
17
17
  estimatedFrameCost: number;
18
18
  /**
19
- * Unique ID of the video. This value can be used in the [get video project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch additional details such as status
19
+ * Unique ID of the video. Use it with the [Get video Project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch status and downloads.
20
20
  */
21
21
  id: string;
22
22
  };
@@ -14,7 +14,7 @@ export type V1AudioProjectsGetResponse = {
14
14
  creditsCharged: number;
15
15
  downloads: V1AudioProjectsGetResponseDownloadsItem[];
16
16
  /**
17
- * Indicates whether the resource is deleted
17
+ * Whether this resource is active. If false, it is deleted.
18
18
  */
19
19
  enabled: boolean;
20
20
  /**
@@ -22,7 +22,7 @@ export type V1AudioProjectsGetResponse = {
22
22
  */
23
23
  error: V1AudioProjectsGetResponseError | null;
24
24
  /**
25
- * Unique ID of the audio. This value can be used in the [get audio project API](https://docs.magichour.ai/api-reference/audio-projects/get-audio-details) to fetch additional details such as status
25
+ * Unique ID of the audio. Use it with the [Get audio Project API](https://docs.magichour.ai/api-reference/audio-projects/get-audio-details) to fetch status and downloads.
26
26
  */
27
27
  id: string;
28
28
  /**
@@ -8,7 +8,7 @@ export type V1AutoSubtitleGeneratorCreateBodyAssets = {
8
8
  * - a direct URL to the video file
9
9
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
10
10
  *
11
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
11
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
12
12
  *
13
13
  */
14
14
  videoFilePath: string;
@@ -10,15 +10,15 @@ export type V1AutoSubtitleGeneratorCreateBody = {
10
10
  */
11
11
  assets: V1AutoSubtitleGeneratorCreateBodyAssets;
12
12
  /**
13
- * The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds.
13
+ * End time of your clip (seconds). Must be greater than start_seconds.
14
14
  */
15
15
  endSeconds: number;
16
16
  /**
17
- * The name of video. This value is mainly used for your own identification of the video.
17
+ * Give your video a custom name for easy identification.
18
18
  */
19
19
  name?: string | undefined;
20
20
  /**
21
- * The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.
21
+ * Start time of your clip (seconds). Must be ≥ 0.
22
22
  */
23
23
  startSeconds: number;
24
24
  /**
@@ -16,7 +16,7 @@ export type V1AutoSubtitleGeneratorCreateResponse = {
16
16
  */
17
17
  estimatedFrameCost: number;
18
18
  /**
19
- * Unique ID of the video. This value can be used in the [get video project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch additional details such as status
19
+ * Unique ID of the video. Use it with the [Get video Project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch status and downloads.
20
20
  */
21
21
  id: string;
22
22
  };
@@ -8,7 +8,7 @@ export type V1FaceDetectionCreateBodyAssets = {
8
8
  * - a direct URL to the video file
9
9
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
10
10
  *
11
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
11
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
12
12
  *
13
13
  */
14
14
  targetFilePath: string;
@@ -8,7 +8,7 @@ export type V1FaceSwapCreateBodyAssetsFaceMappingsItem = {
8
8
  * - a direct URL to the video file
9
9
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
10
10
  *
11
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
11
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
12
12
  *
13
13
  */
14
14
  newFace: string;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The mode of face swap.
3
- * * `all-faces` - Swap all faces in the target image or video. `source_file_path` is required.
4
- * * `individual-faces` - Swap individual faces in the target image or video. `source_faces` is required.
2
+ * Choose how to swap faces:
3
+ * **all-faces** (recommended) — swap all detected faces using one source image (`source_file_path` required)
4
+ * +- **individual-faces** — specify exact mappings using `face_mappings`
5
5
  */
6
6
  export type V1FaceSwapCreateBodyAssetsFaceSwapModeEnum = "all-faces" | "individual-faces";
@@ -1,4 +1,4 @@
1
1
  /**
2
- * V1FaceSwapCreateBodyAssetsVideoSourceEnum
2
+ * Choose your video source.
3
3
  */
4
4
  export type V1FaceSwapCreateBodyAssetsVideoSourceEnum = "file" | "youtube";
@@ -9,9 +9,9 @@ export type V1FaceSwapCreateBodyAssets = {
9
9
  */
10
10
  faceMappings?: V1FaceSwapCreateBodyAssetsFaceMappingsItem[] | undefined;
11
11
  /**
12
- * The mode of face swap.
13
- * * `all-faces` - Swap all faces in the target image or video. `source_file_path` is required.
14
- * * `individual-faces` - Swap individual faces in the target image or video. `source_faces` is required.
12
+ * Choose how to swap faces:
13
+ * **all-faces** (recommended) — swap all detected faces using one source image (`source_file_path` required)
14
+ * +- **individual-faces** — specify exact mappings using `face_mappings`
15
15
  */
16
16
  faceSwapMode?: ("all-faces" | "individual-faces") | undefined;
17
17
  /**
@@ -21,22 +21,25 @@ export type V1FaceSwapCreateBodyAssets = {
21
21
  * - a direct URL to the video file
22
22
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
23
23
  *
24
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
24
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
25
25
  *
26
26
  */
27
27
  imageFilePath?: string | undefined;
28
28
  /**
29
- * Required if `video_source` is `file`. This value is either
29
+ * Your video file. Required if `video_source` is `file`. This value is either
30
30
  * - a direct URL to the video file
31
31
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
32
32
  *
33
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
33
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
34
34
  *
35
35
  */
36
36
  videoFilePath?: string | undefined;
37
+ /**
38
+ * Choose your video source.
39
+ */
37
40
  videoSource: "file" | "youtube";
38
41
  /**
39
- * Using a youtube video as the input source. This field is required if `video_source` is `youtube`
42
+ * YouTube URL (required if `video_source` is `youtube`).
40
43
  */
41
44
  youtubeUrl?: string | undefined;
42
45
  };
@@ -10,7 +10,7 @@ export type V1FaceSwapCreateBody = {
10
10
  */
11
11
  assets: V1FaceSwapCreateBodyAssets;
12
12
  /**
13
- * The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds.
13
+ * End time of your clip (seconds). Must be greater than start_seconds.
14
14
  */
15
15
  endSeconds: number;
16
16
  /**
@@ -24,11 +24,11 @@ export type V1FaceSwapCreateBody = {
24
24
  */
25
25
  height?: number | null | undefined;
26
26
  /**
27
- * The name of video. This value is mainly used for your own identification of the video.
27
+ * Give your video a custom name for easy identification.
28
28
  */
29
29
  name?: string | undefined;
30
30
  /**
31
- * The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.
31
+ * Start time of your clip (seconds). Must be ≥ 0.
32
32
  */
33
33
  startSeconds: number;
34
34
  /**
@@ -16,7 +16,7 @@ export type V1FaceSwapCreateResponse = {
16
16
  */
17
17
  estimatedFrameCost: number;
18
18
  /**
19
- * Unique ID of the video. This value can be used in the [get video project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch additional details such as status
19
+ * Unique ID of the video. Use it with the [Get video Project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch status and downloads.
20
20
  */
21
21
  id: string;
22
22
  };
@@ -8,7 +8,7 @@ export type V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem = {
8
8
  * - a direct URL to the video file
9
9
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
10
10
  *
11
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
11
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
12
12
  *
13
13
  */
14
14
  newFace: string;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The mode of face swap.
3
- * * `all-faces` - Swap all faces in the target image or video. `source_file_path` is required.
4
- * * `individual-faces` - Swap individual faces in the target image or video. `source_faces` is required.
2
+ * Choose how to swap faces:
3
+ * **all-faces** (recommended) — swap all detected faces using one source image (`source_file_path` required)
4
+ * +- **individual-faces** — specify exact mappings using `face_mappings`
5
5
  */
6
6
  export type V1FaceSwapPhotoCreateBodyAssetsFaceSwapModeEnum = "all-faces" | "individual-faces";
@@ -9,9 +9,9 @@ export type V1FaceSwapPhotoCreateBodyAssets = {
9
9
  */
10
10
  faceMappings?: V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem[] | undefined;
11
11
  /**
12
- * The mode of face swap.
13
- * * `all-faces` - Swap all faces in the target image or video. `source_file_path` is required.
14
- * * `individual-faces` - Swap individual faces in the target image or video. `source_faces` is required.
12
+ * Choose how to swap faces:
13
+ * **all-faces** (recommended) — swap all detected faces using one source image (`source_file_path` required)
14
+ * +- **individual-faces** — specify exact mappings using `face_mappings`
15
15
  */
16
16
  faceSwapMode?: ("all-faces" | "individual-faces") | undefined;
17
17
  /**
@@ -21,7 +21,7 @@ export type V1FaceSwapPhotoCreateBodyAssets = {
21
21
  * - a direct URL to the video file
22
22
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
23
23
  *
24
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
24
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
25
25
  *
26
26
  */
27
27
  sourceFilePath?: string | undefined;
@@ -30,7 +30,7 @@ export type V1FaceSwapPhotoCreateBodyAssets = {
30
30
  * - a direct URL to the video file
31
31
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
32
32
  *
33
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
33
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
34
34
  *
35
35
  */
36
36
  targetFilePath: string;
@@ -9,7 +9,7 @@ export type V1FaceSwapPhotoCreateBody = {
9
9
  */
10
10
  assets: V1FaceSwapPhotoCreateBodyAssets;
11
11
  /**
12
- * The name of image. This value is mainly used for your own identification of the image.
12
+ * Give your image a custom name for easy identification.
13
13
  */
14
14
  name?: string | undefined;
15
15
  };
@@ -14,7 +14,7 @@ export type V1FaceSwapPhotoCreateResponse = {
14
14
  */
15
15
  frameCost: number;
16
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
17
+ * Unique ID of the image. Use it with the [Get image Project API](https://docs.magichour.ai/api-reference/image-projects/get-image-details) to fetch status and downloads.
18
18
  */
19
19
  id: string;
20
20
  };
@@ -10,7 +10,7 @@ export type V1ImageBackgroundRemoverCreateBodyAssets = {
10
10
  * - a direct URL to the video file
11
11
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
12
12
  *
13
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
13
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
14
14
  *
15
15
  */
16
16
  backgroundImageFilePath?: string | undefined;
@@ -19,7 +19,7 @@ export type V1ImageBackgroundRemoverCreateBodyAssets = {
19
19
  * - a direct URL to the video file
20
20
  * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
21
21
  *
22
- * Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
22
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
23
23
  *
24
24
  */
25
25
  imageFilePath: string;
@@ -9,7 +9,7 @@ export type V1ImageBackgroundRemoverCreateBody = {
9
9
  */
10
10
  assets: V1ImageBackgroundRemoverCreateBodyAssets;
11
11
  /**
12
- * The name of image. This value is mainly used for your own identification of the image.
12
+ * Give your image a custom name for easy identification.
13
13
  */
14
14
  name?: string | undefined;
15
15
  };
@@ -14,7 +14,7 @@ export type V1ImageBackgroundRemoverCreateResponse = {
14
14
  */
15
15
  frameCost: number;
16
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
17
+ * Unique ID of the image. Use it with the [Get image Project API](https://docs.magichour.ai/api-reference/image-projects/get-image-details) to fetch status and downloads.
18
18
  */
19
19
  id: string;
20
20
  };