magic-hour 0.1.0 → 0.2.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 (35) hide show
  1. package/README.md +4 -0
  2. package/dist/resources/v1/ai-photo-editor/index.d.ts +5 -0
  3. package/dist/resources/v1/ai-photo-editor/index.js +8 -0
  4. package/dist/resources/v1/ai-photo-editor/request-types.d.ts +10 -0
  5. package/dist/resources/v1/ai-photo-editor/request-types.js +5 -0
  6. package/dist/resources/v1/ai-photo-editor/resource-client.d.ts +17 -0
  7. package/dist/resources/v1/ai-photo-editor/resource-client.js +31 -0
  8. package/dist/resources/v1/index.d.ts +1 -0
  9. package/dist/resources/v1/index.js +2 -1
  10. package/dist/resources/v1/resource-client.d.ts +2 -0
  11. package/dist/resources/v1/resource-client.js +2 -0
  12. package/dist/types/get-v1-image-projects-id-response-type-enum.d.ts +1 -1
  13. package/dist/types/index.d.ts +10 -0
  14. package/dist/types/post-v1-ai-photo-editor-body-assets.d.ts +12 -0
  15. package/dist/types/post-v1-ai-photo-editor-body-assets.js +5 -0
  16. package/dist/types/post-v1-ai-photo-editor-body-style.d.ts +28 -0
  17. package/dist/types/post-v1-ai-photo-editor-body-style.js +5 -0
  18. package/dist/types/post-v1-ai-photo-editor-body.d.ts +26 -0
  19. package/dist/types/post-v1-ai-photo-editor-body.js +5 -0
  20. package/dist/types/post-v1-ai-photo-editor-response.d.ts +13 -0
  21. package/dist/types/post-v1-ai-photo-editor-response.js +5 -0
  22. package/dist/types/post-v1-ai-photo-editor-response400.d.ts +9 -0
  23. package/dist/types/post-v1-ai-photo-editor-response400.js +5 -0
  24. package/dist/types/post-v1-ai-photo-editor-response401-message-enum.d.ts +4 -0
  25. package/dist/types/post-v1-ai-photo-editor-response401-message-enum.js +2 -0
  26. package/dist/types/post-v1-ai-photo-editor-response401.d.ts +10 -0
  27. package/dist/types/post-v1-ai-photo-editor-response401.js +5 -0
  28. package/dist/types/post-v1-ai-photo-editor-response404-message-enum.d.ts +4 -0
  29. package/dist/types/post-v1-ai-photo-editor-response404-message-enum.js +2 -0
  30. package/dist/types/post-v1-ai-photo-editor-response404.d.ts +10 -0
  31. package/dist/types/post-v1-ai-photo-editor-response404.js +5 -0
  32. package/dist/types/post-v1-ai-photo-editor-response422.d.ts +9 -0
  33. package/dist/types/post-v1-ai-photo-editor-response422.js +5 -0
  34. package/dist/types/post-v1-files-upload-urls-response-items-item.d.ts +9 -0
  35. package/package.json +1 -1
package/README.md CHANGED
@@ -48,6 +48,10 @@ const client = new Client({ token: process.env["API_TOKEN"]!! });
48
48
 
49
49
  * [create](src/resources/v1/ai-image-upscaler/README.md#create) - Create Upscaled Image
50
50
 
51
+ ### [v1.ai_photo_editor](src/resources/v1/ai-photo-editor/README.md)
52
+
53
+ * [create](src/resources/v1/ai-photo-editor/README.md#create) - AI Photo Editor
54
+
51
55
  ### [v1.ai_qr_code_generator](src/resources/v1/ai-qr-code-generator/README.md)
52
56
 
53
57
  * [create](src/resources/v1/ai-qr-code-generator/README.md#create) - Create AI QR Code
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ export { CreateRequest } from "./request-types";
5
+ export { AiPhotoEditorClient } from "./resource-client";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AiPhotoEditorClient = void 0;
7
+ var resource_client_1 = require("./resource-client");
8
+ Object.defineProperty(exports, "AiPhotoEditorClient", { enumerable: true, get: function () { return resource_client_1.AiPhotoEditorClient; } });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ import { types } from "../../../index.js";
5
+ /**
6
+ * CreateRequest
7
+ */
8
+ export declare type CreateRequest = {
9
+ data: types.PostV1AiPhotoEditorBody;
10
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ import { types } from "../../../index.js";
5
+ import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions } from "../../../core";
6
+ import * as requests from "../../../resources/v1/ai-photo-editor/request-types";
7
+ export declare class AiPhotoEditorClient extends CoreResourceClient {
8
+ constructor(client: CoreClient);
9
+ /**
10
+ * > **NOTE**: this API is still in early development stages, and should be avoided. Please reach out to us if you're interested in this API.
11
+ *
12
+ * Edit photo using AI. Each photo costs 10 frames.
13
+ *
14
+ * POST /v1/ai-photo-editor
15
+ */
16
+ create(request: requests.CreateRequest, opts?: RequestOptions): ApiPromise<types.PostV1AiPhotoEditorResponse>;
17
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AiPhotoEditorClient = void 0;
7
+ const core_1 = require("../../../core");
8
+ class AiPhotoEditorClient extends core_1.CoreResourceClient {
9
+ constructor(client) {
10
+ super(client);
11
+ }
12
+ /**
13
+ * > **NOTE**: this API is still in early development stages, and should be avoided. Please reach out to us if you're interested in this API.
14
+ *
15
+ * Edit photo using AI. Each photo costs 10 frames.
16
+ *
17
+ * POST /v1/ai-photo-editor
18
+ */
19
+ create(request, opts) {
20
+ return this._client.makeRequest({
21
+ method: "post",
22
+ path: "/v1/ai-photo-editor",
23
+ auth: ["bearerAuth"],
24
+ contentType: "application/json",
25
+ body: request.data,
26
+ responseType: "json",
27
+ opts,
28
+ });
29
+ }
30
+ }
31
+ exports.AiPhotoEditorClient = AiPhotoEditorClient;
@@ -4,6 +4,7 @@
4
4
  export * as aiHeadshotGenerator from "./ai-headshot-generator";
5
5
  export * as aiImageGenerator from "./ai-image-generator";
6
6
  export * as aiImageUpscaler from "./ai-image-upscaler";
7
+ export * as aiPhotoEditor from "./ai-photo-editor";
7
8
  export * as aiQrCodeGenerator from "./ai-qr-code-generator";
8
9
  export * as faceSwap from "./face-swap";
9
10
  export * as faceSwapPhoto from "./face-swap-photo";
@@ -26,10 +26,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  return result;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.videoToVideo = exports.videoProjects = exports.textToVideo = exports.V1Client = exports.lipSync = exports.imageToVideo = exports.imageProjects = exports.files = exports.faceSwapPhoto = exports.faceSwap = exports.aiQrCodeGenerator = exports.aiImageUpscaler = exports.aiImageGenerator = exports.aiHeadshotGenerator = void 0;
29
+ exports.videoToVideo = exports.videoProjects = exports.textToVideo = exports.V1Client = exports.lipSync = exports.imageToVideo = exports.imageProjects = exports.files = exports.faceSwapPhoto = exports.faceSwap = exports.aiQrCodeGenerator = exports.aiPhotoEditor = exports.aiImageUpscaler = exports.aiImageGenerator = exports.aiHeadshotGenerator = void 0;
30
30
  exports.aiHeadshotGenerator = __importStar(require("./ai-headshot-generator"));
31
31
  exports.aiImageGenerator = __importStar(require("./ai-image-generator"));
32
32
  exports.aiImageUpscaler = __importStar(require("./ai-image-upscaler"));
33
+ exports.aiPhotoEditor = __importStar(require("./ai-photo-editor"));
33
34
  exports.aiQrCodeGenerator = __importStar(require("./ai-qr-code-generator"));
34
35
  exports.faceSwap = __importStar(require("./face-swap"));
35
36
  exports.faceSwapPhoto = __importStar(require("./face-swap-photo"));
@@ -5,6 +5,7 @@ import { CoreClient, CoreResourceClient } from "../../core";
5
5
  import { AiHeadshotGeneratorClient } from "../../resources/v1/ai-headshot-generator";
6
6
  import { AiImageGeneratorClient } from "../../resources/v1/ai-image-generator";
7
7
  import { AiImageUpscalerClient } from "../../resources/v1/ai-image-upscaler";
8
+ import { AiPhotoEditorClient } from "../../resources/v1/ai-photo-editor";
8
9
  import { AiQrCodeGeneratorClient } from "../../resources/v1/ai-qr-code-generator";
9
10
  import { FaceSwapClient } from "../../resources/v1/face-swap";
10
11
  import { FaceSwapPhotoClient } from "../../resources/v1/face-swap-photo";
@@ -21,6 +22,7 @@ export declare class V1Client extends CoreResourceClient {
21
22
  aiHeadshotGenerator: AiHeadshotGeneratorClient;
22
23
  aiImageGenerator: AiImageGeneratorClient;
23
24
  aiImageUpscaler: AiImageUpscalerClient;
25
+ aiPhotoEditor: AiPhotoEditorClient;
24
26
  aiQrCodeGenerator: AiQrCodeGeneratorClient;
25
27
  faceSwap: FaceSwapClient;
26
28
  faceSwapPhoto: FaceSwapPhotoClient;
@@ -8,6 +8,7 @@ const core_1 = require("../../core");
8
8
  const ai_headshot_generator_1 = require("../../resources/v1/ai-headshot-generator");
9
9
  const ai_image_generator_1 = require("../../resources/v1/ai-image-generator");
10
10
  const ai_image_upscaler_1 = require("../../resources/v1/ai-image-upscaler");
11
+ const ai_photo_editor_1 = require("../../resources/v1/ai-photo-editor");
11
12
  const ai_qr_code_generator_1 = require("../../resources/v1/ai-qr-code-generator");
12
13
  const face_swap_1 = require("../../resources/v1/face-swap");
13
14
  const face_swap_photo_1 = require("../../resources/v1/face-swap-photo");
@@ -26,6 +27,7 @@ class V1Client extends core_1.CoreResourceClient {
26
27
  this.aiHeadshotGenerator = new ai_headshot_generator_1.AiHeadshotGeneratorClient(this._client);
27
28
  this.aiImageGenerator = new ai_image_generator_1.AiImageGeneratorClient(this._client);
28
29
  this.aiImageUpscaler = new ai_image_upscaler_1.AiImageUpscalerClient(this._client);
30
+ this.aiPhotoEditor = new ai_photo_editor_1.AiPhotoEditorClient(this._client);
29
31
  this.aiQrCodeGenerator = new ai_qr_code_generator_1.AiQrCodeGeneratorClient(this._client);
30
32
  this.faceSwap = new face_swap_1.FaceSwapClient(this._client);
31
33
  this.faceSwapPhoto = new face_swap_photo_1.FaceSwapPhotoClient(this._client);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Generated by Sideko (sideko.dev)
3
3
  **/
4
- export declare type GetV1ImageProjectsIdResponseTypeEnum = "AI_HEADSHOT" | "AI_IMAGE" | "FACE_SWAP" | "IMAGE_UPSCALER" | "QR_CODE";
4
+ export declare type GetV1ImageProjectsIdResponseTypeEnum = "AI_HEADSHOT" | "AI_IMAGE" | "FACE_SWAP" | "IMAGE_UPSCALER" | "PHOTO_EDITOR" | "QR_CODE";
@@ -49,6 +49,16 @@ export { PostV1AiImageUpscalerResponse401MessageEnum } from "./post-v1-ai-image-
49
49
  export { PostV1AiImageUpscalerResponse404 } from "./post-v1-ai-image-upscaler-response404";
50
50
  export { PostV1AiImageUpscalerResponse404MessageEnum } from "./post-v1-ai-image-upscaler-response404-message-enum";
51
51
  export { PostV1AiImageUpscalerResponse422 } from "./post-v1-ai-image-upscaler-response422";
52
+ export { PostV1AiPhotoEditorBody } from "./post-v1-ai-photo-editor-body";
53
+ export { PostV1AiPhotoEditorBodyAssets } from "./post-v1-ai-photo-editor-body-assets";
54
+ export { PostV1AiPhotoEditorBodyStyle } from "./post-v1-ai-photo-editor-body-style";
55
+ export { PostV1AiPhotoEditorResponse } from "./post-v1-ai-photo-editor-response";
56
+ export { PostV1AiPhotoEditorResponse400 } from "./post-v1-ai-photo-editor-response400";
57
+ export { PostV1AiPhotoEditorResponse401 } from "./post-v1-ai-photo-editor-response401";
58
+ export { PostV1AiPhotoEditorResponse401MessageEnum } from "./post-v1-ai-photo-editor-response401-message-enum";
59
+ export { PostV1AiPhotoEditorResponse404 } from "./post-v1-ai-photo-editor-response404";
60
+ export { PostV1AiPhotoEditorResponse404MessageEnum } from "./post-v1-ai-photo-editor-response404-message-enum";
61
+ export { PostV1AiPhotoEditorResponse422 } from "./post-v1-ai-photo-editor-response422";
52
62
  export { PostV1AiQrCodeGeneratorBody } from "./post-v1-ai-qr-code-generator-body";
53
63
  export { PostV1AiQrCodeGeneratorBodyStyle } from "./post-v1-ai-qr-code-generator-body-style";
54
64
  export { PostV1AiQrCodeGeneratorResponse } from "./post-v1-ai-qr-code-generator-response";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ /**
5
+ * Provide the assets for photo editor
6
+ */
7
+ export declare type PostV1AiPhotoEditorBodyAssets = {
8
+ /**
9
+ * The image used to generate the output. This is the `file_path` field from the response of the [upload urls API](/docs/api/tag/files/post/v1/files/upload-urls)
10
+ */
11
+ image_file_path: string;
12
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ /**
5
+ * PostV1AiPhotoEditorBodyStyle
6
+ */
7
+ export declare type PostV1AiPhotoEditorBodyStyle = {
8
+ /**
9
+ * Use this to describe what your input image is. This helps maintain aspects of the image you don't want to change.
10
+ */
11
+ image_description: string;
12
+ /**
13
+ * Determines the input image's influence. Higher values align the output more with the initial image.
14
+ */
15
+ likeness_strength: number;
16
+ /**
17
+ * What you want to avoid seeing in the final output; has a minor effect.
18
+ */
19
+ negative_prompt?: string;
20
+ /**
21
+ * What you want your final output to look like. We recommend starting with the image description and making minor edits for best results.
22
+ */
23
+ prompt: string;
24
+ /**
25
+ * Determines the prompt's influence. Higher values align the output more with the prompt.
26
+ */
27
+ prompt_strength: number;
28
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ import { types } from "../index.js";
5
+ /**
6
+ * PostV1AiPhotoEditorBody
7
+ */
8
+ export declare type PostV1AiPhotoEditorBody = {
9
+ /**
10
+ * Provide the assets for photo editor
11
+ */
12
+ assets: types.PostV1AiPhotoEditorBodyAssets;
13
+ /**
14
+ * The name of image
15
+ */
16
+ name?: string;
17
+ /**
18
+ * The resolution of the final output image. The allowed value is based on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
19
+ */
20
+ resolution: number;
21
+ /**
22
+ * Number of iterations used to generate the output. Higher values improve quality and increase the strength of the prompt but increase processing time.
23
+ */
24
+ steps: number;
25
+ style: types.PostV1AiPhotoEditorBodyStyle;
26
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ /**
5
+ * Success
6
+ */
7
+ export declare type PostV1AiPhotoEditorResponse = {
8
+ frame_cost: number;
9
+ /**
10
+ * Unique ID of the image. This value can be used in the [get image project API](/api/tag/image-projects/get/v1/image-projects/{id}) to fetch additional details such as status
11
+ */
12
+ id: string;
13
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ /**
5
+ * The request is invalid
6
+ */
7
+ export declare type PostV1AiPhotoEditorResponse400 = {
8
+ message: string;
9
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ export declare type PostV1AiPhotoEditorResponse401MessageEnum = "Unauthorized";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ import { types } from "../index.js";
5
+ /**
6
+ * The request is not properly authenticated
7
+ */
8
+ export declare type PostV1AiPhotoEditorResponse401 = {
9
+ message: types.PostV1AiPhotoEditorResponse401MessageEnum;
10
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ export declare type PostV1AiPhotoEditorResponse404MessageEnum = "Not Found";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ import { types } from "../index.js";
5
+ /**
6
+ * Requested resource is not found
7
+ */
8
+ export declare type PostV1AiPhotoEditorResponse404 = {
9
+ message: types.PostV1AiPhotoEditorResponse404MessageEnum;
10
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by Sideko (sideko.dev)
3
+ **/
4
+ /**
5
+ * Unprocessable Entity
6
+ */
7
+ export declare type PostV1AiPhotoEditorResponse422 = {
8
+ message: string;
9
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by Sideko (sideko.dev)
4
+ **/
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,7 +5,16 @@
5
5
  * PostV1FilesUploadUrlsResponseItemsItem
6
6
  */
7
7
  export declare type PostV1FilesUploadUrlsResponseItemsItem = {
8
+ /**
9
+ * when the upload url expires, and will need to request a new one.
10
+ */
8
11
  expires_at: string;
12
+ /**
13
+ * this value is used in APIs that needs assets, such as image_file_path, video_file_path, and audio_file_path
14
+ */
9
15
  file_path: string;
16
+ /**
17
+ * Used to upload the file to storage, send a PUT request with the file as data to upload.
18
+ */
10
19
  upload_url: string;
11
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-hour",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {