magic-hour 0.83.1 → 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.
- package/README.md +37 -0
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +1 -1
- package/dist/helpers/download-error.d.ts +16 -0
- package/dist/helpers/download-error.js +15 -0
- package/dist/helpers/download.js +22 -2
- package/dist/resources/v1/ai-music-generator/index.d.ts +2 -0
- package/dist/resources/v1/ai-music-generator/index.js +5 -0
- package/dist/resources/v1/ai-music-generator/request-types.d.ts +32 -0
- package/dist/resources/v1/ai-music-generator/request-types.js +78 -0
- package/dist/resources/v1/ai-music-generator/resource-client.d.ts +31 -0
- package/dist/resources/v1/ai-music-generator/resource-client.js +78 -0
- package/dist/resources/v1/ai-talking-photo/request-types.d.ts +10 -1
- package/dist/resources/v1/ai-talking-photo/request-types.js +4 -0
- package/dist/resources/v1/ai-ugc-ad/index.d.ts +2 -0
- package/dist/resources/v1/ai-ugc-ad/index.js +5 -0
- package/dist/resources/v1/ai-ugc-ad/request-types.d.ts +50 -0
- package/dist/resources/v1/ai-ugc-ad/request-types.js +86 -0
- package/dist/resources/v1/ai-ugc-ad/resource-client.d.ts +41 -0
- package/dist/resources/v1/ai-ugc-ad/resource-client.js +81 -0
- package/dist/resources/v1/ai-video-editor/resource-client.d.ts +2 -2
- package/dist/resources/v1/ai-video-editor/resource-client.js +2 -2
- package/dist/resources/v1/ai-video-translator/resource-client.d.ts +2 -2
- package/dist/resources/v1/ai-video-translator/resource-client.js +2 -2
- package/dist/resources/v1/ai-video-upscaler/index.d.ts +2 -0
- package/dist/resources/v1/ai-video-upscaler/index.js +5 -0
- package/dist/resources/v1/ai-video-upscaler/request-types.d.ts +43 -0
- package/dist/resources/v1/ai-video-upscaler/request-types.js +84 -0
- package/dist/resources/v1/ai-video-upscaler/resource-client.d.ts +60 -0
- package/dist/resources/v1/ai-video-upscaler/resource-client.js +103 -0
- package/dist/resources/v1/audio-projects/resource-client.d.ts +5 -0
- package/dist/resources/v1/audio-projects/resource-client.js +14 -2
- package/dist/resources/v1/audio-to-video/resource-client.d.ts +2 -2
- package/dist/resources/v1/audio-to-video/resource-client.js +2 -2
- package/dist/resources/v1/character-replace/resource-client.d.ts +2 -2
- package/dist/resources/v1/character-replace/resource-client.js +2 -2
- package/dist/resources/v1/face-detection/resource-client.d.ts +5 -0
- package/dist/resources/v1/face-detection/resource-client.js +17 -5
- package/dist/resources/v1/face-swap/resource-client.d.ts +2 -2
- package/dist/resources/v1/face-swap/resource-client.js +2 -2
- package/dist/resources/v1/image-projects/resource-client.d.ts +5 -0
- package/dist/resources/v1/image-projects/resource-client.js +14 -2
- package/dist/resources/v1/image-to-video/request-types.d.ts +6 -2
- package/dist/resources/v1/image-to-video/request-types.js +2 -0
- package/dist/resources/v1/image-to-video/resource-client.d.ts +2 -2
- package/dist/resources/v1/image-to-video/resource-client.js +2 -2
- package/dist/resources/v1/index.d.ts +3 -0
- package/dist/resources/v1/index.js +4 -1
- package/dist/resources/v1/lip-sync/resource-client.d.ts +2 -2
- package/dist/resources/v1/lip-sync/resource-client.js +2 -2
- package/dist/resources/v1/resource-client.d.ts +9 -0
- package/dist/resources/v1/resource-client.js +17 -0
- package/dist/resources/v1/text-to-video/request-types.d.ts +11 -3
- package/dist/resources/v1/text-to-video/request-types.js +2 -0
- package/dist/resources/v1/text-to-video/resource-client.d.ts +2 -2
- package/dist/resources/v1/text-to-video/resource-client.js +2 -2
- package/dist/resources/v1/video-projects/resource-client.d.ts +5 -0
- package/dist/resources/v1/video-projects/resource-client.js +14 -2
- package/dist/resources/v1/video-to-video/resource-client.d.ts +2 -2
- package/dist/resources/v1/video-to-video/resource-client.js +2 -2
- package/dist/types/index.d.ts +13 -0
- package/dist/types/v1-ai-music-generator-create-body-style.d.ts +34 -0
- package/dist/types/v1-ai-music-generator-create-body-style.js +77 -0
- package/dist/types/v1-ai-music-generator-create-body.d.ts +32 -0
- package/dist/types/v1-ai-music-generator-create-body.js +78 -0
- package/dist/types/v1-ai-music-generator-create-response.d.ts +29 -0
- package/dist/types/v1-ai-music-generator-create-response.js +71 -0
- package/dist/types/v1-ai-talking-photo-create-body-resolution-enum.d.ts +4 -0
- package/dist/types/v1-ai-talking-photo-create-body-resolution-enum.js +2 -0
- package/dist/types/v1-ai-talking-photo-create-body.d.ts +10 -1
- package/dist/types/v1-ai-talking-photo-create-body.js +4 -0
- package/dist/types/v1-ai-ugc-ad-create-body-assets.d.ts +29 -0
- package/dist/types/v1-ai-ugc-ad-create-body-assets.js +69 -0
- package/dist/types/v1-ai-ugc-ad-create-body-model-enum.d.ts +4 -0
- package/dist/types/v1-ai-ugc-ad-create-body-model-enum.js +2 -0
- package/dist/types/v1-ai-ugc-ad-create-body-resolution-enum.d.ts +4 -0
- package/dist/types/v1-ai-ugc-ad-create-body-resolution-enum.js +2 -0
- package/dist/types/v1-ai-ugc-ad-create-body.d.ts +50 -0
- package/dist/types/v1-ai-ugc-ad-create-body.js +86 -0
- package/dist/types/v1-ai-ugc-ad-create-response.d.ts +36 -0
- package/dist/types/v1-ai-ugc-ad-create-response.js +75 -0
- package/dist/types/v1-ai-video-upscaler-create-body-assets.d.ts +27 -0
- package/dist/types/v1-ai-video-upscaler-create-body-assets.js +67 -0
- package/dist/types/v1-ai-video-upscaler-create-body-resolution-enum.d.ts +4 -0
- package/dist/types/v1-ai-video-upscaler-create-body-resolution-enum.js +2 -0
- package/dist/types/v1-ai-video-upscaler-create-body.d.ts +43 -0
- package/dist/types/v1-ai-video-upscaler-create-body.js +84 -0
- package/dist/types/v1-ai-video-upscaler-create-response.d.ts +36 -0
- package/dist/types/v1-ai-video-upscaler-create-response.js +75 -0
- package/dist/types/v1-image-to-video-create-body-assets.d.ts +2 -1
- package/dist/types/v1-image-to-video-create-body-model-enum.d.ts +2 -1
- package/dist/types/v1-image-to-video-create-body-resolution-enum.d.ts +1 -0
- package/dist/types/v1-image-to-video-create-body.d.ts +6 -2
- package/dist/types/v1-image-to-video-create-body.js +2 -0
- package/dist/types/v1-text-to-video-create-body-aspect-ratio-enum.d.ts +2 -1
- package/dist/types/v1-text-to-video-create-body-model-enum.d.ts +2 -1
- package/dist/types/v1-text-to-video-create-body-resolution-enum.d.ts +1 -0
- package/dist/types/v1-text-to-video-create-body.d.ts +11 -3
- package/dist/types/v1-text-to-video-create-body.js +2 -0
- package/package.json +4 -3
|
@@ -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$V1AiMusicGeneratorCreateBodyStyle = 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 V1AiMusicGeneratorCreateBodyStyle
|
|
41
|
+
*/
|
|
42
|
+
const SchemaIn$V1AiMusicGeneratorCreateBodyStyle = z
|
|
43
|
+
.object({
|
|
44
|
+
instrumental: z.boolean().optional(),
|
|
45
|
+
lyrics: z.string().optional(),
|
|
46
|
+
prompt: z.string(),
|
|
47
|
+
})
|
|
48
|
+
.catchall(make_api_request_js_1.zodRequiredAny)
|
|
49
|
+
.transform((obj) => {
|
|
50
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
51
|
+
instrumental: "instrumental",
|
|
52
|
+
lyrics: "lyrics",
|
|
53
|
+
prompt: "prompt",
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
* Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiMusicGeneratorCreateBodyStyle
|
|
59
|
+
*/
|
|
60
|
+
const SchemaOut$V1AiMusicGeneratorCreateBodyStyle = z
|
|
61
|
+
.object({
|
|
62
|
+
instrumental: z.boolean().optional(),
|
|
63
|
+
lyrics: z.string().optional(),
|
|
64
|
+
prompt: z.string(),
|
|
65
|
+
})
|
|
66
|
+
.catchall(make_api_request_js_1.zodRequiredAny)
|
|
67
|
+
.transform((obj) => {
|
|
68
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
69
|
+
instrumental: "instrumental",
|
|
70
|
+
lyrics: "lyrics",
|
|
71
|
+
prompt: "prompt",
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
exports.Schemas$V1AiMusicGeneratorCreateBodyStyle = {
|
|
75
|
+
in: SchemaIn$V1AiMusicGeneratorCreateBodyStyle,
|
|
76
|
+
out: SchemaOut$V1AiMusicGeneratorCreateBodyStyle,
|
|
77
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { External$V1AiMusicGeneratorCreateBodyStyle, V1AiMusicGeneratorCreateBodyStyle } from "./v1-ai-music-generator-create-body-style";
|
|
3
|
+
/**
|
|
4
|
+
* V1AiMusicGeneratorCreateBody
|
|
5
|
+
*/
|
|
6
|
+
export type V1AiMusicGeneratorCreateBody = {
|
|
7
|
+
/**
|
|
8
|
+
* Requested track duration in seconds, from 15 to 300. Determines credits charged.
|
|
9
|
+
*/
|
|
10
|
+
duration: number;
|
|
11
|
+
/**
|
|
12
|
+
* Give your audio a custom name for easy identification.
|
|
13
|
+
*/
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
style: V1AiMusicGeneratorCreateBodyStyle;
|
|
16
|
+
[additionalProperty: string]: number | (string | undefined) | V1AiMusicGeneratorCreateBodyStyle | any | null | undefined;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* V1AiMusicGeneratorCreateBody without any key transformation, this is what
|
|
21
|
+
* we expect to come in as network data
|
|
22
|
+
*/
|
|
23
|
+
export type External$V1AiMusicGeneratorCreateBody = {
|
|
24
|
+
duration: number;
|
|
25
|
+
name?: string | undefined;
|
|
26
|
+
style: External$V1AiMusicGeneratorCreateBodyStyle;
|
|
27
|
+
[additionalProperty: string]: number | (string | undefined) | External$V1AiMusicGeneratorCreateBodyStyle | External$V1AiMusicGeneratorCreateBody | null | undefined;
|
|
28
|
+
};
|
|
29
|
+
export declare const Schemas$V1AiMusicGeneratorCreateBody: {
|
|
30
|
+
in: z.ZodType<V1AiMusicGeneratorCreateBody, z.ZodTypeDef, unknown>;
|
|
31
|
+
out: z.ZodType<External$V1AiMusicGeneratorCreateBody, z.ZodTypeDef, V1AiMusicGeneratorCreateBody>;
|
|
32
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
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$V1AiMusicGeneratorCreateBody = void 0;
|
|
37
|
+
const make_api_request_js_1 = require("make-api-request-js");
|
|
38
|
+
const z = __importStar(require("zod"));
|
|
39
|
+
const v1_ai_music_generator_create_body_style_1 = require("./v1-ai-music-generator-create-body-style");
|
|
40
|
+
/**
|
|
41
|
+
* Takes network data, validates it, and transforms keys to match typescript object V1AiMusicGeneratorCreateBody
|
|
42
|
+
*/
|
|
43
|
+
const SchemaIn$V1AiMusicGeneratorCreateBody = z
|
|
44
|
+
.object({
|
|
45
|
+
duration: z.number().int(),
|
|
46
|
+
name: z.string().optional(),
|
|
47
|
+
style: v1_ai_music_generator_create_body_style_1.Schemas$V1AiMusicGeneratorCreateBodyStyle.in,
|
|
48
|
+
})
|
|
49
|
+
.catchall(make_api_request_js_1.zodRequiredAny)
|
|
50
|
+
.transform((obj) => {
|
|
51
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
52
|
+
duration: "duration",
|
|
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$V1AiMusicGeneratorCreateBody
|
|
60
|
+
*/
|
|
61
|
+
const SchemaOut$V1AiMusicGeneratorCreateBody = z
|
|
62
|
+
.object({
|
|
63
|
+
duration: z.number().int(),
|
|
64
|
+
name: z.string().optional(),
|
|
65
|
+
style: v1_ai_music_generator_create_body_style_1.Schemas$V1AiMusicGeneratorCreateBodyStyle.out,
|
|
66
|
+
})
|
|
67
|
+
.catchall(make_api_request_js_1.zodRequiredAny)
|
|
68
|
+
.transform((obj) => {
|
|
69
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
70
|
+
duration: "duration",
|
|
71
|
+
name: "name",
|
|
72
|
+
style: "style",
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
exports.Schemas$V1AiMusicGeneratorCreateBody = {
|
|
76
|
+
in: SchemaIn$V1AiMusicGeneratorCreateBody,
|
|
77
|
+
out: SchemaOut$V1AiMusicGeneratorCreateBody,
|
|
78
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Success
|
|
4
|
+
*/
|
|
5
|
+
export type V1AiMusicGeneratorCreateResponse = {
|
|
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
|
+
* V1AiMusicGeneratorCreateResponse without any key transformation, this is what
|
|
20
|
+
* we expect to come in as network data
|
|
21
|
+
*/
|
|
22
|
+
export type External$V1AiMusicGeneratorCreateResponse = {
|
|
23
|
+
credits_charged: number;
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const Schemas$V1AiMusicGeneratorCreateResponse: {
|
|
27
|
+
in: z.ZodType<V1AiMusicGeneratorCreateResponse, z.ZodTypeDef, unknown>;
|
|
28
|
+
out: z.ZodType<External$V1AiMusicGeneratorCreateResponse, z.ZodTypeDef, V1AiMusicGeneratorCreateResponse>;
|
|
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$V1AiMusicGeneratorCreateResponse = 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 V1AiMusicGeneratorCreateResponse
|
|
41
|
+
*/
|
|
42
|
+
const SchemaIn$V1AiMusicGeneratorCreateResponse = 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$V1AiMusicGeneratorCreateResponse
|
|
56
|
+
*/
|
|
57
|
+
const SchemaOut$V1AiMusicGeneratorCreateResponse = 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$V1AiMusicGeneratorCreateResponse = {
|
|
69
|
+
in: SchemaIn$V1AiMusicGeneratorCreateResponse,
|
|
70
|
+
out: SchemaOut$V1AiMusicGeneratorCreateResponse,
|
|
71
|
+
};
|
|
@@ -14,13 +14,21 @@ export type V1AiTalkingPhotoCreateBody = {
|
|
|
14
14
|
*/
|
|
15
15
|
endSeconds: number;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Deprecated: use `resolution`. Still accepted as a larger-dimension cap, limited by your plan. Ignored when `resolution` is provided.
|
|
18
|
+
*
|
|
19
|
+
* After plan capping:
|
|
20
|
+
* * Below 1280 maps to `480p` (intermediate values round down).
|
|
21
|
+
* * 1280 or above maps to `720p`.
|
|
18
22
|
*/
|
|
19
23
|
maxResolution?: number | undefined;
|
|
20
24
|
/**
|
|
21
25
|
* Give your video a custom name for easy identification.
|
|
22
26
|
*/
|
|
23
27
|
name?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Output preset. Overrides `max_resolution`. Defaults to 480p in prompted mode; realistic mode uses the mapped plan maximum.
|
|
30
|
+
*/
|
|
31
|
+
resolution?: ("480p" | "720p") | undefined;
|
|
24
32
|
/**
|
|
25
33
|
* The start time of the input audio in seconds. Maximum clip length depends on style.generation_mode: realistic 300s, prompted 45s.
|
|
26
34
|
*/
|
|
@@ -40,6 +48,7 @@ export type External$V1AiTalkingPhotoCreateBody = {
|
|
|
40
48
|
end_seconds: number;
|
|
41
49
|
max_resolution?: number | undefined;
|
|
42
50
|
name?: string | undefined;
|
|
51
|
+
resolution?: ("480p" | "720p") | undefined;
|
|
43
52
|
start_seconds: number;
|
|
44
53
|
style?: External$V1AiTalkingPhotoCreateBodyStyle | undefined;
|
|
45
54
|
};
|
|
@@ -47,6 +47,7 @@ const SchemaIn$V1AiTalkingPhotoCreateBody = z
|
|
|
47
47
|
end_seconds: z.number(),
|
|
48
48
|
max_resolution: z.number().int().optional(),
|
|
49
49
|
name: z.string().optional(),
|
|
50
|
+
resolution: z.enum(["480p", "720p"]).optional(),
|
|
50
51
|
start_seconds: z.number(),
|
|
51
52
|
style: v1_ai_talking_photo_create_body_style_1.Schemas$V1AiTalkingPhotoCreateBodyStyle.in.optional(),
|
|
52
53
|
})
|
|
@@ -56,6 +57,7 @@ const SchemaIn$V1AiTalkingPhotoCreateBody = z
|
|
|
56
57
|
end_seconds: "endSeconds",
|
|
57
58
|
max_resolution: "maxResolution",
|
|
58
59
|
name: "name",
|
|
60
|
+
resolution: "resolution",
|
|
59
61
|
start_seconds: "startSeconds",
|
|
60
62
|
style: "style",
|
|
61
63
|
});
|
|
@@ -70,6 +72,7 @@ const SchemaOut$V1AiTalkingPhotoCreateBody = z
|
|
|
70
72
|
endSeconds: z.number(),
|
|
71
73
|
maxResolution: z.number().int().optional(),
|
|
72
74
|
name: z.string().optional(),
|
|
75
|
+
resolution: z.enum(["480p", "720p"]).optional(),
|
|
73
76
|
startSeconds: z.number(),
|
|
74
77
|
style: v1_ai_talking_photo_create_body_style_1.Schemas$V1AiTalkingPhotoCreateBodyStyle.out.optional(),
|
|
75
78
|
})
|
|
@@ -79,6 +82,7 @@ const SchemaOut$V1AiTalkingPhotoCreateBody = z
|
|
|
79
82
|
endSeconds: "end_seconds",
|
|
80
83
|
maxResolution: "max_resolution",
|
|
81
84
|
name: "name",
|
|
85
|
+
resolution: "resolution",
|
|
82
86
|
startSeconds: "start_seconds",
|
|
83
87
|
style: "style",
|
|
84
88
|
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* V1AiUgcAdCreateBodyAssets
|
|
4
|
+
*/
|
|
5
|
+
export type V1AiUgcAdCreateBodyAssets = {
|
|
6
|
+
/**
|
|
7
|
+
* Prepared image to animate. This value is either
|
|
8
|
+
* - a direct URL to the video file
|
|
9
|
+
* - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
|
|
10
|
+
*
|
|
11
|
+
* See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
imageFilePath: string;
|
|
15
|
+
[additionalProperty: string]: string | any | null | undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
* V1AiUgcAdCreateBodyAssets without any key transformation, this is what
|
|
20
|
+
* we expect to come in as network data
|
|
21
|
+
*/
|
|
22
|
+
export type External$V1AiUgcAdCreateBodyAssets = {
|
|
23
|
+
image_file_path: string;
|
|
24
|
+
[additionalProperty: string]: string | External$V1AiUgcAdCreateBodyAssets | null | undefined;
|
|
25
|
+
};
|
|
26
|
+
export declare const Schemas$V1AiUgcAdCreateBodyAssets: {
|
|
27
|
+
in: z.ZodType<V1AiUgcAdCreateBodyAssets, z.ZodTypeDef, unknown>;
|
|
28
|
+
out: z.ZodType<External$V1AiUgcAdCreateBodyAssets, z.ZodTypeDef, V1AiUgcAdCreateBodyAssets>;
|
|
29
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
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$V1AiUgcAdCreateBodyAssets = 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 V1AiUgcAdCreateBodyAssets
|
|
41
|
+
*/
|
|
42
|
+
const SchemaIn$V1AiUgcAdCreateBodyAssets = z
|
|
43
|
+
.object({
|
|
44
|
+
image_file_path: z.string(),
|
|
45
|
+
})
|
|
46
|
+
.catchall(make_api_request_js_1.zodRequiredAny)
|
|
47
|
+
.transform((obj) => {
|
|
48
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
49
|
+
image_file_path: "imageFilePath",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
* Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiUgcAdCreateBodyAssets
|
|
55
|
+
*/
|
|
56
|
+
const SchemaOut$V1AiUgcAdCreateBodyAssets = z
|
|
57
|
+
.object({
|
|
58
|
+
imageFilePath: z.string(),
|
|
59
|
+
})
|
|
60
|
+
.catchall(make_api_request_js_1.zodRequiredAny)
|
|
61
|
+
.transform((obj) => {
|
|
62
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
63
|
+
imageFilePath: "image_file_path",
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
exports.Schemas$V1AiUgcAdCreateBodyAssets = {
|
|
67
|
+
in: SchemaIn$V1AiUgcAdCreateBodyAssets,
|
|
68
|
+
out: SchemaOut$V1AiUgcAdCreateBodyAssets,
|
|
69
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { External$V1AiUgcAdCreateBodyAssets, V1AiUgcAdCreateBodyAssets } from "./v1-ai-ugc-ad-create-body-assets";
|
|
3
|
+
/**
|
|
4
|
+
* V1AiUgcAdCreateBody
|
|
5
|
+
*/
|
|
6
|
+
export type V1AiUgcAdCreateBody = {
|
|
7
|
+
assets: V1AiUgcAdCreateBodyAssets;
|
|
8
|
+
/**
|
|
9
|
+
* Video duration in seconds. Supported values by model:
|
|
10
|
+
* * kling-3.0: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 seconds.
|
|
11
|
+
* * ltx-2.5: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 seconds.
|
|
12
|
+
* * veo3.1: 4, 6, 8, 15, 22, 29, 36, 43, 50, 57, 64, 71, 78, 85, 92, 99, 106, 113, 120, 127, 134, 141 seconds.
|
|
13
|
+
* Free plans are limited to 5 seconds unless a credit pack has been purchased.
|
|
14
|
+
*/
|
|
15
|
+
endSeconds: number;
|
|
16
|
+
/**
|
|
17
|
+
* Defaults to kling-3.0 on paid plans and ltx-2.5 on free plans.
|
|
18
|
+
*/
|
|
19
|
+
model?: ("kling-3.0" | "ltx-2.5" | "veo3.1") | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Defaults to 720p on paid plans and 480p on free plans. Unsupported model/resolution combinations and resolutions unavailable for your plan are rejected.
|
|
22
|
+
*/
|
|
23
|
+
resolution?: ("1080p" | "480p" | "720p") | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The words the actor should speak. Character limits apply after trimming:
|
|
26
|
+
* * kling-3.0: 2500 characters.
|
|
27
|
+
* * ltx-2.5: 1804 characters.
|
|
28
|
+
* * veo3.1: 2500 characters.
|
|
29
|
+
* LTX's dialogue wrapper counts toward its model prompt limit.
|
|
30
|
+
*/
|
|
31
|
+
script: string;
|
|
32
|
+
[additionalProperty: string]: V1AiUgcAdCreateBodyAssets | number | (("kling-3.0" | "ltx-2.5" | "veo3.1") | undefined) | (("1080p" | "480p" | "720p") | undefined) | string | any | null | undefined;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
* V1AiUgcAdCreateBody without any key transformation, this is what
|
|
37
|
+
* we expect to come in as network data
|
|
38
|
+
*/
|
|
39
|
+
export type External$V1AiUgcAdCreateBody = {
|
|
40
|
+
assets: External$V1AiUgcAdCreateBodyAssets;
|
|
41
|
+
end_seconds: number;
|
|
42
|
+
model?: ("kling-3.0" | "ltx-2.5" | "veo3.1") | undefined;
|
|
43
|
+
resolution?: ("1080p" | "480p" | "720p") | undefined;
|
|
44
|
+
script: string;
|
|
45
|
+
[additionalProperty: string]: External$V1AiUgcAdCreateBodyAssets | number | (("kling-3.0" | "ltx-2.5" | "veo3.1") | undefined) | (("1080p" | "480p" | "720p") | undefined) | string | External$V1AiUgcAdCreateBody | null | undefined;
|
|
46
|
+
};
|
|
47
|
+
export declare const Schemas$V1AiUgcAdCreateBody: {
|
|
48
|
+
in: z.ZodType<V1AiUgcAdCreateBody, z.ZodTypeDef, unknown>;
|
|
49
|
+
out: z.ZodType<External$V1AiUgcAdCreateBody, z.ZodTypeDef, V1AiUgcAdCreateBody>;
|
|
50
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
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$V1AiUgcAdCreateBody = void 0;
|
|
37
|
+
const make_api_request_js_1 = require("make-api-request-js");
|
|
38
|
+
const z = __importStar(require("zod"));
|
|
39
|
+
const v1_ai_ugc_ad_create_body_assets_1 = require("./v1-ai-ugc-ad-create-body-assets");
|
|
40
|
+
/**
|
|
41
|
+
* Takes network data, validates it, and transforms keys to match typescript object V1AiUgcAdCreateBody
|
|
42
|
+
*/
|
|
43
|
+
const SchemaIn$V1AiUgcAdCreateBody = z
|
|
44
|
+
.object({
|
|
45
|
+
assets: v1_ai_ugc_ad_create_body_assets_1.Schemas$V1AiUgcAdCreateBodyAssets.in,
|
|
46
|
+
end_seconds: z.number(),
|
|
47
|
+
model: z.enum(["kling-3.0", "ltx-2.5", "veo3.1"]).optional(),
|
|
48
|
+
resolution: z.enum(["1080p", "480p", "720p"]).optional(),
|
|
49
|
+
script: z.string(),
|
|
50
|
+
})
|
|
51
|
+
.catchall(make_api_request_js_1.zodRequiredAny)
|
|
52
|
+
.transform((obj) => {
|
|
53
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
54
|
+
assets: "assets",
|
|
55
|
+
end_seconds: "endSeconds",
|
|
56
|
+
model: "model",
|
|
57
|
+
resolution: "resolution",
|
|
58
|
+
script: "script",
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
* Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiUgcAdCreateBody
|
|
64
|
+
*/
|
|
65
|
+
const SchemaOut$V1AiUgcAdCreateBody = z
|
|
66
|
+
.object({
|
|
67
|
+
assets: v1_ai_ugc_ad_create_body_assets_1.Schemas$V1AiUgcAdCreateBodyAssets.out,
|
|
68
|
+
endSeconds: z.number(),
|
|
69
|
+
model: z.enum(["kling-3.0", "ltx-2.5", "veo3.1"]).optional(),
|
|
70
|
+
resolution: z.enum(["1080p", "480p", "720p"]).optional(),
|
|
71
|
+
script: z.string(),
|
|
72
|
+
})
|
|
73
|
+
.catchall(make_api_request_js_1.zodRequiredAny)
|
|
74
|
+
.transform((obj) => {
|
|
75
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
76
|
+
assets: "assets",
|
|
77
|
+
endSeconds: "end_seconds",
|
|
78
|
+
model: "model",
|
|
79
|
+
resolution: "resolution",
|
|
80
|
+
script: "script",
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
exports.Schemas$V1AiUgcAdCreateBody = {
|
|
84
|
+
in: SchemaIn$V1AiUgcAdCreateBody,
|
|
85
|
+
out: SchemaOut$V1AiUgcAdCreateBody,
|
|
86
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Success
|
|
4
|
+
*/
|
|
5
|
+
export type V1AiUgcAdCreateResponse = {
|
|
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
|
+
* V1AiUgcAdCreateResponse without any key transformation, this is what
|
|
26
|
+
* we expect to come in as network data
|
|
27
|
+
*/
|
|
28
|
+
export type External$V1AiUgcAdCreateResponse = {
|
|
29
|
+
credits_charged: number;
|
|
30
|
+
estimated_frame_cost: number;
|
|
31
|
+
id: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const Schemas$V1AiUgcAdCreateResponse: {
|
|
34
|
+
in: z.ZodType<V1AiUgcAdCreateResponse, z.ZodTypeDef, unknown>;
|
|
35
|
+
out: z.ZodType<External$V1AiUgcAdCreateResponse, z.ZodTypeDef, V1AiUgcAdCreateResponse>;
|
|
36
|
+
};
|