magic-hour 0.74.1 → 0.75.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 (27) 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/index.d.ts +1 -0
  9. package/dist/resources/v1/index.js +2 -1
  10. package/dist/resources/v1/resource-client.d.ts +3 -0
  11. package/dist/resources/v1/resource-client.js +5 -0
  12. package/dist/types/index.d.ts +7 -0
  13. package/dist/types/v1-account-list-response-subscription-billing-interval-enum.d.ts +4 -0
  14. package/dist/types/v1-account-list-response-subscription-billing-interval-enum.js +2 -0
  15. package/dist/types/v1-account-list-response-subscription-discount.d.ts +27 -0
  16. package/dist/types/v1-account-list-response-subscription-discount.js +71 -0
  17. package/dist/types/v1-account-list-response-subscription-price.d.ts +27 -0
  18. package/dist/types/v1-account-list-response-subscription-price.js +71 -0
  19. package/dist/types/v1-account-list-response-subscription-status-enum.d.ts +6 -0
  20. package/dist/types/v1-account-list-response-subscription-status-enum.js +2 -0
  21. package/dist/types/v1-account-list-response-subscription.d.ts +55 -0
  22. package/dist/types/v1-account-list-response-subscription.js +93 -0
  23. package/dist/types/v1-account-list-response-tier-enum.d.ts +4 -0
  24. package/dist/types/v1-account-list-response-tier-enum.js +2 -0
  25. package/dist/types/v1-account-list-response.d.ts +45 -0
  26. package/dist/types/v1-account-list-response.js +84 -0
  27. 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.79.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.79.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;
@@ -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 });
@@ -0,0 +1,45 @@
1
+ import * as z from "zod";
2
+ import { External$V1AccountListResponseSubscription, V1AccountListResponseSubscription } from "./v1-account-list-response-subscription";
3
+ /**
4
+ * V1AccountListResponse
5
+ */
6
+ export type V1AccountListResponse = {
7
+ /**
8
+ * Credits currently available to spend. Includes subscription credits and any purchased credit packs.
9
+ */
10
+ credits: number;
11
+ /**
12
+ * Email address of the account.
13
+ */
14
+ email: string | null;
15
+ /**
16
+ * Unique ID of the account that owns the API key.
17
+ */
18
+ id: string;
19
+ /**
20
+ * 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.
21
+ *
22
+ * 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.
23
+ */
24
+ subscription: V1AccountListResponseSubscription | null;
25
+ /**
26
+ * Subscription tier in effect for the account. `free` if there is no active subscription, including while a subscription is `past_due`.
27
+ */
28
+ tier: "business" | "creator" | "free" | "pro";
29
+ };
30
+ /**
31
+ * @internal
32
+ * V1AccountListResponse without any key transformation, this is what
33
+ * we expect to come in as network data
34
+ */
35
+ export type External$V1AccountListResponse = {
36
+ credits: number;
37
+ email: string | null;
38
+ id: string;
39
+ subscription: External$V1AccountListResponseSubscription | null;
40
+ tier: "business" | "creator" | "free" | "pro";
41
+ };
42
+ export declare const Schemas$V1AccountListResponse: {
43
+ in: z.ZodType<V1AccountListResponse, z.ZodTypeDef, unknown>;
44
+ out: z.ZodType<External$V1AccountListResponse, z.ZodTypeDef, V1AccountListResponse>;
45
+ };
@@ -0,0 +1,84 @@
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$V1AccountListResponse = 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_1 = require("./v1-account-list-response-subscription");
40
+ /**
41
+ * Takes network data, validates it, and transforms keys to match typescript object V1AccountListResponse
42
+ */
43
+ const SchemaIn$V1AccountListResponse = z
44
+ .object({
45
+ credits: z.number().int(),
46
+ email: z.string().nullable(),
47
+ id: z.string(),
48
+ subscription: v1_account_list_response_subscription_1.Schemas$V1AccountListResponseSubscription.in.nullable(),
49
+ tier: z.enum(["business", "creator", "free", "pro"]),
50
+ })
51
+ .transform((obj) => {
52
+ return (0, make_api_request_js_1.zodTransform)(obj, {
53
+ credits: "credits",
54
+ email: "email",
55
+ id: "id",
56
+ subscription: "subscription",
57
+ tier: "tier",
58
+ });
59
+ });
60
+ /**
61
+ * @internal
62
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1AccountListResponse
63
+ */
64
+ const SchemaOut$V1AccountListResponse = z
65
+ .object({
66
+ credits: z.number().int(),
67
+ email: z.string().nullable(),
68
+ id: z.string(),
69
+ subscription: v1_account_list_response_subscription_1.Schemas$V1AccountListResponseSubscription.out.nullable(),
70
+ tier: z.enum(["business", "creator", "free", "pro"]),
71
+ })
72
+ .transform((obj) => {
73
+ return (0, make_api_request_js_1.zodTransform)(obj, {
74
+ credits: "credits",
75
+ email: "email",
76
+ id: "id",
77
+ subscription: "subscription",
78
+ tier: "tier",
79
+ });
80
+ });
81
+ exports.Schemas$V1AccountListResponse = {
82
+ in: SchemaIn$V1AccountListResponse,
83
+ out: SchemaOut$V1AccountListResponse,
84
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-hour",
3
- "version": "0.74.1",
3
+ "version": "0.75.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {