mollie-api-typescript 0.8.5 → 0.8.6

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.
Files changed (137) hide show
  1. package/bin/mcp-server.js +1978 -1971
  2. package/bin/mcp-server.js.map +42 -41
  3. package/dist/commonjs/funcs/salesInvoicesCreate.d.ts +1 -1
  4. package/dist/commonjs/funcs/salesInvoicesCreate.d.ts.map +1 -1
  5. package/dist/commonjs/funcs/salesInvoicesCreate.js +2 -2
  6. package/dist/commonjs/funcs/salesInvoicesCreate.js.map +1 -1
  7. package/dist/commonjs/funcs/salesInvoicesGet.d.ts +1 -1
  8. package/dist/commonjs/funcs/salesInvoicesGet.d.ts.map +1 -1
  9. package/dist/commonjs/funcs/salesInvoicesGet.js +1 -1
  10. package/dist/commonjs/funcs/salesInvoicesGet.js.map +1 -1
  11. package/dist/commonjs/funcs/salesInvoicesUpdate.d.ts +1 -1
  12. package/dist/commonjs/funcs/salesInvoicesUpdate.d.ts.map +1 -1
  13. package/dist/commonjs/funcs/salesInvoicesUpdate.js +1 -1
  14. package/dist/commonjs/funcs/salesInvoicesUpdate.js.map +1 -1
  15. package/dist/commonjs/lib/config.d.ts +3 -3
  16. package/dist/commonjs/lib/config.js +3 -3
  17. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  18. package/dist/commonjs/mcp-server/server.js +1 -1
  19. package/dist/commonjs/models/index.d.ts +2 -2
  20. package/dist/commonjs/models/index.d.ts.map +1 -1
  21. package/dist/commonjs/models/index.js +2 -2
  22. package/dist/commonjs/models/index.js.map +1 -1
  23. package/dist/commonjs/models/operations/createsalesinvoice.d.ts +2 -2
  24. package/dist/commonjs/models/operations/createsalesinvoice.d.ts.map +1 -1
  25. package/dist/commonjs/models/operations/createsalesinvoice.js +4 -4
  26. package/dist/commonjs/models/operations/createsalesinvoice.js.map +1 -1
  27. package/dist/commonjs/models/operations/listsalesinvoices.d.ts +2 -2
  28. package/dist/commonjs/models/operations/listsalesinvoices.d.ts.map +1 -1
  29. package/dist/commonjs/models/operations/listsalesinvoices.js +2 -4
  30. package/dist/commonjs/models/operations/listsalesinvoices.js.map +1 -1
  31. package/dist/commonjs/models/{entitysalesinvoice.d.ts → salesinvoicerequest.d.ts} +25 -25
  32. package/dist/commonjs/models/salesinvoicerequest.d.ts.map +1 -0
  33. package/dist/commonjs/models/{entitysalesinvoice.js → salesinvoicerequest.js} +30 -32
  34. package/dist/commonjs/models/salesinvoicerequest.js.map +1 -0
  35. package/dist/commonjs/models/{entitysalesinvoiceresponse.d.ts → salesinvoiceresponse.d.ts} +35 -29
  36. package/dist/commonjs/models/salesinvoiceresponse.d.ts.map +1 -0
  37. package/dist/commonjs/models/{entitysalesinvoiceresponse.js → salesinvoiceresponse.js} +40 -40
  38. package/dist/commonjs/models/salesinvoiceresponse.js.map +1 -0
  39. package/dist/commonjs/models/updatevaluessalesinvoice.d.ts +2 -2
  40. package/dist/commonjs/models/updatevaluessalesinvoice.d.ts.map +1 -1
  41. package/dist/commonjs/models/updatevaluessalesinvoice.js +2 -4
  42. package/dist/commonjs/models/updatevaluessalesinvoice.js.map +1 -1
  43. package/dist/commonjs/sdk/salesinvoices.d.ts +3 -3
  44. package/dist/commonjs/sdk/salesinvoices.d.ts.map +1 -1
  45. package/dist/commonjs/types/enums.d.ts +1 -8
  46. package/dist/commonjs/types/enums.d.ts.map +1 -1
  47. package/dist/commonjs/types/enums.js +3 -21
  48. package/dist/commonjs/types/enums.js.map +1 -1
  49. package/dist/commonjs/types/index.d.ts +2 -1
  50. package/dist/commonjs/types/index.d.ts.map +1 -1
  51. package/dist/commonjs/types/index.js +15 -0
  52. package/dist/commonjs/types/index.js.map +1 -1
  53. package/dist/commonjs/types/unrecognized.d.ts +10 -0
  54. package/dist/commonjs/types/unrecognized.d.ts.map +1 -0
  55. package/dist/commonjs/types/unrecognized.js +26 -0
  56. package/dist/commonjs/types/unrecognized.js.map +1 -0
  57. package/dist/esm/funcs/salesInvoicesCreate.d.ts +1 -1
  58. package/dist/esm/funcs/salesInvoicesCreate.d.ts.map +1 -1
  59. package/dist/esm/funcs/salesInvoicesCreate.js +2 -2
  60. package/dist/esm/funcs/salesInvoicesCreate.js.map +1 -1
  61. package/dist/esm/funcs/salesInvoicesGet.d.ts +1 -1
  62. package/dist/esm/funcs/salesInvoicesGet.d.ts.map +1 -1
  63. package/dist/esm/funcs/salesInvoicesGet.js +1 -1
  64. package/dist/esm/funcs/salesInvoicesGet.js.map +1 -1
  65. package/dist/esm/funcs/salesInvoicesUpdate.d.ts +1 -1
  66. package/dist/esm/funcs/salesInvoicesUpdate.d.ts.map +1 -1
  67. package/dist/esm/funcs/salesInvoicesUpdate.js +1 -1
  68. package/dist/esm/funcs/salesInvoicesUpdate.js.map +1 -1
  69. package/dist/esm/lib/config.d.ts +3 -3
  70. package/dist/esm/lib/config.js +3 -3
  71. package/dist/esm/mcp-server/mcp-server.js +1 -1
  72. package/dist/esm/mcp-server/server.js +1 -1
  73. package/dist/esm/models/index.d.ts +2 -2
  74. package/dist/esm/models/index.d.ts.map +1 -1
  75. package/dist/esm/models/index.js +2 -2
  76. package/dist/esm/models/index.js.map +1 -1
  77. package/dist/esm/models/operations/createsalesinvoice.d.ts +2 -2
  78. package/dist/esm/models/operations/createsalesinvoice.d.ts.map +1 -1
  79. package/dist/esm/models/operations/createsalesinvoice.js +4 -4
  80. package/dist/esm/models/operations/createsalesinvoice.js.map +1 -1
  81. package/dist/esm/models/operations/listsalesinvoices.d.ts +2 -2
  82. package/dist/esm/models/operations/listsalesinvoices.d.ts.map +1 -1
  83. package/dist/esm/models/operations/listsalesinvoices.js +2 -4
  84. package/dist/esm/models/operations/listsalesinvoices.js.map +1 -1
  85. package/dist/esm/models/{entitysalesinvoice.d.ts → salesinvoicerequest.d.ts} +25 -25
  86. package/dist/esm/models/salesinvoicerequest.d.ts.map +1 -0
  87. package/dist/esm/models/{entitysalesinvoice.js → salesinvoicerequest.js} +25 -27
  88. package/dist/esm/models/salesinvoicerequest.js.map +1 -0
  89. package/dist/esm/models/{entitysalesinvoiceresponse.d.ts → salesinvoiceresponse.d.ts} +35 -29
  90. package/dist/esm/models/salesinvoiceresponse.d.ts.map +1 -0
  91. package/dist/esm/models/{entitysalesinvoiceresponse.js → salesinvoiceresponse.js} +33 -33
  92. package/dist/esm/models/salesinvoiceresponse.js.map +1 -0
  93. package/dist/esm/models/updatevaluessalesinvoice.d.ts +2 -2
  94. package/dist/esm/models/updatevaluessalesinvoice.d.ts.map +1 -1
  95. package/dist/esm/models/updatevaluessalesinvoice.js +2 -4
  96. package/dist/esm/models/updatevaluessalesinvoice.js.map +1 -1
  97. package/dist/esm/sdk/salesinvoices.d.ts +3 -3
  98. package/dist/esm/sdk/salesinvoices.d.ts.map +1 -1
  99. package/dist/esm/types/enums.d.ts +1 -8
  100. package/dist/esm/types/enums.d.ts.map +1 -1
  101. package/dist/esm/types/enums.js +1 -18
  102. package/dist/esm/types/enums.js.map +1 -1
  103. package/dist/esm/types/index.d.ts +2 -1
  104. package/dist/esm/types/index.d.ts.map +1 -1
  105. package/dist/esm/types/index.js +1 -0
  106. package/dist/esm/types/index.js.map +1 -1
  107. package/dist/esm/types/unrecognized.d.ts +10 -0
  108. package/dist/esm/types/unrecognized.d.ts.map +1 -0
  109. package/dist/esm/types/unrecognized.js +23 -0
  110. package/dist/esm/types/unrecognized.js.map +1 -0
  111. package/examples/package-lock.json +1 -1
  112. package/jsr.json +1 -1
  113. package/package.json +1 -1
  114. package/src/funcs/salesInvoicesCreate.ts +5 -5
  115. package/src/funcs/salesInvoicesGet.ts +4 -4
  116. package/src/funcs/salesInvoicesUpdate.ts +4 -4
  117. package/src/lib/config.ts +3 -3
  118. package/src/mcp-server/mcp-server.ts +1 -1
  119. package/src/mcp-server/server.ts +1 -1
  120. package/src/models/index.ts +2 -2
  121. package/src/models/operations/createsalesinvoice.ts +6 -6
  122. package/src/models/operations/listsalesinvoices.ts +4 -8
  123. package/src/models/{entitysalesinvoice.ts → salesinvoicerequest.ts} +54 -54
  124. package/src/models/{entitysalesinvoiceresponse.ts → salesinvoiceresponse.ts} +72 -75
  125. package/src/models/updatevaluessalesinvoice.ts +4 -6
  126. package/src/sdk/salesinvoices.ts +3 -3
  127. package/src/types/enums.ts +1 -21
  128. package/src/types/index.ts +2 -1
  129. package/src/types/unrecognized.ts +27 -0
  130. package/dist/commonjs/models/entitysalesinvoice.d.ts.map +0 -1
  131. package/dist/commonjs/models/entitysalesinvoice.js.map +0 -1
  132. package/dist/commonjs/models/entitysalesinvoiceresponse.d.ts.map +0 -1
  133. package/dist/commonjs/models/entitysalesinvoiceresponse.js.map +0 -1
  134. package/dist/esm/models/entitysalesinvoice.d.ts.map +0 -1
  135. package/dist/esm/models/entitysalesinvoice.js.map +0 -1
  136. package/dist/esm/models/entitysalesinvoiceresponse.d.ts.map +0 -1
  137. package/dist/esm/models/entitysalesinvoiceresponse.js.map +0 -1
@@ -63,9 +63,9 @@ import {
63
63
  * @remarks
64
64
  * you fetch the entity with our API, we will also include the metadata. You can use up to approximately 1kB.
65
65
  */
66
- export type EntitySalesInvoiceMetadata = {};
66
+ export type SalesInvoiceRequestMetadata = {};
67
67
 
68
- export type EntitySalesInvoice = {
68
+ export type SalesInvoiceRequest = {
69
69
  /**
70
70
  * Whether to create the entity in test mode or live mode.
71
71
  *
@@ -103,7 +103,7 @@ export type EntitySalesInvoice = {
103
103
  * - `customerId` and `mandateId` are required if a recurring payment should be used to set the invoice to `paid`
104
104
  * - `emailDetails` optional for `issued` and `paid` to send the invoice by email
105
105
  */
106
- status?: SalesInvoiceStatus | undefined;
106
+ status: SalesInvoiceStatus;
107
107
  /**
108
108
  * The VAT scheme to create the invoice for. You must be enrolled with One Stop Shop enabled to use it.
109
109
  */
@@ -125,12 +125,12 @@ export type EntitySalesInvoice = {
125
125
  * @remarks
126
126
  * you fetch the entity with our API, we will also include the metadata. You can use up to approximately 1kB.
127
127
  */
128
- metadata?: EntitySalesInvoiceMetadata | null | undefined;
128
+ metadata?: SalesInvoiceRequestMetadata | null | undefined;
129
129
  /**
130
130
  * The payment term to be set on the invoice.
131
131
  */
132
132
  paymentTerm?: SalesInvoicePaymentTerm | null | undefined;
133
- paymentDetails?: SalesInvoicePaymentDetails | null | undefined;
133
+ paymentDetails?: SalesInvoicePaymentDetails | undefined;
134
134
  emailDetails?: SalesInvoiceEmailDetails | null | undefined;
135
135
  /**
136
136
  * The identifier referring to the [customer](get-customer) you want to attempt an automated payment for. If
@@ -153,8 +153,8 @@ export type EntitySalesInvoice = {
153
153
  * so that both you and us know who we're referring to. It is a value you provide to us so that recipient management
154
154
  * is not required to send a first invoice to a recipient.
155
155
  */
156
- recipientIdentifier?: string | undefined;
157
- recipient?: SalesInvoiceRecipient | null | undefined;
156
+ recipientIdentifier: string;
157
+ recipient: SalesInvoiceRecipient | null;
158
158
  /**
159
159
  * Provide the line items for the invoice. Each line contains details such as a description of the item
160
160
  *
@@ -163,127 +163,127 @@ export type EntitySalesInvoice = {
163
163
  *
164
164
  * All lines must have the same currency as the invoice.
165
165
  */
166
- lines?: Array<SalesInvoiceLineItem> | null | undefined;
166
+ lines: Array<SalesInvoiceLineItem> | null;
167
167
  discount?: SalesInvoiceDiscount | null | undefined;
168
168
  };
169
169
 
170
170
  /** @internal */
171
- export const EntitySalesInvoiceMetadata$inboundSchema: z.ZodType<
172
- EntitySalesInvoiceMetadata,
171
+ export const SalesInvoiceRequestMetadata$inboundSchema: z.ZodType<
172
+ SalesInvoiceRequestMetadata,
173
173
  z.ZodTypeDef,
174
174
  unknown
175
175
  > = z.object({});
176
176
  /** @internal */
177
- export type EntitySalesInvoiceMetadata$Outbound = {};
177
+ export type SalesInvoiceRequestMetadata$Outbound = {};
178
178
 
179
179
  /** @internal */
180
- export const EntitySalesInvoiceMetadata$outboundSchema: z.ZodType<
181
- EntitySalesInvoiceMetadata$Outbound,
180
+ export const SalesInvoiceRequestMetadata$outboundSchema: z.ZodType<
181
+ SalesInvoiceRequestMetadata$Outbound,
182
182
  z.ZodTypeDef,
183
- EntitySalesInvoiceMetadata
183
+ SalesInvoiceRequestMetadata
184
184
  > = z.object({});
185
185
 
186
- export function entitySalesInvoiceMetadataToJSON(
187
- entitySalesInvoiceMetadata: EntitySalesInvoiceMetadata,
186
+ export function salesInvoiceRequestMetadataToJSON(
187
+ salesInvoiceRequestMetadata: SalesInvoiceRequestMetadata,
188
188
  ): string {
189
189
  return JSON.stringify(
190
- EntitySalesInvoiceMetadata$outboundSchema.parse(entitySalesInvoiceMetadata),
190
+ SalesInvoiceRequestMetadata$outboundSchema.parse(
191
+ salesInvoiceRequestMetadata,
192
+ ),
191
193
  );
192
194
  }
193
- export function entitySalesInvoiceMetadataFromJSON(
195
+ export function salesInvoiceRequestMetadataFromJSON(
194
196
  jsonString: string,
195
- ): SafeParseResult<EntitySalesInvoiceMetadata, SDKValidationError> {
197
+ ): SafeParseResult<SalesInvoiceRequestMetadata, SDKValidationError> {
196
198
  return safeParse(
197
199
  jsonString,
198
- (x) => EntitySalesInvoiceMetadata$inboundSchema.parse(JSON.parse(x)),
199
- `Failed to parse 'EntitySalesInvoiceMetadata' from JSON`,
200
+ (x) => SalesInvoiceRequestMetadata$inboundSchema.parse(JSON.parse(x)),
201
+ `Failed to parse 'SalesInvoiceRequestMetadata' from JSON`,
200
202
  );
201
203
  }
202
204
 
203
205
  /** @internal */
204
- export const EntitySalesInvoice$inboundSchema: z.ZodType<
205
- EntitySalesInvoice,
206
+ export const SalesInvoiceRequest$inboundSchema: z.ZodType<
207
+ SalesInvoiceRequest,
206
208
  z.ZodTypeDef,
207
209
  unknown
208
210
  > = z.object({
209
211
  testmode: z.nullable(z.boolean()).optional(),
210
212
  profileId: z.nullable(z.string()).optional(),
211
- status: SalesInvoiceStatus$inboundSchema.optional(),
213
+ status: SalesInvoiceStatus$inboundSchema,
212
214
  vatScheme: SalesInvoiceVatScheme$inboundSchema.optional(),
213
215
  vatMode: SalesInvoiceVatMode$inboundSchema.optional(),
214
216
  memo: z.nullable(z.string()).optional(),
215
- metadata: z.nullable(z.lazy(() => EntitySalesInvoiceMetadata$inboundSchema))
217
+ metadata: z.nullable(z.lazy(() => SalesInvoiceRequestMetadata$inboundSchema))
216
218
  .optional(),
217
219
  paymentTerm: z.nullable(SalesInvoicePaymentTerm$inboundSchema).optional(),
218
- paymentDetails: z.nullable(SalesInvoicePaymentDetails$inboundSchema)
219
- .optional(),
220
+ paymentDetails: SalesInvoicePaymentDetails$inboundSchema.optional(),
220
221
  emailDetails: z.nullable(SalesInvoiceEmailDetails$inboundSchema).optional(),
221
222
  customerId: z.string().optional(),
222
223
  mandateId: z.string().optional(),
223
- recipientIdentifier: z.string().optional(),
224
- recipient: z.nullable(SalesInvoiceRecipient$inboundSchema).optional(),
225
- lines: z.nullable(z.array(SalesInvoiceLineItem$inboundSchema)).optional(),
224
+ recipientIdentifier: z.string(),
225
+ recipient: z.nullable(SalesInvoiceRecipient$inboundSchema),
226
+ lines: z.nullable(z.array(SalesInvoiceLineItem$inboundSchema)),
226
227
  discount: z.nullable(SalesInvoiceDiscount$inboundSchema).optional(),
227
228
  });
228
229
  /** @internal */
229
- export type EntitySalesInvoice$Outbound = {
230
+ export type SalesInvoiceRequest$Outbound = {
230
231
  testmode?: boolean | null | undefined;
231
232
  profileId?: string | null | undefined;
232
- status?: string | undefined;
233
+ status: string;
233
234
  vatScheme?: string | undefined;
234
235
  vatMode?: string | undefined;
235
236
  memo?: string | null | undefined;
236
- metadata?: EntitySalesInvoiceMetadata$Outbound | null | undefined;
237
+ metadata?: SalesInvoiceRequestMetadata$Outbound | null | undefined;
237
238
  paymentTerm?: string | null | undefined;
238
- paymentDetails?: SalesInvoicePaymentDetails$Outbound | null | undefined;
239
+ paymentDetails?: SalesInvoicePaymentDetails$Outbound | undefined;
239
240
  emailDetails?: SalesInvoiceEmailDetails$Outbound | null | undefined;
240
241
  customerId?: string | undefined;
241
242
  mandateId?: string | undefined;
242
- recipientIdentifier?: string | undefined;
243
- recipient?: SalesInvoiceRecipient$Outbound | null | undefined;
244
- lines?: Array<SalesInvoiceLineItem$Outbound> | null | undefined;
243
+ recipientIdentifier: string;
244
+ recipient: SalesInvoiceRecipient$Outbound | null;
245
+ lines: Array<SalesInvoiceLineItem$Outbound> | null;
245
246
  discount?: SalesInvoiceDiscount$Outbound | null | undefined;
246
247
  };
247
248
 
248
249
  /** @internal */
249
- export const EntitySalesInvoice$outboundSchema: z.ZodType<
250
- EntitySalesInvoice$Outbound,
250
+ export const SalesInvoiceRequest$outboundSchema: z.ZodType<
251
+ SalesInvoiceRequest$Outbound,
251
252
  z.ZodTypeDef,
252
- EntitySalesInvoice
253
+ SalesInvoiceRequest
253
254
  > = z.object({
254
255
  testmode: z.nullable(z.boolean()).optional(),
255
256
  profileId: z.nullable(z.string()).optional(),
256
- status: SalesInvoiceStatus$outboundSchema.optional(),
257
+ status: SalesInvoiceStatus$outboundSchema,
257
258
  vatScheme: SalesInvoiceVatScheme$outboundSchema.optional(),
258
259
  vatMode: SalesInvoiceVatMode$outboundSchema.optional(),
259
260
  memo: z.nullable(z.string()).optional(),
260
- metadata: z.nullable(z.lazy(() => EntitySalesInvoiceMetadata$outboundSchema))
261
+ metadata: z.nullable(z.lazy(() => SalesInvoiceRequestMetadata$outboundSchema))
261
262
  .optional(),
262
263
  paymentTerm: z.nullable(SalesInvoicePaymentTerm$outboundSchema).optional(),
263
- paymentDetails: z.nullable(SalesInvoicePaymentDetails$outboundSchema)
264
- .optional(),
264
+ paymentDetails: SalesInvoicePaymentDetails$outboundSchema.optional(),
265
265
  emailDetails: z.nullable(SalesInvoiceEmailDetails$outboundSchema).optional(),
266
266
  customerId: z.string().optional(),
267
267
  mandateId: z.string().optional(),
268
- recipientIdentifier: z.string().optional(),
269
- recipient: z.nullable(SalesInvoiceRecipient$outboundSchema).optional(),
270
- lines: z.nullable(z.array(SalesInvoiceLineItem$outboundSchema)).optional(),
268
+ recipientIdentifier: z.string(),
269
+ recipient: z.nullable(SalesInvoiceRecipient$outboundSchema),
270
+ lines: z.nullable(z.array(SalesInvoiceLineItem$outboundSchema)),
271
271
  discount: z.nullable(SalesInvoiceDiscount$outboundSchema).optional(),
272
272
  });
273
273
 
274
- export function entitySalesInvoiceToJSON(
275
- entitySalesInvoice: EntitySalesInvoice,
274
+ export function salesInvoiceRequestToJSON(
275
+ salesInvoiceRequest: SalesInvoiceRequest,
276
276
  ): string {
277
277
  return JSON.stringify(
278
- EntitySalesInvoice$outboundSchema.parse(entitySalesInvoice),
278
+ SalesInvoiceRequest$outboundSchema.parse(salesInvoiceRequest),
279
279
  );
280
280
  }
281
- export function entitySalesInvoiceFromJSON(
281
+ export function salesInvoiceRequestFromJSON(
282
282
  jsonString: string,
283
- ): SafeParseResult<EntitySalesInvoice, SDKValidationError> {
283
+ ): SafeParseResult<SalesInvoiceRequest, SDKValidationError> {
284
284
  return safeParse(
285
285
  jsonString,
286
- (x) => EntitySalesInvoice$inboundSchema.parse(JSON.parse(x)),
287
- `Failed to parse 'EntitySalesInvoice' from JSON`,
286
+ (x) => SalesInvoiceRequest$inboundSchema.parse(JSON.parse(x)),
287
+ `Failed to parse 'SalesInvoiceRequest' from JSON`,
288
288
  );
289
289
  }
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../types/fp.js";
9
9
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
+ import { Mode, Mode$inboundSchema, Mode$outboundSchema } from "./mode.js";
10
11
  import {
11
12
  SalesInvoiceDiscountResponse,
12
13
  SalesInvoiceDiscountResponse$inboundSchema,
@@ -70,7 +71,7 @@ import {
70
71
  * @remarks
71
72
  * you fetch the entity with our API, we will also include the metadata. You can use up to approximately 1kB.
72
73
  */
73
- export type EntitySalesInvoiceResponseMetadata = {};
74
+ export type SalesInvoiceResponseMetadata = {};
74
75
 
75
76
  /**
76
77
  * The amount that is left to be paid.
@@ -145,7 +146,7 @@ export type DiscountedSubtotalAmount = {
145
146
  /**
146
147
  * An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
147
148
  */
148
- export type EntitySalesInvoiceResponseLinks = {
149
+ export type SalesInvoiceResponseLinks = {
149
150
  /**
150
151
  * In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.
151
152
  */
@@ -172,18 +173,22 @@ export type EntitySalesInvoiceResponseLinks = {
172
173
  previous?: Url | undefined;
173
174
  };
174
175
 
175
- export type EntitySalesInvoiceResponse = {
176
+ export type SalesInvoiceResponse = {
176
177
  /**
177
178
  * Indicates the response contains a sales invoice object. Will always contain the string `sales-invoice` for this
178
179
  *
179
180
  * @remarks
180
181
  * endpoint.
181
182
  */
182
- resource?: string | undefined;
183
+ resource: string;
183
184
  /**
184
185
  * The identifier uniquely referring to this invoice. Example: `invoice_4Y0eZitmBnQ6IDoMqZQKh`.
185
186
  */
186
- id?: string | undefined;
187
+ id: string;
188
+ /**
189
+ * Whether this entity was created in live mode or in test mode.
190
+ */
191
+ mode: Mode;
187
192
  /**
188
193
  * When issued, an invoice number will be set for the sales invoice.
189
194
  */
@@ -227,12 +232,12 @@ export type EntitySalesInvoiceResponse = {
227
232
  * @remarks
228
233
  * you fetch the entity with our API, we will also include the metadata. You can use up to approximately 1kB.
229
234
  */
230
- metadata?: EntitySalesInvoiceResponseMetadata | null | undefined;
235
+ metadata?: SalesInvoiceResponseMetadata | null | undefined;
231
236
  /**
232
237
  * The payment term to be set on the invoice.
233
238
  */
234
239
  paymentTerm?: SalesInvoicePaymentTermResponse | null | undefined;
235
- paymentDetails?: SalesInvoicePaymentDetailsResponse | null | undefined;
240
+ paymentDetails?: SalesInvoicePaymentDetailsResponse | undefined;
236
241
  emailDetails?: SalesInvoiceEmailDetails | null | undefined;
237
242
  /**
238
243
  * The identifier referring to the [customer](get-customer) you want to attempt an automated payment for. If
@@ -315,42 +320,41 @@ export type EntitySalesInvoiceResponse = {
315
320
  /**
316
321
  * An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
317
322
  */
318
- links?: EntitySalesInvoiceResponseLinks | undefined;
323
+ links?: SalesInvoiceResponseLinks | undefined;
319
324
  };
320
325
 
321
326
  /** @internal */
322
- export const EntitySalesInvoiceResponseMetadata$inboundSchema: z.ZodType<
323
- EntitySalesInvoiceResponseMetadata,
327
+ export const SalesInvoiceResponseMetadata$inboundSchema: z.ZodType<
328
+ SalesInvoiceResponseMetadata,
324
329
  z.ZodTypeDef,
325
330
  unknown
326
331
  > = z.object({});
327
332
  /** @internal */
328
- export type EntitySalesInvoiceResponseMetadata$Outbound = {};
333
+ export type SalesInvoiceResponseMetadata$Outbound = {};
329
334
 
330
335
  /** @internal */
331
- export const EntitySalesInvoiceResponseMetadata$outboundSchema: z.ZodType<
332
- EntitySalesInvoiceResponseMetadata$Outbound,
336
+ export const SalesInvoiceResponseMetadata$outboundSchema: z.ZodType<
337
+ SalesInvoiceResponseMetadata$Outbound,
333
338
  z.ZodTypeDef,
334
- EntitySalesInvoiceResponseMetadata
339
+ SalesInvoiceResponseMetadata
335
340
  > = z.object({});
336
341
 
337
- export function entitySalesInvoiceResponseMetadataToJSON(
338
- entitySalesInvoiceResponseMetadata: EntitySalesInvoiceResponseMetadata,
342
+ export function salesInvoiceResponseMetadataToJSON(
343
+ salesInvoiceResponseMetadata: SalesInvoiceResponseMetadata,
339
344
  ): string {
340
345
  return JSON.stringify(
341
- EntitySalesInvoiceResponseMetadata$outboundSchema.parse(
342
- entitySalesInvoiceResponseMetadata,
346
+ SalesInvoiceResponseMetadata$outboundSchema.parse(
347
+ salesInvoiceResponseMetadata,
343
348
  ),
344
349
  );
345
350
  }
346
- export function entitySalesInvoiceResponseMetadataFromJSON(
351
+ export function salesInvoiceResponseMetadataFromJSON(
347
352
  jsonString: string,
348
- ): SafeParseResult<EntitySalesInvoiceResponseMetadata, SDKValidationError> {
353
+ ): SafeParseResult<SalesInvoiceResponseMetadata, SDKValidationError> {
349
354
  return safeParse(
350
355
  jsonString,
351
- (x) =>
352
- EntitySalesInvoiceResponseMetadata$inboundSchema.parse(JSON.parse(x)),
353
- `Failed to parse 'EntitySalesInvoiceResponseMetadata' from JSON`,
356
+ (x) => SalesInvoiceResponseMetadata$inboundSchema.parse(JSON.parse(x)),
357
+ `Failed to parse 'SalesInvoiceResponseMetadata' from JSON`,
354
358
  );
355
359
  }
356
360
 
@@ -549,8 +553,8 @@ export function discountedSubtotalAmountFromJSON(
549
553
  }
550
554
 
551
555
  /** @internal */
552
- export const EntitySalesInvoiceResponseLinks$inboundSchema: z.ZodType<
553
- EntitySalesInvoiceResponseLinks,
556
+ export const SalesInvoiceResponseLinks$inboundSchema: z.ZodType<
557
+ SalesInvoiceResponseLinks,
554
558
  z.ZodTypeDef,
555
559
  unknown
556
560
  > = z.object({
@@ -562,7 +566,7 @@ export const EntitySalesInvoiceResponseLinks$inboundSchema: z.ZodType<
562
566
  previous: Url$inboundSchema.optional(),
563
567
  });
564
568
  /** @internal */
565
- export type EntitySalesInvoiceResponseLinks$Outbound = {
569
+ export type SalesInvoiceResponseLinks$Outbound = {
566
570
  self?: Url$Outbound | undefined;
567
571
  invoicePayment?: Url$Outbound | undefined;
568
572
  pdfLink?: Url$Outbound | undefined;
@@ -572,10 +576,10 @@ export type EntitySalesInvoiceResponseLinks$Outbound = {
572
576
  };
573
577
 
574
578
  /** @internal */
575
- export const EntitySalesInvoiceResponseLinks$outboundSchema: z.ZodType<
576
- EntitySalesInvoiceResponseLinks$Outbound,
579
+ export const SalesInvoiceResponseLinks$outboundSchema: z.ZodType<
580
+ SalesInvoiceResponseLinks$Outbound,
577
581
  z.ZodTypeDef,
578
- EntitySalesInvoiceResponseLinks
582
+ SalesInvoiceResponseLinks
579
583
  > = z.object({
580
584
  self: Url$outboundSchema.optional(),
581
585
  invoicePayment: Url$outboundSchema.optional(),
@@ -585,45 +589,42 @@ export const EntitySalesInvoiceResponseLinks$outboundSchema: z.ZodType<
585
589
  previous: Url$outboundSchema.optional(),
586
590
  });
587
591
 
588
- export function entitySalesInvoiceResponseLinksToJSON(
589
- entitySalesInvoiceResponseLinks: EntitySalesInvoiceResponseLinks,
592
+ export function salesInvoiceResponseLinksToJSON(
593
+ salesInvoiceResponseLinks: SalesInvoiceResponseLinks,
590
594
  ): string {
591
595
  return JSON.stringify(
592
- EntitySalesInvoiceResponseLinks$outboundSchema.parse(
593
- entitySalesInvoiceResponseLinks,
594
- ),
596
+ SalesInvoiceResponseLinks$outboundSchema.parse(salesInvoiceResponseLinks),
595
597
  );
596
598
  }
597
- export function entitySalesInvoiceResponseLinksFromJSON(
599
+ export function salesInvoiceResponseLinksFromJSON(
598
600
  jsonString: string,
599
- ): SafeParseResult<EntitySalesInvoiceResponseLinks, SDKValidationError> {
601
+ ): SafeParseResult<SalesInvoiceResponseLinks, SDKValidationError> {
600
602
  return safeParse(
601
603
  jsonString,
602
- (x) => EntitySalesInvoiceResponseLinks$inboundSchema.parse(JSON.parse(x)),
603
- `Failed to parse 'EntitySalesInvoiceResponseLinks' from JSON`,
604
+ (x) => SalesInvoiceResponseLinks$inboundSchema.parse(JSON.parse(x)),
605
+ `Failed to parse 'SalesInvoiceResponseLinks' from JSON`,
604
606
  );
605
607
  }
606
608
 
607
609
  /** @internal */
608
- export const EntitySalesInvoiceResponse$inboundSchema: z.ZodType<
609
- EntitySalesInvoiceResponse,
610
+ export const SalesInvoiceResponse$inboundSchema: z.ZodType<
611
+ SalesInvoiceResponse,
610
612
  z.ZodTypeDef,
611
613
  unknown
612
614
  > = z.object({
613
- resource: z.string().optional(),
614
- id: z.string().optional(),
615
+ resource: z.string(),
616
+ id: z.string(),
617
+ mode: Mode$inboundSchema,
615
618
  invoiceNumber: z.nullable(z.string()).optional(),
616
619
  status: SalesInvoiceStatusResponse$inboundSchema.optional(),
617
620
  vatScheme: SalesInvoiceVatSchemeResponse$inboundSchema.optional(),
618
621
  vatMode: SalesInvoiceVatModeResponse$inboundSchema.optional(),
619
622
  memo: z.nullable(z.string()).optional(),
620
- metadata: z.nullable(
621
- z.lazy(() => EntitySalesInvoiceResponseMetadata$inboundSchema),
622
- ).optional(),
623
- paymentTerm: z.nullable(SalesInvoicePaymentTermResponse$inboundSchema)
623
+ metadata: z.nullable(z.lazy(() => SalesInvoiceResponseMetadata$inboundSchema))
624
624
  .optional(),
625
- paymentDetails: z.nullable(SalesInvoicePaymentDetailsResponse$inboundSchema)
625
+ paymentTerm: z.nullable(SalesInvoicePaymentTermResponse$inboundSchema)
626
626
  .optional(),
627
+ paymentDetails: SalesInvoicePaymentDetailsResponse$inboundSchema.optional(),
627
628
  emailDetails: z.nullable(SalesInvoiceEmailDetails$inboundSchema).optional(),
628
629
  customerId: z.string().optional(),
629
630
  mandateId: z.string().optional(),
@@ -642,28 +643,25 @@ export const EntitySalesInvoiceResponse$inboundSchema: z.ZodType<
642
643
  issuedAt: z.nullable(z.string()).optional(),
643
644
  paidAt: z.nullable(z.string()).optional(),
644
645
  dueAt: z.nullable(z.string()).optional(),
645
- _links: z.lazy(() => EntitySalesInvoiceResponseLinks$inboundSchema)
646
- .optional(),
646
+ _links: z.lazy(() => SalesInvoiceResponseLinks$inboundSchema).optional(),
647
647
  }).transform((v) => {
648
648
  return remap$(v, {
649
649
  "_links": "links",
650
650
  });
651
651
  });
652
652
  /** @internal */
653
- export type EntitySalesInvoiceResponse$Outbound = {
654
- resource?: string | undefined;
655
- id?: string | undefined;
653
+ export type SalesInvoiceResponse$Outbound = {
654
+ resource: string;
655
+ id: string;
656
+ mode: string;
656
657
  invoiceNumber?: string | null | undefined;
657
658
  status?: string | undefined;
658
659
  vatScheme?: string | undefined;
659
660
  vatMode?: string | undefined;
660
661
  memo?: string | null | undefined;
661
- metadata?: EntitySalesInvoiceResponseMetadata$Outbound | null | undefined;
662
+ metadata?: SalesInvoiceResponseMetadata$Outbound | null | undefined;
662
663
  paymentTerm?: string | null | undefined;
663
- paymentDetails?:
664
- | SalesInvoicePaymentDetailsResponse$Outbound
665
- | null
666
- | undefined;
664
+ paymentDetails?: SalesInvoicePaymentDetailsResponse$Outbound | undefined;
667
665
  emailDetails?: SalesInvoiceEmailDetails$Outbound | null | undefined;
668
666
  customerId?: string | undefined;
669
667
  mandateId?: string | undefined;
@@ -680,29 +678,29 @@ export type EntitySalesInvoiceResponse$Outbound = {
680
678
  issuedAt?: string | null | undefined;
681
679
  paidAt?: string | null | undefined;
682
680
  dueAt?: string | null | undefined;
683
- _links?: EntitySalesInvoiceResponseLinks$Outbound | undefined;
681
+ _links?: SalesInvoiceResponseLinks$Outbound | undefined;
684
682
  };
685
683
 
686
684
  /** @internal */
687
- export const EntitySalesInvoiceResponse$outboundSchema: z.ZodType<
688
- EntitySalesInvoiceResponse$Outbound,
685
+ export const SalesInvoiceResponse$outboundSchema: z.ZodType<
686
+ SalesInvoiceResponse$Outbound,
689
687
  z.ZodTypeDef,
690
- EntitySalesInvoiceResponse
688
+ SalesInvoiceResponse
691
689
  > = z.object({
692
- resource: z.string().optional(),
693
- id: z.string().optional(),
690
+ resource: z.string(),
691
+ id: z.string(),
692
+ mode: Mode$outboundSchema,
694
693
  invoiceNumber: z.nullable(z.string()).optional(),
695
694
  status: SalesInvoiceStatusResponse$outboundSchema.optional(),
696
695
  vatScheme: SalesInvoiceVatSchemeResponse$outboundSchema.optional(),
697
696
  vatMode: SalesInvoiceVatModeResponse$outboundSchema.optional(),
698
697
  memo: z.nullable(z.string()).optional(),
699
698
  metadata: z.nullable(
700
- z.lazy(() => EntitySalesInvoiceResponseMetadata$outboundSchema),
699
+ z.lazy(() => SalesInvoiceResponseMetadata$outboundSchema),
701
700
  ).optional(),
702
701
  paymentTerm: z.nullable(SalesInvoicePaymentTermResponse$outboundSchema)
703
702
  .optional(),
704
- paymentDetails: z.nullable(SalesInvoicePaymentDetailsResponse$outboundSchema)
705
- .optional(),
703
+ paymentDetails: SalesInvoicePaymentDetailsResponse$outboundSchema.optional(),
706
704
  emailDetails: z.nullable(SalesInvoiceEmailDetails$outboundSchema).optional(),
707
705
  customerId: z.string().optional(),
708
706
  mandateId: z.string().optional(),
@@ -723,27 +721,26 @@ export const EntitySalesInvoiceResponse$outboundSchema: z.ZodType<
723
721
  issuedAt: z.nullable(z.string()).optional(),
724
722
  paidAt: z.nullable(z.string()).optional(),
725
723
  dueAt: z.nullable(z.string()).optional(),
726
- links: z.lazy(() => EntitySalesInvoiceResponseLinks$outboundSchema)
727
- .optional(),
724
+ links: z.lazy(() => SalesInvoiceResponseLinks$outboundSchema).optional(),
728
725
  }).transform((v) => {
729
726
  return remap$(v, {
730
727
  links: "_links",
731
728
  });
732
729
  });
733
730
 
734
- export function entitySalesInvoiceResponseToJSON(
735
- entitySalesInvoiceResponse: EntitySalesInvoiceResponse,
731
+ export function salesInvoiceResponseToJSON(
732
+ salesInvoiceResponse: SalesInvoiceResponse,
736
733
  ): string {
737
734
  return JSON.stringify(
738
- EntitySalesInvoiceResponse$outboundSchema.parse(entitySalesInvoiceResponse),
735
+ SalesInvoiceResponse$outboundSchema.parse(salesInvoiceResponse),
739
736
  );
740
737
  }
741
- export function entitySalesInvoiceResponseFromJSON(
738
+ export function salesInvoiceResponseFromJSON(
742
739
  jsonString: string,
743
- ): SafeParseResult<EntitySalesInvoiceResponse, SDKValidationError> {
740
+ ): SafeParseResult<SalesInvoiceResponse, SDKValidationError> {
744
741
  return safeParse(
745
742
  jsonString,
746
- (x) => EntitySalesInvoiceResponse$inboundSchema.parse(JSON.parse(x)),
747
- `Failed to parse 'EntitySalesInvoiceResponse' from JSON`,
743
+ (x) => SalesInvoiceResponse$inboundSchema.parse(JSON.parse(x)),
744
+ `Failed to parse 'SalesInvoiceResponse' from JSON`,
748
745
  );
749
746
  }
@@ -83,7 +83,7 @@ export type UpdateValuesSalesInvoice = {
83
83
  * The payment term to be set on the invoice.
84
84
  */
85
85
  paymentTerm?: SalesInvoicePaymentTerm | null | undefined;
86
- paymentDetails?: SalesInvoicePaymentDetails | null | undefined;
86
+ paymentDetails?: SalesInvoicePaymentDetails | undefined;
87
87
  emailDetails?: SalesInvoiceEmailDetails | null | undefined;
88
88
  /**
89
89
  * An identifier tied to the recipient data. This should be a unique value based on data your system contains,
@@ -116,8 +116,7 @@ export const UpdateValuesSalesInvoice$inboundSchema: z.ZodType<
116
116
  status: SalesInvoiceStatus$inboundSchema.optional(),
117
117
  memo: z.nullable(z.string()).optional(),
118
118
  paymentTerm: z.nullable(SalesInvoicePaymentTerm$inboundSchema).optional(),
119
- paymentDetails: z.nullable(SalesInvoicePaymentDetails$inboundSchema)
120
- .optional(),
119
+ paymentDetails: SalesInvoicePaymentDetails$inboundSchema.optional(),
121
120
  emailDetails: z.nullable(SalesInvoiceEmailDetails$inboundSchema).optional(),
122
121
  recipientIdentifier: z.string().optional(),
123
122
  recipient: z.nullable(SalesInvoiceRecipient$inboundSchema).optional(),
@@ -130,7 +129,7 @@ export type UpdateValuesSalesInvoice$Outbound = {
130
129
  status?: string | undefined;
131
130
  memo?: string | null | undefined;
132
131
  paymentTerm?: string | null | undefined;
133
- paymentDetails?: SalesInvoicePaymentDetails$Outbound | null | undefined;
132
+ paymentDetails?: SalesInvoicePaymentDetails$Outbound | undefined;
134
133
  emailDetails?: SalesInvoiceEmailDetails$Outbound | null | undefined;
135
134
  recipientIdentifier?: string | undefined;
136
135
  recipient?: SalesInvoiceRecipient$Outbound | null | undefined;
@@ -148,8 +147,7 @@ export const UpdateValuesSalesInvoice$outboundSchema: z.ZodType<
148
147
  status: SalesInvoiceStatus$outboundSchema.optional(),
149
148
  memo: z.nullable(z.string()).optional(),
150
149
  paymentTerm: z.nullable(SalesInvoicePaymentTerm$outboundSchema).optional(),
151
- paymentDetails: z.nullable(SalesInvoicePaymentDetails$outboundSchema)
152
- .optional(),
150
+ paymentDetails: SalesInvoicePaymentDetails$outboundSchema.optional(),
153
151
  emailDetails: z.nullable(SalesInvoiceEmailDetails$outboundSchema).optional(),
154
152
  recipientIdentifier: z.string().optional(),
155
153
  recipient: z.nullable(SalesInvoiceRecipient$outboundSchema).optional(),
@@ -26,7 +26,7 @@ export class SalesInvoices extends ClientSDK {
26
26
  async create(
27
27
  request?: operations.CreateSalesInvoiceRequest | undefined,
28
28
  options?: RequestOptions,
29
- ): Promise<models.EntitySalesInvoiceResponse> {
29
+ ): Promise<models.SalesInvoiceResponse> {
30
30
  return unwrapAsync(salesInvoicesCreate(
31
31
  this,
32
32
  request,
@@ -70,7 +70,7 @@ export class SalesInvoices extends ClientSDK {
70
70
  async get(
71
71
  request: operations.GetSalesInvoiceRequest,
72
72
  options?: RequestOptions,
73
- ): Promise<models.EntitySalesInvoiceResponse> {
73
+ ): Promise<models.SalesInvoiceResponse> {
74
74
  return unwrapAsync(salesInvoicesGet(
75
75
  this,
76
76
  request,
@@ -93,7 +93,7 @@ export class SalesInvoices extends ClientSDK {
93
93
  async update(
94
94
  request: operations.UpdateSalesInvoiceRequest,
95
95
  options?: RequestOptions,
96
- ): Promise<models.EntitySalesInvoiceResponse> {
96
+ ): Promise<models.SalesInvoiceResponse> {
97
97
  return unwrapAsync(salesInvoicesUpdate(
98
98
  this,
99
99
  request,
@@ -3,34 +3,14 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { Unrecognized, unrecognized } from "./unrecognized.js";
6
7
 
7
- declare const __brand: unique symbol;
8
- export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
9
8
  export type ClosedEnum<T extends Readonly<Record<string, string | number>>> =
10
9
  T[keyof T];
11
10
  export type OpenEnum<T extends Readonly<Record<string, string | number>>> =
12
11
  | T[keyof T]
13
12
  | Unrecognized<T[keyof T] extends number ? number : string>;
14
13
 
15
- function unrecognized<T>(value: T): Unrecognized<T> {
16
- unrecognizedCount++;
17
- return value as Unrecognized<T>;
18
- }
19
-
20
- let unrecognizedCount = 0;
21
- let refCount = 0;
22
- export function unrecognizedCounter() {
23
- refCount++;
24
- const start = unrecognizedCount;
25
- return {
26
- count: () => {
27
- const count = unrecognizedCount - start;
28
- if (--refCount === 0) unrecognizedCount = 0;
29
- return count;
30
- },
31
- };
32
- }
33
-
34
14
  export function inboundSchema<T extends Record<string, string>>(
35
15
  enumObj: T,
36
16
  ): z.ZodType<OpenEnum<T>, z.ZodTypeDef, unknown> {
@@ -3,8 +3,9 @@
3
3
  */
4
4
 
5
5
  export { blobLikeSchema, isBlobLike } from "./blobs.js";
6
- export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js";
6
+ export type { ClosedEnum, OpenEnum } from "./enums.js";
7
7
  export type { Result } from "./fp.js";
8
8
  export type { PageIterator, Paginator } from "./operations.js";
9
9
  export { createPageIterator } from "./operations.js";
10
10
  export { RFCDate } from "./rfcdate.js";
11
+ export * from "./unrecognized.js";