@revstackhq/node 0.0.0-dev-20260226054346
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/LICENSE +21 -0
- package/README.md +136 -0
- package/dist/errors.d.ts +106 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +102 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/modules/admin/entitlements.d.ts +68 -0
- package/dist/modules/admin/entitlements.d.ts.map +1 -0
- package/dist/modules/admin/entitlements.js +87 -0
- package/dist/modules/admin/environments.d.ts +71 -0
- package/dist/modules/admin/environments.d.ts.map +1 -0
- package/dist/modules/admin/environments.js +84 -0
- package/dist/modules/admin/index.d.ts +30 -0
- package/dist/modules/admin/index.d.ts.map +1 -0
- package/dist/modules/admin/index.js +31 -0
- package/dist/modules/admin/integrations.d.ts +79 -0
- package/dist/modules/admin/integrations.d.ts.map +1 -0
- package/dist/modules/admin/integrations.js +97 -0
- package/dist/modules/admin/plans.d.ts +72 -0
- package/dist/modules/admin/plans.d.ts.map +1 -0
- package/dist/modules/admin/plans.js +93 -0
- package/dist/modules/admin/system.d.ts +53 -0
- package/dist/modules/admin/system.d.ts.map +1 -0
- package/dist/modules/admin/system.js +61 -0
- package/dist/modules/base.d.ts +43 -0
- package/dist/modules/base.d.ts.map +1 -0
- package/dist/modules/base.js +84 -0
- package/dist/modules/customers.d.ts +56 -0
- package/dist/modules/customers.d.ts.map +1 -0
- package/dist/modules/customers.js +72 -0
- package/dist/modules/entitlements.d.ts +49 -0
- package/dist/modules/entitlements.d.ts.map +1 -0
- package/dist/modules/entitlements.js +64 -0
- package/dist/modules/invoices.d.ts +33 -0
- package/dist/modules/invoices.d.ts.map +1 -0
- package/dist/modules/invoices.js +37 -0
- package/dist/modules/plans.d.ts +35 -0
- package/dist/modules/plans.d.ts.map +1 -0
- package/dist/modules/plans.js +39 -0
- package/dist/modules/subscriptions.d.ts +55 -0
- package/dist/modules/subscriptions.d.ts.map +1 -0
- package/dist/modules/subscriptions.js +71 -0
- package/dist/modules/usage.d.ts +59 -0
- package/dist/modules/usage.d.ts.map +1 -0
- package/dist/modules/usage.js +80 -0
- package/dist/modules/wallets.d.ts +53 -0
- package/dist/modules/wallets.d.ts.map +1 -0
- package/dist/modules/wallets.js +69 -0
- package/dist/modules/webhooks.d.ts +51 -0
- package/dist/modules/webhooks.d.ts.map +1 -0
- package/dist/modules/webhooks.js +90 -0
- package/dist/src/errors.d.ts +91 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +101 -0
- package/dist/src/index.d.ts +71 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +91 -0
- package/dist/src/modules/admin/entitlements.d.ts +73 -0
- package/dist/src/modules/admin/entitlements.d.ts.map +1 -0
- package/dist/src/modules/admin/entitlements.js +90 -0
- package/dist/src/modules/admin/environments.d.ts +76 -0
- package/dist/src/modules/admin/environments.d.ts.map +1 -0
- package/dist/src/modules/admin/environments.js +87 -0
- package/dist/src/modules/admin/index.d.ts +16 -0
- package/dist/src/modules/admin/index.d.ts.map +1 -0
- package/dist/src/modules/admin/index.js +16 -0
- package/dist/src/modules/admin/integrations.d.ts +84 -0
- package/dist/src/modules/admin/integrations.d.ts.map +1 -0
- package/dist/src/modules/admin/integrations.js +100 -0
- package/dist/src/modules/admin/plans.d.ts +77 -0
- package/dist/src/modules/admin/plans.d.ts.map +1 -0
- package/dist/src/modules/admin/plans.js +96 -0
- package/dist/src/modules/admin/system.d.ts +53 -0
- package/dist/src/modules/admin/system.d.ts.map +1 -0
- package/dist/src/modules/admin/system.js +61 -0
- package/dist/src/modules/base.d.ts +43 -0
- package/dist/src/modules/base.d.ts.map +1 -0
- package/dist/src/modules/base.js +84 -0
- package/dist/src/modules/customers.d.ts +61 -0
- package/dist/src/modules/customers.d.ts.map +1 -0
- package/dist/src/modules/customers.js +75 -0
- package/dist/src/modules/entitlements.d.ts +54 -0
- package/dist/src/modules/entitlements.d.ts.map +1 -0
- package/dist/src/modules/entitlements.js +67 -0
- package/dist/src/modules/invoices.d.ts +38 -0
- package/dist/src/modules/invoices.d.ts.map +1 -0
- package/dist/src/modules/invoices.js +40 -0
- package/dist/src/modules/plans.d.ts +40 -0
- package/dist/src/modules/plans.d.ts.map +1 -0
- package/dist/src/modules/plans.js +42 -0
- package/dist/src/modules/subscriptions.d.ts +60 -0
- package/dist/src/modules/subscriptions.d.ts.map +1 -0
- package/dist/src/modules/subscriptions.js +74 -0
- package/dist/src/modules/usage.d.ts +64 -0
- package/dist/src/modules/usage.d.ts.map +1 -0
- package/dist/src/modules/usage.js +83 -0
- package/dist/src/modules/wallets.d.ts +58 -0
- package/dist/src/modules/wallets.d.ts.map +1 -0
- package/dist/src/modules/wallets.js +72 -0
- package/dist/src/modules/webhooks.d.ts +51 -0
- package/dist/src/modules/webhooks.d.ts.map +1 -0
- package/dist/src/modules/webhooks.js +90 -0
- package/dist/src/types.d.ts +676 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +7 -0
- package/dist/types.d.ts +720 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/package.json +40 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @revstackhq/node/errors
|
|
3
|
+
* @description Typed error hierarchy for the Revstack SDK. All errors thrown by the
|
|
4
|
+
* SDK extend {@link RevstackError}, enabling precise error handling with `instanceof`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { RateLimitError, RevstackAPIError } from "@revstackhq/node";
|
|
9
|
+
*
|
|
10
|
+
* try {
|
|
11
|
+
* await revstack.entitlements.check(userId, "api-calls");
|
|
12
|
+
* } catch (error) {
|
|
13
|
+
* if (error instanceof RateLimitError) {
|
|
14
|
+
* console.log(`Rate limited. Retry after ${error.retryAfter}s`);
|
|
15
|
+
* } else if (error instanceof RevstackAPIError) {
|
|
16
|
+
* console.log(`API error ${error.status}: ${error.code}`);
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
// ─── Base Error ──────────────────────────────────────────────
|
|
22
|
+
/**
|
|
23
|
+
* Base class for all Revstack SDK errors.
|
|
24
|
+
* Use `instanceof RevstackError` to catch any SDK-originated error.
|
|
25
|
+
*/
|
|
26
|
+
export class RevstackError extends Error {
|
|
27
|
+
constructor(message) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.name = "RevstackError";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Thrown when the Revstack API returns a non-2xx HTTP response.
|
|
34
|
+
* Contains structured fields for programmatic error handling.
|
|
35
|
+
*/
|
|
36
|
+
export class RevstackAPIError extends RevstackError {
|
|
37
|
+
/** HTTP status code (e.g. `400`, `401`, `404`, `500`). */
|
|
38
|
+
status;
|
|
39
|
+
/** Machine-readable error code (e.g. `INSUFFICIENT_BALANCE`, `NOT_FOUND`). */
|
|
40
|
+
code;
|
|
41
|
+
/** Unique request ID for tracing. Include this in support tickets. */
|
|
42
|
+
requestId;
|
|
43
|
+
constructor(message, status, code, requestId) {
|
|
44
|
+
super(message);
|
|
45
|
+
this.name = "RevstackAPIError";
|
|
46
|
+
this.status = status;
|
|
47
|
+
this.code = code;
|
|
48
|
+
this.requestId = requestId;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// ─── Rate Limit ──────────────────────────────────────────────
|
|
52
|
+
/**
|
|
53
|
+
* Thrown when the API returns HTTP 429 (Too Many Requests).
|
|
54
|
+
* The `retryAfter` field indicates how long to wait before retrying.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* try {
|
|
59
|
+
* await revstack.usage.report(params);
|
|
60
|
+
* } catch (error) {
|
|
61
|
+
* if (error instanceof RateLimitError) {
|
|
62
|
+
* await sleep(error.retryAfter * 1000);
|
|
63
|
+
* await revstack.usage.report(params); // retry
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export class RateLimitError extends RevstackAPIError {
|
|
69
|
+
/** Number of seconds to wait before retrying the request. */
|
|
70
|
+
retryAfter;
|
|
71
|
+
constructor(message, retryAfter, requestId) {
|
|
72
|
+
super(message, 429, "RATE_LIMIT_EXCEEDED", requestId);
|
|
73
|
+
this.name = "RateLimitError";
|
|
74
|
+
this.retryAfter = retryAfter;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// ─── Webhook Signature ──────────────────────────────────────
|
|
78
|
+
/**
|
|
79
|
+
* Thrown when webhook signature verification fails.
|
|
80
|
+
* This indicates the webhook payload was tampered with, the signing secret is wrong,
|
|
81
|
+
* or the webhook timestamp has expired (replay protection).
|
|
82
|
+
*/
|
|
83
|
+
export class SignatureVerificationError extends RevstackError {
|
|
84
|
+
constructor(message = "Webhook signature verification failed") {
|
|
85
|
+
super(message);
|
|
86
|
+
this.name = "SignatureVerificationError";
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// ─── Sync Conflict ──────────────────────────────────────────
|
|
90
|
+
/**
|
|
91
|
+
* Thrown when the system sync endpoint detects a conflict (HTTP 409).
|
|
92
|
+
*/
|
|
93
|
+
export class SyncConflictError extends RevstackAPIError {
|
|
94
|
+
/** The conflicts discovered during sync attempts. */
|
|
95
|
+
conflicts;
|
|
96
|
+
constructor(message, conflicts, requestId) {
|
|
97
|
+
super(message, 409, "SYNC_CONFLICT", requestId);
|
|
98
|
+
this.name = "SyncConflictError";
|
|
99
|
+
this.conflicts = conflicts;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @revstackhq/node
|
|
3
|
+
* @description Official Node.js SDK for Revstack — billing infrastructure for SaaS.
|
|
4
|
+
*
|
|
5
|
+
* The SDK provides two namespaces:
|
|
6
|
+
* - **Data Plane** (`revstack.*`) — Daily backend operations: entitlement checks, usage reporting, subscriptions.
|
|
7
|
+
* - **Control Plane** (`revstack.admin.*`) — Infrastructure management: plan CRUD, Billing as Code sync.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { Revstack, RateLimitError } from "@revstackhq/node";
|
|
12
|
+
*
|
|
13
|
+
* const revstack = new Revstack({ secretKey: "sk_live_..." });
|
|
14
|
+
*
|
|
15
|
+
* // Data Plane: check if a customer can use a feature
|
|
16
|
+
* const { allowed } = await revstack.entitlements.check("usr_abc", "api-calls");
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @packageDocumentation
|
|
20
|
+
*/
|
|
21
|
+
import { RevstackOptions } from "@/types";
|
|
22
|
+
import { EntitlementsClient } from "@/modules/entitlements";
|
|
23
|
+
import { WalletsClient } from "@/modules/wallets";
|
|
24
|
+
import { CustomersClient } from "@/modules/customers";
|
|
25
|
+
import { UsageClient } from "@/modules/usage";
|
|
26
|
+
import { SubscriptionsClient } from "@/modules/subscriptions";
|
|
27
|
+
import { PlansClient } from "@/modules/plans";
|
|
28
|
+
import { InvoicesClient } from "@/modules/invoices";
|
|
29
|
+
import { WebhooksClient } from "@/modules/webhooks";
|
|
30
|
+
import { AdminClient } from "@/modules/admin";
|
|
31
|
+
/**
|
|
32
|
+
* Main SDK client. Initialize with your secret key to access all modules.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const revstack = new Revstack({
|
|
37
|
+
* secretKey: process.env.REVSTACK_SECRET_KEY!,
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare class Revstack {
|
|
42
|
+
/** Manage end-user (customer) records. */
|
|
43
|
+
readonly customers: CustomersClient;
|
|
44
|
+
/** Create, cancel, and manage subscriptions. */
|
|
45
|
+
readonly subscriptions: SubscriptionsClient;
|
|
46
|
+
/** Check feature access and query entitlements. */
|
|
47
|
+
readonly entitlements: EntitlementsClient;
|
|
48
|
+
/** Report and query metered feature usage. */
|
|
49
|
+
readonly usage: UsageClient;
|
|
50
|
+
/** Manage customer wallet balances. */
|
|
51
|
+
readonly wallets: WalletsClient;
|
|
52
|
+
/** Verify inbound webhook signatures. */
|
|
53
|
+
readonly webhooks: WebhooksClient;
|
|
54
|
+
/** Query billing plans (read-only). */
|
|
55
|
+
readonly plans: PlansClient;
|
|
56
|
+
/** Query billing invoices (read-only). */
|
|
57
|
+
readonly invoices: InvoicesClient;
|
|
58
|
+
/** Administrative operations for plans, entitlements, integrations, and environments. */
|
|
59
|
+
readonly admin: AdminClient;
|
|
60
|
+
private readonly config;
|
|
61
|
+
/**
|
|
62
|
+
* Create a new Revstack SDK instance.
|
|
63
|
+
*
|
|
64
|
+
* @param options - Configuration options including the secret API key.
|
|
65
|
+
* @throws {Error} If `secretKey` is missing.
|
|
66
|
+
*/
|
|
67
|
+
constructor(options: RevstackOptions);
|
|
68
|
+
}
|
|
69
|
+
export { RevstackError, RevstackAPIError, RateLimitError, SignatureVerificationError, } from "@/errors";
|
|
70
|
+
export type { RevstackOptions, Customer, IdentifyCustomerParams, UpdateCustomerParams, Subscription, CreateSubscriptionParams, ChangePlanParams, ListSubscriptionsParams, Entitlement, EntitlementCheckOptions, EntitlementCheckResult, UsageMeter, ReportUsageParams, RevertUsageParams, BalanceResponse, GrantBalanceParams, RevokeBalanceParams, Plan, Price, PlanEntitlement, ListPlansParams, Invoice, ListInvoicesParams, WebhookEvent, ListParams, PaginatedResponse, CreatePlanParams, UpdatePlanParams, UpsertPlanParams, UpsertPriceInput, UpsertPlanEntitlementInput, CreateEntitlementParams, UpdateEntitlementParams, UpsertEntitlementParams, Integration, CreateIntegrationParams, UpdateIntegrationParams, ProviderEvent, IntegrationMetric, ListIntegrationsParams, ListProviderEventsParams, ListMetricsParams, Environment, CreateEnvironmentParams, UpdateEnvironmentParams, } from "@/types";
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;;;GASG;AACH,qBAAa,QAAQ;IAGnB,0CAA0C;IAC1C,SAAgB,SAAS,EAAE,eAAe,CAAC;IAC3C,gDAAgD;IAChD,SAAgB,aAAa,EAAE,mBAAmB,CAAC;IACnD,mDAAmD;IACnD,SAAgB,YAAY,EAAE,kBAAkB,CAAC;IACjD,8CAA8C;IAC9C,SAAgB,KAAK,EAAE,WAAW,CAAC;IACnC,uCAAuC;IACvC,SAAgB,OAAO,EAAE,aAAa,CAAC;IACvC,yCAAyC;IACzC,SAAgB,QAAQ,EAAE,cAAc,CAAC;IACzC,uCAAuC;IACvC,SAAgB,KAAK,EAAE,WAAW,CAAC;IACnC,0CAA0C;IAC1C,SAAgB,QAAQ,EAAE,cAAc,CAAC;IAIzC,yFAAyF;IACzF,SAAgB,KAAK,EAAE,WAAW,CAAC;IAEnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAIrB;IAEF;;;;;OAKG;gBACS,OAAO,EAAE,eAAe;CA0BrC;AAGD,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,0BAA0B,GAC3B,MAAM,UAAU,CAAC;AAGlB,YAAY,EACV,eAAe,EACf,QAAQ,EACR,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,EACX,uBAAuB,EACvB,sBAAsB,EACtB,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,IAAI,EACJ,KAAK,EACL,eAAe,EACf,eAAe,EACf,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,iBAAiB,EAGjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,WAAW,EACX,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACX,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @revstackhq/node
|
|
3
|
+
* @description Official Node.js SDK for Revstack — billing infrastructure for SaaS.
|
|
4
|
+
*
|
|
5
|
+
* The SDK provides two namespaces:
|
|
6
|
+
* - **Data Plane** (`revstack.*`) — Daily backend operations: entitlement checks, usage reporting, subscriptions.
|
|
7
|
+
* - **Control Plane** (`revstack.admin.*`) — Infrastructure management: plan CRUD, Billing as Code sync.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { Revstack, RateLimitError } from "@revstackhq/node";
|
|
12
|
+
*
|
|
13
|
+
* const revstack = new Revstack({ secretKey: "sk_live_..." });
|
|
14
|
+
*
|
|
15
|
+
* // Data Plane: check if a customer can use a feature
|
|
16
|
+
* const { allowed } = await revstack.entitlements.check("usr_abc", "api-calls");
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @packageDocumentation
|
|
20
|
+
*/
|
|
21
|
+
import { EntitlementsClient } from "@/modules/entitlements";
|
|
22
|
+
import { WalletsClient } from "@/modules/wallets";
|
|
23
|
+
import { CustomersClient } from "@/modules/customers";
|
|
24
|
+
import { UsageClient } from "@/modules/usage";
|
|
25
|
+
import { SubscriptionsClient } from "@/modules/subscriptions";
|
|
26
|
+
import { PlansClient } from "@/modules/plans";
|
|
27
|
+
import { InvoicesClient } from "@/modules/invoices";
|
|
28
|
+
import { WebhooksClient } from "@/modules/webhooks";
|
|
29
|
+
import { AdminClient } from "@/modules/admin";
|
|
30
|
+
/**
|
|
31
|
+
* Main SDK client. Initialize with your secret key to access all modules.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const revstack = new Revstack({
|
|
36
|
+
* secretKey: process.env.REVSTACK_SECRET_KEY!,
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export class Revstack {
|
|
41
|
+
// ─── Data Plane (S2S) ──────────────────────────
|
|
42
|
+
/** Manage end-user (customer) records. */
|
|
43
|
+
customers;
|
|
44
|
+
/** Create, cancel, and manage subscriptions. */
|
|
45
|
+
subscriptions;
|
|
46
|
+
/** Check feature access and query entitlements. */
|
|
47
|
+
entitlements;
|
|
48
|
+
/** Report and query metered feature usage. */
|
|
49
|
+
usage;
|
|
50
|
+
/** Manage customer wallet balances. */
|
|
51
|
+
wallets;
|
|
52
|
+
/** Verify inbound webhook signatures. */
|
|
53
|
+
webhooks;
|
|
54
|
+
/** Query billing plans (read-only). */
|
|
55
|
+
plans;
|
|
56
|
+
/** Query billing invoices (read-only). */
|
|
57
|
+
invoices;
|
|
58
|
+
// ─── Control Plane (CLI / Admin) ───────────────
|
|
59
|
+
/** Administrative operations for plans, entitlements, integrations, and environments. */
|
|
60
|
+
admin;
|
|
61
|
+
config;
|
|
62
|
+
/**
|
|
63
|
+
* Create a new Revstack SDK instance.
|
|
64
|
+
*
|
|
65
|
+
* @param options - Configuration options including the secret API key.
|
|
66
|
+
* @throws {Error} If `secretKey` is missing.
|
|
67
|
+
*/
|
|
68
|
+
constructor(options) {
|
|
69
|
+
if (!options.secretKey) {
|
|
70
|
+
throw new Error("Revstack: Secret Key is required. Get yours at https://app.revstack.dev");
|
|
71
|
+
}
|
|
72
|
+
this.config = {
|
|
73
|
+
secretKey: options.secretKey,
|
|
74
|
+
baseUrl: options.baseUrl || "https://app.revstack.dev/api/v1",
|
|
75
|
+
timeout: options.timeout || 10000,
|
|
76
|
+
};
|
|
77
|
+
// Data Plane
|
|
78
|
+
this.customers = new CustomersClient(this.config);
|
|
79
|
+
this.subscriptions = new SubscriptionsClient(this.config);
|
|
80
|
+
this.entitlements = new EntitlementsClient(this.config);
|
|
81
|
+
this.usage = new UsageClient(this.config);
|
|
82
|
+
this.wallets = new WalletsClient(this.config);
|
|
83
|
+
this.webhooks = new WebhooksClient();
|
|
84
|
+
this.plans = new PlansClient(this.config);
|
|
85
|
+
this.invoices = new InvoicesClient(this.config);
|
|
86
|
+
// Control Plane
|
|
87
|
+
this.admin = new AdminClient(this.config);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// ─── Errors ──────────────────────────────────────
|
|
91
|
+
export { RevstackError, RevstackAPIError, RateLimitError, SignatureVerificationError, } from "@/errors";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { Entitlement, CreateEntitlementParams, UpdateEntitlementParams, UpsertEntitlementParams, ListParams, PaginatedResponse } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Admin client for managing entitlement definitions (CRUD + upsert).
|
|
5
|
+
* Entitlements define the features and capabilities that can be gated behind plans.
|
|
6
|
+
*
|
|
7
|
+
* The `upsert()` method is idempotent by `slug`, making it safe for repeated
|
|
8
|
+
* CLI deployments without creating duplicates.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* await revstack.admin.entitlements.upsert({
|
|
13
|
+
* slug: "api-calls",
|
|
14
|
+
* name: "API Calls",
|
|
15
|
+
* type: "metered",
|
|
16
|
+
* unitType: "count",
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class AdminEntitlementsClient extends BaseClient {
|
|
21
|
+
constructor(config: {
|
|
22
|
+
secretKey: string;
|
|
23
|
+
baseUrl: string;
|
|
24
|
+
timeout: number;
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* List all entitlement definitions with optional pagination.
|
|
28
|
+
*
|
|
29
|
+
* @param params - Pagination parameters.
|
|
30
|
+
* @returns A paginated list of entitlements.
|
|
31
|
+
*/
|
|
32
|
+
list(params?: ListParams): Promise<PaginatedResponse<Entitlement>>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a single entitlement definition by ID.
|
|
35
|
+
*
|
|
36
|
+
* @param entitlementId - The entitlement's unique identifier.
|
|
37
|
+
* @returns The entitlement definition.
|
|
38
|
+
*/
|
|
39
|
+
get(entitlementId: string): Promise<Entitlement>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a new entitlement definition.
|
|
42
|
+
*
|
|
43
|
+
* @param params - Entitlement creation parameters.
|
|
44
|
+
* @returns The newly created entitlement.
|
|
45
|
+
*/
|
|
46
|
+
create(params: CreateEntitlementParams): Promise<Entitlement>;
|
|
47
|
+
/**
|
|
48
|
+
* Partially update an existing entitlement definition.
|
|
49
|
+
*
|
|
50
|
+
* @param entitlementId - The entitlement's unique identifier.
|
|
51
|
+
* @param params - Fields to update.
|
|
52
|
+
* @returns The updated entitlement.
|
|
53
|
+
*/
|
|
54
|
+
update(entitlementId: string, params: UpdateEntitlementParams): Promise<Entitlement>;
|
|
55
|
+
/**
|
|
56
|
+
* Delete an entitlement definition. Fails if any active plans reference it.
|
|
57
|
+
*
|
|
58
|
+
* @param entitlementId - The entitlement's unique identifier.
|
|
59
|
+
* @returns Confirmation of deletion.
|
|
60
|
+
*/
|
|
61
|
+
delete(entitlementId: string): Promise<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Idempotently create or update an entitlement by its `slug`.
|
|
66
|
+
* If an entitlement with the given slug exists, it is updated; otherwise, it is created.
|
|
67
|
+
*
|
|
68
|
+
* @param params - Full entitlement state.
|
|
69
|
+
* @returns The created or updated entitlement.
|
|
70
|
+
*/
|
|
71
|
+
upsert(params: UpsertEntitlementParams): Promise<Entitlement>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=entitlements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entitlements.d.ts","sourceRoot":"","sources":["../../../../src/modules/admin/entitlements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,UAAU,EACV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,uBAAwB,SAAQ,UAAU;gBACzC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAI3E;;;;;OAKG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAOxE;;;;;OAKG;IACG,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAMtD;;;;;OAKG;IACG,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC;IAOnE;;;;;;OAMG;IACG,MAAM,CACV,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,WAAW,CAAC;IAOvB;;;;;OAKG;IACG,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAOlE;;;;;;OAMG;IACG,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC;CAMpE"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Admin client for managing entitlement definitions (CRUD + upsert).
|
|
4
|
+
* Entitlements define the features and capabilities that can be gated behind plans.
|
|
5
|
+
*
|
|
6
|
+
* The `upsert()` method is idempotent by `slug`, making it safe for repeated
|
|
7
|
+
* CLI deployments without creating duplicates.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* await revstack.admin.entitlements.upsert({
|
|
12
|
+
* slug: "api-calls",
|
|
13
|
+
* name: "API Calls",
|
|
14
|
+
* type: "metered",
|
|
15
|
+
* unitType: "count",
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export class AdminEntitlementsClient extends BaseClient {
|
|
20
|
+
constructor(config) {
|
|
21
|
+
super(config);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* List all entitlement definitions with optional pagination.
|
|
25
|
+
*
|
|
26
|
+
* @param params - Pagination parameters.
|
|
27
|
+
* @returns A paginated list of entitlements.
|
|
28
|
+
*/
|
|
29
|
+
async list(params) {
|
|
30
|
+
return this.request(`/admin/entitlements${this.buildQuery(params)}`, { method: "GET" });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve a single entitlement definition by ID.
|
|
34
|
+
*
|
|
35
|
+
* @param entitlementId - The entitlement's unique identifier.
|
|
36
|
+
* @returns The entitlement definition.
|
|
37
|
+
*/
|
|
38
|
+
async get(entitlementId) {
|
|
39
|
+
return this.request(`/admin/entitlements/${entitlementId}`, {
|
|
40
|
+
method: "GET",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create a new entitlement definition.
|
|
45
|
+
*
|
|
46
|
+
* @param params - Entitlement creation parameters.
|
|
47
|
+
* @returns The newly created entitlement.
|
|
48
|
+
*/
|
|
49
|
+
async create(params) {
|
|
50
|
+
return this.request("/admin/entitlements", {
|
|
51
|
+
method: "POST",
|
|
52
|
+
body: JSON.stringify(params),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Partially update an existing entitlement definition.
|
|
57
|
+
*
|
|
58
|
+
* @param entitlementId - The entitlement's unique identifier.
|
|
59
|
+
* @param params - Fields to update.
|
|
60
|
+
* @returns The updated entitlement.
|
|
61
|
+
*/
|
|
62
|
+
async update(entitlementId, params) {
|
|
63
|
+
return this.request(`/admin/entitlements/${entitlementId}`, {
|
|
64
|
+
method: "PATCH",
|
|
65
|
+
body: JSON.stringify(params),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Delete an entitlement definition. Fails if any active plans reference it.
|
|
70
|
+
*
|
|
71
|
+
* @param entitlementId - The entitlement's unique identifier.
|
|
72
|
+
* @returns Confirmation of deletion.
|
|
73
|
+
*/
|
|
74
|
+
async delete(entitlementId) {
|
|
75
|
+
return this.request(`/admin/entitlements/${entitlementId}`, { method: "DELETE" });
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Idempotently create or update an entitlement by its `slug`.
|
|
79
|
+
* If an entitlement with the given slug exists, it is updated; otherwise, it is created.
|
|
80
|
+
*
|
|
81
|
+
* @param params - Full entitlement state.
|
|
82
|
+
* @returns The created or updated entitlement.
|
|
83
|
+
*/
|
|
84
|
+
async upsert(params) {
|
|
85
|
+
return this.request("/admin/entitlements", {
|
|
86
|
+
method: "PUT",
|
|
87
|
+
body: JSON.stringify(params),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { Environment, CreateEnvironmentParams, UpdateEnvironmentParams, ListParams, PaginatedResponse } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Admin client for managing deployment environments.
|
|
5
|
+
* Each environment has its own API keys, auth configuration, and integrations.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Create a staging environment
|
|
10
|
+
* const env = await revstack.admin.environments.create({
|
|
11
|
+
* name: "staging",
|
|
12
|
+
* authProvider: "supabase",
|
|
13
|
+
* authJwksUri: "https://my-project.supabase.co/.well-known/jwks.json",
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* // Rotate API keys after a security incident
|
|
17
|
+
* const newKeys = await revstack.admin.environments.rotateKeys(env.id);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class AdminEnvironmentsClient extends BaseClient {
|
|
21
|
+
constructor(config: {
|
|
22
|
+
secretKey: string;
|
|
23
|
+
baseUrl: string;
|
|
24
|
+
timeout: number;
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* List all environments with optional pagination.
|
|
28
|
+
*
|
|
29
|
+
* @param params - Pagination parameters.
|
|
30
|
+
* @returns A paginated list of environments.
|
|
31
|
+
*/
|
|
32
|
+
list(params?: ListParams): Promise<PaginatedResponse<Environment>>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a single environment by ID.
|
|
35
|
+
*
|
|
36
|
+
* @param environmentId - The environment's unique identifier.
|
|
37
|
+
* @returns The environment record including API keys and auth config.
|
|
38
|
+
*/
|
|
39
|
+
get(environmentId: string): Promise<Environment>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a new deployment environment.
|
|
42
|
+
*
|
|
43
|
+
* @param params - Environment creation parameters.
|
|
44
|
+
* @returns The newly created environment with generated API keys.
|
|
45
|
+
*/
|
|
46
|
+
create(params: CreateEnvironmentParams): Promise<Environment>;
|
|
47
|
+
/**
|
|
48
|
+
* Update an existing environment's name or auth configuration.
|
|
49
|
+
*
|
|
50
|
+
* @param environmentId - The environment's unique identifier.
|
|
51
|
+
* @param params - Fields to update.
|
|
52
|
+
* @returns The updated environment.
|
|
53
|
+
*/
|
|
54
|
+
update(environmentId: string, params: UpdateEnvironmentParams): Promise<Environment>;
|
|
55
|
+
/**
|
|
56
|
+
* Delete an environment. This invalidates its API keys immediately.
|
|
57
|
+
*
|
|
58
|
+
* @param environmentId - The environment's unique identifier.
|
|
59
|
+
* @returns Confirmation of deletion.
|
|
60
|
+
*/
|
|
61
|
+
delete(environmentId: string): Promise<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Rotate both the public and secret API keys for an environment.
|
|
66
|
+
* The old keys become invalid immediately. Use this after a security incident.
|
|
67
|
+
*
|
|
68
|
+
* @param environmentId - The environment whose keys to rotate.
|
|
69
|
+
* @returns The new API key pair.
|
|
70
|
+
*/
|
|
71
|
+
rotateKeys(environmentId: string): Promise<{
|
|
72
|
+
apiKeyPublic: string;
|
|
73
|
+
apiKeySecret: string;
|
|
74
|
+
}>;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=environments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environments.d.ts","sourceRoot":"","sources":["../../../../src/modules/admin/environments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,uBAAuB,EACvB,UAAU,EACV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,uBAAwB,SAAQ,UAAU;gBACzC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAI3E;;;;;OAKG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAOxE;;;;;OAKG;IACG,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAMtD;;;;;OAKG;IACG,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC;IAOnE;;;;;;OAMG;IACG,MAAM,CACV,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,WAAW,CAAC;IAOvB;;;;;OAKG;IACG,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAOlE;;;;;;OAMG;IACG,UAAU,CACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CAM3D"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Admin client for managing deployment environments.
|
|
4
|
+
* Each environment has its own API keys, auth configuration, and integrations.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // Create a staging environment
|
|
9
|
+
* const env = await revstack.admin.environments.create({
|
|
10
|
+
* name: "staging",
|
|
11
|
+
* authProvider: "supabase",
|
|
12
|
+
* authJwksUri: "https://my-project.supabase.co/.well-known/jwks.json",
|
|
13
|
+
* });
|
|
14
|
+
*
|
|
15
|
+
* // Rotate API keys after a security incident
|
|
16
|
+
* const newKeys = await revstack.admin.environments.rotateKeys(env.id);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export class AdminEnvironmentsClient extends BaseClient {
|
|
20
|
+
constructor(config) {
|
|
21
|
+
super(config);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* List all environments with optional pagination.
|
|
25
|
+
*
|
|
26
|
+
* @param params - Pagination parameters.
|
|
27
|
+
* @returns A paginated list of environments.
|
|
28
|
+
*/
|
|
29
|
+
async list(params) {
|
|
30
|
+
return this.request(`/admin/environments${this.buildQuery(params)}`, { method: "GET" });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve a single environment by ID.
|
|
34
|
+
*
|
|
35
|
+
* @param environmentId - The environment's unique identifier.
|
|
36
|
+
* @returns The environment record including API keys and auth config.
|
|
37
|
+
*/
|
|
38
|
+
async get(environmentId) {
|
|
39
|
+
return this.request(`/admin/environments/${environmentId}`, {
|
|
40
|
+
method: "GET",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create a new deployment environment.
|
|
45
|
+
*
|
|
46
|
+
* @param params - Environment creation parameters.
|
|
47
|
+
* @returns The newly created environment with generated API keys.
|
|
48
|
+
*/
|
|
49
|
+
async create(params) {
|
|
50
|
+
return this.request("/admin/environments", {
|
|
51
|
+
method: "POST",
|
|
52
|
+
body: JSON.stringify(params),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Update an existing environment's name or auth configuration.
|
|
57
|
+
*
|
|
58
|
+
* @param environmentId - The environment's unique identifier.
|
|
59
|
+
* @param params - Fields to update.
|
|
60
|
+
* @returns The updated environment.
|
|
61
|
+
*/
|
|
62
|
+
async update(environmentId, params) {
|
|
63
|
+
return this.request(`/admin/environments/${environmentId}`, {
|
|
64
|
+
method: "PATCH",
|
|
65
|
+
body: JSON.stringify(params),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Delete an environment. This invalidates its API keys immediately.
|
|
70
|
+
*
|
|
71
|
+
* @param environmentId - The environment's unique identifier.
|
|
72
|
+
* @returns Confirmation of deletion.
|
|
73
|
+
*/
|
|
74
|
+
async delete(environmentId) {
|
|
75
|
+
return this.request(`/admin/environments/${environmentId}`, { method: "DELETE" });
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Rotate both the public and secret API keys for an environment.
|
|
79
|
+
* The old keys become invalid immediately. Use this after a security incident.
|
|
80
|
+
*
|
|
81
|
+
* @param environmentId - The environment whose keys to rotate.
|
|
82
|
+
* @returns The new API key pair.
|
|
83
|
+
*/
|
|
84
|
+
async rotateKeys(environmentId) {
|
|
85
|
+
return this.request(`/admin/environments/${environmentId}/rotate-keys`, { method: "POST" });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AdminPlansClient } from "@/modules/admin/plans";
|
|
2
|
+
import { AdminEntitlementsClient } from "@/modules/admin/entitlements";
|
|
3
|
+
import { AdminIntegrationsClient } from "@/modules/admin/integrations";
|
|
4
|
+
import { AdminEnvironmentsClient } from "@/modules/admin/environments";
|
|
5
|
+
export declare class AdminClient {
|
|
6
|
+
readonly plans: AdminPlansClient;
|
|
7
|
+
readonly entitlements: AdminEntitlementsClient;
|
|
8
|
+
readonly integrations: AdminIntegrationsClient;
|
|
9
|
+
readonly environments: AdminEnvironmentsClient;
|
|
10
|
+
constructor(config: {
|
|
11
|
+
secretKey: string;
|
|
12
|
+
baseUrl: string;
|
|
13
|
+
timeout: number;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/admin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,qBAAa,WAAW;IACtB,SAAgB,KAAK,EAAE,gBAAgB,CAAC;IACxC,SAAgB,YAAY,EAAE,uBAAuB,CAAC;IACtD,SAAgB,YAAY,EAAE,uBAAuB,CAAC;IACtD,SAAgB,YAAY,EAAE,uBAAuB,CAAC;gBAE1C,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CAM5E"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AdminPlansClient } from "@/modules/admin/plans";
|
|
2
|
+
import { AdminEntitlementsClient } from "@/modules/admin/entitlements";
|
|
3
|
+
import { AdminIntegrationsClient } from "@/modules/admin/integrations";
|
|
4
|
+
import { AdminEnvironmentsClient } from "@/modules/admin/environments";
|
|
5
|
+
export class AdminClient {
|
|
6
|
+
plans;
|
|
7
|
+
entitlements;
|
|
8
|
+
integrations;
|
|
9
|
+
environments;
|
|
10
|
+
constructor(config) {
|
|
11
|
+
this.plans = new AdminPlansClient(config);
|
|
12
|
+
this.entitlements = new AdminEntitlementsClient(config);
|
|
13
|
+
this.integrations = new AdminIntegrationsClient(config);
|
|
14
|
+
this.environments = new AdminEnvironmentsClient(config);
|
|
15
|
+
}
|
|
16
|
+
}
|