From 42010b064751f2e12f6b9c678b2087c856e8430c Mon Sep 17 00:00:00 2001 From: "sdk-github-actions[bot]" Date: Wed, 15 Jul 2026 18:25:27 +0000 Subject: [PATCH] chore(release): auto --- .sdk.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/environment.ts | 2 +- src/resources/v1/ai-image-upscaler/README.md | 11 +++++------ .../v1/ai-image-upscaler/request-types.ts | 10 +++++----- .../v1/ai-image-upscaler/resource-client.ts | 2 +- src/resources/v1/body-swap/README.md | 2 +- src/resources/v1/files/upload-urls/README.md | 4 ++-- .../v1/files/upload-urls/resource-client.ts | 4 ++-- ...scaler-create-body-style-enhancement-enum.ts | 2 +- ...mage-upscaler-create-body-style-mode-enum.ts | 8 ++++++-- .../v1-ai-image-upscaler-create-body-style.ts | 17 ++++++++++------- src/types/v1-ai-image-upscaler-create-body.ts | 10 +++++----- src/types/v1-body-swap-create-body-assets.ts | 2 +- ...-files-upload-urls-create-body-items-item.ts | 2 +- test/v1-ai-image-upscaler.test.ts | 4 ++-- 17 files changed, 47 insertions(+), 41 deletions(-) diff --git a/.sdk.json b/.sdk.json index 84ea281e..6a699119 100644 --- a/.sdk.json +++ b/.sdk.json @@ -1,5 +1,5 @@ { - "id": "08f97eb1-af23-4f39-876f-bf2890f073a6", + "id": "08756a67-c9aa-401d-9e38-feee98a19df4", "tracked_paths": [ { "editable": true, diff --git a/package-lock.json b/package-lock.json index f8011ce2..e809444b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "magic-hour", - "version": "0.66.0", + "version": "0.67.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "magic-hour", - "version": "0.66.0", + "version": "0.67.0", "license": "MIT", "dependencies": { "make-api-request-js": "^0.2.1", diff --git a/package.json b/package.json index 1fd870b7..7ff4e592 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magic-hour", - "version": "0.66.0", + "version": "0.67.0", "main": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { diff --git a/src/environment.ts b/src/environment.ts index 9ab7e434..e7419bb6 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -1,4 +1,4 @@ export enum Environment { Environment = "https://api.magichour.ai", - MockServer = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.67.0", + MockServer = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.68.0", } diff --git a/src/resources/v1/ai-image-upscaler/README.md b/src/resources/v1/ai-image-upscaler/README.md index 8e05f88c..9ef91ba1 100644 --- a/src/resources/v1/ai-image-upscaler/README.md +++ b/src/resources/v1/ai-image-upscaler/README.md @@ -49,7 +49,7 @@ const res = await client.v1.aiImageUpscaler.generate( ### AI Image Upscaler -Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale costs 200 credits. +Upscale your image using AI. Each 2x upscale costs 50 credits for balanced/creative modes, and 25 credits for preserve. 4x upscale costs 200 and 100 credits respectively. **API Endpoint**: `POST /v1/ai-image-upscaler` @@ -60,11 +60,11 @@ Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale co | `assets` | ✓ | Provide the assets for upscaling | `{"imageFilePath": "api-assets/id/1234.png"}` | | `└─ imageFilePath` | ✓ | The image to upscale. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. . The maximum input image size is 4096x4096px. | `"api-assets/id/1234.png"` | | `scaleFactor` | ✓ | How much to scale the image. Must be either 2 or 4. Note: 4x upscale is only available on Creator, Pro, or Business tier. | `2.0` | -| `style` | ✓ | Style settings for the upscale. Use `mode` to select between `"pro"` (faster, no enhancement required) and `"creative"` (defaults to `"Balanced"` enhancement). Defaults to `"creative"`. | `{"mode": "creative"}` | -| `└─ enhancement` | ✗ | | `"Balanced"` | -| `└─ mode` | ✗ | The upscaling mode. `"pro"` is faster and does not require `enhancement`. `"creative"` requires `enhancement`. Defaults to `"creative"`. | `"creative"` | -| `└─ prompt` | ✗ | A prompt to guide the final image. This value is ignored if `enhancement` is not Creative | `"string"` | | `name` | ✗ | Give your image a custom name for easy identification. | `"My Image Upscaler image"` | +| `style` | ✗ | Style settings for the upscale. Use `mode` (`"preserve"`, `"balanced"`, or `"creative"`). Defaults to `"balanced"`. | `{"mode": "balanced"}` | +| `└─ enhancement` | ✗ | Deprecated: use `mode` instead. `"Resemblance"` maps to `"preserve"`. `"Balanced"` and `"Creative"` map to the same-named modes. | `"Balanced"` | +| `└─ mode` | ✗ | The upscaling mode. `"preserve"` uses the fast pro pipeline (1× credit multiplier). `"balanced"` and `"creative"` use the creative pipeline (2× credit multiplier). `"pro"` is deprecated and maps to `"preserve"`. Defaults to `"balanced"`. | `"balanced"` | +| `└─ prompt` | ✗ | A prompt to guide the final image. Only used when mode is `creative`. | `"string"` | #### Example Snippet @@ -76,7 +76,6 @@ const res = await client.v1.aiImageUpscaler.create({ assets: { imageFilePath: "api-assets/id/1234.png" }, name: "My Image Upscaler image", scaleFactor: 2.0, - style: { mode: "creative" }, }); ``` diff --git a/src/resources/v1/ai-image-upscaler/request-types.ts b/src/resources/v1/ai-image-upscaler/request-types.ts index fcdbc7f7..f3cd27ee 100644 --- a/src/resources/v1/ai-image-upscaler/request-types.ts +++ b/src/resources/v1/ai-image-upscaler/request-types.ts @@ -31,9 +31,9 @@ export type CreateRequest = { */ scaleFactor: number; /** - * Style settings for the upscale. Use `mode` to select between `"pro"` (faster, no enhancement required) and `"creative"` (defaults to `"Balanced"` enhancement). Defaults to `"creative"`. + * Style settings for the upscale. Use `mode` (`"preserve"`, `"balanced"`, or `"creative"`). Defaults to `"balanced"`. */ - style: V1AiImageUpscalerCreateBodyStyle; + style?: V1AiImageUpscalerCreateBodyStyle | undefined; }; /** @@ -45,7 +45,7 @@ export type External$CreateRequest = { assets: External$V1AiImageUpscalerCreateBodyAssets; name?: string | undefined; scale_factor: number; - style: External$V1AiImageUpscalerCreateBodyStyle; + style?: External$V1AiImageUpscalerCreateBodyStyle | undefined; }; /** @@ -60,7 +60,7 @@ const SchemaIn$CreateRequest: z.ZodType< assets: Schemas$V1AiImageUpscalerCreateBodyAssets.in, name: z.string().optional(), scale_factor: z.number(), - style: Schemas$V1AiImageUpscalerCreateBodyStyle.in, + style: Schemas$V1AiImageUpscalerCreateBodyStyle.in.optional(), }) .transform((obj) => { return zodTransform(obj, { @@ -84,7 +84,7 @@ const SchemaOut$CreateRequest: z.ZodType< assets: Schemas$V1AiImageUpscalerCreateBodyAssets.out, name: z.string().optional(), scaleFactor: z.number(), - style: Schemas$V1AiImageUpscalerCreateBodyStyle.out, + style: Schemas$V1AiImageUpscalerCreateBodyStyle.out.optional(), }) .transform((obj) => { return zodTransform(obj, { diff --git a/src/resources/v1/ai-image-upscaler/resource-client.ts b/src/resources/v1/ai-image-upscaler/resource-client.ts index 05f43a94..58e17847 100644 --- a/src/resources/v1/ai-image-upscaler/resource-client.ts +++ b/src/resources/v1/ai-image-upscaler/resource-client.ts @@ -124,7 +124,7 @@ export class AiImageUpscalerClient extends CoreResourceClient { /** * AI Image Upscaler * - * Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale costs 200 credits. + * Upscale your image using AI. Each 2x upscale costs 50 credits for balanced/creative modes, and 25 credits for preserve. 4x upscale costs 200 and 100 credits respectively. * * POST /v1/ai-image-upscaler */ diff --git a/src/resources/v1/body-swap/README.md b/src/resources/v1/body-swap/README.md index 929a4e5c..1e32ceca 100644 --- a/src/resources/v1/body-swap/README.md +++ b/src/resources/v1/body-swap/README.md @@ -61,7 +61,7 @@ Swap a person into a scene image using Nano Banana 2. Credits depend on `resolut | ------------------- | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | `assets` | ✓ | Person image and scene image for body swap | `{"personFilePath": "api-assets/id/1234.png", "sceneFilePath": "api-assets/id/5678.png"}` | | `└─ personFilePath` | ✓ | Image of the person to place into the scene. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/1234.png"` | -| `└─ sceneFilePath` | ✓ | Target scene image (background). This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/5678.png"` | +| `└─ sceneFilePath` | ✓ | Original scene image (background). This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/5678.png"` | | `resolution` | ✓ | Output resolution. Determines credits charged for the run. | `"1k"` | | `name` | ✗ | Give your image a custom name for easy identification. | `"My Body Swap image"` | diff --git a/src/resources/v1/files/upload-urls/README.md b/src/resources/v1/files/upload-urls/README.md index 3703e1eb..8f1b422b 100644 --- a/src/resources/v1/files/upload-urls/README.md +++ b/src/resources/v1/files/upload-urls/README.md @@ -11,8 +11,8 @@ The response array will match the order of items in the request body. **Valid file extensions per asset type**: - video: mp4, m4v, mov, webm -- audio: mp3, wav, aac, flac, webm, m4a, opus, ogg, aiff, amr -- image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, bmp +- audio: mp3, wav, aac, flac, webm, weba, m4a, opus, ogg, oga, aiff, amr +- image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, tif, bmp - gif: gif, webp, webm > Note: `gif` is only supported for face swap API `video_file_path` field. diff --git a/src/resources/v1/files/upload-urls/resource-client.ts b/src/resources/v1/files/upload-urls/resource-client.ts index 9cdec069..550d0d37 100644 --- a/src/resources/v1/files/upload-urls/resource-client.ts +++ b/src/resources/v1/files/upload-urls/resource-client.ts @@ -25,8 +25,8 @@ export class UploadUrlsClient extends CoreResourceClient { * * **Valid file extensions per asset type**: * - video: mp4, m4v, mov, webm - * - audio: mp3, wav, aac, flac, webm, m4a, opus, ogg, aiff, amr - * - image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, bmp + * - audio: mp3, wav, aac, flac, webm, weba, m4a, opus, ogg, oga, aiff, amr + * - image: png, jpg, jpeg, jfif, heic, heif, webp, avif, jp2, tiff, tif, bmp * - gif: gif, webp, webm * * > Note: `gif` is only supported for face swap API `video_file_path` field. diff --git a/src/types/v1-ai-image-upscaler-create-body-style-enhancement-enum.ts b/src/types/v1-ai-image-upscaler-create-body-style-enhancement-enum.ts index bd36d069..4b1934fb 100644 --- a/src/types/v1-ai-image-upscaler-create-body-style-enhancement-enum.ts +++ b/src/types/v1-ai-image-upscaler-create-body-style-enhancement-enum.ts @@ -1,5 +1,5 @@ /** - * V1AiImageUpscalerCreateBodyStyleEnhancementEnum + * Deprecated: use `mode` instead. `"Resemblance"` maps to `"preserve"`. `"Balanced"` and `"Creative"` map to the same-named modes. */ export type V1AiImageUpscalerCreateBodyStyleEnhancementEnum = | "Balanced" diff --git a/src/types/v1-ai-image-upscaler-create-body-style-mode-enum.ts b/src/types/v1-ai-image-upscaler-create-body-style-mode-enum.ts index 7ba2ade3..19dcd7f8 100644 --- a/src/types/v1-ai-image-upscaler-create-body-style-mode-enum.ts +++ b/src/types/v1-ai-image-upscaler-create-body-style-mode-enum.ts @@ -1,4 +1,8 @@ /** - * The upscaling mode. `"pro"` is faster and does not require `enhancement`. `"creative"` requires `enhancement`. Defaults to `"creative"`. + * The upscaling mode. `"preserve"` uses the fast pro pipeline (1× credit multiplier). `"balanced"` and `"creative"` use the creative pipeline (2× credit multiplier). `"pro"` is deprecated and maps to `"preserve"`. Defaults to `"balanced"`. */ -export type V1AiImageUpscalerCreateBodyStyleModeEnum = "creative" | "pro"; +export type V1AiImageUpscalerCreateBodyStyleModeEnum = + | "balanced" + | "creative" + | "preserve" + | "pro"; diff --git a/src/types/v1-ai-image-upscaler-create-body-style.ts b/src/types/v1-ai-image-upscaler-create-body-style.ts index b7026af7..b52bb980 100644 --- a/src/types/v1-ai-image-upscaler-create-body-style.ts +++ b/src/types/v1-ai-image-upscaler-create-body-style.ts @@ -2,16 +2,19 @@ import { zodTransform } from "make-api-request-js"; import * as z from "zod"; /** - * Style settings for the upscale. Use `mode` to select between `"pro"` (faster, no enhancement required) and `"creative"` (defaults to `"Balanced"` enhancement). Defaults to `"creative"`. + * Style settings for the upscale. Use `mode` (`"preserve"`, `"balanced"`, or `"creative"`). Defaults to `"balanced"`. */ export type V1AiImageUpscalerCreateBodyStyle = { + /** + * Deprecated: use `mode` instead. `"Resemblance"` maps to `"preserve"`. `"Balanced"` and `"Creative"` map to the same-named modes. + */ enhancement?: ("Balanced" | "Creative" | "Resemblance") | undefined; /** - * The upscaling mode. `"pro"` is faster and does not require `enhancement`. `"creative"` requires `enhancement`. Defaults to `"creative"`. + * The upscaling mode. `"preserve"` uses the fast pro pipeline (1× credit multiplier). `"balanced"` and `"creative"` use the creative pipeline (2× credit multiplier). `"pro"` is deprecated and maps to `"preserve"`. Defaults to `"balanced"`. */ - mode?: ("creative" | "pro") | undefined; + mode?: ("balanced" | "creative" | "preserve" | "pro") | undefined; /** - * A prompt to guide the final image. This value is ignored if `enhancement` is not Creative + * A prompt to guide the final image. Only used when mode is `creative`. */ prompt?: string | undefined; }; @@ -23,7 +26,7 @@ export type V1AiImageUpscalerCreateBodyStyle = { */ export type External$V1AiImageUpscalerCreateBodyStyle = { enhancement?: ("Balanced" | "Creative" | "Resemblance") | undefined; - mode?: ("creative" | "pro") | undefined; + mode?: ("balanced" | "creative" | "preserve" | "pro") | undefined; prompt?: string | undefined; }; @@ -37,7 +40,7 @@ const SchemaIn$V1AiImageUpscalerCreateBodyStyle: z.ZodType< > = z .object({ enhancement: z.enum(["Balanced", "Creative", "Resemblance"]).optional(), - mode: z.enum(["creative", "pro"]).optional(), + mode: z.enum(["balanced", "creative", "preserve", "pro"]).optional(), prompt: z.string().optional(), }) .transform((obj) => { @@ -59,7 +62,7 @@ const SchemaOut$V1AiImageUpscalerCreateBodyStyle: z.ZodType< > = z .object({ enhancement: z.enum(["Balanced", "Creative", "Resemblance"]).optional(), - mode: z.enum(["creative", "pro"]).optional(), + mode: z.enum(["balanced", "creative", "preserve", "pro"]).optional(), prompt: z.string().optional(), }) .transform((obj) => { diff --git a/src/types/v1-ai-image-upscaler-create-body.ts b/src/types/v1-ai-image-upscaler-create-body.ts index f288dfcc..67edd953 100644 --- a/src/types/v1-ai-image-upscaler-create-body.ts +++ b/src/types/v1-ai-image-upscaler-create-body.ts @@ -31,9 +31,9 @@ export type V1AiImageUpscalerCreateBody = { */ scaleFactor: number; /** - * Style settings for the upscale. Use `mode` to select between `"pro"` (faster, no enhancement required) and `"creative"` (defaults to `"Balanced"` enhancement). Defaults to `"creative"`. + * Style settings for the upscale. Use `mode` (`"preserve"`, `"balanced"`, or `"creative"`). Defaults to `"balanced"`. */ - style: V1AiImageUpscalerCreateBodyStyle; + style?: V1AiImageUpscalerCreateBodyStyle | undefined; }; /** @@ -45,7 +45,7 @@ export type External$V1AiImageUpscalerCreateBody = { assets: External$V1AiImageUpscalerCreateBodyAssets; name?: string | undefined; scale_factor: number; - style: External$V1AiImageUpscalerCreateBodyStyle; + style?: External$V1AiImageUpscalerCreateBodyStyle | undefined; }; /** @@ -60,7 +60,7 @@ const SchemaIn$V1AiImageUpscalerCreateBody: z.ZodType< assets: Schemas$V1AiImageUpscalerCreateBodyAssets.in, name: z.string().optional(), scale_factor: z.number(), - style: Schemas$V1AiImageUpscalerCreateBodyStyle.in, + style: Schemas$V1AiImageUpscalerCreateBodyStyle.in.optional(), }) .transform((obj) => { return zodTransform(obj, { @@ -84,7 +84,7 @@ const SchemaOut$V1AiImageUpscalerCreateBody: z.ZodType< assets: Schemas$V1AiImageUpscalerCreateBodyAssets.out, name: z.string().optional(), scaleFactor: z.number(), - style: Schemas$V1AiImageUpscalerCreateBodyStyle.out, + style: Schemas$V1AiImageUpscalerCreateBodyStyle.out.optional(), }) .transform((obj) => { return zodTransform(obj, { diff --git a/src/types/v1-body-swap-create-body-assets.ts b/src/types/v1-body-swap-create-body-assets.ts index 436814c4..ed3e80ee 100644 --- a/src/types/v1-body-swap-create-body-assets.ts +++ b/src/types/v1-body-swap-create-body-assets.ts @@ -15,7 +15,7 @@ export type V1BodySwapCreateBodyAssets = { */ personFilePath: string; /** - * Target scene image (background). This value is either + * Original scene image (background). This value is either * - a direct URL to the video file * - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). * diff --git a/src/types/v1-files-upload-urls-create-body-items-item.ts b/src/types/v1-files-upload-urls-create-body-items-item.ts index ed72fc07..773cb9c9 100644 --- a/src/types/v1-files-upload-urls-create-body-items-item.ts +++ b/src/types/v1-files-upload-urls-create-body-items-item.ts @@ -6,7 +6,7 @@ import * as z from "zod"; */ export type V1FilesUploadUrlsCreateBodyItemsItem = { /** - * The extension of the file to upload. Do not include the dot (.) before the extension. Possible extensions are mp4,m4v,mov,webm,mp3,wav,aac,flac,webm,m4a,opus,ogg,aiff,amr,png,jpg,jpeg,jfif,heic,heif,webp,avif,jp2,tiff,bmp,gif,webp,webm + * The extension of the file to upload. Do not include the dot (.) before the extension. Possible extensions are mp4,m4v,mov,webm,mp3,wav,aac,flac,webm,weba,m4a,opus,ogg,oga,aiff,amr,png,jpg,jpeg,jfif,heic,heif,webp,avif,jp2,tiff,tif,bmp,gif,webp,webm */ extension: string; /** diff --git a/test/v1-ai-image-upscaler.test.ts b/test/v1-ai-image-upscaler.test.ts index f5f33314..4abc8f17 100644 --- a/test/v1-ai-image-upscaler.test.ts +++ b/test/v1-ai-image-upscaler.test.ts @@ -17,7 +17,7 @@ describe("tests client.v1.aiImageUpscaler.create", () => { scaleFactor: 2.0, style: { enhancement: "Balanced", - mode: "creative", + mode: "balanced", prompt: "string", }, }) @@ -28,7 +28,7 @@ describe("tests client.v1.aiImageUpscaler.create", () => { scaleFactor: 2.0, style: { enhancement: "Balanced", - mode: "creative", + mode: "balanced", prompt: "string", }, }),