@openmeter/client 1.0.0-beta-8eb475ed10bc → 1.0.0-beta-89a54f59c65e

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/README.md CHANGED
@@ -107,6 +107,11 @@ const meters = await client.meters.list()
107
107
  Each method takes the request object as its first argument and an optional
108
108
  per-request options object (`RequestOptions`) as its second.
109
109
 
110
+ Responses return date-time fields as native `Date` objects (every
111
+ `createdAt`/`updatedAt`, meter query row windows, …), and requests accept
112
+ either a `Date` or an RFC 3339 string — a meter query `from`/`to`, an
113
+ ingested event's `time`, filter operands, all alike.
114
+
110
115
  ## Available Resources and Operations
111
116
 
112
117
  Operations are grouped by resource and exposed as methods on the client.
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ export { Governance } from './sdk/governance.js';
19
19
  export { Client } from './core.js';
20
20
  export { HTTPError } from './models/errors.js';
21
21
  export { ValidationError, DepthLimitExceededError } from './lib/wire.js';
22
+ export type { AcceptDateStrings, DateString } from './lib/wire.js';
22
23
  export { ServerList, Regions } from './lib/config.js';
23
24
  export type { SDKOptions, Region, ServerVariables } from './lib/config.js';
24
25
  export type { Result, RequestOptions } from './lib/types.js';
@@ -1,6 +1,10 @@
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 type DateString = string & Record<never, never>;
5
+ export type AcceptDateStrings<T> = T extends Date ? Date | DateString : T extends (infer E)[] ? AcceptDateStrings<E>[] : T extends object ? {
6
+ [K in keyof T]: AcceptDateStrings<T[K]>;
7
+ } : T;
4
8
  export declare class DepthLimitExceededError extends Error {
5
9
  constructor();
6
10
  }
package/dist/lib/wire.js CHANGED
@@ -48,27 +48,31 @@ function arrayElement(schema) {
48
48
  }
49
49
  return undefined;
50
50
  }
