lark-billing 0.0.7 → 0.0.9

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.
Files changed (163) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +7 -2
  4. package/dist/cjs/api/resources/checkout/client/Client.d.ts +3 -3
  5. package/dist/cjs/api/resources/checkout/client/Client.js +3 -3
  6. package/dist/cjs/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.ts +9 -4
  7. package/dist/cjs/api/resources/customerPortal/client/Client.d.ts +1 -1
  8. package/dist/cjs/api/resources/customerPortal/client/Client.js +1 -1
  9. package/dist/cjs/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.ts +2 -1
  10. package/dist/cjs/api/resources/index.d.ts +4 -1
  11. package/dist/cjs/api/resources/index.js +5 -2
  12. package/dist/cjs/api/resources/invoices/client/Client.d.ts +50 -0
  13. package/dist/cjs/api/resources/invoices/client/Client.js +135 -0
  14. package/dist/cjs/api/resources/invoices/client/index.d.ts +2 -0
  15. package/dist/cjs/api/resources/invoices/client/index.js +17 -0
  16. package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.ts +17 -0
  17. package/dist/cjs/api/resources/invoices/client/requests/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/invoices/client/requests/index.js +2 -0
  19. package/dist/cjs/api/resources/invoices/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/invoices/index.js +17 -0
  21. package/dist/cjs/api/resources/pricingMetrics/client/Client.d.ts +13 -0
  22. package/dist/cjs/api/resources/pricingMetrics/client/Client.js +64 -0
  23. package/dist/cjs/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.d.ts +12 -0
  24. package/dist/cjs/api/resources/pricingMetrics/client/requests/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/rateCards/client/Client.d.ts +1 -1
  26. package/dist/cjs/api/resources/rateCards/client/Client.js +1 -1
  27. package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardRequest.d.ts +9 -3
  28. package/dist/cjs/api/resources/rateCards/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/rateCards/index.js +1 -0
  30. package/dist/cjs/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.d.ts +10 -0
  31. package/dist/cjs/api/resources/rateCards/types/index.d.ts +1 -0
  32. package/dist/cjs/api/resources/rateCards/types/index.js +17 -0
  33. package/dist/cjs/api/resources/subjects/client/requests/CreateSubjectRequest.d.ts +4 -0
  34. package/dist/cjs/api/resources/subjects/client/requests/UpdateSubjectRequest.d.ts +3 -1
  35. package/dist/cjs/api/resources/subscriptions/client/Client.d.ts +28 -2
  36. package/dist/cjs/api/resources/subscriptions/client/Client.js +126 -2
  37. package/dist/cjs/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.d.ts +13 -0
  38. package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.ts +13 -0
  39. package/dist/cjs/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.ts +6 -3
  40. package/dist/cjs/api/resources/subscriptions/client/requests/index.d.ts +2 -0
  41. package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.ts +11 -1
  42. package/dist/cjs/api/types/Aggregation.d.ts +1 -10
  43. package/dist/cjs/api/types/Amount.d.ts +1 -0
  44. package/dist/cjs/api/types/CreateCustomerPortalSessionResponse.d.ts +2 -0
  45. package/dist/cjs/api/types/CreateFixedRateRequest.d.ts +11 -0
  46. package/dist/cjs/api/types/CreateFixedRateRequest.js +5 -0
  47. package/dist/cjs/api/types/CreateSimpleUsageBasedRateRequest.d.ts +15 -0
  48. package/dist/cjs/api/types/CreateSimpleUsageBasedRateRequest.js +5 -0
  49. package/dist/cjs/api/types/CreateSubjectResponse.d.ts +6 -0
  50. package/dist/cjs/api/types/CreateSubscriptionCheckoutSessionResponse.d.ts +3 -0
  51. package/dist/cjs/api/types/FixedRateInterface.d.ts +1 -1
  52. package/dist/cjs/api/types/InvoiceLineItemResource.d.ts +10 -0
  53. package/dist/cjs/api/types/InvoiceLineItemResource.js +5 -0
  54. package/dist/cjs/api/types/InvoiceResource.d.ts +33 -0
  55. package/dist/cjs/api/types/InvoiceResource.js +16 -0
  56. package/dist/cjs/api/types/{CreateFixedRateInterface.d.ts → ListInvoicesResponse.d.ts} +3 -4
  57. package/dist/cjs/api/types/ListInvoicesResponse.js +5 -0
  58. package/dist/cjs/api/types/ListPricingMetricsResponse.d.ts +8 -0
  59. package/dist/cjs/api/types/ListPricingMetricsResponse.js +5 -0
  60. package/dist/cjs/api/types/PeriodResource.d.ts +9 -0
  61. package/dist/cjs/api/types/PeriodResource.js +5 -0
  62. package/dist/cjs/api/types/PricingMetricResource.d.ts +11 -0
  63. package/dist/cjs/api/types/PricingMetricResource.js +5 -0
  64. package/dist/cjs/api/types/RateCardResource.d.ts +8 -1
  65. package/dist/cjs/api/types/SimpleUsageBasedRateInterface.d.ts +1 -3
  66. package/dist/cjs/api/types/SubjectResource.d.ts +6 -0
  67. package/dist/cjs/api/types/SubscriptionResource.d.ts +17 -2
  68. package/dist/cjs/api/types/SubscriptionResource.js +1 -0
  69. package/dist/cjs/api/types/index.d.ts +8 -5
  70. package/dist/cjs/api/types/index.js +8 -5
  71. package/dist/cjs/version.d.ts +1 -1
  72. package/dist/cjs/version.js +1 -1
  73. package/dist/esm/Client.d.mts +3 -0
  74. package/dist/esm/Client.mjs +7 -2
  75. package/dist/esm/api/resources/checkout/client/Client.d.mts +3 -3
  76. package/dist/esm/api/resources/checkout/client/Client.mjs +3 -3
  77. package/dist/esm/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.mts +9 -4
  78. package/dist/esm/api/resources/customerPortal/client/Client.d.mts +1 -1
  79. package/dist/esm/api/resources/customerPortal/client/Client.mjs +1 -1
  80. package/dist/esm/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.mts +2 -1
  81. package/dist/esm/api/resources/index.d.mts +4 -1
  82. package/dist/esm/api/resources/index.mjs +4 -1
  83. package/dist/esm/api/resources/invoices/client/Client.d.mts +50 -0
  84. package/dist/esm/api/resources/invoices/client/Client.mjs +98 -0
  85. package/dist/esm/api/resources/invoices/client/index.d.mts +2 -0
  86. package/dist/esm/api/resources/invoices/client/index.mjs +1 -0
  87. package/dist/esm/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.mts +17 -0
  88. package/dist/esm/api/resources/invoices/client/requests/index.d.mts +1 -0
  89. package/dist/esm/api/resources/invoices/client/requests/index.mjs +1 -0
  90. package/dist/esm/api/resources/invoices/index.d.mts +1 -0
  91. package/dist/esm/api/resources/invoices/index.mjs +1 -0
  92. package/dist/esm/api/resources/pricingMetrics/client/Client.d.mts +13 -0
  93. package/dist/esm/api/resources/pricingMetrics/client/Client.mjs +64 -0
  94. package/dist/esm/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.d.mts +12 -0
  95. package/dist/esm/api/resources/pricingMetrics/client/requests/index.d.mts +1 -0
  96. package/dist/esm/api/resources/rateCards/client/Client.d.mts +1 -1
  97. package/dist/esm/api/resources/rateCards/client/Client.mjs +1 -1
  98. package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardRequest.d.mts +9 -3
  99. package/dist/esm/api/resources/rateCards/index.d.mts +1 -0
  100. package/dist/esm/api/resources/rateCards/index.mjs +1 -0
  101. package/dist/esm/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.d.mts +10 -0
  102. package/dist/esm/api/resources/rateCards/types/index.d.mts +1 -0
  103. package/dist/esm/api/resources/rateCards/types/index.mjs +1 -0
  104. package/dist/esm/api/resources/subjects/client/requests/CreateSubjectRequest.d.mts +4 -0
  105. package/dist/esm/api/resources/subjects/client/requests/UpdateSubjectRequest.d.mts +3 -1
  106. package/dist/esm/api/resources/subscriptions/client/Client.d.mts +28 -2
  107. package/dist/esm/api/resources/subscriptions/client/Client.mjs +126 -2
  108. package/dist/esm/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.d.mts +13 -0
  109. package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.mts +13 -0
  110. package/dist/esm/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.mts +6 -3
  111. package/dist/esm/api/resources/subscriptions/client/requests/index.d.mts +2 -0
  112. package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.mts +11 -1
  113. package/dist/esm/api/types/Aggregation.d.mts +1 -10
  114. package/dist/esm/api/types/Amount.d.mts +1 -0
  115. package/dist/esm/api/types/CreateCustomerPortalSessionResponse.d.mts +2 -0
  116. package/dist/esm/api/types/CreateFixedRateRequest.d.mts +11 -0
  117. package/dist/esm/api/types/CreateFixedRateRequest.mjs +4 -0
  118. package/dist/esm/api/types/CreateSimpleUsageBasedRateRequest.d.mts +15 -0
  119. package/dist/esm/api/types/CreateSimpleUsageBasedRateRequest.mjs +4 -0
  120. package/dist/esm/api/types/CreateSubjectResponse.d.mts +6 -0
  121. package/dist/esm/api/types/CreateSubscriptionCheckoutSessionResponse.d.mts +3 -0
  122. package/dist/esm/api/types/FixedRateInterface.d.mts +1 -1
  123. package/dist/esm/api/types/InvoiceLineItemResource.d.mts +10 -0
  124. package/dist/esm/api/types/InvoiceLineItemResource.mjs +4 -0
  125. package/dist/esm/api/types/InvoiceResource.d.mts +33 -0
  126. package/dist/esm/api/types/InvoiceResource.mjs +13 -0
  127. package/dist/esm/api/types/{CreateFixedRateInterface.d.mts → ListInvoicesResponse.d.mts} +3 -4
  128. package/dist/esm/api/types/ListInvoicesResponse.mjs +4 -0
  129. package/dist/esm/api/types/ListPricingMetricsResponse.d.mts +8 -0
  130. package/dist/esm/api/types/ListPricingMetricsResponse.mjs +4 -0
  131. package/dist/esm/api/types/PeriodResource.d.mts +9 -0
  132. package/dist/esm/api/types/PeriodResource.mjs +4 -0
  133. package/dist/esm/api/types/PricingMetricResource.d.mts +11 -0
  134. package/dist/esm/api/types/PricingMetricResource.mjs +4 -0
  135. package/dist/esm/api/types/RateCardResource.d.mts +8 -1
  136. package/dist/esm/api/types/SimpleUsageBasedRateInterface.d.mts +1 -3
  137. package/dist/esm/api/types/SubjectResource.d.mts +6 -0
  138. package/dist/esm/api/types/SubscriptionResource.d.mts +17 -2
  139. package/dist/esm/api/types/SubscriptionResource.mjs +1 -0
  140. package/dist/esm/api/types/index.d.mts +8 -5
  141. package/dist/esm/api/types/index.mjs +8 -5
  142. package/dist/esm/version.d.mts +1 -1
  143. package/dist/esm/version.mjs +1 -1
  144. package/package.json +1 -1
  145. package/reference.md +225 -7
  146. package/dist/cjs/api/types/CreateSimpleUsageBasedRateInterface.d.ts +0 -12
  147. package/dist/cjs/api/types/CustomPricingMetricResource.d.ts +0 -6
  148. package/dist/cjs/api/types/LastAggregationPricingMetricResource.d.ts +0 -6
  149. package/dist/cjs/api/types/MaxAggregationPricingMetricResource.d.ts +0 -6
  150. package/dist/esm/api/types/CreateSimpleUsageBasedRateInterface.d.mts +0 -12
  151. package/dist/esm/api/types/CustomPricingMetricResource.d.mts +0 -6
  152. package/dist/esm/api/types/LastAggregationPricingMetricResource.d.mts +0 -6
  153. package/dist/esm/api/types/MaxAggregationPricingMetricResource.d.mts +0 -6
  154. /package/dist/cjs/api/{types/CreateFixedRateInterface.js → resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.js} +0 -0
  155. /package/dist/cjs/api/{types/CreateSimpleUsageBasedRateInterface.js → resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.js} +0 -0
  156. /package/dist/cjs/api/{types/CustomPricingMetricResource.js → resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.js} +0 -0
  157. /package/dist/cjs/api/{types/LastAggregationPricingMetricResource.js → resources/subscriptions/client/requests/CancelSubscriptionRequest.js} +0 -0
  158. /package/dist/cjs/api/{types/MaxAggregationPricingMetricResource.js → resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.js} +0 -0
  159. /package/dist/esm/api/{types/CreateFixedRateInterface.mjs → resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.mjs} +0 -0
  160. /package/dist/esm/api/{types/CreateSimpleUsageBasedRateInterface.mjs → resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.mjs} +0 -0
  161. /package/dist/esm/api/{types/CustomPricingMetricResource.mjs → resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.mjs} +0 -0
  162. /package/dist/esm/api/{types/LastAggregationPricingMetricResource.mjs → resources/subscriptions/client/requests/CancelSubscriptionRequest.mjs} +0 -0
  163. /package/dist/esm/api/{types/MaxAggregationPricingMetricResource.mjs → resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.mjs} +0 -0
@@ -1,19 +1,34 @@
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 SubscriptionResource {
6
+ /** The ID of the subscription. */
5
7
  id: string;
8
+ /** The ID of the subject that the subscription is for. */
6
9
  subject_id: string;
10
+ /** The ID of the rate card of the subscription. */
7
11
  rate_card_id: string;
12
+ /** The date and time the subscription became effective. */
8
13
  effective_at: string;
14
+ /** The date and time the next cycle of the subscription will start. */
9
15
  cycles_next_at?: string;
10
- metadata?: Record<string, string | undefined>;
16
+ /** The current period of the subscription if it is active. */
17
+ current_period?: Lark.PeriodResource;
18
+ metadata: Record<string, string>;
19
+ /** The status of the subscription. */
11
20
  status: SubscriptionResource.Status;
21
+ /** Whether the subscription will be cancelled at the end of the current cycle. */
22
+ cancels_at_end_of_cycle: boolean;
12
23
  }
13
24
  export declare namespace SubscriptionResource {
14
- type Status = "active" | "cancelled";
25
+ /**
26
+ * The status of the subscription.
27
+ */
28
+ type Status = "active" | "cancelled" | "paused";
15
29
  const Status: {
16
30
  readonly Active: "active";
17
31
  readonly Cancelled: "cancelled";
32
+ readonly Paused: "paused";
18
33
  };
19
34
  }
@@ -9,5 +9,6 @@ var SubscriptionResource;
9
9
  SubscriptionResource.Status = {
10
10
  Active: "active",
11
11
  Cancelled: "cancelled",
12
+ Paused: "paused",
12
13
  };
13
14
  })(SubscriptionResource || (exports.SubscriptionResource = SubscriptionResource = {}));
@@ -4,25 +4,28 @@ export * from "./CountAggregationPricingMetricInterface.js";
4
4
  export * from "./CountAggregationPricingMetricResource.js";
5
5
  export * from "./CreateCustomerPortalSessionResponse.js";
6
6
  export * from "./Price.js";
7
- export * from "./CreateFixedRateInterface.js";
7
+ export * from "./CreateFixedRateRequest.js";
8
8
  export * from "./Aggregation.js";
9
9
  export * from "./CreatePricingMetricResponse.js";
10
- export * from "./CreateSimpleUsageBasedRateInterface.js";
10
+ export * from "./CreateSimpleUsageBasedRateRequest.js";
11
11
  export * from "./CreateSubjectResponse.js";
12
12
  export * from "./CreateSubscriptionCheckoutSessionResponse.js";
13
13
  export * from "./CreateUsageEventSummaryResponse.js";
14
- export * from "./CustomPricingMetricResource.js";
15
14
  export * from "./FixedRateInterface.js";
16
15
  export * from "./FlatPrice.js";
17
16
  export * from "./GetPricingMetricResponse.js";
18
17
  export * from "./HttpValidationError.js";
19
- export * from "./LastAggregationPricingMetricResource.js";
18
+ export * from "./InvoiceLineItemResource.js";
19
+ export * from "./InvoiceResource.js";
20
+ export * from "./ListInvoicesResponse.js";
21
+ export * from "./ListPricingMetricsResponse.js";
20
22
  export * from "./ListRateCardsResponse.js";
21
23
  export * from "./ListSubjectsResponse.js";
22
24
  export * from "./ListSubscriptionsResponse.js";
23
- export * from "./MaxAggregationPricingMetricResource.js";
24
25
  export * from "./PackagePrice.js";
25
26
  export * from "./Period.js";
27
+ export * from "./PeriodResource.js";
28
+ export * from "./PricingMetricResource.js";
26
29
  export * from "./RateCardResourceUsageBasedRatesItem.js";
27
30
  export * from "./RateCardResource.js";
28
31
  export * from "./SimpleUsageBasedRateInterface.js";
@@ -20,25 +20,28 @@ __exportStar(require("./CountAggregationPricingMetricInterface.js"), exports);
20
20
  __exportStar(require("./CountAggregationPricingMetricResource.js"), exports);
21
21
  __exportStar(require("./CreateCustomerPortalSessionResponse.js"), exports);
22
22
  __exportStar(require("./Price.js"), exports);
23
- __exportStar(require("./CreateFixedRateInterface.js"), exports);
23
+ __exportStar(require("./CreateFixedRateRequest.js"), exports);
24
24
  __exportStar(require("./Aggregation.js"), exports);
25
25
  __exportStar(require("./CreatePricingMetricResponse.js"), exports);
26
- __exportStar(require("./CreateSimpleUsageBasedRateInterface.js"), exports);
26
+ __exportStar(require("./CreateSimpleUsageBasedRateRequest.js"), exports);
27
27
  __exportStar(require("./CreateSubjectResponse.js"), exports);
28
28
  __exportStar(require("./CreateSubscriptionCheckoutSessionResponse.js"), exports);
29
29
  __exportStar(require("./CreateUsageEventSummaryResponse.js"), exports);
30
- __exportStar(require("./CustomPricingMetricResource.js"), exports);
31
30
  __exportStar(require("./FixedRateInterface.js"), exports);
32
31
  __exportStar(require("./FlatPrice.js"), exports);
33
32
  __exportStar(require("./GetPricingMetricResponse.js"), exports);
34
33
  __exportStar(require("./HttpValidationError.js"), exports);
35
- __exportStar(require("./LastAggregationPricingMetricResource.js"), exports);
34
+ __exportStar(require("./InvoiceLineItemResource.js"), exports);
35
+ __exportStar(require("./InvoiceResource.js"), exports);
36
+ __exportStar(require("./ListInvoicesResponse.js"), exports);
37
+ __exportStar(require("./ListPricingMetricsResponse.js"), exports);
36
38
  __exportStar(require("./ListRateCardsResponse.js"), exports);
37
39
  __exportStar(require("./ListSubjectsResponse.js"), exports);
38
40
  __exportStar(require("./ListSubscriptionsResponse.js"), exports);
39
- __exportStar(require("./MaxAggregationPricingMetricResource.js"), exports);
40
41
  __exportStar(require("./PackagePrice.js"), exports);
41
42
  __exportStar(require("./Period.js"), exports);
43
+ __exportStar(require("./PeriodResource.js"), exports);
44
+ __exportStar(require("./PricingMetricResource.js"), exports);
42
45
  __exportStar(require("./RateCardResourceUsageBasedRatesItem.js"), exports);
43
46
  __exportStar(require("./RateCardResource.js"), exports);
44
47
  __exportStar(require("./SimpleUsageBasedRateInterface.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.7";
1
+ export declare const SDK_VERSION = "0.0.9";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.7";
4
+ exports.SDK_VERSION = "0.0.9";
@@ -11,6 +11,7 @@ import { Subscriptions } from "./api/resources/subscriptions/client/Client.mjs";
11
11
  import { Subjects } from "./api/resources/subjects/client/Client.mjs";
12
12
  import { PricingMetrics } from "./api/resources/pricingMetrics/client/Client.mjs";
13
13
  import { CustomerAccess } from "./api/resources/customerAccess/client/Client.mjs";
14
+ import { Invoices } from "./api/resources/invoices/client/Client.mjs";
14
15
  export declare namespace LarkClient {
15
16
  interface Options {
16
17
  environment?: core.Supplier<environments.LarkEnvironment | string>;
@@ -43,6 +44,7 @@ export declare class LarkClient {
43
44
  protected _subjects: Subjects | undefined;
44
45
  protected _pricingMetrics: PricingMetrics | undefined;
45
46
  protected _customerAccess: CustomerAccess | undefined;
47
+ protected _invoices: Invoices | undefined;
46
48
  constructor(_options: LarkClient.Options);
47
49
  get checkout(): Checkout;
48
50
  get customerPortal(): CustomerPortal;
@@ -52,4 +54,5 @@ export declare class LarkClient {
52
54
  get subjects(): Subjects;
53
55
  get pricingMetrics(): PricingMetrics;
54
56
  get customerAccess(): CustomerAccess;
57
+ get invoices(): Invoices;
55
58
  }
@@ -11,13 +11,14 @@ import { Subscriptions } from "./api/resources/subscriptions/client/Client.mjs";
11
11
  import { Subjects } from "./api/resources/subjects/client/Client.mjs";
12
12
  import { PricingMetrics } from "./api/resources/pricingMetrics/client/Client.mjs";
13
13
  import { CustomerAccess } from "./api/resources/customerAccess/client/Client.mjs";
14
+ import { Invoices } from "./api/resources/invoices/client/Client.mjs";
14
15
  export class LarkClient {
15
16
  constructor(_options) {
16
17
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
17
18
  "X-Fern-Language": "JavaScript",
18
19
  "X-Fern-SDK-Name": "lark-billing",
19
- "X-Fern-SDK-Version": "0.0.7",
20
- "User-Agent": "lark-billing/0.0.7",
20
+ "X-Fern-SDK-Version": "0.0.9",
21
+ "User-Agent": "lark-billing/0.0.9",
21
22
  "X-Fern-Runtime": core.RUNTIME.type,
22
23
  "X-Fern-Runtime-Version": core.RUNTIME.version,
23
24
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -54,4 +55,8 @@ export class LarkClient {
54
55
  var _a;
55
56
  return ((_a = this._customerAccess) !== null && _a !== void 0 ? _a : (this._customerAccess = new CustomerAccess(this._options)));
56
57
  }
58
+ get invoices() {
59
+ var _a;
60
+ return ((_a = this._invoices) !== null && _a !== void 0 ? _a : (this._invoices = new Invoices(this._options)));
61
+ }
57
62
  }
@@ -37,9 +37,9 @@ export declare class Checkout {
37
37
  *
38
38
  * @example
39
39
  * await client.checkout.createSubscriptionCheckoutSession({
40
- * subject_id: "subject_id",
41
- * rate_card_id: "rate_card_id",
42
- * callback_url: "callback_url"
40
+ * subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
41
+ * rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
42
+ * success_callback_url: "https://example.com/callback"
43
43
  * })
44
44
  */
45
45
  createSubscriptionCheckoutSession(request: Lark.CreateSubscriptionCheckoutSessionRequest, requestOptions?: Checkout.RequestOptions): core.HttpResponsePromise<Lark.CreateSubscriptionCheckoutSessionResponse>;
@@ -27,9 +27,9 @@ export class Checkout {
27
27
  *
28
28
  * @example
29
29
  * await client.checkout.createSubscriptionCheckoutSession({
30
- * subject_id: "subject_id",
31
- * rate_card_id: "rate_card_id",
32
- * callback_url: "callback_url"
30
+ * subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
31
+ * rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
32
+ * success_callback_url: "https://example.com/callback"
33
33
  * })
34
34
  */
35
35
  createSubscriptionCheckoutSession(request, requestOptions) {
@@ -4,13 +4,18 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * subject_id: "subject_id",
8
- * rate_card_id: "rate_card_id",
9
- * callback_url: "callback_url"
7
+ * subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
8
+ * rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
9
+ * success_callback_url: "https://example.com/callback"
10
10
  * }
11
11
  */
12
12
  export interface CreateSubscriptionCheckoutSessionRequest {
13
+ /** The ID of the subject to create the checkout for. */
13
14
  subject_id: string;
15
+ /** The ID of the rate card to subscribe to. */
14
16
  rate_card_id: string;
15
- callback_url: string;
17
+ /** The URL to redirect to after the checkout is successful. */
18
+ success_callback_url: string;
19
+ /** The URL to redirect to after the checkout is cancelled. */
20
+ cancel_url?: string;
16
21
  }
@@ -37,7 +37,7 @@ export declare class CustomerPortal {
37
37
  *
38
38
  * @example
39
39
  * await client.customerPortal.createCustomerPortalSession({
40
- * subject_id: "subject_id"
40
+ * subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
41
41
  * })
42
42
  */
43
43
  createCustomerPortalSession(request: Lark.CreateCustomerPortalSessionRequest, requestOptions?: CustomerPortal.RequestOptions): core.HttpResponsePromise<Lark.CreateCustomerPortalSessionResponse>;
@@ -27,7 +27,7 @@ export class CustomerPortal {
27
27
  *
28
28
  * @example
29
29
  * await client.customerPortal.createCustomerPortalSession({
30
- * subject_id: "subject_id"
30
+ * subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
31
31
  * })
32
32
  */
33
33
  createCustomerPortalSession(request, requestOptions) {
@@ -4,9 +4,10 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * subject_id: "subject_id"
7
+ * subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
8
8
  * }
9
9
  */
10
10
  export interface CreateCustomerPortalSessionRequest {
11
+ /** The ID of the subject to create the customer portal session for. */
11
12
  subject_id: string;
12
13
  }
@@ -1,12 +1,14 @@
1
+ export * as rateCards from "./rateCards/index.mjs";
2
+ export * from "./rateCards/types/index.mjs";
1
3
  export * as pricingMetrics from "./pricingMetrics/index.mjs";
2
4
  export * from "./pricingMetrics/types/index.mjs";
3
5
  export * as checkout from "./checkout/index.mjs";
4
6
  export * as customerPortal from "./customerPortal/index.mjs";
5
- export * as rateCards from "./rateCards/index.mjs";
6
7
  export * as usageEvents from "./usageEvents/index.mjs";
7
8
  export * as subscriptions from "./subscriptions/index.mjs";
8
9
  export * as subjects from "./subjects/index.mjs";
9
10
  export * as customerAccess from "./customerAccess/index.mjs";
11
+ export * as invoices from "./invoices/index.mjs";
10
12
  export * from "./checkout/client/requests/index.mjs";
11
13
  export * from "./customerPortal/client/requests/index.mjs";
12
14
  export * from "./rateCards/client/requests/index.mjs";
@@ -14,3 +16,4 @@ export * from "./usageEvents/client/requests/index.mjs";
14
16
  export * from "./subscriptions/client/requests/index.mjs";
15
17
  export * from "./subjects/client/requests/index.mjs";
16
18
  export * from "./pricingMetrics/client/requests/index.mjs";
19
+ export * from "./invoices/client/requests/index.mjs";
@@ -1,12 +1,14 @@
1
+ export * as rateCards from "./rateCards/index.mjs";
2
+ export * from "./rateCards/types/index.mjs";
1
3
  export * as pricingMetrics from "./pricingMetrics/index.mjs";
2
4
  export * from "./pricingMetrics/types/index.mjs";
3
5
  export * as checkout from "./checkout/index.mjs";
4
6
  export * as customerPortal from "./customerPortal/index.mjs";
5
- export * as rateCards from "./rateCards/index.mjs";
6
7
  export * as usageEvents from "./usageEvents/index.mjs";
7
8
  export * as subscriptions from "./subscriptions/index.mjs";
8
9
  export * as subjects from "./subjects/index.mjs";
9
10
  export * as customerAccess from "./customerAccess/index.mjs";
11
+ export * as invoices from "./invoices/index.mjs";
10
12
  export * from "./checkout/client/requests/index.mjs";
11
13
  export * from "./customerPortal/client/requests/index.mjs";
12
14
  export * from "./rateCards/client/requests/index.mjs";
@@ -14,3 +16,4 @@ export * from "./usageEvents/client/requests/index.mjs";
14
16
  export * from "./subscriptions/client/requests/index.mjs";
15
17
  export * from "./subjects/client/requests/index.mjs";
16
18
  export * from "./pricingMetrics/client/requests/index.mjs";
19
+ export * from "./invoices/client/requests/index.mjs";
@@ -0,0 +1,50 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments.mjs";
5
+ import * as core from "../../../../core/index.mjs";
6
+ import * as Lark from "../../../index.mjs";
7
+ export declare namespace Invoices {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.LarkEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ apiKey: core.Supplier<string>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
+ }
16
+ interface RequestOptions {
17
+ /** The maximum time to wait for a response in seconds. */
18
+ timeoutInSeconds?: number;
19
+ /** The number of times to retry the request. Defaults to 2. */
20
+ maxRetries?: number;
21
+ /** A hook to abort the request. */
22
+ abortSignal?: AbortSignal;
23
+ /** Additional query string parameters to include in the request. */
24
+ queryParams?: Record<string, unknown>;
25
+ /** Additional headers to include in the request. */
26
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
27
+ }
28
+ }
29
+ export declare class Invoices {
30
+ protected readonly _options: Invoices.Options;
31
+ constructor(_options: Invoices.Options);
32
+ /**
33
+ * @param {Lark.ListInvoicesInvoicesGetRequest} request
34
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
35
+ *
36
+ * @throws {@link Lark.UnprocessableEntityError}
37
+ *
38
+ * @example
39
+ * await client.invoices.listInvoices({
40
+ * subject_id: "subject_id",
41
+ * limit: 1,
42
+ * offset: 1
43
+ * })
44
+ */
45
+ listInvoices(request: Lark.ListInvoicesInvoicesGetRequest, requestOptions?: Invoices.RequestOptions): core.HttpResponsePromise<Lark.ListInvoicesResponse>;
46
+ private __listInvoices;
47
+ protected _getCustomAuthorizationHeaders(): Promise<{
48
+ "X-API-Key": string;
49
+ }>;
50
+ }
@@ -0,0 +1,98 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../environments.mjs";
14
+ import * as core from "../../../../core/index.mjs";
15
+ import * as Lark from "../../../index.mjs";
16
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
17
+ import * as errors from "../../../../errors/index.mjs";
18
+ export class Invoices {
19
+ constructor(_options) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * @param {Lark.ListInvoicesInvoicesGetRequest} request
24
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
25
+ *
26
+ * @throws {@link Lark.UnprocessableEntityError}
27
+ *
28
+ * @example
29
+ * await client.invoices.listInvoices({
30
+ * subject_id: "subject_id",
31
+ * limit: 1,
32
+ * offset: 1
33
+ * })
34
+ */
35
+ listInvoices(request, requestOptions) {
36
+ return core.HttpResponsePromise.fromPromise(this.__listInvoices(request, requestOptions));
37
+ }
38
+ __listInvoices(request, requestOptions) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ var _a, _b, _c;
41
+ const { subject_id: subjectId, limit, offset } = request;
42
+ const _queryParams = {};
43
+ _queryParams["subject_id"] = subjectId;
44
+ if (limit != null) {
45
+ _queryParams["limit"] = limit.toString();
46
+ }
47
+ if (offset != null) {
48
+ _queryParams["offset"] = offset.toString();
49
+ }
50
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
51
+ const _response = yield core.fetcher({
52
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LarkEnvironment.Default, "invoices"),
53
+ method: "GET",
54
+ headers: _headers,
55
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
56
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
57
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
58
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
59
+ });
60
+ if (_response.ok) {
61
+ return { data: _response.body, rawResponse: _response.rawResponse };
62
+ }
63
+ if (_response.error.reason === "status-code") {
64
+ switch (_response.error.statusCode) {
65
+ case 422:
66
+ throw new Lark.UnprocessableEntityError(_response.error.body, _response.rawResponse);
67
+ default:
68
+ throw new errors.LarkError({
69
+ statusCode: _response.error.statusCode,
70
+ body: _response.error.body,
71
+ rawResponse: _response.rawResponse,
72
+ });
73
+ }
74
+ }
75
+ switch (_response.error.reason) {
76
+ case "non-json":
77
+ throw new errors.LarkError({
78
+ statusCode: _response.error.statusCode,
79
+ body: _response.error.rawBody,
80
+ rawResponse: _response.rawResponse,
81
+ });
82
+ case "timeout":
83
+ throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /invoices.");
84
+ case "unknown":
85
+ throw new errors.LarkError({
86
+ message: _response.error.errorMessage,
87
+ rawResponse: _response.rawResponse,
88
+ });
89
+ }
90
+ });
91
+ }
92
+ _getCustomAuthorizationHeaders() {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
95
+ return { "X-API-Key": apiKeyValue };
96
+ });
97
+ }
98
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * subject_id: "subject_id",
8
+ * limit: 1,
9
+ * offset: 1
10
+ * }
11
+ */
12
+ export interface ListInvoicesInvoicesGetRequest {
13
+ /** The ID of the subject to list invoices for. */
14
+ subject_id: string;
15
+ limit?: number;
16
+ offset?: number;
17
+ }
@@ -0,0 +1 @@
1
+ export { type ListInvoicesInvoicesGetRequest } from "./ListInvoicesInvoicesGetRequest.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -29,6 +29,19 @@ export declare namespace PricingMetrics {
29
29
  export declare class PricingMetrics {
30
30
  protected readonly _options: PricingMetrics.Options;
31
31
  constructor(_options: PricingMetrics.Options);
32
+ /**
33
+ * @param {Lark.ListPricingMetricsPricingMetricsGetRequest} request
34
+ * @param {PricingMetrics.RequestOptions} requestOptions - Request-specific configuration.
35
+ *
36
+ * @throws {@link Lark.UnprocessableEntityError}
37
+ *
38
+ * @example
39
+ * await client.pricingMetrics.listPricingMetrics({
40
+ * limit: 1
41
+ * })
42
+ */
43
+ listPricingMetrics(request?: Lark.ListPricingMetricsPricingMetricsGetRequest, requestOptions?: PricingMetrics.RequestOptions): core.HttpResponsePromise<Lark.ListPricingMetricsResponse>;
44
+ private __listPricingMetrics;
32
45
  /**
33
46
  * @param {Lark.CreatePricingMetricRequest} request
34
47
  * @param {PricingMetrics.RequestOptions} requestOptions - Request-specific configuration.
@@ -19,6 +19,70 @@ export class PricingMetrics {
19
19
  constructor(_options) {
20
20
  this._options = _options;
21
21
  }
22
+ /**
23
+ * @param {Lark.ListPricingMetricsPricingMetricsGetRequest} request
24
+ * @param {PricingMetrics.RequestOptions} requestOptions - Request-specific configuration.
25
+ *
26
+ * @throws {@link Lark.UnprocessableEntityError}
27
+ *
28
+ * @example
29
+ * await client.pricingMetrics.listPricingMetrics({
30
+ * limit: 1
31
+ * })
32
+ */
33
+ listPricingMetrics(request = {}, requestOptions) {
34
+ return core.HttpResponsePromise.fromPromise(this.__listPricingMetrics(request, requestOptions));
35
+ }
36
+ __listPricingMetrics() {
37
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
38
+ var _a, _b, _c;
39
+ const { limit } = request;
40
+ const _queryParams = {};
41
+ if (limit != null) {
42
+ _queryParams["limit"] = limit.toString();
43
+ }
44
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
45
+ const _response = yield core.fetcher({
46
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LarkEnvironment.Default, "pricing-metrics"),
47
+ method: "GET",
48
+ headers: _headers,
49
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
50
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
51
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
52
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
53
+ });
54
+ if (_response.ok) {
55
+ return { data: _response.body, rawResponse: _response.rawResponse };
56
+ }
57
+ if (_response.error.reason === "status-code") {
58
+ switch (_response.error.statusCode) {
59
+ case 422:
60
+ throw new Lark.UnprocessableEntityError(_response.error.body, _response.rawResponse);
61
+ default:
62
+ throw new errors.LarkError({
63
+ statusCode: _response.error.statusCode,
64
+ body: _response.error.body,
65
+ rawResponse: _response.rawResponse,
66
+ });
67
+ }
68
+ }
69
+ switch (_response.error.reason) {
70
+ case "non-json":
71
+ throw new errors.LarkError({
72
+ statusCode: _response.error.statusCode,
73
+ body: _response.error.rawBody,
74
+ rawResponse: _response.rawResponse,
75
+ });
76
+ case "timeout":
77
+ throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /pricing-metrics.");
78
+ case "unknown":
79
+ throw new errors.LarkError({
80
+ message: _response.error.errorMessage,
81
+ rawResponse: _response.rawResponse,
82
+ });
83
+ }
84
+ });
85
+ }
22
86
  /**
23
87
  * @param {Lark.CreatePricingMetricRequest} request
24
88
  * @param {PricingMetrics.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * limit: 1
8
+ * }
9
+ */
10
+ export interface ListPricingMetricsPricingMetricsGetRequest {
11
+ limit?: number;
12
+ }
@@ -1 +1,2 @@
1
+ export { type ListPricingMetricsPricingMetricsGetRequest } from "./ListPricingMetricsPricingMetricsGetRequest.mjs";
1
2
  export { type CreatePricingMetricRequest } from "./CreatePricingMetricRequest.mjs";
@@ -50,7 +50,7 @@ export declare class RateCards {
50
50
  *
51
51
  * @example
52
52
  * await client.rateCards.createRateCard({
53
- * name: "name",
53
+ * name: "Pro Plan",
54
54
  * billing_interval: "monthly"
55
55
  * })
56
56
  */
@@ -91,7 +91,7 @@ export class RateCards {
91
91
  *
92
92
  * @example
93
93
  * await client.rateCards.createRateCard({
94
- * name: "name",
94
+ * name: "Pro Plan",
95
95
  * billing_interval: "monthly"
96
96
  * })
97
97
  */