@openmeter/client 1.0.0-beta.229 → 1.0.0-beta.231
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +364 -66
- package/dist/core.d.ts +0 -1
- package/dist/core.js +8 -1
- package/dist/funcs/addons.d.ts +49 -1
- package/dist/funcs/addons.js +161 -29
- package/dist/funcs/apps.d.ts +14 -1
- package/dist/funcs/apps.js +52 -9
- package/dist/funcs/billing.d.ts +46 -1
- package/dist/funcs/billing.js +126 -17
- package/dist/funcs/currencies.d.ts +30 -1
- package/dist/funcs/currencies.js +113 -23
- package/dist/funcs/customers.d.ts +167 -2
- package/dist/funcs/customers.js +580 -90
- package/dist/funcs/defaults.d.ts +10 -1
- package/dist/funcs/defaults.js +35 -5
- package/dist/funcs/entitlements.d.ts +5 -1
- package/dist/funcs/entitlements.js +25 -6
- package/dist/funcs/events.d.ts +14 -1
- package/dist/funcs/events.js +41 -9
- package/dist/funcs/features.d.ts +42 -1
- package/dist/funcs/features.js +142 -28
- package/dist/funcs/governance.d.ts +14 -1
- package/dist/funcs/governance.js +42 -10
- package/dist/funcs/index.d.ts +1 -1
- package/dist/funcs/index.js +2 -1
- package/dist/funcs/invoices.d.ts +51 -0
- package/dist/funcs/invoices.js +125 -0
- package/dist/funcs/llmCost.d.ts +36 -1
- package/dist/funcs/llmCost.js +114 -24
- package/dist/funcs/meters.d.ts +55 -2
- package/dist/funcs/meters.js +172 -28
- package/dist/funcs/planAddons.d.ts +35 -1
- package/dist/funcs/planAddons.js +139 -29
- package/dist/funcs/plans.d.ts +49 -1
- package/dist/funcs/plans.js +163 -25
- package/dist/funcs/subscriptions.d.ts +61 -2
- package/dist/funcs/subscriptions.js +238 -40
- package/dist/funcs/tax.d.ts +25 -1
- package/dist/funcs/tax.js +104 -22
- package/dist/index.d.ts +6 -4
- package/dist/index.js +4 -3
- package/dist/lib/config.d.ts +9 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/encodings.d.ts +1 -2
- package/dist/lib/encodings.js +6 -5
- package/dist/lib/paginate.d.ts +56 -0
- package/dist/lib/paginate.js +60 -0
- package/dist/lib/request.d.ts +0 -1
- package/dist/lib/request.js +1 -1
- package/dist/lib/to-error.d.ts +0 -1
- package/dist/lib/to-error.js +1 -1
- package/dist/lib/types.d.ts +0 -1
- package/dist/lib/types.js +1 -1
- package/dist/lib/version.d.ts +1 -0
- package/dist/lib/version.js +5 -0
- package/dist/lib/wire.d.ts +20 -0
- package/dist/lib/wire.js +401 -0
- package/dist/models/errors.d.ts +13 -2
- package/dist/models/errors.js +31 -4
- package/dist/models/operations/addons.d.ts +17 -6
- package/dist/models/operations/addons.js +1 -1
- package/dist/models/operations/apps.d.ts +4 -6
- package/dist/models/operations/apps.js +1 -1
- package/dist/models/operations/billing.d.ts +5 -5
- package/dist/models/operations/billing.js +1 -1
- package/dist/models/operations/currencies.d.ts +27 -10
- package/dist/models/operations/currencies.js +1 -1
- package/dist/models/operations/customers.d.ts +87 -33
- package/dist/models/operations/customers.js +1 -1
- package/dist/models/operations/defaults.d.ts +2 -2
- package/dist/models/operations/defaults.js +1 -1
- package/dist/models/operations/entitlements.d.ts +0 -1
- package/dist/models/operations/entitlements.js +1 -1
- package/dist/models/operations/events.d.ts +20 -5
- package/dist/models/operations/events.js +1 -1
- package/dist/models/operations/features.d.ts +24 -9
- package/dist/models/operations/features.js +1 -1
- package/dist/models/operations/governance.d.ts +3 -3
- package/dist/models/operations/governance.js +1 -1
- package/dist/models/operations/invoices.d.ts +45 -0
- package/dist/models/operations/invoices.js +2 -0
- package/dist/models/operations/llmCost.d.ts +16 -5
- package/dist/models/operations/llmCost.js +1 -1
- package/dist/models/operations/meters.d.ts +29 -9
- package/dist/models/operations/meters.js +1 -1
- package/dist/models/operations/planAddons.d.ts +7 -7
- package/dist/models/operations/planAddons.js +1 -1
- package/dist/models/operations/plans.d.ts +14 -6
- package/dist/models/operations/plans.js +1 -1
- package/dist/models/operations/subscriptions.d.ts +36 -11
- package/dist/models/operations/subscriptions.js +1 -1
- package/dist/models/operations/tax.d.ts +6 -6
- package/dist/models/operations/tax.js +1 -1
- package/dist/models/schemas.d.ts +27484 -3125
- package/dist/models/schemas.js +6247 -495
- package/dist/models/types.d.ts +4548 -1398
- package/dist/models/types.js +1 -1
- package/dist/sdk/addons.d.ts +60 -1
- package/dist/sdk/addons.js +63 -1
- package/dist/sdk/apps.d.ts +25 -1
- package/dist/sdk/apps.js +28 -1
- package/dist/sdk/billing.d.ts +57 -1
- package/dist/sdk/billing.js +60 -1
- package/dist/sdk/customers.d.ts +213 -2
- package/dist/sdk/customers.js +228 -2
- package/dist/sdk/defaults.d.ts +10 -1
- package/dist/sdk/defaults.js +11 -1
- package/dist/sdk/entitlements.d.ts +5 -1
- package/dist/sdk/entitlements.js +6 -1
- package/dist/sdk/events.d.ts +25 -1
- package/dist/sdk/events.js +28 -1
- package/dist/sdk/features.d.ts +53 -1
- package/dist/sdk/features.js +56 -1
- package/dist/sdk/internal.d.ts +180 -0
- package/dist/sdk/internal.js +224 -0
- package/dist/sdk/llmCost.d.ts +57 -1
- package/dist/sdk/llmCost.js +62 -1
- package/dist/sdk/meters.d.ts +66 -2
- package/dist/sdk/meters.js +71 -2
- package/dist/sdk/planAddons.d.ts +46 -1
- package/dist/sdk/planAddons.js +49 -1
- package/dist/sdk/plans.d.ts +60 -1
- package/dist/sdk/plans.js +63 -1
- package/dist/sdk/sdk.d.ts +9 -7
- package/dist/sdk/sdk.js +11 -10
- package/dist/sdk/subscriptions.d.ts +71 -1
- package/dist/sdk/subscriptions.js +76 -1
- package/dist/sdk/tax.d.ts +34 -1
- package/dist/sdk/tax.js +37 -1
- package/package.json +31 -6
- package/dist/sdk/currencies.d.ts +0 -12
- package/dist/sdk/currencies.js +0 -21
- package/dist/sdk/governance.d.ts +0 -9
- package/dist/sdk/governance.js +0 -12
|
@@ -1,64 +1,262 @@
|
|
|
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
|
-
import {
|
|
4
|
+
import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
|
|
5
|
+
import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
|
|
6
|
+
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* Create subscription
|
|
9
|
+
*
|
|
10
|
+
* POST /openmeter/subscriptions
|
|
11
|
+
*/
|
|
4
12
|
export function createSubscription(client, req, options) {
|
|
5
|
-
return request(() =>
|
|
6
|
-
|
|
7
|
-
.
|
|
13
|
+
return request(() => {
|
|
14
|
+
const body = toWire(req, schemas.createSubscriptionBody);
|
|
15
|
+
if (client._options.validate) {
|
|
16
|
+
assertValid(schemas.createSubscriptionBodyWire, body);
|
|
17
|
+
}
|
|
18
|
+
return http(client)
|
|
19
|
+
.post('openmeter/subscriptions', { ...options, json: body })
|
|
20
|
+
.json()
|
|
21
|
+
.then((data) => {
|
|
22
|
+
if (client._options.validate) {
|
|
23
|
+
assertValid(schemas.createSubscriptionResponseWire, data);
|
|
24
|
+
}
|
|
25
|
+
return fromWire(data, schemas.createSubscriptionResponse);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
8
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* List subscriptions
|
|
31
|
+
*
|
|
32
|
+
* GET /openmeter/subscriptions
|
|
33
|
+
*/
|
|
9
34
|
export function listSubscriptions(client, req = {}, options) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
35
|
+
return request(() => {
|
|
36
|
+
const query = toWire({
|
|
37
|
+
page: req.page,
|
|
38
|
+
sort: encodeSort(req.sort, toSnakeCase),
|
|
39
|
+
filter: req.filter,
|
|
40
|
+
}, schemas.listSubscriptionsQueryParams);
|
|
41
|
+
if (client._options.validate) {
|
|
42
|
+
assertValid(schemas.listSubscriptionsQueryParamsWire, query);
|
|
43
|
+
}
|
|
44
|
+
const searchParams = toURLSearchParams(query);
|
|
45
|
+
return http(client)
|
|
46
|
+
.get('openmeter/subscriptions', { ...options, searchParams })
|
|
47
|
+
.json()
|
|
48
|
+
.then((data) => {
|
|
49
|
+
if (client._options.validate) {
|
|
50
|
+
assertValid(schemas.listSubscriptionsResponseWire, data);
|
|
51
|
+
}
|
|
52
|
+
return fromWire(data, schemas.listSubscriptionsResponse);
|
|
53
|
+
});
|
|
14
54
|
});
|
|
15
|
-
return request(() => http(client)
|
|
16
|
-
.get('openmeter/subscriptions', { ...options, searchParams })
|
|
17
|
-
.json());
|
|
18
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Get subscription
|
|
58
|
+
*
|
|
59
|
+
* GET /openmeter/subscriptions/{subscriptionId}
|
|
60
|
+
*/
|
|
19
61
|
export function getSubscription(client, req, options) {
|
|
20
|
-
|
|
21
|
-
|
|
62
|
+
return request(() => {
|
|
63
|
+
const path = `openmeter/subscriptions/${(() => {
|
|
64
|
+
if (req.subscriptionId === undefined) {
|
|
65
|
+
throw new Error('missing path parameter: subscriptionId');
|
|
66
|
+
}
|
|
67
|
+
return encodeURIComponent(String(req.subscriptionId));
|
|
68
|
+
})()}`;
|
|
69
|
+
return http(client)
|
|
70
|
+
.get(path, options)
|
|
71
|
+
.json()
|
|
72
|
+
.then((data) => {
|
|
73
|
+
if (client._options.validate) {
|
|
74
|
+
assertValid(schemas.getSubscriptionResponseWire, data);
|
|
75
|
+
}
|
|
76
|
+
return fromWire(data, schemas.getSubscriptionResponse);
|
|
77
|
+
});
|
|
22
78
|
});
|
|
23
|
-
return request(() => http(client).get(path, options).json());
|
|
24
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Cancel subscription
|
|
82
|
+
*
|
|
83
|
+
* Cancels the subscription. Will result in a scheduling conflict if there are
|
|
84
|
+
* other subscriptions scheduled to start after the cancelation time.
|
|
85
|
+
*
|
|
86
|
+
* POST /openmeter/subscriptions/{subscriptionId}/cancel
|
|
87
|
+
*/
|
|
25
88
|
export function cancelSubscription(client, req, options) {
|
|
26
|
-
|
|
27
|
-
|
|
89
|
+
return request(() => {
|
|
90
|
+
const path = `openmeter/subscriptions/${(() => {
|
|
91
|
+
if (req.subscriptionId === undefined) {
|
|
92
|
+
throw new Error('missing path parameter: subscriptionId');
|
|
93
|
+
}
|
|
94
|
+
return encodeURIComponent(String(req.subscriptionId));
|
|
95
|
+
})()}/cancel`;
|
|
96
|
+
const body = toWire(req.body, schemas.cancelSubscriptionBody);
|
|
97
|
+
if (client._options.validate) {
|
|
98
|
+
assertValid(schemas.cancelSubscriptionBodyWire, body);
|
|
99
|
+
}
|
|
100
|
+
return http(client)
|
|
101
|
+
.post(path, { ...options, json: body })
|
|
102
|
+
.json()
|
|
103
|
+
.then((data) => {
|
|
104
|
+
if (client._options.validate) {
|
|
105
|
+
assertValid(schemas.cancelSubscriptionResponseWire, data);
|
|
106
|
+
}
|
|
107
|
+
return fromWire(data, schemas.cancelSubscriptionResponse);
|
|
108
|
+
});
|
|
28
109
|
});
|
|
29
|
-
return request(() => http(client)
|
|
30
|
-
.post(path, { ...options, json: req.body })
|
|
31
|
-
.json());
|
|
32
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Unschedule subscription cancelation
|
|
113
|
+
*
|
|
114
|
+
* Unschedules the subscription cancelation.
|
|
115
|
+
*
|
|
116
|
+
* POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation
|
|
117
|
+
*/
|
|
33
118
|
export function unscheduleCancelation(client, req, options) {
|
|
34
|
-
|
|
35
|
-
|
|
119
|
+
return request(() => {
|
|
120
|
+
const path = `openmeter/subscriptions/${(() => {
|
|
121
|
+
if (req.subscriptionId === undefined) {
|
|
122
|
+
throw new Error('missing path parameter: subscriptionId');
|
|
123
|
+
}
|
|
124
|
+
return encodeURIComponent(String(req.subscriptionId));
|
|
125
|
+
})()}/unschedule-cancelation`;
|
|
126
|
+
return http(client)
|
|
127
|
+
.post(path, options)
|
|
128
|
+
.json()
|
|
129
|
+
.then((data) => {
|
|
130
|
+
if (client._options.validate) {
|
|
131
|
+
assertValid(schemas.unscheduleCancelationResponseWire, data);
|
|
132
|
+
}
|
|
133
|
+
return fromWire(data, schemas.unscheduleCancelationResponse);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
36
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Change subscription
|
|
139
|
+
*
|
|
140
|
+
* Closes a running subscription and starts a new one according to the
|
|
141
|
+
* specification. Can be used for upgrades, downgrades, and plan changes.
|
|
142
|
+
*
|
|
143
|
+
* POST /openmeter/subscriptions/{subscriptionId}/change
|
|
144
|
+
*/
|
|
37
145
|
export function changeSubscription(client, req, options) {
|
|
38
|
-
|
|
39
|
-
|
|
146
|
+
return request(() => {
|
|
147
|
+
const path = `openmeter/subscriptions/${(() => {
|
|
148
|
+
if (req.subscriptionId === undefined) {
|
|
149
|
+
throw new Error('missing path parameter: subscriptionId');
|
|
150
|
+
}
|
|
151
|
+
return encodeURIComponent(String(req.subscriptionId));
|
|
152
|
+
})()}/change`;
|
|
153
|
+
const body = toWire(req.body, schemas.changeSubscriptionBody);
|
|
154
|
+
if (client._options.validate) {
|
|
155
|
+
assertValid(schemas.changeSubscriptionBodyWire, body);
|
|
156
|
+
}
|
|
157
|
+
return http(client)
|
|
158
|
+
.post(path, { ...options, json: body })
|
|
159
|
+
.json()
|
|
160
|
+
.then((data) => {
|
|
161
|
+
if (client._options.validate) {
|
|
162
|
+
assertValid(schemas.changeSubscriptionResponseWire, data);
|
|
163
|
+
}
|
|
164
|
+
return fromWire(data, schemas.changeSubscriptionResponse);
|
|
165
|
+
});
|
|
40
166
|
});
|
|
41
|
-
return request(() => http(client)
|
|
42
|
-
.post(path, { ...options, json: req.body })
|
|
43
|
-
.json());
|
|
44
167
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
168
|
+
/**
|
|
169
|
+
* Create a new subscription add-on
|
|
170
|
+
*
|
|
171
|
+
* Add add-on to a subscription.
|
|
172
|
+
*
|
|
173
|
+
* POST /openmeter/subscriptions/{subscriptionId}/addons
|
|
174
|
+
*/
|
|
175
|
+
export function createSubscriptionAddon(client, req, options) {
|
|
176
|
+
return request(() => {
|
|
177
|
+
const path = `openmeter/subscriptions/${(() => {
|
|
178
|
+
if (req.subscriptionId === undefined) {
|
|
179
|
+
throw new Error('missing path parameter: subscriptionId');
|
|
180
|
+
}
|
|
181
|
+
return encodeURIComponent(String(req.subscriptionId));
|
|
182
|
+
})()}/addons`;
|
|
183
|
+
const body = toWire(req.body, schemas.createSubscriptionAddonBody);
|
|
184
|
+
if (client._options.validate) {
|
|
185
|
+
assertValid(schemas.createSubscriptionAddonBodyWire, body);
|
|
186
|
+
}
|
|
187
|
+
return http(client)
|
|
188
|
+
.post(path, { ...options, json: body })
|
|
189
|
+
.json()
|
|
190
|
+
.then((data) => {
|
|
191
|
+
if (client._options.validate) {
|
|
192
|
+
assertValid(schemas.createSubscriptionAddonResponseWire, data);
|
|
193
|
+
}
|
|
194
|
+
return fromWire(data, schemas.createSubscriptionAddonResponse);
|
|
195
|
+
});
|
|
49
196
|
});
|
|
50
|
-
|
|
51
|
-
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* List subscription addons
|
|
200
|
+
*
|
|
201
|
+
* List the add-ons of a subscription.
|
|
202
|
+
*
|
|
203
|
+
* GET /openmeter/subscriptions/{subscriptionId}/addons
|
|
204
|
+
*/
|
|
205
|
+
export function listSubscriptionAddons(client, req, options) {
|
|
206
|
+
return request(() => {
|
|
207
|
+
const path = `openmeter/subscriptions/${(() => {
|
|
208
|
+
if (req.subscriptionId === undefined) {
|
|
209
|
+
throw new Error('missing path parameter: subscriptionId');
|
|
210
|
+
}
|
|
211
|
+
return encodeURIComponent(String(req.subscriptionId));
|
|
212
|
+
})()}/addons`;
|
|
213
|
+
const query = toWire({
|
|
214
|
+
page: req.page,
|
|
215
|
+
sort: encodeSort(req.sort, toSnakeCase),
|
|
216
|
+
}, schemas.listSubscriptionAddonsQueryParams);
|
|
217
|
+
if (client._options.validate) {
|
|
218
|
+
assertValid(schemas.listSubscriptionAddonsQueryParamsWire, query);
|
|
219
|
+
}
|
|
220
|
+
const searchParams = toURLSearchParams(query);
|
|
221
|
+
return http(client)
|
|
222
|
+
.get(path, { ...options, searchParams })
|
|
223
|
+
.json()
|
|
224
|
+
.then((data) => {
|
|
225
|
+
if (client._options.validate) {
|
|
226
|
+
assertValid(schemas.listSubscriptionAddonsResponseWire, data);
|
|
227
|
+
}
|
|
228
|
+
return fromWire(data, schemas.listSubscriptionAddonsResponse);
|
|
229
|
+
});
|
|
52
230
|
});
|
|
53
|
-
return request(() => http(client)
|
|
54
|
-
.get(path, { ...options, searchParams })
|
|
55
|
-
.json());
|
|
56
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* Get add-on association for subscription
|
|
234
|
+
*
|
|
235
|
+
* Get an add-on association for a subscription.
|
|
236
|
+
*
|
|
237
|
+
* GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}
|
|
238
|
+
*/
|
|
57
239
|
export function getSubscriptionAddon(client, req, options) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
240
|
+
return request(() => {
|
|
241
|
+
const path = `openmeter/subscriptions/${(() => {
|
|
242
|
+
if (req.subscriptionId === undefined) {
|
|
243
|
+
throw new Error('missing path parameter: subscriptionId');
|
|
244
|
+
}
|
|
245
|
+
return encodeURIComponent(String(req.subscriptionId));
|
|
246
|
+
})()}/addons/${(() => {
|
|
247
|
+
if (req.subscriptionAddonId === undefined) {
|
|
248
|
+
throw new Error('missing path parameter: subscriptionAddonId');
|
|
249
|
+
}
|
|
250
|
+
return encodeURIComponent(String(req.subscriptionAddonId));
|
|
251
|
+
})()}`;
|
|
252
|
+
return http(client)
|
|
253
|
+
.get(path, options)
|
|
254
|
+
.json()
|
|
255
|
+
.then((data) => {
|
|
256
|
+
if (client._options.validate) {
|
|
257
|
+
assertValid(schemas.getSubscriptionAddonResponseWire, data);
|
|
258
|
+
}
|
|
259
|
+
return fromWire(data, schemas.getSubscriptionAddonResponse);
|
|
260
|
+
});
|
|
61
261
|
});
|
|
62
|
-
return request(() => http(client).get(path, options).json());
|
|
63
262
|
}
|
|
64
|
-
//# sourceMappingURL=subscriptions.js.map
|
package/dist/funcs/tax.d.ts
CHANGED
|
@@ -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,40 +1,122 @@
|
|
|
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
|
-
import {
|
|
4
|
+
import { toURLSearchParams } from '../lib/encodings.js';
|
|
5
|
+
import { toWire, fromWire, assertValid } from '../lib/wire.js';
|
|
6
|
+
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* Create tax code
|
|
9
|
+
*
|
|
10
|
+
* POST /openmeter/tax-codes
|
|
11
|
+
*/
|
|
4
12
|
export function createTaxCode(client, req, options) {
|
|
5
|
-
return request(() =>
|
|
6
|
-
|
|
7
|
-
.
|
|
13
|
+
return request(() => {
|
|
14
|
+
const body = toWire(req, schemas.createTaxCodeBody);
|
|
15
|
+
if (client._options.validate) {
|
|
16
|
+
assertValid(schemas.createTaxCodeBodyWire, body);
|
|
17
|
+
}
|
|
18
|
+
return http(client)
|
|
19
|
+
.post('openmeter/tax-codes', { ...options, json: body })
|
|
20
|
+
.json()
|
|
21
|
+
.then((data) => {
|
|
22
|
+
if (client._options.validate) {
|
|
23
|
+
assertValid(schemas.createTaxCodeResponseWire, data);
|
|
24
|
+
}
|
|
25
|
+
return fromWire(data, schemas.createTaxCodeResponse);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
8
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Get tax code
|
|
31
|
+
*
|
|
32
|
+
* GET /openmeter/tax-codes/{taxCodeId}
|
|
33
|
+
*/
|
|
9
34
|
export function getTaxCode(client, req, options) {
|
|
10
|
-
|
|
11
|
-
|
|
35
|
+
return request(() => {
|
|
36
|
+
const path = `openmeter/tax-codes/${(() => {
|
|
37
|
+
if (req.taxCodeId === undefined) {
|
|
38
|
+
throw new Error('missing path parameter: taxCodeId');
|
|
39
|
+
}
|
|
40
|
+
return encodeURIComponent(String(req.taxCodeId));
|
|
41
|
+
})()}`;
|
|
42
|
+
return http(client)
|
|
43
|
+
.get(path, options)
|
|
44
|
+
.json()
|
|
45
|
+
.then((data) => {
|
|
46
|
+
if (client._options.validate) {
|
|
47
|
+
assertValid(schemas.getTaxCodeResponseWire, data);
|
|
48
|
+
}
|
|
49
|
+
return fromWire(data, schemas.getTaxCodeResponse);
|
|
50
|
+
});
|
|
12
51
|
});
|
|
13
|
-
return request(() => http(client).get(path, options).json());
|
|
14
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* List tax codes
|
|
55
|
+
*
|
|
56
|
+
* GET /openmeter/tax-codes
|
|
57
|
+
*/
|
|
15
58
|
export function listTaxCodes(client, req = {}, options) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
59
|
+
return request(() => {
|
|
60
|
+
const query = toWire({
|
|
61
|
+
page: req.page,
|
|
62
|
+
includeDeleted: req.includeDeleted,
|
|
63
|
+
}, schemas.listTaxCodesQueryParams);
|
|
64
|
+
if (client._options.validate) {
|
|
65
|
+
assertValid(schemas.listTaxCodesQueryParamsWire, query);
|
|
66
|
+
}
|
|
67
|
+
const searchParams = toURLSearchParams(query);
|
|
68
|
+
return http(client)
|
|
69
|
+
.get('openmeter/tax-codes', { ...options, searchParams })
|
|
70
|
+
.json()
|
|
71
|
+
.then((data) => {
|
|
72
|
+
if (client._options.validate) {
|
|
73
|
+
assertValid(schemas.listTaxCodesResponseWire, data);
|
|
74
|
+
}
|
|
75
|
+
return fromWire(data, schemas.listTaxCodesResponse);
|
|
76
|
+
});
|
|
19
77
|
});
|
|
20
|
-
return request(() => http(client)
|
|
21
|
-
.get('openmeter/tax-codes', { ...options, searchParams })
|
|
22
|
-
.json());
|
|
23
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Upsert tax code
|
|
81
|
+
*
|
|
82
|
+
* PUT /openmeter/tax-codes/{taxCodeId}
|
|
83
|
+
*/
|
|
24
84
|
export function upsertTaxCode(client, req, options) {
|
|
25
|
-
|
|
26
|
-
|
|
85
|
+
return request(() => {
|
|
86
|
+
const path = `openmeter/tax-codes/${(() => {
|
|
87
|
+
if (req.taxCodeId === undefined) {
|
|
88
|
+
throw new Error('missing path parameter: taxCodeId');
|
|
89
|
+
}
|
|
90
|
+
return encodeURIComponent(String(req.taxCodeId));
|
|
91
|
+
})()}`;
|
|
92
|
+
const body = toWire(req.body, schemas.upsertTaxCodeBody);
|
|
93
|
+
if (client._options.validate) {
|
|
94
|
+
assertValid(schemas.upsertTaxCodeBodyWire, body);
|
|
95
|
+
}
|
|
96
|
+
return http(client)
|
|
97
|
+
.put(path, { ...options, json: body })
|
|
98
|
+
.json()
|
|
99
|
+
.then((data) => {
|
|
100
|
+
if (client._options.validate) {
|
|
101
|
+
assertValid(schemas.upsertTaxCodeResponseWire, data);
|
|
102
|
+
}
|
|
103
|
+
return fromWire(data, schemas.upsertTaxCodeResponse);
|
|
104
|
+
});
|
|
27
105
|
});
|
|
28
|
-
return request(() => http(client)
|
|
29
|
-
.put(path, { ...options, json: req.body })
|
|
30
|
-
.json());
|
|
31
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Delete tax code
|
|
109
|
+
*
|
|
110
|
+
* DELETE /openmeter/tax-codes/{taxCodeId}
|
|
111
|
+
*/
|
|
32
112
|
export function deleteTaxCode(client, req, options) {
|
|
33
|
-
const path = encodePath('openmeter/tax-codes/{taxCodeId}', {
|
|
34
|
-
taxCodeId: req.taxCodeId,
|
|
35
|
-
});
|
|
36
113
|
return request(async () => {
|
|
114
|
+
const path = `openmeter/tax-codes/${(() => {
|
|
115
|
+
if (req.taxCodeId === undefined) {
|
|
116
|
+
throw new Error('missing path parameter: taxCodeId');
|
|
117
|
+
}
|
|
118
|
+
return encodeURIComponent(String(req.taxCodeId));
|
|
119
|
+
})()}`;
|
|
37
120
|
await http(client).delete(path, options);
|
|
38
121
|
});
|
|
39
122
|
}
|
|
40
|
-
//# sourceMappingURL=tax.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -7,18 +7,20 @@ export { Subscriptions } from './sdk/subscriptions.js';
|
|
|
7
7
|
export { Apps } from './sdk/apps.js';
|
|
8
8
|
export { Billing } from './sdk/billing.js';
|
|
9
9
|
export { Tax } from './sdk/tax.js';
|
|
10
|
-
export { Currencies } from './sdk/currencies.js';
|
|
11
10
|
export { Features } from './sdk/features.js';
|
|
12
11
|
export { LLMCost } from './sdk/llmCost.js';
|
|
13
12
|
export { Plans } from './sdk/plans.js';
|
|
14
13
|
export { Addons } from './sdk/addons.js';
|
|
15
14
|
export { PlanAddons } from './sdk/planAddons.js';
|
|
16
15
|
export { Defaults } from './sdk/defaults.js';
|
|
17
|
-
export { Governance } from './sdk/governance.js';
|
|
18
16
|
export { Client } from './core.js';
|
|
19
17
|
export { HTTPError } from './models/errors.js';
|
|
18
|
+
export { ValidationError, DepthLimitExceededError, UnsafeIntegerError, } from './lib/wire.js';
|
|
19
|
+
export type { AcceptDateStrings, DateString } from './lib/wire.js';
|
|
20
|
+
export { PaginationLimitExceededError } from './lib/paginate.js';
|
|
20
21
|
export { ServerList, Regions } from './lib/config.js';
|
|
21
22
|
export type { SDKOptions, Region, ServerVariables } from './lib/config.js';
|
|
23
|
+
export { unwrap, ok, err } from './lib/types.js';
|
|
22
24
|
export type { Result, RequestOptions } from './lib/types.js';
|
|
23
25
|
export { encodePath, encodeSort, querySerializer, toURLSearchParams, } from './lib/encodings.js';
|
|
24
26
|
export * as funcs from './funcs/index.js';
|
|
@@ -29,6 +31,7 @@ export type * from './models/operations/entitlements.js';
|
|
|
29
31
|
export type * from './models/operations/subscriptions.js';
|
|
30
32
|
export type * from './models/operations/apps.js';
|
|
31
33
|
export type * from './models/operations/billing.js';
|
|
34
|
+
export type * from './models/operations/invoices.js';
|
|
32
35
|
export type * from './models/operations/tax.js';
|
|
33
36
|
export type * from './models/operations/currencies.js';
|
|
34
37
|
export type * from './models/operations/features.js';
|
|
@@ -38,5 +41,4 @@ export type * from './models/operations/addons.js';
|
|
|
38
41
|
export type * from './models/operations/planAddons.js';
|
|
39
42
|
export type * from './models/operations/defaults.js';
|
|
40
43
|
export type * from './models/operations/governance.js';
|
|
41
|
-
export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels,
|
|
42
|
-
//# sourceMappingURL=index.d.ts.map
|
|
44
|
+
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, 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, 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, AppCatalogItem, TaxCodeAppMapping, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, WorkflowInvoicingSettings, InvoiceValidationIssue, InvoiceAvailableActions, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, CurrencyCustom, CreateCurrencyCustomRequest, 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, FeatureCostQueryResult, MeterPagePaginatedResponse, CostBasisPagePaginatedResponse, MeterQueryFilters, FeatureMeterReference, Customer, PartyAddresses, InvoiceCustomer, UpdateBillingPartyAddresses, UpdateInvoiceCustomer, AppStripeCreateCheckoutSessionConsentCollection, ListCustomerEntitlementAccessResponseData, WorkflowCollectionAlignmentAnchored, ChargeFlatFeeSystemIntent, SubscriptionPagePaginatedResponse, SubscriptionChangeResponse, SubscriptionCancel, SubscriptionChange, InvoiceUsageQuantityDetail, AppStripe, AppSandbox, AppExternalInvoicing, TaxCode, 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, InvoiceWorkflowSettings, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, CurrencyPagePaginatedResponse, GovernanceQueryResult, Feature, CreditGrantPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, WorkflowCollectionSettings, AppPagePaginatedResponse, ProfileApps, GovernanceQueryResponse, ChargeFlatFee, ChargeUsageBasedSystemIntent, CreateChargeUsageBasedRequest, RateCard, InvoiceLineRateCard, UpdateInvoiceLineRateCard, FeaturePagePaginatedResponse, Workflow, 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, Currency, FeatureUnitCost, WorkflowCollectionAlignment, App, Price, UpdatePrice, 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, 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,3 +1,4 @@
|
|
|
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';
|
|
@@ -7,17 +8,17 @@ export { Subscriptions } from './sdk/subscriptions.js';
|
|
|
7
8
|
export { Apps } from './sdk/apps.js';
|
|
8
9
|
export { Billing } from './sdk/billing.js';
|
|
9
10
|
export { Tax } from './sdk/tax.js';
|
|
10
|
-
export { Currencies } from './sdk/currencies.js';
|
|
11
11
|
export { Features } from './sdk/features.js';
|
|
12
12
|
export { LLMCost } from './sdk/llmCost.js';
|
|
13
13
|
export { Plans } from './sdk/plans.js';
|
|
14
14
|
export { Addons } from './sdk/addons.js';
|
|
15
15
|
export { PlanAddons } from './sdk/planAddons.js';
|
|
16
16
|
export { Defaults } from './sdk/defaults.js';
|
|
17
|
-
export { Governance } from './sdk/governance.js';
|
|
18
17
|
export { Client } from './core.js';
|
|
19
18
|
export { HTTPError } from './models/errors.js';
|
|
19
|
+
export { ValidationError, DepthLimitExceededError, UnsafeIntegerError, } from './lib/wire.js';
|
|
20
|
+
export { PaginationLimitExceededError } from './lib/paginate.js';
|
|
20
21
|
export { ServerList, Regions } from './lib/config.js';
|
|
22
|
+
export { unwrap, ok, err } from './lib/types.js';
|
|
21
23
|
export { encodePath, encodeSort, querySerializer, toURLSearchParams, } from './lib/encodings.js';
|
|
22
24
|
export * as funcs from './funcs/index.js';
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -10,5 +10,13 @@ export interface SDKOptions extends Omit<Options, 'method'> {
|
|
|
10
10
|
baseUrl: (typeof ServerList)[number] | URL | string;
|
|
11
11
|
serverVariables?: ServerVariables;
|
|
12
12
|
apiKey?: string | (() => string | Promise<string>);
|
|
13
|
+
/**
|
|
14
|
+
* Validate request bodies and response payloads against their schemas. Off by
|
|
15
|
+
* default: the SDK maps casing but does not validate, so additive server fields
|
|
16
|
+
* never break clients. When on, a request body or response that fails its schema
|
|
17
|
+
* (missing/wrong-typed field, unknown enum value) returns a failed Result whose
|
|
18
|
+
* `error` is a ValidationError (validation runs inside the SDK's request
|
|
19
|
+
* handling, so it never rejects/throws).
|
|
20
|
+
*/
|
|
21
|
+
validate?: boolean;
|
|
13
22
|
}
|
|
14
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/lib/config.js
CHANGED
|
@@ -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
|
package/dist/lib/encodings.d.ts
CHANGED
|
@@ -4,5 +4,4 @@ export declare function toURLSearchParams(params: Record<string, unknown>): URLS
|
|
|
4
4
|
export declare function encodeSort(sort: {
|
|
5
5
|
by?: string;
|
|
6
6
|
order?: 'asc' | 'desc';
|
|
7
|
-
} | undefined): string | undefined;
|
|
8
|
-
//# sourceMappingURL=encodings.d.ts.map
|
|
7
|
+
} | undefined, encodeField?: (field: string) => string): string | undefined;
|
package/dist/lib/encodings.js
CHANGED
|
@@ -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];
|
|
@@ -41,16 +42,16 @@ export function toURLSearchParams(params) {
|
|
|
41
42
|
}
|
|
42
43
|
return search;
|
|
43
44
|
}
|
|
44
|
-
export function encodeSort(sort) {
|
|
45
|
+
export function encodeSort(sort, encodeField = (field) => field) {
|
|
45
46
|
if (!sort?.by) {
|
|
46
47
|
return undefined;
|
|
47
48
|
}
|
|
49
|
+
const by = encodeField(sort.by);
|
|
48
50
|
if (sort.order === 'desc') {
|
|
49
|
-
return `${
|
|
51
|
+
return `${by} desc`;
|
|
50
52
|
}
|
|
51
53
|
if (sort.order === 'asc') {
|
|
52
|
-
return `${
|
|
54
|
+
return `${by} asc`;
|
|
53
55
|
}
|
|
54
|
-
return
|
|
56
|
+
return by;
|
|
55
57
|
}
|
|
56
|
-
//# sourceMappingURL=encodings.js.map
|