lark-billing 0.1.2 → 0.1.4
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/README.md +4 -1
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/checkout/client/Client.d.ts +4 -1
- package/dist/cjs/api/resources/checkout/client/Client.js +4 -1
- package/dist/cjs/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.ts +7 -5
- package/dist/cjs/api/resources/customerPortal/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/customerPortal/client/Client.js +2 -1
- package/dist/cjs/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.ts +4 -1
- package/dist/cjs/api/resources/subscriptions/client/Client.d.ts +5 -1
- package/dist/cjs/api/resources/subscriptions/client/Client.js +5 -1
- package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.ts +20 -2
- package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.js +8 -0
- package/dist/cjs/api/resources/usageEvents/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/usageEvents/client/Client.js +2 -2
- package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.ts +2 -2
- package/dist/cjs/api/types/CheckoutCallback.d.ts +9 -0
- package/dist/cjs/api/types/CheckoutCallback.js +5 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/checkout/client/Client.d.mts +4 -1
- package/dist/esm/api/resources/checkout/client/Client.mjs +4 -1
- package/dist/esm/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.mts +7 -5
- package/dist/esm/api/resources/customerPortal/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/customerPortal/client/Client.mjs +2 -1
- package/dist/esm/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.mts +4 -1
- package/dist/esm/api/resources/subscriptions/client/Client.d.mts +5 -1
- package/dist/esm/api/resources/subscriptions/client/Client.mjs +5 -1
- package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.mts +20 -2
- package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.mjs +7 -1
- package/dist/esm/api/resources/usageEvents/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/usageEvents/client/Client.mjs +2 -2
- package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.mts +2 -2
- package/dist/esm/api/types/CheckoutCallback.d.mts +9 -0
- package/dist/esm/api/types/CheckoutCallback.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +11 -3
package/README.md
CHANGED
|
@@ -26,7 +26,10 @@ const client = new LarkClient({ apiKey: "YOUR_API_KEY" });
|
|
|
26
26
|
await client.checkout.createSubscriptionCheckoutSession({
|
|
27
27
|
subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
28
28
|
rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
29
|
-
|
|
29
|
+
checkout_callback_urls: {
|
|
30
|
+
cancelled_url: "https://example.com/callback",
|
|
31
|
+
success_url: "https://example.com/callback",
|
|
32
|
+
},
|
|
30
33
|
});
|
|
31
34
|
```
|
|
32
35
|
|
package/dist/cjs/Client.js
CHANGED
|
@@ -53,8 +53,8 @@ class LarkClient {
|
|
|
53
53
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
54
54
|
"X-Fern-Language": "JavaScript",
|
|
55
55
|
"X-Fern-SDK-Name": "lark-billing",
|
|
56
|
-
"X-Fern-SDK-Version": "0.1.
|
|
57
|
-
"User-Agent": "lark-billing/0.1.
|
|
56
|
+
"X-Fern-SDK-Version": "0.1.4",
|
|
57
|
+
"User-Agent": "lark-billing/0.1.4",
|
|
58
58
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
59
59
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
60
60
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -39,7 +39,10 @@ export declare class Checkout {
|
|
|
39
39
|
* await client.checkout.createSubscriptionCheckoutSession({
|
|
40
40
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
41
41
|
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
42
|
-
*
|
|
42
|
+
* checkout_callback_urls: {
|
|
43
|
+
* cancelled_url: "https://example.com/callback",
|
|
44
|
+
* success_url: "https://example.com/callback"
|
|
45
|
+
* }
|
|
43
46
|
* })
|
|
44
47
|
*/
|
|
45
48
|
createSubscriptionCheckoutSession(request: Lark.CreateSubscriptionCheckoutSessionRequest, requestOptions?: Checkout.RequestOptions): core.HttpResponsePromise<Lark.CreateSubscriptionCheckoutSessionResponse>;
|
|
@@ -65,7 +65,10 @@ class Checkout {
|
|
|
65
65
|
* await client.checkout.createSubscriptionCheckoutSession({
|
|
66
66
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
67
67
|
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
68
|
-
*
|
|
68
|
+
* checkout_callback_urls: {
|
|
69
|
+
* cancelled_url: "https://example.com/callback",
|
|
70
|
+
* success_url: "https://example.com/callback"
|
|
71
|
+
* }
|
|
69
72
|
* })
|
|
70
73
|
*/
|
|
71
74
|
createSubscriptionCheckoutSession(request, requestOptions) {
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Lark from "../../../../index.js";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {
|
|
7
8
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
8
9
|
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
9
|
-
*
|
|
10
|
+
* checkout_callback_urls: {
|
|
11
|
+
* cancelled_url: "https://example.com/callback",
|
|
12
|
+
* success_url: "https://example.com/callback"
|
|
13
|
+
* }
|
|
10
14
|
* }
|
|
11
15
|
*/
|
|
12
16
|
export interface CreateSubscriptionCheckoutSessionRequest {
|
|
@@ -14,8 +18,6 @@ export interface CreateSubscriptionCheckoutSessionRequest {
|
|
|
14
18
|
subject_id: string;
|
|
15
19
|
/** The ID of the rate card to subscribe to. */
|
|
16
20
|
rate_card_id: string;
|
|
17
|
-
/** The
|
|
18
|
-
|
|
19
|
-
/** The URL to redirect to after the checkout is cancelled. */
|
|
20
|
-
cancel_url?: string;
|
|
21
|
+
/** The URLs to redirect to after the checkout is completed or cancelled. */
|
|
22
|
+
checkout_callback_urls: Lark.CheckoutCallback;
|
|
21
23
|
}
|
|
@@ -37,7 +37,8 @@ export declare class CustomerPortal {
|
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* await client.customerPortal.createCustomerPortalSession({
|
|
40
|
-
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
|
|
40
|
+
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
41
|
+
* return_url: "https://example.com/dashboard"
|
|
41
42
|
* })
|
|
42
43
|
*/
|
|
43
44
|
createCustomerPortalSession(request: Lark.CreateCustomerPortalSessionRequest, requestOptions?: CustomerPortal.RequestOptions): core.HttpResponsePromise<Lark.CreateCustomerPortalSessionResponse>;
|
|
@@ -63,7 +63,8 @@ class CustomerPortal {
|
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* await client.customerPortal.createCustomerPortalSession({
|
|
66
|
-
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
|
|
66
|
+
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
67
|
+
* return_url: "https://example.com/dashboard"
|
|
67
68
|
* })
|
|
68
69
|
*/
|
|
69
70
|
createCustomerPortalSession(request, requestOptions) {
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
|
-
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
|
|
7
|
+
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
8
|
+
* return_url: "https://example.com/dashboard"
|
|
8
9
|
* }
|
|
9
10
|
*/
|
|
10
11
|
export interface CreateCustomerPortalSessionRequest {
|
|
11
12
|
/** The ID or external ID of the subject to create the customer portal session for. */
|
|
12
13
|
subject_id: string;
|
|
14
|
+
/** The URL to redirect customers to if they click the back button on the customer portal. */
|
|
15
|
+
return_url: string;
|
|
13
16
|
}
|
|
@@ -90,7 +90,11 @@ export declare class Subscriptions {
|
|
|
90
90
|
*
|
|
91
91
|
* @example
|
|
92
92
|
* await client.subscriptions.changeSubscriptionRateCard("subscription_id", {
|
|
93
|
-
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g"
|
|
93
|
+
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g",
|
|
94
|
+
* checkout_callback_urls: {
|
|
95
|
+
* cancelled_url: "https://example.com/callback",
|
|
96
|
+
* success_url: "https://example.com/callback"
|
|
97
|
+
* }
|
|
94
98
|
* })
|
|
95
99
|
*/
|
|
96
100
|
changeSubscriptionRateCard(subscriptionId: string, request: Lark.ChangeSubscriptionRateCardRequest, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.ChangeSubscriptionRateCardResponse>;
|
|
@@ -317,7 +317,11 @@ class Subscriptions {
|
|
|
317
317
|
*
|
|
318
318
|
* @example
|
|
319
319
|
* await client.subscriptions.changeSubscriptionRateCard("subscription_id", {
|
|
320
|
-
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g"
|
|
320
|
+
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g",
|
|
321
|
+
* checkout_callback_urls: {
|
|
322
|
+
* cancelled_url: "https://example.com/callback",
|
|
323
|
+
* success_url: "https://example.com/callback"
|
|
324
|
+
* }
|
|
321
325
|
* })
|
|
322
326
|
*/
|
|
323
327
|
changeSubscriptionRateCard(subscriptionId, request, requestOptions) {
|
package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.ts
CHANGED
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Lark from "../../../../index.js";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {
|
|
7
|
-
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g"
|
|
8
|
+
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g",
|
|
9
|
+
* checkout_callback_urls: {
|
|
10
|
+
* cancelled_url: "https://example.com/callback",
|
|
11
|
+
* success_url: "https://example.com/callback"
|
|
12
|
+
* }
|
|
8
13
|
* }
|
|
9
14
|
*/
|
|
10
15
|
export interface ChangeSubscriptionRateCardRequest {
|
|
11
16
|
/** The ID of the rate card to change the subscription to. */
|
|
12
17
|
rate_card_id: string;
|
|
13
|
-
|
|
18
|
+
/** The behavior to use when upgrading the subscription. If 'prorate', the customer will be charged for the prorated difference. If 'rate_difference', the customer will be charged for the difference in the rate cards without respect to time. */
|
|
19
|
+
upgrade_behavior?: ChangeSubscriptionRateCardRequest.UpgradeBehavior;
|
|
20
|
+
/** The URLs to redirect to after the checkout is completed or cancelled, if a checkout is required. */
|
|
21
|
+
checkout_callback_urls: Lark.CheckoutCallback;
|
|
22
|
+
}
|
|
23
|
+
export declare namespace ChangeSubscriptionRateCardRequest {
|
|
24
|
+
/**
|
|
25
|
+
* The behavior to use when upgrading the subscription. If 'prorate', the customer will be charged for the prorated difference. If 'rate_difference', the customer will be charged for the difference in the rate cards without respect to time.
|
|
26
|
+
*/
|
|
27
|
+
type UpgradeBehavior = "prorate" | "rate_difference";
|
|
28
|
+
const UpgradeBehavior: {
|
|
29
|
+
readonly Prorate: "prorate";
|
|
30
|
+
readonly RateDifference: "rate_difference";
|
|
31
|
+
};
|
|
14
32
|
}
|
package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.js
CHANGED
|
@@ -3,3 +3,11 @@
|
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChangeSubscriptionRateCardRequest = void 0;
|
|
7
|
+
var ChangeSubscriptionRateCardRequest;
|
|
8
|
+
(function (ChangeSubscriptionRateCardRequest) {
|
|
9
|
+
ChangeSubscriptionRateCardRequest.UpgradeBehavior = {
|
|
10
|
+
Prorate: "prorate",
|
|
11
|
+
RateDifference: "rate_difference",
|
|
12
|
+
};
|
|
13
|
+
})(ChangeSubscriptionRateCardRequest || (exports.ChangeSubscriptionRateCardRequest = ChangeSubscriptionRateCardRequest = {}));
|
|
@@ -37,10 +37,10 @@ export declare class UsageEvents {
|
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* await client.usageEvents.createUsageEvent({
|
|
40
|
-
* idempotency_key: "
|
|
40
|
+
* idempotency_key: "4a1d819c-7d3e-47cf-bc06-ecb185702540",
|
|
41
41
|
* event_name: "compute_hours",
|
|
42
42
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
43
|
-
* timestamp: "2025-11-
|
|
43
|
+
* timestamp: "2025-11-06T21:43:48Z",
|
|
44
44
|
* data: {
|
|
45
45
|
* "compute_hours": 100,
|
|
46
46
|
* "instance_type": "t2.micro",
|
|
@@ -63,10 +63,10 @@ class UsageEvents {
|
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* await client.usageEvents.createUsageEvent({
|
|
66
|
-
* idempotency_key: "
|
|
66
|
+
* idempotency_key: "4a1d819c-7d3e-47cf-bc06-ecb185702540",
|
|
67
67
|
* event_name: "compute_hours",
|
|
68
68
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
69
|
-
* timestamp: "2025-11-
|
|
69
|
+
* timestamp: "2025-11-06T21:43:48Z",
|
|
70
70
|
* data: {
|
|
71
71
|
* "compute_hours": 100,
|
|
72
72
|
* "instance_type": "t2.micro",
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
|
-
* idempotency_key: "
|
|
7
|
+
* idempotency_key: "4a1d819c-7d3e-47cf-bc06-ecb185702540",
|
|
8
8
|
* event_name: "compute_hours",
|
|
9
9
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
10
|
-
* timestamp: "2025-11-
|
|
10
|
+
* timestamp: "2025-11-06T21:43:48Z",
|
|
11
11
|
* data: {
|
|
12
12
|
* "compute_hours": 100,
|
|
13
13
|
* "instance_type": "t2.micro",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface CheckoutCallback {
|
|
5
|
+
/** The URL to redirect to after the checkout is cancelled. */
|
|
6
|
+
cancelled_url: string;
|
|
7
|
+
/** The URL to redirect to after the checkout is successful. */
|
|
8
|
+
success_url: string;
|
|
9
|
+
}
|
|
@@ -60,3 +60,4 @@ __exportStar(require("./SumAggregationPricingMetricInterface.js"), exports);
|
|
|
60
60
|
__exportStar(require("./SumAggregationPricingMetricResource.js"), exports);
|
|
61
61
|
__exportStar(require("./UsageDataForRate.js"), exports);
|
|
62
62
|
__exportStar(require("./ValidationError.js"), exports);
|
|
63
|
+
__exportStar(require("./CheckoutCallback.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.4";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -17,8 +17,8 @@ export class LarkClient {
|
|
|
17
17
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
18
18
|
"X-Fern-Language": "JavaScript",
|
|
19
19
|
"X-Fern-SDK-Name": "lark-billing",
|
|
20
|
-
"X-Fern-SDK-Version": "0.1.
|
|
21
|
-
"User-Agent": "lark-billing/0.1.
|
|
20
|
+
"X-Fern-SDK-Version": "0.1.4",
|
|
21
|
+
"User-Agent": "lark-billing/0.1.4",
|
|
22
22
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
23
23
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
24
24
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -39,7 +39,10 @@ export declare class Checkout {
|
|
|
39
39
|
* await client.checkout.createSubscriptionCheckoutSession({
|
|
40
40
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
41
41
|
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
42
|
-
*
|
|
42
|
+
* checkout_callback_urls: {
|
|
43
|
+
* cancelled_url: "https://example.com/callback",
|
|
44
|
+
* success_url: "https://example.com/callback"
|
|
45
|
+
* }
|
|
43
46
|
* })
|
|
44
47
|
*/
|
|
45
48
|
createSubscriptionCheckoutSession(request: Lark.CreateSubscriptionCheckoutSessionRequest, requestOptions?: Checkout.RequestOptions): core.HttpResponsePromise<Lark.CreateSubscriptionCheckoutSessionResponse>;
|
|
@@ -29,7 +29,10 @@ export class Checkout {
|
|
|
29
29
|
* await client.checkout.createSubscriptionCheckoutSession({
|
|
30
30
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
31
31
|
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
32
|
-
*
|
|
32
|
+
* checkout_callback_urls: {
|
|
33
|
+
* cancelled_url: "https://example.com/callback",
|
|
34
|
+
* success_url: "https://example.com/callback"
|
|
35
|
+
* }
|
|
33
36
|
* })
|
|
34
37
|
*/
|
|
35
38
|
createSubscriptionCheckoutSession(request, requestOptions) {
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Lark from "../../../../index.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {
|
|
7
8
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
8
9
|
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
9
|
-
*
|
|
10
|
+
* checkout_callback_urls: {
|
|
11
|
+
* cancelled_url: "https://example.com/callback",
|
|
12
|
+
* success_url: "https://example.com/callback"
|
|
13
|
+
* }
|
|
10
14
|
* }
|
|
11
15
|
*/
|
|
12
16
|
export interface CreateSubscriptionCheckoutSessionRequest {
|
|
@@ -14,8 +18,6 @@ export interface CreateSubscriptionCheckoutSessionRequest {
|
|
|
14
18
|
subject_id: string;
|
|
15
19
|
/** The ID of the rate card to subscribe to. */
|
|
16
20
|
rate_card_id: string;
|
|
17
|
-
/** The
|
|
18
|
-
|
|
19
|
-
/** The URL to redirect to after the checkout is cancelled. */
|
|
20
|
-
cancel_url?: string;
|
|
21
|
+
/** The URLs to redirect to after the checkout is completed or cancelled. */
|
|
22
|
+
checkout_callback_urls: Lark.CheckoutCallback;
|
|
21
23
|
}
|
|
@@ -37,7 +37,8 @@ export declare class CustomerPortal {
|
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* await client.customerPortal.createCustomerPortalSession({
|
|
40
|
-
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
|
|
40
|
+
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
41
|
+
* return_url: "https://example.com/dashboard"
|
|
41
42
|
* })
|
|
42
43
|
*/
|
|
43
44
|
createCustomerPortalSession(request: Lark.CreateCustomerPortalSessionRequest, requestOptions?: CustomerPortal.RequestOptions): core.HttpResponsePromise<Lark.CreateCustomerPortalSessionResponse>;
|
|
@@ -27,7 +27,8 @@ export class CustomerPortal {
|
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* await client.customerPortal.createCustomerPortalSession({
|
|
30
|
-
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
|
|
30
|
+
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
31
|
+
* return_url: "https://example.com/dashboard"
|
|
31
32
|
* })
|
|
32
33
|
*/
|
|
33
34
|
createCustomerPortalSession(request, requestOptions) {
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
|
-
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
|
|
7
|
+
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
8
|
+
* return_url: "https://example.com/dashboard"
|
|
8
9
|
* }
|
|
9
10
|
*/
|
|
10
11
|
export interface CreateCustomerPortalSessionRequest {
|
|
11
12
|
/** The ID or external ID of the subject to create the customer portal session for. */
|
|
12
13
|
subject_id: string;
|
|
14
|
+
/** The URL to redirect customers to if they click the back button on the customer portal. */
|
|
15
|
+
return_url: string;
|
|
13
16
|
}
|
|
@@ -90,7 +90,11 @@ export declare class Subscriptions {
|
|
|
90
90
|
*
|
|
91
91
|
* @example
|
|
92
92
|
* await client.subscriptions.changeSubscriptionRateCard("subscription_id", {
|
|
93
|
-
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g"
|
|
93
|
+
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g",
|
|
94
|
+
* checkout_callback_urls: {
|
|
95
|
+
* cancelled_url: "https://example.com/callback",
|
|
96
|
+
* success_url: "https://example.com/callback"
|
|
97
|
+
* }
|
|
94
98
|
* })
|
|
95
99
|
*/
|
|
96
100
|
changeSubscriptionRateCard(subscriptionId: string, request: Lark.ChangeSubscriptionRateCardRequest, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.ChangeSubscriptionRateCardResponse>;
|
|
@@ -281,7 +281,11 @@ export class Subscriptions {
|
|
|
281
281
|
*
|
|
282
282
|
* @example
|
|
283
283
|
* await client.subscriptions.changeSubscriptionRateCard("subscription_id", {
|
|
284
|
-
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g"
|
|
284
|
+
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g",
|
|
285
|
+
* checkout_callback_urls: {
|
|
286
|
+
* cancelled_url: "https://example.com/callback",
|
|
287
|
+
* success_url: "https://example.com/callback"
|
|
288
|
+
* }
|
|
285
289
|
* })
|
|
286
290
|
*/
|
|
287
291
|
changeSubscriptionRateCard(subscriptionId, request, requestOptions) {
|
package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.mts
CHANGED
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Lark from "../../../../index.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {
|
|
7
|
-
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g"
|
|
8
|
+
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g",
|
|
9
|
+
* checkout_callback_urls: {
|
|
10
|
+
* cancelled_url: "https://example.com/callback",
|
|
11
|
+
* success_url: "https://example.com/callback"
|
|
12
|
+
* }
|
|
8
13
|
* }
|
|
9
14
|
*/
|
|
10
15
|
export interface ChangeSubscriptionRateCardRequest {
|
|
11
16
|
/** The ID of the rate card to change the subscription to. */
|
|
12
17
|
rate_card_id: string;
|
|
13
|
-
|
|
18
|
+
/** The behavior to use when upgrading the subscription. If 'prorate', the customer will be charged for the prorated difference. If 'rate_difference', the customer will be charged for the difference in the rate cards without respect to time. */
|
|
19
|
+
upgrade_behavior?: ChangeSubscriptionRateCardRequest.UpgradeBehavior;
|
|
20
|
+
/** The URLs to redirect to after the checkout is completed or cancelled, if a checkout is required. */
|
|
21
|
+
checkout_callback_urls: Lark.CheckoutCallback;
|
|
22
|
+
}
|
|
23
|
+
export declare namespace ChangeSubscriptionRateCardRequest {
|
|
24
|
+
/**
|
|
25
|
+
* The behavior to use when upgrading the subscription. If 'prorate', the customer will be charged for the prorated difference. If 'rate_difference', the customer will be charged for the difference in the rate cards without respect to time.
|
|
26
|
+
*/
|
|
27
|
+
type UpgradeBehavior = "prorate" | "rate_difference";
|
|
28
|
+
const UpgradeBehavior: {
|
|
29
|
+
readonly Prorate: "prorate";
|
|
30
|
+
readonly RateDifference: "rate_difference";
|
|
31
|
+
};
|
|
14
32
|
}
|
package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.mjs
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export var ChangeSubscriptionRateCardRequest;
|
|
5
|
+
(function (ChangeSubscriptionRateCardRequest) {
|
|
6
|
+
ChangeSubscriptionRateCardRequest.UpgradeBehavior = {
|
|
7
|
+
Prorate: "prorate",
|
|
8
|
+
RateDifference: "rate_difference",
|
|
9
|
+
};
|
|
10
|
+
})(ChangeSubscriptionRateCardRequest || (ChangeSubscriptionRateCardRequest = {}));
|
|
@@ -37,10 +37,10 @@ export declare class UsageEvents {
|
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* await client.usageEvents.createUsageEvent({
|
|
40
|
-
* idempotency_key: "
|
|
40
|
+
* idempotency_key: "4a1d819c-7d3e-47cf-bc06-ecb185702540",
|
|
41
41
|
* event_name: "compute_hours",
|
|
42
42
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
43
|
-
* timestamp: "2025-11-
|
|
43
|
+
* timestamp: "2025-11-06T21:43:48Z",
|
|
44
44
|
* data: {
|
|
45
45
|
* "compute_hours": 100,
|
|
46
46
|
* "instance_type": "t2.micro",
|
|
@@ -27,10 +27,10 @@ export class UsageEvents {
|
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* await client.usageEvents.createUsageEvent({
|
|
30
|
-
* idempotency_key: "
|
|
30
|
+
* idempotency_key: "4a1d819c-7d3e-47cf-bc06-ecb185702540",
|
|
31
31
|
* event_name: "compute_hours",
|
|
32
32
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
33
|
-
* timestamp: "2025-11-
|
|
33
|
+
* timestamp: "2025-11-06T21:43:48Z",
|
|
34
34
|
* data: {
|
|
35
35
|
* "compute_hours": 100,
|
|
36
36
|
* "instance_type": "t2.micro",
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
|
-
* idempotency_key: "
|
|
7
|
+
* idempotency_key: "4a1d819c-7d3e-47cf-bc06-ecb185702540",
|
|
8
8
|
* event_name: "compute_hours",
|
|
9
9
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
10
|
-
* timestamp: "2025-11-
|
|
10
|
+
* timestamp: "2025-11-06T21:43:48Z",
|
|
11
11
|
* data: {
|
|
12
12
|
* "compute_hours": 100,
|
|
13
13
|
* "instance_type": "t2.micro",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface CheckoutCallback {
|
|
5
|
+
/** The URL to redirect to after the checkout is cancelled. */
|
|
6
|
+
cancelled_url: string;
|
|
7
|
+
/** The URL to redirect to after the checkout is successful. */
|
|
8
|
+
success_url: string;
|
|
9
|
+
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.4";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.1.
|
|
1
|
+
export const SDK_VERSION = "0.1.4";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
await client.checkout.createSubscriptionCheckoutSession({
|
|
19
19
|
subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
20
20
|
rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
21
|
-
|
|
21
|
+
checkout_callback_urls: {
|
|
22
|
+
cancelled_url: "https://example.com/callback",
|
|
23
|
+
success_url: "https://example.com/callback",
|
|
24
|
+
},
|
|
22
25
|
});
|
|
23
26
|
```
|
|
24
27
|
|
|
@@ -71,6 +74,7 @@ await client.checkout.createSubscriptionCheckoutSession({
|
|
|
71
74
|
```typescript
|
|
72
75
|
await client.customerPortal.createCustomerPortalSession({
|
|
73
76
|
subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
77
|
+
return_url: "https://example.com/dashboard",
|
|
74
78
|
});
|
|
75
79
|
```
|
|
76
80
|
|
|
@@ -303,10 +307,10 @@ await client.rateCards.getRateCard("rate_card_id");
|
|
|
303
307
|
|
|
304
308
|
```typescript
|
|
305
309
|
await client.usageEvents.createUsageEvent({
|
|
306
|
-
idempotency_key: "
|
|
310
|
+
idempotency_key: "4a1d819c-7d3e-47cf-bc06-ecb185702540",
|
|
307
311
|
event_name: "compute_hours",
|
|
308
312
|
subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
309
|
-
timestamp: "2025-11-
|
|
313
|
+
timestamp: "2025-11-06T21:43:48Z",
|
|
310
314
|
data: {
|
|
311
315
|
compute_hours: 100,
|
|
312
316
|
instance_type: "t2.micro",
|
|
@@ -571,6 +575,10 @@ await client.subscriptions.cancelSubscription("subscription_id");
|
|
|
571
575
|
```typescript
|
|
572
576
|
await client.subscriptions.changeSubscriptionRateCard("subscription_id", {
|
|
573
577
|
rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g",
|
|
578
|
+
checkout_callback_urls: {
|
|
579
|
+
cancelled_url: "https://example.com/callback",
|
|
580
|
+
success_url: "https://example.com/callback",
|
|
581
|
+
},
|
|
574
582
|
});
|
|
575
583
|
```
|
|
576
584
|
|