@openmeter/client 1.0.0-beta-106e6d4e7951 → 1.0.0-beta-0bf476acf4b6

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/dist/core.js CHANGED
@@ -22,10 +22,13 @@ export class Client {
22
22
  beforeRequest: [
23
23
  ...(options.hooks?.beforeRequest ?? []),
24
24
  async ({ request }) => {
25
- // Browsers treat User-Agent as a forbidden header and silently drop
26
- // it; that's fine here, this is only observable server-side (e.g.
27
- // request logs) and Node/server callers get it.
28
- if (!request.headers.has('User-Agent')) {
25
+ // User-Agent is settable on the web but is not CORS-safelisted, so
26
+ // setting it would preflight otherwise-simple cross-origin requests.
27
+ // Gate on a positive Node check, not `window`: workers are also
28
+ // CORS-bound yet have no `window`.
29
+ if (typeof process !== 'undefined' &&
30
+ process.versions?.node != null &&
31
+ !request.headers.has('User-Agent')) {
29
32
  request.headers.set('User-Agent', `openmeter-node/${SDK_VERSION}`);
30
33
  }
31
34
  const token = typeof options.apiKey === 'function'
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.0-beta-106e6d4e7951";
1
+ export declare const SDK_VERSION = "1.0.0-beta-0bf476acf4b6";
@@ -2,4 +2,4 @@
2
2
  // The committed value is a dev placeholder. The publish flow
3
3
  // (`make -C api/spec publish-aip-sdk`) stamps the real release version here
4
4
  // before `pnpm publish`, after `pnpm version` updates package.json.
5
- export const SDK_VERSION = '1.0.0-beta-106e6d4e7951';
5
+ export const SDK_VERSION = '1.0.0-beta-0bf476acf4b6';
@@ -33,8 +33,8 @@ export declare const ingestedEventValidationError: z.ZodObject<{
33
33
  export declare const cursorMetaPage: z.ZodObject<{
34
34
  first: z.ZodOptional<z.ZodString>;
35
35
  last: z.ZodOptional<z.ZodString>;
36
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
37
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
36
+ next: z.ZodNullable<z.ZodString>;
37
+ previous: z.ZodNullable<z.ZodString>;
38
38
  size: z.ZodNumber;
39
39
  }, z.core.$strip>;
40
40
  export declare const invalidRules: z.ZodEnum<{
@@ -788,11 +788,11 @@ export declare const event: z.ZodObject<{
788
788
  source: z.ZodString;
789
789
  specversion: z.ZodDefault<z.ZodString>;
790
790
  type: z.ZodString;
791
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
792
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
791
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
792
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
793
793
  subject: z.ZodString;
794
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNull]>>;
795
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
794
+ time: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
795
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
796
796
  }, z.core.$strip>;
797
797
  export declare const meterQueryRow: z.ZodObject<{
798
798
  value: z.ZodString;
@@ -839,7 +839,7 @@ export declare const createCostBasisRequest: z.ZodObject<{
839
839
  }, z.core.$strip>;
840
840
  export declare const featureCostQueryRow: z.ZodObject<{
841
841
  usage: z.ZodString;
842
- cost: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
842
+ cost: z.ZodNullable<z.ZodString>;
843
843
  currency: z.ZodString;
844
844
  detail: z.ZodOptional<z.ZodString>;
845
845
  from: z.ZodDate;
@@ -874,8 +874,8 @@ export declare const cursorMeta: z.ZodObject<{
874
874
  page: z.ZodObject<{
875
875
  first: z.ZodOptional<z.ZodString>;
876
876
  last: z.ZodOptional<z.ZodString>;
877
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
878
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
877
+ next: z.ZodNullable<z.ZodString>;
878
+ previous: z.ZodNullable<z.ZodString>;
879
879
  size: z.ZodNumber;
880
880
  }, z.core.$strip>;
881
881
  }, z.core.$strip>;
@@ -2294,11 +2294,11 @@ export declare const ingestedEvent: z.ZodObject<{
2294
2294
  source: z.ZodString;
2295
2295
  specversion: z.ZodDefault<z.ZodString>;
2296
2296
  type: z.ZodString;
2297
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
2298
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
2297
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
2298
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2299
2299
  subject: z.ZodString;
2300
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNull]>>;
2301
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
2300
+ time: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2301
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
2302
2302
  }, z.core.$strip>;
2303
2303
  customer: z.ZodOptional<z.ZodObject<{
2304
2304
  id: z.ZodString;
@@ -2326,7 +2326,7 @@ export declare const featureCostQueryResult: z.ZodObject<{
2326
2326
  to: z.ZodOptional<z.ZodDate>;
2327
2327
  data: z.ZodArray<z.ZodObject<{
2328
2328
  usage: z.ZodString;
2329
- cost: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
2329
+ cost: z.ZodNullable<z.ZodString>;
2330
2330
  currency: z.ZodString;
2331
2331
  detail: z.ZodOptional<z.ZodString>;
2332
2332
  from: z.ZodDate;
@@ -3072,8 +3072,8 @@ export declare const creditTransactionPaginatedResponse: z.ZodObject<{
3072
3072
  page: z.ZodObject<{
3073
3073
  first: z.ZodOptional<z.ZodString>;
3074
3074
  last: z.ZodOptional<z.ZodString>;
3075
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
3076
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
3075
+ next: z.ZodNullable<z.ZodString>;
3076
+ previous: z.ZodNullable<z.ZodString>;
3077
3077
  size: z.ZodNumber;
3078
3078
  }, z.core.$strip>;
3079
3079
  }, z.core.$strip>;
@@ -3402,11 +3402,11 @@ export declare const ingestedEventPaginatedResponse: z.ZodObject<{
3402
3402
  source: z.ZodString;
3403
3403
  specversion: z.ZodDefault<z.ZodString>;
3404
3404
  type: z.ZodString;
3405
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
3406
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
3405
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
3406
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3407
3407
  subject: z.ZodString;
3408
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNull]>>;
3409
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
3408
+ time: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3409
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
3410
3410
  }, z.core.$strip>;
3411
3411
  customer: z.ZodOptional<z.ZodObject<{
3412
3412
  id: z.ZodString;
@@ -3423,8 +3423,8 @@ export declare const ingestedEventPaginatedResponse: z.ZodObject<{
3423
3423
  page: z.ZodObject<{
3424
3424
  first: z.ZodOptional<z.ZodString>;
3425
3425
  last: z.ZodOptional<z.ZodString>;
3426
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
3427
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
3426
+ next: z.ZodNullable<z.ZodString>;
3427
+ previous: z.ZodNullable<z.ZodString>;
3428
3428
  size: z.ZodNumber;
3429
3429
  }, z.core.$strip>;
3430
3430
  }, z.core.$strip>;
@@ -4301,7 +4301,7 @@ export declare const createFeatureRequest: z.ZodObject<{
4301
4301
  }, z.core.$strip>], "type">>;
4302
4302
  }, z.core.$strip>;
4303
4303
  export declare const updateFeatureRequest: z.ZodObject<{
4304
- unitCost: z.ZodOptional<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
4304
+ unitCost: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
4305
4305
  type: z.ZodLiteral<"manual">;
4306
4306
  amount: z.ZodString;
4307
4307
  }, z.core.$strip>, z.ZodObject<{
@@ -4327,7 +4327,7 @@ export declare const updateFeatureRequest: z.ZodObject<{
4327
4327
  reasoningPerToken: z.ZodOptional<z.ZodString>;
4328
4328
  cacheWritePerToken: z.ZodOptional<z.ZodString>;
4329
4329
  }, z.core.$strip>>;
4330
- }, z.core.$strip>], "type">, z.ZodNull]>>;
4330
+ }, z.core.$strip>], "type">>>;
4331
4331
  }, z.core.$strip>;
4332
4332
  export declare const creditGrantPagePaginatedResponse: z.ZodObject<{
4333
4333
  data: z.ZodArray<z.ZodObject<{
@@ -4814,8 +4814,8 @@ export declare const governanceQueryResponse: z.ZodObject<{
4814
4814
  page: z.ZodObject<{
4815
4815
  first: z.ZodOptional<z.ZodString>;
4816
4816
  last: z.ZodOptional<z.ZodString>;
4817
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
4818
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
4817
+ next: z.ZodNullable<z.ZodString>;
4818
+ previous: z.ZodNullable<z.ZodString>;
4819
4819
  size: z.ZodNumber;
4820
4820
  }, z.core.$strip>;
4821
4821
  }, z.core.$strip>;
@@ -10588,11 +10588,11 @@ export declare const listMeteringEventsResponse: z.ZodObject<{
10588
10588
  source: z.ZodString;
10589
10589
  specversion: z.ZodDefault<z.ZodString>;
10590
10590
  type: z.ZodString;
10591
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
10592
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
10591
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
10592
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10593
10593
  subject: z.ZodString;
10594
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNull]>>;
10595
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
10594
+ time: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
10595
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
10596
10596
  }, z.core.$strip>;
10597
10597
  customer: z.ZodOptional<z.ZodObject<{
10598
10598
  id: z.ZodString;
@@ -10609,8 +10609,8 @@ export declare const listMeteringEventsResponse: z.ZodObject<{
10609
10609
  page: z.ZodObject<{
10610
10610
  first: z.ZodOptional<z.ZodString>;
10611
10611
  last: z.ZodOptional<z.ZodString>;
10612
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
10613
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
10612
+ next: z.ZodNullable<z.ZodString>;
10613
+ previous: z.ZodNullable<z.ZodString>;
10614
10614
  size: z.ZodNumber;
10615
10615
  }, z.core.$strip>;
10616
10616
  }, z.core.$strip>;
@@ -10620,21 +10620,21 @@ export declare const ingestMeteringEventsBody: z.ZodUnion<readonly [z.ZodObject<
10620
10620
  source: z.ZodString;
10621
10621
  specversion: z.ZodDefault<z.ZodString>;
10622
10622
  type: z.ZodString;
10623
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
10624
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
10623
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
10624
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10625
10625
  subject: z.ZodString;
10626
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNull]>>;
10627
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
10626
+ time: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
10627
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
10628
10628
  }, z.core.$strip>, z.ZodArray<z.ZodObject<{
10629
10629
  id: z.ZodString;
10630
10630
  source: z.ZodString;
10631
10631
  specversion: z.ZodDefault<z.ZodString>;
10632
10632
  type: z.ZodString;
10633
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
10634
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
10633
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
10634
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10635
10635
  subject: z.ZodString;
10636
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNull]>>;
10637
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
10636
+ time: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
10637
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
10638
10638
  }, z.core.$strip>>]>;
10639
10639
  export declare const createMeterBody: z.ZodObject<{
10640
10640
  name: z.ZodString;
@@ -11796,8 +11796,8 @@ export declare const listCreditTransactionsResponse: z.ZodObject<{
11796
11796
  page: z.ZodObject<{
11797
11797
  first: z.ZodOptional<z.ZodString>;
11798
11798
  last: z.ZodOptional<z.ZodString>;
11799
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
11800
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
11799
+ next: z.ZodNullable<z.ZodString>;
11800
+ previous: z.ZodNullable<z.ZodString>;
11801
11801
  size: z.ZodNumber;
11802
11802
  }, z.core.$strip>;
11803
11803
  }, z.core.$strip>;
@@ -17363,7 +17363,7 @@ export declare const updateFeaturePathParams: z.ZodObject<{
17363
17363
  featureId: z.ZodString;
17364
17364
  }, z.core.$strip>;
17365
17365
  export declare const updateFeatureBody: z.ZodObject<{
17366
- unitCost: z.ZodOptional<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
17366
+ unitCost: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
17367
17367
  type: z.ZodLiteral<"manual">;
17368
17368
  amount: z.ZodString;
17369
17369
  }, z.core.$strip>, z.ZodObject<{
@@ -17389,7 +17389,7 @@ export declare const updateFeatureBody: z.ZodObject<{
17389
17389
  reasoningPerToken: z.ZodOptional<z.ZodString>;
17390
17390
  cacheWritePerToken: z.ZodOptional<z.ZodString>;
17391
17391
  }, z.core.$strip>>;
17392
- }, z.core.$strip>], "type">, z.ZodNull]>>;
17392
+ }, z.core.$strip>], "type">>>;
17393
17393
  }, z.core.$strip>;
17394
17394
  export declare const updateFeatureResponse: z.ZodObject<{
17395
17395
  id: z.ZodString;
@@ -17509,7 +17509,7 @@ export declare const queryFeatureCostResponse: z.ZodObject<{
17509
17509
  to: z.ZodOptional<z.ZodDate>;
17510
17510
  data: z.ZodArray<z.ZodObject<{
17511
17511
  usage: z.ZodString;
17512
- cost: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
17512
+ cost: z.ZodNullable<z.ZodString>;
17513
17513
  currency: z.ZodString;
17514
17514
  detail: z.ZodOptional<z.ZodString>;
17515
17515
  from: z.ZodDate;
@@ -20060,8 +20060,8 @@ export declare const queryGovernanceAccessResponse: z.ZodObject<{
20060
20060
  page: z.ZodObject<{
20061
20061
  first: z.ZodOptional<z.ZodString>;
20062
20062
  last: z.ZodOptional<z.ZodString>;
20063
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
20064
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
20063
+ next: z.ZodNullable<z.ZodString>;
20064
+ previous: z.ZodNullable<z.ZodString>;
20065
20065
  size: z.ZodNumber;
20066
20066
  }, z.core.$strip>;
20067
20067
  }, z.core.$strip>;
@@ -20100,8 +20100,8 @@ export declare const ingestedEventValidationErrorWire: z.ZodObject<{
20100
20100
  export declare const cursorMetaPageWire: z.ZodObject<{
20101
20101
  first: z.ZodOptional<z.ZodString>;
20102
20102
  last: z.ZodOptional<z.ZodString>;
20103
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
20104
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
20103
+ next: z.ZodNullable<z.ZodString>;
20104
+ previous: z.ZodNullable<z.ZodString>;
20105
20105
  size: z.ZodNumber;
20106
20106
  }, z.core.$strict>;
20107
20107
  export declare const invalidRulesWire: z.ZodEnum<{
@@ -20855,11 +20855,11 @@ export declare const eventWire: z.ZodObject<{
20855
20855
  source: z.ZodString;
20856
20856
  specversion: z.ZodString;
20857
20857
  type: z.ZodString;
20858
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
20859
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
20858
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
20859
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20860
20860
  subject: z.ZodString;
20861
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
20862
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
20861
+ time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20862
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
20863
20863
  }, z.core.$strict>;
20864
20864
  export declare const meterQueryRowWire: z.ZodObject<{
20865
20865
  value: z.ZodString;
@@ -20906,7 +20906,7 @@ export declare const createCostBasisRequestWire: z.ZodObject<{
20906
20906
  }, z.core.$strict>;
20907
20907
  export declare const featureCostQueryRowWire: z.ZodObject<{
20908
20908
  usage: z.ZodString;
20909
- cost: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
20909
+ cost: z.ZodNullable<z.ZodString>;
20910
20910
  currency: z.ZodString;
20911
20911
  detail: z.ZodOptional<z.ZodString>;
20912
20912
  from: z.ZodString;
@@ -20941,8 +20941,8 @@ export declare const cursorMetaWire: z.ZodObject<{
20941
20941
  page: z.ZodObject<{
20942
20942
  first: z.ZodOptional<z.ZodString>;
20943
20943
  last: z.ZodOptional<z.ZodString>;
20944
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
20945
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
20944
+ next: z.ZodNullable<z.ZodString>;
20945
+ previous: z.ZodNullable<z.ZodString>;
20946
20946
  size: z.ZodNumber;
20947
20947
  }, z.core.$strict>;
20948
20948
  }, z.core.$strict>;
@@ -22361,11 +22361,11 @@ export declare const ingestedEventWire: z.ZodObject<{
22361
22361
  source: z.ZodString;
22362
22362
  specversion: z.ZodString;
22363
22363
  type: z.ZodString;
22364
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
22365
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
22364
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
22365
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22366
22366
  subject: z.ZodString;
22367
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
22368
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
22367
+ time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22368
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
22369
22369
  }, z.core.$strict>;
22370
22370
  customer: z.ZodOptional<z.ZodObject<{
22371
22371
  id: z.ZodString;
@@ -22393,7 +22393,7 @@ export declare const featureCostQueryResultWire: z.ZodObject<{
22393
22393
  to: z.ZodOptional<z.ZodString>;
22394
22394
  data: z.ZodArray<z.ZodObject<{
22395
22395
  usage: z.ZodString;
22396
- cost: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
22396
+ cost: z.ZodNullable<z.ZodString>;
22397
22397
  currency: z.ZodString;
22398
22398
  detail: z.ZodOptional<z.ZodString>;
22399
22399
  from: z.ZodString;
@@ -23139,8 +23139,8 @@ export declare const creditTransactionPaginatedResponseWire: z.ZodObject<{
23139
23139
  page: z.ZodObject<{
23140
23140
  first: z.ZodOptional<z.ZodString>;
23141
23141
  last: z.ZodOptional<z.ZodString>;
23142
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
23143
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
23142
+ next: z.ZodNullable<z.ZodString>;
23143
+ previous: z.ZodNullable<z.ZodString>;
23144
23144
  size: z.ZodNumber;
23145
23145
  }, z.core.$strict>;
23146
23146
  }, z.core.$strict>;
@@ -23469,11 +23469,11 @@ export declare const ingestedEventPaginatedResponseWire: z.ZodObject<{
23469
23469
  source: z.ZodString;
23470
23470
  specversion: z.ZodString;
23471
23471
  type: z.ZodString;
23472
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
23473
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
23472
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
23473
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23474
23474
  subject: z.ZodString;
23475
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
23476
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
23475
+ time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23476
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
23477
23477
  }, z.core.$strict>;
23478
23478
  customer: z.ZodOptional<z.ZodObject<{
23479
23479
  id: z.ZodString;
@@ -23490,8 +23490,8 @@ export declare const ingestedEventPaginatedResponseWire: z.ZodObject<{
23490
23490
  page: z.ZodObject<{
23491
23491
  first: z.ZodOptional<z.ZodString>;
23492
23492
  last: z.ZodOptional<z.ZodString>;
23493
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
23494
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
23493
+ next: z.ZodNullable<z.ZodString>;
23494
+ previous: z.ZodNullable<z.ZodString>;
23495
23495
  size: z.ZodNumber;
23496
23496
  }, z.core.$strict>;
23497
23497
  }, z.core.$strict>;
@@ -24368,7 +24368,7 @@ export declare const createFeatureRequestWire: z.ZodObject<{
24368
24368
  }, z.core.$strict>], "type">>;
24369
24369
  }, z.core.$strict>;
24370
24370
  export declare const updateFeatureRequestWire: z.ZodObject<{
24371
- unit_cost: z.ZodOptional<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
24371
+ unit_cost: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
24372
24372
  type: z.ZodLiteral<"manual">;
24373
24373
  amount: z.ZodString;
24374
24374
  }, z.core.$strict>, z.ZodObject<{
@@ -24394,7 +24394,7 @@ export declare const updateFeatureRequestWire: z.ZodObject<{
24394
24394
  reasoning_per_token: z.ZodOptional<z.ZodString>;
24395
24395
  cache_write_per_token: z.ZodOptional<z.ZodString>;
24396
24396
  }, z.core.$strict>>;
24397
- }, z.core.$strict>], "type">, z.ZodNull]>>;
24397
+ }, z.core.$strict>], "type">>>;
24398
24398
  }, z.core.$strict>;
24399
24399
  export declare const creditGrantPagePaginatedResponseWire: z.ZodObject<{
24400
24400
  data: z.ZodArray<z.ZodObject<{
@@ -24881,8 +24881,8 @@ export declare const governanceQueryResponseWire: z.ZodObject<{
24881
24881
  page: z.ZodObject<{
24882
24882
  first: z.ZodOptional<z.ZodString>;
24883
24883
  last: z.ZodOptional<z.ZodString>;
24884
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
24885
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
24884
+ next: z.ZodNullable<z.ZodString>;
24885
+ previous: z.ZodNullable<z.ZodString>;
24886
24886
  size: z.ZodNumber;
24887
24887
  }, z.core.$strict>;
24888
24888
  }, z.core.$strict>;
@@ -30652,11 +30652,11 @@ export declare const listMeteringEventsResponseWire: z.ZodObject<{
30652
30652
  source: z.ZodString;
30653
30653
  specversion: z.ZodString;
30654
30654
  type: z.ZodString;
30655
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
30656
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
30655
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
30656
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30657
30657
  subject: z.ZodString;
30658
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
30659
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
30658
+ time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30659
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
30660
30660
  }, z.core.$strict>;
30661
30661
  customer: z.ZodOptional<z.ZodObject<{
30662
30662
  id: z.ZodString;
@@ -30673,8 +30673,8 @@ export declare const listMeteringEventsResponseWire: z.ZodObject<{
30673
30673
  page: z.ZodObject<{
30674
30674
  first: z.ZodOptional<z.ZodString>;
30675
30675
  last: z.ZodOptional<z.ZodString>;
30676
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
30677
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
30676
+ next: z.ZodNullable<z.ZodString>;
30677
+ previous: z.ZodNullable<z.ZodString>;
30678
30678
  size: z.ZodNumber;
30679
30679
  }, z.core.$strict>;
30680
30680
  }, z.core.$strict>;
@@ -30684,21 +30684,21 @@ export declare const ingestMeteringEventsBodyWire: z.ZodUnion<readonly [z.ZodObj
30684
30684
  source: z.ZodString;
30685
30685
  specversion: z.ZodString;
30686
30686
  type: z.ZodString;
30687
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
30688
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
30687
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
30688
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30689
30689
  subject: z.ZodString;
30690
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
30691
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
30690
+ time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30691
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
30692
30692
  }, z.core.$strict>, z.ZodArray<z.ZodObject<{
30693
30693
  id: z.ZodString;
30694
30694
  source: z.ZodString;
30695
30695
  specversion: z.ZodString;
30696
30696
  type: z.ZodString;
30697
- datacontenttype: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"application/json">, z.ZodNull]>>;
30698
- dataschema: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
30697
+ datacontenttype: z.ZodOptional<z.ZodNullable<z.ZodLiteral<"application/json">>>;
30698
+ dataschema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30699
30699
  subject: z.ZodString;
30700
- time: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
30701
- data: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
30700
+ time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30701
+ data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
30702
30702
  }, z.core.$strict>>]>;
30703
30703
  export declare const createMeterBodyWire: z.ZodObject<{
30704
30704
  name: z.ZodString;
@@ -31854,8 +31854,8 @@ export declare const listCreditTransactionsResponseWire: z.ZodObject<{
31854
31854
  page: z.ZodObject<{
31855
31855
  first: z.ZodOptional<z.ZodString>;
31856
31856
  last: z.ZodOptional<z.ZodString>;
31857
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
31858
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
31857
+ next: z.ZodNullable<z.ZodString>;
31858
+ previous: z.ZodNullable<z.ZodString>;
31859
31859
  size: z.ZodNumber;
31860
31860
  }, z.core.$strict>;
31861
31861
  }, z.core.$strict>;
@@ -37403,7 +37403,7 @@ export declare const updateFeaturePathParamsWire: z.ZodObject<{
37403
37403
  featureId: z.ZodString;
37404
37404
  }, z.core.$strip>;
37405
37405
  export declare const updateFeatureBodyWire: z.ZodObject<{
37406
- unit_cost: z.ZodOptional<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
37406
+ unit_cost: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
37407
37407
  type: z.ZodLiteral<"manual">;
37408
37408
  amount: z.ZodString;
37409
37409
  }, z.core.$strict>, z.ZodObject<{
@@ -37429,7 +37429,7 @@ export declare const updateFeatureBodyWire: z.ZodObject<{
37429
37429
  reasoning_per_token: z.ZodOptional<z.ZodString>;
37430
37430
  cache_write_per_token: z.ZodOptional<z.ZodString>;
37431
37431
  }, z.core.$strict>>;
37432
- }, z.core.$strict>], "type">, z.ZodNull]>>;
37432
+ }, z.core.$strict>], "type">>>;
37433
37433
  }, z.core.$strict>;
37434
37434
  export declare const updateFeatureResponseWire: z.ZodObject<{
37435
37435
  id: z.ZodString;
@@ -37549,7 +37549,7 @@ export declare const queryFeatureCostResponseWire: z.ZodObject<{
37549
37549
  to: z.ZodOptional<z.ZodString>;
37550
37550
  data: z.ZodArray<z.ZodObject<{
37551
37551
  usage: z.ZodString;
37552
- cost: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
37552
+ cost: z.ZodNullable<z.ZodString>;
37553
37553
  currency: z.ZodString;
37554
37554
  detail: z.ZodOptional<z.ZodString>;
37555
37555
  from: z.ZodString;
@@ -40091,8 +40091,8 @@ export declare const queryGovernanceAccessResponseWire: z.ZodObject<{
40091
40091
  page: z.ZodObject<{
40092
40092
  first: z.ZodOptional<z.ZodString>;
40093
40093
  last: z.ZodOptional<z.ZodString>;
40094
- next: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
40095
- previous: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
40094
+ next: z.ZodNullable<z.ZodString>;
40095
+ previous: z.ZodNullable<z.ZodString>;
40096
40096
  size: z.ZodNumber;
40097
40097
  }, z.core.$strict>;
40098
40098
  }, z.core.$strict>;
@@ -110,10 +110,8 @@ export const cursorMetaPage = z
110
110
  .object({
111
111
  first: z.string().optional().describe('URI to the first page.'),
112
112
  last: z.string().optional().describe('URI to the last page.'),
113
- next: z.union([z.string(), z.null()]).describe('URI to the next page.'),
114
- previous: z
115
- .union([z.string(), z.null()])
116
- .describe('URI to the previous page.'),
113
+ next: z.string().nullable().describe('URI to the next page.'),
114
+ previous: z.string().nullable().describe('URI to the previous page.'),
117
115
  size: z.number().int().describe('Requested page size.'),
118
116
  })
119
117
  .describe('Cursor pagination metadata.');
@@ -1317,23 +1315,26 @@ export const event = z
1317
1315
  .min(1)
1318
1316
  .describe('Contains a value describing the type of event related to the originating occurrence.'),
1319
1317
  datacontenttype: z
1320
- .union([z.literal('application/json'), z.null()])
1318
+ .literal('application/json')
1319
+ .nullable()
1321
1320
  .optional()
1322
1321
  .describe('Content type of the CloudEvents data value. Only the value "application/json" is allowed over HTTP.'),
1323
1322
  dataschema: z
1324
- .union([z.string(), z.null()])
1323
+ .string()
1324
+ .nullable()
1325
1325
  .optional()
1326
1326
  .describe('Identifies the schema that data adheres to.'),
1327
1327
  subject: z
1328
1328
  .string()
1329
1329
  .min(1)
1330
1330
  .describe('Describes the subject of the event in the context of the event producer (identified by source).'),
1331
- time: z
1332
- .union([dateTime, z.null()])
1331
+ time: dateTime
1332
+ .nullable()
1333
1333
  .optional()
1334
1334
  .describe('Timestamp of when the occurrence happened. Must adhere to RFC 3339.'),
1335
1335
  data: z
1336
- .union([z.record(z.string(), z.unknown()), z.null()])
1336
+ .record(z.string(), z.unknown())
1337
+ .nullable()
1337
1338
  .optional()
1338
1339
  .describe('The event payload. Optional, if present it must be a JSON object.'),
1339
1340
  })
@@ -1416,8 +1417,8 @@ export const createCostBasisRequest = z
1416
1417
  export const featureCostQueryRow = z
1417
1418
  .object({
1418
1419
  usage: numeric,
1419
- cost: z
1420
- .union([numeric, z.null()])
1420
+ cost: numeric
1421
+ .nullable()
1421
1422
  .describe('The computed cost amount (usage × unit cost). Null when pricing is not available for the given combination of dimensions.'),
1422
1423
  currency: currencyCode,
1423
1424
  detail: z
@@ -3539,8 +3540,8 @@ export const createFeatureRequest = z
3539
3540
  .describe('Feature create request.');
3540
3541
  export const updateFeatureRequest = z
3541
3542
  .object({
3542
- unitCost: z
3543
- .union([featureUnitCost, z.null()])
3543
+ unitCost: featureUnitCost
3544
+ .nullable()
3544
3545
  .optional()
3545
3546
  .describe('Optional per-unit cost configuration. Use "manual" for a fixed per-unit cost, or "llm" to look up cost from the LLM cost database based on meter group-by properties. Set to `null` to clear the existing unit cost; omit to leave it unchanged.'),
3546
3547
  })
@@ -5099,10 +5100,8 @@ export const cursorMetaPageWire = z
5099
5100
  .strictObject({
5100
5101
  first: z.string().optional().describe('URI to the first page.'),
5101
5102
  last: z.string().optional().describe('URI to the last page.'),
5102
- next: z.union([z.string(), z.null()]).describe('URI to the next page.'),
5103
- previous: z
5104
- .union([z.string(), z.null()])
5105
- .describe('URI to the previous page.'),
5103
+ next: z.string().nullable().describe('URI to the next page.'),
5104
+ previous: z.string().nullable().describe('URI to the previous page.'),
5106
5105
  size: z.number().int().describe('Requested page size.'),
5107
5106
  })
5108
5107
  .describe('Cursor pagination metadata.');
@@ -6298,23 +6297,26 @@ export const eventWire = z
6298
6297
  .min(1)
6299
6298
  .describe('Contains a value describing the type of event related to the originating occurrence.'),
6300
6299
  datacontenttype: z
6301
- .union([z.literal('application/json'), z.null()])
6300
+ .literal('application/json')
6301
+ .nullable()
6302
6302
  .optional()
6303
6303
  .describe('Content type of the CloudEvents data value. Only the value "application/json" is allowed over HTTP.'),
6304
6304
  dataschema: z
6305
- .union([z.string(), z.null()])
6305
+ .string()
6306
+ .nullable()
6306
6307
  .optional()
6307
6308
  .describe('Identifies the schema that data adheres to.'),
6308
6309
  subject: z
6309
6310
  .string()
6310
6311
  .min(1)
6311
6312
  .describe('Describes the subject of the event in the context of the event producer (identified by source).'),
6312
- time: z
6313
- .union([dateTimeWire, z.null()])
6313
+ time: dateTimeWire
6314
+ .nullable()
6314
6315
  .optional()
6315
6316
  .describe('Timestamp of when the occurrence happened. Must adhere to RFC 3339.'),
6316
6317
  data: z
6317
- .union([z.record(z.string(), z.unknown()), z.null()])
6318
+ .record(z.string(), z.unknown())
6319
+ .nullable()
6318
6320
  .optional()
6319
6321
  .describe('The event payload. Optional, if present it must be a JSON object.'),
6320
6322
  })
@@ -6397,8 +6399,8 @@ export const createCostBasisRequestWire = z
6397
6399
  export const featureCostQueryRowWire = z
6398
6400
  .strictObject({
6399
6401
  usage: numericWire,
6400
- cost: z
6401
- .union([numericWire, z.null()])
6402
+ cost: numericWire
6403
+ .nullable()
6402
6404
  .describe('The computed cost amount (usage × unit cost). Null when pricing is not available for the given combination of dimensions.'),
6403
6405
  currency: currencyCodeWire,
6404
6406
  detail: z
@@ -8501,8 +8503,8 @@ export const createFeatureRequestWire = z
8501
8503
  .describe('Feature create request.');
8502
8504
  export const updateFeatureRequestWire = z
8503
8505
  .strictObject({
8504
- unit_cost: z
8505
- .union([featureUnitCostWire, z.null()])
8506
+ unit_cost: featureUnitCostWire
8507
+ .nullable()
8506
8508
  .optional()
8507
8509
  .describe('Optional per-unit cost configuration. Use "manual" for a fixed per-unit cost, or "llm" to look up cost from the LLM cost database based on meter group-by properties. Set to `null` to clear the existing unit cost; omit to leave it unchanged.'),
8508
8510
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta-106e6d4e7951",
3
+ "version": "1.0.0-beta-0bf476acf4b6",
4
4
  "description": "Official TypeScript SDK for the OpenMeter API — usage metering and billing",
5
5
  "keywords": [
6
6
  "openmeter",