@openmeter/client 1.0.0-beta.230 → 1.0.0-beta.232

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 (137) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +365 -76
  3. package/dist/core.d.ts +0 -1
  4. package/dist/core.js +11 -1
  5. package/dist/funcs/addons.d.ts +49 -1
  6. package/dist/funcs/addons.js +109 -12
  7. package/dist/funcs/apps.d.ts +55 -2
  8. package/dist/funcs/apps.js +179 -4
  9. package/dist/funcs/billing.d.ts +46 -1
  10. package/dist/funcs/billing.js +81 -8
  11. package/dist/funcs/currencies.d.ts +39 -2
  12. package/dist/funcs/currencies.js +93 -6
  13. package/dist/funcs/customers.d.ts +165 -2
  14. package/dist/funcs/customers.js +402 -40
  15. package/dist/funcs/defaults.d.ts +10 -1
  16. package/dist/funcs/defaults.js +11 -1
  17. package/dist/funcs/entitlements.d.ts +5 -1
  18. package/dist/funcs/entitlements.js +18 -4
  19. package/dist/funcs/events.d.ts +14 -1
  20. package/dist/funcs/events.js +18 -1
  21. package/dist/funcs/features.d.ts +42 -1
  22. package/dist/funcs/features.js +91 -10
  23. package/dist/funcs/governance.d.ts +14 -1
  24. package/dist/funcs/governance.js +15 -1
  25. package/dist/funcs/index.d.ts +0 -1
  26. package/dist/funcs/index.js +1 -1
  27. package/dist/funcs/invoices.d.ts +102 -2
  28. package/dist/funcs/invoices.js +247 -8
  29. package/dist/funcs/llmCost.d.ts +36 -1
  30. package/dist/funcs/llmCost.js +63 -6
  31. package/dist/funcs/meters.d.ts +53 -1
  32. package/dist/funcs/meters.js +113 -12
  33. package/dist/funcs/planAddons.d.ts +35 -1
  34. package/dist/funcs/planAddons.js +101 -18
  35. package/dist/funcs/plans.d.ts +49 -1
  36. package/dist/funcs/plans.js +109 -12
  37. package/dist/funcs/subscriptions.d.ts +59 -1
  38. package/dist/funcs/subscriptions.js +147 -18
  39. package/dist/funcs/tax.d.ts +25 -1
  40. package/dist/funcs/tax.js +60 -8
  41. package/dist/index.d.ts +4 -7
  42. package/dist/index.js +4 -6
  43. package/dist/lib/config.d.ts +2 -3
  44. package/dist/lib/config.js +1 -1
  45. package/dist/lib/encodings.d.ts +0 -1
  46. package/dist/lib/encodings.js +1 -1
  47. package/dist/lib/paginate.d.ts +56 -0
  48. package/dist/lib/paginate.js +60 -0
  49. package/dist/lib/request.d.ts +0 -1
  50. package/dist/lib/request.js +1 -1
  51. package/dist/lib/to-error.d.ts +0 -1
  52. package/dist/lib/to-error.js +1 -1
  53. package/dist/lib/types.d.ts +0 -1
  54. package/dist/lib/types.js +1 -1
  55. package/dist/lib/version.d.ts +1 -0
  56. package/dist/lib/version.js +5 -0
  57. package/dist/lib/wire.d.ts +4 -1
  58. package/dist/lib/wire.js +118 -7
  59. package/dist/models/errors.d.ts +13 -2
  60. package/dist/models/errors.js +31 -4
  61. package/dist/models/operations/addons.d.ts +0 -1
  62. package/dist/models/operations/addons.js +1 -1
  63. package/dist/models/operations/apps.d.ts +26 -5
  64. package/dist/models/operations/apps.js +1 -1
  65. package/dist/models/operations/billing.d.ts +0 -1
  66. package/dist/models/operations/billing.js +1 -1
  67. package/dist/models/operations/currencies.d.ts +10 -1
  68. package/dist/models/operations/currencies.js +1 -1
  69. package/dist/models/operations/customers.d.ts +11 -7
  70. package/dist/models/operations/customers.js +1 -1
  71. package/dist/models/operations/defaults.d.ts +0 -1
  72. package/dist/models/operations/defaults.js +1 -1
  73. package/dist/models/operations/entitlements.d.ts +0 -1
  74. package/dist/models/operations/entitlements.js +1 -1
  75. package/dist/models/operations/events.d.ts +0 -1
  76. package/dist/models/operations/events.js +1 -1
  77. package/dist/models/operations/features.d.ts +0 -1
  78. package/dist/models/operations/features.js +1 -1
  79. package/dist/models/operations/governance.d.ts +0 -1
  80. package/dist/models/operations/governance.js +1 -1
  81. package/dist/models/operations/invoices.d.ts +20 -7
  82. package/dist/models/operations/invoices.js +1 -1
  83. package/dist/models/operations/llmCost.d.ts +0 -1
  84. package/dist/models/operations/llmCost.js +1 -1
  85. package/dist/models/operations/meters.d.ts +0 -1
  86. package/dist/models/operations/meters.js +1 -1
  87. package/dist/models/operations/planAddons.d.ts +0 -1
  88. package/dist/models/operations/planAddons.js +1 -1
  89. package/dist/models/operations/plans.d.ts +0 -1
  90. package/dist/models/operations/plans.js +1 -1
  91. package/dist/models/operations/subscriptions.d.ts +0 -1
  92. package/dist/models/operations/subscriptions.js +1 -1
  93. package/dist/models/operations/tax.d.ts +0 -1
  94. package/dist/models/operations/tax.js +1 -1
  95. package/dist/models/schemas.d.ts +11651 -6090
  96. package/dist/models/schemas.js +991 -468
  97. package/dist/models/types.d.ts +941 -810
  98. package/dist/models/types.js +1 -1
  99. package/dist/sdk/addons.d.ts +60 -1
  100. package/dist/sdk/addons.js +63 -1
  101. package/dist/sdk/apps.d.ts +68 -2
  102. package/dist/sdk/apps.js +81 -2
  103. package/dist/sdk/billing.d.ts +57 -1
  104. package/dist/sdk/billing.js +60 -1
  105. package/dist/sdk/customers.d.ts +211 -2
  106. package/dist/sdk/customers.js +222 -2
  107. package/dist/sdk/defaults.d.ts +10 -1
  108. package/dist/sdk/defaults.js +11 -1
  109. package/dist/sdk/entitlements.d.ts +5 -1
  110. package/dist/sdk/entitlements.js +6 -1
  111. package/dist/sdk/events.d.ts +25 -1
  112. package/dist/sdk/events.js +28 -1
  113. package/dist/sdk/features.d.ts +53 -1
  114. package/dist/sdk/features.js +56 -1
  115. package/dist/sdk/internal.d.ts +328 -0
  116. package/dist/sdk/internal.js +404 -0
  117. package/dist/sdk/invoices.d.ts +5 -2
  118. package/dist/sdk/invoices.js +13 -2
  119. package/dist/sdk/llmCost.d.ts +57 -1
  120. package/dist/sdk/llmCost.js +62 -1
  121. package/dist/sdk/meters.d.ts +64 -1
  122. package/dist/sdk/meters.js +67 -1
  123. package/dist/sdk/planAddons.d.ts +46 -1
  124. package/dist/sdk/planAddons.js +49 -1
  125. package/dist/sdk/plans.d.ts +60 -1
  126. package/dist/sdk/plans.js +63 -1
  127. package/dist/sdk/sdk.d.ts +9 -13
  128. package/dist/sdk/sdk.js +11 -20
  129. package/dist/sdk/subscriptions.d.ts +72 -3
  130. package/dist/sdk/subscriptions.js +77 -5
  131. package/dist/sdk/tax.d.ts +34 -1
  132. package/dist/sdk/tax.js +37 -1
  133. package/package.json +30 -6
  134. package/dist/sdk/currencies.d.ts +0 -12
  135. package/dist/sdk/currencies.js +0 -21
  136. package/dist/sdk/governance.d.ts +0 -9
  137. package/dist/sdk/governance.js +0 -12
