lark-billing 0.7.0 → 0.8.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 (80) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +5 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -0
  10. package/client.mjs.map +1 -1
  11. package/internal/tslib.js +17 -17
  12. package/package.json +1 -1
  13. package/resources/index.d.mts +2 -1
  14. package/resources/index.d.mts.map +1 -1
  15. package/resources/index.d.ts +2 -1
  16. package/resources/index.d.ts.map +1 -1
  17. package/resources/index.js +3 -1
  18. package/resources/index.js.map +1 -1
  19. package/resources/index.mjs +1 -0
  20. package/resources/index.mjs.map +1 -1
  21. package/resources/rate-catalogs.d.mts +19 -74
  22. package/resources/rate-catalogs.d.mts.map +1 -1
  23. package/resources/rate-catalogs.d.ts +19 -74
  24. package/resources/rate-catalogs.d.ts.map +1 -1
  25. package/resources/rate-catalogs.js.map +1 -1
  26. package/resources/rate-catalogs.mjs.map +1 -1
  27. package/resources/subscription-timelines/index.d.mts +3 -0
  28. package/resources/subscription-timelines/index.d.mts.map +1 -0
  29. package/resources/subscription-timelines/index.d.ts +3 -0
  30. package/resources/subscription-timelines/index.d.ts.map +1 -0
  31. package/resources/subscription-timelines/index.js +9 -0
  32. package/resources/subscription-timelines/index.js.map +1 -0
  33. package/resources/subscription-timelines/index.mjs +4 -0
  34. package/resources/subscription-timelines/index.mjs.map +1 -0
  35. package/resources/subscription-timelines/items.d.mts +130 -0
  36. package/resources/subscription-timelines/items.d.mts.map +1 -0
  37. package/resources/subscription-timelines/items.d.ts +130 -0
  38. package/resources/subscription-timelines/items.d.ts.map +1 -0
  39. package/resources/subscription-timelines/items.js +28 -0
  40. package/resources/subscription-timelines/items.js.map +1 -0
  41. package/resources/subscription-timelines/items.mjs +24 -0
  42. package/resources/subscription-timelines/items.mjs.map +1 -0
  43. package/resources/subscription-timelines/subscription-timelines.d.mts +145 -0
  44. package/resources/subscription-timelines/subscription-timelines.d.mts.map +1 -0
  45. package/resources/subscription-timelines/subscription-timelines.d.ts +145 -0
  46. package/resources/subscription-timelines/subscription-timelines.d.ts.map +1 -0
  47. package/resources/subscription-timelines/subscription-timelines.js +45 -0
  48. package/resources/subscription-timelines/subscription-timelines.js.map +1 -0
  49. package/resources/subscription-timelines/subscription-timelines.mjs +40 -0
  50. package/resources/subscription-timelines/subscription-timelines.mjs.map +1 -0
  51. package/resources/subscription-timelines.d.mts +2 -0
  52. package/resources/subscription-timelines.d.mts.map +1 -0
  53. package/resources/subscription-timelines.d.ts +2 -0
  54. package/resources/subscription-timelines.d.ts.map +1 -0
  55. package/resources/subscription-timelines.js +6 -0
  56. package/resources/subscription-timelines.js.map +1 -0
  57. package/resources/subscription-timelines.mjs +3 -0
  58. package/resources/subscription-timelines.mjs.map +1 -0
  59. package/resources/subscriptions.d.mts +4 -0
  60. package/resources/subscriptions.d.mts.map +1 -1
  61. package/resources/subscriptions.d.ts +4 -0
  62. package/resources/subscriptions.d.ts.map +1 -1
  63. package/resources/usage-events.d.mts +2 -2
  64. package/resources/usage-events.d.ts +2 -2
  65. package/resources/usage-events.js +2 -2
  66. package/resources/usage-events.mjs +2 -2
  67. package/src/client.ts +29 -0
  68. package/src/resources/index.ts +13 -0
  69. package/src/resources/rate-catalogs.ts +29 -105
  70. package/src/resources/subscription-timelines/index.ts +19 -0
  71. package/src/resources/subscription-timelines/items.ts +187 -0
  72. package/src/resources/subscription-timelines/subscription-timelines.ts +240 -0
  73. package/src/resources/subscription-timelines.ts +3 -0
  74. package/src/resources/subscriptions.ts +5 -0
  75. package/src/resources/usage-events.ts +2 -2
  76. package/src/version.ts +1 -1
  77. package/version.d.mts +1 -1
  78. package/version.d.ts +1 -1
  79. package/version.js +1 -1
  80. package/version.mjs +1 -1
@@ -0,0 +1,240 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as SubscriptionsAPI from '../subscriptions';
5
+ import * as ItemsAPI from './items';
6
+ import { ItemCreateParams, ItemCreateResponse, ItemListParams, ItemListResponse, Items } from './items';
7
+ import { APIPromise } from '../../core/api-promise';
8
+ import { RequestOptions } from '../../internal/request-options';
9
+ import { path } from '../../internal/utils/path';
10
+
11
+ export class SubscriptionTimelines extends APIResource {
12
+ items: ItemsAPI.Items = new ItemsAPI.Items(this._client);
13
+
14
+ /**
15
+ * Create Subscription Timeline
16
+ */
17
+ create(
18
+ body: SubscriptionTimelineCreateParams,
19
+ options?: RequestOptions,
20
+ ): APIPromise<SubscriptionTimelineCreateResponse> {
21
+ return this._client.post('/subscription-timelines', { body, ...options });
22
+ }
23
+
24
+ /**
25
+ * Get Subscription Timeline
26
+ */
27
+ retrieve(
28
+ subscriptionTimelineID: string,
29
+ options?: RequestOptions,
30
+ ): APIPromise<SubscriptionTimelineRetrieveResponse> {
31
+ return this._client.get(path`/subscription-timelines/${subscriptionTimelineID}`, options);
32
+ }
33
+
34
+ /**
35
+ * List Subscription Timelines
36
+ */
37
+ list(
38
+ query: SubscriptionTimelineListParams | null | undefined = {},
39
+ options?: RequestOptions,
40
+ ): APIPromise<SubscriptionTimelineListResponse> {
41
+ return this._client.get('/subscription-timelines', { query, ...options });
42
+ }
43
+
44
+ /**
45
+ * Start Subscription Timeline
46
+ */
47
+ start(
48
+ subscriptionTimelineID: string,
49
+ body: SubscriptionTimelineStartParams,
50
+ options?: RequestOptions,
51
+ ): APIPromise<SubscriptionTimelineStartResponse> {
52
+ return this._client.post(path`/subscription-timelines/${subscriptionTimelineID}/start`, {
53
+ body,
54
+ ...options,
55
+ });
56
+ }
57
+ }
58
+
59
+ export interface SubscriptionTimelineCreateResponse {
60
+ id: string;
61
+
62
+ created_at: string;
63
+
64
+ rate_card_id: string;
65
+
66
+ status: 'draft' | 'pending' | 'active' | 'completed';
67
+
68
+ subject_id: string;
69
+
70
+ subscription_id: string | null;
71
+
72
+ updated_at: string;
73
+ }
74
+
75
+ export interface SubscriptionTimelineRetrieveResponse {
76
+ id: string;
77
+
78
+ created_at: string;
79
+
80
+ rate_card_id: string;
81
+
82
+ status: 'draft' | 'pending' | 'active' | 'completed';
83
+
84
+ subject_id: string;
85
+
86
+ subscription_id: string | null;
87
+
88
+ updated_at: string;
89
+ }
90
+
91
+ export interface SubscriptionTimelineListResponse {
92
+ has_more: boolean;
93
+
94
+ subscription_timelines: Array<SubscriptionTimelineListResponse.SubscriptionTimeline>;
95
+ }
96
+
97
+ export namespace SubscriptionTimelineListResponse {
98
+ export interface SubscriptionTimeline {
99
+ id: string;
100
+
101
+ created_at: string;
102
+
103
+ rate_card_id: string;
104
+
105
+ status: 'draft' | 'pending' | 'active' | 'completed';
106
+
107
+ subject_id: string;
108
+
109
+ subscription_id: string | null;
110
+
111
+ updated_at: string;
112
+ }
113
+ }
114
+
115
+ export interface SubscriptionTimelineStartResponse {
116
+ /**
117
+ * The result of the request. If the request is successful, the subscription
118
+ * timeline resource will be returned. If the request is requires action, the
119
+ * action to take to complete the request will be returned.
120
+ */
121
+ result:
122
+ | SubscriptionTimelineStartResponse.StartSubscriptionTimelineRequiresActionResponse
123
+ | SubscriptionTimelineStartResponse.StartSubscriptionTimelineSuccessResponse;
124
+ }
125
+
126
+ export namespace SubscriptionTimelineStartResponse {
127
+ export interface StartSubscriptionTimelineRequiresActionResponse {
128
+ /**
129
+ * The action to take to complete the request.
130
+ */
131
+ action: StartSubscriptionTimelineRequiresActionResponse.Action;
132
+
133
+ result_type: 'requires_action';
134
+ }
135
+
136
+ export namespace StartSubscriptionTimelineRequiresActionResponse {
137
+ /**
138
+ * The action to take to complete the request.
139
+ */
140
+ export interface Action {
141
+ /**
142
+ * The URL of the checkout page to redirect to in order to complete the request.
143
+ */
144
+ checkout_url: string;
145
+
146
+ requires_action_type: 'checkout';
147
+ }
148
+ }
149
+
150
+ export interface StartSubscriptionTimelineSuccessResponse {
151
+ result_type: 'success';
152
+
153
+ /**
154
+ * The subscription timeline resource.
155
+ */
156
+ subscription_timeline: StartSubscriptionTimelineSuccessResponse.SubscriptionTimeline;
157
+ }
158
+
159
+ export namespace StartSubscriptionTimelineSuccessResponse {
160
+ /**
161
+ * The subscription timeline resource.
162
+ */
163
+ export interface SubscriptionTimeline {
164
+ id: string;
165
+
166
+ created_at: string;
167
+
168
+ rate_card_id: string;
169
+
170
+ status: 'draft' | 'pending' | 'active' | 'completed';
171
+
172
+ subject_id: string;
173
+
174
+ subscription_id: string | null;
175
+
176
+ updated_at: string;
177
+ }
178
+ }
179
+ }
180
+
181
+ export interface SubscriptionTimelineCreateParams {
182
+ /**
183
+ * The ID of the rate card to create the subscription timeline for.
184
+ */
185
+ rate_card_id: string;
186
+
187
+ /**
188
+ * The ID of the subject to create the subscription timeline for.
189
+ */
190
+ subject_id: string;
191
+ }
192
+
193
+ export interface SubscriptionTimelineListParams {
194
+ limit?: number;
195
+
196
+ offset?: number;
197
+ }
198
+
199
+ export interface SubscriptionTimelineStartParams {
200
+ /**
201
+ * The URLs to redirect to after the checkout is completed or cancelled, if a
202
+ * checkout is required.
203
+ */
204
+ checkout_callback_urls: SubscriptionsAPI.CheckoutCallback;
205
+
206
+ /**
207
+ * Determines whether a checkout session is always required even if the subject has
208
+ * a payment method on file. By default, if the subject has a payment method on
209
+ * file, the subscription will be created and billed for immediately.
210
+ */
211
+ create_checkout_session: 'when_required' | 'always';
212
+
213
+ /**
214
+ * When the subscription should become active. If not provided, the current date
215
+ * and time will be used.
216
+ */
217
+ effective_at?: string;
218
+ }
219
+
220
+ SubscriptionTimelines.Items = Items;
221
+
222
+ export declare namespace SubscriptionTimelines {
223
+ export {
224
+ type SubscriptionTimelineCreateResponse as SubscriptionTimelineCreateResponse,
225
+ type SubscriptionTimelineRetrieveResponse as SubscriptionTimelineRetrieveResponse,
226
+ type SubscriptionTimelineListResponse as SubscriptionTimelineListResponse,
227
+ type SubscriptionTimelineStartResponse as SubscriptionTimelineStartResponse,
228
+ type SubscriptionTimelineCreateParams as SubscriptionTimelineCreateParams,
229
+ type SubscriptionTimelineListParams as SubscriptionTimelineListParams,
230
+ type SubscriptionTimelineStartParams as SubscriptionTimelineStartParams,
231
+ };
232
+
233
+ export {
234
+ Items as Items,
235
+ type ItemCreateResponse as ItemCreateResponse,
236
+ type ItemListResponse as ItemListResponse,
237
+ type ItemCreateParams as ItemCreateParams,
238
+ type ItemListParams as ItemListParams,
239
+ };
240
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './subscription-timelines/index';
@@ -328,6 +328,11 @@ export interface SubscriptionCreateParams {
328
328
  * per seat.
329
329
  */
330
330
  rate_price_multipliers?: { [key: string]: number | string };
331
+
332
+ /**
333
+ * The ID of the subscription timeline to use for the subscription.
334
+ */
335
+ subscription_timeline_id?: string | null;
331
336
  }
332
337
 
333
338
  export interface SubscriptionListParams {
@@ -17,9 +17,9 @@ export class UsageEvents extends APIResource {
17
17
  * region: 'us-east-1',
18
18
  * },
19
19
  * event_name: 'job_completed',
20
- * idempotency_key: '5ee29f5a-ff4d-4265-8029-bf29e465f5dc',
20
+ * idempotency_key: 'baf940b3-330f-4fc5-8f58-91a8e6c35acd',
21
21
  * subject_id: 'subj_VyX6Q96h5avMho8O7QWlKeXE',
22
- * timestamp: '2026-01-13T22:50:12.390246+00:00',
22
+ * timestamp: '2026-01-16T22:48:04.214059+00:00',
23
23
  * });
24
24
  * ```
25
25
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.7.0'; // x-release-please-version
1
+ export const VERSION = '0.8.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.7.0";
1
+ export declare const VERSION = "0.8.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.7.0";
1
+ export declare const VERSION = "0.8.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.7.0'; // x-release-please-version
4
+ exports.VERSION = '0.8.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.7.0'; // x-release-please-version
1
+ export const VERSION = '0.8.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map