magic-hour 0.28.0 → 0.30.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 (57) hide show
  1. package/README.md +5 -0
  2. package/dist/environment.d.ts +1 -1
  3. package/dist/environment.js +1 -1
  4. package/dist/resources/v1/face-detection/index.d.ts +2 -0
  5. package/dist/resources/v1/face-detection/index.js +5 -0
  6. package/dist/resources/v1/face-detection/request-types.d.ts +51 -0
  7. package/dist/resources/v1/face-detection/request-types.js +101 -0
  8. package/dist/resources/v1/face-detection/resource-client.d.ts +24 -0
  9. package/dist/resources/v1/face-detection/resource-client.js +48 -0
  10. package/dist/resources/v1/index.d.ts +1 -0
  11. package/dist/resources/v1/index.js +2 -1
  12. package/dist/resources/v1/resource-client.d.ts +3 -0
  13. package/dist/resources/v1/resource-client.js +6 -0
  14. package/dist/types/index.d.ts +20 -0
  15. package/dist/types/v1-face-detection-create-body-assets.d.ts +22 -0
  16. package/dist/types/v1-face-detection-create-body-assets.js +67 -0
  17. package/dist/types/v1-face-detection-create-body.d.ts +30 -0
  18. package/dist/types/v1-face-detection-create-body.js +72 -0
  19. package/dist/types/v1-face-detection-create-response.d.ts +27 -0
  20. package/dist/types/v1-face-detection-create-response.js +71 -0
  21. package/dist/types/v1-face-detection-create-response400.d.ts +19 -0
  22. package/dist/types/v1-face-detection-create-response400.js +67 -0
  23. package/dist/types/v1-face-detection-create-response401-message-enum.d.ts +4 -0
  24. package/dist/types/v1-face-detection-create-response401-message-enum.js +2 -0
  25. package/dist/types/v1-face-detection-create-response401.d.ts +19 -0
  26. package/dist/types/v1-face-detection-create-response401.js +67 -0
  27. package/dist/types/v1-face-detection-create-response404-message-enum.d.ts +4 -0
  28. package/dist/types/v1-face-detection-create-response404-message-enum.js +2 -0
  29. package/dist/types/v1-face-detection-create-response404.d.ts +19 -0
  30. package/dist/types/v1-face-detection-create-response404.js +67 -0
  31. package/dist/types/v1-face-detection-create-response422.d.ts +19 -0
  32. package/dist/types/v1-face-detection-create-response422.js +67 -0
  33. package/dist/types/v1-face-detection-get-response-faces-item.d.ts +27 -0
  34. package/dist/types/v1-face-detection-get-response-faces-item.js +71 -0
  35. package/dist/types/v1-face-detection-get-response-status-enum.d.ts +4 -0
  36. package/dist/types/v1-face-detection-get-response-status-enum.js +2 -0
  37. package/dist/types/v1-face-detection-get-response.d.ts +38 -0
  38. package/dist/types/v1-face-detection-get-response.js +80 -0
  39. package/dist/types/v1-face-detection-get-response400.d.ts +19 -0
  40. package/dist/types/v1-face-detection-get-response400.js +67 -0
  41. package/dist/types/v1-face-detection-get-response401-message-enum.d.ts +4 -0
  42. package/dist/types/v1-face-detection-get-response401-message-enum.js +2 -0
  43. package/dist/types/v1-face-detection-get-response401.d.ts +19 -0
  44. package/dist/types/v1-face-detection-get-response401.js +67 -0
  45. package/dist/types/v1-face-detection-get-response404-message-enum.d.ts +4 -0
  46. package/dist/types/v1-face-detection-get-response404-message-enum.js +2 -0
  47. package/dist/types/v1-face-detection-get-response404.d.ts +19 -0
  48. package/dist/types/v1-face-detection-get-response404.js +67 -0
  49. package/dist/types/v1-face-detection-get-response422.d.ts +19 -0
  50. package/dist/types/v1-face-detection-get-response422.js +67 -0
  51. package/dist/types/v1-face-swap-photo-create-body-assets-face-mappings-item.d.ts +30 -0
  52. package/dist/types/v1-face-swap-photo-create-body-assets-face-mappings-item.js +71 -0
  53. package/dist/types/v1-face-swap-photo-create-body-assets-face-swap-mode-enum.d.ts +6 -0
  54. package/dist/types/v1-face-swap-photo-create-body-assets-face-swap-mode-enum.js +2 -0
  55. package/dist/types/v1-face-swap-photo-create-body-assets.d.ts +18 -3
  56. package/dist/types/v1-face-swap-photo-create-body-assets.js +15 -2
  57. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * The request is invalid