@@ -1,13 +1,71 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
3
  import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
4
+ /**
5
+ * Create subscription
6
+ *
7
+ * POST /openmeter/subscriptions
8
+ */
4
9
  export declare function createSubscription(client: Client, req: CreateSubscriptionRequest, options?: RequestOptions): Promise<Result<CreateSubscriptionResponse>>;
10
+ /**
11
+ * List subscriptions
12
+ *
13
+ * GET /openmeter/subscriptions
14
+ */
5
15
  export declare function listSubscriptions(client: Client, req?: ListSubscriptionsRequest, options?: RequestOptions): Promise<Result<ListSubscriptionsResponse>>;
16
+ /**
17
+ * Get subscription
18
+ *
19
+ * GET /openmeter/subscriptions/{subscriptionId}
20
+ */
6
21
  export declare function getSubscription(client: Client, req: GetSubscriptionRequest, options?: RequestOptions): Promise<Result<GetSubscriptionResponse>>;
22
+ /**
23
+ * Cancel subscription
24
+ *
25
+ * Cancels the subscription. Will result in a scheduling conflict if there are
26
+ * other subscriptions scheduled to start after the cancelation time.
27
+ *
28
+ * POST /openmeter/subscriptions/{subscriptionId}/cancel
29
+ */
7
30
  export declare function cancelSubscription(client: Client, req: CancelSubscriptionRequest, options?: RequestOptions): Promise<Result<CancelSubscriptionResponse>>;
31
+ /**
32
+ * Unschedule subscription cancelation
33
+ *
34
+ * Unschedules the subscription cancelation.
35
+ *
36
+ * POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation
37
+ */
8
38
  export declare function unscheduleCancelation(client: Client, req: UnscheduleCancelationRequest, options?: RequestOptions): Promise<Result<UnscheduleCancelationResponse>>;
39
+ /**
40
+ * Change subscription
41
+ *
42
+ * Closes a running subscription and starts a new one according to the
43
+ * specification. Can be used for upgrades, downgrades, and plan changes.
44
+ *
45
+ * POST /openmeter/subscriptions/{subscriptionId}/change
46
+ */
9
47
  export declare function changeSubscription(client: Client, req: ChangeSubscriptionRequest, options?: RequestOptions): Promise<Result<ChangeSubscriptionResponse>>;
48
+ /**
49
+ * Create a new subscription add-on
50
+ *
51
+ * Add add-on to a subscription.
52
+ *
53
+ * POST /openmeter/subscriptions/{subscriptionId}/addons
54
+ */
10
55
  export declare function createSubscriptionAddon(client: Client, req: CreateSubscriptionAddonRequest, options?: RequestOptions): Promise<Result<CreateSubscriptionAddonResponse>>;
56
+ /**
57
+ * List subscription addons
58
+ *
59
+ * List the add-ons of a subscription.
60
+ *
61
+ * GET /openmeter/subscriptions/{subscriptionId}/addons
62
+ */
11
63
  export declare function listSubscriptionAddons(client: Client, req: ListSubscriptionAddonsRequest, options?: RequestOptions): Promise<Result<ListSubscriptionAddonsResponse>>;
64
+ /**
65
+ * Get add-on association for subscription
66
+ *
67
+ * Get an add-on association for a subscription.
68
+ *
69
+ * GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}
70
+ */
12
71
  export declare function getSubscriptionAddon(client: Client, req: GetSubscriptionAddonRequest, options?: RequestOptions): Promise<Result<GetSubscriptionAddonResponse>>;
13
- //# sourceMappingURL=subscriptions.d.ts.map
@@ -1,8 +1,14 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { http } from '../core.js';
2
3
  import { request } from '../lib/request.js';
3
4
  import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
4
- import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
5
+ import { toWire, toPathWire, fromWire, assertValid, toSnakeCase, } from '../lib/wire.js';
5
6
  import * as schemas from '../models/schemas.js';
7
+ /**
8
+ * Create subscription
9
+ *
10
+ * POST /openmeter/subscriptions
11
+ */
6
12
  export function createSubscription(client, req, options) {
7
13
  return request(() => {
8
14
  const body = toWire(req, schemas.createSubscriptionBody);
@@ -20,8 +26,16 @@ export function createSubscription(client, req, options) {
20
26
  });
21
27
  });
22
28
  }
29
+ /**
30
+ * List subscriptions
31
+ *
32
+ * GET /openmeter/subscriptions
33
+ */
23
34
  export function listSubscriptions(client, req = {}, options) {
24
35
  return request(() => {
36
+ if (client._options.validate && req.sort !== undefined) {
37
+ assertValid(schemas.listSubscriptionsQueryParams.shape.sort, req.sort);
38
+ }
25
39
  const query = toWire({
26
40
  page: req.page,
27
41
  sort: encodeSort(req.sort, toSnakeCase),
@@ -42,13 +56,27 @@ export function listSubscriptions(client, req = {}, options) {
42
56
  });
43
57
  });
44
58
  }
59
+ /**
60
+ * Get subscription
61
+ *
62
+ * GET /openmeter/subscriptions/{subscriptionId}
63
+ */
45
64
  export function getSubscription(client, req, options) {
46
65
  return request(() => {
66
+ const pathParamsInput = {
67
+ subscriptionId: req.subscriptionId,
68
+ };
69
+ const pathParams = client._options.validate
70
+ ? toPathWire(pathParamsInput, schemas.getSubscriptionPathParams)
71
+ : pathParamsInput;
72
+ if (client._options.validate) {
73
+ assertValid(schemas.getSubscriptionPathParamsWire, pathParams);
74
+ }
47
75
  const path = `openmeter/subscriptions/${(() => {
48
- if (req.subscriptionId === undefined) {
76
+ if (pathParams.subscriptionId === undefined) {
49
77
  throw new Error('missing path parameter: subscriptionId');
50
78
  }
51
- return encodeURIComponent(String(req.subscriptionId));
79
+ return encodeURIComponent(String(pathParams.subscriptionId));
52
80
  })()}`;
53
81
  return http(client)
54
82
  .get(path, options)
@@ -61,13 +89,30 @@ export function getSubscription(client, req, options) {
61
89
  });
62
90
  });
63
91
  }
