magic-hour 0.74.1 → 0.76.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 (45) 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/account/index.d.ts +1 -0
  5. package/dist/resources/v1/account/index.js +5 -0
  6. package/dist/resources/v1/account/resource-client.d.ts +13 -0
  7. package/dist/resources/v1/account/resource-client.js +27 -0
  8. package/dist/resources/v1/ai-image-editor/request-types.d.ts +7 -2
  9. package/dist/resources/v1/ai-image-editor/request-types.js +2 -0
  10. package/dist/resources/v1/ai-image-generator/request-types.d.ts +7 -2
  11. package/dist/resources/v1/ai-image-generator/request-types.js +2 -0
  12. package/dist/resources/v1/index.d.ts +1 -0
  13. package/dist/resources/v1/index.js +2 -1
  14. package/dist/resources/v1/resource-client.d.ts +3 -0
  15. package/dist/resources/v1/resource-client.js +5 -0
  16. package/dist/types/index.d.ts +7 -0
  17. package/dist/types/v1-account-list-response-subscription-billing-interval-enum.d.ts +4 -0
  18. package/dist/types/v1-account-list-response-subscription-billing-interval-enum.js +2 -0
  19. package/dist/types/v1-account-list-response-subscription-discount.d.ts +27 -0
  20. package/dist/types/v1-account-list-response-subscription-discount.js +71 -0
  21. package/dist/types/v1-account-list-response-subscription-price.d.ts +27 -0
  22. package/dist/types/v1-account-list-response-subscription-price.js +71 -0
  23. package/dist/types/v1-account-list-response-subscription-status-enum.d.ts +6 -0
  24. package/dist/types/v1-account-list-response-subscription-status-enum.js +2 -0
  25. package/dist/types/v1-account-list-response-subscription.d.ts +55 -0
  26. package/dist/types/v1-account-list-response-subscription.js +93 -0
  27. package/dist/types/v1-account-list-response-tier-enum.d.ts +4 -0
  28. package/dist/types/v1-account-list-response-tier-enum.js +2 -0
  29. package/dist/types/v1-account-list-response.d.ts +45 -0
  30. package/dist/types/v1-account-list-response.js +84 -0
  31. package/dist/types/v1-ai-image-editor-create-body-model-enum.d.ts +5 -1
  32. package/dist/types/v1-ai-image-editor-create-body-resolution-enum.d.ts +1 -0
  33. package/dist/types/v1-ai-image-editor-create-body.d.ts +7 -2
  34. package/dist/types/v1-ai-image-editor-create-body.js +2 -0
  35. package/dist/types/v1-ai-image-generator-create-body-model-enum.d.ts +5 -1
  36. package/dist/types/v1-ai-image-generator-create-body-resolution-enum.d.ts +1 -0
  37. package/dist/types/v1-ai-image-generator-create-body.d.ts +7 -2
  38. package/dist/types/v1-ai-image-generator-create-body.js +2 -0
  39. package/dist/types/v1-ai-meme-generator-create-body-style-template-enum.d.ts +1 -1
  40. package/dist/types/v1-ai-meme-generator-create-body-style.d.ts +2 -2
  41. package/dist/types/v1-ai-meme-generator-create-body-style.js +176 -0
  42. package/dist/types/v1-ai-voice-generator-create-body-style-voice-name-enum.d.ts +2 -2
  43. package/dist/types/v1-ai-voice-generator-create-body-style.d.ts +3 -3
  44. package/dist/types/v1-ai-voice-generator-create-body-style.js +1550 -0
  45. package/package.json +1 -1
package/README.md CHANGED
@@ -201,6 +201,10 @@ Valid values are: `none`, `error`, `warn`, `info`, `debug` (case insensitive). I
201
201
 
202
202
  ## Module Documentation and Snippets
203
203
 
204
+ ### [v1.account](src/resources/v1/account/README.md)
205
+
206
+ - [list](src/resources/v1/account/README.md#list) - Get account details
207
+
204
208
  ### [v1.aiClothesChanger](src/resources/v1/ai-clothes-changer/README.md)
205
209
 
206
210
  - [create](src/resources/v1/ai-clothes-changer/README.md#create) - AI Clothes Changer
@@ -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.78.1"
3
+ MockServer = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.80.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.78.1";
7
+ Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.80.0";
8
8
  })(Environment || (exports.Environment = Environment = {}));
@@ -0,0 +1 @@
1
+ export { AccountClient } from "./resource-client";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountClient = void 0;
4
+ var resource_client_1 = require("./resource-client");
5
+ Object.defineProperty(exports, "AccountClient", { enumerable: true, get: function () { return resource_client_1.AccountClient; } });
@@ -0,0 +1,13 @@
1
+ import { ApiPromise, CoreClient, CoreResourceClient, RequestOptions, ResourceClientOptions } from "make-api-request-js";
2
+ import * as types from "../../../types";
3
+ export declare class AccountClient extends CoreResourceClient {
4
+ constructor(coreClient: CoreClient, opts: ResourceClientOptions);
5
+ /**
6
+ * Get account details
7
+ *
8
+ * Get the current credit balance and subscription details of the account that owns the API key.
9
+ *
10
+ * GET /v1/account
11
+ */
12
+ list(opts?: RequestOptions): ApiPromise<types.V1AccountListResponse>;
13
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountClient = void 0;
4
+ const make_api_request_js_1 = require("make-api-request-js");
5
+ const v1_account_list_response_1 = require("../../../types/v1-account-list-response");
6
+ class AccountClient extends make_api_request_js_1.CoreResourceClient {
7
+ constructor(coreClient, opts) {
8
+ super(coreClient, opts);
9
+ }
10
+ /**
11
+ * Get account details
12
+ *
13
+ * Get the current credit balance and subscription details of the account that owns the API key.
14
+ *
15
+ * GET /v1/account
16
+ */
17
+ list(opts) {
18
+ return this._client.makeRequest({
19
+ method: "get",
20
+ path: "/v1/account",
21
+ auth: ["bearerAuth"],
22
+ responseSchema: v1_account_list_response_1.Schemas$V1AccountListResponse.in,
23
+ opts,
24
+ });
25
+ }
26
+ }
27
+ exports.AccountClient = AccountClient;
@@ -30,6 +30,10 @@ export type CreateRequest = {
30
30
  * - Supported resolutions: 640px, 1k, 2k, 4k
31
31
  * - Available for tiers: creator, pro, business
32
32
  * - Max additional input images: 9
33
+ * - `gpt-image-2.5-flare` - from 100 credits/image
34
+ * - Supported resolutions: 640px, 1k, 2k, 4k
35
+ * - Available for tiers: creator, pro, business
36
+ * - Max additional input images: 9
33
37
  * - `nano-banana` - from 50 credits/image
34
38
  * - Supported resolutions: 640px, 1k
35
39
  * - Available for tiers: creator, pro, business
@@ -64,7 +68,7 @@ export type CreateRequest = {
64
68
  * - Max additional input images: 9
65
69
  *
66
70
  */
67
- model?: ("default" | "flux-2-klein" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-2-lite" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5" | "seedream-v5-pro") | undefined;
71
+ model?: ("default" | "flux-2-klein" | "gpt-image-2" | "gpt-image-2.5-flare" | "nano-banana" | "nano-banana-2" | "nano-banana-2-lite" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5" | "seedream-v5-pro") | undefined;
68
72
  /**
69
73
  * Give your image a custom name for easy identification.
70
74
  */
@@ -82,6 +86,7 @@ export type CreateRequest = {
82
86
  * **Per-model support:**
83
87
  * - `flux-2-klein` - 640px, 1k, 2k
84
88
  * - `gpt-image-2` - 640px, 1k, 2k, 4k
89
+ * - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k
85
90
  * - `nano-banana` - 640px, 1k
86
91
  * - `nano-banana-2` - 640px, 1k, 2k, 4k
87
92
  * - `nano-banana-2-lite` - 640px, 1k
@@ -105,7 +110,7 @@ export type External$CreateRequest = {
105
110
  aspect_ratio?: ("16:9" | "1:1" | "2:3" | "3:2" | "4:3" | "4:5" | "9:16" | "auto") | undefined;
106
111
  assets: External$V1AiImageEditorCreateBodyAssets;
107
112
  image_count?: number | undefined;
108
- model?: ("default" | "flux-2-klein" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-2-lite" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5" | "seedream-v5-pro") | undefined;
113
+ model?: ("default" | "flux-2-klein" | "gpt-image-2" | "gpt-image-2.5-flare" | "nano-banana" | "nano-banana-2" | "nano-banana-2-lite" | "nano-banana-pro" | "qwen-edit" | "seedream-v4" | "seedream-v4.5" | "seedream-v5-pro") | undefined;
109
114
  name?: string | undefined;
110
115
  resolution?: ("1k" | "2k" | "4k" | "640px" | "auto") | undefined;
111
116
  style: External$V1AiImageEditorCreateBodyStyle;
@@ -53,6 +53,7 @@ const SchemaIn$CreateRequest = z
53
53
  "default",
54
54
  "flux-2-klein",
55
55
  "gpt-image-2",
56
+ "gpt-image-2.5-flare",
56
57
  "nano-banana",
57
58
  "nano-banana-2",
58
59
  "nano-banana-2-lite",
@@ -94,6 +95,7 @@ const SchemaOut$CreateRequest = z
94
95
  "default",
95
96
  "flux-2-klein",
96
97
  "gpt-image-2",
98
+ "gpt-image-2.5-flare",
97
99
  "nano-banana",
98
100
  "nano-banana-2",
99
101
  "nano-banana-2-lite",
@@ -29,6 +29,10 @@ export type CreateRequest = {
29
29
  * - Supported resolutions: 640px, 1k, 2k, 4k
30
30
  * - Available for tiers: creator, pro, business
31
31
  * - Image count allowed: 1, 2, 3, 4
32
+ * - `gpt-image-2.5-flare` - from 100 credits/image
33
+ * - Supported resolutions: 640px, 1k, 2k, 4k
34
+ * - Available for tiers: creator, pro, business
35
+ * - Image count allowed: 1, 2, 3, 4
32
36
  * - `nano-banana` - from 50 credits/image
33
37
  * - Supported resolutions: 640px, 1k
34
38
  * - Available for tiers: creator, pro, business
@@ -62,7 +66,7 @@ export type CreateRequest = {
62
66
  * - `seedream` - Use `seedream-v4` instead.
63
67
  *
64
68
  */
65
- model?: ("default" | "flux-2-klein" | "flux-schnell" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-2-lite" | "nano-banana-pro" | "seedream" | "seedream-v4" | "seedream-v5-pro" | "z-image-turbo") | undefined;
69
+ model?: ("default" | "flux-2-klein" | "flux-schnell" | "gpt-image-2" | "gpt-image-2.5-flare" | "nano-banana" | "nano-banana-2" | "nano-banana-2-lite" | "nano-banana-pro" | "seedream" | "seedream-v4" | "seedream-v5-pro" | "z-image-turbo") | undefined;
66
70
  /**
67
71
  * Give your image a custom name for easy identification.
68
72
  */
@@ -87,6 +91,7 @@ export type CreateRequest = {
87
91
  * - `flux-2-klein` - 640px, 1k, 2k
88
92
  * - `flux-schnell` - 640px, 1k, 2k
89
93
  * - `gpt-image-2` - 640px, 1k, 2k, 4k
94
+ * - `gpt-image-2.5-flare` - 640px, 1k, 2k, 4k
90
95
  * - `nano-banana` - 640px, 1k
91
96
  * - `nano-banana-2` - 640px, 1k, 2k, 4k
92
97
  * - `nano-banana-2-lite` - 640px, 1k
@@ -111,7 +116,7 @@ export type CreateRequest = {
111
116
  export type External$CreateRequest = {
112
117
  aspect_ratio?: ("16:9" | "1:1" | "9:16") | undefined;
113
118
  image_count: number;
114
- model?: ("default" | "flux-2-klein" | "flux-schnell" | "gpt-image-2" | "nano-banana" | "nano-banana-2" | "nano-banana-2-lite" | "nano-banana-pro" | "seedream" | "seedream-v4" | "seedream-v5-pro" | "z-image-turbo") | undefined;
119
+ model?: ("default" | "flux-2-klein" | "flux-schnell" | "gpt-image-2" | "gpt-image-2.5-flare" | "nano-banana" | "nano-banana-2" | "nano-banana-2-lite" | "nano-banana-pro" | "seedream" | "seedream-v4" | "seedream-v5-pro" | "z-image-turbo") | undefined;
115
120
  name?: string | undefined;
116
121
  orientation?: ("landscape" | "portrait" | "square") | undefined;
117
122
  resolution?: ("1k" | "2k" | "4k" | "640px" | "auto") | undefined;
@@ -50,6 +50,7 @@ const SchemaIn$CreateRequest = z
50
50
  "flux-2-klein",
51
51
  "flux-schnell",
52
52
  "gpt-image-2",
53
+ "gpt-image-2.5-flare",
53
54
  "nano-banana",
54
55
  "nano-banana-2",
55
56
  "nano-banana-2-lite",
@@ -90,6 +91,7 @@ const SchemaOut$CreateRequest = z
90
91
  "flux-2-klein",
91
92
  "flux-schnell",
92
93
  "gpt-image-2",
94
+ "gpt-image-2.5-flare",
93
95
  "nano-banana",
94
96
  "nano-banana-2",
95
97
  "nano-banana-2-lite",
@@ -1,3 +1,4 @@
1
+ export * as account from "./account";
1
2
  export * as aiClothesChanger from "./ai-clothes-changer";
2
3
  export * as aiFaceEditor from "./ai-face-editor";
3
4
  export * as aiGifGenerator from "./ai-gif-generator";
@@ -33,7 +33,8 @@ 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.photoColorizer = exports.lipSync = exports.imageToVideo = exports.imageProjects = exports.imageBackgroundRemover = exports.headSwap = exports.files = exports.faceSwapPhoto = exports.faceSwap = exports.faceDetection = exports.characterReplace = exports.bodySwap = exports.autoSubtitleGenerator = exports.audioToVideo = exports.audioProjects = exports.animation = exports.aiVoiceGenerator = exports.aiVoiceCloner = exports.aiVideoEditor = exports.aiTalkingPhoto = exports.aiQrCodeGenerator = exports.aiMemeGenerator = exports.aiImageUpscaler = exports.aiImageGenerator = exports.aiImageEditor = exports.aiHeadshotGenerator = exports.aiGifGenerator = exports.aiFaceEditor = exports.aiClothesChanger = void 0;
36
+ exports.videoToVideo = exports.videoProjects = exports.textToVideo = exports.V1Client = exports.photoColorizer = exports.lipSync = exports.imageToVideo = exports.imageProjects = exports.imageBackgroundRemover = exports.headSwap = exports.files = exports.faceSwapPhoto = exports.faceSwap = exports.faceDetection = exports.characterReplace = exports.bodySwap = exports.autoSubtitleGenerator = exports.audioToVideo = exports.audioProjects = exports.animation = exports.aiVoiceGenerator = exports.aiVoiceCloner = exports.aiVideoEditor = exports.aiTalkingPhoto = exports.aiQrCodeGenerator = exports.aiMemeGenerator = exports.aiImageUpscaler = exports.aiImageGenerator = exports.aiImageEditor = exports.aiHeadshotGenerator = exports.aiGifGenerator = exports.aiFaceEditor = exports.aiClothesChanger = exports.account = void 0;
37
+ exports.account = __importStar(require("./account"));
37
38
  exports.aiClothesChanger = __importStar(require("./ai-clothes-changer"));
38
39
  exports.aiFaceEditor = __importStar(require("./ai-face-editor"));
39
40
  exports.aiGifGenerator = __importStar(require("./ai-gif-generator"));
@@ -1,4 +1,5 @@
1
1
  import { CoreClient, CoreResourceClient, ResourceClientOptions } from "make-api-request-js";
2
+ import { AccountClient } from "../../resources/v1/account";
2
3
  import { AiClothesChangerClient } from "../../resources/v1/ai-clothes-changer";
3
4
  import { AiFaceEditorClient } from "../../resources/v1/ai-face-editor";
4
5
  import { AiGifGeneratorClient } from "../../resources/v1/ai-gif-generator";
@@ -32,6 +33,7 @@ import { TextToVideoClient } from "../../resources/v1/text-to-video";
32
33
  import { VideoProjectsClient } from "../../resources/v1/video-projects";
33
34
  import { VideoToVideoClient } from "../../resources/v1/video-to-video";
34
35
  export declare class V1Client extends CoreResourceClient {
36
+ private _accountLazy?;
35
37
  private _characterReplaceLazy?;
36
38
  private _aiVideoEditorLazy?;
37
39
  private _audioToVideoLazy?;
@@ -97,4 +99,5 @@ export declare class V1Client extends CoreResourceClient {
97
99
  get audioToVideo(): AudioToVideoClient;
98
100
  get aiVideoEditor(): AiVideoEditorClient;
99
101
  get characterReplace(): CharacterReplaceClient;
102
+ get account(): AccountClient;
100
103
  }
@@ -6,6 +6,7 @@ class V1Client extends make_api_request_js_1.CoreResourceClient {
6
6
  constructor(coreClient, opts) {
7
7
  super(coreClient, opts);
8
8
  if (this._opts.lazyLoad === false) {
9
+ this.account;
9
10
  this.aiClothesChanger;
10
11
  this.aiFaceEditor;
11
12
  this.aiGifGenerator;
@@ -194,5 +195,9 @@ class V1Client extends make_api_request_js_1.CoreResourceClient {
194
195
  return ((_a = this._characterReplaceLazy) !== null && _a !== void 0 ? _a : (this._characterReplaceLazy =
195
196
  new (require("./character-replace").CharacterReplaceClient)(this._client, this._opts)));
196
197
  }
198
+ get account() {
199
+ var _a;
200
+ return ((_a = this._accountLazy) !== null && _a !== void 0 ? _a : (this._accountLazy = new (require("./account").AccountClient)(this._client, this._opts)));
201
+ }
197
202
  }
198
203
  exports.V1Client = V1Client;
@@ -1,3 +1,10 @@
1
+ export { V1AccountListResponse } from "./v1-account-list-response";
2
+ export { V1AccountListResponseSubscription } from "./v1-account-list-response-subscription";
3
+ export { V1AccountListResponseSubscriptionBillingIntervalEnum } from "./v1-account-list-response-subscription-billing-interval-enum";
4
+ export { V1AccountListResponseSubscriptionDiscount } from "./v1-account-list-response-subscription-discount";
5
+ export { V1AccountListResponseSubscriptionPrice } from "./v1-account-list-response-subscription-price";
6
+ export { V1AccountListResponseSubscriptionStatusEnum } from "./v1-account-list-response-subscription-status-enum";
7
+ export { V1AccountListResponseTierEnum } from "./v1-account-list-response-tier-enum";
1
8
  export { V1AiClothesChangerCreateBody } from "./v1-ai-clothes-changer-create-body";
2
9
  export { V1AiClothesChangerCreateBodyAssets } from "./v1-ai-clothes-changer-create-body-assets";
3
10
  export { V1AiClothesChangerCreateBodyAssetsGarmentTypeEnum } from "./v1-ai-clothes-changer-create-body-assets-garment-type-enum";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * How often the subscription is billed. `null` if unknown.
3
+ */
4
+ export type V1AccountListResponseSubscriptionBillingIntervalEnum = "month" | "year";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,27 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Discount applied to the subscription. `null` if no discount is applied.
4
+ */
5
+ export type V1AccountListResponseSubscriptionDiscount = {
6
+ /**
7
+ * Fixed amount taken off `price.amount` each billing interval, in the smallest unit of the currency. `null` if the discount is a percentage.
8
+ */
9
+ amountOff: number | null;
10
+ /**
11
+ * Percentage taken off `price.amount` each billing interval. `null` if the discount is a fixed amount.
12
+ */
13
+ percentOff: number | null;
14
+ };
15
+ /**
16
+ * @internal
17
+ * V1AccountListResponseSubscriptionDiscount without any key transformation, this is what
18
+ * we expect to come in as network data
19
+ */
20
+ export type External$V1AccountListResponseSubscriptionDiscount = {
21
+ amount_off: number | null;
22
+ percent_off: number | null;
23
+ };
24
+ export declare const Schemas$V1AccountListResponseSubscriptionDiscount: {
25
+ in: z.ZodType<V1AccountListResponseSubscriptionDiscount, z.ZodTypeDef, unknown>;
26
+ out: z.ZodType<External$V1AccountListResponseSubscriptionDiscount, z.ZodTypeDef, V1AccountListResponseSubscriptionDiscount>;
27
+ };
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1AccountListResponseSubscriptionDiscount = 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 V1AccountListResponseSubscriptionDiscount
41
+ */
42
+ const SchemaIn$V1AccountListResponseSubscriptionDiscount = z
43
+ .object({
44
+ amount_off: z.number().int().nullable(),
45
+ percent_off: z.number().nullable(),
46
+ })
47
+ .transform((obj) => {
48
+ return (0, make_api_request_js_1.zodTransform)(obj, {
49
+ amount_off: "amountOff",
50
+ percent_off: "percentOff",
51
+ });
52
+ });
53
+ /**
54
+ * @internal
55
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AccountListResponseSubscriptionDiscount
56
+ */
57
+ const SchemaOut$V1AccountListResponseSubscriptionDiscount = z
58
+ .object({
59
+ amountOff: z.number().int().nullable(),
60
+ percentOff: z.number().nullable(),
61
+ })
62
+ .transform((obj) => {
63
+ return (0, make_api_request_js_1.zodTransform)(obj, {
64
+ amountOff: "amount_off",
65
+ percentOff: "percent_off",
66
+ });
67
+ });
68
+ exports.Schemas$V1AccountListResponseSubscriptionDiscount = {
69
+ in: SchemaIn$V1AccountListResponseSubscriptionDiscount,
70
+ out: SchemaOut$V1AccountListResponseSubscriptionDiscount,
71
+ };
@@ -0,0 +1,27 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * V1AccountListResponseSubscriptionPrice
4
+ */
5
+ export type V1AccountListResponseSubscriptionPrice = {
6
+ /**
7
+ * Price charged per billing interval, in the smallest unit of the currency (e.g. 4900 is $49.00 for `usd`). Discounts are not applied.
8
+ */
9
+ amount: number;
10
+ /**
11
+ * Three-letter ISO 4217 currency code, lowercase.
12
+ */
13
+ currency: string;
14
+ };
15
+ /**
16
+ * @internal
17
+ * V1AccountListResponseSubscriptionPrice without any key transformation, this is what
18
+ * we expect to come in as network data
19
+ */
20
+ export type External$V1AccountListResponseSubscriptionPrice = {
21
+ amount: number;
22
+ currency: string;
23
+ };
24
+ export declare const Schemas$V1AccountListResponseSubscriptionPrice: {
25
+ in: z.ZodType<V1AccountListResponseSubscriptionPrice, z.ZodTypeDef, unknown>;
26
+ out: z.ZodType<External$V1AccountListResponseSubscriptionPrice, z.ZodTypeDef, V1AccountListResponseSubscriptionPrice>;
27
+ };
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1AccountListResponseSubscriptionPrice = 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 V1AccountListResponseSubscriptionPrice
41
+ */
42
+ const SchemaIn$V1AccountListResponseSubscriptionPrice = z
43
+ .object({
44
+ amount: z.number().int(),
45
+ currency: z.string(),
46
+ })
47
+ .transform((obj) => {
48
+ return (0, make_api_request_js_1.zodTransform)(obj, {
49
+ amount: "amount",
50
+ currency: "currency",
51
+ });
52
+ });
53
+ /**
54
+ * @internal
55
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AccountListResponseSubscriptionPrice
56
+ */
57
+ const SchemaOut$V1AccountListResponseSubscriptionPrice = z
58
+ .object({
59
+ amount: z.number().int(),
60
+ currency: z.string(),
61
+ })
62
+ .transform((obj) => {
63
+ return (0, make_api_request_js_1.zodTransform)(obj, {
64
+ amount: "amount",
65
+ currency: "currency",
66
+ });
67
+ });
68
+ exports.Schemas$V1AccountListResponseSubscriptionPrice = {
69
+ in: SchemaIn$V1AccountListResponseSubscriptionPrice,
70
+ out: SchemaOut$V1AccountListResponseSubscriptionPrice,
71
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Status of the subscription.
3
+ * - `active`: payments are up to date.
4
+ * - `past_due`: the latest payment failed. `tier` is `free` until payment succeeds. The subscription is canceled if payment keeps failing.
5
+ */
6
+ export type V1AccountListResponseSubscriptionStatusEnum = "active" | "past_due";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,55 @@
1
+ import * as z from "zod";
2
+ import { External$V1AccountListResponseSubscriptionDiscount, V1AccountListResponseSubscriptionDiscount } from "./v1-account-list-response-subscription-discount";
3
+ import { External$V1AccountListResponseSubscriptionPrice, V1AccountListResponseSubscriptionPrice } from "./v1-account-list-response-subscription-price";
4
+ /**
5
+ * Details of the account's subscription plan. `null` if the account has no subscription, e.g. a free account, an account that only purchased credit packs, or an account on usage-based API pricing.
6
+ *
7
+ * Reflects the plan currently configured on the subscription. If a plan change is scheduled, `tier` stays on the current plan until the next payment succeeds, so `tier` and `name` can briefly disagree.
8
+ */
9
+ export type V1AccountListResponseSubscription = {
10
+ /**
11
+ * How often the subscription is billed. `null` if unknown.
12
+ */
13
+ billingInterval: ("month" | "year") | null;
14
+ /**
15
+ * Whether the subscription is scheduled to end at `current_period_end` instead of renewing. The subscription stays usable until then.
16
+ */
17
+ cancelAtPeriodEnd: boolean;
18
+ /**
19
+ * End of the current billing period, in ISO 8601 format. The subscription renews at this time, or ends if `cancel_at_period_end` is `true`.
20
+ */
21
+ currentPeriodEnd: string | null;
22
+ /**
23
+ * Discount applied to the subscription. `null` if no discount is applied.
24
+ */
25
+ discount: V1AccountListResponseSubscriptionDiscount | null;
26
+ /**
27
+ * Name of the current subscription plan, e.g. `Creator`, `Pro`, `Pro Plus`, `Business`. `null` if the plan cannot be determined. Use `tier` for a machine-readable value.
28
+ */
29
+ name: string | null;
30
+ price: V1AccountListResponseSubscriptionPrice;
31
+ /**
32
+ * Status of the subscription.
33
+ * - `active`: payments are up to date.
34
+ * - `past_due`: the latest payment failed. `tier` is `free` until payment succeeds. The subscription is canceled if payment keeps failing.
35
+ */
36
+ status: "active" | "past_due";
37
+ };
38
+ /**
39
+ * @internal
40
+ * V1AccountListResponseSubscription without any key transformation, this is what
41
+ * we expect to come in as network data
42
+ */
43
+ export type External$V1AccountListResponseSubscription = {
44
+ billing_interval: ("month" | "year") | null;
45
+ cancel_at_period_end: boolean;
46
+ current_period_end: string | null;
47
+ discount: External$V1AccountListResponseSubscriptionDiscount | null;
48
+ name: string | null;
49
+ price: External$V1AccountListResponseSubscriptionPrice;
50
+ status: "active" | "past_due";
51
+ };
52
+ export declare const Schemas$V1AccountListResponseSubscription: {
53
+ in: z.ZodType<V1AccountListResponseSubscription, z.ZodTypeDef, unknown>;
54
+ out: z.ZodType<External$V1AccountListResponseSubscription, z.ZodTypeDef, V1AccountListResponseSubscription>;
55
+ };
@@ -0,0 +1,93 @@
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$V1AccountListResponseSubscription = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ const v1_account_list_response_subscription_discount_1 = require("./v1-account-list-response-subscription-discount");
40
+ const v1_account_list_response_subscription_price_1 = require("./v1-account-list-response-subscription-price");
41
+ /**
42
+ * Takes network data, validates it, and transforms keys to match typescript object V1AccountListResponseSubscription
43
+ */
44
+ const SchemaIn$V1AccountListResponseSubscription = z
45
+ .object({
46
+ billing_interval: z.enum(["month", "year"]).nullable(),
47
+ cancel_at_period_end: z.boolean(),
48
+ current_period_end: z.string().nullable(),
49
+ discount: v1_account_list_response_subscription_discount_1.Schemas$V1AccountListResponseSubscriptionDiscount.in.nullable(),
50
+ name: z.string().nullable(),
51
+ price: v1_account_list_response_subscription_price_1.Schemas$V1AccountListResponseSubscriptionPrice.in,
52
+ status: z.enum(["active", "past_due"]),
53
+ })
54
+ .transform((obj) => {
55
+ return (0, make_api_request_js_1.zodTransform)(obj, {
56
+ billing_interval: "billingInterval",
57
+ cancel_at_period_end: "cancelAtPeriodEnd",
58
+ current_period_end: "currentPeriodEnd",
59
+ discount: "discount",
60
+ name: "name",
61
+ price: "price",
62
+ status: "status",
63
+ });
64
+ });
65
+ /**
66
+ * @internal
67
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AccountListResponseSubscription
68
+ */
69
+ const SchemaOut$V1AccountListResponseSubscription = z
70
+ .object({
71
+ billingInterval: z.enum(["month", "year"]).nullable(),
72
+ cancelAtPeriodEnd: z.boolean(),
73
+ currentPeriodEnd: z.string().nullable(),
74
+ discount: v1_account_list_response_subscription_discount_1.Schemas$V1AccountListResponseSubscriptionDiscount.out.nullable(),
75
+ name: z.string().nullable(),
76
+ price: v1_account_list_response_subscription_price_1.Schemas$V1AccountListResponseSubscriptionPrice.out,
77
+ status: z.enum(["active", "past_due"]),
78
+ })
79
+ .transform((obj) => {
80
+ return (0, make_api_request_js_1.zodTransform)(obj, {
81
+ billingInterval: "billing_interval",
82
+ cancelAtPeriodEnd: "cancel_at_period_end",
83
+ currentPeriodEnd: "current_period_end",
84
+ discount: "discount",
85
+ name: "name",
86
+ price: "price",
87
+ status: "status",
88
+ });
89
+ });
90
+ exports.Schemas$V1AccountListResponseSubscription = {
91
+ in: SchemaIn$V1AccountListResponseSubscription,
92
+ out: SchemaOut$V1AccountListResponseSubscription,
93
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Subscription tier in effect for the account. `free` if there is no active subscription, including while a subscription is `past_due`.
3
+ */
4
+ export type V1AccountListResponseTierEnum = "business" | "creator" | "free" | "pro";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });