@openmeter/client 1.0.0-beta-fd561cd8ec89 → 1.0.0-beta-2ef5b869426e

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.
@@ -397,6 +397,9 @@ export const creditPurchasePaymentSettlementStatus = z
397
397
  export const creditGrantStatus = z
398
398
  .enum(['pending', 'active', 'expired', 'voided'])
399
399
  .describe('Credit grant lifecycle status. - `pending`: The credit block has been created but is not yet valid. (`effective_at` is in the future or availability_policy is not met) - `active`: The credit block is currently valid and eligible for consumption. (`effective_at` is in the past, `expires_at` is in the future and availability_policy is met) - `expired`: The credit block expired with remaining unused balance, `expires_at` time has passed. - `voided`: The credit block was voided. Remaining balance is forfeited.');
400
+ export const validationIssueSeverity = z
401
+ .enum(['critical', 'warning'])
402
+ .describe('Severity level of a billing validation issue.');
400
403
  export const stringFieldFilterExact = z
401
404
  .union([
402
405
  z.string(),
@@ -506,9 +509,6 @@ export const taxIdentificationCode = z
506
509
  .min(1)
507
510
  .max(32)
508
511
  .describe('Tax identifier code is a normalized tax code shown on the original identity document.');
509
- export const invoiceValidationIssueSeverity = z
510
- .enum(['critical', 'warning'])
511
- .describe('Severity level of an invoice validation issue.');
512
512
  export const invoiceExternalReferences = z
513
513
  .object({
514
514
  invoicingId: z
@@ -2203,6 +2203,25 @@ export const listCreditGrantsParamsFilter = z
2203
2203
  key: stringFieldFilter.optional(),
2204
2204
  })
2205
2205
  .describe('Filter options for listing credit grants.');
2206
+ export const validationIssue = z
2207
+ .object({
2208
+ code: z.string().describe('Machine-readable error code.'),
2209
+ message: z.string().describe('Human-readable description of the error.'),
2210
+ attributes: z
2211
+ .record(z.string(), z.unknown())
2212
+ .optional()
2213
+ .describe('Additional structured context.'),
2214
+ severity: validationIssueSeverity,
2215
+ field: z
2216
+ .string()
2217
+ .optional()
2218
+ .describe('JSON path to the field that caused the validation issue, if applicable.'),
2219
+ component: z
2220
+ .string()
2221
+ .optional()
2222
+ .describe('Component that reported the validation issue, if applicable.'),
2223
+ })
2224
+ .describe('A validation issue found while processing a billing resource.');
2206
2225
  export const getCreditBalanceParamsFilter = z
2207
2226
  .object({
2208
2227
  currency: stringFieldFilterExact.optional(),
@@ -2262,21 +2281,6 @@ export const updateBillingPartyTaxIdentity = z
2262
2281
  code: taxIdentificationCode.optional(),
2263
2282
  })
2264
2283
  .describe('Identity stores the details required to identify an entity for tax purposes in a specific country.');
2265
- export const invoiceValidationIssue = z
2266
- .object({
2267
- code: z.string().describe('Machine-readable error code.'),
2268
- message: z.string().describe('Human-readable description of the error.'),
2269
- attributes: z
2270
- .record(z.string(), z.unknown())
2271
- .optional()
2272
- .describe('Additional structured context.'),
2273
- severity: invoiceValidationIssueSeverity,
2274
- field: z
2275
- .string()
2276
- .optional()
2277
- .describe('JSON path to the field that caused this validation issue, if applicable. For example: `lines/0/rate_card/price`.'),
2278
- })
2279
- .describe('A validation issue found during invoice processing. Converges on the same structure used by plan and subscription validation errors: a machine-readable `code`, a human-readable `message`, optional structured `attributes`, plus a `severity` and optional `field` path.');
2280
2284
  export const invoiceAvailableActions = z
2281
2285
  .object({
2282
2286
  advance: invoiceAvailableActionDetails.optional(),
@@ -4008,6 +4012,10 @@ export const creditGrant = z
4008
4012
  expiresAt: dateTime.optional(),
4009
4013
  voidedAt: dateTime.optional(),
4010
4014
  status: creditGrantStatus,
4015
+ validationIssues: z
4016
+ .array(validationIssue)
4017
+ .optional()
4018
+ .describe('Validation issues found while processing the credit grant. Present only when there are one or more validation findings. An empty list is omitted.'),
4011
4019
  })
4012
4020
  .describe('A credit grant allocates credits to a customer. Credits are drawn down against charges according to the settlement mode configured on the rate card.');
4013
4021
  export const currencyPagePaginatedResponse = z
@@ -4040,7 +4048,7 @@ export const invoiceBase = z
4040
4048
  totals: totals,
4041
4049
  servicePeriod: closedPeriod,
4042
4050
  validationIssues: z
4043
- .array(invoiceValidationIssue)
4051
+ .array(validationIssue)
4044
4052
  .optional()
4045
4053
  .describe('Validation issues found during invoice processing. Present only when there are one or more validation findings. An empty list is omitted.'),
4046
4054
  externalReferences: invoiceExternalReferences.optional(),
@@ -4081,7 +4089,7 @@ export const chargeRealizationInvoice = z
4081
4089
  totals: totals,
4082
4090
  servicePeriod: closedPeriod,
4083
4091
  validationIssues: z
4084
- .array(invoiceValidationIssue)
4092
+ .array(validationIssue)
4085
4093
  .optional()
4086
4094
  .describe('Validation issues found during invoice processing. Present only when there are one or more validation findings. An empty list is omitted.'),
4087
4095
  externalReferences: invoiceExternalReferences.optional(),
@@ -4861,7 +4869,7 @@ export const invoiceStandard = z
4861
4869
  totals: totals,
4862
4870
  servicePeriod: closedPeriod,
4863
4871
  validationIssues: z
4864
- .array(invoiceValidationIssue)
4872
+ .array(validationIssue)
4865
4873
  .optional()
4866
4874
  .describe('Validation issues found during invoice processing. Present only when there are one or more validation findings. An empty list is omitted.'),
4867
4875
  externalReferences: invoiceExternalReferences.optional(),
@@ -4948,6 +4956,10 @@ export const chargeFlatFee = z
4948
4956
  currency: billingCurrencyCode,
4949
4957
  resolvedCostBasis: chargeResolvedCostBasis.optional(),
4950
4958
  status: chargeStatus,
4959
+ validationIssues: z
4960
+ .array(validationIssue)
4961
+ .optional()
4962
+ .describe('Validation issues found while processing the charge. Present only when there are one or more validation findings. An empty list is omitted.'),
4951
4963
  invoiceAt: dateTime,
4952
4964
  servicePeriod: closedPeriod,
4953
4965
  fullServicePeriod: closedPeriod,
@@ -4995,6 +5007,10 @@ export const chargeUsageBased = z
4995
5007
  currency: billingCurrencyCode,
4996
5008
  resolvedCostBasis: chargeResolvedCostBasis.optional(),
4997
5009
  status: chargeStatus,
5010
+ validationIssues: z
5011
+ .array(validationIssue)
5012
+ .optional()
5013
+ .describe('Validation issues found while processing the charge. Present only when there are one or more validation findings. An empty list is omitted.'),
4998
5014
  invoiceAt: dateTime,
4999
5015
  servicePeriod: closedPeriod,
5000
5016
  fullServicePeriod: closedPeriod,
@@ -6153,6 +6169,9 @@ export const creditPurchasePaymentSettlementStatusWire = z
6153
6169
  export const creditGrantStatusWire = z
6154
6170
  .enum(['pending', 'active', 'expired', 'voided'])
6155
6171
  .describe('Credit grant lifecycle status. - `pending`: The credit block has been created but is not yet valid. (`effective_at` is in the future or availability_policy is not met) - `active`: The credit block is currently valid and eligible for consumption. (`effective_at` is in the past, `expires_at` is in the future and availability_policy is met) - `expired`: The credit block expired with remaining unused balance, `expires_at` time has passed. - `voided`: The credit block was voided. Remaining balance is forfeited.');
6172
+ export const validationIssueSeverityWire = z
6173
+ .enum(['critical', 'warning'])
6174
+ .describe('Severity level of a billing validation issue.');
6156
6175
  export const stringFieldFilterExactWire = z
6157
6176
  .union([
6158
6177
  z.string(),
@@ -6262,9 +6281,6 @@ export const taxIdentificationCodeWire = z
6262
6281
  .min(1)
6263
6282
  .max(32)
6264
6283
  .describe('Tax identifier code is a normalized tax code shown on the original identity document.');
6265
- export const invoiceValidationIssueSeverityWire = z
6266
- .enum(['critical', 'warning'])
6267
- .describe('Severity level of an invoice validation issue.');
6268
6284
  export const invoiceExternalReferencesWire = z
6269
6285
  .strictObject({
6270
6286
  invoicing_id: z
@@ -7942,6 +7958,25 @@ export const listCreditGrantsParamsFilterWire = z
7942
7958
  key: stringFieldFilterWire.optional(),
7943
7959
  })
7944
7960
  .describe('Filter options for listing credit grants.');
7961
+ export const validationIssueWire = z
7962
+ .strictObject({
7963
+ code: z.string().describe('Machine-readable error code.'),
7964
+ message: z.string().describe('Human-readable description of the error.'),
7965
+ attributes: z
7966
+ .record(z.string(), z.unknown())
7967
+ .optional()
7968
+ .describe('Additional structured context.'),
7969
+ severity: validationIssueSeverityWire,
7970
+ field: z
7971
+ .string()
7972
+ .optional()
7973
+ .describe('JSON path to the field that caused the validation issue, if applicable.'),
7974
+ component: z
7975
+ .string()
7976
+ .optional()
7977
+ .describe('Component that reported the validation issue, if applicable.'),
7978
+ })
7979
+ .describe('A validation issue found while processing a billing resource.');
7945
7980
  export const getCreditBalanceParamsFilterWire = z
7946
7981
  .strictObject({
7947
7982
  currency: stringFieldFilterExactWire.optional(),
@@ -7998,21 +8033,6 @@ export const updateBillingPartyTaxIdentityWire = z
7998
8033
  code: taxIdentificationCodeWire.optional(),
7999
8034
  })
8000
8035
  .describe('Identity stores the details required to identify an entity for tax purposes in a specific country.');
8001
- export const invoiceValidationIssueWire = z
8002
- .strictObject({
8003
- code: z.string().describe('Machine-readable error code.'),
8004
- message: z.string().describe('Human-readable description of the error.'),
8005
- attributes: z
8006
- .record(z.string(), z.unknown())
8007
- .optional()
8008
- .describe('Additional structured context.'),
8009
- severity: invoiceValidationIssueSeverityWire,
8010
- field: z
8011
- .string()
8012
- .optional()
8013
- .describe('JSON path to the field that caused this validation issue, if applicable. For example: `lines/0/rate_card/price`.'),
8014
- })
8015
- .describe('A validation issue found during invoice processing. Converges on the same structure used by plan and subscription validation errors: a machine-readable `code`, a human-readable `message`, optional structured `attributes`, plus a `severity` and optional `field` path.');
8016
8036
  export const invoiceAvailableActionsWire = z
8017
8037
  .strictObject({
8018
8038
  advance: invoiceAvailableActionDetailsWire.optional(),
@@ -9738,6 +9758,10 @@ export const creditGrantWire = z
9738
9758
  expires_at: dateTimeWire.optional(),
9739
9759
  voided_at: dateTimeWire.optional(),
9740
9760
  status: creditGrantStatusWire,
9761
+ validation_issues: z
9762
+ .array(validationIssueWire)
9763
+ .optional()
9764
+ .describe('Validation issues found while processing the credit grant. Present only when there are one or more validation findings. An empty list is omitted.'),
9741
9765
  })
9742
9766
  .describe('A credit grant allocates credits to a customer. Credits are drawn down against charges according to the settlement mode configured on the rate card.');
9743
9767
  export const currencyPagePaginatedResponseWire = z
@@ -9770,7 +9794,7 @@ export const invoiceBaseWire = z
9770
9794
  totals: totalsWire,
9771
9795
  service_period: closedPeriodWire,
9772
9796
  validation_issues: z
9773
- .array(invoiceValidationIssueWire)
9797
+ .array(validationIssueWire)
9774
9798
  .optional()
9775
9799
  .describe('Validation issues found during invoice processing. Present only when there are one or more validation findings. An empty list is omitted.'),
9776
9800
  external_references: invoiceExternalReferencesWire.optional(),
@@ -9808,7 +9832,7 @@ export const chargeRealizationInvoiceWire = z
9808
9832
  totals: totalsWire,
9809
9833
  service_period: closedPeriodWire,
9810
9834
  validation_issues: z
9811
- .array(invoiceValidationIssueWire)
9835
+ .array(validationIssueWire)
9812
9836
  .optional()
9813
9837
  .describe('Validation issues found during invoice processing. Present only when there are one or more validation findings. An empty list is omitted.'),
9814
9838
  external_references: invoiceExternalReferencesWire.optional(),
@@ -10586,7 +10610,7 @@ export const invoiceStandardWire = z
10586
10610
  totals: totalsWire,
10587
10611
  service_period: closedPeriodWire,
10588
10612
  validation_issues: z
10589
- .array(invoiceValidationIssueWire)
10613
+ .array(validationIssueWire)
10590
10614
  .optional()
10591
10615
  .describe('Validation issues found during invoice processing. Present only when there are one or more validation findings. An empty list is omitted.'),
10592
10616
  external_references: invoiceExternalReferencesWire.optional(),
@@ -10673,6 +10697,10 @@ export const chargeFlatFeeWire = z
10673
10697
  currency: billingCurrencyCodeWire,
10674
10698
  resolved_cost_basis: chargeResolvedCostBasisWire.optional(),
10675
10699
  status: chargeStatusWire,
10700
+ validation_issues: z
10701
+ .array(validationIssueWire)
10702
+ .optional()
10703
+ .describe('Validation issues found while processing the charge. Present only when there are one or more validation findings. An empty list is omitted.'),
10676
10704
  invoice_at: dateTimeWire,
10677
10705
  service_period: closedPeriodWire,
10678
10706
  full_service_period: closedPeriodWire,
@@ -10720,6 +10748,10 @@ export const chargeUsageBasedWire = z
10720
10748
  currency: billingCurrencyCodeWire,
10721
10749
  resolved_cost_basis: chargeResolvedCostBasisWire.optional(),
10722
10750
  status: chargeStatusWire,
10751
+ validation_issues: z
10752
+ .array(validationIssueWire)
10753
+ .optional()
10754
+ .describe('Validation issues found while processing the charge. Present only when there are one or more validation findings. An empty list is omitted.'),
10723
10755
  invoice_at: dateTimeWire,
10724
10756
  service_period: closedPeriodWire,
10725
10757
  full_service_period: closedPeriodWire,
@@ -1854,6 +1854,21 @@ export interface ListCreditGrantsParamsFilter {
1854
1854
  /** Filter credit grants by key. */
1855
1855
  key?: StringFieldFilter;
1856
1856
  }
1857
+ /** A validation issue found while processing a billing resource. */
1858
+ export interface ValidationIssue {
1859
+ /** Machine-readable error code. */
1860
+ code: string;
1861
+ /** Human-readable description of the error. */
1862
+ message: string;
1863
+ /** Additional structured context. */
1864
+ attributes?: Record<string, unknown>;
1865
+ /** Severity of the validation issue. */
1866
+ severity: 'critical' | 'warning';
1867
+ /** JSON path to the field that caused the validation issue, if applicable. */
1868
+ field?: string;
1869
+ /** Component that reported the validation issue, if applicable. */
1870
+ component?: string;
1871
+ }
1857
1872
  /** Filter options for getting a credit balance. */
1858
1873
  export interface GetCreditBalanceParamsFilter {
1859
1874
  /** Filter credit balance by currency. */
@@ -1968,29 +1983,6 @@ export interface UpdateBillingPartyTaxIdentity {
1968
1983
  /** Normalized tax identification code shown on the original identity document. */
1969
1984
  code?: string;
1970
1985
  }
1971
- /**
1972
- * A validation issue found during invoice processing.
1973
- *
1974
- * Converges on the same structure used by plan and subscription validation errors:
1975
- * a machine-readable `code`, a human-readable `message`, optional structured
1976
- * `attributes`, plus a `severity` and optional `field` path.
1977
- */
1978
- export interface InvoiceValidationIssue {
1979
- /** Machine-readable error code. */
1980
- code: string;
1981
- /** Human-readable description of the error. */
1982
- message: string;
1983
- /** Additional structured context. */
1984
- attributes?: Record<string, unknown>;
1985
- /** Severity of the validation issue. */
1986
- severity: 'critical' | 'warning';
1987
- /**
1988
- * JSON path to the field that caused this validation issue, if applicable.
1989
- *
1990
- * For example: `lines/0/rate_card/price`.
1991
- */
1992
- field?: string;
1993
- }
1994
1986
  /**
1995
1987
  * The set of state-transition actions available for an invoice in its current
1996
1988
  * status.
@@ -4357,6 +4349,13 @@ export interface CreditGrant {
4357
4349
  voidedAt?: Date;
4358
4350
  /** Current lifecycle status of the grant. */
4359
4351
  status: 'pending' | 'active' | 'expired' | 'voided';
4352
+ /**
4353
+ * Validation issues found while processing the credit grant.
4354
+ *
4355
+ * Present only when there are one or more validation findings. An empty list is
4356
+ * omitted.
4357
+ */
4358
+ validationIssues?: ValidationIssue[];
4360
4359
  }
4361
4360
  /** Page paginated response. */
4362
4361
  export interface CurrencyPagePaginatedResponse {
@@ -4415,7 +4414,7 @@ export interface InvoiceBase {
4415
4414
  * Present only when there are one or more validation findings. An empty list is
4416
4415
  * omitted.
4417
4416
  */
4418
- validationIssues?: InvoiceValidationIssue[];
4417
+ validationIssues?: ValidationIssue[];
4419
4418
  /** External identifiers assigned to this invoice by third-party systems. */
4420
4419
  externalReferences?: InvoiceExternalReferences;
4421
4420
  }
@@ -4500,7 +4499,7 @@ export interface ChargeRealizationInvoice {
4500
4499
  * Present only when there are one or more validation findings. An empty list is
4501
4500
  * omitted.
4502
4501
  */
4503
- validationIssues?: InvoiceValidationIssue[];
4502
+ validationIssues?: ValidationIssue[];
4504
4503
  /** External identifiers assigned to this invoice by third-party systems. */
4505
4504
  externalReferences?: InvoiceExternalReferences;
4506
4505
  /** Discriminator field identifying this as a standard invoice. */
@@ -5739,7 +5738,7 @@ export interface InvoiceStandard {
5739
5738
  * Present only when there are one or more validation findings. An empty list is
5740
5739
  * omitted.
5741
5740
  */
5742
- validationIssues?: InvoiceValidationIssue[];
5741
+ validationIssues?: ValidationIssue[];
5743
5742
  /** External identifiers assigned to this invoice by third-party systems. */
5744
5743
  externalReferences?: InvoiceExternalReferences;
5745
5744
  /** Discriminator field identifying this as a standard invoice. */
@@ -5874,6 +5873,13 @@ export interface ChargeFlatFee {
5874
5873
  resolvedCostBasis?: ChargeResolvedCostBasis;
5875
5874
  /** The lifecycle status of the charge. */
5876
5875
  status: 'created' | 'active' | 'final' | 'deleted';
5876
+ /**
5877
+ * Validation issues found while processing the charge.
5878
+ *
5879
+ * Present only when there are one or more validation findings. An empty list is
5880
+ * omitted.
5881
+ */
5882
+ validationIssues?: ValidationIssue[];
5877
5883
  /** The timestamp when the charge is intended to be invoiced. */
5878
5884
  invoiceAt: Date;
5879
5885
  /** The effective service period covered by the charge. */
@@ -5968,6 +5974,13 @@ export interface ChargeUsageBased {
5968
5974
  resolvedCostBasis?: ChargeResolvedCostBasis;
5969
5975
  /** The lifecycle status of the charge. */
5970
5976
  status: 'created' | 'active' | 'final' | 'deleted';
5977
+ /**
5978
+ * Validation issues found while processing the charge.
5979
+ *
5980
+ * Present only when there are one or more validation findings. An empty list is
5981
+ * omitted.
5982
+ */
5983
+ validationIssues?: ValidationIssue[];
5971
5984
  /** The timestamp when the charge is intended to be invoiced. */
5972
5985
  invoiceAt: Date;
5973
5986
  /** The effective service period covered by the charge. */
@@ -6989,6 +7002,13 @@ export interface CreditGrantInput {
6989
7002
  voidedAt?: Date;
6990
7003
  /** Current lifecycle status of the grant. */
6991
7004
  status: 'pending' | 'active' | 'expired' | 'voided';
7005
+ /**
7006
+ * Validation issues found while processing the credit grant.
7007
+ *
7008
+ * Present only when there are one or more validation findings. An empty list is
7009
+ * omitted.
7010
+ */
7011
+ validationIssues?: ValidationIssue[];
6992
7012
  }
6993
7013
  /** Bad Request. */
6994
7014
  export interface BadRequestInput extends BaseErrorInput {
@@ -7076,7 +7096,7 @@ export interface ChargeRealizationInvoiceInput {
7076
7096
  * Present only when there are one or more validation findings. An empty list is
7077
7097
  * omitted.
7078
7098
  */
7079
- validationIssues?: InvoiceValidationIssue[];
7099
+ validationIssues?: ValidationIssue[];
7080
7100
  /** External identifiers assigned to this invoice by third-party systems. */
7081
7101
  externalReferences?: InvoiceExternalReferences;
7082
7102
  /** Discriminator field identifying this as a standard invoice. */
@@ -8231,7 +8251,7 @@ export interface InvoiceStandardInput {
8231
8251
  * Present only when there are one or more validation findings. An empty list is
8232
8252
  * omitted.
8233
8253
  */
8234
- validationIssues?: InvoiceValidationIssue[];
8254
+ validationIssues?: ValidationIssue[];
8235
8255
  /** External identifiers assigned to this invoice by third-party systems. */
8236
8256
  externalReferences?: InvoiceExternalReferences;
8237
8257
  /** Discriminator field identifying this as a standard invoice. */
@@ -8366,6 +8386,13 @@ export interface ChargeFlatFeeInput {
8366
8386
  resolvedCostBasis?: ChargeResolvedCostBasis;
8367
8387
  /** The lifecycle status of the charge. */
8368
8388
  status: 'created' | 'active' | 'final' | 'deleted';
8389
+ /**
8390
+ * Validation issues found while processing the charge.
8391
+ *
8392
+ * Present only when there are one or more validation findings. An empty list is
8393
+ * omitted.
8394
+ */
8395
+ validationIssues?: ValidationIssue[];
8369
8396
  /** The timestamp when the charge is intended to be invoiced. */
8370
8397
  invoiceAt: Date;
8371
8398
  /** The effective service period covered by the charge. */
@@ -8460,6 +8487,13 @@ export interface ChargeUsageBasedInput {
8460
8487
  resolvedCostBasis?: ChargeResolvedCostBasis;
8461
8488
  /** The lifecycle status of the charge. */
8462
8489
  status: 'created' | 'active' | 'final' | 'deleted';
8490
+ /**
8491
+ * Validation issues found while processing the charge.
8492
+ *
8493
+ * Present only when there are one or more validation findings. An empty list is
8494
+ * omitted.
8495
+ */
8496
+ validationIssues?: ValidationIssue[];
8463
8497
  /** The timestamp when the charge is intended to be invoiced. */
8464
8498
  invoiceAt: Date;
8465
8499
  /** The effective service period covered by the charge. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta-fd561cd8ec89",
3
+ "version": "1.0.0-beta-2ef5b869426e",
4
4
  "description": "Official TypeScript SDK for the OpenMeter API — usage metering and billing",
5
5
  "keywords": [
6
6
  "openmeter",