92
+ /**
93
+ * Cancel subscription
94
+ *
95
+ * Cancels the subscription. Will result in a scheduling conflict if there are
96
+ * other subscriptions scheduled to start after the cancelation time.
97
+ *
98
+ * POST /openmeter/subscriptions/{subscriptionId}/cancel
99
+ */
64
100
  export function cancelSubscription(client, req, options) {
65
101
  return request(() => {
102
+ const pathParamsInput = {
103
+ subscriptionId: req.subscriptionId,
104
+ };
105
+ const pathParams = client._options.validate
106
+ ? toPathWire(pathParamsInput, schemas.cancelSubscriptionPathParams)
107
+ : pathParamsInput;
108
+ if (client._options.validate) {
109
+ assertValid(schemas.cancelSubscriptionPathParamsWire, pathParams);
110
+ }
66
111
  const path = `openmeter/subscriptions/${(() => {
67
- if (req.subscriptionId === undefined) {
112
+ if (pathParams.subscriptionId === undefined) {
68
113
  throw new Error('missing path parameter: subscriptionId');
69
114
  }
70
- return encodeURIComponent(String(req.subscriptionId));
115
+ return encodeURIComponent(String(pathParams.subscriptionId));
71
116
  })()}/cancel`;
72
117
  const body = toWire(req.body, schemas.cancelSubscriptionBody);
73
118
  if (client._options.validate) {
@@ -84,13 +129,29 @@ export function cancelSubscription(client, req, options) {
84
129
  });
85
130
  });
86
131
  }
132
+ /**
133
+ * Unschedule subscription cancelation
134
+ *
135
+ * Unschedules the subscription cancelation.
136
+ *
137
+ * POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation
138
+ */
87
139
  export function unscheduleCancelation(client, req, options) {
88
140
  return request(() => {
141
+ const pathParamsInput = {
142
+ subscriptionId: req.subscriptionId,
143
+ };
144
+ const pathParams = client._options.validate
145
+ ? toPathWire(pathParamsInput, schemas.unscheduleCancelationPathParams)
146
+ : pathParamsInput;
147
+ if (client._options.validate) {
148
+ assertValid(schemas.unscheduleCancelationPathParamsWire, pathParams);
149
+ }
89
150
  const path = `openmeter/subscriptions/${(() => {
90
- if (req.subscriptionId === undefined) {
151
+ if (pathParams.subscriptionId === undefined) {
91
152
  throw new Error('missing path parameter: subscriptionId');
92
153
  }
93
- return encodeURIComponent(String(req.subscriptionId));
154
+ return encodeURIComponent(String(pathParams.subscriptionId));
94
155
  })()}/unschedule-cancelation`;
95
156
  return http(client)
96
157
  .post(path, options)
@@ -103,13 +164,30 @@ export function unscheduleCancelation(client, req, options) {
103
164
  });
104
165
  });
105
166
  }
167
+ /**
168
+ * Change subscription
169
+ *
170
+ * Closes a running subscription and starts a new one according to the
171
+ * specification. Can be used for upgrades, downgrades, and plan changes.
172
+ *
173
+ * POST /openmeter/subscriptions/{subscriptionId}/change
174
+ */
106
175
  export function changeSubscription(client, req, options) {
107
176
  return request(() => {
177
+ const pathParamsInput = {
178
+ subscriptionId: req.subscriptionId,
179
+ };
180
+ const pathParams = client._options.validate
181
+ ? toPathWire(pathParamsInput, schemas.changeSubscriptionPathParams)
182
+ : pathParamsInput;
183
+ if (client._options.validate) {
184
+ assertValid(schemas.changeSubscriptionPathParamsWire, pathParams);
185
+ }
108
186
  const path = `openmeter/subscriptions/${(() => {
109
- if (req.subscriptionId === undefined) {
187
+ if (pathParams.subscriptionId === undefined) {
110
188
  throw new Error('missing path parameter: subscriptionId');
111
189
  }
112
- return encodeURIComponent(String(req.subscriptionId));
190
+ return encodeURIComponent(String(pathParams.subscriptionId));
113
191
  })()}/change`;
114
192
  const body = toWire(req.body, schemas.changeSubscriptionBody);
115
193
  if (client._options.validate) {
@@ -126,13 +204,29 @@ export function changeSubscription(client, req, options) {
126
204
  });
127
205
  });
128
206
  }
207
+ /**
208
+ * Create a new subscription add-on
209
+ *
210
+ * Add add-on to a subscription.
211
+ *
212
+ * POST /openmeter/subscriptions/{subscriptionId}/addons
213
+ */
129
214
  export function createSubscriptionAddon(client, req, options) {
130
215
  return request(() => {
216
+ const pathParamsInput = {
217
+ subscriptionId: req.subscriptionId,
218
+ };
219
+ const pathParams = client._options.validate
220
+ ? toPathWire(pathParamsInput, schemas.createSubscriptionAddonPathParams)
221
+ : pathParamsInput;
222
+ if (client._options.validate) {
223
+ assertValid(schemas.createSubscriptionAddonPathParamsWire, pathParams);
224
+ }
131
225
  const path = `openmeter/subscriptions/${(() => {
132
- if (req.subscriptionId === undefined) {
226
+ if (pathParams.subscriptionId === undefined) {
133
227
  throw new Error('missing path parameter: subscriptionId');
134
228
  }
135
- return encodeURIComponent(String(req.subscriptionId));
229
+ return encodeURIComponent(String(pathParams.subscriptionId));
136
230
  })()}/addons`;
137
231
  const body = toWire(req.body, schemas.createSubscriptionAddonBody);
138
232
  if (client._options.validate) {
@@ -149,14 +243,33 @@ export function createSubscriptionAddon(client, req, options) {
149
243
  });
150
244
  });
151
245
  }