51
- // Whether a value schema carries renamable fields (object/record/array/union of
52
- // such), so a record value is recursed only when it is model-shaped. Scalars,
53
- // literals, unknown, and any are left untouched.
54
- function hasRenamableShape(schema) {
51
+ // Whether a record value schema needs walking: it carries renamable fields
52
+ // (object/record/array/union of such) or date-typed values that must map
53
+ // between `Date` and the RFC 3339 wire string. Other scalars, literals,
54
+ // unknown, and any are left untouched, so user data (labels, dimensions,
55
+ // event payloads) is never rewritten.
56
+ function needsWalk(schema) {
55
57
  const s = unwrap(schema);
56
58
  const d = def(s);
57
59
  /* v8 ignore next 3 -- a record always has a value schema; defensive only */
58
60
  if (!d) {
59
61
  return false;
60
62
  }
61
- if (d.type === 'object' || d.type === 'record') {
63
+ if (d.type === 'object' || d.type === 'record' || d.type === 'date') {
62
64
  return true;
63
65
  }
64
66
  if (d.type === 'array') {
65
- return hasRenamableShape(d.element);
67
+ return needsWalk(d.element);
66
68
  }
67
69
  if (d.type === 'union') {
68
- return (d.options ?? []).some(hasRenamableShape);
70
+ return (d.options ?? []).some(needsWalk);
69
71
  }
70
72
  return false;
71
73
  }
74
+ const _literalsSurviveWidening = true;
75
+ void _literalsSurviveWidening;
72
76
  // A handful of schemas are genuinely self-referential (e.g. the `and`/`or`
73
77
  // legs of a filter tree), so nesting depth is bounded only by the DATA the
74
78
  // server sends, not by the schema. Without a limit, a crafted or
@@ -88,11 +92,24 @@ function walk(data, schema, dir, depth = 0) {
88
92
  if (data === null || data === undefined) {
89
93
  return data;
90
94
  }
95
+ // A Date can only ever mean its wire serialization, wherever it sits — a
96
+ // typed date field, a record value, or an unknown-schema position. Wire→
97
+ // public data never contains Date instances (it comes from JSON.parse), so
98
+ // this only rewrites public→wire.
99
+ if (data instanceof Date) {
100
+ return dir.mapDate(data);
101
+ }
91
102
  if (depth > MAX_WALK_DEPTH) {
92
103
  throw new DepthLimitExceededError();
93
104
  }
94
105
  const s = unwrap(schema);
95
106
  const d = def(s);
107
+ // A date-typed node maps between the public `Date` and the RFC 3339 wire
108
+ // string (fromWire revives the string; a string handed to toWire by an
109
+ // untyped caller passes through as-is).
110
+ if (d?.type === 'date') {
111
+ return dir.mapDate(data);
112
+ }
96
113
  if (Array.isArray(data)) {
97
114
  // The schema may be the array itself or a union with an array variant
98
115
  // (e.g. a single-or-batch body `T | T[]`); resolve the element schema from
@@ -101,19 +118,28 @@ function walk(data, schema, dir, depth = 0) {
101
118
  return data.map((item) => walk(item, element, dir, depth + 1));
102
119
  }
103
120
  if (typeof data !== 'object') {
121
+ // A wire datetime can sit behind a union (`DateTime | null`,
122
+ // enum-or-DateTime): revive the string only when the union's date variant
123
+ // is its sole plausible owner, so enum literals and plain-string variants
124
+ // pass through untouched.
125
+ if (typeof data === 'string' &&
126
+ d?.type === 'union' &&
127
+ unionDateClaims(s, data)) {
128
+ return dir.mapDate(data);
129
+ }
104
130
  return data;
105
131
  }
106
132
  const record = data;
107
133
  if (d?.type === 'record') {
108
134
  // Record keys are user data (label/dimension names) — preserved verbatim.
109
- // Only the value is walked, and only when it is model-shaped. A null
135
+ // Only the value is walked, and only when it needs mapping. A null
110
136
  // prototype avoids the `__proto__` key silently reassigning `out`'s own
111
137
  // prototype instead of becoming a visible entry (user data may contain
112
138
  // any key, including reserved object-literal property names). The
113
139
  // prototype is restored once every key is a plain own property, so the
114
140
  // returned object still behaves normally for consumers (instanceof,
115
141
  // template literals) — `Object.prototype` itself was never touched.
116
- const valueSchema = hasRenamableShape(d.valueType) ? d.valueType : undefined;
142
+ const valueSchema = needsWalk(d.valueType) ? d.valueType : undefined;
117
143
  const out = Object.create(null);
118
144
  for (const [key, value] of Object.entries(record)) {
119
145
  out[key] = valueSchema ? walk(value, valueSchema, dir, depth + 1) : value;
@@ -206,26 +232,56 @@ function literalValue(schema) {
206
232
  /* v8 ignore next -- a discriminated-union variant's discriminator is a literal */
207
233
  return undefined;
208
234
  }
235
+ // Whether a union's date variant is the sole plausible owner of a string
236
+ // value: the union carries a date option, no string-capable sibling (a plain
237
+ // string variant, an enum containing the value, an equal string literal)
238
+ // claims it, and the value actually parses as a date. `DateTime | null`
239
+ // revives its RFC 3339 string; `'immediate' | DateTime` keeps the enum
240
+ // literal a string. Fail-open: an unclaimed string stays a string.
241
+ function unionDateClaims(schema, value) {
242
+ let hasDate = false;
243
+ for (const option of def(schema)?.options ?? []) {
244
+ const od = def(unwrap(option));
245
+ if (od?.type === 'date') {
246
+ hasDate = true;
247
+ }
248
+ else if (od?.type === 'string') {
249
+ return false;
250
+ }
251
+ else if (od?.type === 'enum' &&
252
+ Object.values(od.entries ?? {}).includes(value)) {
253
+ return false;
254
+ }
255
+ else if (od?.type === 'literal' && literalValue(option) === value) {
256
+ return false;
257
+ }
258
+ }
259
+ return hasDate && !Number.isNaN(Date.parse(value));
260
+ }
209
261
  const toWireDirection = {
210
262
  rename: toSnakeCase,
211
263
  discriminatorKey: (camelKey) => camelKey,
264
+ mapDate: (value) => (value instanceof Date ? value.toISOString() : value),
212
265
  };
213
266
  const fromWireDirection = {
214
267
  rename: toCamelCase,
215
268
  discriminatorKey: (camelKey) => toSnakeCase(camelKey),
269
+ mapDate: (value) => (typeof value === 'string' ? new Date(value) : value),
216
270
  };
217
271
  // Rewrite a request body or query object from the camelCase public shape to the
218
272
  // snake_case wire shape, driven by its schema. Record keys (label/dimension names)
219
- // are preserved. The return is typed as the input `T` so call sites stay cast-free
220
- // (the runtime object has snake keys, but the value is write-only it flows
221
- // straight into `json:`/`toURLSearchParams`, both of which accept any object).
273
+ // are preserved; `Date` values serialize to RFC 3339 strings. The return is typed
274
+ // as the input `T` so call sites stay cast-free (the runtime object has snake keys
275
+ // and wire-encoded dates, but the value is write-only — it flows straight into
276
+ // `json:`/`toURLSearchParams`, both of which accept any object).
222
277
  export function toWire(data, schema) {
223
278
  return walk(data, schema, toWireDirection);
224
279
  }
225
280
  // Rewrite a response body from the snake_case wire shape to the camelCase public
226
- // shape. Renames keys only never coerces values or applies defaults. The result
227
- // is the schema's output shape: `walk` produces exactly the schema's known fields
228
- // in camelCase, so the inferred `output<S>` type describes the runtime value (the
281
+ // shape: renames keys and revives RFC 3339 strings into `Date`s at date-typed
282
+ // nodes never applies defaults or any other coercion. The result is the
283
+ // schema's output shape: `walk` produces exactly the schema's known fields in
284
+ // camelCase, so the inferred `output<S>` type describes the runtime value (the
229
285
  // same wire-trust boundary as a plain `.json<T>()`, with no `.parse()`).
230
286
  export function fromWire(data, schema) {
231
287
  return walk(data, schema, fromWireDirection);
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { Addon, AddonPagePaginatedResponse, CreateAddonRequestInput, ListAddonsParamsFilter, SortQueryInput, UpsertAddonRequestInput } from '../types.js';
2
3
  export interface ListAddonsQuery {
3
4
  /** Determines which page of the collection to retrieve. */
@@ -21,14 +22,14 @@ export interface ListAddonsQuery {
21
22
  /** Filter add-ons returned in the response. */
22
23
  filter?: ListAddonsParamsFilter;
23
24
  }
24
- export type ListAddonsRequest = ListAddonsQuery;
25
+ export type ListAddonsRequest = AcceptDateStrings<ListAddonsQuery>;
25
26
  export type ListAddonsResponse = AddonPagePaginatedResponse;
26
- export type CreateAddonRequest = CreateAddonRequestInput;
27
+ export type CreateAddonRequest = AcceptDateStrings<CreateAddonRequestInput>;
27
28
  export type CreateAddonResponse = Addon;
28
- export type UpdateAddonRequest = {
29
+ export type UpdateAddonRequest = AcceptDateStrings<{
29
30
  addonId: string;
30
31
  body: UpsertAddonRequestInput;
31
- };
32
+ }>;
32
33
  export type UpdateAddonResponse = Addon;
33
34
  export type GetAddonRequest = {
34
35
  addonId: string;
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import * as schemas from '../schemas.js';
3
+ import type { AcceptDateStrings } from '../../lib/wire.js';
3
4
  import type { AppPagePaginatedResponse } from '../types.js';
4
5
  export interface ListAppsQuery {
5
6
  /** Determines which page of the collection to retrieve. */
@@ -8,7 +9,7 @@ export interface ListAppsQuery {
8
9
  number?: number;
9
10
  };
10
11
  }
11
- export type ListAppsRequest = ListAppsQuery;
12
+ export type ListAppsRequest = AcceptDateStrings<ListAppsQuery>;
12
13
  export type ListAppsResponse = AppPagePaginatedResponse;
13
14
  export type GetAppRequest = {
14
15
  appId: string;
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CreateBillingProfileRequestInput, Profile, ProfilePagePaginatedResponse, UpsertBillingProfileRequestInput } from '../types.js';
2
3
  export interface ListBillingProfilesQuery {
3
4
  /** Determines which page of the collection to retrieve. */
@@ -6,18 +7,18 @@ export interface ListBillingProfilesQuery {
6
7
  number?: number;
7
8
  };
8
9
  }
9
- export type ListBillingProfilesRequest = ListBillingProfilesQuery;
10
+ export type ListBillingProfilesRequest = AcceptDateStrings<ListBillingProfilesQuery>;
10
11
  export type ListBillingProfilesResponse = ProfilePagePaginatedResponse;
11
- export type CreateBillingProfileRequest = CreateBillingProfileRequestInput;
12
+ export type CreateBillingProfileRequest = AcceptDateStrings<CreateBillingProfileRequestInput>;
12
13
  export type CreateBillingProfileResponse = Profile;
13
14
  export type GetBillingProfileRequest = {
14
15
  id: string;
15
16
  };
16
17
  export type GetBillingProfileResponse = Profile;
17
- export type UpdateBillingProfileRequest = {
18
+ export type UpdateBillingProfileRequest = AcceptDateStrings<{
18
19
  id: string;
19
20
  body: UpsertBillingProfileRequestInput;
20
- };
21
+ }>;
21
22
  export type UpdateBillingProfileResponse = Profile;
22
23
  export type DeleteBillingProfileRequest = {
23
24
  id: string;
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CostBasis, CostBasisPagePaginatedResponse, CreateCostBasisRequest as CreateCostBasisRequestBody, CreateCurrencyCustomRequest, CurrencyCustom, CurrencyPagePaginatedResponse, ListCostBasesParamsFilter, ListCurrenciesParamsFilter, SortQueryInput } from '../types.js';
2
3
  export interface ListCurrenciesQuery {
3
4
  /** Determines which page of the collection to retrieve. */
@@ -22,9 +23,9 @@ export interface ListCurrenciesQuery {
22
23
  */
23
24
  filter?: ListCurrenciesParamsFilter;
24
25
  }
25
- export type ListCurrenciesRequest = ListCurrenciesQuery;
26
+ export type ListCurrenciesRequest = AcceptDateStrings<ListCurrenciesQuery>;
26
27
  export type ListCurrenciesResponse = CurrencyPagePaginatedResponse;
27
- export type CreateCustomCurrencyRequest = CreateCurrencyCustomRequest;
28
+ export type CreateCustomCurrencyRequest = AcceptDateStrings<CreateCurrencyCustomRequest>;
28
29
  export type CreateCustomCurrencyResponse = CurrencyCustom;
29
30
  export interface ListCostBasesQuery {
30
31
  /**
@@ -40,13 +41,13 @@ export interface ListCostBasesQuery {
40
41
  number?: number;
41
42
  };
42
43
  }
43
- export type ListCostBasesRequest = ListCostBasesQuery & {
44
+ export type ListCostBasesRequest = AcceptDateStrings<ListCostBasesQuery & {
44
45
  currencyId: string;
45
- };
46
+ }>;
46
47
  export type ListCostBasesResponse = CostBasisPagePaginatedResponse;
47
- export type CreateCostBasisRequest = {
48
+ export type CreateCostBasisRequest = AcceptDateStrings<{
48
49
  currencyId: string;
49
50
  body: CreateCostBasisRequestBody;
50
- };
51
+ }>;
51
52
  export type CreateCostBasisResponse = CostBasis;
52
53
  //# sourceMappingURL=currencies.d.ts.map
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import * as schemas from '../schemas.js';
3
+ import type { AcceptDateStrings } from '../../lib/wire.js';
3
4
  import type { AppCustomerData, AppStripeCreateCheckoutSessionResult, AppStripeCreateCustomerPortalSessionResult, ChargePagePaginatedResponse, CreateChargeFlatFeeRequest, CreateChargeUsageBasedRequest, 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 } from '../types.js';
4
- export type CreateCustomerRequest = CreateCustomerRequestBody;
5
+ export type CreateCustomerRequest = AcceptDateStrings<CreateCustomerRequestBody>;
5
6
  export type CreateCustomerResponse = Customer;
6
7
  export type GetCustomerRequest = {
7
8
  customerId: string;
@@ -31,12 +32,12 @@ export interface ListCustomersQuery {
31
32
  */
32
33
  filter?: ListCustomersParamsFilter;
33
34
  }
34
- export type ListCustomersRequest = ListCustomersQuery;
35
+ export type ListCustomersRequest = AcceptDateStrings<ListCustomersQuery>;
35
36
  export type ListCustomersResponse = CustomerPagePaginatedResponse;
36
- export type UpsertCustomerRequest = {
37
+ export type UpsertCustomerRequest = AcceptDateStrings<{
37
38
  customerId: string;
38
39
  body: UpsertCustomerRequestBody;
39
- };
40
+ }>;
40
41
  export type UpsertCustomerResponse = Customer;
41
42
  export type DeleteCustomerRequest = {
42
43
  customerId: string;
@@ -46,30 +47,30 @@ export type GetCustomerBillingRequest = {
46
47
  customerId: string;
47
48
  };
48
49
  export type GetCustomerBillingResponse = CustomerData;
49
- export type UpdateCustomerBillingRequest = {
50
+ export type UpdateCustomerBillingRequest = AcceptDateStrings<{
50
51
  customerId: string;
51
52
  body: UpsertCustomerBillingDataRequest;
52
- };
53
+ }>;
53
54
  export type UpdateCustomerBillingResponse = CustomerData;
54
- export type UpdateCustomerBillingAppDataRequest = {
55
+ export type UpdateCustomerBillingAppDataRequest = AcceptDateStrings<{
55
56
  customerId: string;
56
57
  body: UpsertAppCustomerDataRequest;
57
- };
58
+ }>;
58
59
  export type UpdateCustomerBillingAppDataResponse = AppCustomerData;
59
- export type CreateCustomerStripeCheckoutSessionRequest = {
60
+ export type CreateCustomerStripeCheckoutSessionRequest = AcceptDateStrings<{
60
61
  customerId: string;
61
62
  body: CustomerStripeCreateCheckoutSessionRequestInput;
62
- };
63
+ }>;
63
64
  export type CreateCustomerStripeCheckoutSessionResponse = AppStripeCreateCheckoutSessionResult;
64
- export type CreateCustomerStripePortalSessionRequest = {
65
+ export type CreateCustomerStripePortalSessionRequest = AcceptDateStrings<{
65
66
  customerId: string;
66
67
  body: CustomerStripeCreateCustomerPortalSessionRequest;
67
- };
68
+ }>;
68
69
  export type CreateCustomerStripePortalSessionResponse = AppStripeCreateCustomerPortalSessionResult;
69
- export type CreateCreditGrantRequest = {
70
+ export type CreateCreditGrantRequest = AcceptDateStrings<{
70
71
  customerId: string;
71
72
  body: CreateCreditGrantRequestInput;
72
- };
73
+ }>;
73
74
  export type CreateCreditGrantResponse = CreditGrant;
74
75
  export type GetCreditGrantRequest = {
75
76
  customerId: string;
@@ -85,9 +86,9 @@ export interface ListCreditGrantsQuery {
85
86
  /** Filter credit grants returned in the response. */
86
87
  filter?: ListCreditGrantsParamsFilter;
87
88
  }
88
- export type ListCreditGrantsRequest = ListCreditGrantsQuery & {
89
+ export type ListCreditGrantsRequest = AcceptDateStrings<ListCreditGrantsQuery & {
89
90
  customerId: string;
90
- };
91
+ }>;
91
92
  export type ListCreditGrantsResponse = CreditGrantPagePaginatedResponse;
92
93
  export interface GetCustomerCreditBalanceQuery {
93
94
  /**
@@ -95,32 +96,32 @@ export interface GetCustomerCreditBalanceQuery {
95
96
  *
96
97
  * Defaults to the current time.
97
98
  */
98
- timestamp?: string;
99
+ timestamp?: Date;
99
100
  filter?: GetCreditBalanceParamsFilter;
100
101
  }
101
- export type GetCustomerCreditBalanceRequest = GetCustomerCreditBalanceQuery & {
102
+ export type GetCustomerCreditBalanceRequest = AcceptDateStrings<GetCustomerCreditBalanceQuery & {
102
103
  customerId: string;
103
- };
104
+ }>;
104
105
  export type GetCustomerCreditBalanceResponse = CreditBalances;
105
- export type CreateCreditAdjustmentRequest = {
106
+ export type CreateCreditAdjustmentRequest = AcceptDateStrings<{
106
107
  customerId: string;
107
108
  body: CreateCreditAdjustmentRequestBody;
108
- };
109
+ }>;
109
110
  export type CreateCreditAdjustmentResponse = CreditAdjustment;
110
- export type UpdateCreditGrantExternalSettlementRequest = {
111
+ export type UpdateCreditGrantExternalSettlementRequest = AcceptDateStrings<{
111
112
  customerId: string;
112
113
  creditGrantId: string;
113
114
  body: UpdateCreditGrantExternalSettlementRequestBody;
114
- };
115
+ }>;
115
116
  export type UpdateCreditGrantExternalSettlementResponse = CreditGrant;
116
117
  export interface ListCreditTransactionsQuery {
117
118
  page?: CursorPaginationQueryPage;
118
119
  /** Filter credit transactions returned in the response. */
119
120
  filter?: ListCreditTransactionsParamsFilter;
120
121
  }
121
- export type ListCreditTransactionsRequest = ListCreditTransactionsQuery & {
122
+ export type ListCreditTransactionsRequest = AcceptDateStrings<ListCreditTransactionsQuery & {
122
123
  customerId: string;
123
- };
124
+ }>;
124
125
  export type ListCreditTransactionsResponse = CreditTransactionPaginatedResponse;
125
126
  export interface ListCustomerChargesQuery {
126
127
  /** Determines which page of the collection to retrieve. */
@@ -155,13 +156,13 @@ export interface ListCustomerChargesQuery {
155
156
  */
156
157
  expand?: 'real_time_usage'[];
157
158
  }
158
- export type ListCustomerChargesRequest = ListCustomerChargesQuery & {
159
+ export type ListCustomerChargesRequest = AcceptDateStrings<ListCustomerChargesQuery & {
159
160
  customerId: string;
160
- };
161
+ }>;
161
162
  export type ListCustomerChargesResponse = ChargePagePaginatedResponse;
162
- export type CreateCustomerChargesRequest = {
163
+ export type CreateCustomerChargesRequest = AcceptDateStrings<{
163
164
  customerId: string;
164
165
  body: CreateChargeFlatFeeRequest | CreateChargeUsageBasedRequest;
165
- };
166
+ }>;
166
167
  export type CreateCustomerChargesResponse = z.output<typeof schemas.createCustomerChargesResponse>;
167
168
  //# sourceMappingURL=customers.d.ts.map
@@ -1,6 +1,7 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { OrganizationDefaultTaxCodes, UpdateOrganizationDefaultTaxCodesRequest as UpdateOrganizationDefaultTaxCodesRequestBody } from '../types.js';
2
3
  export type GetOrganizationDefaultTaxCodesRequest = Record<string, never>;
3
4
  export type GetOrganizationDefaultTaxCodesResponse = OrganizationDefaultTaxCodes;
4
- export type UpdateOrganizationDefaultTaxCodesRequest = UpdateOrganizationDefaultTaxCodesRequestBody;
5
+ export type UpdateOrganizationDefaultTaxCodesRequest = AcceptDateStrings<UpdateOrganizationDefaultTaxCodesRequestBody>;
5
6
  export type UpdateOrganizationDefaultTaxCodesResponse = OrganizationDefaultTaxCodes;
6
7
  //# sourceMappingURL=defaults.d.ts.map
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CursorPaginationQueryPage, EventInput, IngestedEventPaginatedResponse, ListEventsParamsFilter, SortQueryInput } from '../types.js';
2
3
  export interface ListMeteringEventsQuery {
3
4
  page?: CursorPaginationQueryPage;
@@ -21,8 +22,8 @@ export interface ListMeteringEventsQuery {
21
22
  */
22
23
  sort?: SortQueryInput;
23
24
  }
24
- export type ListMeteringEventsRequest = ListMeteringEventsQuery;
25
+ export type ListMeteringEventsRequest = AcceptDateStrings<ListMeteringEventsQuery>;
25
26
  export type ListMeteringEventsResponse = IngestedEventPaginatedResponse;
26
- export type IngestMeteringEventsRequest = EventInput | EventInput[];
27
+ export type IngestMeteringEventsRequest = AcceptDateStrings<EventInput | EventInput[]>;
27
28
  export type IngestMeteringEventsResponse = void;
28
29
  //# sourceMappingURL=events.d.ts.map
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CreateFeatureRequest as CreateFeatureRequestBody, Feature, FeatureCostQueryResult, FeaturePagePaginatedResponse, ListFeatureParamsFilter, MeterQueryRequestInput, SortQueryInput, UpdateFeatureRequest as UpdateFeatureRequestBody } from '../types.js';
2
3
  export interface ListFeaturesQuery {
3
4
  /** Determines which page of the collection to retrieve. */
@@ -25,26 +26,26 @@ export interface ListFeaturesQuery {
25
26
  */
26
27
  filter?: ListFeatureParamsFilter;
27
28
  }
28
- export type ListFeaturesRequest = ListFeaturesQuery;
29
+ export type ListFeaturesRequest = AcceptDateStrings<ListFeaturesQuery>;
29
30
  export type ListFeaturesResponse = FeaturePagePaginatedResponse;
30
- export type CreateFeatureRequest = CreateFeatureRequestBody;
31
+ export type CreateFeatureRequest = AcceptDateStrings<CreateFeatureRequestBody>;
31
32
  export type CreateFeatureResponse = Feature;
32
33
  export type GetFeatureRequest = {
33
34
  featureId: string;
34
35
  };
35
36
  export type GetFeatureResponse = Feature;
36
- export type UpdateFeatureRequest = {
37
+ export type UpdateFeatureRequest = AcceptDateStrings<{
37
38
  featureId: string;
38
39
  body: UpdateFeatureRequestBody;
39
- };
40
+ }>;
40
41
  export type UpdateFeatureResponse = Feature;
41
42
  export type DeleteFeatureRequest = {
42
43
  featureId: string;
43
44
  };
44
45
  export type DeleteFeatureResponse = void;
45
- export type QueryFeatureCostRequest = {
46
+ export type QueryFeatureCostRequest = AcceptDateStrings<{
46
47
  featureId: string;
47
48
  body: MeterQueryRequestInput;
48
- };
49
+ }>;
49
50
  export type QueryFeatureCostResponse = FeatureCostQueryResult;
50
51
  //# sourceMappingURL=features.d.ts.map
@@ -1,9 +1,10 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CursorPaginationQueryPage, GovernanceQueryRequestInput, GovernanceQueryResponse } from '../types.js';
2
3
  export interface QueryGovernanceAccessQuery {
3
4
  page?: CursorPaginationQueryPage;
4
5
  }
5
- export type QueryGovernanceAccessRequest = {
6
+ export type QueryGovernanceAccessRequest = AcceptDateStrings<{
6
7
  body: GovernanceQueryRequestInput;
7
- } & QueryGovernanceAccessQuery;
8
+ } & QueryGovernanceAccessQuery>;
8
9
  export type QueryGovernanceAccessResponse = GovernanceQueryResponse;
9
10
  //# sourceMappingURL=governance.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import * as schemas from '../schemas.js';
3
+ import type { AcceptDateStrings } from '../../lib/wire.js';
3
4
  import type { InvoicePagePaginatedResponse, ListInvoicesParamsFilter, SortQueryInput, UpdateInvoiceStandardRequestInput } from '../types.js';
4
5
  export interface ListInvoicesQuery {
5
6
  /** Determines which page of the collection to retrieve. */
@@ -29,16 +30,16 @@ export interface ListInvoicesQuery {
29
30
  */
30
31
  filter?: ListInvoicesParamsFilter;
31
32
  }
32
- export type ListInvoicesRequest = ListInvoicesQuery;
33
+ export type ListInvoicesRequest = AcceptDateStrings<ListInvoicesQuery>;
33
34
  export type ListInvoicesResponse = InvoicePagePaginatedResponse;
34
35
  export type GetInvoiceRequest = {
35
36
  invoiceId: string;
36
37
  };
37
38
  export type GetInvoiceResponse = z.output<typeof schemas.getInvoiceResponse>;
38
- export type UpdateInvoiceRequest = {
39
+ export type UpdateInvoiceRequest = AcceptDateStrings<{
39
40
  invoiceId: string;
40
41
  body: UpdateInvoiceStandardRequestInput;
41
- };
42
+ }>;
42
43
  export type UpdateInvoiceResponse = z.output<typeof schemas.updateInvoiceResponse>;
43
44
  export type DeleteInvoiceRequest = {
44
45
  invoiceId: string;
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { ListLlmCostPricesParamsFilter, LlmCostOverrideCreate, LlmCostPrice, PricePagePaginatedResponse, SortQueryInput } from '../types.js';
2
3
  export interface ListLlmCostPricesQuery {
3
4
  /** Filter prices. */
@@ -21,7 +22,7 @@ export interface ListLlmCostPricesQuery {
21
22
  number?: number;
22
23
  };
23
24
  }
24
- export type ListLlmCostPricesRequest = ListLlmCostPricesQuery;
25
+ export type ListLlmCostPricesRequest = AcceptDateStrings<ListLlmCostPricesQuery>;
25
26
  export type ListLlmCostPricesResponse = PricePagePaginatedResponse;
26
27
  export type GetLlmCostPriceRequest = {
27
28
  priceId: string;
@@ -35,9 +36,9 @@ export interface ListLlmCostOverridesQuery {
35
36
  number?: number;
36
37
  };
37
38
  }
38
- export type ListLlmCostOverridesRequest = ListLlmCostOverridesQuery;
39
+ export type ListLlmCostOverridesRequest = AcceptDateStrings<ListLlmCostOverridesQuery>;
39
40
  export type ListLlmCostOverridesResponse = PricePagePaginatedResponse;
40
- export type CreateLlmCostOverrideRequest = LlmCostOverrideCreate;
41
+ export type CreateLlmCostOverrideRequest = AcceptDateStrings<LlmCostOverrideCreate>;
41
42
  export type CreateLlmCostOverrideResponse = LlmCostPrice;
42
43
  export type DeleteLlmCostOverrideRequest = {
43
44
  priceId: string;
@@ -1,5 +1,6 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CreateMeterRequest as CreateMeterRequestBody, ListMetersParamsFilter, Meter, MeterPagePaginatedResponse, MeterQueryRequestInput, MeterQueryResult, SortQueryInput, UpdateMeterRequest as UpdateMeterRequestBody } from '../types.js';
2
- export type CreateMeterRequest = CreateMeterRequestBody;
3
+ export type CreateMeterRequest = AcceptDateStrings<CreateMeterRequestBody>;
3
4
  export type CreateMeterResponse = Meter;
4
5
  export type GetMeterRequest = {
5
6
  meterId: string;
@@ -31,25 +32,25 @@ export interface ListMetersQuery {
31
32
  */
32
33
  filter?: ListMetersParamsFilter;
33
34
  }
34
- export type ListMetersRequest = ListMetersQuery;
35
+ export type ListMetersRequest = AcceptDateStrings<ListMetersQuery>;
35
36
  export type ListMetersResponse = MeterPagePaginatedResponse;
36
- export type UpdateMeterRequest = {
37
+ export type UpdateMeterRequest = AcceptDateStrings<{
37
38
  meterId: string;
38
39
  body: UpdateMeterRequestBody;
39
- };
40
+ }>;
40
41
  export type UpdateMeterResponse = Meter;
41
42
  export type DeleteMeterRequest = {
42
43
  meterId: string;
43
44
  };
44
45
  export type DeleteMeterResponse = void;
45
- export type QueryMeterRequest = {
46
+ export type QueryMeterRequest = AcceptDateStrings<{
46
47
  meterId: string;
47
48
  body: MeterQueryRequestInput;
48
- };
49
+ }>;
49
50
  export type QueryMeterResponse = MeterQueryResult;
50
- export type QueryMeterCsvRequest = {
51
+ export type QueryMeterCsvRequest = AcceptDateStrings<{
51
52
  meterId: string;
52
53
  body: MeterQueryRequestInput;
53
- };
54
+ }>;
54
55
  export type QueryMeterCsvResponse = string;
55
56
  //# sourceMappingURL=meters.d.ts.map
@@ -1,3 +1,4 @@
1
+ import type { AcceptDateStrings } from '../../lib/wire.js';
1
2
  import type { CreatePlanAddonRequest as CreatePlanAddonRequestBody, PlanAddon, PlanAddonPagePaginatedResponse, UpsertPlanAddonRequest } from '../types.js';
2
3
  export interface ListPlanAddonsQuery {
3
4
  /** Determines which page of the collection to retrieve. */
@@ -6,25 +7,25 @@ export interface ListPlanAddonsQuery {
6
7
  number?: number;
7
8
  };
8
9
  }
9
- export type ListPlanAddonsRequest = ListPlanAddonsQuery & {
10
+ export type ListPlanAddonsRequest = AcceptDateStrings<ListPlanAddonsQuery & {
10
11
  planId: string;
11
- };
12
+ }>;
12
13
  export type ListPlanAddonsResponse = PlanAddonPagePaginatedResponse;
13
- export type CreatePlanAddonRequest = {
14
+ export type CreatePlanAddonRequest = AcceptDateStrings<{
14
15
  planId: string;
15
16
  body: CreatePlanAddonRequestBody;
16
- };
17
+ }>;
17
18
  export type CreatePlanAddonResponse = PlanAddon;
18
19
  export type GetPlanAddonRequest = {
19
20
  planId: string;
20
21
  planAddonId: string;
21
22
  };
22
23
  export type GetPlanAddonResponse = PlanAddon;
23
- export type UpdatePlanAddonRequest = {
24
+ export type UpdatePlanAddonRequest = AcceptDateStrings<{
24
25
  planId: string;
25
26
  planAddonId: string;
26
27
  body: UpsertPlanAddonRequest;
27
- };
28
+ }>;
28
29
  export type UpdatePlanAddonResponse = PlanAddon;
29
30
  export type DeletePlanAddonRequest = {
30
31
  planId: string;