magic-hour 0.84.0 → 0.85.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 (55) hide show
  1. package/README.md +10 -0
  2. package/dist/environment.d.ts +1 -1
  3. package/dist/environment.js +1 -1
  4. package/dist/resources/v1/ai-music-generator/index.d.ts +2 -0
  5. package/dist/resources/v1/ai-music-generator/index.js +5 -0
  6. package/dist/resources/v1/ai-music-generator/request-types.d.ts +32 -0
  7. package/dist/resources/v1/ai-music-generator/request-types.js +78 -0
  8. package/dist/resources/v1/ai-music-generator/resource-client.d.ts +31 -0
  9. package/dist/resources/v1/ai-music-generator/resource-client.js +78 -0
  10. package/dist/resources/v1/ai-video-editor/resource-client.d.ts +1 -1
  11. package/dist/resources/v1/ai-video-editor/resource-client.js +1 -1
  12. package/dist/resources/v1/ai-video-translator/resource-client.d.ts +1 -1
  13. package/dist/resources/v1/ai-video-translator/resource-client.js +1 -1
  14. package/dist/resources/v1/ai-video-upscaler/index.d.ts +2 -0
  15. package/dist/resources/v1/ai-video-upscaler/index.js +5 -0
  16. package/dist/resources/v1/ai-video-upscaler/request-types.d.ts +43 -0
  17. package/dist/resources/v1/ai-video-upscaler/request-types.js +84 -0
  18. package/dist/resources/v1/ai-video-upscaler/resource-client.d.ts +60 -0
  19. package/dist/resources/v1/ai-video-upscaler/resource-client.js +103 -0
  20. package/dist/resources/v1/audio-to-video/resource-client.d.ts +1 -1
  21. package/dist/resources/v1/audio-to-video/resource-client.js +1 -1
  22. package/dist/resources/v1/character-replace/resource-client.d.ts +1 -1
  23. package/dist/resources/v1/character-replace/resource-client.js +1 -1
  24. package/dist/resources/v1/face-swap/resource-client.d.ts +1 -1
  25. package/dist/resources/v1/face-swap/resource-client.js +1 -1
  26. package/dist/resources/v1/image-to-video/resource-client.d.ts +1 -1
  27. package/dist/resources/v1/image-to-video/resource-client.js +1 -1
  28. package/dist/resources/v1/index.d.ts +2 -0
  29. package/dist/resources/v1/index.js +3 -1
  30. package/dist/resources/v1/lip-sync/resource-client.d.ts +1 -1
  31. package/dist/resources/v1/lip-sync/resource-client.js +1 -1
  32. package/dist/resources/v1/resource-client.d.ts +6 -0
  33. package/dist/resources/v1/resource-client.js +12 -0
  34. package/dist/resources/v1/text-to-video/request-types.d.ts +1 -1
  35. package/dist/resources/v1/text-to-video/resource-client.d.ts +1 -1
  36. package/dist/resources/v1/text-to-video/resource-client.js +1 -1
  37. package/dist/resources/v1/video-to-video/resource-client.d.ts +1 -1
  38. package/dist/resources/v1/video-to-video/resource-client.js +1 -1
  39. package/dist/types/index.d.ts +7 -0
  40. package/dist/types/v1-ai-music-generator-create-body-style.d.ts +34 -0
  41. package/dist/types/v1-ai-music-generator-create-body-style.js +77 -0
  42. package/dist/types/v1-ai-music-generator-create-body.d.ts +32 -0
  43. package/dist/types/v1-ai-music-generator-create-body.js +78 -0
  44. package/dist/types/v1-ai-music-generator-create-response.d.ts +29 -0
  45. package/dist/types/v1-ai-music-generator-create-response.js +71 -0
  46. package/dist/types/v1-ai-video-upscaler-create-body-assets.d.ts +27 -0
  47. package/dist/types/v1-ai-video-upscaler-create-body-assets.js +67 -0
  48. package/dist/types/v1-ai-video-upscaler-create-body-resolution-enum.d.ts +4 -0
  49. package/dist/types/v1-ai-video-upscaler-create-body-resolution-enum.js +2 -0
  50. package/dist/types/v1-ai-video-upscaler-create-body.d.ts +43 -0
  51. package/dist/types/v1-ai-video-upscaler-create-body.js +84 -0
  52. package/dist/types/v1-ai-video-upscaler-create-response.d.ts +36 -0
  53. package/dist/types/v1-ai-video-upscaler-create-response.js +75 -0
  54. package/dist/types/v1-text-to-video-create-body.d.ts +1 -1
  55. package/package.json +1 -1
@@ -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$V1AiVideoUpscalerCreateBodyAssets = 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 V1AiVideoUpscalerCreateBodyAssets
41
+ */
42
+ const SchemaIn$V1AiVideoUpscalerCreateBodyAssets = z
43
+ .object({
44
+ video_file_path: z.string(),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, make_api_request_js_1.zodTransform)(obj, {
48
+ video_file_path: "videoFilePath",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiVideoUpscalerCreateBodyAssets
54
+ */
55
+ const SchemaOut$V1AiVideoUpscalerCreateBodyAssets = z
56
+ .object({
57
+ videoFilePath: z.string(),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, make_api_request_js_1.zodTransform)(obj, {
61
+ videoFilePath: "video_file_path",
62
+ });
63
+ });
64
+ exports.Schemas$V1AiVideoUpscalerCreateBodyAssets = {
65
+ in: SchemaIn$V1AiVideoUpscalerCreateBodyAssets,
66
+ out: SchemaOut$V1AiVideoUpscalerCreateBodyAssets,
67
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Output resolution. `720p` and `1080p` set the output's short side, `2k` and `4k` its long side; the aspect ratio is kept. Requires a paid plan.
3
+ */
4
+ export type V1AiVideoUpscalerCreateBodyResolutionEnum = "1080p" | "2k" | "4k" | "720p";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,43 @@
1
+ import * as z from "zod";
2
+ import { External$V1AiVideoUpscalerCreateBodyAssets, V1AiVideoUpscalerCreateBodyAssets } from "./v1-ai-video-upscaler-create-body-assets";
3
+ /**
4
+ * V1AiVideoUpscalerCreateBody
5
+ */
6
+ export type V1AiVideoUpscalerCreateBody = {
7
+ /**
8
+ * Source video for the upscale job.
9
+ */
10
+ assets: V1AiVideoUpscalerCreateBodyAssets;
11
+ /**
12
+ * End time of your clip (seconds). Must be greater than start_seconds.
13
+ */
14
+ endSeconds: number;
15
+ /**
16
+ * Give your video a custom name for easy identification.
17
+ */
18
+ name?: string | undefined;
19
+ /**
20
+ * Output resolution. `720p` and `1080p` set the output's short side, `2k` and `4k` its long side; the aspect ratio is kept. Requires a paid plan.
21
+ */
22
+ resolution: "1080p" | "2k" | "4k" | "720p";
23
+ /**
24
+ * Start time of your clip (seconds). Must be ≥ 0.
25
+ */
26
+ startSeconds?: number | undefined;
27
+ };
28
+ /**
29
+ * @internal
30
+ * V1AiVideoUpscalerCreateBody without any key transformation, this is what
31
+ * we expect to come in as network data
32
+ */
33
+ export type External$V1AiVideoUpscalerCreateBody = {
34
+ assets: External$V1AiVideoUpscalerCreateBodyAssets;
35
+ end_seconds: number;
36
+ name?: string | undefined;
37
+ resolution: "1080p" | "2k" | "4k" | "720p";
38
+ start_seconds?: number | undefined;
39
+ };
40
+ export declare const Schemas$V1AiVideoUpscalerCreateBody: {
41
+ in: z.ZodType<V1AiVideoUpscalerCreateBody, z.ZodTypeDef, unknown>;
42
+ out: z.ZodType<External$V1AiVideoUpscalerCreateBody, z.ZodTypeDef, V1AiVideoUpscalerCreateBody>;
43
+ };
@@ -0,0 +1,84 @@
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$V1AiVideoUpscalerCreateBody = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ const v1_ai_video_upscaler_create_body_assets_1 = require("./v1-ai-video-upscaler-create-body-assets");
40
+ /**
41
+ * Takes network data, validates it, and transforms keys to match typescript object V1AiVideoUpscalerCreateBody
42
+ */
43
+ const SchemaIn$V1AiVideoUpscalerCreateBody = z
44
+ .object({
45
+ assets: v1_ai_video_upscaler_create_body_assets_1.Schemas$V1AiVideoUpscalerCreateBodyAssets.in,
46
+ end_seconds: z.number(),
47
+ name: z.string().optional(),
48
+ resolution: z.enum(["1080p", "2k", "4k", "720p"]),
49
+ start_seconds: z.number().optional(),
50
+ })
51
+ .transform((obj) => {
52
+ return (0, make_api_request_js_1.zodTransform)(obj, {
53
+ assets: "assets",
54
+ end_seconds: "endSeconds",
55
+ name: "name",
56
+ resolution: "resolution",
57
+ start_seconds: "startSeconds",
58
+ });
59
+ });
60
+ /**
61
+ * @internal
62
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiVideoUpscalerCreateBody
63
+ */
64
+ const SchemaOut$V1AiVideoUpscalerCreateBody = z
65
+ .object({
66
+ assets: v1_ai_video_upscaler_create_body_assets_1.Schemas$V1AiVideoUpscalerCreateBodyAssets.out,
67
+ endSeconds: z.number(),
68
+ name: z.string().optional(),
69
+ resolution: z.enum(["1080p", "2k", "4k", "720p"]),
70
+ startSeconds: z.number().optional(),
71
+ })
72
+ .transform((obj) => {
73
+ return (0, make_api_request_js_1.zodTransform)(obj, {
74
+ assets: "assets",
75
+ endSeconds: "end_seconds",
76
+ name: "name",
77
+ resolution: "resolution",
78
+ startSeconds: "start_seconds",
79
+ });
80
+ });
81
+ exports.Schemas$V1AiVideoUpscalerCreateBody = {
82
+ in: SchemaIn$V1AiVideoUpscalerCreateBody,
83
+ out: SchemaOut$V1AiVideoUpscalerCreateBody,
84
+ };
@@ -0,0 +1,36 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Success
4
+ */
5
+ export type V1AiVideoUpscalerCreateResponse = {
6
+ /**
7
+ * The amount of credits deducted from your account to generate the video. If the status is not 'complete', this value is an estimate and may be adjusted upon completion based on the actual FPS of the output video.
8
+ *
9
+ * If video generation fails, 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 video generation. Use 'credits_charged' instead.
14
+ *
15
+ * The amount of frames used to generate the video. If the status is not 'complete', the cost is an estimate and will be adjusted when the video completes.
16
+ */
17
+ estimatedFrameCost: number;
18
+ /**
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
+ */
21
+ id: string;
22
+ };
23
+ /**
24
+ * @internal
25
+ * V1AiVideoUpscalerCreateResponse without any key transformation, this is what
26
+ * we expect to come in as network data
27
+ */
28
+ export type External$V1AiVideoUpscalerCreateResponse = {
29
+ credits_charged: number;
30
+ estimated_frame_cost: number;
31
+ id: string;
32
+ };
33
+ export declare const Schemas$V1AiVideoUpscalerCreateResponse: {
34
+ in: z.ZodType<V1AiVideoUpscalerCreateResponse, z.ZodTypeDef, unknown>;
35
+ out: z.ZodType<External$V1AiVideoUpscalerCreateResponse, z.ZodTypeDef, V1AiVideoUpscalerCreateResponse>;
36
+ };
@@ -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$V1AiVideoUpscalerCreateResponse = 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 V1AiVideoUpscalerCreateResponse
41
+ */
42
+ const SchemaIn$V1AiVideoUpscalerCreateResponse = z
43
+ .object({
44
+ credits_charged: z.number().int(),
45
+ estimated_frame_cost: z.number().int(),
46
+ id: z.string(),
47
+ })
48
+ .transform((obj) => {
49
+ return (0, make_api_request_js_1.zodTransform)(obj, {
50
+ credits_charged: "creditsCharged",
51
+ estimated_frame_cost: "estimatedFrameCost",
52
+ id: "id",
53
+ });
54
+ });
55
+ /**
56
+ * @internal
57
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiVideoUpscalerCreateResponse
58
+ */
59
+ const SchemaOut$V1AiVideoUpscalerCreateResponse = z
60
+ .object({
61
+ creditsCharged: z.number().int(),
62
+ estimatedFrameCost: z.number().int(),
63
+ id: z.string(),
64
+ })
65
+ .transform((obj) => {
66
+ return (0, make_api_request_js_1.zodTransform)(obj, {
67
+ creditsCharged: "credits_charged",
68
+ estimatedFrameCost: "estimated_frame_cost",
69
+ id: "id",
70
+ });
71
+ });
72
+ exports.Schemas$V1AiVideoUpscalerCreateResponse = {
73
+ in: SchemaIn$V1AiVideoUpscalerCreateResponse,
74
+ out: SchemaOut$V1AiVideoUpscalerCreateResponse,
75
+ };
@@ -100,7 +100,7 @@ export type V1TextToVideoCreateBody = {
100
100
  * Reference media for video generation. Name references without @ and refer to them as @name in style.prompt. Maximum 10 references total.
101
101
  *
102
102
  * Supported models and reference media:
103
- * * **`gemini-omni-1.1`**: Supports images, videos. Up to 13 references.
103
+ * * **`gemini-omni-1.1`**: Supports images, videos. Up to 10 references.
104
104
  * * **`kling-3.0`**: Supports images, videos.
105
105
  * * **`minimax-h3`**: Supports images, videos, audio.
106
106
  * * **`seedance-2.0`**: Supports images, videos, audio.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-hour",
3
- "version": "0.84.0",
3
+ "version": "0.85.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {