magic-hour 0.15.0 → 0.16.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 (39) hide show
  1. package/README.md +4 -0
  2. package/dist/environment.d.ts +1 -1
  3. package/dist/environment.js +1 -1
  4. package/dist/resources/v1/ai-face-editor/index.d.ts +2 -0
  5. package/dist/resources/v1/ai-face-editor/index.js +5 -0
  6. package/dist/resources/v1/ai-face-editor/request-types.d.ts +34 -0
  7. package/dist/resources/v1/ai-face-editor/request-types.js +77 -0
  8. package/dist/resources/v1/ai-face-editor/resource-client.d.ts +14 -0
  9. package/dist/resources/v1/ai-face-editor/resource-client.js +30 -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/lip-sync/request-types.d.ts +20 -6
  13. package/dist/resources/v1/lip-sync/request-types.js +4 -4
  14. package/dist/resources/v1/resource-client.d.ts +2 -0
  15. package/dist/resources/v1/resource-client.js +2 -0
  16. package/dist/types/index.d.ts +10 -0
  17. package/dist/types/v1-ai-face-editor-create-body-assets.d.ts +22 -0
  18. package/dist/types/v1-ai-face-editor-create-body-assets.js +67 -0
  19. package/dist/types/v1-ai-face-editor-create-body-style.d.ts +92 -0
  20. package/dist/types/v1-ai-face-editor-create-body-style.js +123 -0
  21. package/dist/types/v1-ai-face-editor-create-body.d.ts +34 -0
  22. package/dist/types/v1-ai-face-editor-create-body.js +77 -0
  23. package/dist/types/v1-ai-face-editor-create-response.d.ts +27 -0
  24. package/dist/types/v1-ai-face-editor-create-response.js +71 -0
  25. package/dist/types/v1-ai-face-editor-create-response400.d.ts +19 -0
  26. package/dist/types/v1-ai-face-editor-create-response400.js +67 -0
  27. package/dist/types/v1-ai-face-editor-create-response401-message-enum.d.ts +4 -0
  28. package/dist/types/v1-ai-face-editor-create-response401-message-enum.js +2 -0
  29. package/dist/types/v1-ai-face-editor-create-response401.d.ts +19 -0
  30. package/dist/types/v1-ai-face-editor-create-response401.js +67 -0
  31. package/dist/types/v1-ai-face-editor-create-response404-message-enum.d.ts +4 -0
  32. package/dist/types/v1-ai-face-editor-create-response404-message-enum.js +2 -0
  33. package/dist/types/v1-ai-face-editor-create-response404.d.ts +19 -0
  34. package/dist/types/v1-ai-face-editor-create-response404.js +67 -0
  35. package/dist/types/v1-ai-face-editor-create-response422.d.ts +19 -0
  36. package/dist/types/v1-ai-face-editor-create-response422.js +67 -0
  37. package/dist/types/v1-lip-sync-create-body.d.ts +20 -6
  38. package/dist/types/v1-lip-sync-create-body.js +4 -4
  39. package/package.json +1 -1
package/README.md CHANGED
@@ -36,6 +36,10 @@ const client = new Client({
36
36
 
37
37
  * [create](src/resources/v1/ai-clothes-changer/README.md#create) - AI Clothes Changer
38
38
 
39
+ ### [v1.aiFaceEditor](src/resources/v1/ai-face-editor/README.md)
40
+
41
+ * [create](src/resources/v1/ai-face-editor/README.md#create) - AI Face Editor
42
+
39
43
  ### [v1.aiHeadshotGenerator](src/resources/v1/ai-headshot-generator/README.md)
40
44
 
41
45
  * [create](src/resources/v1/ai-headshot-generator/README.md#create) - AI Headshots
@@ -1,4 +1,4 @@
1
1
  export declare enum Environment {
2
2
  Environment = "https://api.magichour.ai",
3
- MockServer = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.15.0"
3
+ MockServer = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.16.0"
4
4
  }
@@ -4,5 +4,5 @@ exports.Environment = void 0;
4
4
  var Environment;
5
5
  (function (Environment) {
6
6
  Environment["Environment"] = "https://api.magichour.ai";
7
- Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.15.0";
7
+ Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.16.0";
8
8
  })(Environment || (exports.Environment = Environment = {}));
@@ -0,0 +1,2 @@
1
+ export { CreateRequest } from "./request-types";
2
+ export { AiFaceEditorClient } from "./resource-client";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AiFaceEditorClient = void 0;
4
+ var resource_client_1 = require("./resource-client");
5
+ Object.defineProperty(exports, "AiFaceEditorClient", { enumerable: true, get: function () { return resource_client_1.AiFaceEditorClient; } });
@@ -0,0 +1,34 @@
1
+ import { External$V1AiFaceEditorCreateBodyAssets, V1AiFaceEditorCreateBodyAssets } from "../../../types/v1-ai-face-editor-create-body-assets";
2
+ import { External$V1AiFaceEditorCreateBodyStyle, V1AiFaceEditorCreateBodyStyle } from "../../../types/v1-ai-face-editor-create-body-style";
3
+ import * as z from "zod";
4
+ /**
5
+ * CreateRequest
6
+ */
7
+ export type CreateRequest = {
8
+ /**
9
+ * Provide the assets for face editor
10
+ */
11
+ assets: V1AiFaceEditorCreateBodyAssets;
12
+ /**
13
+ * The name of image
14
+ */
15
+ name?: string | undefined;
16
+ /**
17
+ * Face editing parameters
18
+ */
19
+ style: V1AiFaceEditorCreateBodyStyle;
20
+ };
21
+ /**
22
+ * @internal
23
+ * CreateRequest without any key transformation, this is what
24
+ * we expect to come in as network data
25
+ */
26
+ export type External$CreateRequest = {
27
+ assets: External$V1AiFaceEditorCreateBodyAssets;
28
+ name?: string | undefined;
29
+ style: External$V1AiFaceEditorCreateBodyStyle;
30
+ };
31
+ export declare const Schemas$CreateRequest: {
32
+ in: z.ZodType<CreateRequest, z.ZodTypeDef, unknown>;
33
+ out: z.ZodType<External$CreateRequest, z.ZodTypeDef, CreateRequest>;
34
+ };
@@ -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$CreateRequest = void 0;
37
+ const core_1 = require("../../../core");
38
+ const v1_ai_face_editor_create_body_assets_1 = require("../../../types/v1-ai-face-editor-create-body-assets");
39
+ const v1_ai_face_editor_create_body_style_1 = require("../../../types/v1-ai-face-editor-create-body-style");
40
+ const z = __importStar(require("zod"));
41
+ /**
42
+ * Takes network data, validates it, and transforms keys to match typescript object CreateRequest
43
+ */
44
+ const SchemaIn$CreateRequest = z
45
+ .object({
46
+ assets: v1_ai_face_editor_create_body_assets_1.Schemas$V1AiFaceEditorCreateBodyAssets.in,
47
+ name: z.string().optional(),
48
+ style: v1_ai_face_editor_create_body_style_1.Schemas$V1AiFaceEditorCreateBodyStyle.in,
49
+ })
50
+ .transform((obj) => {
51
+ return (0, core_1.zodTransform)(obj, {
52
+ assets: "assets",
53
+ name: "name",
54
+ style: "style",
55
+ });
56
+ });
57
+ /**
58
+ * @internal
59
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$CreateRequest
60
+ */
61
+ const SchemaOut$CreateRequest = z
62
+ .object({
63
+ assets: v1_ai_face_editor_create_body_assets_1.Schemas$V1AiFaceEditorCreateBodyAssets.out,
64
+ name: z.string().optional(),
65
+ style: v1_ai_face_editor_create_body_style_1.Schemas$V1AiFaceEditorCreateBodyStyle.out,
66
+ })
67
+ .transform((obj) => {
68
+ return (0, core_1.zodTransform)(obj, {
69
+ assets: "assets",
70
+ name: "name",
71
+ style: "style",
72
+ });
73
+ });
74
+ exports.Schemas$CreateRequest = {
75
+ in: SchemaIn$CreateRequest,
76
+ out: SchemaOut$CreateRequest,
77
+ };
@@ -0,0 +1,14 @@
1
+ import { types } from "../../../index.js";
2
+ import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions } from "../../../core";
3
+ import * as requests from "../../../resources/v1/ai-face-editor/request-types";
4
+ export declare class AiFaceEditorClient extends CoreResourceClient {
5
+ constructor(client: CoreClient);
6
+ /**
7
+ * AI Face Editor
8
+ *
9
+ * Edit facial features of an image using AI. Each edit costs 1 frame. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
10
+ *
11
+ * POST /v1/ai-face-editor
12
+ */
13
+ create(request: requests.CreateRequest, opts?: RequestOptions): ApiPromise<types.V1AiFaceEditorCreateResponse>;
14
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AiFaceEditorClient = void 0;
4
+ const core_1 = require("../../../core");
5
+ const v1_ai_face_editor_create_body_1 = require("../../../types/v1-ai-face-editor-create-body");
6
+ const v1_ai_face_editor_create_response_1 = require("../../../types/v1-ai-face-editor-create-response");
7
+ class AiFaceEditorClient extends core_1.CoreResourceClient {
8
+ constructor(client) {
9
+ super(client);
10
+ }
11
+ /**
12
+ * AI Face Editor
13
+ *
14
+ * Edit facial features of an image using AI. Each edit costs 1 frame. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
15
+ *
16
+ * POST /v1/ai-face-editor
17
+ */
18
+ create(request, opts) {
19
+ return this._client.makeRequest({
20
+ method: "post",
21
+ path: "/v1/ai-face-editor",
22
+ auth: ["bearerAuth"],
23
+ contentType: "application/json",
24
+ body: v1_ai_face_editor_create_body_1.Schemas$V1AiFaceEditorCreateBody.out.parse(request),
25
+ responseSchema: v1_ai_face_editor_create_response_1.Schemas$V1AiFaceEditorCreateResponse.in,
26
+ opts,
27
+ });
28
+ }
29
+ }
30
+ exports.AiFaceEditorClient = AiFaceEditorClient;
@@ -1,4 +1,5 @@
1
1
  export * as aiClothesChanger from "./ai-clothes-changer";
2
+ export * as aiFaceEditor from "./ai-face-editor";
2
3
  export * as aiHeadshotGenerator from "./ai-headshot-generator";
3
4
  export * as aiImageGenerator from "./ai-image-generator";
4
5
  export * as aiImageUpscaler from "./ai-image-upscaler";
@@ -33,8 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.videoToVideo = exports.videoProjects = exports.textToVideo = exports.V1Client = exports.lipSync = exports.imageToVideo = exports.imageProjects = exports.imageBackgroundRemover = exports.files = exports.faceSwapPhoto = exports.faceSwap = exports.animation = exports.aiTalkingPhoto = exports.aiQrCodeGenerator = exports.aiPhotoEditor = exports.aiMemeGenerator = exports.aiImageUpscaler = exports.aiImageGenerator = exports.aiHeadshotGenerator = exports.aiClothesChanger = void 0;
36
+ exports.videoToVideo = exports.videoProjects = exports.textToVideo = exports.V1Client = exports.lipSync = exports.imageToVideo = exports.imageProjects = exports.imageBackgroundRemover = exports.files = exports.faceSwapPhoto = exports.faceSwap = exports.animation = exports.aiTalkingPhoto = exports.aiQrCodeGenerator = exports.aiPhotoEditor = exports.aiMemeGenerator = exports.aiImageUpscaler = exports.aiImageGenerator = exports.aiHeadshotGenerator = exports.aiFaceEditor = exports.aiClothesChanger = void 0;
37
37
  exports.aiClothesChanger = __importStar(require("./ai-clothes-changer"));
38
+ exports.aiFaceEditor = __importStar(require("./ai-face-editor"));
38
39
  exports.aiHeadshotGenerator = __importStar(require("./ai-headshot-generator"));
39
40
  exports.aiImageGenerator = __importStar(require("./ai-image-generator"));
40
41
  exports.aiImageUpscaler = __importStar(require("./ai-image-upscaler"));
@@ -13,9 +13,16 @@ export type CreateRequest = {
13
13
  */
14
14
  endSeconds: number;
15
15
  /**
16
- * The height of the final output video. The maximum height depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
16
+ * Used to determine the dimensions of the output video.
17
+ *
18
+ * * If height is provided, width will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
19
+ * * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
20
+ *
21
+ * Note: if the video's original resolution is less than the maximum, the video will not be resized.
22
+ *
23
+ * See our [pricing page](https://magichour.ai/pricing) for more details.
17
24
  */
18
- height: number;
25
+ height?: number | undefined;
19
26
  /**
20
27
  * Defines the maximum FPS (frames per second) for the output video. If the input video's FPS is lower than this limit, the output video will retain the input FPS. This is useful for reducing unnecessary frame usage in scenarios where high FPS is not required.
21
28
  */
@@ -29,9 +36,16 @@ export type CreateRequest = {
29
36
  */
30
37
  startSeconds: number;
31
38
  /**
32
- * The width of the final output video. The maximum width depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
39
+ * Used to determine the dimensions of the output video.
40
+ *
41
+ * * If width is provided, height will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
42
+ * * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
43
+ *
44
+ * Note: if the video's original resolution is less than the maximum, the video will not be resized.
45
+ *
46
+ * See our [pricing page](https://magichour.ai/pricing) for more details.
33
47
  */
34
- width: number;
48
+ width?: number | undefined;
35
49
  };
36
50
  /**
37
51
  * @internal
@@ -41,11 +55,11 @@ export type CreateRequest = {
41
55
  export type External$CreateRequest = {
42
56
  assets: External$V1LipSyncCreateBodyAssets;
43
57
  end_seconds: number;
44
- height: number;
58
+ height?: number | undefined;
45
59
  max_fps_limit?: number | undefined;
46
60
  name?: string | undefined;
47
61
  start_seconds: number;
48
- width: number;
62
+ width?: number | undefined;
49
63
  };
50
64
  export declare const Schemas$CreateRequest: {
51
65
  in: z.ZodType<CreateRequest, z.ZodTypeDef, unknown>;
@@ -44,11 +44,11 @@ const SchemaIn$CreateRequest = z
44
44
  .object({
45
45
  assets: v1_lip_sync_create_body_assets_1.Schemas$V1LipSyncCreateBodyAssets.in,
46
46
  end_seconds: z.number(),
47
- height: z.number().int(),
47
+ height: z.number().int().optional(),
48
48
  max_fps_limit: z.number().optional(),
49
49
  name: z.string().optional(),
50
50
  start_seconds: z.number(),
51
- width: z.number().int(),
51
+ width: z.number().int().optional(),
52
52
  })
53
53
  .transform((obj) => {
54
54
  return (0, core_1.zodTransform)(obj, {
@@ -69,11 +69,11 @@ const SchemaOut$CreateRequest = z
69
69
  .object({
70
70
  assets: v1_lip_sync_create_body_assets_1.Schemas$V1LipSyncCreateBodyAssets.out,
71
71
  endSeconds: z.number(),
72
- height: z.number().int(),
72
+ height: z.number().int().optional(),
73
73
  maxFpsLimit: z.number().optional(),
74
74
  name: z.string().optional(),
75
75
  startSeconds: z.number(),
76
- width: z.number().int(),
76
+ width: z.number().int().optional(),
77
77
  })
78
78
  .transform((obj) => {
79
79
  return (0, core_1.zodTransform)(obj, {
@@ -1,5 +1,6 @@
1
1
  import { CoreClient, CoreResourceClient } from "../../core";
2
2
  import { AiClothesChangerClient } from "../../resources/v1/ai-clothes-changer";
3
+ import { AiFaceEditorClient } from "../../resources/v1/ai-face-editor";
3
4
  import { AiHeadshotGeneratorClient } from "../../resources/v1/ai-headshot-generator";
4
5
  import { AiImageGeneratorClient } from "../../resources/v1/ai-image-generator";
5
6
  import { AiImageUpscalerClient } from "../../resources/v1/ai-image-upscaler";
@@ -22,6 +23,7 @@ export declare class V1Client extends CoreResourceClient {
22
23
  imageProjects: ImageProjectsClient;
23
24
  videoProjects: VideoProjectsClient;
24
25
  aiClothesChanger: AiClothesChangerClient;
26
+ aiFaceEditor: AiFaceEditorClient;
25
27
  aiHeadshotGenerator: AiHeadshotGeneratorClient;
26
28
  aiImageGenerator: AiImageGeneratorClient;
27
29
  aiImageUpscaler: AiImageUpscalerClient;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.V1Client = void 0;
4
4
  const core_1 = require("../../core");
5
5
  const ai_clothes_changer_1 = require("../../resources/v1/ai-clothes-changer");
6
+ const ai_face_editor_1 = require("../../resources/v1/ai-face-editor");
6
7
  const ai_headshot_generator_1 = require("../../resources/v1/ai-headshot-generator");
7
8
  const ai_image_generator_1 = require("../../resources/v1/ai-image-generator");
8
9
  const ai_image_upscaler_1 = require("../../resources/v1/ai-image-upscaler");
@@ -27,6 +28,7 @@ class V1Client extends core_1.CoreResourceClient {
27
28
  this.imageProjects = new image_projects_1.ImageProjectsClient(this._client);
28
29
  this.videoProjects = new video_projects_1.VideoProjectsClient(this._client);
29
30
  this.aiClothesChanger = new ai_clothes_changer_1.AiClothesChangerClient(this._client);
31
+ this.aiFaceEditor = new ai_face_editor_1.AiFaceEditorClient(this._client);
30
32
  this.aiHeadshotGenerator = new ai_headshot_generator_1.AiHeadshotGeneratorClient(this._client);
31
33
  this.aiImageGenerator = new ai_image_generator_1.AiImageGeneratorClient(this._client);
32
34
  this.aiImageUpscaler = new ai_image_upscaler_1.AiImageUpscalerClient(this._client);
@@ -8,6 +8,16 @@ export { V1AiClothesChangerCreateResponse401MessageEnum } from "./v1-ai-clothes-
8
8
  export { V1AiClothesChangerCreateResponse404 } from "./v1-ai-clothes-changer-create-response404";
9
9
  export { V1AiClothesChangerCreateResponse404MessageEnum } from "./v1-ai-clothes-changer-create-response404-message-enum";
10
10
  export { V1AiClothesChangerCreateResponse422 } from "./v1-ai-clothes-changer-create-response422";
11
+ export { V1AiFaceEditorCreateBody } from "./v1-ai-face-editor-create-body";
12
+ export { V1AiFaceEditorCreateBodyAssets } from "./v1-ai-face-editor-create-body-assets";
13
+ export { V1AiFaceEditorCreateBodyStyle } from "./v1-ai-face-editor-create-body-style";
14
+ export { V1AiFaceEditorCreateResponse } from "./v1-ai-face-editor-create-response";
15
+ export { V1AiFaceEditorCreateResponse400 } from "./v1-ai-face-editor-create-response400";
16
+ export { V1AiFaceEditorCreateResponse401 } from "./v1-ai-face-editor-create-response401";
17
+ export { V1AiFaceEditorCreateResponse401MessageEnum } from "./v1-ai-face-editor-create-response401-message-enum";
18
+ export { V1AiFaceEditorCreateResponse404 } from "./v1-ai-face-editor-create-response404";
19
+ export { V1AiFaceEditorCreateResponse404MessageEnum } from "./v1-ai-face-editor-create-response404-message-enum";
20
+ export { V1AiFaceEditorCreateResponse422 } from "./v1-ai-face-editor-create-response422";
11
21
  export { V1AiHeadshotGeneratorCreateBody } from "./v1-ai-headshot-generator-create-body";
12
22
  export { V1AiHeadshotGeneratorCreateBodyAssets } from "./v1-ai-headshot-generator-create-body-assets";
13
23
  export { V1AiHeadshotGeneratorCreateBodyStyle } from "./v1-ai-headshot-generator-create-body-style";
@@ -0,0 +1,22 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Provide the assets for face editor
4
+ */
5
+ export type V1AiFaceEditorCreateBodyAssets = {
6
+ /**
7
+ * This is the image whose face will be edited. 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
+ imageFilePath: string;
10
+ };
11
+ /**
12
+ * @internal
13
+ * V1AiFaceEditorCreateBodyAssets without any key transformation, this is what
14
+ * we expect to come in as network data
15
+ */
16
+ export type External$V1AiFaceEditorCreateBodyAssets = {
17
+ image_file_path: string;
18
+ };
19
+ export declare const Schemas$V1AiFaceEditorCreateBodyAssets: {
20
+ in: z.ZodType<V1AiFaceEditorCreateBodyAssets, z.ZodTypeDef, unknown>;
21
+ out: z.ZodType<External$V1AiFaceEditorCreateBodyAssets, z.ZodTypeDef, V1AiFaceEditorCreateBodyAssets>;
22
+ };
@@ -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$V1AiFaceEditorCreateBodyAssets = 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 V1AiFaceEditorCreateBodyAssets
41
+ */
42
+ const SchemaIn$V1AiFaceEditorCreateBodyAssets = z
43
+ .object({
44
+ image_file_path: z.string(),
45
+ })
46
+ .transform((obj) => {
47
+ return (0, core_1.zodTransform)(obj, {
48
+ image_file_path: "imageFilePath",
49
+ });
50
+ });
51
+ /**
52
+ * @internal
53
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiFaceEditorCreateBodyAssets
54
+ */
55
+ const SchemaOut$V1AiFaceEditorCreateBodyAssets = z
56
+ .object({
57
+ imageFilePath: z.string(),
58
+ })
59
+ .transform((obj) => {
60
+ return (0, core_1.zodTransform)(obj, {
61
+ imageFilePath: "image_file_path",
62
+ });
63
+ });
64
+ exports.Schemas$V1AiFaceEditorCreateBodyAssets = {
65
+ in: SchemaIn$V1AiFaceEditorCreateBodyAssets,
66
+ out: SchemaOut$V1AiFaceEditorCreateBodyAssets,
67
+ };
@@ -0,0 +1,92 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Face editing parameters
4
+ */
5
+ export type V1AiFaceEditorCreateBodyStyle = {
6
+ /**
7
+ * Enhance face features
8
+ */
9
+ enhanceFace: boolean;
10
+ /**
11
+ * Horizontal eye gaze (-100 to 100), in increments of 5
12
+ */
13
+ eyeGazeHorizontal: number;
14
+ /**
15
+ * Vertical eye gaze (-100 to 100), in increments of 5
16
+ */
17
+ eyeGazeVertical: number;
18
+ /**
19
+ * Eye open ratio (-100 to 100), in increments of 5
20
+ */
21
+ eyeOpenRatio: number;
22
+ /**
23
+ * Eyebrow direction (-100 to 100), in increments of 5
24
+ */
25
+ eyebrowDirection: number;
26
+ /**
27
+ * Head pitch (-100 to 100), in increments of 5
28
+ */
29
+ headPitch: number;
30
+ /**
31
+ * Head roll (-100 to 100), in increments of 5
32
+ */
33
+ headRoll: number;
34
+ /**
35
+ * Head yaw (-100 to 100), in increments of 5
36
+ */
37
+ headYaw: number;
38
+ /**
39
+ * Lip open ratio (-100 to 100), in increments of 5
40
+ */
41
+ lipOpenRatio: number;
42
+ /**
43
+ * Mouth grim (-100 to 100), in increments of 5
44
+ */
45
+ mouthGrim: number;
46
+ /**
47
+ * Horizontal mouth position (-100 to 100), in increments of 5
48
+ */
49
+ mouthPositionHorizontal: number;
50
+ /**
51
+ * Vertical mouth position (-100 to 100), in increments of 5
52
+ */
53
+ mouthPositionVertical: number;
54
+ /**
55
+ * Mouth pout (-100 to 100), in increments of 5
56
+ */
57
+ mouthPout: number;
58
+ /**
59
+ * Mouth purse (-100 to 100), in increments of 5
60
+ */
61
+ mouthPurse: number;
62
+ /**
63
+ * Mouth smile (-100 to 100), in increments of 5
64
+ */
65
+ mouthSmile: number;
66
+ };
67
+ /**
68
+ * @internal
69
+ * V1AiFaceEditorCreateBodyStyle without any key transformation, this is what
70
+ * we expect to come in as network data
71
+ */
72
+ export type External$V1AiFaceEditorCreateBodyStyle = {
73
+ enhance_face: boolean;
74
+ eye_gaze_horizontal: number;
75
+ eye_gaze_vertical: number;
76
+ eye_open_ratio: number;
77
+ eyebrow_direction: number;
78
+ head_pitch: number;
79
+ head_roll: number;
80
+ head_yaw: number;
81
+ lip_open_ratio: number;
82
+ mouth_grim: number;
83
+ mouth_position_horizontal: number;
84
+ mouth_position_vertical: number;
85
+ mouth_pout: number;
86
+ mouth_purse: number;
87
+ mouth_smile: number;
88
+ };
89
+ export declare const Schemas$V1AiFaceEditorCreateBodyStyle: {
90
+ in: z.ZodType<V1AiFaceEditorCreateBodyStyle, z.ZodTypeDef, unknown>;
91
+ out: z.ZodType<External$V1AiFaceEditorCreateBodyStyle, z.ZodTypeDef, V1AiFaceEditorCreateBodyStyle>;
92
+ };
@@ -0,0 +1,123 @@
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$V1AiFaceEditorCreateBodyStyle = 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 V1AiFaceEditorCreateBodyStyle
41
+ */
42
+ const SchemaIn$V1AiFaceEditorCreateBodyStyle = z
43
+ .object({
44
+ enhance_face: z.boolean(),
45
+ eye_gaze_horizontal: z.number(),
46
+ eye_gaze_vertical: z.number(),
47
+ eye_open_ratio: z.number(),
48
+ eyebrow_direction: z.number(),
49
+ head_pitch: z.number(),
50
+ head_roll: z.number(),
51
+ head_yaw: z.number(),
52
+ lip_open_ratio: z.number(),
53
+ mouth_grim: z.number(),
54
+ mouth_position_horizontal: z.number(),
55
+ mouth_position_vertical: z.number(),
56
+ mouth_pout: z.number(),
57
+ mouth_purse: z.number(),
58
+ mouth_smile: z.number(),
59
+ })
60
+ .transform((obj) => {
61
+ return (0, core_1.zodTransform)(obj, {
62
+ enhance_face: "enhanceFace",
63
+ eye_gaze_horizontal: "eyeGazeHorizontal",
64
+ eye_gaze_vertical: "eyeGazeVertical",
65
+ eye_open_ratio: "eyeOpenRatio",
66
+ eyebrow_direction: "eyebrowDirection",
67
+ head_pitch: "headPitch",
68
+ head_roll: "headRoll",
69
+ head_yaw: "headYaw",
70
+ lip_open_ratio: "lipOpenRatio",
71
+ mouth_grim: "mouthGrim",
72
+ mouth_position_horizontal: "mouthPositionHorizontal",
73
+ mouth_position_vertical: "mouthPositionVertical",
74
+ mouth_pout: "mouthPout",
75
+ mouth_purse: "mouthPurse",
76
+ mouth_smile: "mouthSmile",
77
+ });
78
+ });
79
+ /**
80
+ * @internal
81
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AiFaceEditorCreateBodyStyle
82
+ */
83
+ const SchemaOut$V1AiFaceEditorCreateBodyStyle = z
84
+ .object({
85
+ enhanceFace: z.boolean(),
86
+ eyeGazeHorizontal: z.number(),
87
+ eyeGazeVertical: z.number(),
88
+ eyeOpenRatio: z.number(),
89
+ eyebrowDirection: z.number(),
90
+ headPitch: z.number(),
91
+ headRoll: z.number(),
92
+ headYaw: z.number(),
93
+ lipOpenRatio: z.number(),
94
+ mouthGrim: z.number(),
95
+ mouthPositionHorizontal: z.number(),
96
+ mouthPositionVertical: z.number(),
97
+ mouthPout: z.number(),
98
+ mouthPurse: z.number(),
99
+ mouthSmile: z.number(),
100
+ })
101
+ .transform((obj) => {
102
+ return (0, core_1.zodTransform)(obj, {
103
+ enhanceFace: "enhance_face",
104
+ eyeGazeHorizontal: "eye_gaze_horizontal",
105
+ eyeGazeVertical: "eye_gaze_vertical",
106
+ eyeOpenRatio: "eye_open_ratio",
107
+ eyebrowDirection: "eyebrow_direction",
108
+ headPitch: "head_pitch",
109
+ headRoll: "head_roll",
110
+ headYaw: "head_yaw",
111
+ lipOpenRatio: "lip_open_ratio",
112
+ mouthGrim: "mouth_grim",
113
+ mouthPositionHorizontal: "mouth_position_horizontal",
114
+ mouthPositionVertical: "mouth_position_vertical",
115
+ mouthPout: "mouth_pout",
116
+ mouthPurse: "mouth_purse",
117
+ mouthSmile: "mouth_smile",
118
+ });
119
+ });
120
+ exports.Schemas$V1AiFaceEditorCreateBodyStyle = {
121
+ in: SchemaIn$V1AiFaceEditorCreateBodyStyle,
122
+ out: SchemaOut$V1AiFaceEditorCreateBodyStyle,
123
+ };