@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,84 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { Integration, CreateIntegrationParams, UpdateIntegrationParams, ListIntegrationsParams, ProviderEvent, ListProviderEventsParams, IntegrationMetric, ListMetricsParams, PaginatedResponse } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Admin client for managing payment provider integrations.
|
|
5
|
+
* Supports CRUD operations on integrations (e.g. Stripe, Paddle) and
|
|
6
|
+
* read access to their webhook events and hourly metrics.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // Create a Stripe integration
|
|
11
|
+
* await revstack.admin.integrations.create({
|
|
12
|
+
* provider: "stripe",
|
|
13
|
+
* credentials: { apiKey: "sk_live_..." },
|
|
14
|
+
* webhookSecret: "whsec_...",
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // View recent webhook events
|
|
18
|
+
* const { data: events } = await revstack.admin.integrations.listEvents("int_abc");
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class AdminIntegrationsClient extends BaseClient {
|
|
22
|
+
constructor(config: {
|
|
23
|
+
secretKey: string;
|
|
24
|
+
baseUrl: string;
|
|
25
|
+
timeout: number;
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* List all integrations with optional filters.
|
|
29
|
+
*
|
|
30
|
+
* @param params - Filter and pagination parameters.
|
|
31
|
+
* @returns A paginated list of integrations.
|
|
32
|
+
*/
|
|
33
|
+
list(params?: ListIntegrationsParams): Promise<PaginatedResponse<Integration>>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve a single integration by ID.
|
|
36
|
+
*
|
|
37
|
+
* @param integrationId - The integration's unique identifier.
|
|
38
|
+
* @returns The integration record.
|
|
39
|
+
*/
|
|
40
|
+
get(integrationId: string): Promise<Integration>;
|
|
41
|
+
/**
|
|
42
|
+
* Create a new payment provider integration.
|
|
43
|
+
*
|
|
44
|
+
* @param params - Integration creation parameters.
|
|
45
|
+
* @returns The newly created integration.
|
|
46
|
+
*/
|
|
47
|
+
create(params: CreateIntegrationParams): Promise<Integration>;
|
|
48
|
+
/**
|
|
49
|
+
* Update an existing integration's credentials, webhook secret, or active status.
|
|
50
|
+
*
|
|
51
|
+
* @param integrationId - The integration's unique identifier.
|
|
52
|
+
* @param params - Fields to update.
|
|
53
|
+
* @returns The updated integration.
|
|
54
|
+
*/
|
|
55
|
+
update(integrationId: string, params: UpdateIntegrationParams): Promise<Integration>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete an integration. This stops webhook processing for the provider.
|
|
58
|
+
*
|
|
59
|
+
* @param integrationId - The integration's unique identifier.
|
|
60
|
+
* @returns Confirmation of deletion.
|
|
61
|
+
*/
|
|
62
|
+
delete(integrationId: string): Promise<{
|
|
63
|
+
success: boolean;
|
|
64
|
+
}>;
|
|
65
|
+
/**
|
|
66
|
+
* List webhook events received by an integration.
|
|
67
|
+
* Useful for debugging webhook delivery and processing issues.
|
|
68
|
+
*
|
|
69
|
+
* @param integrationId - The integration to query events for.
|
|
70
|
+
* @param params - Filter and pagination parameters.
|
|
71
|
+
* @returns A paginated list of provider events.
|
|
72
|
+
*/
|
|
73
|
+
listEvents(integrationId: string, params?: ListProviderEventsParams): Promise<PaginatedResponse<ProviderEvent>>;
|
|
74
|
+
/**
|
|
75
|
+
* List hourly aggregated metrics for an integration.
|
|
76
|
+
* Shows volume processed and event counts per hour.
|
|
77
|
+
*
|
|
78
|
+
* @param integrationId - The integration to query metrics for.
|
|
79
|
+
* @param params - Time range and pagination parameters.
|
|
80
|
+
* @returns A paginated list of hourly metrics.
|
|
81
|
+
*/
|
|
82
|
+
listMetrics(integrationId: string, params?: ListMetricsParams): Promise<PaginatedResponse<IntegrationMetric>>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../../src/modules/admin/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;GAiBG;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,CACR,MAAM,CAAC,EAAE,sBAAsB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAO1C;;;;;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;;;;;;;OAOG;IACG,UAAU,CACd,aAAa,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAO5C;;;;;;;OAOG;IACG,WAAW,CACf,aAAa,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAMjD"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Admin client for managing payment provider integrations.
|
|
4
|
+
* Supports CRUD operations on integrations (e.g. Stripe, Paddle) and
|
|
5
|
+
* read access to their webhook events and hourly metrics.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Create a Stripe integration
|
|
10
|
+
* await revstack.admin.integrations.create({
|
|
11
|
+
* provider: "stripe",
|
|
12
|
+
* credentials: { apiKey: "sk_live_..." },
|
|
13
|
+
* webhookSecret: "whsec_...",
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* // View recent webhook events
|
|
17
|
+
* const { data: events } = await revstack.admin.integrations.listEvents("int_abc");
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export class AdminIntegrationsClient extends BaseClient {
|
|
21
|
+
constructor(config) {
|
|
22
|
+
super(config);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List all integrations with optional filters.
|
|
26
|
+
*
|
|
27
|
+
* @param params - Filter and pagination parameters.
|
|
28
|
+
* @returns A paginated list of integrations.
|
|
29
|
+
*/
|
|
30
|
+
async list(params) {
|
|
31
|
+
return this.request(`/admin/integrations${this.buildQuery(params)}`, { method: "GET" });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a single integration by ID.
|
|
35
|
+
*
|
|
36
|
+
* @param integrationId - The integration's unique identifier.
|
|
37
|
+
* @returns The integration record.
|
|
38
|
+
*/
|
|
39
|
+
async get(integrationId) {
|
|
40
|
+
return this.request(`/admin/integrations/${integrationId}`, {
|
|
41
|
+
method: "GET",
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create a new payment provider integration.
|
|
46
|
+
*
|
|
47
|
+
* @param params - Integration creation parameters.
|
|
48
|
+
* @returns The newly created integration.
|
|
49
|
+
*/
|
|
50
|
+
async create(params) {
|
|
51
|
+
return this.request("/admin/integrations", {
|
|
52
|
+
method: "POST",
|
|
53
|
+
body: JSON.stringify(params),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Update an existing integration's credentials, webhook secret, or active status.
|
|
58
|
+
*
|
|
59
|
+
* @param integrationId - The integration's unique identifier.
|
|
60
|
+
* @param params - Fields to update.
|
|
61
|
+
* @returns The updated integration.
|
|
62
|
+
*/
|
|
63
|
+
async update(integrationId, params) {
|
|
64
|
+
return this.request(`/admin/integrations/${integrationId}`, {
|
|
65
|
+
method: "PATCH",
|
|
66
|
+
body: JSON.stringify(params),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Delete an integration. This stops webhook processing for the provider.
|
|
71
|
+
*
|
|
72
|
+
* @param integrationId - The integration's unique identifier.
|
|
73
|
+
* @returns Confirmation of deletion.
|
|
74
|
+
*/
|
|
75
|
+
async delete(integrationId) {
|
|
76
|
+
return this.request(`/admin/integrations/${integrationId}`, { method: "DELETE" });
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* List webhook events received by an integration.
|
|
80
|
+
* Useful for debugging webhook delivery and processing issues.
|
|
81
|
+
*
|
|
82
|
+
* @param integrationId - The integration to query events for.
|
|
83
|
+
* @param params - Filter and pagination parameters.
|
|
84
|
+
* @returns A paginated list of provider events.
|
|
85
|
+
*/
|
|
86
|
+
async listEvents(integrationId, params) {
|
|
87
|
+
return this.request(`/admin/integrations/${integrationId}/events${this.buildQuery(params)}`, { method: "GET" });
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* List hourly aggregated metrics for an integration.
|
|
91
|
+
* Shows volume processed and event counts per hour.
|
|
92
|
+
*
|
|
93
|
+
* @param integrationId - The integration to query metrics for.
|
|
94
|
+
* @param params - Time range and pagination parameters.
|
|
95
|
+
* @returns A paginated list of hourly metrics.
|
|
96
|
+
*/
|
|
97
|
+
async listMetrics(integrationId, params) {
|
|
98
|
+
return this.request(`/admin/integrations/${integrationId}/metrics${this.buildQuery(params)}`, { method: "GET" });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { Plan, CreatePlanParams, UpdatePlanParams, UpsertPlanParams, ListPlansParams, PaginatedResponse } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Admin client for managing billing plans (CRUD + upsert).
|
|
5
|
+
* Used by the CLI (`npx revstack push`) and advanced integrations.
|
|
6
|
+
*
|
|
7
|
+
* The `upsert()` method is the primary primitive for Billing as Code —
|
|
8
|
+
* it creates or updates a plan by its `slug`, making deployments idempotent.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* await revstack.admin.plans.upsert({
|
|
13
|
+
* slug: "pro",
|
|
14
|
+
* name: "Pro",
|
|
15
|
+
* status: "active",
|
|
16
|
+
* prices: [{ amount: 4900, currency: "USD", billingInterval: "month" }],
|
|
17
|
+
* entitlements: [{ entitlementSlug: "api-calls", valueLimit: 10000 }],
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class AdminPlansClient extends BaseClient {
|
|
22
|
+
constructor(config: {
|
|
23
|
+
secretKey: string;
|
|
24
|
+
baseUrl: string;
|
|
25
|
+
timeout: number;
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* List all plans with optional filters.
|
|
29
|
+
*
|
|
30
|
+
* @param params - Filter and pagination parameters.
|
|
31
|
+
* @returns A paginated list of plans.
|
|
32
|
+
*/
|
|
33
|
+
list(params?: ListPlansParams): Promise<PaginatedResponse<Plan>>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve a plan by ID, including nested prices and entitlements.
|
|
36
|
+
*
|
|
37
|
+
* @param planId - The plan's unique identifier.
|
|
38
|
+
* @returns The plan with populated `prices[]` and `entitlements[]`.
|
|
39
|
+
*/
|
|
40
|
+
get(planId: string): Promise<Plan>;
|
|
41
|
+
/**
|
|
42
|
+
* Create a new billing plan with optional prices and entitlements.
|
|
43
|
+
*
|
|
44
|
+
* @param params - Plan creation parameters.
|
|
45
|
+
* @returns The newly created plan.
|
|
46
|
+
*/
|
|
47
|
+
create(params: CreatePlanParams): Promise<Plan>;
|
|
48
|
+
/**
|
|
49
|
+
* Partially update an existing plan's attributes.
|
|
50
|
+
* Does not modify prices or entitlements — use `upsert()` for that.
|
|
51
|
+
*
|
|
52
|
+
* @param planId - The plan's unique identifier.
|
|
53
|
+
* @param params - Fields to update.
|
|
54
|
+
* @returns The updated plan.
|
|
55
|
+
*/
|
|
56
|
+
update(planId: string, params: UpdatePlanParams): Promise<Plan>;
|
|
57
|
+
/**
|
|
58
|
+
* Delete a plan. Fails if the plan has active subscriptions.
|
|
59
|
+
*
|
|
60
|
+
* @param planId - The plan's unique identifier.
|
|
61
|
+
* @returns Confirmation of deletion.
|
|
62
|
+
*/
|
|
63
|
+
delete(planId: string): Promise<{
|
|
64
|
+
success: boolean;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Idempotently create or update a plan by its `slug`.
|
|
68
|
+
* This is the primary method used by the CLI for Billing as Code deployments.
|
|
69
|
+
* If a plan with the given slug exists, it is updated; otherwise, it is created.
|
|
70
|
+
* Nested prices and entitlements are replaced atomically.
|
|
71
|
+
*
|
|
72
|
+
* @param params - Full plan state including prices and entitlements.
|
|
73
|
+
* @returns The created or updated plan.
|
|
74
|
+
*/
|
|
75
|
+
upsert(params: UpsertPlanParams): Promise<Plan>;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../../../src/modules/admin/plans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;gBAClC,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,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAOtE;;;;;OAKG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxC;;;;;OAKG;IACG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOrD;;;;;;;OAOG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOrE;;;;;OAKG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAM3D;;;;;;;;OAQG;IACG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAMtD"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Admin client for managing billing plans (CRUD + upsert).
|
|
4
|
+
* Used by the CLI (`npx revstack push`) and advanced integrations.
|
|
5
|
+
*
|
|
6
|
+
* The `upsert()` method is the primary primitive for Billing as Code —
|
|
7
|
+
* it creates or updates a plan by its `slug`, making deployments idempotent.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* await revstack.admin.plans.upsert({
|
|
12
|
+
* slug: "pro",
|
|
13
|
+
* name: "Pro",
|
|
14
|
+
* status: "active",
|
|
15
|
+
* prices: [{ amount: 4900, currency: "USD", billingInterval: "month" }],
|
|
16
|
+
* entitlements: [{ entitlementSlug: "api-calls", valueLimit: 10000 }],
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export class AdminPlansClient extends BaseClient {
|
|
21
|
+
constructor(config) {
|
|
22
|
+
super(config);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List all plans with optional filters.
|
|
26
|
+
*
|
|
27
|
+
* @param params - Filter and pagination parameters.
|
|
28
|
+
* @returns A paginated list of plans.
|
|
29
|
+
*/
|
|
30
|
+
async list(params) {
|
|
31
|
+
return this.request(`/admin/plans${this.buildQuery(params)}`, { method: "GET" });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a plan by ID, including nested prices and entitlements.
|
|
35
|
+
*
|
|
36
|
+
* @param planId - The plan's unique identifier.
|
|
37
|
+
* @returns The plan with populated `prices[]` and `entitlements[]`.
|
|
38
|
+
*/
|
|
39
|
+
async get(planId) {
|
|
40
|
+
return this.request(`/admin/plans/${planId}`, {
|
|
41
|
+
method: "GET",
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create a new billing plan with optional prices and entitlements.
|
|
46
|
+
*
|
|
47
|
+
* @param params - Plan creation parameters.
|
|
48
|
+
* @returns The newly created plan.
|
|
49
|
+
*/
|
|
50
|
+
async create(params) {
|
|
51
|
+
return this.request("/admin/plans", {
|
|
52
|
+
method: "POST",
|
|
53
|
+
body: JSON.stringify(params),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Partially update an existing plan's attributes.
|
|
58
|
+
* Does not modify prices or entitlements — use `upsert()` for that.
|
|
59
|
+
*
|
|
60
|
+
* @param planId - The plan's unique identifier.
|
|
61
|
+
* @param params - Fields to update.
|
|
62
|
+
* @returns The updated plan.
|
|
63
|
+
*/
|
|
64
|
+
async update(planId, params) {
|
|
65
|
+
return this.request(`/admin/plans/${planId}`, {
|
|
66
|
+
method: "PATCH",
|
|
67
|
+
body: JSON.stringify(params),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Delete a plan. Fails if the plan has active subscriptions.
|
|
72
|
+
*
|
|
73
|
+
* @param planId - The plan's unique identifier.
|
|
74
|
+
* @returns Confirmation of deletion.
|
|
75
|
+
*/
|
|
76
|
+
async delete(planId) {
|
|
77
|
+
return this.request(`/admin/plans/${planId}`, {
|
|
78
|
+
method: "DELETE",
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Idempotently create or update a plan by its `slug`.
|
|
83
|
+
* This is the primary method used by the CLI for Billing as Code deployments.
|
|
84
|
+
* If a plan with the given slug exists, it is updated; otherwise, it is created.
|
|
85
|
+
* Nested prices and entitlements are replaced atomically.
|
|
86
|
+
*
|
|
87
|
+
* @param params - Full plan state including prices and entitlements.
|
|
88
|
+
* @returns The created or updated plan.
|
|
89
|
+
*/
|
|
90
|
+
async upsert(params) {
|
|
91
|
+
return this.request("/admin/plans", {
|
|
92
|
+
method: "PUT",
|
|
93
|
+
body: JSON.stringify(params),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { SyncConfig, SyncResult, SyncPreview } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Admin client for the Billing as Code orchestrator.
|
|
5
|
+
* Provides atomic sync operations used by the CLI (`npx revstack push`) to
|
|
6
|
+
* apply the full desired state from `revstack.config.ts` in a single ACID
|
|
7
|
+
* Postgres transaction.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const config: SyncConfig = {
|
|
12
|
+
* plans: [
|
|
13
|
+
* { slug: "free", name: "Free", type: "free", status: "active" },
|
|
14
|
+
* { slug: "pro", name: "Pro", prices: [{ amount: 4900, billingInterval: "month" }] },
|
|
15
|
+
* ],
|
|
16
|
+
* entitlements: [
|
|
17
|
+
* { slug: "api-calls", name: "API Calls", type: "metered", unitType: "count" },
|
|
18
|
+
* ],
|
|
19
|
+
* };
|
|
20
|
+
*
|
|
21
|
+
* // Preview changes before applying
|
|
22
|
+
* const preview = await revstack.admin.system.preview(config);
|
|
23
|
+
* console.log(`${preview.changes.length} changes, breaking: ${preview.hasBreakingChanges}`);
|
|
24
|
+
*
|
|
25
|
+
* // Apply atomically
|
|
26
|
+
* const result = await revstack.admin.system.sync(config);
|
|
27
|
+
* console.log(`Applied ${result.applied.length} changes at ${result.timestamp}`);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare class AdminSystemClient extends BaseClient {
|
|
31
|
+
/**
|
|
32
|
+
* Apply the full desired billing state in a single ACID transaction.
|
|
33
|
+
* The Revstack Cloud backend computes the diff between the current state
|
|
34
|
+
* and the desired config, then applies all changes atomically.
|
|
35
|
+
*
|
|
36
|
+
* @param config - The complete desired state (plans + entitlements).
|
|
37
|
+
* @returns The list of changes that were applied and the execution timestamp.
|
|
38
|
+
*
|
|
39
|
+
* @throws {SyncConflictError} If the remote state has drifted unexpectedly (HTTP 409).
|
|
40
|
+
*/
|
|
41
|
+
sync(config: SyncConfig): Promise<SyncResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Preview the changes that would be applied by a `sync()` call.
|
|
44
|
+
* Returns the computed diff without applying any mutations.
|
|
45
|
+
* The CLI should **always** call this before `sync()` to show the operator
|
|
46
|
+
* what will change.
|
|
47
|
+
*
|
|
48
|
+
* @param config - The complete desired state (plans + entitlements).
|
|
49
|
+
* @returns A preview with the list of changes and whether any are breaking.
|
|
50
|
+
*/
|
|
51
|
+
preview(config: SyncConfig): Promise<SyncPreview>;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/modules/admin/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;IAC/C;;;;;;;;;OASG;IACG,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAOnD;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;CAMxD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Admin client for the Billing as Code orchestrator.
|
|
4
|
+
* Provides atomic sync operations used by the CLI (`npx revstack push`) to
|
|
5
|
+
* apply the full desired state from `revstack.config.ts` in a single ACID
|
|
6
|
+
* Postgres transaction.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const config: SyncConfig = {
|
|
11
|
+
* plans: [
|
|
12
|
+
* { slug: "free", name: "Free", type: "free", status: "active" },
|
|
13
|
+
* { slug: "pro", name: "Pro", prices: [{ amount: 4900, billingInterval: "month" }] },
|
|
14
|
+
* ],
|
|
15
|
+
* entitlements: [
|
|
16
|
+
* { slug: "api-calls", name: "API Calls", type: "metered", unitType: "count" },
|
|
17
|
+
* ],
|
|
18
|
+
* };
|
|
19
|
+
*
|
|
20
|
+
* // Preview changes before applying
|
|
21
|
+
* const preview = await revstack.admin.system.preview(config);
|
|
22
|
+
* console.log(`${preview.changes.length} changes, breaking: ${preview.hasBreakingChanges}`);
|
|
23
|
+
*
|
|
24
|
+
* // Apply atomically
|
|
25
|
+
* const result = await revstack.admin.system.sync(config);
|
|
26
|
+
* console.log(`Applied ${result.applied.length} changes at ${result.timestamp}`);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export class AdminSystemClient extends BaseClient {
|
|
30
|
+
/**
|
|
31
|
+
* Apply the full desired billing state in a single ACID transaction.
|
|
32
|
+
* The Revstack Cloud backend computes the diff between the current state
|
|
33
|
+
* and the desired config, then applies all changes atomically.
|
|
34
|
+
*
|
|
35
|
+
* @param config - The complete desired state (plans + entitlements).
|
|
36
|
+
* @returns The list of changes that were applied and the execution timestamp.
|
|
37
|
+
*
|
|
38
|
+
* @throws {SyncConflictError} If the remote state has drifted unexpectedly (HTTP 409).
|
|
39
|
+
*/
|
|
40
|
+
async sync(config) {
|
|
41
|
+
return this.request("/admin/system/sync", {
|
|
42
|
+
method: "POST",
|
|
43
|
+
body: JSON.stringify(config),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Preview the changes that would be applied by a `sync()` call.
|
|
48
|
+
* Returns the computed diff without applying any mutations.
|
|
49
|
+
* The CLI should **always** call this before `sync()` to show the operator
|
|
50
|
+
* what will change.
|
|
51
|
+
*
|
|
52
|
+
* @param config - The complete desired state (plans + entitlements).
|
|
53
|
+
* @returns A preview with the list of changes and whether any are breaking.
|
|
54
|
+
*/
|
|
55
|
+
async preview(config) {
|
|
56
|
+
return this.request("/admin/system/preview", {
|
|
57
|
+
method: "POST",
|
|
58
|
+
body: JSON.stringify(config),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base HTTP client shared by all SDK modules.
|
|
3
|
+
* Handles authentication, timeouts, idempotency headers, and typed error responses.
|
|
4
|
+
*
|
|
5
|
+
* @internal Not intended for direct use — all public modules extend this class.
|
|
6
|
+
*/
|
|
7
|
+
export declare class BaseClient {
|
|
8
|
+
protected config: {
|
|
9
|
+
secretKey: string;
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
timeout: number;
|
|
12
|
+
};
|
|
13
|
+
constructor(config: {
|
|
14
|
+
secretKey: string;
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
timeout: number;
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Builds a URL query string from an object of parameters.
|
|
20
|
+
* Filters out `null` and `undefined` values.
|
|
21
|
+
*
|
|
22
|
+
* @typeParam T - The parameter object type.
|
|
23
|
+
* @param params - Key-value pairs to encode as query parameters.
|
|
24
|
+
* @returns A query string prefixed with `?`, or an empty string if no params.
|
|
25
|
+
*/
|
|
26
|
+
protected buildQuery<T extends object>(params?: T): string;
|
|
27
|
+
/**
|
|
28
|
+
* Sends an authenticated HTTP request to the Revstack API.
|
|
29
|
+
*
|
|
30
|
+
* @typeParam T - Expected response body type.
|
|
31
|
+
* @param endpoint - API endpoint path (e.g. `/customers`).
|
|
32
|
+
* @param options - Fetch options with optional `idempotencyKey`.
|
|
33
|
+
* @returns Parsed JSON response body.
|
|
34
|
+
*
|
|
35
|
+
* @throws {RateLimitError} When the API returns HTTP 429.
|
|
36
|
+
* @throws {SyncConflictError} When `admin.system.sync()` detects a conflict (HTTP 409).
|
|
37
|
+
* @throws {RevstackAPIError} For all other non-2xx responses.
|
|
38
|
+
*/
|
|
39
|
+
protected request<T>(endpoint: string, options?: RequestInit & {
|
|
40
|
+
idempotencyKey?: string;
|
|
41
|
+
}): Promise<T>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/modules/base.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,qBAAa,UAAU;IAEnB,SAAS,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;gBAA/D,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAG3E;;;;;;;OAOG;IACH,SAAS,CAAC,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM;IAY1D;;;;;;;;;;;OAWG;cACa,OAAO,CAAC,CAAC,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,WAAW,GAAG;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAO,GACtD,OAAO,CAAC,CAAC,CAAC;CAsDd"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { RevstackAPIError, RateLimitError, SyncConflictError, } from "@/errors";
|
|
2
|
+
/**
|
|
3
|
+
* Base HTTP client shared by all SDK modules.
|
|
4
|
+
* Handles authentication, timeouts, idempotency headers, and typed error responses.
|
|
5
|
+
*
|
|
6
|
+
* @internal Not intended for direct use — all public modules extend this class.
|
|
7
|
+
*/
|
|
8
|
+
export class BaseClient {
|
|
9
|
+
config;
|
|
10
|
+
constructor(config) {
|
|
11
|
+
this.config = config;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Builds a URL query string from an object of parameters.
|
|
15
|
+
* Filters out `null` and `undefined` values.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam T - The parameter object type.
|
|
18
|
+
* @param params - Key-value pairs to encode as query parameters.
|
|
19
|
+
* @returns A query string prefixed with `?`, or an empty string if no params.
|
|
20
|
+
*/
|
|
21
|
+
buildQuery(params) {
|
|
22
|
+
if (!params)
|
|
23
|
+
return "";
|
|
24
|
+
const searchParams = new URLSearchParams();
|
|
25
|
+
for (const [key, value] of Object.entries(params)) {
|
|
26
|
+
if (value !== undefined && value !== null) {
|
|
27
|
+
searchParams.append(key, String(value));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const query = searchParams.toString();
|
|
31
|
+
return query ? `?${query}` : "";
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Sends an authenticated HTTP request to the Revstack API.
|
|
35
|
+
*
|
|
36
|
+
* @typeParam T - Expected response body type.
|
|
37
|
+
* @param endpoint - API endpoint path (e.g. `/customers`).
|
|
38
|
+
* @param options - Fetch options with optional `idempotencyKey`.
|
|
39
|
+
* @returns Parsed JSON response body.
|
|
40
|
+
*
|
|
41
|
+
* @throws {RateLimitError} When the API returns HTTP 429.
|
|
42
|
+
* @throws {SyncConflictError} When `admin.system.sync()` detects a conflict (HTTP 409).
|
|
43
|
+
* @throws {RevstackAPIError} For all other non-2xx responses.
|
|
44
|
+
*/
|
|
45
|
+
async request(endpoint, options = {}) {
|
|
46
|
+
const controller = new AbortController();
|
|
47
|
+
const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);
|
|
48
|
+
const headers = {
|
|
49
|
+
Authorization: `Bearer ${this.config.secretKey}`,
|
|
50
|
+
"Content-Type": "application/json",
|
|
51
|
+
...options.headers,
|
|
52
|
+
};
|
|
53
|
+
if (options.idempotencyKey) {
|
|
54
|
+
headers["Idempotency-Key"] = options.idempotencyKey;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const response = await fetch(`${this.config.baseUrl}${endpoint}`, {
|
|
58
|
+
...options,
|
|
59
|
+
headers,
|
|
60
|
+
signal: controller.signal,
|
|
61
|
+
});
|
|
62
|
+
if (!response.ok) {
|
|
63
|
+
const errorData = (await response
|
|
64
|
+
.json()
|
|
65
|
+
.catch(() => ({})));
|
|
66
|
+
const message = errorData.message || `Revstack API Error: ${response.status}`;
|
|
67
|
+
const requestId = errorData.requestId;
|
|
68
|
+
if (response.status === 429) {
|
|
69
|
+
const retryAfter = errorData.retryAfter ??
|
|
70
|
+
parseInt(response.headers.get("Retry-After") || "60", 10);
|
|
71
|
+
throw new RateLimitError(message, retryAfter, requestId);
|
|
72
|
+
}
|
|
73
|
+
if (response.status === 409 && errorData.conflicts) {
|
|
74
|
+
throw new SyncConflictError(message, errorData.conflicts, requestId);
|
|
75
|
+
}
|
|
76
|
+
throw new RevstackAPIError(message, response.status, errorData.code || "UNKNOWN_ERROR", requestId);
|
|
77
|
+
}
|
|
78
|
+
return (await response.json());
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
clearTimeout(timeoutId);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { Customer, IdentifyCustomerParams, UpdateCustomerParams, ListParams, PaginatedResponse } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Client for managing end-user (customer) records.
|
|
5
|
+
* Provides full CRUD operations on the `app_users` table.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const customer = await revstack.customers.identify({
|
|
10
|
+
* customerId: "user-123",
|
|
11
|
+
* email: "john@acme.com",
|
|
12
|
+
* });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class CustomersClient extends BaseClient {
|
|
16
|
+
constructor(config: {
|
|
17
|
+
secretKey: string;
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
timeout: number;
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Identify (upsert) a customer. Creates the customer if not found,
|
|
23
|
+
* or updates it if a record with the same `customerId` already exists.
|
|
24
|
+
*
|
|
25
|
+
* @param params - Customer identification parameters.
|
|
26
|
+
* @returns The created or updated customer record.
|
|
27
|
+
*/
|
|
28
|
+
identify(params: IdentifyCustomerParams): Promise<Customer>;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve a customer by ID.
|
|
31
|
+
*
|
|
32
|
+
* @param customerId - The customer's unique identifier.
|
|
33
|
+
* @returns The customer record.
|
|
34
|
+
*/
|
|
35
|
+
get(customerId: string): Promise<Customer>;
|
|
36
|
+
/**
|
|
37
|
+
* List customers with optional pagination.
|
|
38
|
+
*
|
|
39
|
+
* @param params - Pagination parameters (limit, offset).
|
|
40
|
+
* @returns A paginated list of customer records.
|
|
41
|
+
*/
|
|
42
|
+
list(params?: ListParams): Promise<PaginatedResponse<Customer>>;
|
|
43
|
+
/**
|
|
44
|
+
* Update an existing customer's profile.
|
|
45
|
+
*
|
|
46
|
+
* @param customerId - The customer's unique identifier.
|
|
47
|
+
* @param params - Fields to update (email, metadata).
|
|
48
|
+
* @returns The updated customer record.
|
|
49
|
+
*/
|
|
50
|
+
update(customerId: string, params: UpdateCustomerParams): Promise<Customer>;
|
|
51
|
+
/**
|
|
52
|
+
* Delete a customer and all associated data.
|
|
53
|
+
*
|
|
54
|
+
* @param customerId - The customer's unique identifier.
|
|
55
|
+
* @returns Confirmation of deletion.
|
|
56
|
+
*/
|
|
57
|
+
delete(customerId: string): Promise<{
|
|
58
|
+
success: boolean;
|
|
59
|
+
}>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=customers.d.ts.map
|