@openmeter/client 1.0.0-beta.230 → 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 +347 -68
- 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 +50 -1
- package/dist/funcs/apps.d.ts +14 -1
- package/dist/funcs/apps.js +15 -1
- package/dist/funcs/billing.d.ts +46 -1
- package/dist/funcs/billing.js +47 -1
- package/dist/funcs/currencies.d.ts +30 -1
- package/dist/funcs/currencies.js +31 -1
- package/dist/funcs/customers.d.ts +165 -2
- package/dist/funcs/customers.js +192 -1
- package/dist/funcs/defaults.d.ts +10 -1
- package/dist/funcs/defaults.js +11 -1
- package/dist/funcs/entitlements.d.ts +5 -1
- package/dist/funcs/entitlements.js +6 -1
- package/dist/funcs/events.d.ts +14 -1
- package/dist/funcs/events.js +15 -1
- package/dist/funcs/features.d.ts +42 -1
- package/dist/funcs/features.js +43 -1
- package/dist/funcs/governance.d.ts +14 -1
- package/dist/funcs/governance.js +15 -1
- package/dist/funcs/index.d.ts +0 -1
- package/dist/funcs/index.js +1 -1
- package/dist/funcs/invoices.d.ts +44 -1
- package/dist/funcs/invoices.js +45 -1
- package/dist/funcs/llmCost.d.ts +36 -1
- package/dist/funcs/llmCost.js +37 -1
- package/dist/funcs/meters.d.ts +53 -1
- package/dist/funcs/meters.js +54 -1
- package/dist/funcs/planAddons.d.ts +35 -1
- package/dist/funcs/planAddons.js +36 -1
- package/dist/funcs/plans.d.ts +49 -1
- package/dist/funcs/plans.js +50 -1
- package/dist/funcs/subscriptions.d.ts +59 -1
- package/dist/funcs/subscriptions.js +60 -1
- package/dist/funcs/tax.d.ts +25 -1
- package/dist/funcs/tax.js +26 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.js +4 -5
- package/dist/lib/config.d.ts +0 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/encodings.d.ts +0 -1
- package/dist/lib/encodings.js +1 -1
- 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 +3 -1
- package/dist/lib/wire.js +93 -4
- package/dist/models/errors.d.ts +13 -2
- package/dist/models/errors.js +31 -4
- package/dist/models/operations/addons.d.ts +0 -1
- package/dist/models/operations/addons.js +1 -1
- package/dist/models/operations/apps.d.ts +2 -5
- package/dist/models/operations/apps.js +1 -1
- package/dist/models/operations/billing.d.ts +0 -1
- package/dist/models/operations/billing.js +1 -1
- package/dist/models/operations/currencies.d.ts +0 -1
- package/dist/models/operations/currencies.js +1 -1
- package/dist/models/operations/customers.d.ts +9 -6
- package/dist/models/operations/customers.js +1 -1
- package/dist/models/operations/defaults.d.ts +0 -1
- 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 +0 -1
- package/dist/models/operations/events.js +1 -1
- package/dist/models/operations/features.d.ts +0 -1
- package/dist/models/operations/features.js +1 -1
- package/dist/models/operations/governance.d.ts +0 -1
- package/dist/models/operations/governance.js +1 -1
- package/dist/models/operations/invoices.d.ts +4 -7
- package/dist/models/operations/invoices.js +1 -1
- package/dist/models/operations/llmCost.d.ts +0 -1
- package/dist/models/operations/llmCost.js +1 -1
- package/dist/models/operations/meters.d.ts +0 -1
- package/dist/models/operations/meters.js +1 -1
- package/dist/models/operations/planAddons.d.ts +0 -1
- package/dist/models/operations/planAddons.js +1 -1
- package/dist/models/operations/plans.d.ts +0 -1
- package/dist/models/operations/plans.js +1 -1
- package/dist/models/operations/subscriptions.d.ts +0 -1
- package/dist/models/operations/subscriptions.js +1 -1
- package/dist/models/operations/tax.d.ts +0 -1
- package/dist/models/operations/tax.js +1 -1
- package/dist/models/schemas.d.ts +162 -1
- package/dist/models/schemas.js +37 -5
- package/dist/models/types.d.ts +464 -577
- 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 +211 -2
- package/dist/sdk/customers.js +222 -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 +64 -1
- package/dist/sdk/meters.js +67 -1
- 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 -10
- package/dist/sdk/sdk.js +11 -15
- package/dist/sdk/subscriptions.d.ts +72 -3
- package/dist/sdk/subscriptions.js +77 -5
- package/dist/sdk/tax.d.ts +34 -1
- package/dist/sdk/tax.js +37 -1
- package/package.json +28 -4
- 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
- package/dist/sdk/invoices.d.ts +0 -12
- package/dist/sdk/invoices.js +0 -21
package/dist/lib/to-error.d.ts
CHANGED
package/dist/lib/to-error.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { HTTPError as KyHTTPError } from 'ky';
|
|
2
3
|
import * as schemas from '../models/schemas.js';
|
|
3
4
|
import { HTTPError } from '../models/errors.js';
|
|
@@ -13,4 +14,3 @@ export async function toError(e) {
|
|
|
13
14
|
}
|
|
14
15
|
return new Error(String(e));
|
|
15
16
|
}
|
|
16
|
-
//# sourceMappingURL=to-error.js.map
|
package/dist/lib/types.d.ts
CHANGED
package/dist/lib/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_VERSION = "v1.0.0-beta.231";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
|
+
// The committed value is a dev placeholder. The publish flow
|
|
3
|
+
// (`make -C api/spec publish-aip-sdk`) stamps the real release version here
|
|
4
|
+
// before `pnpm publish`, after `pnpm version` updates package.json.
|
|
5
|
+
export const SDK_VERSION = 'v1.0.0-beta.231';
|
package/dist/lib/wire.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { output, ZodType } from 'zod';
|
|
2
2
|
export declare function toCamelCase(name: string): string;
|
|
3
3
|
export declare function toSnakeCase(name: string): string;
|
|
4
|
+
export declare class UnsafeIntegerError extends Error {
|
|
5
|
+
constructor(value: bigint);
|
|
6
|
+
}
|
|
4
7
|
export type DateString = string & Record<never, never>;
|
|
5
8
|
export type AcceptDateStrings<T> = T extends Date ? Date | DateString : T extends (infer E)[] ? AcceptDateStrings<E>[] : T extends object ? {
|
|
6
9
|
[K in keyof T]: AcceptDateStrings<T[K]>;
|
|
@@ -15,4 +18,3 @@ export declare class ValidationError extends Error {
|
|
|
15
18
|
constructor(message: string, issues: unknown);
|
|
16
19
|
}
|
|
17
20
|
export declare function assertValid(schema: ZodType, data: unknown): void;
|
|
18
|
-
//# sourceMappingURL=wire.d.ts.map
|
package/dist/lib/wire.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
export function toCamelCase(name) {
|
|
2
3
|
return name.replace(/_([a-z0-9])/g, (_m, c) => c.toUpperCase());
|
|
3
4
|
}
|
|
@@ -27,6 +28,38 @@ function unwrap(schema) {
|
|
|
27
28
|
/* v8 ignore next -- loop returns inside; reached only past the cycle guard */
|
|
28
29
|
return current;
|
|
29
30
|
}
|
|
31
|
+
// The default to write for a field the caller omitted, present only when the
|
|
32
|
+
// field is required-with-default in the spec — emitted as `.default(x)` with no
|
|
33
|
+
// `.optional()` in the wrapper chain (TypeSpec `field: T = x`, not
|
|
34
|
+
// `field?: T = x`). Such fields must be present on the wire (e.g. a CloudEvents
|
|
35
|
+
// envelope's `specversion`, which the server's parser rejects when absent), yet
|
|
36
|
+
// the generated request type allows omitting them so callers get the documented
|
|
37
|
+
// default for free — toWire is the layer that has to reconcile the two.
|
|
38
|
+
// Spec-optional fields (`.optional().default(x)`) return undefined and stay off
|
|
39
|
+
// the wire: their default is the server's to apply, and materializing them
|
|
40
|
+
// client-side would silently overwrite server state on update requests.
|
|
41
|
+
function requiredDefault(schema) {
|
|
42
|
+
let current = schema;
|
|
43
|
+
let found;
|
|
44
|
+
for (let i = 0; i < 100 && current; i++) {
|
|
45
|
+
const d = def(current);
|
|
46
|
+
/* v8 ignore next 3 -- every zod schema carries a def; guards the type only */
|
|
47
|
+
if (!d) {
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
if (d.type === 'optional') {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
if (d.type === 'default') {
|
|
54
|
+
found ??= { value: d.defaultValue };
|
|
55
|
+
}
|
|
56
|
+
else if (d.type !== 'nullable') {
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
current = d.innerType;
|
|
60
|
+
}
|
|
61
|
+
return found;
|
|
62
|
+
}
|
|
30
63
|
function shapeOf(schema) {
|
|
31
64
|
return schema?.shape;
|
|
32
65
|
}
|
|
@@ -60,7 +93,10 @@ function needsWalk(schema) {
|
|
|
60
93
|
if (!d) {
|
|
61
94
|
return false;
|
|
62
95
|
}
|
|
63
|
-
if (d.type === 'object' ||
|
|
96
|
+
if (d.type === 'object' ||
|
|
97
|
+
d.type === 'record' ||
|
|
98
|
+
d.type === 'date' ||
|
|
99
|
+
d.type === 'bigint') {
|
|
64
100
|
return true;
|
|
65
101
|
}
|
|
66
102
|
if (d.type === 'array') {
|
|
@@ -71,6 +107,18 @@ function needsWalk(schema) {
|
|
|
71
107
|
}
|
|
72
108
|
return false;
|
|
73
109
|
}
|
|
110
|
+
// Thrown by toWire when a bigint value (an int64/uint64 field) is outside
|
|
111
|
+
// JSON's exactly-representable integer range. The wire carries int64 as a JSON
|
|
112
|
+
// number (the server decodes it into a Go int64), so a value beyond 2^53-1
|
|
113
|
+
// cannot be sent without silent precision corruption — a typed, immediate
|
|
114
|
+
// failure is the only honest option. request() catches it like any Error and
|
|
115
|
+
// surfaces it as Result.error.
|
|
116
|
+
export class UnsafeIntegerError extends Error {
|
|
117
|
+
constructor(value) {
|
|
118
|
+
super(`bigint value ${value} exceeds JSON's safe integer range and cannot be sent without precision loss`);
|
|
119
|
+
this.name = 'UnsafeIntegerError';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
74
122
|
const _literalsSurviveWidening = true;
|
|
75
123
|
void _literalsSurviveWidening;
|
|
76
124
|
// A handful of schemas are genuinely self-referential (e.g. the `and`/`or`
|
|
@@ -95,10 +143,15 @@ function walk(data, schema, dir, depth = 0) {
|
|
|
95
143
|
// A Date can only ever mean its wire serialization, wherever it sits — a
|
|
96
144
|
// typed date field, a record value, or an unknown-schema position. Wire→
|
|
97
145
|
// public data never contains Date instances (it comes from JSON.parse), so
|
|
98
|
-
// this only rewrites public→wire.
|
|
146
|
+
// this only rewrites public→wire. The same holds for bigint: JSON.parse
|
|
147
|
+
// never produces one, and public→wire it must become a JSON number wherever
|
|
148
|
+
// it sits.
|
|
99
149
|
if (data instanceof Date) {
|
|
100
150
|
return dir.mapDate(data);
|
|
101
151
|
}
|
|
152
|
+
if (typeof data === 'bigint') {
|
|
153
|
+
return dir.mapBigInt(data);
|
|
154
|
+
}
|
|
102
155
|
if (depth > MAX_WALK_DEPTH) {
|
|
103
156
|
throw new DepthLimitExceededError();
|
|
104
157
|
}
|
|
@@ -110,6 +163,12 @@ function walk(data, schema, dir, depth = 0) {
|
|
|
110
163
|
if (d?.type === 'date') {
|
|
111
164
|
return dir.mapDate(data);
|
|
112
165
|
}
|
|
166
|
+
// A bigint-typed node revives the wire's JSON number into the public
|
|
167
|
+
// `bigint` (public→wire bigints were already mapped by the value check
|
|
168
|
+
// above, so only fromWire reaches a number here).
|
|
169
|
+
if (d?.type === 'bigint') {
|
|
170
|
+
return dir.mapBigInt(data);
|
|
171
|
+
}
|
|
113
172
|
if (Array.isArray(data)) {
|
|
114
173
|
// The schema may be the array itself or a union with an array variant
|
|
115
174
|
// (e.g. a single-or-batch body `T | T[]`); resolve the element schema from
|
|
@@ -172,6 +231,20 @@ function walk(data, schema, dir, depth = 0) {
|
|
|
172
231
|
}
|
|
173
232
|
out[dir.rename(key)] = walk(value, fieldSchema, dir, depth + 1);
|
|
174
233
|
}
|
|
234
|
+
if (dir.applyDefaults) {
|
|
235
|
+
// Shape keys are generated camelCase identifiers (never data-controlled),
|
|
236
|
+
// so direct indexing into `record` is safe here. Runs after the data loop
|
|
237
|
+
// so an explicit `key: undefined` entry is also replaced by the default.
|
|
238
|
+
for (const [key, fieldSchema] of Object.entries(shape)) {
|
|
239
|
+
if (record[key] !== undefined) {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
const dflt = requiredDefault(fieldSchema);
|
|
243
|
+
if (dflt !== undefined) {
|
|
244
|
+
out[dir.rename(key)] = walk(dflt.value, fieldSchema, dir, depth + 1);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
175
248
|
Object.setPrototypeOf(out, Object.prototype);
|
|
176
249
|
return out;
|
|
177
250
|
}
|
|
@@ -262,15 +335,32 @@ const toWireDirection = {
|
|
|
262
335
|
rename: toSnakeCase,
|
|
263
336
|
discriminatorKey: (camelKey) => camelKey,
|
|
264
337
|
mapDate: (value) => (value instanceof Date ? value.toISOString() : value),
|
|
338
|
+
mapBigInt: (value) => {
|
|
339
|
+
if (typeof value !== 'bigint') {
|
|
340
|
+
return value;
|
|
341
|
+
}
|
|
342
|
+
if (value > BigInt(Number.MAX_SAFE_INTEGER) ||
|
|
343
|
+
value < -BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
344
|
+
throw new UnsafeIntegerError(value);
|
|
345
|
+
}
|
|
346
|
+
return Number(value);
|
|
347
|
+
},
|
|
348
|
+
applyDefaults: true,
|
|
265
349
|
};
|
|
266
350
|
const fromWireDirection = {
|
|
267
351
|
rename: toCamelCase,
|
|
268
352
|
discriminatorKey: (camelKey) => toSnakeCase(camelKey),
|
|
269
353
|
mapDate: (value) => (typeof value === 'string' ? new Date(value) : value),
|
|
354
|
+
mapBigInt: (value) => typeof value === 'number' && Number.isInteger(value)
|
|
355
|
+
? BigInt(value)
|
|
356
|
+
: value,
|
|
357
|
+
applyDefaults: false,
|
|
270
358
|
};
|
|
271
359
|
// Rewrite a request body or query object from the camelCase public shape to the
|
|
272
360
|
// snake_case wire shape, driven by its schema. Record keys (label/dimension names)
|
|
273
|
-
// are preserved; `Date` values serialize to RFC 3339 strings
|
|
361
|
+
// are preserved; `Date` values serialize to RFC 3339 strings; `bigint` values
|
|
362
|
+
// (int64 fields) become JSON numbers; omitted required-with-default fields are
|
|
363
|
+
// filled with their declared default (see requiredDefault). The return is typed
|
|
274
364
|
// as the input `T` so call sites stay cast-free (the runtime object has snake keys
|
|
275
365
|
// and wire-encoded dates, but the value is write-only — it flows straight into
|
|
276
366
|
// `json:`/`toURLSearchParams`, both of which accept any object).
|
|
@@ -309,4 +399,3 @@ export function assertValid(schema, data) {
|
|
|
309
399
|
throw new ValidationError('schema validation failed', result.error.issues);
|
|
310
400
|
}
|
|
311
401
|
}
|
|
312
|
-
//# sourceMappingURL=wire.js.map
|
package/dist/models/errors.d.ts
CHANGED
|
@@ -5,12 +5,23 @@ export declare class HTTPError extends Error {
|
|
|
5
5
|
title: string;
|
|
6
6
|
status: number;
|
|
7
7
|
url: string;
|
|
8
|
+
retryAfter: number | undefined;
|
|
8
9
|
protected __raw?: Record<string, unknown> | undefined;
|
|
9
|
-
constructor(message: string, type: string, title: string, status: number, url: string, __raw?: Record<string, unknown> | undefined);
|
|
10
|
+
constructor(message: string, type: string, title: string, status: number, url: string, retryAfter: number | undefined, __raw?: Record<string, unknown> | undefined);
|
|
10
11
|
static fromResponse(resp: {
|
|
11
12
|
response: Response;
|
|
12
13
|
error?: z.infer<typeof schemas.baseError>;
|
|
13
14
|
}): HTTPError;
|
|
15
|
+
/**
|
|
16
|
+
* The `invalid_parameters` problem-detail extension member, present on Bad
|
|
17
|
+
* Request (400) responses. Typed from the schema, not runtime-validated
|
|
18
|
+
* (like the rest of the SDK, this trusts the server rather than rejecting
|
|
19
|
+
* additive fields) — `undefined` when the response didn't carry one.
|
|
20
|
+
*/
|
|
21
|
+
get invalidParameters(): z.infer<typeof schemas.invalidParameters> | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Escape hatch for problem-detail extension members without a typed
|
|
24
|
+
* accessor above.
|
|
25
|
+
*/
|
|
14
26
|
getField(key: string): unknown;
|
|
15
27
|
}
|
|
16
|
-
//# sourceMappingURL=errors.d.ts.map
|
package/dist/models/errors.js
CHANGED
|
@@ -1,28 +1,55 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
|
+
// Retry-After is either delta-seconds (an integer) or an HTTP-date. Only the
|
|
3
|
+
// delta-seconds form is parsed; HTTP-date values yield undefined rather than
|
|
4
|
+
// a parsed Date, keeping the public type a plain number.
|
|
5
|
+
function parseRetryAfter(header) {
|
|
6
|
+
if (header === null) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const trimmed = header.trim();
|
|
10
|
+
return /^\d+$/.test(trimmed) ? Number(trimmed) : undefined;
|
|
11
|
+
}
|
|
1
12
|
export class HTTPError extends Error {
|
|
2
13
|
type;
|
|
3
14
|
title;
|
|
4
15
|
status;
|
|
5
16
|
url;
|
|
17
|
+
retryAfter;
|
|
6
18
|
__raw;
|
|
7
|
-
constructor(message, type, title, status, url, __raw) {
|
|
19
|
+
constructor(message, type, title, status, url, retryAfter, __raw) {
|
|
8
20
|
super(message);
|
|
9
21
|
this.type = type;
|
|
10
22
|
this.title = title;
|
|
11
23
|
this.status = status;
|
|
12
24
|
this.url = url;
|
|
25
|
+
this.retryAfter = retryAfter;
|
|
13
26
|
this.__raw = __raw;
|
|
27
|
+
this.name = 'HTTPError';
|
|
14
28
|
}
|
|
15
29
|
static fromResponse(resp) {
|
|
30
|
+
const retryAfter = parseRetryAfter(resp.response.headers.get('Retry-After'));
|
|
16
31
|
if (resp.response.headers
|
|
17
32
|
.get('Content-Type')
|
|
18
33
|
?.includes('application/problem+json') &&
|
|
19
34
|
resp.error) {
|
|
20
|
-
return new HTTPError(resp.error.detail, resp.error.type ?? resp.error.title, resp.error.title, resp.error.status ?? resp.response.status, resp.response.url, resp.error);
|
|
35
|
+
return new HTTPError(resp.error.detail, resp.error.type ?? resp.error.title, resp.error.title, resp.error.status ?? resp.response.status, resp.response.url, retryAfter, resp.error);
|
|
21
36
|
}
|
|
22
|
-
return new HTTPError(`Request failed: ${resp.response.statusText}`, resp.response.statusText, resp.response.statusText, resp.response.status, resp.response.url);
|
|
37
|
+
return new HTTPError(`Request failed: ${resp.response.statusText}`, resp.response.statusText, resp.response.statusText, resp.response.status, resp.response.url, retryAfter);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The `invalid_parameters` problem-detail extension member, present on Bad
|
|
41
|
+
* Request (400) responses. Typed from the schema, not runtime-validated
|
|
42
|
+
* (like the rest of the SDK, this trusts the server rather than rejecting
|
|
43
|
+
* additive fields) — `undefined` when the response didn't carry one.
|
|
44
|
+
*/
|
|
45
|
+
get invalidParameters() {
|
|
46
|
+
return this.__raw?.invalid_parameters;
|
|
23
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Escape hatch for problem-detail extension members without a typed
|
|
50
|
+
* accessor above.
|
|
51
|
+
*/
|
|
24
52
|
getField(key) {
|
|
25
53
|
return this.__raw?.[key];
|
|
26
54
|
}
|
|
27
55
|
}
|
|
28
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import * as schemas from '../schemas.js';
|
|
3
1
|
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
4
|
-
import type { AppPagePaginatedResponse } from '../types.js';
|
|
2
|
+
import type { App, AppPagePaginatedResponse } from '../types.js';
|
|
5
3
|
export interface ListAppsQuery {
|
|
6
4
|
/** Determines which page of the collection to retrieve. */
|
|
7
5
|
page?: {
|
|
@@ -14,5 +12,4 @@ export type ListAppsResponse = AppPagePaginatedResponse;
|
|
|
14
12
|
export type GetAppRequest = {
|
|
15
13
|
appId: string;
|
|
16
14
|
};
|
|
17
|
-
export type GetAppResponse =
|
|
18
|
-
//# sourceMappingURL=apps.d.ts.map
|
|
15
|
+
export type GetAppResponse = App;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import * as schemas from '../schemas.js';
|
|
3
1
|
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
4
|
-
import type { AppCustomerData, AppStripeCreateCheckoutSessionResult, AppStripeCreateCustomerPortalSessionResult,
|
|
2
|
+
import type { AppCustomerData, AppStripeCreateCheckoutSessionResult, AppStripeCreateCustomerPortalSessionResult, Charge, ChargePagePaginatedResponse, CreateChargeRequest, CreateCreditAdjustmentRequest as CreateCreditAdjustmentRequestBody, CreateCreditGrantRequestInput, CreateCustomerRequest as CreateCustomerRequestBody, CreditAdjustment, CreditBalances, CreditGrant, CreditGrantPagePaginatedResponse, CreditTransactionPaginatedResponse, CursorPaginationQueryPage, Customer, CustomerData, CustomerPagePaginatedResponse, CustomerStripeCreateCheckoutSessionRequestInput, CustomerStripeCreateCustomerPortalSessionRequest, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListCreditGrantsParamsFilter, ListCreditTransactionsParamsFilter, ListCustomersParamsFilter, SortQueryInput, UpdateCreditGrantExternalSettlementRequest as UpdateCreditGrantExternalSettlementRequestBody, UpsertAppCustomerDataRequest, UpsertCustomerBillingDataRequest, UpsertCustomerRequest as UpsertCustomerRequestBody, VoidCreditGrantRequestInput } from '../types.js';
|
|
5
3
|
export type CreateCustomerRequest = AcceptDateStrings<CreateCustomerRequestBody>;
|
|
6
4
|
export type CreateCustomerResponse = Customer;
|
|
7
5
|
export type GetCustomerRequest = {
|
|
@@ -108,6 +106,12 @@ export type CreateCreditAdjustmentRequest = AcceptDateStrings<{
|
|
|
108
106
|
body: CreateCreditAdjustmentRequestBody;
|
|
109
107
|
}>;
|
|
110
108
|
export type CreateCreditAdjustmentResponse = CreditAdjustment;
|
|
109
|
+
export type VoidCreditGrantRequest = AcceptDateStrings<{
|
|
110
|
+
customerId: string;
|
|
111
|
+
creditGrantId: string;
|
|
112
|
+
body: VoidCreditGrantRequestInput;
|
|
113
|
+
}>;
|
|
114
|
+
export type VoidCreditGrantResponse = CreditGrant;
|
|
111
115
|
export type UpdateCreditGrantExternalSettlementRequest = AcceptDateStrings<{
|
|
112
116
|
customerId: string;
|
|
113
117
|
creditGrantId: string;
|
|
@@ -162,7 +166,6 @@ export type ListCustomerChargesRequest = AcceptDateStrings<ListCustomerChargesQu
|
|
|
162
166
|
export type ListCustomerChargesResponse = ChargePagePaginatedResponse;
|
|
163
167
|
export type CreateCustomerChargesRequest = AcceptDateStrings<{
|
|
164
168
|
customerId: string;
|
|
165
|
-
body:
|
|
169
|
+
body: CreateChargeRequest;
|
|
166
170
|
}>;
|
|
167
|
-
export type CreateCustomerChargesResponse =
|
|
168
|
-
//# sourceMappingURL=customers.d.ts.map
|
|
171
|
+
export type CreateCustomerChargesResponse = Charge;
|
|
@@ -4,4 +4,3 @@ export type GetOrganizationDefaultTaxCodesRequest = Record<string, never>;
|
|
|
4
4
|
export type GetOrganizationDefaultTaxCodesResponse = OrganizationDefaultTaxCodes;
|
|
5
5
|
export type UpdateOrganizationDefaultTaxCodesRequest = AcceptDateStrings<UpdateOrganizationDefaultTaxCodesRequestBody>;
|
|
6
6
|
export type UpdateOrganizationDefaultTaxCodesResponse = OrganizationDefaultTaxCodes;
|
|
7
|
-
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -26,4 +26,3 @@ export type ListMeteringEventsRequest = AcceptDateStrings<ListMeteringEventsQuer
|
|
|
26
26
|
export type ListMeteringEventsResponse = IngestedEventPaginatedResponse;
|
|
27
27
|
export type IngestMeteringEventsRequest = AcceptDateStrings<EventInput | EventInput[]>;
|
|
28
28
|
export type IngestMeteringEventsResponse = void;
|
|
29
|
-
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import * as schemas from '../schemas.js';
|
|
3
1
|
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
4
|
-
import type { InvoicePagePaginatedResponse, ListInvoicesParamsFilter, SortQueryInput,
|
|
2
|
+
import type { Invoice, InvoicePagePaginatedResponse, ListInvoicesParamsFilter, SortQueryInput, UpdateInvoiceRequestInput } from '../types.js';
|
|
5
3
|
export interface ListInvoicesQuery {
|
|
6
4
|
/** Determines which page of the collection to retrieve. */
|
|
7
5
|
page?: {
|
|
@@ -35,14 +33,13 @@ export type ListInvoicesResponse = InvoicePagePaginatedResponse;
|
|
|
35
33
|
export type GetInvoiceRequest = {
|
|
36
34
|
invoiceId: string;
|
|
37
35
|
};
|
|
38
|
-
export type GetInvoiceResponse =
|
|
36
|
+
export type GetInvoiceResponse = Invoice;
|
|
39
37
|
export type UpdateInvoiceRequest = AcceptDateStrings<{
|
|
40
38
|
invoiceId: string;
|
|
41
|
-
body:
|
|
39
|
+
body: UpdateInvoiceRequestInput;
|
|
42
40
|
}>;
|
|
43
|
-
export type UpdateInvoiceResponse =
|
|
41
|
+
export type UpdateInvoiceResponse = Invoice;
|
|
44
42
|
export type DeleteInvoiceRequest = {
|
|
45
43
|
invoiceId: string;
|
|
46
44
|
};
|
|
47
45
|
export type DeleteInvoiceResponse = void;
|
|
48
|
-
//# sourceMappingURL=invoices.d.ts.map
|