246
+ /**
247
+ * List subscription addons
248
+ *
249
+ * List the add-ons of a subscription.
250
+ *
251
+ * GET /openmeter/subscriptions/{subscriptionId}/addons
252
+ */
152
253
  export function listSubscriptionAddons(client, req, options) {
153
254
  return request(() => {
255
+ const pathParamsInput = {
256
+ subscriptionId: req.subscriptionId,
257
+ };
258
+ const pathParams = client._options.validate
259
+ ? toPathWire(pathParamsInput, schemas.listSubscriptionAddonsPathParams)
260
+ : pathParamsInput;
261
+ if (client._options.validate) {
262
+ assertValid(schemas.listSubscriptionAddonsPathParamsWire, pathParams);
263
+ }
154
264
  const path = `openmeter/subscriptions/${(() => {
155
- if (req.subscriptionId === undefined) {
265
+ if (pathParams.subscriptionId === undefined) {
156
266
  throw new Error('missing path parameter: subscriptionId');
157
267
  }
158
- return encodeURIComponent(String(req.subscriptionId));
268
+ return encodeURIComponent(String(pathParams.subscriptionId));
159
269
  })()}/addons`;
270
+ if (client._options.validate && req.sort !== undefined) {
271
+ assertValid(schemas.listSubscriptionAddonsQueryParams.shape.sort, req.sort);
272
+ }
160
273
  const query = toWire({
161
274
  page: req.page,
162
275
  sort: encodeSort(req.sort, toSnakeCase),
@@ -176,18 +289,35 @@ export function listSubscriptionAddons(client, req, options) {
176
289
  });
177
290
  });
178
291
  }
292
+ /**
293
+ * Get add-on association for subscription
294
+ *
295
+ * Get an add-on association for a subscription.
296
+ *
297
+ * GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}
298
+ */
179
299
  export function getSubscriptionAddon(client, req, options) {
180
300
  return request(() => {
301
+ const pathParamsInput = {
302
+ subscriptionId: req.subscriptionId,
303
+ subscriptionAddonId: req.subscriptionAddonId,
304
+ };
305
+ const pathParams = client._options.validate
306
+ ? toPathWire(pathParamsInput, schemas.getSubscriptionAddonPathParams)
307
+ : pathParamsInput;
308
+ if (client._options.validate) {
309
+ assertValid(schemas.getSubscriptionAddonPathParamsWire, pathParams);
310
+ }
181
311
  const path = `openmeter/subscriptions/${(() => {
182
- if (req.subscriptionId === undefined) {
312
+ if (pathParams.subscriptionId === undefined) {
183
313
  throw new Error('missing path parameter: subscriptionId');
184
314
  }
185
- return encodeURIComponent(String(req.subscriptionId));
315
+ return encodeURIComponent(String(pathParams.subscriptionId));
186
316
  })()}/addons/${(() => {
187
- if (req.subscriptionAddonId === undefined) {
317
+ if (pathParams.subscriptionAddonId === undefined) {
188
318
  throw new Error('missing path parameter: subscriptionAddonId');
189
319
  }
190
- return encodeURIComponent(String(req.subscriptionAddonId));
320
+ return encodeURIComponent(String(pathParams.subscriptionAddonId));
191
321
  })()}`;
192
322
  return http(client)
193
323
  .get(path, options)
@@ -200,4 +330,3 @@ export function getSubscriptionAddon(client, req, options) {
200
330
  });
201
331
  });
202
332
  }
203
- //# sourceMappingURL=subscriptions.js.map
@@ -1,9 +1,33 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
3
  import type { CreateTaxCodeRequest, CreateTaxCodeResponse, GetTaxCodeRequest, GetTaxCodeResponse, ListTaxCodesRequest, ListTaxCodesResponse, UpsertTaxCodeRequest, UpsertTaxCodeResponse, DeleteTaxCodeRequest, DeleteTaxCodeResponse } from '../models/operations/tax.js';
4
+ /**
5
+ * Create tax code
6
+ *
7
+ * POST /openmeter/tax-codes
8
+ */
4
9
  export declare function createTaxCode(client: Client, req: CreateTaxCodeRequest, options?: RequestOptions): Promise<Result<CreateTaxCodeResponse>>;
10
+ /**
11
+ * Get tax code
12
+ *
13
+ * GET /openmeter/tax-codes/{taxCodeId}
14
+ */
5
15
  export declare function getTaxCode(client: Client, req: GetTaxCodeRequest, options?: RequestOptions): Promise<Result<GetTaxCodeResponse>>;
16
+ /**
17
+ * List tax codes
18
+ *
19
+ * GET /openmeter/tax-codes
20
+ */
6
21
  export declare function listTaxCodes(client: Client, req?: ListTaxCodesRequest, options?: RequestOptions): Promise<Result<ListTaxCodesResponse>>;
22
+ /**
23
+ * Upsert tax code
24
+ *
25
+ * PUT /openmeter/tax-codes/{taxCodeId}
26
+ */
7
27
  export declare function upsertTaxCode(client: Client, req: UpsertTaxCodeRequest, options?: RequestOptions): Promise<Result<UpsertTaxCodeResponse>>;
28
+ /**
29
+ * Delete tax code
30
+ *
31
+ * DELETE /openmeter/tax-codes/{taxCodeId}
32
+ */
8
33
  export declare function deleteTaxCode(client: Client, req: DeleteTaxCodeRequest, options?: RequestOptions): Promise<Result<DeleteTaxCodeResponse>>;
9
- //# sourceMappingURL=tax.d.ts.map
package/dist/funcs/tax.js CHANGED
@@ -1,8 +1,14 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { http } from '../core.js';
2
3
  import { request } from '../lib/request.js';
3
4
  import { toURLSearchParams } from '../lib/encodings.js';
4
- import { toWire, fromWire, assertValid } from '../lib/wire.js';
5
+ import { toWire, toPathWire, fromWire, assertValid } from '../lib/wire.js';
5
6
  import * as schemas from '../models/schemas.js';
7
+ /**
8
+ * Create tax code
9
+ *
10
+ * POST /openmeter/tax-codes
11
+ */
6
12
  export function createTaxCode(client, req, options) {
7
13
  return request(() => {
8
14
  const body = toWire(req, schemas.createTaxCodeBody);
@@ -20,13 +26,27 @@ export function createTaxCode(client, req, options) {
20
26
  });
21
27
  });
22
28
  }
29
+ /**
30
+ * Get tax code
31
+ *
32
+ * GET /openmeter/tax-codes/{taxCodeId}
33
+ */
23
34
  export function getTaxCode(client, req, options) {
24
35
  return request(() => {
36
+ const pathParamsInput = {
37
+ taxCodeId: req.taxCodeId,
38
+ };
39
+ const pathParams = client._options.validate
40
+ ? toPathWire(pathParamsInput, schemas.getTaxCodePathParams)
41
+ : pathParamsInput;
42
+ if (client._options.validate) {
43
+ assertValid(schemas.getTaxCodePathParamsWire, pathParams);
44
+ }
25
45
  const path = `openmeter/tax-codes/${(() => {
26
- if (req.taxCodeId === undefined) {
46
+ if (pathParams.taxCodeId === undefined) {
27
47
  throw new Error('missing path parameter: taxCodeId');
28
48
  }
29
- return encodeURIComponent(String(req.taxCodeId));
49
+ return encodeURIComponent(String(pathParams.taxCodeId));
30
50
  })()}`;
31
51
  return http(client)
32
52
  .get(path, options)
@@ -39,6 +59,11 @@ export function getTaxCode(client, req, options) {
39
59
  });
40
60
  });
41
61
  }
62
+ /**
63
+ * List tax codes
64
+ *
65
+ * GET /openmeter/tax-codes
66
+ */
42
67
  export function listTaxCodes(client, req = {}, options) {
43
68
  return request(() => {
44
69
  const query = toWire({
@@ -60,13 +85,27 @@ export function listTaxCodes(client, req = {}, options) {
60
85
  });
61
86
  });
62
87
  }
88
+ /**
89
+ * Upsert tax code
90
+ *
91
+ * PUT /openmeter/tax-codes/{taxCodeId}
92
+ */
63
93
  export function upsertTaxCode(client, req, options) {
64
94
  return request(() => {
95
+ const pathParamsInput = {
96
+ taxCodeId: req.taxCodeId,
97
+ };
98
+ const pathParams = client._options.validate
99
+ ? toPathWire(pathParamsInput, schemas.upsertTaxCodePathParams)
100
+ : pathParamsInput;
101
+ if (client._options.validate) {
102
+ assertValid(schemas.upsertTaxCodePathParamsWire, pathParams);
103
+ }
65
104
  const path = `openmeter/tax-codes/${(() => {
66
- if (req.taxCodeId === undefined) {
105
+ if (pathParams.taxCodeId === undefined) {
67
106
  throw new Error('missing path parameter: taxCodeId');
68
107
  }
69
- return encodeURIComponent(String(req.taxCodeId));
108
+ return encodeURIComponent(String(pathParams.taxCodeId));
70
109
  })()}`;
71
110
  const body = toWire(req.body, schemas.upsertTaxCodeBody);
72
111
  if (client._options.validate) {
@@ -83,15 +122,28 @@ export function upsertTaxCode(client, req, options) {
83
122
  });
84
123
  });
85
124
  }
125
+ /**
126
+ * Delete tax code
127
+ *
128
+ * DELETE /openmeter/tax-codes/{taxCodeId}
129
+ */
86
130
  export function deleteTaxCode(client, req, options) {
87
131
  return request(async () => {
132
+ const pathParamsInput = {
133
+ taxCodeId: req.taxCodeId,
134
+ };
135
+ const pathParams = client._options.validate
136
+ ? toPathWire(pathParamsInput, schemas.deleteTaxCodePathParams)
137
+ : pathParamsInput;
138
+ if (client._options.validate) {
139
+ assertValid(schemas.deleteTaxCodePathParamsWire, pathParams);
140
+ }
88
141
  const path = `openmeter/tax-codes/${(() => {
89
- if (req.taxCodeId === undefined) {
142
+ if (pathParams.taxCodeId === undefined) {
90
143
  throw new Error('missing path parameter: taxCodeId');
91
144
  }
92
- return encodeURIComponent(String(req.taxCodeId));
145
+ return encodeURIComponent(String(pathParams.taxCodeId));
93
146
  })()}`;
94
147
  await http(client).delete(path, options);
95
148
  });
96
149
  }
97
- //# sourceMappingURL=tax.js.map
package/dist/index.d.ts CHANGED
@@ -4,24 +4,22 @@ export { Meters } from './sdk/meters.js';
4
4
  export { Customers } from './sdk/customers.js';
5
5
  export { Entitlements } from './sdk/entitlements.js';
6
6
  export { Subscriptions } from './sdk/subscriptions.js';
7
- export { Apps } from './sdk/apps.js';
8
7
  export { Billing } from './sdk/billing.js';
9
- export { Invoices } from './sdk/invoices.js';
10
8
  export { Tax } from './sdk/tax.js';
11
- export { Currencies } from './sdk/currencies.js';
12
9
  export { Features } from './sdk/features.js';
13
10
  export { LLMCost } from './sdk/llmCost.js';
14
11
  export { Plans } from './sdk/plans.js';
15
12
  export { Addons } from './sdk/addons.js';
16
13
  export { PlanAddons } from './sdk/planAddons.js';
17
14
  export { Defaults } from './sdk/defaults.js';
18
- export { Governance } from './sdk/governance.js';
19
15
  export { Client } from './core.js';
20
16
  export { HTTPError } from './models/errors.js';
21
- export { ValidationError, DepthLimitExceededError } from './lib/wire.js';
17
+ export { ValidationError, DepthLimitExceededError, UnsafeIntegerError, } from './lib/wire.js';
22
18
  export type { AcceptDateStrings, DateString } from './lib/wire.js';
19
+ export { PaginationLimitExceededError } from './lib/paginate.js';
23
20
  export { ServerList, Regions } from './lib/config.js';
24
21
  export type { SDKOptions, Region, ServerVariables } from './lib/config.js';
22
+ export { unwrap, ok, err } from './lib/types.js';
25
23
  export type { Result, RequestOptions } from './lib/types.js';
26
24
  export { encodePath, encodeSort, querySerializer, toURLSearchParams, } from './lib/encodings.js';
27
25
  export * as funcs from './funcs/index.js';
@@ -42,5 +40,4 @@ export type * from './models/operations/addons.js';
42
40
  export type * from './models/operations/planAddons.js';
43
41
  export type * from './models/operations/defaults.js';
44
42
  export type * from './models/operations/governance.js';
45
- export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, TaxConfigStripe, TaxConfigExternalInvoicing, ChargeFlatFeeDiscounts, PriceFree, RateCardStaticEntitlement, RateCardBooleanEntitlement, WorkflowCollectionAlignmentSubscription, WorkflowPaymentChargeAutomaticallySettings, WorkflowPaymentSendInvoiceSettings, InvoiceExternalReferences, InvoiceAvailableActionDetails, InvoiceWorkflowInvoicingSettings, InvoiceLineExternalReferences, UpdateLabels, UpdateBillingInvoiceWorkflowInvoicingSettings, UpdateBillingWorkflowPaymentChargeAutomaticallySettings, UpdateBillingWorkflowPaymentSendInvoiceSettings, UpdatePriceFree, LlmCostProvider, LlmCostModel, ProductCatalogValidationError, GovernanceQueryRequestCustomers, GovernanceQueryRequestFeatures, QueryFilterInteger, QueryFilterFloat, QueryFilterBoolean, PagePaginationQuery, PublicLabels, SystemAccountAccessToken, PersonalAccessToken, KonnectAccessToken, UpdateMeterRequest, AppCustomerDataStripe, AppCustomerDataExternalInvoicing, CurrencyFiat, ListCostBasesParamsFilter, CurrencyAmount, PriceFlat, PriceUnit, RateCardDiscounts, Totals, SpendCommitments, InvoiceLineCreditsApplied, UpdatePriceFlat, UpdatePriceUnit, UpdateDiscounts, FeatureManualUnitCost, FeatureLlmUnitCostPricing, LlmCostModelPricing, QueryFilterNumeric, CursorPaginationQuery, ListMetersParamsFilter, ListLlmCostPricesParamsFilter, LabelsFieldFilter, CustomerReference, ProfileReference, CreateResourceReference, TaxCodeReference, CreditGrantInvoiceReference, BillingCustomerReference, SubscriptionReference, AddonReference, FeatureReference, AppReference, ChargeReference, UpdateResourceReference, Event, MeterQueryRow, AppStripeCreateCustomerPortalSessionResult, ClosedPeriod, SubscriptionAddonTimelineSegment, UpdateClosedPeriod, CostBasis, CreateCostBasisRequest, FeatureCostQueryRow, Resource, ResourceImmutable, QueryFilterDateTime, CursorMeta, InvalidParameterStandard, InvalidParameterMinimumLength, InvalidParameterMaximumLength, InvalidParameterChoiceItem, InvalidParameterDependentItem, Unauthorized, Forbidden, NotFound, Gone, Conflict, PayloadTooLarge, UnsupportedMediaType, UnprocessableContent, TooManyRequests, Internal, NotImplemented, NotAvailable, CreateCreditGrantFilters, CreditGrantFilters, UpsertPlanAddonRequest, ResourceWithKey, CreateMeterRequest, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, EntitlementAccessResult, CreateCreditGrantPurchase, RateCardMeteredEntitlement, RecurringPeriod, CreditGrantPurchase, UpdateCreditGrantExternalSettlementRequest, ListCreditGrantsParamsFilter, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListPlansParamsFilter, SubscriptionCreate, RateCardProrationConfiguration, Subscription, UnitConfig, AppCatalogItem, TaxCodeAppMapping, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, WorkflowInvoicingSettings, InvoiceValidationIssue, InvoiceAvailableActions, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, CurrencyCustom, CreateCurrencyCustomRequest, GovernanceQueryRequest, GovernanceFeatureAccessReason, GovernanceQueryError, AppCustomerData, UpsertAppCustomerDataRequest, CreditAdjustment, CreditBalance, CreateCreditAdjustmentRequest, ListCreditTransactionsParamsFilter, CreditTransaction, PriceTier, ChargeTotals, UpdatePriceTier, FeatureLlmUnitCost, LlmCostPrice, LlmCostOverrideCreate, ListCustomersParamsFilter, ListSubscriptionsParamsFilter, ListFeatureParamsFilter, ListAddonsParamsFilter, CreateCreditGrantTaxConfig, CreditGrantTaxConfig, TaxConfig, RateCardTaxConfig, OrganizationDefaultTaxCodes, UpdateOrganizationDefaultTaxCodesRequest, PlanAddon, CreatePlanAddonRequest, ProfileAppReferences, InvoiceWorkflowAppsReferences, UpdateRateCardTaxConfig, ListEventsParamsFilter, ListInvoicesParamsFilter, ResourceFilters, FieldFilters, IngestedEvent, MeterQueryResult, FeatureCostQueryResult, MeterPagePaginatedResponse, CostBasisPagePaginatedResponse, MeterQueryFilters, FeatureMeterReference, CreateCustomerRequest, Customer, UpsertCustomerRequest, PartyAddresses, InvoiceCustomer, UpdateBillingPartyAddresses, UpdateInvoiceCustomer, AppStripeCreateCheckoutSessionConsentCollection, ListCustomerEntitlementAccessResponseData, WorkflowCollectionAlignmentAnchored, ChargeFlatFeeSystemIntent, SubscriptionPagePaginatedResponse, SubscriptionChangeResponse, SubscriptionCancel, SubscriptionChange, CreateSubscriptionAddonRequest, InvoiceUsageQuantityDetail, AppStripe, AppSandbox, AppExternalInvoicing, CreateTaxCodeRequest, TaxCode, UpsertTaxCodeRequest, InvoiceWorkflow, InvoiceStatusDetails, InvoiceLineDiscounts, UpdateBillingInvoiceWorkflow, GovernanceFeatureAccess, CustomerData, UpsertCustomerBillingDataRequest, CreditBalances, CreditTransactionPaginatedResponse, PriceGraduated, PriceVolume, UpdatePriceGraduated, UpdatePriceVolume, PricePagePaginatedResponse, CreateCreditGrantRequest, CreditGrant, CreateChargeFlatFeeRequest, WorkflowTaxSettings, PlanAddonPagePaginatedResponse, IngestedEventPaginatedResponse, InvalidParameters, MeterQueryRequest, CustomerPagePaginatedResponse, Party, Supplier, UpdateSupplier, AppStripeCreateCheckoutSessionRequestOptions, TaxCodePagePaginatedResponse, InvoiceWorkflowSettings, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, CurrencyPagePaginatedResponse, GovernanceQueryResult, Feature, CreateFeatureRequest, UpdateFeatureRequest, CreditGrantPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, WorkflowCollectionSettings, AppPagePaginatedResponse, ProfileApps, GovernanceQueryResponse, ChargeFlatFee, ChargeUsageBasedSystemIntent, CreateChargeUsageBasedRequest, RateCard, InvoiceLineRateCard, UpdateInvoiceLineRateCard, FeaturePagePaginatedResponse, Workflow, ChargeUsageBased, SubscriptionAddonRateCard, PlanPhase, Addon, CreateAddonRequest, UpsertAddonRequest, InvoiceStandardLine, UpdateInvoiceStandardLine, Profile, CreateBillingProfileRequest, UpsertBillingProfileRequest, SubscriptionAddon, Plan, CreatePlanRequest, UpsertPlanRequest, AddonPagePaginatedResponse, ProfilePagePaginatedResponse, ChargePagePaginatedResponse, SubscriptionAddonPagePaginatedResponse, PlanPagePaginatedResponse, InvoiceStandard, UpdateInvoiceStandardRequest, InvoicePagePaginatedResponse, SortQueryInput, BaseErrorInput, WorkflowPaymentSendInvoiceSettingsInput, InvoiceWorkflowInvoicingSettingsInput, UpdateBillingInvoiceWorkflowInvoicingSettingsInput, UpdateBillingWorkflowPaymentSendInvoiceSettingsInput, EventInput, UnauthorizedInput, ForbiddenInput, NotFoundInput, GoneInput, ConflictInput, PayloadTooLargeInput, UnsupportedMediaTypeInput, UnprocessableContentInput, TooManyRequestsInput, InternalInput, NotImplementedInput, NotAvailableInput, AppStripeCreateCheckoutSessionCustomerUpdateInput, AppStripeCreateCheckoutSessionTaxIdCollectionInput, CreateCreditGrantPurchaseInput, RateCardMeteredEntitlementInput, CreditGrantPurchaseInput, UnitConfigInput, WorkflowInvoicingSettingsInput, GovernanceQueryRequestInput, IngestedEventInput, SubscriptionCancelInput, InvoiceUsageQuantityDetailInput, InvoiceWorkflowInput, UpdateBillingInvoiceWorkflowInput, CreateCreditGrantRequestInput, CreditGrantInput, WorkflowTaxSettingsInput, IngestedEventPaginatedResponseInput, MeterQueryRequestInput, AppStripeCreateCheckoutSessionRequestOptionsInput, InvoiceWorkflowSettingsInput, InvoiceDetailedLineInput, UpdateInvoiceWorkflowSettingsInput, CreditGrantPagePaginatedResponseInput, BadRequestInput, CustomerStripeCreateCheckoutSessionRequestInput, WorkflowCollectionSettingsInput, RateCardInput, WorkflowInput, SubscriptionAddonRateCardInput, PlanPhaseInput, AddonInput, CreateAddonRequestInput, UpsertAddonRequestInput, InvoiceStandardLineInput, ProfileInput, CreateBillingProfileRequestInput, UpsertBillingProfileRequestInput, SubscriptionAddonInput, PlanInput, CreatePlanRequestInput, UpsertPlanRequestInput, AddonPagePaginatedResponseInput, ProfilePagePaginatedResponseInput, SubscriptionAddonPagePaginatedResponseInput, PlanPagePaginatedResponseInput, InvoiceStandardInput, UpdateInvoiceStandardRequestInput, InvoicePagePaginatedResponseInput, } from './models/types.js';
46
- //# sourceMappingURL=index.d.ts.map
43
+ export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, TaxConfigStripe, TaxConfigExternalInvoicing, ChargeFlatFeeDiscounts, PriceFree, RateCardStaticEntitlement, RateCardBooleanEntitlement, UpdateLabels, InstallAppStripeWithApiKey, InstallAppSandbox, InstallAppExternalInvoicing, WorkflowCollectionAlignmentSubscription, WorkflowPaymentChargeAutomaticallySettings, WorkflowPaymentSendInvoiceSettings, InvoiceExternalReferences, InvoiceAvailableActionDetails, InvoiceWorkflowInvoicingSettings, InvoiceLineExternalReferences, UpdateBillingInvoiceWorkflowInvoicingSettings, UpdateBillingWorkflowPaymentChargeAutomaticallySettings, UpdateBillingWorkflowPaymentSendInvoiceSettings, UpdatePriceFree, LlmCostProvider, LlmCostModel, ProductCatalogValidationError, GovernanceQueryRequestCustomers, GovernanceQueryRequestFeatures, QueryFilterInteger, QueryFilterFloat, QueryFilterBoolean, PagePaginationQuery, PublicLabels, SystemAccountAccessToken, PersonalAccessToken, KonnectAccessToken, AppCustomerDataStripe, AppCustomerDataExternalInvoicing, CurrencyFiat, ListCostBasesParamsFilter, CreateCurrencyCustomRequest, CurrencyAmount, PriceFlat, PriceUnit, RateCardDiscounts, Totals, SpendCommitments, InvoiceLineCreditsApplied, UpdatePriceFlat, UpdatePriceUnit, UpdateDiscounts, FeatureManualUnitCost, FeatureLlmUnitCostPricing, LlmCostModelPricing, QueryFilterNumeric, CursorPaginationQuery, ListMetersParamsFilter, ListLlmCostPricesParamsFilter, LabelsFieldFilter, CustomerReference, ProfileReference, CreateResourceReference, TaxCodeReference, CreditGrantInvoiceReference, BillingCustomerReference, SubscriptionReference, AddonReference, FeatureReference, AppReference, ChargeReference, UpdateResourceReference, Event, MeterQueryRow, AppStripeCreateCustomerPortalSessionResult, ClosedPeriod, SubscriptionAddonTimelineSegment, UpdateClosedPeriod, CostBasis, FeatureCostQueryRow, Resource, ResourceImmutable, QueryFilterDateTime, CursorMeta, InvalidParameterStandard, InvalidParameterMinimumLength, InvalidParameterMaximumLength, InvalidParameterChoiceItem, InvalidParameterDependentItem, Unauthorized, Forbidden, NotFound, Gone, Conflict, PayloadTooLarge, UnsupportedMediaType, UnprocessableContent, TooManyRequests, Internal, NotImplemented, NotAvailable, CreateCreditGrantFilters, CreditGrantFilters, UpsertPlanAddonRequest, ResourceWithKey, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, EntitlementAccessResult, CreateCreditGrantPurchase, RateCardMeteredEntitlement, RecurringPeriod, CreditGrantPurchase, ListCreditGrantsParamsFilter, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListPlansParamsFilter, SubscriptionCreate, RateCardProrationConfiguration, Subscription, UnitConfig, TaxCodeAppMapping, AppCapability, UpdateAppStripeRequest, UpdateAppSandboxRequest, UpdateAppExternalInvoicingRequest, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, WorkflowInvoicingSettings, InvoiceValidationIssue, InvoiceAvailableActions, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, GovernanceQueryRequest, GovernanceFeatureAccessReason, GovernanceQueryError, AppCustomerData, UpsertAppCustomerDataRequest, CreditAdjustment, CreditBalance, ListCreditTransactionsParamsFilter, CreditTransaction, PriceTier, ChargeTotals, UpdatePriceTier, FeatureLlmUnitCost, LlmCostPrice, LlmCostOverrideCreate, ListCustomersParamsFilter, ListSubscriptionsParamsFilter, ListFeatureParamsFilter, ListAddonsParamsFilter, CreateCreditGrantTaxConfig, CreditGrantTaxConfig, TaxConfig, RateCardTaxConfig, OrganizationDefaultTaxCodes, PlanAddon, ProfileAppReferences, InvoiceWorkflowAppsReferences, UpdateRateCardTaxConfig, ListEventsParamsFilter, ListInvoicesParamsFilter, ResourceFilters, FieldFilters, IngestedEvent, MeterQueryResult, CurrencyCustom, FeatureCostQueryResult, MeterPagePaginatedResponse, CostBasisPagePaginatedResponse, MeterQueryFilters, FeatureMeterReference, Customer, PartyAddresses, InvoiceCustomer, UpdateBillingPartyAddresses, UpdateInvoiceCustomer, AppStripeCreateCheckoutSessionConsentCollection, ListCustomerEntitlementAccessResponseData, WorkflowCollectionAlignmentAnchored, ChargeFlatFeeSystemIntent, SubscriptionPagePaginatedResponse, SubscriptionChangeResponse, SubscriptionCancel, SubscriptionChange, InvoiceUsageQuantityDetail, TaxCode, AppCatalogItem, InvoiceWorkflow, InvoiceStatusDetails, InvoiceLineDiscounts, UpdateBillingInvoiceWorkflow, GovernanceFeatureAccess, CustomerData, UpsertCustomerBillingDataRequest, CreditBalances, CreditTransactionPaginatedResponse, PriceGraduated, PriceVolume, UpdatePriceGraduated, UpdatePriceVolume, PricePagePaginatedResponse, CreditGrant, CreateChargeFlatFeeRequest, WorkflowTaxSettings, PlanAddonPagePaginatedResponse, IngestedEventPaginatedResponse, InvalidParameters, MeterQueryRequest, CustomerPagePaginatedResponse, Party, Supplier, UpdateSupplier, AppStripeCreateCheckoutSessionRequestOptions, TaxCodePagePaginatedResponse, AppStripe, AppSandbox, AppExternalInvoicing, AppCatalogItemPagePaginatedResponse, InvoiceWorkflowSettings, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, GovernanceQueryResult, Feature, CreditGrantPagePaginatedResponse, CurrencyPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, WorkflowCollectionSettings, GovernanceQueryResponse, ChargeFlatFee, ChargeUsageBasedSystemIntent, CreateChargeUsageBasedRequest, RateCard, InvoiceLineRateCard, UpdateInvoiceLineRateCard, FeaturePagePaginatedResponse, Workflow, AppPagePaginatedResponse, BillingInstallAppResponse, ProfileApps, ChargeUsageBased, SubscriptionAddonRateCard, PlanPhase, Addon, UpsertAddonRequest, InvoiceStandardLine, UpdateInvoiceStandardLine, Profile, UpsertBillingProfileRequest, SubscriptionAddon, Plan, UpsertPlanRequest, AddonPagePaginatedResponse, ProfilePagePaginatedResponse, ChargePagePaginatedResponse, SubscriptionAddonPagePaginatedResponse, PlanPagePaginatedResponse, InvoiceStandard, UpdateInvoiceStandardRequest, InvoicePagePaginatedResponse, StringFieldFilter, MeterAggregation, MeterQueryGranularity, StringFieldFilterExact, PricePaymentTerm, BillingCurrencyCode, CreateCurrencyCode, UlidFieldFilter, DateTimeFieldFilter, SubscriptionEditTiming, WorkflowPaymentSettings, UpdateBillingWorkflowPaymentSettings, InvalidParameter, RateCardEntitlement, FeatureUnitCost, Currency, WorkflowCollectionAlignment, Price, UpdatePrice, App, CreateChargeRequest, Charge, InvoiceLine, UpdateInvoiceLine, Invoice, SortQueryInput, BaseErrorInput, WorkflowPaymentSendInvoiceSettingsInput, InvoiceWorkflowInvoicingSettingsInput, UpdateBillingInvoiceWorkflowInvoicingSettingsInput, UpdateBillingWorkflowPaymentSendInvoiceSettingsInput, EventInput, UnauthorizedInput, ForbiddenInput, NotFoundInput, GoneInput, ConflictInput, PayloadTooLargeInput, UnsupportedMediaTypeInput, UnprocessableContentInput, TooManyRequestsInput, InternalInput, NotImplementedInput, NotAvailableInput, AppStripeCreateCheckoutSessionCustomerUpdateInput, AppStripeCreateCheckoutSessionTaxIdCollectionInput, CreateCreditGrantPurchaseInput, RateCardMeteredEntitlementInput, CreditGrantPurchaseInput, VoidCreditGrantRequestInput, UnitConfigInput, WorkflowInvoicingSettingsInput, GovernanceQueryRequestInput, IngestedEventInput, SubscriptionCancelInput, InvoiceUsageQuantityDetailInput, InvoiceWorkflowInput, UpdateBillingInvoiceWorkflowInput, CreateCreditGrantRequestInput, CreditGrantInput, WorkflowTaxSettingsInput, IngestedEventPaginatedResponseInput, MeterQueryRequestInput, AppStripeCreateCheckoutSessionRequestOptionsInput, InvoiceWorkflowSettingsInput, InvoiceDetailedLineInput, UpdateInvoiceWorkflowSettingsInput, CreditGrantPagePaginatedResponseInput, BadRequestInput, CustomerStripeCreateCheckoutSessionRequestInput, WorkflowCollectionSettingsInput, RateCardInput, InvoiceLineRateCardInput, WorkflowInput, SubscriptionAddonRateCardInput, PlanPhaseInput, AddonInput, CreateAddonRequestInput, UpsertAddonRequestInput, InvoiceStandardLineInput, ProfileInput, CreateBillingProfileRequestInput, UpsertBillingProfileRequestInput, SubscriptionAddonInput, PlanInput, CreatePlanRequestInput, UpsertPlanRequestInput, AddonPagePaginatedResponseInput, ProfilePagePaginatedResponseInput, SubscriptionAddonPagePaginatedResponseInput, PlanPagePaginatedResponseInput, InvoiceStandardInput, UpdateInvoiceStandardRequestInput, InvoicePagePaginatedResponseInput, WorkflowPaymentSettingsInput, UpdateBillingWorkflowPaymentSettingsInput, RateCardEntitlementInput, InvoiceLineInput, InvoiceInput, UpdateInvoiceRequestInput, } from './models/types.js';
package/dist/index.js CHANGED
@@ -1,25 +1,23 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export { OpenMeter } from './sdk/sdk.js';
2
3
  export { Events } from './sdk/events.js';
3
4
  export { Meters } from './sdk/meters.js';
4
5
  export { Customers } from './sdk/customers.js';
5
6
  export { Entitlements } from './sdk/entitlements.js';
6
7
  export { Subscriptions } from './sdk/subscriptions.js';
7
- export { Apps } from './sdk/apps.js';
8
8
  export { Billing } from './sdk/billing.js';
9
- export { Invoices } from './sdk/invoices.js';
10
9
  export { Tax } from './sdk/tax.js';
11
- export { Currencies } from './sdk/currencies.js';
12
10
  export { Features } from './sdk/features.js';
13
11
  export { LLMCost } from './sdk/llmCost.js';
14
12
  export { Plans } from './sdk/plans.js';
15
13
  export { Addons } from './sdk/addons.js';
16
14
  export { PlanAddons } from './sdk/planAddons.js';
17
15
  export { Defaults } from './sdk/defaults.js';
18
- export { Governance } from './sdk/governance.js';
19
16
  export { Client } from './core.js';
20
17
  export { HTTPError } from './models/errors.js';
21
- export { ValidationError, DepthLimitExceededError } from './lib/wire.js';
18
+ export { ValidationError, DepthLimitExceededError, UnsafeIntegerError, } from './lib/wire.js';
19
+ export { PaginationLimitExceededError } from './lib/paginate.js';
22
20
  export { ServerList, Regions } from './lib/config.js';
