lark-billing 0.1.0 → 0.1.2
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/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.ts +1 -1
- package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.ts +1 -1
- package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.d.ts +1 -1
- package/dist/cjs/api/resources/subscriptions/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/subscriptions/client/Client.js +4 -1
- package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.ts +1 -0
- package/dist/cjs/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.ts +1 -1
- package/dist/cjs/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.d.ts +1 -1
- 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 +3 -3
- package/dist/cjs/api/types/ActiveSubscription.d.ts +7 -0
- package/dist/cjs/api/types/ActiveSubscription.js +5 -0
- package/dist/cjs/api/types/BillingStateResponse.d.ts +5 -0
- package/dist/cjs/api/types/ChangeSubscriptionRateCardResponse.d.ts +7 -0
- package/dist/cjs/api/types/ChangeSubscriptionRateCardResponse.js +5 -0
- package/dist/cjs/api/types/CheckoutAction.d.ts +7 -0
- package/dist/cjs/api/types/CheckoutAction.js +5 -0
- package/dist/cjs/api/types/CreateCustomerPortalSessionResponse.d.ts +2 -0
- package/dist/cjs/api/types/RequiresActionResponse.d.ts +7 -0
- package/dist/cjs/api/types/RequiresActionResponse.js +5 -0
- package/dist/cjs/api/types/Result.d.ts +13 -0
- package/dist/cjs/api/types/Result.js +5 -0
- package/dist/cjs/api/types/SuccessResponse.d.ts +7 -0
- package/dist/cjs/api/types/SuccessResponse.js +5 -0
- package/dist/cjs/api/types/UsageDataForRate.d.ts +9 -0
- package/dist/cjs/api/types/UsageDataForRate.js +5 -0
- package/dist/cjs/api/types/index.d.ts +7 -0
- package/dist/cjs/api/types/index.js +7 -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/requests/CreateSubscriptionCheckoutSessionRequest.d.mts +1 -1
- package/dist/esm/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.mts +1 -1
- package/dist/esm/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.mts +1 -1
- package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.d.mts +1 -1
- package/dist/esm/api/resources/subscriptions/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/subscriptions/client/Client.mjs +4 -1
- package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.mts +1 -0
- package/dist/esm/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.mts +1 -1
- package/dist/esm/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.d.mts +1 -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 +3 -3
- package/dist/esm/api/types/ActiveSubscription.d.mts +7 -0
- package/dist/esm/api/types/ActiveSubscription.mjs +4 -0
- package/dist/esm/api/types/BillingStateResponse.d.mts +5 -0
- package/dist/esm/api/types/ChangeSubscriptionRateCardResponse.d.mts +7 -0
- package/dist/esm/api/types/ChangeSubscriptionRateCardResponse.mjs +4 -0
- package/dist/esm/api/types/CheckoutAction.d.mts +7 -0
- package/dist/esm/api/types/CheckoutAction.mjs +4 -0
- package/dist/esm/api/types/CreateCustomerPortalSessionResponse.d.mts +2 -0
- package/dist/esm/api/types/RequiresActionResponse.d.mts +7 -0
- package/dist/esm/api/types/RequiresActionResponse.mjs +4 -0
- package/dist/esm/api/types/Result.d.mts +13 -0
- package/dist/esm/api/types/Result.mjs +4 -0
- package/dist/esm/api/types/SuccessResponse.d.mts +7 -0
- package/dist/esm/api/types/SuccessResponse.mjs +4 -0
- package/dist/esm/api/types/UsageDataForRate.d.mts +9 -0
- package/dist/esm/api/types/UsageDataForRate.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +7 -0
- package/dist/esm/api/types/index.mjs +7 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +3 -3
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.2",
|
|
57
|
+
"User-Agent": "lark-billing/0.1.2",
|
|
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) });
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface CreateSubscriptionCheckoutSessionRequest {
|
|
13
|
-
/** The ID of the subject to create the checkout for. */
|
|
13
|
+
/** The ID or external ID of the subject to create the checkout for. */
|
|
14
14
|
subject_id: string;
|
|
15
15
|
/** The ID of the rate card to subscribe to. */
|
|
16
16
|
rate_card_id: string;
|
package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import * as Lark from "../../../../index.js";
|
|
|
13
13
|
* }
|
|
14
14
|
*/
|
|
15
15
|
export interface CreatePricingMetricSummaryRequest {
|
|
16
|
-
/** The ID of the subject that the summary should be computed for. */
|
|
16
|
+
/** The ID or external ID of the subject that the summary should be computed for. */
|
|
17
17
|
subject_id: string;
|
|
18
18
|
/** The period that the summary should be computed over. */
|
|
19
19
|
period: Lark.Period;
|
|
@@ -93,7 +93,7 @@ export declare class Subscriptions {
|
|
|
93
93
|
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g"
|
|
94
94
|
* })
|
|
95
95
|
*/
|
|
96
|
-
changeSubscriptionRateCard(subscriptionId: string, request: Lark.ChangeSubscriptionRateCardRequest, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.
|
|
96
|
+
changeSubscriptionRateCard(subscriptionId: string, request: Lark.ChangeSubscriptionRateCardRequest, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.ChangeSubscriptionRateCardResponse>;
|
|
97
97
|
private __changeSubscriptionRateCard;
|
|
98
98
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
99
99
|
"X-API-Key": string;
|
|
@@ -340,7 +340,10 @@ class Subscriptions {
|
|
|
340
340
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
341
341
|
});
|
|
342
342
|
if (_response.ok) {
|
|
343
|
-
return {
|
|
343
|
+
return {
|
|
344
|
+
data: _response.body,
|
|
345
|
+
rawResponse: _response.rawResponse,
|
|
346
|
+
};
|
|
344
347
|
}
|
|
345
348
|
if (_response.error.reason === "status-code") {
|
|
346
349
|
switch (_response.error.statusCode) {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
export interface CreateSubscriptionRequest {
|
|
12
12
|
/** The ID of the rate card to use for the subscription. */
|
|
13
13
|
rate_card_id: string;
|
|
14
|
-
/** The ID of the subject to create the subscription for. */
|
|
14
|
+
/** The ID or external ID of the subject to create the subscription for. */
|
|
15
15
|
subject_id: string;
|
|
16
16
|
/** Additional metadata about the subscription. You may use this to store any custom data about the subscription. */
|
|
17
17
|
metadata?: Record<string, string>;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export interface ListSubscriptionsSubscriptionsGetRequest {
|
|
13
13
|
limit?: number;
|
|
14
|
-
/** The ID of the subject to list subscriptions for. Cannot be used with rate_card_id. */
|
|
14
|
+
/** The ID or external ID of the subject to list subscriptions for. Cannot be used with rate_card_id. */
|
|
15
15
|
subject_id?: string;
|
|
16
16
|
/** The ID of the rate card to list subscriptions for. Cannot be used with subject_id. */
|
|
17
17
|
rate_card_id?: string;
|
|
@@ -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: "c49b13a8-b0f3-4d61-8fa6-c5e779301682",
|
|
41
41
|
* event_name: "compute_hours",
|
|
42
42
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
43
|
-
* timestamp: "2025-
|
|
43
|
+
* timestamp: "2025-11-06T00:08:40Z",
|
|
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: "c49b13a8-b0f3-4d61-8fa6-c5e779301682",
|
|
67
67
|
* event_name: "compute_hours",
|
|
68
68
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
69
|
-
* timestamp: "2025-
|
|
69
|
+
* timestamp: "2025-11-06T00:08:40Z",
|
|
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: "c49b13a8-b0f3-4d61-8fa6-c5e779301682",
|
|
8
8
|
* event_name: "compute_hours",
|
|
9
9
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
10
|
-
* timestamp: "2025-
|
|
10
|
+
* timestamp: "2025-11-06T00:08:40Z",
|
|
11
11
|
* data: {
|
|
12
12
|
* "compute_hours": 100,
|
|
13
13
|
* "instance_type": "t2.micro",
|
|
@@ -20,7 +20,7 @@ export interface CreateUsageEventRequest {
|
|
|
20
20
|
idempotency_key: string;
|
|
21
21
|
/** The name of the event. This is used by pricing metrics to aggregate usage events. */
|
|
22
22
|
event_name: string;
|
|
23
|
-
/** The ID of the subject that the usage event is for. */
|
|
23
|
+
/** The ID or external ID of the subject that the usage event is for. */
|
|
24
24
|
subject_id: string;
|
|
25
25
|
/** The timestamp of the usage event. It is highly recommended to provide a timestamp. If not provided, the current timestamp will be used. */
|
|
26
26
|
timestamp?: string;
|
|
@@ -1,9 +1,14 @@
|
|
|
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
|
export interface BillingStateResponse {
|
|
5
6
|
/** Whether the subject has an active subscription. */
|
|
6
7
|
has_active_subscription: boolean;
|
|
7
8
|
/** Whether the subject has exceeded the included usage (if any) on a usage-based rate they are subscribed to. */
|
|
8
9
|
has_overage_for_usage: boolean;
|
|
10
|
+
/** List of active subscriptions the subject is subscribed to. */
|
|
11
|
+
active_subscriptions: Lark.ActiveSubscription[];
|
|
12
|
+
/** The usage data for the usage-based rates the subject is subscribed to. */
|
|
13
|
+
usage_data: Lark.UsageDataForRate[];
|
|
9
14
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Lark from "../index.js";
|
|
5
|
+
export type Result = Lark.Result.RequiresAction | Lark.Result.Success;
|
|
6
|
+
export declare namespace Result {
|
|
7
|
+
interface RequiresAction extends Lark.RequiresActionResponse {
|
|
8
|
+
type: "requires_action";
|
|
9
|
+
}
|
|
10
|
+
interface Success extends Lark.SuccessResponse {
|
|
11
|
+
type: "success";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export * from "./ActiveSubscription.js";
|
|
1
2
|
export * from "./Amount.js";
|
|
2
3
|
export * from "./BillingStateResponse.js";
|
|
4
|
+
export * from "./Result.js";
|
|
5
|
+
export * from "./ChangeSubscriptionRateCardResponse.js";
|
|
6
|
+
export * from "./CheckoutAction.js";
|
|
3
7
|
export * from "./CountAggregationPricingMetricInterface.js";
|
|
4
8
|
export * from "./CountAggregationPricingMetricResource.js";
|
|
5
9
|
export * from "./CreateCustomerPortalSessionResponse.js";
|
|
@@ -31,9 +35,12 @@ export * from "./PricingMetricResource.js";
|
|
|
31
35
|
export * from "./PricingMetricSummaryResource.js";
|
|
32
36
|
export * from "./RateCardResourceUsageBasedRatesItem.js";
|
|
33
37
|
export * from "./RateCardResource.js";
|
|
38
|
+
export * from "./RequiresActionResponse.js";
|
|
34
39
|
export * from "./SimpleUsageBasedRateInterface.js";
|
|
35
40
|
export * from "./SubjectResource.js";
|
|
36
41
|
export * from "./SubscriptionResource.js";
|
|
42
|
+
export * from "./SuccessResponse.js";
|
|
37
43
|
export * from "./SumAggregationPricingMetricInterface.js";
|
|
38
44
|
export * from "./SumAggregationPricingMetricResource.js";
|
|
45
|
+
export * from "./UsageDataForRate.js";
|
|
39
46
|
export * from "./ValidationError.js";
|
|
@@ -14,8 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ActiveSubscription.js"), exports);
|
|
17
18
|
__exportStar(require("./Amount.js"), exports);
|
|
18
19
|
__exportStar(require("./BillingStateResponse.js"), exports);
|
|
20
|
+
__exportStar(require("./Result.js"), exports);
|
|
21
|
+
__exportStar(require("./ChangeSubscriptionRateCardResponse.js"), exports);
|
|
22
|
+
__exportStar(require("./CheckoutAction.js"), exports);
|
|
19
23
|
__exportStar(require("./CountAggregationPricingMetricInterface.js"), exports);
|
|
20
24
|
__exportStar(require("./CountAggregationPricingMetricResource.js"), exports);
|
|
21
25
|
__exportStar(require("./CreateCustomerPortalSessionResponse.js"), exports);
|
|
@@ -47,9 +51,12 @@ __exportStar(require("./PricingMetricResource.js"), exports);
|
|
|
47
51
|
__exportStar(require("./PricingMetricSummaryResource.js"), exports);
|
|
48
52
|
__exportStar(require("./RateCardResourceUsageBasedRatesItem.js"), exports);
|
|
49
53
|
__exportStar(require("./RateCardResource.js"), exports);
|
|
54
|
+
__exportStar(require("./RequiresActionResponse.js"), exports);
|
|
50
55
|
__exportStar(require("./SimpleUsageBasedRateInterface.js"), exports);
|
|
51
56
|
__exportStar(require("./SubjectResource.js"), exports);
|
|
52
57
|
__exportStar(require("./SubscriptionResource.js"), exports);
|
|
58
|
+
__exportStar(require("./SuccessResponse.js"), exports);
|
|
53
59
|
__exportStar(require("./SumAggregationPricingMetricInterface.js"), exports);
|
|
54
60
|
__exportStar(require("./SumAggregationPricingMetricResource.js"), exports);
|
|
61
|
+
__exportStar(require("./UsageDataForRate.js"), exports);
|
|
55
62
|
__exportStar(require("./ValidationError.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.2";
|
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.2",
|
|
21
|
+
"User-Agent": "lark-billing/0.1.2",
|
|
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) });
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface CreateSubscriptionCheckoutSessionRequest {
|
|
13
|
-
/** The ID of the subject to create the checkout for. */
|
|
13
|
+
/** The ID or external ID of the subject to create the checkout for. */
|
|
14
14
|
subject_id: string;
|
|
15
15
|
/** The ID of the rate card to subscribe to. */
|
|
16
16
|
rate_card_id: string;
|
|
@@ -13,7 +13,7 @@ import * as Lark from "../../../../index.mjs";
|
|
|
13
13
|
* }
|
|
14
14
|
*/
|
|
15
15
|
export interface CreatePricingMetricSummaryRequest {
|
|
16
|
-
/** The ID of the subject that the summary should be computed for. */
|
|
16
|
+
/** The ID or external ID of the subject that the summary should be computed for. */
|
|
17
17
|
subject_id: string;
|
|
18
18
|
/** The period that the summary should be computed over. */
|
|
19
19
|
period: Lark.Period;
|
|
@@ -93,7 +93,7 @@ export declare class Subscriptions {
|
|
|
93
93
|
* rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g"
|
|
94
94
|
* })
|
|
95
95
|
*/
|
|
96
|
-
changeSubscriptionRateCard(subscriptionId: string, request: Lark.ChangeSubscriptionRateCardRequest, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.
|
|
96
|
+
changeSubscriptionRateCard(subscriptionId: string, request: Lark.ChangeSubscriptionRateCardRequest, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.ChangeSubscriptionRateCardResponse>;
|
|
97
97
|
private __changeSubscriptionRateCard;
|
|
98
98
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
99
99
|
"X-API-Key": string;
|
|
@@ -304,7 +304,10 @@ export class Subscriptions {
|
|
|
304
304
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
305
305
|
});
|
|
306
306
|
if (_response.ok) {
|
|
307
|
-
return {
|
|
307
|
+
return {
|
|
308
|
+
data: _response.body,
|
|
309
|
+
rawResponse: _response.rawResponse,
|
|
310
|
+
};
|
|
308
311
|
}
|
|
309
312
|
if (_response.error.reason === "status-code") {
|
|
310
313
|
switch (_response.error.statusCode) {
|
package/dist/esm/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.mts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
export interface CreateSubscriptionRequest {
|
|
12
12
|
/** The ID of the rate card to use for the subscription. */
|
|
13
13
|
rate_card_id: string;
|
|
14
|
-
/** The ID of the subject to create the subscription for. */
|
|
14
|
+
/** The ID or external ID of the subject to create the subscription for. */
|
|
15
15
|
subject_id: string;
|
|
16
16
|
/** Additional metadata about the subscription. You may use this to store any custom data about the subscription. */
|
|
17
17
|
metadata?: Record<string, string>;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export interface ListSubscriptionsSubscriptionsGetRequest {
|
|
13
13
|
limit?: number;
|
|
14
|
-
/** The ID of the subject to list subscriptions for. Cannot be used with rate_card_id. */
|
|
14
|
+
/** The ID or external ID of the subject to list subscriptions for. Cannot be used with rate_card_id. */
|
|
15
15
|
subject_id?: string;
|
|
16
16
|
/** The ID of the rate card to list subscriptions for. Cannot be used with subject_id. */
|
|
17
17
|
rate_card_id?: string;
|
|
@@ -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: "c49b13a8-b0f3-4d61-8fa6-c5e779301682",
|
|
41
41
|
* event_name: "compute_hours",
|
|
42
42
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
43
|
-
* timestamp: "2025-
|
|
43
|
+
* timestamp: "2025-11-06T00:08:40Z",
|
|
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: "c49b13a8-b0f3-4d61-8fa6-c5e779301682",
|
|
31
31
|
* event_name: "compute_hours",
|
|
32
32
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
33
|
-
* timestamp: "2025-
|
|
33
|
+
* timestamp: "2025-11-06T00:08:40Z",
|
|
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: "c49b13a8-b0f3-4d61-8fa6-c5e779301682",
|
|
8
8
|
* event_name: "compute_hours",
|
|
9
9
|
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
10
|
-
* timestamp: "2025-
|
|
10
|
+
* timestamp: "2025-11-06T00:08:40Z",
|
|
11
11
|
* data: {
|
|
12
12
|
* "compute_hours": 100,
|
|
13
13
|
* "instance_type": "t2.micro",
|
|
@@ -20,7 +20,7 @@ export interface CreateUsageEventRequest {
|
|
|
20
20
|
idempotency_key: string;
|
|
21
21
|
/** The name of the event. This is used by pricing metrics to aggregate usage events. */
|
|
22
22
|
event_name: string;
|
|
23
|
-
/** The ID of the subject that the usage event is for. */
|
|
23
|
+
/** The ID or external ID of the subject that the usage event is for. */
|
|
24
24
|
subject_id: string;
|
|
25
25
|
/** The timestamp of the usage event. It is highly recommended to provide a timestamp. If not provided, the current timestamp will be used. */
|
|
26
26
|
timestamp?: string;
|
|
@@ -1,9 +1,14 @@
|
|
|
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
|
export interface BillingStateResponse {
|
|
5
6
|
/** Whether the subject has an active subscription. */
|
|
6
7
|
has_active_subscription: boolean;
|
|
7
8
|
/** Whether the subject has exceeded the included usage (if any) on a usage-based rate they are subscribed to. */
|
|
8
9
|
has_overage_for_usage: boolean;
|
|
10
|
+
/** List of active subscriptions the subject is subscribed to. */
|
|
11
|
+
active_subscriptions: Lark.ActiveSubscription[];
|
|
12
|
+
/** The usage data for the usage-based rates the subject is subscribed to. */
|
|
13
|
+
usage_data: Lark.UsageDataForRate[];
|
|
9
14
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Lark from "../index.mjs";
|
|
5
|
+
export type Result = Lark.Result.RequiresAction | Lark.Result.Success;
|
|
6
|
+
export declare namespace Result {
|
|
7
|
+
interface RequiresAction extends Lark.RequiresActionResponse {
|
|
8
|
+
type: "requires_action";
|
|
9
|
+
}
|
|
10
|
+
interface Success extends Lark.SuccessResponse {
|
|
11
|
+
type: "success";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export * from "./ActiveSubscription.mjs";
|
|
1
2
|
export * from "./Amount.mjs";
|
|
2
3
|
export * from "./BillingStateResponse.mjs";
|
|
4
|
+
export * from "./Result.mjs";
|
|
5
|
+
export * from "./ChangeSubscriptionRateCardResponse.mjs";
|
|
6
|
+
export * from "./CheckoutAction.mjs";
|
|
3
7
|
export * from "./CountAggregationPricingMetricInterface.mjs";
|
|
4
8
|
export * from "./CountAggregationPricingMetricResource.mjs";
|
|
5
9
|
export * from "./CreateCustomerPortalSessionResponse.mjs";
|
|
@@ -31,9 +35,12 @@ export * from "./PricingMetricResource.mjs";
|
|
|
31
35
|
export * from "./PricingMetricSummaryResource.mjs";
|
|
32
36
|
export * from "./RateCardResourceUsageBasedRatesItem.mjs";
|
|
33
37
|
export * from "./RateCardResource.mjs";
|
|
38
|
+
export * from "./RequiresActionResponse.mjs";
|
|
34
39
|
export * from "./SimpleUsageBasedRateInterface.mjs";
|
|
35
40
|
export * from "./SubjectResource.mjs";
|
|
36
41
|
export * from "./SubscriptionResource.mjs";
|
|
42
|
+
export * from "./SuccessResponse.mjs";
|
|
37
43
|
export * from "./SumAggregationPricingMetricInterface.mjs";
|
|
38
44
|
export * from "./SumAggregationPricingMetricResource.mjs";
|
|
45
|
+
export * from "./UsageDataForRate.mjs";
|
|
39
46
|
export * from "./ValidationError.mjs";
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export * from "./ActiveSubscription.mjs";
|
|
1
2
|
export * from "./Amount.mjs";
|
|
2
3
|
export * from "./BillingStateResponse.mjs";
|
|
4
|
+
export * from "./Result.mjs";
|
|
5
|
+
export * from "./ChangeSubscriptionRateCardResponse.mjs";
|
|
6
|
+
export * from "./CheckoutAction.mjs";
|
|
3
7
|
export * from "./CountAggregationPricingMetricInterface.mjs";
|
|
4
8
|
export * from "./CountAggregationPricingMetricResource.mjs";
|
|
5
9
|
export * from "./CreateCustomerPortalSessionResponse.mjs";
|
|
@@ -31,9 +35,12 @@ export * from "./PricingMetricResource.mjs";
|
|
|
31
35
|
export * from "./PricingMetricSummaryResource.mjs";
|
|
32
36
|
export * from "./RateCardResourceUsageBasedRatesItem.mjs";
|
|
33
37
|
export * from "./RateCardResource.mjs";
|
|
38
|
+
export * from "./RequiresActionResponse.mjs";
|
|
34
39
|
export * from "./SimpleUsageBasedRateInterface.mjs";
|
|
35
40
|
export * from "./SubjectResource.mjs";
|
|
36
41
|
export * from "./SubscriptionResource.mjs";
|
|
42
|
+
export * from "./SuccessResponse.mjs";
|
|
37
43
|
export * from "./SumAggregationPricingMetricInterface.mjs";
|
|
38
44
|
export * from "./SumAggregationPricingMetricResource.mjs";
|
|
45
|
+
export * from "./UsageDataForRate.mjs";
|
|
39
46
|
export * from "./ValidationError.mjs";
|
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.2";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.1.
|
|
1
|
+
export const SDK_VERSION = "0.1.2";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -303,10 +303,10 @@ await client.rateCards.getRateCard("rate_card_id");
|
|
|
303
303
|
|
|
304
304
|
```typescript
|
|
305
305
|
await client.usageEvents.createUsageEvent({
|
|
306
|
-
idempotency_key: "
|
|
306
|
+
idempotency_key: "c49b13a8-b0f3-4d61-8fa6-c5e779301682",
|
|
307
307
|
event_name: "compute_hours",
|
|
308
308
|
subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
|
|
309
|
-
timestamp: "2025-
|
|
309
|
+
timestamp: "2025-11-06T00:08:40Z",
|
|
310
310
|
data: {
|
|
311
311
|
compute_hours: 100,
|
|
312
312
|
instance_type: "t2.micro",
|
|
@@ -556,7 +556,7 @@ await client.subscriptions.cancelSubscription("subscription_id");
|
|
|
556
556
|
</dl>
|
|
557
557
|
</details>
|
|
558
558
|
|
|
559
|
-
<details><summary><code>client.subscriptions.<a href="/src/api/resources/subscriptions/client/Client.ts">changeSubscriptionRateCard</a>(subscriptionId, { ...params }) -> Lark.
|
|
559
|
+
<details><summary><code>client.subscriptions.<a href="/src/api/resources/subscriptions/client/Client.ts">changeSubscriptionRateCard</a>(subscriptionId, { ...params }) -> Lark.ChangeSubscriptionRateCardResponse</code></summary>
|
|
560
560
|
<dl>
|
|
561
561
|
<dd>
|
|
562
562
|
|