@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 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../src/modules/customers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,QAAQ,EACR,sBAAsB,EACtB,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;GAWG;AACH,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAI3E;;;;;;OAMG;IACG,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAOjE;;;;;OAKG;IACG,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAMhD;;;;;OAKG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAOrE;;;;;;OAMG;IACG,MAAM,CACV,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,QAAQ,CAAC;IAOpB;;;;;OAKG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAKhE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Client for managing end-user (customer) records.
|
|
4
|
+
* Provides full CRUD operations on the `app_users` table.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const customer = await revstack.customers.identify({
|
|
9
|
+
* customerId: "user-123",
|
|
10
|
+
* email: "john@acme.com",
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export class CustomersClient extends BaseClient {
|
|
15
|
+
constructor(config) {
|
|
16
|
+
super(config);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Identify (upsert) a customer. Creates the customer if not found,
|
|
20
|
+
* or updates it if a record with the same `customerId` already exists.
|
|
21
|
+
*
|
|
22
|
+
* @param params - Customer identification parameters.
|
|
23
|
+
* @returns The created or updated customer record.
|
|
24
|
+
*/
|
|
25
|
+
async identify(params) {
|
|
26
|
+
return this.request("/customers", {
|
|
27
|
+
method: "POST",
|
|
28
|
+
body: JSON.stringify(params),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve a customer by ID.
|
|
33
|
+
*
|
|
34
|
+
* @param customerId - The customer's unique identifier.
|
|
35
|
+
* @returns The customer record.
|
|
36
|
+
*/
|
|
37
|
+
async get(customerId) {
|
|
38
|
+
return this.request(`/customers/${customerId}`, {
|
|
39
|
+
method: "GET",
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* List customers with optional pagination.
|
|
44
|
+
*
|
|
45
|
+
* @param params - Pagination parameters (limit, offset).
|
|
46
|
+
* @returns A paginated list of customer records.
|
|
47
|
+
*/
|
|
48
|
+
async list(params) {
|
|
49
|
+
return this.request(`/customers${this.buildQuery(params)}`, { method: "GET" });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Update an existing customer's profile.
|
|
53
|
+
*
|
|
54
|
+
* @param customerId - The customer's unique identifier.
|
|
55
|
+
* @param params - Fields to update (email, metadata).
|
|
56
|
+
* @returns The updated customer record.
|
|
57
|
+
*/
|
|
58
|
+
async update(customerId, params) {
|
|
59
|
+
return this.request(`/customers/${customerId}`, {
|
|
60
|
+
method: "PATCH",
|
|
61
|
+
body: JSON.stringify(params),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Delete a customer and all associated data.
|
|
66
|
+
*
|
|
67
|
+
* @param customerId - The customer's unique identifier.
|
|
68
|
+
* @returns Confirmation of deletion.
|
|
69
|
+
*/
|
|
70
|
+
async delete(customerId) {
|
|
71
|
+
return this.request(`/customers/${customerId}`, {
|
|
72
|
+
method: "DELETE",
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { Entitlement, EntitlementCheckOptions, EntitlementCheckResult } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Client for checking and querying feature entitlements.
|
|
5
|
+
* The `check()` method is the core primitive of the SDK — it determines whether
|
|
6
|
+
* a customer is allowed to use a specific feature based on their plan.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const { allowed, reason } = await revstack.entitlements.check(
|
|
11
|
+
* "usr_abc",
|
|
12
|
+
* "api-calls",
|
|
13
|
+
* { amount: 10 }
|
|
14
|
+
* );
|
|
15
|
+
*
|
|
16
|
+
* if (!allowed) {
|
|
17
|
+
* throw new Error(`Access denied: ${reason}`);
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class EntitlementsClient extends BaseClient {
|
|
22
|
+
constructor(config: {
|
|
23
|
+
secretKey: string;
|
|
24
|
+
baseUrl: string;
|
|
25
|
+
timeout: number;
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Check whether a customer has access to a specific feature.
|
|
29
|
+
* This is the most critical method in the SDK — it evaluates the customer's
|
|
30
|
+
* plan, metered usage, and custom entitlement overrides.
|
|
31
|
+
*
|
|
32
|
+
* @param customerId - The customer to check.
|
|
33
|
+
* @param featureId - The entitlement slug or ID.
|
|
34
|
+
* @param options - Optional check parameters (e.g. requested amount).
|
|
35
|
+
* @returns The check result with `allowed`, `reason`, and `remainingBalance`.
|
|
36
|
+
*/
|
|
37
|
+
check(customerId: string, featureId: string, options?: EntitlementCheckOptions): Promise<EntitlementCheckResult>;
|
|
38
|
+
/**
|
|
39
|
+
* List all active entitlements for a customer, including limits from
|
|
40
|
+
* their plan and any custom overrides.
|
|
41
|
+
*
|
|
42
|
+
* @param customerId - The customer whose entitlements to list.
|
|
43
|
+
* @returns Array of entitlement definitions the customer has access to.
|
|
44
|
+
*/
|
|
45
|
+
list(customerId: string): Promise<Entitlement[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieve a single entitlement definition by ID.
|
|
48
|
+
*
|
|
49
|
+
* @param entitlementId - The entitlement's unique identifier.
|
|
50
|
+
* @returns The entitlement definition.
|
|
51
|
+
*/
|
|
52
|
+
get(entitlementId: string): Promise<Entitlement>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=entitlements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entitlements.d.ts","sourceRoot":"","sources":["../../../src/modules/entitlements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;gBACpC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAI3E;;;;;;;;;OASG;IACG,KAAK,CACT,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAWlC;;;;;;OAMG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAMtD;;;;;OAKG;IACG,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAKvD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Client for checking and querying feature entitlements.
|
|
4
|
+
* The `check()` method is the core primitive of the SDK — it determines whether
|
|
5
|
+
* a customer is allowed to use a specific feature based on their plan.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const { allowed, reason } = await revstack.entitlements.check(
|
|
10
|
+
* "usr_abc",
|
|
11
|
+
* "api-calls",
|
|
12
|
+
* { amount: 10 }
|
|
13
|
+
* );
|
|
14
|
+
*
|
|
15
|
+
* if (!allowed) {
|
|
16
|
+
* throw new Error(`Access denied: ${reason}`);
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export class EntitlementsClient extends BaseClient {
|
|
21
|
+
constructor(config) {
|
|
22
|
+
super(config);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Check whether a customer has access to a specific feature.
|
|
26
|
+
* This is the most critical method in the SDK — it evaluates the customer's
|
|
27
|
+
* plan, metered usage, and custom entitlement overrides.
|
|
28
|
+
*
|
|
29
|
+
* @param customerId - The customer to check.
|
|
30
|
+
* @param featureId - The entitlement slug or ID.
|
|
31
|
+
* @param options - Optional check parameters (e.g. requested amount).
|
|
32
|
+
* @returns The check result with `allowed`, `reason`, and `remainingBalance`.
|
|
33
|
+
*/
|
|
34
|
+
async check(customerId, featureId, options) {
|
|
35
|
+
return this.request("/entitlements/check", {
|
|
36
|
+
method: "POST",
|
|
37
|
+
body: JSON.stringify({
|
|
38
|
+
customerId,
|
|
39
|
+
featureId,
|
|
40
|
+
requestedAmount: options?.amount || 1,
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* List all active entitlements for a customer, including limits from
|
|
46
|
+
* their plan and any custom overrides.
|
|
47
|
+
*
|
|
48
|
+
* @param customerId - The customer whose entitlements to list.
|
|
49
|
+
* @returns Array of entitlement definitions the customer has access to.
|
|
50
|
+
*/
|
|
51
|
+
async list(customerId) {
|
|
52
|
+
return this.request(`/entitlements/customer/${customerId}`, {
|
|
53
|
+
method: "GET",
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Retrieve a single entitlement definition by ID.
|
|
58
|
+
*
|
|
59
|
+
* @param entitlementId - The entitlement's unique identifier.
|
|
60
|
+
* @returns The entitlement definition.
|
|
61
|
+
*/
|
|
62
|
+
async get(entitlementId) {
|
|
63
|
+
return this.request(`/entitlements/${entitlementId}`, {
|
|
64
|
+
method: "GET",
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { Invoice, ListInvoicesParams, PaginatedResponse } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Read-only client for querying billing invoices.
|
|
5
|
+
* Used to display billing history to end users. Invoice creation is handled
|
|
6
|
+
* automatically by the payment pipeline and is not accessible from the SDK.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // List invoices for a customer's billing history page
|
|
11
|
+
* const { data: invoices } = await revstack.invoices.list({
|
|
12
|
+
* customerId: "usr_abc",
|
|
13
|
+
* status: "paid",
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class InvoicesClient extends BaseClient {
|
|
18
|
+
constructor(config: {
|
|
19
|
+
secretKey: string;
|
|
20
|
+
baseUrl: string;
|
|
21
|
+
timeout: number;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* List invoices with optional filters.
|
|
25
|
+
*
|
|
26
|
+
* @param params - Filter and pagination parameters.
|
|
27
|
+
* @returns A paginated list of invoices.
|
|
28
|
+
*/
|
|
29
|
+
list(params?: ListInvoicesParams): Promise<PaginatedResponse<Invoice>>;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve a single invoice by ID.
|
|
32
|
+
*
|
|
33
|
+
* @param invoiceId - The invoice's unique identifier.
|
|
34
|
+
* @returns The invoice record.
|
|
35
|
+
*/
|
|
36
|
+
get(invoiceId: string): Promise<Invoice>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=invoices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../../src/modules/invoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEzE;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAe,SAAQ,UAAU;gBAChC,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,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAO5E;;;;;OAKG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAK/C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Read-only client for querying billing invoices.
|
|
4
|
+
* Used to display billing history to end users. Invoice creation is handled
|
|
5
|
+
* automatically by the payment pipeline and is not accessible from the SDK.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // List invoices for a customer's billing history page
|
|
10
|
+
* const { data: invoices } = await revstack.invoices.list({
|
|
11
|
+
* customerId: "usr_abc",
|
|
12
|
+
* status: "paid",
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export class InvoicesClient extends BaseClient {
|
|
17
|
+
constructor(config) {
|
|
18
|
+
super(config);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* List invoices with optional filters.
|
|
22
|
+
*
|
|
23
|
+
* @param params - Filter and pagination parameters.
|
|
24
|
+
* @returns A paginated list of invoices.
|
|
25
|
+
*/
|
|
26
|
+
async list(params) {
|
|
27
|
+
return this.request(`/invoices${this.buildQuery(params)}`, { method: "GET" });
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve a single invoice by ID.
|
|
31
|
+
*
|
|
32
|
+
* @param invoiceId - The invoice's unique identifier.
|
|
33
|
+
* @returns The invoice record.
|
|
34
|
+
*/
|
|
35
|
+
async get(invoiceId) {
|
|
36
|
+
return this.request(`/invoices/${invoiceId}`, {
|
|
37
|
+
method: "GET",
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { Plan, ListPlansParams, PaginatedResponse } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Read-only client for querying billing plans.
|
|
5
|
+
* Used by the merchant's frontend to render pricing pages and plan selectors.
|
|
6
|
+
* Plan mutations are handled via `revstack.admin.plans`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // Fetch all public plans for the pricing page
|
|
11
|
+
* const { data: plans } = await revstack.plans.list({ status: "active" });
|
|
12
|
+
*
|
|
13
|
+
* // Get a specific plan with prices and entitlements
|
|
14
|
+
* const proPlan = await revstack.plans.get("plan_pro");
|
|
15
|
+
* console.log(proPlan.prices); // billing intervals
|
|
16
|
+
* console.log(proPlan.entitlements); // feature allocations
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class PlansClient extends BaseClient {
|
|
20
|
+
constructor(config: {
|
|
21
|
+
secretKey: string;
|
|
22
|
+
baseUrl: string;
|
|
23
|
+
timeout: number;
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* List plans with optional filters.
|
|
27
|
+
*
|
|
28
|
+
* @param params - Filter and pagination parameters.
|
|
29
|
+
* @returns A paginated list of plans.
|
|
30
|
+
*/
|
|
31
|
+
list(params?: ListPlansParams): Promise<PaginatedResponse<Plan>>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve a single plan by ID, including its nested prices and entitlements.
|
|
34
|
+
*
|
|
35
|
+
* @param planId - The plan's unique identifier.
|
|
36
|
+
* @returns The plan with populated `prices[]` and `entitlements[]`.
|
|
37
|
+
*/
|
|
38
|
+
get(planId: string): Promise<Plan>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../../src/modules/plans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEnE;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,WAAY,SAAQ,UAAU;gBAC7B,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;CAKzC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Read-only client for querying billing plans.
|
|
4
|
+
* Used by the merchant's frontend to render pricing pages and plan selectors.
|
|
5
|
+
* Plan mutations are handled via `revstack.admin.plans`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Fetch all public plans for the pricing page
|
|
10
|
+
* const { data: plans } = await revstack.plans.list({ status: "active" });
|
|
11
|
+
*
|
|
12
|
+
* // Get a specific plan with prices and entitlements
|
|
13
|
+
* const proPlan = await revstack.plans.get("plan_pro");
|
|
14
|
+
* console.log(proPlan.prices); // billing intervals
|
|
15
|
+
* console.log(proPlan.entitlements); // feature allocations
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export class PlansClient extends BaseClient {
|
|
19
|
+
constructor(config) {
|
|
20
|
+
super(config);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* List plans with optional filters.
|
|
24
|
+
*
|
|
25
|
+
* @param params - Filter and pagination parameters.
|
|
26
|
+
* @returns A paginated list of plans.
|
|
27
|
+
*/
|
|
28
|
+
async list(params) {
|
|
29
|
+
return this.request(`/plans${this.buildQuery(params)}`, { method: "GET" });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve a single plan by ID, including its nested prices and entitlements.
|
|
33
|
+
*
|
|
34
|
+
* @param planId - The plan's unique identifier.
|
|
35
|
+
* @returns The plan with populated `prices[]` and `entitlements[]`.
|
|
36
|
+
*/
|
|
37
|
+
async get(planId) {
|
|
38
|
+
return this.request(`/plans/${planId}`, {
|
|
39
|
+
method: "GET",
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { Subscription, CreateSubscriptionParams, ChangePlanParams, ListSubscriptionsParams, PaginatedResponse } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Client for managing customer subscriptions.
|
|
5
|
+
* Handles creating, retrieving, canceling, and upgrading/downgrading subscriptions.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const sub = await revstack.subscriptions.create({
|
|
10
|
+
* customerId: "usr_abc",
|
|
11
|
+
* planId: "plan_pro",
|
|
12
|
+
* });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class SubscriptionsClient extends BaseClient {
|
|
16
|
+
constructor(config: {
|
|
17
|
+
secretKey: string;
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
timeout: number;
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* List subscriptions with optional filters.
|
|
23
|
+
*
|
|
24
|
+
* @param params - Filter and pagination parameters.
|
|
25
|
+
* @returns A paginated list of subscriptions.
|
|
26
|
+
*/
|
|
27
|
+
list(params?: ListSubscriptionsParams): Promise<PaginatedResponse<Subscription>>;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve a subscription by ID.
|
|
30
|
+
*
|
|
31
|
+
* @param subscriptionId - The subscription's unique identifier.
|
|
32
|
+
* @returns The subscription record.
|
|
33
|
+
*/
|
|
34
|
+
get(subscriptionId: string): Promise<Subscription>;
|
|
35
|
+
/**
|
|
36
|
+
* Create a new subscription for a customer.
|
|
37
|
+
*
|
|
38
|
+
* @param params - Subscription creation parameters (customerId, planId).
|
|
39
|
+
* @returns The newly created subscription.
|
|
40
|
+
*/
|
|
41
|
+
create(params: CreateSubscriptionParams): Promise<Subscription>;
|
|
42
|
+
/**
|
|
43
|
+
* Cancel an active subscription. The subscription will remain active until
|
|
44
|
+
* the end of the current billing period.
|
|
45
|
+
*
|
|
46
|
+
* @param subscriptionId - The subscription to cancel.
|
|
47
|
+
* @returns The updated subscription with `canceled` status.
|
|
48
|
+
*/
|
|
49
|
+
cancel(subscriptionId: string): Promise<Subscription>;
|
|
50
|
+
/**
|
|
51
|
+
* Change the plan of an existing subscription (upgrade or downgrade).
|
|
52
|
+
* Proration is handled automatically by the billing engine.
|
|
53
|
+
*
|
|
54
|
+
* @param subscriptionId - The subscription to modify.
|
|
55
|
+
* @param params - The new plan and optional price to switch to.
|
|
56
|
+
* @returns The updated subscription.
|
|
57
|
+
*/
|
|
58
|
+
changePlan(subscriptionId: string, params: ChangePlanParams): Promise<Subscription>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/modules/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;GAWG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;gBACrC,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,uBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAO3C;;;;;OAKG;IACG,GAAG,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAMxD;;;;;OAKG;IACG,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC;IAOrE;;;;;;OAMG;IACG,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAO3D;;;;;;;OAOG;IACG,UAAU,CACd,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,YAAY,CAAC;CASzB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Client for managing customer subscriptions.
|
|
4
|
+
* Handles creating, retrieving, canceling, and upgrading/downgrading subscriptions.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const sub = await revstack.subscriptions.create({
|
|
9
|
+
* customerId: "usr_abc",
|
|
10
|
+
* planId: "plan_pro",
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export class SubscriptionsClient extends BaseClient {
|
|
15
|
+
constructor(config) {
|
|
16
|
+
super(config);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* List subscriptions with optional filters.
|
|
20
|
+
*
|
|
21
|
+
* @param params - Filter and pagination parameters.
|
|
22
|
+
* @returns A paginated list of subscriptions.
|
|
23
|
+
*/
|
|
24
|
+
async list(params) {
|
|
25
|
+
return this.request(`/subscriptions${this.buildQuery(params)}`, { method: "GET" });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve a subscription by ID.
|
|
29
|
+
*
|
|
30
|
+
* @param subscriptionId - The subscription's unique identifier.
|
|
31
|
+
* @returns The subscription record.
|
|
32
|
+
*/
|
|
33
|
+
async get(subscriptionId) {
|
|
34
|
+
return this.request(`/subscriptions/${subscriptionId}`, {
|
|
35
|
+
method: "GET",
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create a new subscription for a customer.
|
|
40
|
+
*
|
|
41
|
+
* @param params - Subscription creation parameters (customerId, planId).
|
|
42
|
+
* @returns The newly created subscription.
|
|
43
|
+
*/
|
|
44
|
+
async create(params) {
|
|
45
|
+
return this.request("/subscriptions", {
|
|
46
|
+
method: "POST",
|
|
47
|
+
body: JSON.stringify(params),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Cancel an active subscription. The subscription will remain active until
|
|
52
|
+
* the end of the current billing period.
|
|
53
|
+
*
|
|
54
|
+
* @param subscriptionId - The subscription to cancel.
|
|
55
|
+
* @returns The updated subscription with `canceled` status.
|
|
56
|
+
*/
|
|
57
|
+
async cancel(subscriptionId) {
|
|
58
|
+
return this.request(`/subscriptions/${subscriptionId}/cancel`, { method: "POST" });
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Change the plan of an existing subscription (upgrade or downgrade).
|
|
62
|
+
* Proration is handled automatically by the billing engine.
|
|
63
|
+
*
|
|
64
|
+
* @param subscriptionId - The subscription to modify.
|
|
65
|
+
* @param params - The new plan and optional price to switch to.
|
|
66
|
+
* @returns The updated subscription.
|
|
67
|
+
*/
|
|
68
|
+
async changePlan(subscriptionId, params) {
|
|
69
|
+
return this.request(`/subscriptions/${subscriptionId}/change-plan`, {
|
|
70
|
+
method: "POST",
|
|
71
|
+
body: JSON.stringify(params),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
import { ReportUsageParams, RevertUsageParams, UsageMeter } from "@/types";
|
|
3
|
+
/**
|
|
4
|
+
* Client for reporting and querying metered feature usage.
|
|
5
|
+
* Works in conjunction with {@link EntitlementsClient} — report usage after
|
|
6
|
+
* a successful entitlement check, and revert it if downstream operations fail.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // Optimistic usage pattern for AI applications
|
|
11
|
+
* const { allowed } = await revstack.entitlements.check(userId, "ai-tokens", { amount: 500 });
|
|
12
|
+
* if (!allowed) throw new Error("Limit exceeded");
|
|
13
|
+
*
|
|
14
|
+
* await revstack.usage.report({ customerId: userId, featureId: "ai-tokens", amount: 500 });
|
|
15
|
+
* try {
|
|
16
|
+
* await openai.chat.completions.create({ ... });
|
|
17
|
+
* } catch {
|
|
18
|
+
* await revstack.usage.revert({ customerId: userId, featureId: "ai-tokens", amount: 500 });
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare class UsageClient extends BaseClient {
|
|
23
|
+
constructor(config: {
|
|
24
|
+
secretKey: string;
|
|
25
|
+
baseUrl: string;
|
|
26
|
+
timeout: number;
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Report usage of a metered feature. Increments the customer's usage meter.
|
|
30
|
+
*
|
|
31
|
+
* @param params - Usage report parameters.
|
|
32
|
+
* @returns Confirmation of the reported usage.
|
|
33
|
+
*/
|
|
34
|
+
report(params: ReportUsageParams): Promise<{
|
|
35
|
+
success: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve all usage meters for a customer (one per metered entitlement).
|
|
39
|
+
*
|
|
40
|
+
* @param customerId - The customer whose meters to retrieve.
|
|
41
|
+
* @returns Array of usage meters with current counts and reset times.
|
|
42
|
+
*/
|
|
43
|
+
getMeters(customerId: string): Promise<UsageMeter[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Retrieve a single usage meter for a specific customer and feature.
|
|
46
|
+
*
|
|
47
|
+
* @param customerId - The customer whose meter to retrieve.
|
|
48
|
+
* @param featureId - The entitlement slug or ID.
|
|
49
|
+
* @returns The usage meter with current count and reset time.
|
|
50
|
+
*/
|
|
51
|
+
getMeter(customerId: string, featureId: string): Promise<UsageMeter>;
|
|
52
|
+
/**
|
|
53
|
+
* Revert (roll back) previously reported usage. Decrements the customer's
|
|
54
|
+
* usage meter. Essential for maintaining accurate billing when downstream
|
|
55
|
+
* operations fail after usage was already recorded.
|
|
56
|
+
*
|
|
57
|
+
* @param params - Revert parameters including reason for audit trail.
|
|
58
|
+
* @returns Confirmation of the reverted usage.
|
|
59
|
+
*/
|
|
60
|
+
revert(params: RevertUsageParams): Promise<{
|
|
61
|
+
success: boolean;
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/modules/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3E;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,WAAY,SAAQ,UAAU;gBAC7B,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAI3E;;;;;OAKG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAYtE;;;;;OAKG;IACG,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAM1D;;;;;;OAMG;IACG,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAO1E;;;;;;;OAOG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAYvE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { BaseClient } from "@/modules/base";
|
|
2
|
+
/**
|
|
3
|
+
* Client for reporting and querying metered feature usage.
|
|
4
|
+
* Works in conjunction with {@link EntitlementsClient} — report usage after
|
|
5
|
+
* a successful entitlement check, and revert it if downstream operations fail.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Optimistic usage pattern for AI applications
|
|
10
|
+
* const { allowed } = await revstack.entitlements.check(userId, "ai-tokens", { amount: 500 });
|
|
11
|
+
* if (!allowed) throw new Error("Limit exceeded");
|
|
12
|
+
*
|
|
13
|
+
* await revstack.usage.report({ customerId: userId, featureId: "ai-tokens", amount: 500 });
|
|
14
|
+
* try {
|
|
15
|
+
* await openai.chat.completions.create({ ... });
|
|
16
|
+
* } catch {
|
|
17
|
+
* await revstack.usage.revert({ customerId: userId, featureId: "ai-tokens", amount: 500 });
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export class UsageClient extends BaseClient {
|
|
22
|
+
constructor(config) {
|
|
23
|
+
super(config);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Report usage of a metered feature. Increments the customer's usage meter.
|
|
27
|
+
*
|
|
28
|
+
* @param params - Usage report parameters.
|
|
29
|
+
* @returns Confirmation of the reported usage.
|
|
30
|
+
*/
|
|
31
|
+
async report(params) {
|
|
32
|
+
return this.request("/usage/report", {
|
|
33
|
+
method: "POST",
|
|
34
|
+
idempotencyKey: params.idempotencyKey,
|
|
35
|
+
body: JSON.stringify({
|
|
36
|
+
customerId: params.customerId,
|
|
37
|
+
featureId: params.featureId,
|
|
38
|
+
amount: params.amount,
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Retrieve all usage meters for a customer (one per metered entitlement).
|
|
44
|
+
*
|
|
45
|
+
* @param customerId - The customer whose meters to retrieve.
|
|
46
|
+
* @returns Array of usage meters with current counts and reset times.
|
|
47
|
+
*/
|
|
48
|
+
async getMeters(customerId) {
|
|
49
|
+
return this.request(`/usage/meters/${customerId}`, {
|
|
50
|
+
method: "GET",
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Retrieve a single usage meter for a specific customer and feature.
|
|
55
|
+
*
|
|
56
|
+
* @param customerId - The customer whose meter to retrieve.
|
|
57
|
+
* @param featureId - The entitlement slug or ID.
|
|
58
|
+
* @returns The usage meter with current count and reset time.
|
|
59
|
+
*/
|
|
60
|
+
async getMeter(customerId, featureId) {
|
|
61
|
+
return this.request(`/usage/meters/${customerId}/${featureId}`, { method: "GET" });
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Revert (roll back) previously reported usage. Decrements the customer's
|
|
65
|
+
* usage meter. Essential for maintaining accurate billing when downstream
|
|
66
|
+
* operations fail after usage was already recorded.
|
|
67
|
+
*
|
|
68
|
+
* @param params - Revert parameters including reason for audit trail.
|
|
69
|
+
* @returns Confirmation of the reverted usage.
|
|
70
|
+
*/
|
|
71
|
+
async revert(params) {
|
|
72
|
+
return this.request("/usage/revert", {
|
|
73
|
+
method: "POST",
|
|
74
|
+
idempotencyKey: params.idempotencyKey,
|
|
75
|
+
body: JSON.stringify({
|
|
76
|
+
customerId: params.customerId,
|
|
77
|
+
featureId: params.featureId,
|
|
78
|
+
amount: params.amount,
|
|
79
|
+
reason: params.reason,
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|