21
+ export { unwrap, ok, err } from './lib/types.js';
23
22
  export { encodePath, encodeSort, querySerializer, toURLSearchParams, } from './lib/encodings.js';
24
23
  export * as funcs from './funcs/index.js';
25
- //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import { type Options } from 'ky';
2
- export declare const ServerList: readonly ["https://{region}.api.konghq.com/v3", "http://localhost:{port}/api/v3", "https://openmeter.cloud/api/v3"];
3
- export declare const Regions: readonly ["in", "me", "au", "eu", "us"];
2
+ export declare const ServerList: readonly ['https://{region}.api.konghq.com/v3', 'http://localhost:{port}/api/v3', 'https://openmeter.cloud/api/v3'];
3
+ export declare const Regions: readonly ['in', 'me', 'au', 'eu', 'us'];
4
4
  export type Region = (typeof Regions)[number];
5
5
  export type ServerVariables = {
6
6
  region?: Region;
@@ -20,4 +20,3 @@ export interface SDKOptions extends Omit<Options, 'method'> {
20
20
  */
21
21
  validate?: boolean;
22
22
  }
23
- //# sourceMappingURL=config.d.ts.map
@@ -1,7 +1,7 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export const ServerList = [
2
3
  'https://{region}.api.konghq.com/v3',
3
4
  'http://localhost:{port}/api/v3',
4
5
  'https://openmeter.cloud/api/v3',
5
6
  ];
6
7
  export const Regions = ['in', 'me', 'au', 'eu', 'us'];
7
- //# sourceMappingURL=config.js.map
@@ -5,4 +5,3 @@ export declare function encodeSort(sort: {
5
5
  by?: string;
6
6
  order?: 'asc' | 'desc';
7
7
  } | undefined, encodeField?: (field: string) => string): string | undefined;
8
- //# sourceMappingURL=encodings.d.ts.map
@@ -1,3 +1,4 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  export function encodePath(template, params) {
2
3
  return template.replace(/\{(\w+)\}/g, (_, key) => {
3
4
  const value = params[key];
@@ -54,4 +55,3 @@ export function encodeSort(sort, encodeField = (field) => field) {
54
55
  }
55
56
  return by;
56
57
  }
57
- //# sourceMappingURL=encodings.js.map