magic-hour 0.67.0 → 0.69.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 (47) 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-video-editor/index.d.ts +2 -0
  5. package/dist/resources/v1/ai-video-editor/index.js +5 -0
  6. package/dist/resources/v1/ai-video-editor/request-types.d.ts +41 -0
  7. package/dist/resources/v1/ai-video-editor/request-types.js +85 -0
  8. package/dist/resources/v1/ai-video-editor/resource-client.d.ts +76 -0
  9. package/dist/resources/v1/ai-video-editor/resource-client.js +120 -0
  10. package/dist/resources/v1/body-swap/resource-client.d.ts +1 -1
  11. package/dist/resources/v1/body-swap/resource-client.js +1 -1
  12. package/dist/resources/v1/character-replace/index.d.ts +2 -0
  13. package/dist/resources/v1/character-replace/index.js +5 -0
  14. package/dist/resources/v1/character-replace/request-types.d.ts +49 -0
  15. package/dist/resources/v1/character-replace/request-types.js +89 -0
  16. package/dist/resources/v1/character-replace/resource-client.d.ts +88 -0
  17. package/dist/resources/v1/character-replace/resource-client.js +129 -0
  18. package/dist/resources/v1/index.d.ts +2 -0
  19. package/dist/resources/v1/index.js +3 -1
  20. package/dist/resources/v1/resource-client.d.ts +6 -0
  21. package/dist/resources/v1/resource-client.js +12 -0
  22. package/dist/types/index.d.ts +12 -0
  23. package/dist/types/v1-ai-video-editor-create-body-assets.d.ts +27 -0
  24. package/dist/types/v1-ai-video-editor-create-body-assets.js +67 -0
  25. package/dist/types/v1-ai-video-editor-create-body-style.d.ts +22 -0
  26. package/dist/types/v1-ai-video-editor-create-body-style.js +67 -0
  27. package/dist/types/v1-ai-video-editor-create-body.d.ts +41 -0
  28. package/dist/types/v1-ai-video-editor-create-body.js +85 -0
  29. package/dist/types/v1-ai-video-editor-create-response.d.ts +36 -0
  30. package/dist/types/v1-ai-video-editor-create-response.js +75 -0
  31. package/dist/types/v1-character-replace-create-body-assets.d.ts +37 -0
  32. package/dist/types/v1-character-replace-create-body-assets.js +71 -0
  33. package/dist/types/v1-character-replace-create-body-resolution-enum.d.ts +4 -0
  34. package/dist/types/v1-character-replace-create-body-resolution-enum.js +2 -0
  35. package/dist/types/v1-character-replace-create-body-style-mode-enum.d.ts +4 -0
  36. package/dist/types/v1-character-replace-create-body-style-mode-enum.js +2 -0
  37. package/dist/types/v1-character-replace-create-body-style-points-item.d.ts +32 -0
  38. package/dist/types/v1-character-replace-create-body-style-points-item.js +75 -0
  39. package/dist/types/v1-character-replace-create-body-style-selection-mode-enum.d.ts +4 -0
  40. package/dist/types/v1-character-replace-create-body-style-selection-mode-enum.js +2 -0
  41. package/dist/types/v1-character-replace-create-body-style.d.ts +33 -0
  42. package/dist/types/v1-character-replace-create-body-style.js +80 -0
  43. package/dist/types/v1-character-replace-create-body.d.ts +49 -0
  44. package/dist/types/v1-character-replace-create-body.js +89 -0
  45. package/dist/types/v1-character-replace-create-response.d.ts +36 -0
  46. package/dist/types/v1-character-replace-create-response.js +75 -0
  47. package/package.json +1 -1