4
+ */
5
+ export type V1FaceDetectionGetResponse400 = {
6
+ message: string;
7
+ };
8
+ /**
9
+ * @internal
10
+ * V1FaceDetectionGetResponse400 without any key transformation, this is what
11
+ * we expect to come in as network data
12
+ */
13
+ export type External$V1FaceDetectionGetResponse400 = {
14
+ message: string;
15
+ };
16
+ export declare const Schemas$V1FaceDetectionGetResponse400: {
17
+ in: z.ZodType<V1FaceDetectionGetResponse400, z.ZodTypeDef, unknown>;
18
+ out: z.ZodType<External$V1FaceDetectionGetResponse400, z.ZodTypeDef, V1FaceDetectionGetResponse400>;
19
+ };
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1FaceDetectionGetResponse400 = void 0;
37
+ const core_1 = require("../core");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1FaceDetectionGetResponse400
41
+ */
42
+ const SchemaIn$V1FaceDetectionGetResponse400 = z
43
+ .object({
44
+ message: z.string(),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, core_1.zodTransform)(obj, {
48
+ message: "message",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1FaceDetectionGetResponse400
54
+ */
55
+ const SchemaOut$V1FaceDetectionGetResponse400 = z
56
+ .object({
57
+ message: z.string(),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, core_1.zodTransform)(obj, {
61
+ message: "message",
62
+ });
63
+ });
64
+ exports.Schemas$V1FaceDetectionGetResponse400 = {
65
+ in: SchemaIn$V1FaceDetectionGetResponse400,
66
+ out: SchemaOut$V1FaceDetectionGetResponse400,
67
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * V1FaceDetectionGetResponse401MessageEnum
3
+ */
4
+ export type V1FaceDetectionGetResponse401MessageEnum = "Unauthorized";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * The request is not properly authenticated
4
+ */
5
+ export type V1FaceDetectionGetResponse401 = {
6
+ message: "Unauthorized";
7
+ };
8
+ /**
9
+ * @internal
10
+ * V1FaceDetectionGetResponse401 without any key transformation, this is what
11
+ * we expect to come in as network data
12
+ */
13
+ export type External$V1FaceDetectionGetResponse401 = {
14
+ message: "Unauthorized";
15
+ };
16
+ export declare const Schemas$V1FaceDetectionGetResponse401: {
17
+ in: z.ZodType<V1FaceDetectionGetResponse401, z.ZodTypeDef, unknown>;
18
+ out: z.ZodType<External$V1FaceDetectionGetResponse401, z.ZodTypeDef, V1FaceDetectionGetResponse401>;
19
+ };
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1FaceDetectionGetResponse401 = void 0;
37
+ const core_1 = require("../core");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1FaceDetectionGetResponse401
41
+ */
42
+ const SchemaIn$V1FaceDetectionGetResponse401 = z
43
+ .object({
44
+ message: z.enum(["Unauthorized"]),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, core_1.zodTransform)(obj, {
48
+ message: "message",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1FaceDetectionGetResponse401
54
+ */
55
+ const SchemaOut$V1FaceDetectionGetResponse401 = z
56
+ .object({
57
+ message: z.enum(["Unauthorized"]),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, core_1.zodTransform)(obj, {
61
+ message: "message",
62
+ });
63
+ });
64
+ exports.Schemas$V1FaceDetectionGetResponse401 = {
65
+ in: SchemaIn$V1FaceDetectionGetResponse401,
66
+ out: SchemaOut$V1FaceDetectionGetResponse401,
67
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * V1FaceDetectionGetResponse404MessageEnum
3
+ */
4
+ export type V1FaceDetectionGetResponse404MessageEnum = "Not Found";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Requested resource is not found
4
+ */
5
+ export type V1FaceDetectionGetResponse404 = {
6
+ message: "Not Found";
7
+ };
8
+ /**
9
+ * @internal
10
+ * V1FaceDetectionGetResponse404 without any key transformation, this is what
11
+ * we expect to come in as network data
12
+ */
13
+ export type External$V1FaceDetectionGetResponse404 = {
14
+ message: "Not Found";
15
+ };
16
+ export declare const Schemas$V1FaceDetectionGetResponse404: {
17
+ in: z.ZodType<V1FaceDetectionGetResponse404, z.ZodTypeDef, unknown>;
18
+ out: z.ZodType<External$V1FaceDetectionGetResponse404, z.ZodTypeDef, V1FaceDetectionGetResponse404>;
19
+ };
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1FaceDetectionGetResponse404 = void 0;
37
+ const core_1 = require("../core");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1FaceDetectionGetResponse404
41
+ */
42
+ const SchemaIn$V1FaceDetectionGetResponse404 = z
43
+ .object({
44
+ message: z.enum(["Not Found"]),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, core_1.zodTransform)(obj, {
48
+ message: "message",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1FaceDetectionGetResponse404
54
+ */
55
+ const SchemaOut$V1FaceDetectionGetResponse404 = z
56
+ .object({
57
+ message: z.enum(["Not Found"]),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, core_1.zodTransform)(obj, {
61
+ message: "message",
62
+ });
63
+ });
64
+ exports.Schemas$V1FaceDetectionGetResponse404 = {
65
+ in: SchemaIn$V1FaceDetectionGetResponse404,
66
+ out: SchemaOut$V1FaceDetectionGetResponse404,
67
+ };
@@ -0,0 +1,19 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Unprocessable Entity
4
+ */
5
+ export type V1FaceDetectionGetResponse422 = {
6
+ message: string;
7
+ };
8
+ /**
9
+ * @internal
10
+ * V1FaceDetectionGetResponse422 without any key transformation, this is what
11
+ * we expect to come in as network data
12
+ */
13
+ export type External$V1FaceDetectionGetResponse422 = {
14
+ message: string;
15
+ };
16
+ export declare const Schemas$V1FaceDetectionGetResponse422: {
17
+ in: z.ZodType<V1FaceDetectionGetResponse422, z.ZodTypeDef, unknown>;
18
+ out: z.ZodType<External$V1FaceDetectionGetResponse422, z.ZodTypeDef, V1FaceDetectionGetResponse422>;
19
+ };
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1FaceDetectionGetResponse422 = void 0;
37
+ const core_1 = require("../core");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1FaceDetectionGetResponse422
41
+ */
42
+ const SchemaIn$V1FaceDetectionGetResponse422 = z
43
+ .object({
44
+ message: z.string(),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, core_1.zodTransform)(obj, {
48
+ message: "message",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1FaceDetectionGetResponse422
54
+ */
55
+ const SchemaOut$V1FaceDetectionGetResponse422 = z
56
+ .object({
57
+ message: z.string(),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, core_1.zodTransform)(obj, {
61
+ message: "message",
62
+ });
63
+ });
64
+ exports.Schemas$V1FaceDetectionGetResponse422 = {
65
+ in: SchemaIn$V1FaceDetectionGetResponse422,
66
+ out: SchemaOut$V1FaceDetectionGetResponse422,
67
+ };
@@ -0,0 +1,30 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem
4
+ */
5
+ export type V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem = {
6
+ /**
7
+ * The face image that will be used to replace the face in the `original_face`. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
8
+ */
9
+ newFace: string;
10
+ /**
11
+ * The face detected from the image in `target_file_path`. The file name is in the format of `<face_frame>-<face_index>.png`. This value is corresponds to the response in the face detection API [COMING SOON].
12
+ *
13
+ * * The face_frame is the frame number of the face in the target image. For images, the frame number is always 0.
14
+ * * The face_index is the index of the face in the target image, starting from 0 going left to right.
15
+ */
16
+ originalFace: string;
17
+ };
18
+ /**
19
+ * @internal
20
+ * V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem without any key transformation, this is what
21
+ * we expect to come in as network data
22
+ */
23
+ export type External$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem = {
24
+ new_face: string;
25
+ original_face: string;
26
+ };
27
+ export declare const Schemas$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem: {
28
+ in: z.ZodType<V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem, z.ZodTypeDef, unknown>;
29
+ out: z.ZodType<External$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem, z.ZodTypeDef, V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem>;
30
+ };
@@ -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$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem = void 0;
37
+ const core_1 = require("../core");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem
41
+ */
42
+ const SchemaIn$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem = z
43
+ .object({
44
+ new_face: z.string(),
45
+ original_face: z.string(),
46
+ })
47
+ .transform((obj) => {
48
+ return (0, core_1.zodTransform)(obj, {
49
+ new_face: "newFace",
50
+ original_face: "originalFace",
51
+ });
52
+ });
53
+ /**
54
+ * @internal
55
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem
56
+ */
57
+ const SchemaOut$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem = z
58
+ .object({
59
+ newFace: z.string(),
60
+ originalFace: z.string(),
61
+ })
62
+ .transform((obj) => {
63
+ return (0, core_1.zodTransform)(obj, {
64
+ newFace: "new_face",
65
+ originalFace: "original_face",
66
+ });
67
+ });
68
+ exports.Schemas$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem = {
69
+ in: SchemaIn$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem,
70
+ out: SchemaOut$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem,
71
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The mode of face swap.
3
+ * * `all-faces` - Swap all faces in the target image. `source_file_path` is required.
4
+ * * `individual-faces` - Swap individual faces in the target image. `source_faces` is required.
5
+ */
6
+ export type V1FaceSwapPhotoCreateBodyAssetsFaceSwapModeEnum = "all-faces" | "individual-faces";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +1,25 @@
1
+ import { External$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem, V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem } from "./v1-face-swap-photo-create-body-assets-face-mappings-item";
1
2
  import * as z from "zod";
2
3
  /**
3
4
  * Provide the assets for face swap photo
4
5
  */
5
6
  export type V1FaceSwapPhotoCreateBodyAssets = {
6
7
  /**
7
- * This is the image from which the face is extracted. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
8
+ * This is the array of face mappings used for multiple face swap. The value is required if `face_swap_mode` is `individual-faces`.
8
9
  */
9
- sourceFilePath: string;
10
+ faceMappings?: V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem[] | undefined;
11
+ /**
12
+ * The mode of face swap.
13
+ * * `all-faces` - Swap all faces in the target image. `source_file_path` is required.
14
+ * * `individual-faces` - Swap individual faces in the target image. `source_faces` is required.
15
+ */
16
+ faceSwapMode?: ("all-faces" | "individual-faces") | undefined;
17
+ /**
18
+ * This is the image from which the face is extracted. The value is required if `face_swap_mode` is `all-faces`.
19
+ *
20
+ * This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
21
+ */
22
+ sourceFilePath?: string | undefined;
10
23
  /**
11
24
  * This is the image where the face from the source image will be placed. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
12
25
  */
@@ -18,7 +31,9 @@ export type V1FaceSwapPhotoCreateBodyAssets = {
18
31
  * we expect to come in as network data
19
32
  */
20
33
  export type External$V1FaceSwapPhotoCreateBodyAssets = {
21
- source_file_path: string;
34
+ face_mappings?: External$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem[] | undefined;
35
+ face_swap_mode?: ("all-faces" | "individual-faces") | undefined;
36
+ source_file_path?: string | undefined;
22
37
  target_file_path: string;
23
38
  };
24
39
  export declare const Schemas$V1FaceSwapPhotoCreateBodyAssets: {
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Schemas$V1FaceSwapPhotoCreateBodyAssets = void 0;
37
+ const v1_face_swap_photo_create_body_assets_face_mappings_item_1 = require("./v1-face-swap-photo-create-body-assets-face-mappings-item");
37
38
  const core_1 = require("../core");
38
39
  const z = __importStar(require("zod"));
39
40
  /**
@@ -41,11 +42,17 @@ const z = __importStar(require("zod"));
41
42
  */
42
43
  const SchemaIn$V1FaceSwapPhotoCreateBodyAssets = z
43
44
  .object({
44
- source_file_path: z.string(),
45
+ face_mappings: z
46
+ .array(v1_face_swap_photo_create_body_assets_face_mappings_item_1.Schemas$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem.in)
47
+ .optional(),
48
+ face_swap_mode: z.enum(["all-faces", "individual-faces"]).optional(),
49
+ source_file_path: z.string().optional(),
45
50
  target_file_path: z.string(),
46
51
  })
47
52
  .transform((obj) => {
48
53
  return (0, core_1.zodTransform)(obj, {
54
+ face_mappings: "faceMappings",
55
+ face_swap_mode: "faceSwapMode",
49
56
  source_file_path: "sourceFilePath",
50
57
  target_file_path: "targetFilePath",
51
58
  });
@@ -56,11 +63,17 @@ const SchemaIn$V1FaceSwapPhotoCreateBodyAssets = z
56
63
  */
57
64
  const SchemaOut$V1FaceSwapPhotoCreateBodyAssets = z
58
65
  .object({
59
- sourceFilePath: z.string(),
66
+ faceMappings: z
67
+ .array(v1_face_swap_photo_create_body_assets_face_mappings_item_1.Schemas$V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem.out)
68
+ .optional(),
69
+ faceSwapMode: z.enum(["all-faces", "individual-faces"]).optional(),
70
+ sourceFilePath: z.string().optional(),
60
71
  targetFilePath: z.string(),
61
72
  })
62
73
  .transform((obj) => {
63
74
  return (0, core_1.zodTransform)(obj, {
75
+ faceMappings: "face_mappings",
76
+ faceSwapMode: "face_swap_mode",
64
77
  sourceFilePath: "source_file_path",
65
78
  targetFilePath: "target_file_path",
66
79
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-hour",
3
- "version": "0.28.0",
3
+ "version": "0.30.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {