lark-billing 0.0.8 → 0.1.0

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 (131) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/checkout/client/Client.d.ts +2 -2
  4. package/dist/cjs/api/resources/checkout/client/Client.js +2 -2
  5. package/dist/cjs/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.ts +4 -2
  6. package/dist/cjs/api/resources/customerPortal/client/Client.d.ts +1 -1
  7. package/dist/cjs/api/resources/customerPortal/client/Client.js +1 -1
  8. package/dist/cjs/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.ts +2 -1
  9. package/dist/cjs/api/resources/pricingMetrics/client/Client.d.ts +25 -6
  10. package/dist/cjs/api/resources/pricingMetrics/client/Client.js +72 -4
  11. package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.d.ts +9 -5
  12. package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.d.ts +20 -0
  13. package/dist/cjs/api/resources/pricingMetrics/client/requests/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/pricingMetrics/types/PricingMetricAggregation.d.ts +13 -1
  15. package/dist/cjs/api/resources/rateCards/client/Client.d.ts +28 -2
  16. package/dist/cjs/api/resources/rateCards/client/Client.js +28 -2
  17. package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardRequest.d.ts +38 -4
  18. package/dist/cjs/api/resources/subjects/client/Client.d.ts +8 -1
  19. package/dist/cjs/api/resources/subjects/client/Client.js +8 -1
  20. package/dist/cjs/api/resources/subjects/client/requests/CreateSubjectRequest.d.ts +8 -1
  21. package/dist/cjs/api/resources/subscriptions/client/Client.d.ts +1 -1
  22. package/dist/cjs/api/resources/subscriptions/client/Client.js +1 -1
  23. package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.ts +2 -1
  24. package/dist/cjs/api/resources/usageEvents/client/Client.d.ts +7 -23
  25. package/dist/cjs/api/resources/usageEvents/client/Client.js +7 -72
  26. package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.ts +18 -5
  27. package/dist/cjs/api/resources/usageEvents/client/requests/index.d.ts +0 -1
  28. package/dist/cjs/api/types/Aggregation.d.ts +10 -1
  29. package/dist/cjs/api/types/Amount.d.ts +1 -0
  30. package/dist/cjs/api/types/BillingStateResponse.d.ts +2 -0
  31. package/dist/cjs/api/types/CountAggregationPricingMetricInterface.d.ts +3 -0
  32. package/dist/cjs/api/types/CreateCustomerPortalSessionResponse.d.ts +2 -0
  33. package/dist/cjs/api/types/CreateFixedRateRequest.d.ts +3 -1
  34. package/dist/cjs/api/types/CreateSimpleUsageBasedRateRequest.d.ts +4 -1
  35. package/dist/cjs/api/types/CreateSubscriptionCheckoutSessionResponse.d.ts +3 -0
  36. package/dist/cjs/api/types/CustomAggregationPricingMetricInterface.d.ts +10 -0
  37. package/dist/cjs/api/types/FixedRateInterface.d.ts +1 -1
  38. package/dist/cjs/api/types/InvoiceResource.d.ts +10 -2
  39. package/dist/cjs/api/types/LastAggregationPricingMetricInterface.d.ts +10 -0
  40. package/dist/cjs/api/types/LastAggregationPricingMetricResource.d.ts +7 -0
  41. package/dist/cjs/api/types/LastAggregationPricingMetricResource.js +5 -0
  42. package/dist/cjs/api/types/MaxAggregationPricingMetricInterface.d.ts +10 -0
  43. package/dist/cjs/api/types/MaxAggregationPricingMetricInterface.js +5 -0
  44. package/dist/cjs/api/types/MaxAggregationPricingMetricResource.d.ts +7 -0
  45. package/dist/cjs/api/types/MaxAggregationPricingMetricResource.js +5 -0
  46. package/dist/cjs/api/types/PricingMetricResource.d.ts +5 -0
  47. package/dist/cjs/api/types/PricingMetricSummaryResource.d.ts +16 -0
  48. package/dist/cjs/api/types/PricingMetricSummaryResource.js +5 -0
  49. package/dist/cjs/api/types/RateCardResource.d.ts +8 -1
  50. package/dist/cjs/api/types/SimpleUsageBasedRateInterface.d.ts +1 -1
  51. package/dist/cjs/api/types/SubscriptionResource.d.ts +11 -0
  52. package/dist/cjs/api/types/SumAggregationPricingMetricInterface.d.ts +3 -0
  53. package/dist/cjs/api/types/SumAggregationPricingMetricResource.d.ts +1 -0
  54. package/dist/cjs/api/types/index.d.ts +7 -4
  55. package/dist/cjs/api/types/index.js +7 -4
  56. package/dist/cjs/version.d.ts +1 -1
  57. package/dist/cjs/version.js +1 -1
  58. package/dist/esm/Client.mjs +2 -2
  59. package/dist/esm/api/resources/checkout/client/Client.d.mts +2 -2
  60. package/dist/esm/api/resources/checkout/client/Client.mjs +2 -2
  61. package/dist/esm/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.mts +4 -2
  62. package/dist/esm/api/resources/customerPortal/client/Client.d.mts +1 -1
  63. package/dist/esm/api/resources/customerPortal/client/Client.mjs +1 -1
  64. package/dist/esm/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.mts +2 -1
  65. package/dist/esm/api/resources/pricingMetrics/client/Client.d.mts +25 -6
  66. package/dist/esm/api/resources/pricingMetrics/client/Client.mjs +72 -4
  67. package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.d.mts +9 -5
  68. package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.d.mts +20 -0
  69. package/dist/esm/api/resources/pricingMetrics/client/requests/index.d.mts +1 -0
  70. package/dist/esm/api/resources/pricingMetrics/types/PricingMetricAggregation.d.mts +13 -1
  71. package/dist/esm/api/resources/rateCards/client/Client.d.mts +28 -2
  72. package/dist/esm/api/resources/rateCards/client/Client.mjs +28 -2
  73. package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardRequest.d.mts +38 -4
  74. package/dist/esm/api/resources/subjects/client/Client.d.mts +8 -1
  75. package/dist/esm/api/resources/subjects/client/Client.mjs +8 -1
  76. package/dist/esm/api/resources/subjects/client/requests/CreateSubjectRequest.d.mts +8 -1
  77. package/dist/esm/api/resources/subscriptions/client/Client.d.mts +1 -1
  78. package/dist/esm/api/resources/subscriptions/client/Client.mjs +1 -1
  79. package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.mts +2 -1
  80. package/dist/esm/api/resources/usageEvents/client/Client.d.mts +7 -23
  81. package/dist/esm/api/resources/usageEvents/client/Client.mjs +7 -72
  82. package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.mts +18 -5
  83. package/dist/esm/api/resources/usageEvents/client/requests/index.d.mts +0 -1
  84. package/dist/esm/api/types/Aggregation.d.mts +10 -1
  85. package/dist/esm/api/types/Amount.d.mts +1 -0
  86. package/dist/esm/api/types/BillingStateResponse.d.mts +2 -0
  87. package/dist/esm/api/types/CountAggregationPricingMetricInterface.d.mts +3 -0
  88. package/dist/esm/api/types/CreateCustomerPortalSessionResponse.d.mts +2 -0
  89. package/dist/esm/api/types/CreateFixedRateRequest.d.mts +3 -1
  90. package/dist/esm/api/types/CreateSimpleUsageBasedRateRequest.d.mts +4 -1
  91. package/dist/esm/api/types/CreateSubscriptionCheckoutSessionResponse.d.mts +3 -0
  92. package/dist/esm/api/types/CustomAggregationPricingMetricInterface.d.mts +10 -0
  93. package/dist/esm/api/types/FixedRateInterface.d.mts +1 -1
  94. package/dist/esm/api/types/InvoiceResource.d.mts +10 -2
  95. package/dist/esm/api/types/LastAggregationPricingMetricInterface.d.mts +10 -0
  96. package/dist/esm/api/types/LastAggregationPricingMetricResource.d.mts +7 -0
  97. package/dist/esm/api/types/LastAggregationPricingMetricResource.mjs +4 -0
  98. package/dist/esm/api/types/MaxAggregationPricingMetricInterface.d.mts +10 -0
  99. package/dist/esm/api/types/MaxAggregationPricingMetricInterface.mjs +4 -0
  100. package/dist/esm/api/types/MaxAggregationPricingMetricResource.d.mts +7 -0
  101. package/dist/esm/api/types/MaxAggregationPricingMetricResource.mjs +4 -0
  102. package/dist/esm/api/types/PricingMetricResource.d.mts +5 -0
  103. package/dist/esm/api/types/PricingMetricSummaryResource.d.mts +16 -0
  104. package/dist/esm/api/types/PricingMetricSummaryResource.mjs +4 -0
  105. package/dist/esm/api/types/RateCardResource.d.mts +8 -1
  106. package/dist/esm/api/types/SimpleUsageBasedRateInterface.d.mts +1 -1
  107. package/dist/esm/api/types/SubscriptionResource.d.mts +11 -0
  108. package/dist/esm/api/types/SumAggregationPricingMetricInterface.d.mts +3 -0
  109. package/dist/esm/api/types/SumAggregationPricingMetricResource.d.mts +1 -0
  110. package/dist/esm/api/types/index.d.mts +7 -4
  111. package/dist/esm/api/types/index.mjs +7 -4
  112. package/dist/esm/version.d.mts +1 -1
  113. package/dist/esm/version.mjs +1 -1
  114. package/package.json +1 -1
  115. package/reference.md +119 -72
  116. package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.d.ts +0 -30
  117. package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.js +0 -14
  118. package/dist/cjs/api/types/CreatePricingMetricResponse.d.ts +0 -11
  119. package/dist/cjs/api/types/CreateUsageEventSummaryResponse.d.ts +0 -10
  120. package/dist/cjs/api/types/GetPricingMetricResponse.d.ts +0 -11
  121. package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.d.mts +0 -30
  122. package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventSummaryRequest.mjs +0 -11
  123. package/dist/esm/api/types/CreatePricingMetricResponse.d.mts +0 -11
  124. package/dist/esm/api/types/CreateUsageEventSummaryResponse.d.mts +0 -10
  125. package/dist/esm/api/types/GetPricingMetricResponse.d.mts +0 -11
  126. /package/dist/cjs/api/{types/CreatePricingMetricResponse.js → resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.js} +0 -0
  127. /package/dist/cjs/api/types/{CreateUsageEventSummaryResponse.js → CustomAggregationPricingMetricInterface.js} +0 -0
  128. /package/dist/cjs/api/types/{GetPricingMetricResponse.js → LastAggregationPricingMetricInterface.js} +0 -0
  129. /package/dist/esm/api/{types/CreatePricingMetricResponse.mjs → resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.mjs} +0 -0
  130. /package/dist/esm/api/types/{CreateUsageEventSummaryResponse.mjs → CustomAggregationPricingMetricInterface.mjs} +0 -0
  131. /package/dist/esm/api/types/{GetPricingMetricResponse.mjs → LastAggregationPricingMetricInterface.mjs} +0 -0
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface BillingStateResponse {
5
+ /** Whether the subject has an active subscription. */
5
6
  has_active_subscription: boolean;
7
+ /** Whether the subject has exceeded the included usage (if any) on a usage-based rate they are subscribed to. */
6
8
  has_overage_for_usage: boolean;
7
9
  }
@@ -1,5 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ /**
5
+ * Computes the number of usage events with the specified `event_name`.
6
+ */
4
7
  export interface CountAggregationPricingMetricInterface {
5
8
  }
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface CreateCustomerPortalSessionResponse {
5
+ /** The ID of the subject for the customer portal session. */
5
6
  subject_id: string;
7
+ /** The URL to redirect to the customer portal session. */
6
8
  url: string;
7
9
  }
@@ -3,7 +3,9 @@
3
3
  */
4
4
  import * as Lark from "../index.mjs";
5
5
  export interface CreateFixedRateRequest {
6
- name?: string;
6
+ /** The name of the rate displayed to the customer. */
7
+ name: string;
8
+ /** The description of the rate displayed to the customer. */
7
9
  description?: string;
8
10
  price: Lark.Price;
9
11
  }
@@ -3,9 +3,12 @@
3
3
  */
4
4
  import * as Lark from "../index.mjs";
5
5
  export interface CreateSimpleUsageBasedRateRequest {
6
- name?: string;
6
+ /** The name of the rate displayed to the customer. */
7
+ name: string;
8
+ /** The description of the rate displayed to the customer. */
7
9
  description?: string;
8
10
  price: Lark.Price;
11
+ /** The number of units included in the rate before the price is applied. */
9
12
  included_units?: number;
10
13
  /** The ID of the pricing metric to use for this rate. */
11
14
  pricing_metric_id: string;
@@ -3,7 +3,10 @@
3
3
  */
4
4
  import * as Lark from "../index.mjs";
5
5
  export interface CreateSubscriptionCheckoutSessionResponse {
6
+ /** The ID of the checkout session. */
6
7
  id: string;
8
+ /** The amount of the checkout session. */
7
9
  amount: Lark.Amount;
10
+ /** The URL to redirect to the checkout session. */
8
11
  url: string;
9
12
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Custom aggregation for use cases not supported by the other aggregation types. Please email team@uselark.ai to enable this feature.
6
+ */
7
+ export interface CustomAggregationPricingMetricInterface {
8
+ /** Custom expression to compute the pricing metric. Please email team@uselark.ai to enable this feature. */
9
+ custom_expression: string;
10
+ }
@@ -5,6 +5,6 @@ import * as Lark from "../index.mjs";
5
5
  export interface FixedRateInterface {
6
6
  id: string;
7
7
  name: string;
8
- description: string;
8
+ description?: string;
9
9
  price: Lark.Price;
10
10
  }
@@ -3,17 +3,25 @@
3
3
  */
4
4
  import * as Lark from "../index.mjs";
5
5
  export interface InvoiceResource {
6
+ /** The ID of the invoice. */
6
7
  id: string;
7
- merchant_id: string;
8
- bill_id?: string;
8
+ /** The total amount of the invoice. */
9
9
  total_amount: Lark.Amount;
10
+ /** The ID of the subject for the invoice. */
10
11
  subject_id: string;
12
+ /** The date and time the invoice was created. */
11
13
  created_at: string;
14
+ /** The status of the invoice. */
12
15
  status: InvoiceResource.Status;
16
+ /** The URL of the hosted invoice. */
13
17
  hosted_url?: string;
18
+ /** The line items of the invoice. */
14
19
  line_items: Lark.InvoiceLineItemResource[];
15
20
  }
16
21
  export declare namespace InvoiceResource {
22
+ /**
23
+ * The status of the invoice.
24
+ */
17
25
  type Status = "draft" | "open" | "paid" | "uncollectible" | "void";
18
26
  const Status: {
19
27
  readonly Draft: "draft";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Computes the last value of the `value_field` over all usage events with the specified `event_name`.
6
+ */
7
+ export interface LastAggregationPricingMetricInterface {
8
+ /** Field to get the last value of. */
9
+ value_field: string;
10
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface LastAggregationPricingMetricResource {
5
+ /** The field to get the last value of. */
6
+ value_field: string;
7
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Computes the max value of the `value_field` over all usage events with the specified `event_name`.
6
+ */
7
+ export interface MaxAggregationPricingMetricInterface {
8
+ /** Field to get the max value of. */
9
+ value_field: string;
10
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MaxAggregationPricingMetricResource {
5
+ /** The field to get the max value of. */
6
+ value_field: string;
7
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -3,9 +3,14 @@
3
3
  */
4
4
  import * as Lark from "../index.mjs";
5
5
  export interface PricingMetricResource {
6
+ /** The ID of the pricing metric. */
6
7
  id: string;
8
+ /** The name of the pricing metric. */
7
9
  name: string;
10
+ /** The event name that the pricing metric is computed on. */
8
11
  event_name: string;
12
+ /** The aggregation function used to compute the value of the pricing metric. */
9
13
  aggregation: Lark.Aggregation;
14
+ /** The unit of the value computed by the pricing metric. */
10
15
  unit: string;
11
16
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Lark from "../index.mjs";
5
+ export interface PricingMetricSummaryResource {
6
+ /** The ID of the pricing metric summary. */
7
+ id: string;
8
+ /** The ID of the pricing metric that the summary is for. */
9
+ pricing_metric_id: string;
10
+ /** The ID of the subject that the summary is for. */
11
+ subject_id: string;
12
+ /** The period that the summary is computed over. */
13
+ period: Lark.Period;
14
+ /** The computed value of the pricing metric for the period. If the pricing metric does not have any usage events for the period, this will be `null`. */
15
+ value?: string;
16
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -3,13 +3,20 @@
3
3
  */
4
4
  import * as Lark from "../index.mjs";
5
5
  export interface RateCardResource {
6
+ /** The ID of the rate card. */
6
7
  id: string;
8
+ /** The name of the rate card. */
7
9
  name: string;
8
- description: string;
10
+ /** The description of the rate card. */
11
+ description?: string;
12
+ /** The usage based rates of the rate card. */
9
13
  usage_based_rates: Lark.RateCardResourceUsageBasedRatesItem[];
14
+ /** The fixed rates of the rate card. */
10
15
  fixed_rates: Lark.FixedRateInterface[];
11
16
  billing_interval: RateCardResource.BillingInterval;
17
+ /** The date and time the rate card was created. */
12
18
  created_at: string;
19
+ /** The date and time the rate card was last updated. */
13
20
  updated_at: string;
14
21
  metadata: Record<string, string>;
15
22
  }
@@ -5,7 +5,7 @@ import * as Lark from "../index.mjs";
5
5
  export interface SimpleUsageBasedRateInterface {
6
6
  id: string;
7
7
  name: string;
8
- description: string;
8
+ description?: string;
9
9
  price: Lark.Price;
10
10
  included_units: number;
11
11
  pricing_metric_id: string;
@@ -3,17 +3,28 @@
3
3
  */
4
4
  import * as Lark from "../index.mjs";
5
5
  export interface SubscriptionResource {
6
+ /** The ID of the subscription. */
6
7
  id: string;
8
+ /** The ID of the subject that the subscription is for. */
7
9
  subject_id: string;
10
+ /** The ID of the rate card of the subscription. */
8
11
  rate_card_id: string;
12
+ /** The date and time the subscription became effective. */
9
13
  effective_at: string;
14
+ /** The date and time the next cycle of the subscription will start. */
10
15
  cycles_next_at?: string;
16
+ /** The current period of the subscription if it is active. */
11
17
  current_period?: Lark.PeriodResource;
12
18
  metadata: Record<string, string>;
19
+ /** The status of the subscription. */
13
20
  status: SubscriptionResource.Status;
21
+ /** Whether the subscription will be cancelled at the end of the current cycle. */
14
22
  cancels_at_end_of_cycle: boolean;
15
23
  }
16
24
  export declare namespace SubscriptionResource {
25
+ /**
26
+ * The status of the subscription.
27
+ */
17
28
  type Status = "active" | "cancelled" | "paused";
18
29
  const Status: {
19
30
  readonly Active: "active";
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ /**
5
+ * Computes the sum of the `value_field` over all usage events with the specified `event_name`.
6
+ */
4
7
  export interface SumAggregationPricingMetricInterface {
5
8
  /** Field to sum over. */
6
9
  value_field: string;
@@ -2,5 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface SumAggregationPricingMetricResource {
5
+ /** The field to sum over. */
5
6
  value_field: string;
6
7
  }
@@ -5,27 +5,30 @@ export * from "./CountAggregationPricingMetricResource.mjs";
5
5
  export * from "./CreateCustomerPortalSessionResponse.mjs";
6
6
  export * from "./Price.mjs";
7
7
  export * from "./CreateFixedRateRequest.mjs";
8
- export * from "./Aggregation.mjs";
9
- export * from "./CreatePricingMetricResponse.mjs";
10
8
  export * from "./CreateSimpleUsageBasedRateRequest.mjs";
11
9
  export * from "./CreateSubjectResponse.mjs";
12
10
  export * from "./CreateSubscriptionCheckoutSessionResponse.mjs";
13
- export * from "./CreateUsageEventSummaryResponse.mjs";
11
+ export * from "./CustomAggregationPricingMetricInterface.mjs";
14
12
  export * from "./FixedRateInterface.mjs";
15
13
  export * from "./FlatPrice.mjs";
16
- export * from "./GetPricingMetricResponse.mjs";
17
14
  export * from "./HttpValidationError.mjs";
18
15
  export * from "./InvoiceLineItemResource.mjs";
19
16
  export * from "./InvoiceResource.mjs";
17
+ export * from "./LastAggregationPricingMetricInterface.mjs";
18
+ export * from "./LastAggregationPricingMetricResource.mjs";
20
19
  export * from "./ListInvoicesResponse.mjs";
21
20
  export * from "./ListPricingMetricsResponse.mjs";
22
21
  export * from "./ListRateCardsResponse.mjs";
23
22
  export * from "./ListSubjectsResponse.mjs";
24
23
  export * from "./ListSubscriptionsResponse.mjs";
24
+ export * from "./MaxAggregationPricingMetricInterface.mjs";
25
+ export * from "./MaxAggregationPricingMetricResource.mjs";
25
26
  export * from "./PackagePrice.mjs";
26
27
  export * from "./Period.mjs";
27
28
  export * from "./PeriodResource.mjs";
29
+ export * from "./Aggregation.mjs";
28
30
  export * from "./PricingMetricResource.mjs";
31
+ export * from "./PricingMetricSummaryResource.mjs";
29
32
  export * from "./RateCardResourceUsageBasedRatesItem.mjs";
30
33
  export * from "./RateCardResource.mjs";
31
34
  export * from "./SimpleUsageBasedRateInterface.mjs";
@@ -5,27 +5,30 @@ export * from "./CountAggregationPricingMetricResource.mjs";
5
5
  export * from "./CreateCustomerPortalSessionResponse.mjs";
6
6
  export * from "./Price.mjs";
7
7
  export * from "./CreateFixedRateRequest.mjs";
8
- export * from "./Aggregation.mjs";
9
- export * from "./CreatePricingMetricResponse.mjs";
10
8
  export * from "./CreateSimpleUsageBasedRateRequest.mjs";
11
9
  export * from "./CreateSubjectResponse.mjs";
12
10
  export * from "./CreateSubscriptionCheckoutSessionResponse.mjs";
13
- export * from "./CreateUsageEventSummaryResponse.mjs";
11
+ export * from "./CustomAggregationPricingMetricInterface.mjs";
14
12
  export * from "./FixedRateInterface.mjs";
15
13
  export * from "./FlatPrice.mjs";
16
- export * from "./GetPricingMetricResponse.mjs";
17
14
  export * from "./HttpValidationError.mjs";
18
15
  export * from "./InvoiceLineItemResource.mjs";
19
16
  export * from "./InvoiceResource.mjs";
17
+ export * from "./LastAggregationPricingMetricInterface.mjs";
18
+ export * from "./LastAggregationPricingMetricResource.mjs";
20
19
  export * from "./ListInvoicesResponse.mjs";
21
20
  export * from "./ListPricingMetricsResponse.mjs";
22
21
  export * from "./ListRateCardsResponse.mjs";
23
22
  export * from "./ListSubjectsResponse.mjs";
24
23
  export * from "./ListSubscriptionsResponse.mjs";
24
+ export * from "./MaxAggregationPricingMetricInterface.mjs";
25
+ export * from "./MaxAggregationPricingMetricResource.mjs";
25
26
  export * from "./PackagePrice.mjs";
26
27
  export * from "./Period.mjs";
27
28
  export * from "./PeriodResource.mjs";
29
+ export * from "./Aggregation.mjs";
28
30
  export * from "./PricingMetricResource.mjs";
31
+ export * from "./PricingMetricSummaryResource.mjs";
29
32
  export * from "./RateCardResourceUsageBasedRatesItem.mjs";
30
33
  export * from "./RateCardResource.mjs";
31
34
  export * from "./SimpleUsageBasedRateInterface.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.8";
1
+ export declare const SDK_VERSION = "0.1.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.8";
1
+ export const SDK_VERSION = "0.1.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lark-billing",
3
- "version": "0.0.8",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "repository": "github:fern-demo/lark-ts-sdk",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -16,8 +16,8 @@
16
16
 
17
17
  ```typescript
18
18
  await client.checkout.createSubscriptionCheckoutSession({
19
- subject_id: "subject_id",
20
- rate_card_id: "rate_card_id",
19
+ subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
20
+ rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
21
21
  success_callback_url: "https://example.com/callback",
22
22
  });
23
23
  ```
@@ -70,7 +70,7 @@ await client.checkout.createSubscriptionCheckoutSession({
70
70
 
71
71
  ```typescript
72
72
  await client.customerPortal.createCustomerPortalSession({
73
- subject_id: "subject_id",
73
+ subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
74
74
  });
75
75
  ```
76
76
 
@@ -172,8 +172,38 @@ await client.rateCards.listRateCards({
172
172
 
173
173
  ```typescript
174
174
  await client.rateCards.createRateCard({
175
- name: "name",
175
+ name: "Pro Plan",
176
+ description: "For production applications with moderate usage.",
176
177
  billing_interval: "monthly",
178
+ fixed_rates: [
179
+ {
180
+ name: "Base Rate",
181
+ price: {
182
+ price_type: "flat",
183
+ amount: {
184
+ value: "2500",
185
+ currency_code: "usd",
186
+ },
187
+ },
188
+ },
189
+ ],
190
+ usage_based_rates: [
191
+ {
192
+ usage_based_rate_type: "simple",
193
+ name: "name",
194
+ price: {
195
+ price_type: "flat",
196
+ amount: {
197
+ value: "2500",
198
+ currency_code: "usd",
199
+ },
200
+ },
201
+ pricing_metric_id: "pricing_metric_id",
202
+ },
203
+ ],
204
+ metadata: {
205
+ key: "value",
206
+ },
177
207
  });
178
208
  ```
179
209
 
@@ -273,11 +303,14 @@ await client.rateCards.getRateCard("rate_card_id");
273
303
 
274
304
  ```typescript
275
305
  await client.usageEvents.createUsageEvent({
276
- idempotency_key: "idempotency_key",
277
- event_name: "event_name",
278
- subject_id: "subject_id",
306
+ idempotency_key: "6b4ef298-4566-427d-b2ca-cd8fbe38ec60",
307
+ event_name: "compute_hours",
308
+ subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
309
+ timestamp: "2025-10-31T20:29:47Z",
279
310
  data: {
280
- key: "value",
311
+ compute_hours: 100,
312
+ instance_type: "t2.micro",
313
+ region: "us-east-1",
281
314
  },
282
315
  });
283
316
  ```
@@ -314,62 +347,6 @@ await client.usageEvents.createUsageEvent({
314
347
  </dl>
315
348
  </details>
316
349
 
317
- <details><summary><code>client.usageEvents.<a href="/src/api/resources/usageEvents/client/Client.ts">createUsageEventSummary</a>({ ...params }) -> Lark.CreateUsageEventSummaryResponse</code></summary>
318
- <dl>
319
- <dd>
320
-
321
- #### 🔌 Usage
322
-
323
- <dl>
324
- <dd>
325
-
326
- <dl>
327
- <dd>
328
-
329
- ```typescript
330
- await client.usageEvents.createUsageEventSummary({
331
- event_name: "event_name",
332
- subject_id: "subject_id",
333
- period: {
334
- start: "2024-01-15T09:30:00Z",
335
- end: "2024-01-15T09:30:00Z",
336
- },
337
- aggregation_type: "sum",
338
- });
339
- ```
340
-
341
- </dd>
342
- </dl>
343
- </dd>
344
- </dl>
345
-
346
- #### ⚙️ Parameters
347
-
348
- <dl>
349
- <dd>
350
-
351
- <dl>
352
- <dd>
353
-
354
- **request:** `Lark.CreateUsageEventSummaryRequest`
355
-
356
- </dd>
357
- </dl>
358
-
359
- <dl>
360
- <dd>
361
-
362
- **requestOptions:** `UsageEvents.RequestOptions`
363
-
364
- </dd>
365
- </dl>
366
- </dd>
367
- </dl>
368
-
369
- </dd>
370
- </dl>
371
- </details>
372
-
373
350
  ## Subscriptions
374
351
 
375
352
  <details><summary><code>client.subscriptions.<a href="/src/api/resources/subscriptions/client/Client.ts">listSubscriptions</a>({ ...params }) -> Lark.ListSubscriptionsResponse</code></summary>
@@ -593,7 +570,7 @@ await client.subscriptions.cancelSubscription("subscription_id");
593
570
 
594
571
  ```typescript
595
572
  await client.subscriptions.changeSubscriptionRateCard("subscription_id", {
596
- rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
573
+ rate_card_id: "rc_jQK2n0wutCj6bBcAIrL6o07g",
597
574
  });
598
575
  ```
599
576
 
@@ -703,7 +680,14 @@ await client.subjects.listSubjects({
703
680
  <dd>
704
681
 
705
682
  ```typescript
706
- await client.subjects.createSubject();
683
+ await client.subjects.createSubject({
684
+ external_id: "user_1234567890",
685
+ name: "John Doe",
686
+ email: "john.doe@example.com",
687
+ metadata: {
688
+ key: "value",
689
+ },
690
+ });
707
691
  ```
708
692
 
709
693
  </dd>
@@ -942,7 +926,7 @@ await client.pricingMetrics.listPricingMetrics({
942
926
  </dl>
943
927
  </details>
944
928
 
945
- <details><summary><code>client.pricingMetrics.<a href="/src/api/resources/pricingMetrics/client/Client.ts">createPricingMetric</a>({ ...params }) -> Lark.CreatePricingMetricResponse</code></summary>
929
+ <details><summary><code>client.pricingMetrics.<a href="/src/api/resources/pricingMetrics/client/Client.ts">createPricingMetric</a>({ ...params }) -> Lark.PricingMetricResource</code></summary>
946
930
  <dl>
947
931
  <dd>
948
932
 
@@ -956,12 +940,13 @@ await client.pricingMetrics.listPricingMetrics({
956
940
 
957
941
  ```typescript
958
942
  await client.pricingMetrics.createPricingMetric({
959
- name: "name",
960
- event_name: "event_name",
943
+ name: "Compute Hours",
944
+ event_name: "job_completed",
961
945
  aggregation: {
962
- aggregation_type: "count",
946
+ aggregation_type: "sum",
947
+ value_field: "value_field",
963
948
  },
964
- unit: "unit",
949
+ unit: "hours",
965
950
  });
966
951
  ```
967
952
 
@@ -997,7 +982,7 @@ await client.pricingMetrics.createPricingMetric({
997
982
  </dl>
998
983
  </details>
999
984
 
1000
- <details><summary><code>client.pricingMetrics.<a href="/src/api/resources/pricingMetrics/client/Client.ts">getPricingMetric</a>(pricingMetricId) -> Lark.GetPricingMetricResponse</code></summary>
985
+ <details><summary><code>client.pricingMetrics.<a href="/src/api/resources/pricingMetrics/client/Client.ts">getPricingMetric</a>(pricingMetricId) -> Lark.PricingMetricResource</code></summary>
1001
986
  <dl>
1002
987
  <dd>
1003
988
 
@@ -1045,6 +1030,68 @@ await client.pricingMetrics.getPricingMetric("pricing_metric_id");
1045
1030
  </dl>
1046
1031
  </details>
1047
1032
 
1033
+ <details><summary><code>client.pricingMetrics.<a href="/src/api/resources/pricingMetrics/client/Client.ts">createPricingMetricSummary</a>(pricingMetricId, { ...params }) -> Lark.PricingMetricSummaryResource</code></summary>
1034
+ <dl>
1035
+ <dd>
1036
+
1037
+ #### 🔌 Usage
1038
+
1039
+ <dl>
1040
+ <dd>
1041
+
1042
+ <dl>
1043
+ <dd>
1044
+
1045
+ ```typescript
1046
+ await client.pricingMetrics.createPricingMetricSummary("pricing_metric_id", {
1047
+ subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE",
1048
+ period: {
1049
+ start: "2025-10-01T00:00:00Z",
1050
+ end: "2025-11-01T00:00:00Z",
1051
+ },
1052
+ });
1053
+ ```
1054
+
1055
+ </dd>
1056
+ </dl>
1057
+ </dd>
1058
+ </dl>
1059
+
1060
+ #### ⚙️ Parameters
1061
+
1062
+ <dl>
1063
+ <dd>
1064
+
1065
+ <dl>
1066
+ <dd>
1067
+
1068
+ **pricingMetricId:** `string`
1069
+
1070
+ </dd>
1071
+ </dl>
1072
+
1073
+ <dl>
1074
+ <dd>
1075
+
1076
+ **request:** `Lark.CreatePricingMetricSummaryRequest`
1077
+
1078
+ </dd>
1079
+ </dl>
1080
+
1081
+ <dl>
1082
+ <dd>
1083
+
1084
+ **requestOptions:** `PricingMetrics.RequestOptions`
1085
+
1086
+ </dd>
1087
+ </dl>
1088
+ </dd>
1089
+ </dl>
1090
+
1091
+ </dd>
1092
+ </dl>
1093
+ </details>
1094
+
1048
1095
  ## CustomerAccess
1049
1096
 
1050
1097
  <details><summary><code>client.customerAccess.<a href="/src/api/resources/customerAccess/client/Client.ts">getBillingState</a>(subjectId) -> Lark.BillingStateResponse</code></summary>