magic-hour 0.97.1 → 0.98.1
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.
- package/README.md +24 -0
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +1 -1
- package/dist/resources/v1/account/checkout/index.d.ts +2 -0
- package/dist/resources/v1/account/checkout/index.js +5 -0
- package/dist/resources/v1/account/checkout/request-types.d.ts +32 -0
- package/dist/resources/v1/account/checkout/request-types.js +75 -0
- package/dist/resources/v1/account/checkout/resource-client.d.ts +14 -0
- package/dist/resources/v1/account/checkout/resource-client.js +30 -0
- package/dist/resources/v1/account/index.d.ts +1 -0
- package/dist/resources/v1/account/index.js +35 -1
- package/dist/resources/v1/account/resource-client.d.ts +3 -0
- package/dist/resources/v1/account/resource-client.js +7 -0
- package/dist/resources/v1/ai-image-editor/request-types.d.ts +5 -0
- package/dist/resources/v1/ai-image-generator/request-types.d.ts +5 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/v1-account-checkout-create-body-type-enum.d.ts +4 -0
- package/dist/types/v1-account-checkout-create-body-type-enum.js +2 -0
- package/dist/types/v1-account-checkout-create-body.d.ts +32 -0
- package/dist/types/v1-account-checkout-create-body.js +75 -0
- package/dist/types/v1-account-checkout-create-response.d.ts +22 -0
- package/dist/types/v1-account-checkout-create-response.js +67 -0
- package/dist/types/v1-ai-image-editor-create-body-model-enum.d.ts +4 -0
- package/dist/types/v1-ai-image-editor-create-body-resolution-enum.d.ts +1 -0
- package/dist/types/v1-ai-image-editor-create-body.d.ts +5 -0
- package/dist/types/v1-ai-image-generator-create-body-model-enum.d.ts +4 -0
- package/dist/types/v1-ai-image-generator-create-body-resolution-enum.d.ts +1 -0
- package/dist/types/v1-ai-image-generator-create-body.d.ts +5 -0
- package/dist/types/v1-image-to-video-create-body-assets.d.ts +1 -1
- package/dist/types/v1-video-projects-get-response.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -200,6 +200,26 @@ try {
|
|
|
200
200
|
}
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
+
## Idempotent Requests
|
|
204
|
+
|
|
205
|
+
Project create endpoints accept an `Idempotency-Key` header, so you can safely retry a request without creating or paying for a second project. Repeating a key within 24 hours returns the original project. Keys are shared across your account, so use a new key, such as a UUID, for each project.
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
await client.v1.aiImageGenerator.create(
|
|
209
|
+
{ imageCount: 1, style: { prompt: "Cool image" } },
|
|
210
|
+
{ additionalHeaders: { "Idempotency-Key": "5f3c1b9e-8a41-4a0e-9d3e-2f6a1c7b9e10" } },
|
|
211
|
+
);
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
With `generate()`:
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
await client.v1.aiImageGenerator.generate(
|
|
218
|
+
{ imageCount: 1, style: { prompt: "Cool image" } },
|
|
219
|
+
{ additionalHeaders: { "Idempotency-Key": "5f3c1b9e-8a41-4a0e-9d3e-2f6a1c7b9e10" } },
|
|
220
|
+
);
|
|
221
|
+
```
|
|
222
|
+
|
|
203
223
|
## Logging
|
|
204
224
|
|
|
205
225
|
### Logging Levels
|
|
@@ -228,6 +248,10 @@ Valid values are: `none`, `error`, `warn`, `info`, `debug` (case insensitive). I
|
|
|
228
248
|
|
|
229
249
|
- [list](src/resources/v1/account/README.md#list) - Get account details
|
|
230
250
|
|
|
251
|
+
### [v1.account.checkout](src/resources/v1/account/checkout/README.md)
|
|
252
|
+
|
|
253
|
+
- [create](src/resources/v1/account/checkout/README.md#create) - Create checkout
|
|
254
|
+
|
|
231
255
|
### [v1.aiClothesChanger](src/resources/v1/ai-clothes-changer/README.md)
|
|
232
256
|
|
|
233
257
|
- [create](src/resources/v1/ai-clothes-changer/README.md#create) - AI Clothes Changer
|
package/dist/environment.d.ts
CHANGED
package/dist/environment.js
CHANGED
|
@@ -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.
|
|
7
|
+
Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.104.0";
|
|
8
8
|
})(Environment || (exports.Environment = Environment = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckoutClient = void 0;
|
|
4
|
+
var resource_client_1 = require("./resource-client");
|
|
5
|
+
Object.defineProperty(exports, "CheckoutClient", { enumerable: true, get: function () { return resource_client_1.CheckoutClient; } });
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* CreateRequest
|
|
4
|
+
*/
|
|
5
|
+
export type CreateRequest = {
|
|
6
|
+
/**
|
|
7
|
+
* Credits a blocked request is missing, e.g. `credit_shortfall` from a 402 response. The checkout starts with enough packs to cover it. Defaults to one pack.
|
|
8
|
+
*/
|
|
9
|
+
creditShortfall?: number | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Number of credit packs the checkout starts with. Takes priority over `credit_shortfall`.
|
|
12
|
+
*/
|
|
13
|
+
packCount?: number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* What to buy. `credit_pack` is a one-time credit purchase.
|
|
16
|
+
*/
|
|
17
|
+
type: "credit_pack";
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
* CreateRequest without any key transformation, this is what
|
|
22
|
+
* we expect to come in as network data
|
|
23
|
+
*/
|
|
24
|
+
export type External$CreateRequest = {
|
|
25
|
+
credit_shortfall?: number | undefined;
|
|
26
|
+
pack_count?: number | undefined;
|
|
27
|
+
type: "credit_pack";
|
|
28
|
+
};
|
|
29
|
+
export declare const Schemas$CreateRequest: {
|
|
30
|
+
in: z.ZodType<CreateRequest, z.ZodTypeDef, unknown>;
|
|
31
|
+
out: z.ZodType<External$CreateRequest, z.ZodTypeDef, CreateRequest>;
|
|
32
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Schemas$CreateRequest = void 0;
|
|
37
|
+
const make_api_request_js_1 = require("make-api-request-js");
|
|
38
|
+
const z = __importStar(require("zod"));
|
|
39
|
+
/**
|
|
40
|
+
* Takes network data, validates it, and transforms keys to match typescript object CreateRequest
|
|
41
|
+
*/
|
|
42
|
+
const SchemaIn$CreateRequest = z
|
|
43
|
+
.object({
|
|
44
|
+
credit_shortfall: z.number().optional(),
|
|
45
|
+
pack_count: z.number().int().optional(),
|
|
46
|
+
type: z.enum(["credit_pack"]),
|
|
47
|
+
})
|
|
48
|
+
.transform((obj) => {
|
|
49
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
50
|
+
credit_shortfall: "creditShortfall",
|
|
51
|
+
pack_count: "packCount",
|
|
52
|
+
type: "type",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
* Takes typescript data, validates it, and maps keys to match the expected external object External$CreateRequest
|
|
58
|
+
*/
|
|
59
|
+
const SchemaOut$CreateRequest = z
|
|
60
|
+
.object({
|
|
61
|
+
creditShortfall: z.number().optional(),
|
|
62
|
+
packCount: z.number().int().optional(),
|
|
63
|
+
type: z.enum(["credit_pack"]),
|
|
64
|
+
})
|
|
65
|
+
.transform((obj) => {
|
|
66
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
67
|
+
creditShortfall: "credit_shortfall",
|
|
68
|
+
packCount: "pack_count",
|
|
69
|
+
type: "type",
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
exports.Schemas$CreateRequest = {
|
|
73
|
+
in: SchemaIn$CreateRequest,
|
|
74
|
+
out: SchemaOut$CreateRequest,
|
|
75
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions, ResourceClientOptions } from "make-api-request-js";
|
|
2
|
+
import * as requests from "./request-types.js";
|
|
3
|
+
import * as types from "../../../../types/index.js";
|
|
4
|
+
export declare class CheckoutClient extends CoreResourceClient {
|
|
5
|
+
constructor(coreClient: CoreClient, opts: ResourceClientOptions);
|
|
6
|
+
/**
|
|
7
|
+
* Create checkout
|
|
8
|
+
*
|
|
9
|
+
* Create a Stripe Checkout link for the account that owns the API key. Nothing is charged until the checkout is completed in a browser.
|
|
10
|
+
*
|
|
11
|
+
* POST /v1/account/checkout
|
|
12
|
+
*/
|
|
13
|
+
create(request: requests.CreateRequest, opts?: RequestOptions): ApiPromise<types.V1AccountCheckoutCreateResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckoutClient = void 0;
|
|
4
|
+
const make_api_request_js_1 = require("make-api-request-js");
|
|
5
|
+
const v1_account_checkout_create_body_1 = require("../../../../types/v1-account-checkout-create-body.js");
|
|
6
|
+
const v1_account_checkout_create_response_1 = require("../../../../types/v1-account-checkout-create-response.js");
|
|
7
|
+
class CheckoutClient extends make_api_request_js_1.CoreResourceClient {
|
|
8
|
+
constructor(coreClient, opts) {
|
|
9
|
+
super(coreClient, opts);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create checkout
|
|
13
|
+
*
|
|
14
|
+
* Create a Stripe Checkout link for the account that owns the API key. Nothing is charged until the checkout is completed in a browser.
|
|
15
|
+
*
|
|
16
|
+
* POST /v1/account/checkout
|
|
17
|
+
*/
|
|
18
|
+
create(request, opts) {
|
|
19
|
+
return this._client.makeRequest({
|
|
20
|
+
method: "post",
|
|
21
|
+
path: "/v1/account/checkout",
|
|
22
|
+
auth: ["bearerAuth"],
|
|
23
|
+
contentType: "application/json",
|
|
24
|
+
body: v1_account_checkout_create_body_1.Schemas$V1AccountCheckoutCreateBody.out.parse(request),
|
|
25
|
+
responseSchema: v1_account_checkout_create_response_1.Schemas$V1AccountCheckoutCreateResponse.in,
|
|
26
|
+
opts,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.CheckoutClient = CheckoutClient;
|
|
@@ -1,5 +1,39 @@
|
|
|
1
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
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AccountClient = void 0;
|
|
36
|
+
exports.AccountClient = exports.checkout = void 0;
|
|
37
|
+
exports.checkout = __importStar(require("./checkout"));
|
|
4
38
|
var resource_client_1 = require("./resource-client");
|
|
5
39
|
Object.defineProperty(exports, "AccountClient", { enumerable: true, get: function () { return resource_client_1.AccountClient; } });
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions, ResourceClientOptions } from "make-api-request-js";
|
|
2
|
+
import { CheckoutClient } from "./checkout/index.js";
|
|
2
3
|
import * as types from "../../../types/index.js";
|
|
3
4
|
export declare class AccountClient extends CoreResourceClient {
|
|
5
|
+
private _checkoutLazy?;
|
|
4
6
|
constructor(coreClient: CoreClient, opts: ResourceClientOptions);
|
|
5
7
|
/**
|
|
6
8
|
* Get account details
|
|
@@ -10,4 +12,5 @@ export declare class AccountClient extends CoreResourceClient {
|
|
|
10
12
|
* GET /v1/account
|
|
11
13
|
*/
|
|
12
14
|
list(opts?: RequestOptions): ApiPromise<types.V1AccountListResponse>;
|
|
15
|
+
get checkout(): CheckoutClient;
|
|
13
16
|
}
|
|
@@ -6,6 +6,9 @@ const v1_account_list_response_1 = require("../../../types/v1-account-list-respo
|
|
|
6
6
|
class AccountClient extends make_api_request_js_1.CoreResourceClient {
|
|
7
7
|
constructor(coreClient, opts) {
|
|
8
8
|
super(coreClient, opts);
|
|
9
|
+
if (this._opts.lazyLoad === false) {
|
|
10
|
+
this.checkout;
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
/**
|
|
11
14
|
* Get account details
|
|
@@ -23,5 +26,9 @@ class AccountClient extends make_api_request_js_1.CoreResourceClient {
|
|
|
23
26
|
opts,
|
|
24
27
|
});
|
|
25
28
|
}
|
|
29
|
+
get checkout() {
|
|
30
|
+
var _a;
|
|
31
|
+
return ((_a = this._checkoutLazy) !== null && _a !== void 0 ? _a : (this._checkoutLazy = new (require("./checkout").CheckoutClient)(this._client, this._opts)));
|
|
32
|
+
}
|
|
26
33
|
}
|
|
27
34
|
exports.AccountClient = AccountClient;
|
|
@@ -46,6 +46,10 @@ export type CreateRequest = {
|
|
|
46
46
|
* - Supported resolutions: 640px, 1k
|
|
47
47
|
* - Available for tiers: creator, pro, business
|
|
48
48
|
* - Max additional input images: 9
|
|
49
|
+
* - `nano-banana-2` - from 100 credits/image
|
|
50
|
+
* - Supported resolutions: 640px, 1k, 2k, 4k
|
|
51
|
+
* - Available for tiers: creator, pro, business
|
|
52
|
+
* - Max additional input images: 9
|
|
49
53
|
* - `nano-banana-2-lite` - from 50 credits/image
|
|
50
54
|
* - Supported resolutions: 640px, 1k
|
|
51
55
|
* - Available for tiers: creator, pro, business
|
|
@@ -106,6 +110,7 @@ export type CreateRequest = {
|
|
|
106
110
|
* - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k
|
|
107
111
|
* - `krea-2` - 640px, 1k
|
|
108
112
|
* - `nano-banana` - 640px, 1k
|
|
113
|
+
* - `nano-banana-2` - 640px, 1k, 2k, 4k
|
|
109
114
|
* - `nano-banana-2-lite` - 640px, 1k
|
|
110
115
|
* - `nano-banana-2.1` - 640px, 1k, 2k, 4k
|
|
111
116
|
* - `nano-banana-pro` - 1k, 2k, 4k
|
|
@@ -45,6 +45,10 @@ export type CreateRequest = {
|
|
|
45
45
|
* - Supported resolutions: 640px, 1k
|
|
46
46
|
* - Available for tiers: creator, pro, business
|
|
47
47
|
* - Image count allowed: 1, 2, 3, 4
|
|
48
|
+
* - `nano-banana-2` - from 100 credits/image
|
|
49
|
+
* - Supported resolutions: 640px, 1k, 2k, 4k
|
|
50
|
+
* - Available for tiers: creator, pro, business
|
|
51
|
+
* - Image count allowed: 1, 4, 9, 16
|
|
48
52
|
* - `nano-banana-2-lite` - from 50 credits/image
|
|
49
53
|
* - Supported resolutions: 640px, 1k
|
|
50
54
|
* - Available for tiers: creator, pro, business
|
|
@@ -115,6 +119,7 @@ export type CreateRequest = {
|
|
|
115
119
|
* - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k
|
|
116
120
|
* - `krea-2` - 640px, 1k
|
|
117
121
|
* - `nano-banana` - 640px, 1k
|
|
122
|
+
* - `nano-banana-2` - 640px, 1k, 2k, 4k
|
|
118
123
|
* - `nano-banana-2-lite` - 640px, 1k
|
|
119
124
|
* - `nano-banana-2.1` - 640px, 1k, 2k, 4k
|
|
120
125
|
* - `nano-banana-pro` - 1k, 2k, 4k
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { V1AccountCheckoutCreateBody } from "./v1-account-checkout-create-body";
|
|
2
|
+
export { V1AccountCheckoutCreateBodyTypeEnum } from "./v1-account-checkout-create-body-type-enum";
|
|
3
|
+
export { V1AccountCheckoutCreateResponse } from "./v1-account-checkout-create-response";
|
|
1
4
|
export { V1AccountListResponse } from "./v1-account-list-response";
|
|
2
5
|
export { V1AccountListResponseSubscription } from "./v1-account-list-response-subscription";
|
|
3
6
|
export { V1AccountListResponseSubscriptionBillingIntervalEnum } from "./v1-account-list-response-subscription-billing-interval-enum";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* V1AccountCheckoutCreateBody
|
|
4
|
+
*/
|
|
5
|
+
export type V1AccountCheckoutCreateBody = {
|
|
6
|
+
/**
|
|
7
|
+
* Credits a blocked request is missing, e.g. `credit_shortfall` from a 402 response. The checkout starts with enough packs to cover it. Defaults to one pack.
|
|
8
|
+
*/
|
|
9
|
+
creditShortfall?: number | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Number of credit packs the checkout starts with. Takes priority over `credit_shortfall`.
|
|
12
|
+
*/
|
|
13
|
+
packCount?: number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* What to buy. `credit_pack` is a one-time credit purchase.
|
|
16
|
+
*/
|
|
17
|
+
type: "credit_pack";
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
* V1AccountCheckoutCreateBody without any key transformation, this is what
|
|
22
|
+
* we expect to come in as network data
|
|
23
|
+
*/
|
|
24
|
+
export type External$V1AccountCheckoutCreateBody = {
|
|
25
|
+
credit_shortfall?: number | undefined;
|
|
26
|
+
pack_count?: number | undefined;
|
|
27
|
+
type: "credit_pack";
|
|
28
|
+
};
|
|
29
|
+
export declare const Schemas$V1AccountCheckoutCreateBody: {
|
|
30
|
+
in: z.ZodType<V1AccountCheckoutCreateBody, z.ZodTypeDef, unknown>;
|
|
31
|
+
out: z.ZodType<External$V1AccountCheckoutCreateBody, z.ZodTypeDef, V1AccountCheckoutCreateBody>;
|
|
32
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Schemas$V1AccountCheckoutCreateBody = void 0;
|
|
37
|
+
const make_api_request_js_1 = require("make-api-request-js");
|
|
38
|
+
const z = __importStar(require("zod"));
|
|
39
|
+
/**
|
|
40
|
+
* Takes network data, validates it, and transforms keys to match typescript object V1AccountCheckoutCreateBody
|
|
41
|
+
*/
|
|
42
|
+
const SchemaIn$V1AccountCheckoutCreateBody = z
|
|
43
|
+
.object({
|
|
44
|
+
credit_shortfall: z.number().optional(),
|
|
45
|
+
pack_count: z.number().int().optional(),
|
|
46
|
+
type: z.enum(["credit_pack"]),
|
|
47
|
+
})
|
|
48
|
+
.transform((obj) => {
|
|
49
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
50
|
+
credit_shortfall: "creditShortfall",
|
|
51
|
+
pack_count: "packCount",
|
|
52
|
+
type: "type",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
* Takes typescript data, validates it, and maps keys to match the expected external object External$V1AccountCheckoutCreateBody
|
|
58
|
+
*/
|
|
59
|
+
const SchemaOut$V1AccountCheckoutCreateBody = z
|
|
60
|
+
.object({
|
|
61
|
+
creditShortfall: z.number().optional(),
|
|
62
|
+
packCount: z.number().int().optional(),
|
|
63
|
+
type: z.enum(["credit_pack"]),
|
|
64
|
+
})
|
|
65
|
+
.transform((obj) => {
|
|
66
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
67
|
+
creditShortfall: "credit_shortfall",
|
|
68
|
+
packCount: "pack_count",
|
|
69
|
+
type: "type",
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
exports.Schemas$V1AccountCheckoutCreateBody = {
|
|
73
|
+
in: SchemaIn$V1AccountCheckoutCreateBody,
|
|
74
|
+
out: SchemaOut$V1AccountCheckoutCreateBody,
|
|
75
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* V1AccountCheckoutCreateResponse
|
|
4
|
+
*/
|
|
5
|
+
export type V1AccountCheckoutCreateResponse = {
|
|
6
|
+
/**
|
|
7
|
+
* Open in a browser to complete the purchase.
|
|
8
|
+
*/
|
|
9
|
+
checkoutUrl: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
* V1AccountCheckoutCreateResponse without any key transformation, this is what
|
|
14
|
+
* we expect to come in as network data
|
|
15
|
+
*/
|
|
16
|
+
export type External$V1AccountCheckoutCreateResponse = {
|
|
17
|
+
checkout_url: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const Schemas$V1AccountCheckoutCreateResponse: {
|
|
20
|
+
in: z.ZodType<V1AccountCheckoutCreateResponse, z.ZodTypeDef, unknown>;
|
|
21
|
+
out: z.ZodType<External$V1AccountCheckoutCreateResponse, z.ZodTypeDef, V1AccountCheckoutCreateResponse>;
|
|
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$V1AccountCheckoutCreateResponse = void 0;
|
|
37
|
+
const make_api_request_js_1 = require("make-api-request-js");
|
|
38
|
+
const z = __importStar(require("zod"));
|
|
39
|
+
/**
|
|
40
|
+
* Takes network data, validates it, and transforms keys to match typescript object V1AccountCheckoutCreateResponse
|
|
41
|
+
*/
|
|
42
|
+
const SchemaIn$V1AccountCheckoutCreateResponse = z
|
|
43
|
+
.object({
|
|
44
|
+
checkout_url: z.string(),
|
|
45
|
+
})
|
|
46
|
+
.transform((obj) => {
|
|
47
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
48
|
+
checkout_url: "checkoutUrl",
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
* Takes typescript data, validates it, and maps keys to match the expected external object External$V1AccountCheckoutCreateResponse
|
|
54
|
+
*/
|
|
55
|
+
const SchemaOut$V1AccountCheckoutCreateResponse = z
|
|
56
|
+
.object({
|
|
57
|
+
checkoutUrl: z.string(),
|
|
58
|
+
})
|
|
59
|
+
.transform((obj) => {
|
|
60
|
+
return (0, make_api_request_js_1.zodTransform)(obj, {
|
|
61
|
+
checkoutUrl: "checkout_url",
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
exports.Schemas$V1AccountCheckoutCreateResponse = {
|
|
65
|
+
in: SchemaIn$V1AccountCheckoutCreateResponse,
|
|
66
|
+
out: SchemaOut$V1AccountCheckoutCreateResponse,
|
|
67
|
+
};
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
* - Supported resolutions: 640px, 1k
|
|
28
28
|
* - Available for tiers: creator, pro, business
|
|
29
29
|
* - Max additional input images: 9
|
|
30
|
+
* - `nano-banana-2` - from 100 credits/image
|
|
31
|
+
* - Supported resolutions: 640px, 1k, 2k, 4k
|
|
32
|
+
* - Available for tiers: creator, pro, business
|
|
33
|
+
* - Max additional input images: 9
|
|
30
34
|
* - `nano-banana-2-lite` - from 50 credits/image
|
|
31
35
|
* - Supported resolutions: 640px, 1k
|
|
32
36
|
* - Available for tiers: creator, pro, business
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k
|
|
16
16
|
* - `krea-2` - 640px, 1k
|
|
17
17
|
* - `nano-banana` - 640px, 1k
|
|
18
|
+
* - `nano-banana-2` - 640px, 1k, 2k, 4k
|
|
18
19
|
* - `nano-banana-2-lite` - 640px, 1k
|
|
19
20
|
* - `nano-banana-2.1` - 640px, 1k, 2k, 4k
|
|
20
21
|
* - `nano-banana-pro` - 1k, 2k, 4k
|
|
@@ -46,6 +46,10 @@ export type V1AiImageEditorCreateBody = {
|
|
|
46
46
|
* - Supported resolutions: 640px, 1k
|
|
47
47
|
* - Available for tiers: creator, pro, business
|
|
48
48
|
* - Max additional input images: 9
|
|
49
|
+
* - `nano-banana-2` - from 100 credits/image
|
|
50
|
+
* - Supported resolutions: 640px, 1k, 2k, 4k
|
|
51
|
+
* - Available for tiers: creator, pro, business
|
|
52
|
+
* - Max additional input images: 9
|
|
49
53
|
* - `nano-banana-2-lite` - from 50 credits/image
|
|
50
54
|
* - Supported resolutions: 640px, 1k
|
|
51
55
|
* - Available for tiers: creator, pro, business
|
|
@@ -106,6 +110,7 @@ export type V1AiImageEditorCreateBody = {
|
|
|
106
110
|
* - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k
|
|
107
111
|
* - `krea-2` - 640px, 1k
|
|
108
112
|
* - `nano-banana` - 640px, 1k
|
|
113
|
+
* - `nano-banana-2` - 640px, 1k, 2k, 4k
|
|
109
114
|
* - `nano-banana-2-lite` - 640px, 1k
|
|
110
115
|
* - `nano-banana-2.1` - 640px, 1k, 2k, 4k
|
|
111
116
|
* - `nano-banana-pro` - 1k, 2k, 4k
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
* - Supported resolutions: 640px, 1k
|
|
32
32
|
* - Available for tiers: creator, pro, business
|
|
33
33
|
* - Image count allowed: 1, 2, 3, 4
|
|
34
|
+
* - `nano-banana-2` - from 100 credits/image
|
|
35
|
+
* - Supported resolutions: 640px, 1k, 2k, 4k
|
|
36
|
+
* - Available for tiers: creator, pro, business
|
|
37
|
+
* - Image count allowed: 1, 4, 9, 16
|
|
34
38
|
* - `nano-banana-2-lite` - from 50 credits/image
|
|
35
39
|
* - Supported resolutions: 640px, 1k
|
|
36
40
|
* - Available for tiers: creator, pro, business
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k
|
|
17
17
|
* - `krea-2` - 640px, 1k
|
|
18
18
|
* - `nano-banana` - 640px, 1k
|
|
19
|
+
* - `nano-banana-2` - 640px, 1k, 2k, 4k
|
|
19
20
|
* - `nano-banana-2-lite` - 640px, 1k
|
|
20
21
|
* - `nano-banana-2.1` - 640px, 1k, 2k, 4k
|
|
21
22
|
* - `nano-banana-pro` - 1k, 2k, 4k
|
|
@@ -45,6 +45,10 @@ export type V1AiImageGeneratorCreateBody = {
|
|
|
45
45
|
* - Supported resolutions: 640px, 1k
|
|
46
46
|
* - Available for tiers: creator, pro, business
|
|
47
47
|
* - Image count allowed: 1, 2, 3, 4
|
|
48
|
+
* - `nano-banana-2` - from 100 credits/image
|
|
49
|
+
* - Supported resolutions: 640px, 1k, 2k, 4k
|
|
50
|
+
* - Available for tiers: creator, pro, business
|
|
51
|
+
* - Image count allowed: 1, 4, 9, 16
|
|
48
52
|
* - `nano-banana-2-lite` - from 50 credits/image
|
|
49
53
|
* - Supported resolutions: 640px, 1k
|
|
50
54
|
* - Available for tiers: creator, pro, business
|
|
@@ -115,6 +119,7 @@ export type V1AiImageGeneratorCreateBody = {
|
|
|
115
119
|
* - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k
|
|
116
120
|
* - `krea-2` - 640px, 1k
|
|
117
121
|
* - `nano-banana` - 640px, 1k
|
|
122
|
+
* - `nano-banana-2` - 640px, 1k, 2k, 4k
|
|
118
123
|
* - `nano-banana-2-lite` - 640px, 1k
|
|
119
124
|
* - `nano-banana-2.1` - 640px, 1k, 2k, 4k
|
|
120
125
|
* - `nano-banana-pro` - 1k, 2k, 4k
|
|
@@ -15,7 +15,7 @@ export type V1ImageToVideoCreateBodyAssets = {
|
|
|
15
15
|
* * **`seedance-1.5`**: Supports 480p, 720p, 1080p.
|
|
16
16
|
* * **`seedance-2.0`**: Supports 480p, 720p, 1080p, 4k.
|
|
17
17
|
* * **`seedance-2.0-fast`**: Supports 480p, 720p.
|
|
18
|
-
* * **`seedance-2.0-mini`**:
|
|
18
|
+
* * **`seedance-2.0-mini`**: Not supported
|
|
19
19
|
* * **`seedance-2.5`**: Supports 480p, 720p, 1080p, 4k.
|
|
20
20
|
* * **`veo3.1`**: Supports 720p, 1080p. Requires a duration of 8 seconds or less.
|
|
21
21
|
* * **`veo3.1-lite`**: Supports 720p, 1080p. Requires a duration of 8 seconds or less.
|
|
@@ -70,7 +70,7 @@ export type V1VideoProjectsGetResponse = {
|
|
|
70
70
|
*/
|
|
71
71
|
totalFrameCost: number;
|
|
72
72
|
/**
|
|
73
|
-
* The type of the video project. Possible values are ANIMATION, AUTO_SUBTITLE, VIDEO_TO_VIDEO, FACE_SWAP, TEXT_TO_VIDEO, IMAGE_TO_VIDEO, LIP_SYNC, TALKING_PHOTO, AVATAR, VIDEO_UPSCALER, VIDEO_EDITOR, CHARACTER_REPLACE, VIDEO_COLORIZER, VIDEO_WATERMARK_REMOVER, VIDEO_COLOR_GRADER, VIDEO_TRANSLATOR, MUSIC_VIDEO, EXTEND, AUDIO_TO_VIDEO, VIDEO_EXPANDER, UGC_AD
|
|
73
|
+
* The type of the video project. Possible values are ANIMATION, AUTO_SUBTITLE, VIDEO_TO_VIDEO, FACE_SWAP, TEXT_TO_VIDEO, IMAGE_TO_VIDEO, LIP_SYNC, TALKING_PHOTO, AVATAR, VIDEO_UPSCALER, VIDEO_EDITOR, CHARACTER_REPLACE, VIDEO_COLORIZER, VIDEO_WATERMARK_REMOVER, VIDEO_COLOR_GRADER, VIDEO_TRANSLATOR, MUSIC_VIDEO, VIDEO_REMIXER, EXTEND, AUDIO_TO_VIDEO, VIDEO_EXPANDER, UGC_AD
|
|
74
74
|
*/
|
|
75
75
|
type: string;
|
|
76
76
|
/**
|