@@ -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$V1AiVideoEditorCreateResponse = 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 V1AiVideoEditorCreateResponse
41
+ */
42
+ const SchemaIn$V1AiVideoEditorCreateResponse = 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$V1AiVideoEditorCreateResponse
58
+ */
59
+ const SchemaOut$V1AiVideoEditorCreateResponse = 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$V1AiVideoEditorCreateResponse = {
73
+ in: SchemaIn$V1AiVideoEditorCreateResponse,
74
+ out: SchemaOut$V1AiVideoEditorCreateResponse,
75
+ };
@@ -0,0 +1,37 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Source video and reference character image for the job.
4
+ */
5
+ export type V1CharacterReplaceCreateBodyAssets = {
6
+ /**
7
+ * Reference character image used as the replacement or animation target. 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
+ /**
16
+ * Source video containing the subject to replace or animate. This value is either
17
+ * - a direct URL to the video file
18
+ * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
19
+ *
20
+ * See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.
21
+ *
22
+ */
23
+ videoFilePath: string;
24
+ };
25
+ /**
26
+ * @internal
27
+ * V1CharacterReplaceCreateBodyAssets without any key transformation, this is what
28
+ * we expect to come in as network data
29
+ */
30
+ export type External$V1CharacterReplaceCreateBodyAssets = {
31
+ image_file_path: string;
32
+ video_file_path: string;
33
+ };
34
+ export declare const Schemas$V1CharacterReplaceCreateBodyAssets: {
35
+ in: z.ZodType<V1CharacterReplaceCreateBodyAssets, z.ZodTypeDef, unknown>;
36
+ out: z.ZodType<External$V1CharacterReplaceCreateBodyAssets, z.ZodTypeDef, V1CharacterReplaceCreateBodyAssets>;
37
+ };
@@ -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$V1CharacterReplaceCreateBodyAssets = 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 V1CharacterReplaceCreateBodyAssets
41
+ */
42
+ const SchemaIn$V1CharacterReplaceCreateBodyAssets = z
43
+ .object({
44
+ image_file_path: z.string(),
45
+ video_file_path: z.string(),
46
+ })
47
+ .transform((obj) => {
48
+ return (0, make_api_request_js_1.zodTransform)(obj, {
49
+ image_file_path: "imageFilePath",
50
+ video_file_path: "videoFilePath",
51
+ });
52
+ });
53
+ /**
54
+ * @internal
55
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1CharacterReplaceCreateBodyAssets
56
+ */
57
+ const SchemaOut$V1CharacterReplaceCreateBodyAssets = z
58
+ .object({
59
+ imageFilePath: z.string(),
60
+ videoFilePath: z.string(),
61
+ })
62
+ .transform((obj) => {
63
+ return (0, make_api_request_js_1.zodTransform)(obj, {
64
+ imageFilePath: "image_file_path",
65
+ videoFilePath: "video_file_path",
66
+ });
67
+ });
68
+ exports.Schemas$V1CharacterReplaceCreateBodyAssets = {
69
+ in: SchemaIn$V1CharacterReplaceCreateBodyAssets,
70
+ out: SchemaOut$V1CharacterReplaceCreateBodyAssets,
71
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Output video resolution. Defaults to 480p, the lowest resolution available on your plan.
3
+ */
4
+ export type V1CharacterReplaceCreateBodyResolutionEnum = "480p" | "720p";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Processing mode. `replace` swaps the detected subject with your reference character. `animate` transfers motion from the video onto your character image.
3
+ */
4
+ export type V1CharacterReplaceCreateBodyStyleModeEnum = "animate" | "replace";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * V1CharacterReplaceCreateBodyStylePointsItem
4
+ */
5
+ export type V1CharacterReplaceCreateBodyStylePointsItem = {
6
+ /**
7
+ * Horizontal pixel coordinate in the source video frame at `time_seconds`, measured from the left edge.
8
+ */
9
+ positionX: number;
10
+ /**
11
+ * Vertical pixel coordinate in the source video frame at `time_seconds`, measured from the top edge.
12
+ */
13
+ positionY: number;
14
+ /**
15
+ * Timestamp on the source video timeline in seconds. Uses the same clock as `start_seconds` and `end_seconds`.
16
+ */
17
+ timeSeconds: number;
18
+ };
19
+ /**
20
+ * @internal
21
+ * V1CharacterReplaceCreateBodyStylePointsItem without any key transformation, this is what
22
+ * we expect to come in as network data
23
+ */
24
+ export type External$V1CharacterReplaceCreateBodyStylePointsItem = {
25
+ position_x: number;
26
+ position_y: number;
27
+ time_seconds: number;
28
+ };
29
+ export declare const Schemas$V1CharacterReplaceCreateBodyStylePointsItem: {
30
+ in: z.ZodType<V1CharacterReplaceCreateBodyStylePointsItem, z.ZodTypeDef, unknown>;
31
+ out: z.ZodType<External$V1CharacterReplaceCreateBodyStylePointsItem, z.ZodTypeDef, V1CharacterReplaceCreateBodyStylePointsItem>;
32
+ };
@@ -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$V1CharacterReplaceCreateBodyStylePointsItem = 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 V1CharacterReplaceCreateBodyStylePointsItem
41
+ */
42
+ const SchemaIn$V1CharacterReplaceCreateBodyStylePointsItem = z
43
+ .object({
44
+ position_x: z.number().int(),
45
+ position_y: z.number().int(),
46
+ time_seconds: z.number(),
47
+ })
48
+ .transform((obj) => {
49
+ return (0, make_api_request_js_1.zodTransform)(obj, {
50
+ position_x: "positionX",
51
+ position_y: "positionY",
52
+ time_seconds: "timeSeconds",
53
+ });
54
+ });
55
+ /**
56
+ * @internal
57
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1CharacterReplaceCreateBodyStylePointsItem
58
+ */
59
+ const SchemaOut$V1CharacterReplaceCreateBodyStylePointsItem = z
60
+ .object({
61
+ positionX: z.number().int(),
62
+ positionY: z.number().int(),
63
+ timeSeconds: z.number(),
64
+ })
65
+ .transform((obj) => {
66
+ return (0, make_api_request_js_1.zodTransform)(obj, {
67
+ positionX: "position_x",
68
+ positionY: "position_y",
69
+ timeSeconds: "time_seconds",
70
+ });
71
+ });
72
+ exports.Schemas$V1CharacterReplaceCreateBodyStylePointsItem = {
73
+ in: SchemaIn$V1CharacterReplaceCreateBodyStylePointsItem,
74
+ out: SchemaOut$V1CharacterReplaceCreateBodyStylePointsItem,
75
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * How to locate the subject in the source video. `auto` detects a person automatically. `point` uses your `points` to mark the subject. Defaults to `auto`.
3
+ */
4
+ export type V1CharacterReplaceCreateBodyStyleSelectionModeEnum = "auto" | "point";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,33 @@
1
+ import * as z from "zod";
2
+ import { External$V1CharacterReplaceCreateBodyStylePointsItem, V1CharacterReplaceCreateBodyStylePointsItem } from "./v1-character-replace-create-body-style-points-item";
3
+ /**
4
+ * Optional style controls for replace vs animate mode and subject selection.
5
+ */
6
+ export type V1CharacterReplaceCreateBodyStyle = {
7
+ /**
8
+ * Processing mode. `replace` swaps the detected subject with your reference character. `animate` transfers motion from the video onto your character image.
9
+ */
10
+ mode?: ("animate" | "replace") | undefined;
11
+ /**
12
+ * On-frame markers for manual subject selection. Required when `selection_mode` is `point`. Ignored when `selection_mode` is `auto` or omitted.
13
+ */
14
+ points?: V1CharacterReplaceCreateBodyStylePointsItem[] | undefined;
15
+ /**
16
+ * How to locate the subject in the source video. `auto` detects a person automatically. `point` uses your `points` to mark the subject. Defaults to `auto`.
17
+ */
18
+ selectionMode?: ("auto" | "point") | undefined;
19
+ };
20
+ /**
21
+ * @internal
22
+ * V1CharacterReplaceCreateBodyStyle without any key transformation, this is what
23
+ * we expect to come in as network data
24
+ */
25
+ export type External$V1CharacterReplaceCreateBodyStyle = {
26
+ mode?: ("animate" | "replace") | undefined;
27
+ points?: External$V1CharacterReplaceCreateBodyStylePointsItem[] | undefined;
28
+ selection_mode?: ("auto" | "point") | undefined;
29
+ };
30
+ export declare const Schemas$V1CharacterReplaceCreateBodyStyle: {
31
+ in: z.ZodType<V1CharacterReplaceCreateBodyStyle, z.ZodTypeDef, unknown>;
32
+ out: z.ZodType<External$V1CharacterReplaceCreateBodyStyle, z.ZodTypeDef, V1CharacterReplaceCreateBodyStyle>;
33
+ };
@@ -0,0 +1,80 @@
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$V1CharacterReplaceCreateBodyStyle = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ const v1_character_replace_create_body_style_points_item_1 = require("./v1-character-replace-create-body-style-points-item");
40
+ /**
41
+ * Takes network data, validates it, and transforms keys to match typescript object V1CharacterReplaceCreateBodyStyle
42
+ */
43
+ const SchemaIn$V1CharacterReplaceCreateBodyStyle = z
44
+ .object({
45
+ mode: z.enum(["animate", "replace"]).optional(),
46
+ points: z
47
+ .array(v1_character_replace_create_body_style_points_item_1.Schemas$V1CharacterReplaceCreateBodyStylePointsItem.in)
48
+ .optional(),
49
+ selection_mode: z.enum(["auto", "point"]).optional(),
50
+ })
51
+ .transform((obj) => {
52
+ return (0, make_api_request_js_1.zodTransform)(obj, {
53
+ mode: "mode",
54
+ points: "points",
55
+ selection_mode: "selectionMode",
56
+ });
57
+ });
58
+ /**
59
+ * @internal
60
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1CharacterReplaceCreateBodyStyle
61
+ */
62
+ const SchemaOut$V1CharacterReplaceCreateBodyStyle = z
63
+ .object({
64
+ mode: z.enum(["animate", "replace"]).optional(),
65
+ points: z
66
+ .array(v1_character_replace_create_body_style_points_item_1.Schemas$V1CharacterReplaceCreateBodyStylePointsItem.out)
67
+ .optional(),
68
+ selectionMode: z.enum(["auto", "point"]).optional(),
69
+ })
70
+ .transform((obj) => {
71
+ return (0, make_api_request_js_1.zodTransform)(obj, {
72
+ mode: "mode",
73
+ points: "points",
74
+ selectionMode: "selection_mode",
75
+ });
76
+ });
77
+ exports.Schemas$V1CharacterReplaceCreateBodyStyle = {
78
+ in: SchemaIn$V1CharacterReplaceCreateBodyStyle,
79
+ out: SchemaOut$V1CharacterReplaceCreateBodyStyle,
80
+ };
@@ -0,0 +1,49 @@
1
+ import * as z from "zod";
2
+ import { External$V1CharacterReplaceCreateBodyAssets, V1CharacterReplaceCreateBodyAssets } from "./v1-character-replace-create-body-assets";
3
+ import { External$V1CharacterReplaceCreateBodyStyle, V1CharacterReplaceCreateBodyStyle } from "./v1-character-replace-create-body-style";
4
+ /**
5
+ * V1CharacterReplaceCreateBody
6
+ */
7
+ export type V1CharacterReplaceCreateBody = {
8
+ /**
9
+ * Source video and reference character image for the job.
10
+ */
11
+ assets: V1CharacterReplaceCreateBodyAssets;
12
+ /**
13
+ * End time of your clip (seconds). Must be greater than start_seconds.
14
+ */
15
+ endSeconds: number;
16
+ /**
17
+ * Give your video a custom name for easy identification.
18
+ */
19
+ name?: string | undefined;
20
+ /**
21
+ * Output video resolution. Defaults to 480p, the lowest resolution available on your plan.
22
+ */
23
+ resolution?: ("480p" | "720p") | undefined;
24
+ /**
25
+ * Start time of your clip (seconds). Must be ≥ 0.
26
+ */
27
+ startSeconds?: number | undefined;
28
+ /**
29
+ * Optional style controls for replace vs animate mode and subject selection.
30
+ */
31
+ style?: V1CharacterReplaceCreateBodyStyle | undefined;
32
+ };
33
+ /**
34
+ * @internal
35
+ * V1CharacterReplaceCreateBody without any key transformation, this is what
36
+ * we expect to come in as network data
37
+ */
38
+ export type External$V1CharacterReplaceCreateBody = {
39
+ assets: External$V1CharacterReplaceCreateBodyAssets;
40
+ end_seconds: number;
41
+ name?: string | undefined;
42
+ resolution?: ("480p" | "720p") | undefined;
43
+ start_seconds?: number | undefined;
44
+ style?: External$V1CharacterReplaceCreateBodyStyle | undefined;
45
+ };
46
+ export declare const Schemas$V1CharacterReplaceCreateBody: {
47
+ in: z.ZodType<V1CharacterReplaceCreateBody, z.ZodTypeDef, unknown>;
48
+ out: z.ZodType<External$V1CharacterReplaceCreateBody, z.ZodTypeDef, V1CharacterReplaceCreateBody>;
49
+ };
@@ -0,0 +1,89 @@
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$V1CharacterReplaceCreateBody = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ const v1_character_replace_create_body_assets_1 = require("./v1-character-replace-create-body-assets");
40
+ const v1_character_replace_create_body_style_1 = require("./v1-character-replace-create-body-style");
41
+ /**
42
+ * Takes network data, validates it, and transforms keys to match typescript object V1CharacterReplaceCreateBody
43
+ */
44
+ const SchemaIn$V1CharacterReplaceCreateBody = z
45
+ .object({
46
+ assets: v1_character_replace_create_body_assets_1.Schemas$V1CharacterReplaceCreateBodyAssets.in,
47
+ end_seconds: z.number(),
48
+ name: z.string().optional(),
49
+ resolution: z.enum(["480p", "720p"]).optional(),
50
+ start_seconds: z.number().optional(),
51
+ style: v1_character_replace_create_body_style_1.Schemas$V1CharacterReplaceCreateBodyStyle.in.optional(),
52
+ })
53
+ .transform((obj) => {
54
+ return (0, make_api_request_js_1.zodTransform)(obj, {
55
+ assets: "assets",
56
+ end_seconds: "endSeconds",
57
+ name: "name",
58
+ resolution: "resolution",
59
+ start_seconds: "startSeconds",
60
+ style: "style",
61
+ });
62
+ });
63
+ /**
64
+ * @internal
65
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1CharacterReplaceCreateBody
66
+ */
67
+ const SchemaOut$V1CharacterReplaceCreateBody = z
68
+ .object({
69
+ assets: v1_character_replace_create_body_assets_1.Schemas$V1CharacterReplaceCreateBodyAssets.out,
70
+ endSeconds: z.number(),
71
+ name: z.string().optional(),
72
+ resolution: z.enum(["480p", "720p"]).optional(),
73
+ startSeconds: z.number().optional(),
74
+ style: v1_character_replace_create_body_style_1.Schemas$V1CharacterReplaceCreateBodyStyle.out.optional(),
75
+ })
76
+ .transform((obj) => {
77
+ return (0, make_api_request_js_1.zodTransform)(obj, {
78
+ assets: "assets",
79
+ endSeconds: "end_seconds",
80
+ name: "name",
81
+ resolution: "resolution",
82
+ startSeconds: "start_seconds",
83
+ style: "style",
84
+ });
85
+ });
86
+ exports.Schemas$V1CharacterReplaceCreateBody = {
87
+ in: SchemaIn$V1CharacterReplaceCreateBody,
88
+ out: SchemaOut$V1CharacterReplaceCreateBody,
89
+ };
@@ -0,0 +1,36 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Success
4
+ */
5
+ export type V1CharacterReplaceCreateResponse = {
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
+ * V1CharacterReplaceCreateResponse without any key transformation, this is what
26
+ * we expect to come in as network data
27
+ */
28
+ export type External$V1CharacterReplaceCreateResponse = {
29
+ credits_charged: number;
30
+ estimated_frame_cost: number;
31
+ id: string;
32
+ };
33
+ export declare const Schemas$V1CharacterReplaceCreateResponse: {
34
+ in: z.ZodType<V1CharacterReplaceCreateResponse, z.ZodTypeDef, unknown>;
35
+ out: z.ZodType<External$V1CharacterReplaceCreateResponse, z.ZodTypeDef, V1CharacterReplaceCreateResponse>;
36
+ };