@greensecurity/javascript-sdk 0.35.23 → 0.35.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/bin/mcp-server.js +869 -378
- package/bin/mcp-server.js.map +10 -7
- package/dist/commonjs/__tests__/invoices.test.js +18 -0
- package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +7 -48
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/invoicesUpdateInvoice.d.ts +26 -0
- package/dist/commonjs/funcs/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/commonjs/funcs/invoicesUpdateInvoice.js +133 -0
- package/dist/commonjs/funcs/invoicesUpdateInvoice.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.js +73 -0
- package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/updateinvoice.d.ts +441 -0
- package/dist/commonjs/models/operations/updateinvoice.d.ts.map +1 -0
- package/dist/commonjs/models/operations/updateinvoice.js +622 -0
- package/dist/commonjs/models/operations/updateinvoice.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/invoicesUpdateInvoice.d.ts +32 -0
- package/dist/commonjs/react-query/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/commonjs/react-query/invoicesUpdateInvoice.js +56 -0
- package/dist/commonjs/react-query/invoicesUpdateInvoice.js.map +1 -0
- package/dist/commonjs/sdk/invoices.d.ts +16 -0
- package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
- package/dist/commonjs/sdk/invoices.js +19 -0
- package/dist/commonjs/sdk/invoices.js.map +1 -1
- package/dist/esm/__tests__/invoices.test.js +18 -0
- package/dist/esm/__tests__/invoices.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +7 -48
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/invoicesUpdateInvoice.d.ts +26 -0
- package/dist/esm/funcs/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/esm/funcs/invoicesUpdateInvoice.js +97 -0
- package/dist/esm/funcs/invoicesUpdateInvoice.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.d.ts +8 -0
- package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.js +37 -0
- package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/updateinvoice.d.ts +441 -0
- package/dist/esm/models/operations/updateinvoice.d.ts.map +1 -0
- package/dist/esm/models/operations/updateinvoice.js +566 -0
- package/dist/esm/models/operations/updateinvoice.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/invoicesUpdateInvoice.d.ts +32 -0
- package/dist/esm/react-query/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/esm/react-query/invoicesUpdateInvoice.js +51 -0
- package/dist/esm/react-query/invoicesUpdateInvoice.js.map +1 -0
- package/dist/esm/sdk/invoices.d.ts +16 -0
- package/dist/esm/sdk/invoices.d.ts.map +1 -1
- package/dist/esm/sdk/invoices.js +19 -0
- package/dist/esm/sdk/invoices.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/invoices.test.ts +21 -0
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +7 -48
- package/src/funcs/invoicesUpdateInvoice.ts +182 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/invoicesUpdateInvoice.ts +46 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/updateinvoice.ts +1002 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/invoicesUpdateInvoice.ts +97 -0
- package/src/sdk/invoices.ts +27 -0
|
@@ -0,0 +1,1002 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { RFCDate } from "../../types/rfcdate.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export const UpdateInvoiceRequestBodyInvoicesPaymentHandler = {
|
|
14
|
+
VendorCredential: "vendor credential",
|
|
15
|
+
CredentialingSubscription: "credentialing subscription",
|
|
16
|
+
ExpeditedCredential: "expedited credential",
|
|
17
|
+
} as const;
|
|
18
|
+
export type UpdateInvoiceRequestBodyInvoicesPaymentHandler = ClosedEnum<
|
|
19
|
+
typeof UpdateInvoiceRequestBodyInvoicesPaymentHandler
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export type UpdateInvoiceRequestBodyInvoicesLines = {
|
|
23
|
+
variantId: number;
|
|
24
|
+
unitPrice?: number | undefined;
|
|
25
|
+
quantity?: number | undefined;
|
|
26
|
+
subscriptionId?: number | undefined;
|
|
27
|
+
dateStarts?: RFCDate | undefined;
|
|
28
|
+
dateEnds?: RFCDate | undefined;
|
|
29
|
+
paymentHandler?: UpdateInvoiceRequestBodyInvoicesPaymentHandler | undefined;
|
|
30
|
+
paymentHandlerData?: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type Four = {
|
|
34
|
+
systemId: number;
|
|
35
|
+
lines?: Array<UpdateInvoiceRequestBodyInvoicesLines> | undefined;
|
|
36
|
+
vendorCredentialId?: number | undefined;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const UpdateInvoiceRequestBodyPaymentHandler = {
|
|
40
|
+
VendorCredential: "vendor credential",
|
|
41
|
+
CredentialingSubscription: "credentialing subscription",
|
|
42
|
+
ExpeditedCredential: "expedited credential",
|
|
43
|
+
} as const;
|
|
44
|
+
export type UpdateInvoiceRequestBodyPaymentHandler = ClosedEnum<
|
|
45
|
+
typeof UpdateInvoiceRequestBodyPaymentHandler
|
|
46
|
+
>;
|
|
47
|
+
|
|
48
|
+
export type UpdateInvoiceRequestBodyLines = {
|
|
49
|
+
variantId: number;
|
|
50
|
+
unitPrice?: number | undefined;
|
|
51
|
+
quantity?: number | undefined;
|
|
52
|
+
subscriptionId?: number | undefined;
|
|
53
|
+
dateStarts?: RFCDate | undefined;
|
|
54
|
+
dateEnds?: RFCDate | undefined;
|
|
55
|
+
paymentHandler?: UpdateInvoiceRequestBodyPaymentHandler | undefined;
|
|
56
|
+
paymentHandlerData?: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type Three = {
|
|
60
|
+
facilityId: number;
|
|
61
|
+
lines?: Array<UpdateInvoiceRequestBodyLines> | undefined;
|
|
62
|
+
vendorCredentialId?: number | undefined;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const RequestBodyPaymentHandler = {
|
|
66
|
+
VendorCredential: "vendor credential",
|
|
67
|
+
CredentialingSubscription: "credentialing subscription",
|
|
68
|
+
ExpeditedCredential: "expedited credential",
|
|
69
|
+
} as const;
|
|
70
|
+
export type RequestBodyPaymentHandler = ClosedEnum<
|
|
71
|
+
typeof RequestBodyPaymentHandler
|
|
72
|
+
>;
|
|
73
|
+
|
|
74
|
+
export type RequestBodyLines = {
|
|
75
|
+
variantId: number;
|
|
76
|
+
unitPrice?: number | undefined;
|
|
77
|
+
quantity?: number | undefined;
|
|
78
|
+
subscriptionId?: number | undefined;
|
|
79
|
+
dateStarts?: RFCDate | undefined;
|
|
80
|
+
dateEnds?: RFCDate | undefined;
|
|
81
|
+
paymentHandler?: RequestBodyPaymentHandler | undefined;
|
|
82
|
+
paymentHandlerData?: string | undefined;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type RequestBody2 = {
|
|
86
|
+
companyId: number;
|
|
87
|
+
lines?: Array<RequestBodyLines> | undefined;
|
|
88
|
+
vendorCredentialId?: number | undefined;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const PaymentHandler = {
|
|
92
|
+
VendorCredential: "vendor credential",
|
|
93
|
+
CredentialingSubscription: "credentialing subscription",
|
|
94
|
+
ExpeditedCredential: "expedited credential",
|
|
95
|
+
} as const;
|
|
96
|
+
export type PaymentHandler = ClosedEnum<typeof PaymentHandler>;
|
|
97
|
+
|
|
98
|
+
export type Lines = {
|
|
99
|
+
variantId: number;
|
|
100
|
+
unitPrice?: number | undefined;
|
|
101
|
+
quantity?: number | undefined;
|
|
102
|
+
subscriptionId?: number | undefined;
|
|
103
|
+
dateStarts?: RFCDate | undefined;
|
|
104
|
+
dateEnds?: RFCDate | undefined;
|
|
105
|
+
paymentHandler?: PaymentHandler | undefined;
|
|
106
|
+
paymentHandlerData?: string | undefined;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export type RequestBody1 = {
|
|
110
|
+
vendorId: number;
|
|
111
|
+
lines?: Array<Lines> | undefined;
|
|
112
|
+
vendorCredentialId?: number | undefined;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export type UpdateInvoiceRequestBody =
|
|
116
|
+
| RequestBody1
|
|
117
|
+
| RequestBody2
|
|
118
|
+
| Three
|
|
119
|
+
| Four;
|
|
120
|
+
|
|
121
|
+
export type UpdateInvoiceRequest = {
|
|
122
|
+
/**
|
|
123
|
+
* The identifier of the object
|
|
124
|
+
*/
|
|
125
|
+
id: number;
|
|
126
|
+
requestBody: RequestBody1 | RequestBody2 | Three | Four;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** @internal */
|
|
130
|
+
export const UpdateInvoiceRequestBodyInvoicesPaymentHandler$inboundSchema:
|
|
131
|
+
z.ZodNativeEnum<typeof UpdateInvoiceRequestBodyInvoicesPaymentHandler> = z
|
|
132
|
+
.nativeEnum(UpdateInvoiceRequestBodyInvoicesPaymentHandler);
|
|
133
|
+
|
|
134
|
+
/** @internal */
|
|
135
|
+
export const UpdateInvoiceRequestBodyInvoicesPaymentHandler$outboundSchema:
|
|
136
|
+
z.ZodNativeEnum<typeof UpdateInvoiceRequestBodyInvoicesPaymentHandler> =
|
|
137
|
+
UpdateInvoiceRequestBodyInvoicesPaymentHandler$inboundSchema;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @internal
|
|
141
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
142
|
+
*/
|
|
143
|
+
export namespace UpdateInvoiceRequestBodyInvoicesPaymentHandler$ {
|
|
144
|
+
/** @deprecated use `UpdateInvoiceRequestBodyInvoicesPaymentHandler$inboundSchema` instead. */
|
|
145
|
+
export const inboundSchema =
|
|
146
|
+
UpdateInvoiceRequestBodyInvoicesPaymentHandler$inboundSchema;
|
|
147
|
+
/** @deprecated use `UpdateInvoiceRequestBodyInvoicesPaymentHandler$outboundSchema` instead. */
|
|
148
|
+
export const outboundSchema =
|
|
149
|
+
UpdateInvoiceRequestBodyInvoicesPaymentHandler$outboundSchema;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** @internal */
|
|
153
|
+
export const UpdateInvoiceRequestBodyInvoicesLines$inboundSchema: z.ZodType<
|
|
154
|
+
UpdateInvoiceRequestBodyInvoicesLines,
|
|
155
|
+
z.ZodTypeDef,
|
|
156
|
+
unknown
|
|
157
|
+
> = z.object({
|
|
158
|
+
variant_id: z.number().int(),
|
|
159
|
+
unit_price: z.number().optional(),
|
|
160
|
+
quantity: z.number().int().optional(),
|
|
161
|
+
subscription_id: z.number().int().optional(),
|
|
162
|
+
date_starts: z.string().transform(v => new RFCDate(v)).optional(),
|
|
163
|
+
date_ends: z.string().transform(v => new RFCDate(v)).optional(),
|
|
164
|
+
payment_handler: UpdateInvoiceRequestBodyInvoicesPaymentHandler$inboundSchema
|
|
165
|
+
.optional(),
|
|
166
|
+
payment_handler_data: z.string().optional(),
|
|
167
|
+
}).transform((v) => {
|
|
168
|
+
return remap$(v, {
|
|
169
|
+
"variant_id": "variantId",
|
|
170
|
+
"unit_price": "unitPrice",
|
|
171
|
+
"subscription_id": "subscriptionId",
|
|
172
|
+
"date_starts": "dateStarts",
|
|
173
|
+
"date_ends": "dateEnds",
|
|
174
|
+
"payment_handler": "paymentHandler",
|
|
175
|
+
"payment_handler_data": "paymentHandlerData",
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
/** @internal */
|
|
180
|
+
export type UpdateInvoiceRequestBodyInvoicesLines$Outbound = {
|
|
181
|
+
variant_id: number;
|
|
182
|
+
unit_price?: number | undefined;
|
|
183
|
+
quantity?: number | undefined;
|
|
184
|
+
subscription_id?: number | undefined;
|
|
185
|
+
date_starts?: string | undefined;
|
|
186
|
+
date_ends?: string | undefined;
|
|
187
|
+
payment_handler?: string | undefined;
|
|
188
|
+
payment_handler_data?: string | undefined;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
/** @internal */
|
|
192
|
+
export const UpdateInvoiceRequestBodyInvoicesLines$outboundSchema: z.ZodType<
|
|
193
|
+
UpdateInvoiceRequestBodyInvoicesLines$Outbound,
|
|
194
|
+
z.ZodTypeDef,
|
|
195
|
+
UpdateInvoiceRequestBodyInvoicesLines
|
|
196
|
+
> = z.object({
|
|
197
|
+
variantId: z.number().int(),
|
|
198
|
+
unitPrice: z.number().optional(),
|
|
199
|
+
quantity: z.number().int().optional(),
|
|
200
|
+
subscriptionId: z.number().int().optional(),
|
|
201
|
+
dateStarts: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
202
|
+
dateEnds: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
203
|
+
paymentHandler: UpdateInvoiceRequestBodyInvoicesPaymentHandler$outboundSchema
|
|
204
|
+
.optional(),
|
|
205
|
+
paymentHandlerData: z.string().optional(),
|
|
206
|
+
}).transform((v) => {
|
|
207
|
+
return remap$(v, {
|
|
208
|
+
variantId: "variant_id",
|
|
209
|
+
unitPrice: "unit_price",
|
|
210
|
+
subscriptionId: "subscription_id",
|
|
211
|
+
dateStarts: "date_starts",
|
|
212
|
+
dateEnds: "date_ends",
|
|
213
|
+
paymentHandler: "payment_handler",
|
|
214
|
+
paymentHandlerData: "payment_handler_data",
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @internal
|
|
220
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
221
|
+
*/
|
|
222
|
+
export namespace UpdateInvoiceRequestBodyInvoicesLines$ {
|
|
223
|
+
/** @deprecated use `UpdateInvoiceRequestBodyInvoicesLines$inboundSchema` instead. */
|
|
224
|
+
export const inboundSchema =
|
|
225
|
+
UpdateInvoiceRequestBodyInvoicesLines$inboundSchema;
|
|
226
|
+
/** @deprecated use `UpdateInvoiceRequestBodyInvoicesLines$outboundSchema` instead. */
|
|
227
|
+
export const outboundSchema =
|
|
228
|
+
UpdateInvoiceRequestBodyInvoicesLines$outboundSchema;
|
|
229
|
+
/** @deprecated use `UpdateInvoiceRequestBodyInvoicesLines$Outbound` instead. */
|
|
230
|
+
export type Outbound = UpdateInvoiceRequestBodyInvoicesLines$Outbound;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export function updateInvoiceRequestBodyInvoicesLinesToJSON(
|
|
234
|
+
updateInvoiceRequestBodyInvoicesLines: UpdateInvoiceRequestBodyInvoicesLines,
|
|
235
|
+
): string {
|
|
236
|
+
return JSON.stringify(
|
|
237
|
+
UpdateInvoiceRequestBodyInvoicesLines$outboundSchema.parse(
|
|
238
|
+
updateInvoiceRequestBodyInvoicesLines,
|
|
239
|
+
),
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export function updateInvoiceRequestBodyInvoicesLinesFromJSON(
|
|
244
|
+
jsonString: string,
|
|
245
|
+
): SafeParseResult<UpdateInvoiceRequestBodyInvoicesLines, SDKValidationError> {
|
|
246
|
+
return safeParse(
|
|
247
|
+
jsonString,
|
|
248
|
+
(x) =>
|
|
249
|
+
UpdateInvoiceRequestBodyInvoicesLines$inboundSchema.parse(JSON.parse(x)),
|
|
250
|
+
`Failed to parse 'UpdateInvoiceRequestBodyInvoicesLines' from JSON`,
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** @internal */
|
|
255
|
+
export const Four$inboundSchema: z.ZodType<Four, z.ZodTypeDef, unknown> = z
|
|
256
|
+
.object({
|
|
257
|
+
system_id: z.number().int(),
|
|
258
|
+
lines: z.array(
|
|
259
|
+
z.lazy(() => UpdateInvoiceRequestBodyInvoicesLines$inboundSchema),
|
|
260
|
+
).optional(),
|
|
261
|
+
vendor_credential_id: z.number().int().optional(),
|
|
262
|
+
}).transform((v) => {
|
|
263
|
+
return remap$(v, {
|
|
264
|
+
"system_id": "systemId",
|
|
265
|
+
"vendor_credential_id": "vendorCredentialId",
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
/** @internal */
|
|
270
|
+
export type Four$Outbound = {
|
|
271
|
+
system_id: number;
|
|
272
|
+
lines?: Array<UpdateInvoiceRequestBodyInvoicesLines$Outbound> | undefined;
|
|
273
|
+
vendor_credential_id?: number | undefined;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
/** @internal */
|
|
277
|
+
export const Four$outboundSchema: z.ZodType<Four$Outbound, z.ZodTypeDef, Four> =
|
|
278
|
+
z.object({
|
|
279
|
+
systemId: z.number().int(),
|
|
280
|
+
lines: z.array(
|
|
281
|
+
z.lazy(() => UpdateInvoiceRequestBodyInvoicesLines$outboundSchema),
|
|
282
|
+
).optional(),
|
|
283
|
+
vendorCredentialId: z.number().int().optional(),
|
|
284
|
+
}).transform((v) => {
|
|
285
|
+
return remap$(v, {
|
|
286
|
+
systemId: "system_id",
|
|
287
|
+
vendorCredentialId: "vendor_credential_id",
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @internal
|
|
293
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
294
|
+
*/
|
|
295
|
+
export namespace Four$ {
|
|
296
|
+
/** @deprecated use `Four$inboundSchema` instead. */
|
|
297
|
+
export const inboundSchema = Four$inboundSchema;
|
|
298
|
+
/** @deprecated use `Four$outboundSchema` instead. */
|
|
299
|
+
export const outboundSchema = Four$outboundSchema;
|
|
300
|
+
/** @deprecated use `Four$Outbound` instead. */
|
|
301
|
+
export type Outbound = Four$Outbound;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export function fourToJSON(four: Four): string {
|
|
305
|
+
return JSON.stringify(Four$outboundSchema.parse(four));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export function fourFromJSON(
|
|
309
|
+
jsonString: string,
|
|
310
|
+
): SafeParseResult<Four, SDKValidationError> {
|
|
311
|
+
return safeParse(
|
|
312
|
+
jsonString,
|
|
313
|
+
(x) => Four$inboundSchema.parse(JSON.parse(x)),
|
|
314
|
+
`Failed to parse 'Four' from JSON`,
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** @internal */
|
|
319
|
+
export const UpdateInvoiceRequestBodyPaymentHandler$inboundSchema:
|
|
320
|
+
z.ZodNativeEnum<typeof UpdateInvoiceRequestBodyPaymentHandler> = z.nativeEnum(
|
|
321
|
+
UpdateInvoiceRequestBodyPaymentHandler,
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
/** @internal */
|
|
325
|
+
export const UpdateInvoiceRequestBodyPaymentHandler$outboundSchema:
|
|
326
|
+
z.ZodNativeEnum<typeof UpdateInvoiceRequestBodyPaymentHandler> =
|
|
327
|
+
UpdateInvoiceRequestBodyPaymentHandler$inboundSchema;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @internal
|
|
331
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
332
|
+
*/
|
|
333
|
+
export namespace UpdateInvoiceRequestBodyPaymentHandler$ {
|
|
334
|
+
/** @deprecated use `UpdateInvoiceRequestBodyPaymentHandler$inboundSchema` instead. */
|
|
335
|
+
export const inboundSchema =
|
|
336
|
+
UpdateInvoiceRequestBodyPaymentHandler$inboundSchema;
|
|
337
|
+
/** @deprecated use `UpdateInvoiceRequestBodyPaymentHandler$outboundSchema` instead. */
|
|
338
|
+
export const outboundSchema =
|
|
339
|
+
UpdateInvoiceRequestBodyPaymentHandler$outboundSchema;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/** @internal */
|
|
343
|
+
export const UpdateInvoiceRequestBodyLines$inboundSchema: z.ZodType<
|
|
344
|
+
UpdateInvoiceRequestBodyLines,
|
|
345
|
+
z.ZodTypeDef,
|
|
346
|
+
unknown
|
|
347
|
+
> = z.object({
|
|
348
|
+
variant_id: z.number().int(),
|
|
349
|
+
unit_price: z.number().optional(),
|
|
350
|
+
quantity: z.number().int().optional(),
|
|
351
|
+
subscription_id: z.number().int().optional(),
|
|
352
|
+
date_starts: z.string().transform(v => new RFCDate(v)).optional(),
|
|
353
|
+
date_ends: z.string().transform(v => new RFCDate(v)).optional(),
|
|
354
|
+
payment_handler: UpdateInvoiceRequestBodyPaymentHandler$inboundSchema
|
|
355
|
+
.optional(),
|
|
356
|
+
payment_handler_data: z.string().optional(),
|
|
357
|
+
}).transform((v) => {
|
|
358
|
+
return remap$(v, {
|
|
359
|
+
"variant_id": "variantId",
|
|
360
|
+
"unit_price": "unitPrice",
|
|
361
|
+
"subscription_id": "subscriptionId",
|
|
362
|
+
"date_starts": "dateStarts",
|
|
363
|
+
"date_ends": "dateEnds",
|
|
364
|
+
"payment_handler": "paymentHandler",
|
|
365
|
+
"payment_handler_data": "paymentHandlerData",
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
/** @internal */
|
|
370
|
+
export type UpdateInvoiceRequestBodyLines$Outbound = {
|
|
371
|
+
variant_id: number;
|
|
372
|
+
unit_price?: number | undefined;
|
|
373
|
+
quantity?: number | undefined;
|
|
374
|
+
subscription_id?: number | undefined;
|
|
375
|
+
date_starts?: string | undefined;
|
|
376
|
+
date_ends?: string | undefined;
|
|
377
|
+
payment_handler?: string | undefined;
|
|
378
|
+
payment_handler_data?: string | undefined;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
/** @internal */
|
|
382
|
+
export const UpdateInvoiceRequestBodyLines$outboundSchema: z.ZodType<
|
|
383
|
+
UpdateInvoiceRequestBodyLines$Outbound,
|
|
384
|
+
z.ZodTypeDef,
|
|
385
|
+
UpdateInvoiceRequestBodyLines
|
|
386
|
+
> = z.object({
|
|
387
|
+
variantId: z.number().int(),
|
|
388
|
+
unitPrice: z.number().optional(),
|
|
389
|
+
quantity: z.number().int().optional(),
|
|
390
|
+
subscriptionId: z.number().int().optional(),
|
|
391
|
+
dateStarts: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
392
|
+
dateEnds: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
393
|
+
paymentHandler: UpdateInvoiceRequestBodyPaymentHandler$outboundSchema
|
|
394
|
+
.optional(),
|
|
395
|
+
paymentHandlerData: z.string().optional(),
|
|
396
|
+
}).transform((v) => {
|
|
397
|
+
return remap$(v, {
|
|
398
|
+
variantId: "variant_id",
|
|
399
|
+
unitPrice: "unit_price",
|
|
400
|
+
subscriptionId: "subscription_id",
|
|
401
|
+
dateStarts: "date_starts",
|
|
402
|
+
dateEnds: "date_ends",
|
|
403
|
+
paymentHandler: "payment_handler",
|
|
404
|
+
paymentHandlerData: "payment_handler_data",
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* @internal
|
|
410
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
411
|
+
*/
|
|
412
|
+
export namespace UpdateInvoiceRequestBodyLines$ {
|
|
413
|
+
/** @deprecated use `UpdateInvoiceRequestBodyLines$inboundSchema` instead. */
|
|
414
|
+
export const inboundSchema = UpdateInvoiceRequestBodyLines$inboundSchema;
|
|
415
|
+
/** @deprecated use `UpdateInvoiceRequestBodyLines$outboundSchema` instead. */
|
|
416
|
+
export const outboundSchema = UpdateInvoiceRequestBodyLines$outboundSchema;
|
|
417
|
+
/** @deprecated use `UpdateInvoiceRequestBodyLines$Outbound` instead. */
|
|
418
|
+
export type Outbound = UpdateInvoiceRequestBodyLines$Outbound;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export function updateInvoiceRequestBodyLinesToJSON(
|
|
422
|
+
updateInvoiceRequestBodyLines: UpdateInvoiceRequestBodyLines,
|
|
423
|
+
): string {
|
|
424
|
+
return JSON.stringify(
|
|
425
|
+
UpdateInvoiceRequestBodyLines$outboundSchema.parse(
|
|
426
|
+
updateInvoiceRequestBodyLines,
|
|
427
|
+
),
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export function updateInvoiceRequestBodyLinesFromJSON(
|
|
432
|
+
jsonString: string,
|
|
433
|
+
): SafeParseResult<UpdateInvoiceRequestBodyLines, SDKValidationError> {
|
|
434
|
+
return safeParse(
|
|
435
|
+
jsonString,
|
|
436
|
+
(x) => UpdateInvoiceRequestBodyLines$inboundSchema.parse(JSON.parse(x)),
|
|
437
|
+
`Failed to parse 'UpdateInvoiceRequestBodyLines' from JSON`,
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/** @internal */
|
|
442
|
+
export const Three$inboundSchema: z.ZodType<Three, z.ZodTypeDef, unknown> = z
|
|
443
|
+
.object({
|
|
444
|
+
facility_id: z.number().int(),
|
|
445
|
+
lines: z.array(z.lazy(() => UpdateInvoiceRequestBodyLines$inboundSchema))
|
|
446
|
+
.optional(),
|
|
447
|
+
vendor_credential_id: z.number().int().optional(),
|
|
448
|
+
}).transform((v) => {
|
|
449
|
+
return remap$(v, {
|
|
450
|
+
"facility_id": "facilityId",
|
|
451
|
+
"vendor_credential_id": "vendorCredentialId",
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
/** @internal */
|
|
456
|
+
export type Three$Outbound = {
|
|
457
|
+
facility_id: number;
|
|
458
|
+
lines?: Array<UpdateInvoiceRequestBodyLines$Outbound> | undefined;
|
|
459
|
+
vendor_credential_id?: number | undefined;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
/** @internal */
|
|
463
|
+
export const Three$outboundSchema: z.ZodType<
|
|
464
|
+
Three$Outbound,
|
|
465
|
+
z.ZodTypeDef,
|
|
466
|
+
Three
|
|
467
|
+
> = z.object({
|
|
468
|
+
facilityId: z.number().int(),
|
|
469
|
+
lines: z.array(z.lazy(() => UpdateInvoiceRequestBodyLines$outboundSchema))
|
|
470
|
+
.optional(),
|
|
471
|
+
vendorCredentialId: z.number().int().optional(),
|
|
472
|
+
}).transform((v) => {
|
|
473
|
+
return remap$(v, {
|
|
474
|
+
facilityId: "facility_id",
|
|
475
|
+
vendorCredentialId: "vendor_credential_id",
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* @internal
|
|
481
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
482
|
+
*/
|
|
483
|
+
export namespace Three$ {
|
|
484
|
+
/** @deprecated use `Three$inboundSchema` instead. */
|
|
485
|
+
export const inboundSchema = Three$inboundSchema;
|
|
486
|
+
/** @deprecated use `Three$outboundSchema` instead. */
|
|
487
|
+
export const outboundSchema = Three$outboundSchema;
|
|
488
|
+
/** @deprecated use `Three$Outbound` instead. */
|
|
489
|
+
export type Outbound = Three$Outbound;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export function threeToJSON(three: Three): string {
|
|
493
|
+
return JSON.stringify(Three$outboundSchema.parse(three));
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export function threeFromJSON(
|
|
497
|
+
jsonString: string,
|
|
498
|
+
): SafeParseResult<Three, SDKValidationError> {
|
|
499
|
+
return safeParse(
|
|
500
|
+
jsonString,
|
|
501
|
+
(x) => Three$inboundSchema.parse(JSON.parse(x)),
|
|
502
|
+
`Failed to parse 'Three' from JSON`,
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/** @internal */
|
|
507
|
+
export const RequestBodyPaymentHandler$inboundSchema: z.ZodNativeEnum<
|
|
508
|
+
typeof RequestBodyPaymentHandler
|
|
509
|
+
> = z.nativeEnum(RequestBodyPaymentHandler);
|
|
510
|
+
|
|
511
|
+
/** @internal */
|
|
512
|
+
export const RequestBodyPaymentHandler$outboundSchema: z.ZodNativeEnum<
|
|
513
|
+
typeof RequestBodyPaymentHandler
|
|
514
|
+
> = RequestBodyPaymentHandler$inboundSchema;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* @internal
|
|
518
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
519
|
+
*/
|
|
520
|
+
export namespace RequestBodyPaymentHandler$ {
|
|
521
|
+
/** @deprecated use `RequestBodyPaymentHandler$inboundSchema` instead. */
|
|
522
|
+
export const inboundSchema = RequestBodyPaymentHandler$inboundSchema;
|
|
523
|
+
/** @deprecated use `RequestBodyPaymentHandler$outboundSchema` instead. */
|
|
524
|
+
export const outboundSchema = RequestBodyPaymentHandler$outboundSchema;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/** @internal */
|
|
528
|
+
export const RequestBodyLines$inboundSchema: z.ZodType<
|
|
529
|
+
RequestBodyLines,
|
|
530
|
+
z.ZodTypeDef,
|
|
531
|
+
unknown
|
|
532
|
+
> = z.object({
|
|
533
|
+
variant_id: z.number().int(),
|
|
534
|
+
unit_price: z.number().optional(),
|
|
535
|
+
quantity: z.number().int().optional(),
|
|
536
|
+
subscription_id: z.number().int().optional(),
|
|
537
|
+
date_starts: z.string().transform(v => new RFCDate(v)).optional(),
|
|
538
|
+
date_ends: z.string().transform(v => new RFCDate(v)).optional(),
|
|
539
|
+
payment_handler: RequestBodyPaymentHandler$inboundSchema.optional(),
|
|
540
|
+
payment_handler_data: z.string().optional(),
|
|
541
|
+
}).transform((v) => {
|
|
542
|
+
return remap$(v, {
|
|
543
|
+
"variant_id": "variantId",
|
|
544
|
+
"unit_price": "unitPrice",
|
|
545
|
+
"subscription_id": "subscriptionId",
|
|
546
|
+
"date_starts": "dateStarts",
|
|
547
|
+
"date_ends": "dateEnds",
|
|
548
|
+
"payment_handler": "paymentHandler",
|
|
549
|
+
"payment_handler_data": "paymentHandlerData",
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
/** @internal */
|
|
554
|
+
export type RequestBodyLines$Outbound = {
|
|
555
|
+
variant_id: number;
|
|
556
|
+
unit_price?: number | undefined;
|
|
557
|
+
quantity?: number | undefined;
|
|
558
|
+
subscription_id?: number | undefined;
|
|
559
|
+
date_starts?: string | undefined;
|
|
560
|
+
date_ends?: string | undefined;
|
|
561
|
+
payment_handler?: string | undefined;
|
|
562
|
+
payment_handler_data?: string | undefined;
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
/** @internal */
|
|
566
|
+
export const RequestBodyLines$outboundSchema: z.ZodType<
|
|
567
|
+
RequestBodyLines$Outbound,
|
|
568
|
+
z.ZodTypeDef,
|
|
569
|
+
RequestBodyLines
|
|
570
|
+
> = z.object({
|
|
571
|
+
variantId: z.number().int(),
|
|
572
|
+
unitPrice: z.number().optional(),
|
|
573
|
+
quantity: z.number().int().optional(),
|
|
574
|
+
subscriptionId: z.number().int().optional(),
|
|
575
|
+
dateStarts: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
576
|
+
dateEnds: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
577
|
+
paymentHandler: RequestBodyPaymentHandler$outboundSchema.optional(),
|
|
578
|
+
paymentHandlerData: z.string().optional(),
|
|
579
|
+
}).transform((v) => {
|
|
580
|
+
return remap$(v, {
|
|
581
|
+
variantId: "variant_id",
|
|
582
|
+
unitPrice: "unit_price",
|
|
583
|
+
subscriptionId: "subscription_id",
|
|
584
|
+
dateStarts: "date_starts",
|
|
585
|
+
dateEnds: "date_ends",
|
|
586
|
+
paymentHandler: "payment_handler",
|
|
587
|
+
paymentHandlerData: "payment_handler_data",
|
|
588
|
+
});
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* @internal
|
|
593
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
594
|
+
*/
|
|
595
|
+
export namespace RequestBodyLines$ {
|
|
596
|
+
/** @deprecated use `RequestBodyLines$inboundSchema` instead. */
|
|
597
|
+
export const inboundSchema = RequestBodyLines$inboundSchema;
|
|
598
|
+
/** @deprecated use `RequestBodyLines$outboundSchema` instead. */
|
|
599
|
+
export const outboundSchema = RequestBodyLines$outboundSchema;
|
|
600
|
+
/** @deprecated use `RequestBodyLines$Outbound` instead. */
|
|
601
|
+
export type Outbound = RequestBodyLines$Outbound;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
export function requestBodyLinesToJSON(
|
|
605
|
+
requestBodyLines: RequestBodyLines,
|
|
606
|
+
): string {
|
|
607
|
+
return JSON.stringify(
|
|
608
|
+
RequestBodyLines$outboundSchema.parse(requestBodyLines),
|
|
609
|
+
);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export function requestBodyLinesFromJSON(
|
|
613
|
+
jsonString: string,
|
|
614
|
+
): SafeParseResult<RequestBodyLines, SDKValidationError> {
|
|
615
|
+
return safeParse(
|
|
616
|
+
jsonString,
|
|
617
|
+
(x) => RequestBodyLines$inboundSchema.parse(JSON.parse(x)),
|
|
618
|
+
`Failed to parse 'RequestBodyLines' from JSON`,
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/** @internal */
|
|
623
|
+
export const RequestBody2$inboundSchema: z.ZodType<
|
|
624
|
+
RequestBody2,
|
|
625
|
+
z.ZodTypeDef,
|
|
626
|
+
unknown
|
|
627
|
+
> = z.object({
|
|
628
|
+
company_id: z.number().int(),
|
|
629
|
+
lines: z.array(z.lazy(() => RequestBodyLines$inboundSchema)).optional(),
|
|
630
|
+
vendor_credential_id: z.number().int().optional(),
|
|
631
|
+
}).transform((v) => {
|
|
632
|
+
return remap$(v, {
|
|
633
|
+
"company_id": "companyId",
|
|
634
|
+
"vendor_credential_id": "vendorCredentialId",
|
|
635
|
+
});
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
/** @internal */
|
|
639
|
+
export type RequestBody2$Outbound = {
|
|
640
|
+
company_id: number;
|
|
641
|
+
lines?: Array<RequestBodyLines$Outbound> | undefined;
|
|
642
|
+
vendor_credential_id?: number | undefined;
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
/** @internal */
|
|
646
|
+
export const RequestBody2$outboundSchema: z.ZodType<
|
|
647
|
+
RequestBody2$Outbound,
|
|
648
|
+
z.ZodTypeDef,
|
|
649
|
+
RequestBody2
|
|
650
|
+
> = z.object({
|
|
651
|
+
companyId: z.number().int(),
|
|
652
|
+
lines: z.array(z.lazy(() => RequestBodyLines$outboundSchema)).optional(),
|
|
653
|
+
vendorCredentialId: z.number().int().optional(),
|
|
654
|
+
}).transform((v) => {
|
|
655
|
+
return remap$(v, {
|
|
656
|
+
companyId: "company_id",
|
|
657
|
+
vendorCredentialId: "vendor_credential_id",
|
|
658
|
+
});
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* @internal
|
|
663
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
664
|
+
*/
|
|
665
|
+
export namespace RequestBody2$ {
|
|
666
|
+
/** @deprecated use `RequestBody2$inboundSchema` instead. */
|
|
667
|
+
export const inboundSchema = RequestBody2$inboundSchema;
|
|
668
|
+
/** @deprecated use `RequestBody2$outboundSchema` instead. */
|
|
669
|
+
export const outboundSchema = RequestBody2$outboundSchema;
|
|
670
|
+
/** @deprecated use `RequestBody2$Outbound` instead. */
|
|
671
|
+
export type Outbound = RequestBody2$Outbound;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
export function requestBody2ToJSON(requestBody2: RequestBody2): string {
|
|
675
|
+
return JSON.stringify(RequestBody2$outboundSchema.parse(requestBody2));
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export function requestBody2FromJSON(
|
|
679
|
+
jsonString: string,
|
|
680
|
+
): SafeParseResult<RequestBody2, SDKValidationError> {
|
|
681
|
+
return safeParse(
|
|
682
|
+
jsonString,
|
|
683
|
+
(x) => RequestBody2$inboundSchema.parse(JSON.parse(x)),
|
|
684
|
+
`Failed to parse 'RequestBody2' from JSON`,
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/** @internal */
|
|
689
|
+
export const PaymentHandler$inboundSchema: z.ZodNativeEnum<
|
|
690
|
+
typeof PaymentHandler
|
|
691
|
+
> = z.nativeEnum(PaymentHandler);
|
|
692
|
+
|
|
693
|
+
/** @internal */
|
|
694
|
+
export const PaymentHandler$outboundSchema: z.ZodNativeEnum<
|
|
695
|
+
typeof PaymentHandler
|
|
696
|
+
> = PaymentHandler$inboundSchema;
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* @internal
|
|
700
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
701
|
+
*/
|
|
702
|
+
export namespace PaymentHandler$ {
|
|
703
|
+
/** @deprecated use `PaymentHandler$inboundSchema` instead. */
|
|
704
|
+
export const inboundSchema = PaymentHandler$inboundSchema;
|
|
705
|
+
/** @deprecated use `PaymentHandler$outboundSchema` instead. */
|
|
706
|
+
export const outboundSchema = PaymentHandler$outboundSchema;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/** @internal */
|
|
710
|
+
export const Lines$inboundSchema: z.ZodType<Lines, z.ZodTypeDef, unknown> = z
|
|
711
|
+
.object({
|
|
712
|
+
variant_id: z.number().int(),
|
|
713
|
+
unit_price: z.number().optional(),
|
|
714
|
+
quantity: z.number().int().optional(),
|
|
715
|
+
subscription_id: z.number().int().optional(),
|
|
716
|
+
date_starts: z.string().transform(v => new RFCDate(v)).optional(),
|
|
717
|
+
date_ends: z.string().transform(v => new RFCDate(v)).optional(),
|
|
718
|
+
payment_handler: PaymentHandler$inboundSchema.optional(),
|
|
719
|
+
payment_handler_data: z.string().optional(),
|
|
720
|
+
}).transform((v) => {
|
|
721
|
+
return remap$(v, {
|
|
722
|
+
"variant_id": "variantId",
|
|
723
|
+
"unit_price": "unitPrice",
|
|
724
|
+
"subscription_id": "subscriptionId",
|
|
725
|
+
"date_starts": "dateStarts",
|
|
726
|
+
"date_ends": "dateEnds",
|
|
727
|
+
"payment_handler": "paymentHandler",
|
|
728
|
+
"payment_handler_data": "paymentHandlerData",
|
|
729
|
+
});
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
/** @internal */
|
|
733
|
+
export type Lines$Outbound = {
|
|
734
|
+
variant_id: number;
|
|
735
|
+
unit_price?: number | undefined;
|
|
736
|
+
quantity?: number | undefined;
|
|
737
|
+
subscription_id?: number | undefined;
|
|
738
|
+
date_starts?: string | undefined;
|
|
739
|
+
date_ends?: string | undefined;
|
|
740
|
+
payment_handler?: string | undefined;
|
|
741
|
+
payment_handler_data?: string | undefined;
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
/** @internal */
|
|
745
|
+
export const Lines$outboundSchema: z.ZodType<
|
|
746
|
+
Lines$Outbound,
|
|
747
|
+
z.ZodTypeDef,
|
|
748
|
+
Lines
|
|
749
|
+
> = z.object({
|
|
750
|
+
variantId: z.number().int(),
|
|
751
|
+
unitPrice: z.number().optional(),
|
|
752
|
+
quantity: z.number().int().optional(),
|
|
753
|
+
subscriptionId: z.number().int().optional(),
|
|
754
|
+
dateStarts: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
755
|
+
dateEnds: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
756
|
+
paymentHandler: PaymentHandler$outboundSchema.optional(),
|
|
757
|
+
paymentHandlerData: z.string().optional(),
|
|
758
|
+
}).transform((v) => {
|
|
759
|
+
return remap$(v, {
|
|
760
|
+
variantId: "variant_id",
|
|
761
|
+
unitPrice: "unit_price",
|
|
762
|
+
subscriptionId: "subscription_id",
|
|
763
|
+
dateStarts: "date_starts",
|
|
764
|
+
dateEnds: "date_ends",
|
|
765
|
+
paymentHandler: "payment_handler",
|
|
766
|
+
paymentHandlerData: "payment_handler_data",
|
|
767
|
+
});
|
|
768
|
+
});
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* @internal
|
|
772
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
773
|
+
*/
|
|
774
|
+
export namespace Lines$ {
|
|
775
|
+
/** @deprecated use `Lines$inboundSchema` instead. */
|
|
776
|
+
export const inboundSchema = Lines$inboundSchema;
|
|
777
|
+
/** @deprecated use `Lines$outboundSchema` instead. */
|
|
778
|
+
export const outboundSchema = Lines$outboundSchema;
|
|
779
|
+
/** @deprecated use `Lines$Outbound` instead. */
|
|
780
|
+
export type Outbound = Lines$Outbound;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export function linesToJSON(lines: Lines): string {
|
|
784
|
+
return JSON.stringify(Lines$outboundSchema.parse(lines));
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export function linesFromJSON(
|
|
788
|
+
jsonString: string,
|
|
789
|
+
): SafeParseResult<Lines, SDKValidationError> {
|
|
790
|
+
return safeParse(
|
|
791
|
+
jsonString,
|
|
792
|
+
(x) => Lines$inboundSchema.parse(JSON.parse(x)),
|
|
793
|
+
`Failed to parse 'Lines' from JSON`,
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/** @internal */
|
|
798
|
+
export const RequestBody1$inboundSchema: z.ZodType<
|
|
799
|
+
RequestBody1,
|
|
800
|
+
z.ZodTypeDef,
|
|
801
|
+
unknown
|
|
802
|
+
> = z.object({
|
|
803
|
+
vendor_id: z.number().int(),
|
|
804
|
+
lines: z.array(z.lazy(() => Lines$inboundSchema)).optional(),
|
|
805
|
+
vendor_credential_id: z.number().int().optional(),
|
|
806
|
+
}).transform((v) => {
|
|
807
|
+
return remap$(v, {
|
|
808
|
+
"vendor_id": "vendorId",
|
|
809
|
+
"vendor_credential_id": "vendorCredentialId",
|
|
810
|
+
});
|
|
811
|
+
});
|
|
812
|
+
|
|
813
|
+
/** @internal */
|
|
814
|
+
export type RequestBody1$Outbound = {
|
|
815
|
+
vendor_id: number;
|
|
816
|
+
lines?: Array<Lines$Outbound> | undefined;
|
|
817
|
+
vendor_credential_id?: number | undefined;
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
/** @internal */
|
|
821
|
+
export const RequestBody1$outboundSchema: z.ZodType<
|
|
822
|
+
RequestBody1$Outbound,
|
|
823
|
+
z.ZodTypeDef,
|
|
824
|
+
RequestBody1
|
|
825
|
+
> = z.object({
|
|
826
|
+
vendorId: z.number().int(),
|
|
827
|
+
lines: z.array(z.lazy(() => Lines$outboundSchema)).optional(),
|
|
828
|
+
vendorCredentialId: z.number().int().optional(),
|
|
829
|
+
}).transform((v) => {
|
|
830
|
+
return remap$(v, {
|
|
831
|
+
vendorId: "vendor_id",
|
|
832
|
+
vendorCredentialId: "vendor_credential_id",
|
|
833
|
+
});
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* @internal
|
|
838
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
839
|
+
*/
|
|
840
|
+
export namespace RequestBody1$ {
|
|
841
|
+
/** @deprecated use `RequestBody1$inboundSchema` instead. */
|
|
842
|
+
export const inboundSchema = RequestBody1$inboundSchema;
|
|
843
|
+
/** @deprecated use `RequestBody1$outboundSchema` instead. */
|
|
844
|
+
export const outboundSchema = RequestBody1$outboundSchema;
|
|
845
|
+
/** @deprecated use `RequestBody1$Outbound` instead. */
|
|
846
|
+
export type Outbound = RequestBody1$Outbound;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
export function requestBody1ToJSON(requestBody1: RequestBody1): string {
|
|
850
|
+
return JSON.stringify(RequestBody1$outboundSchema.parse(requestBody1));
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
export function requestBody1FromJSON(
|
|
854
|
+
jsonString: string,
|
|
855
|
+
): SafeParseResult<RequestBody1, SDKValidationError> {
|
|
856
|
+
return safeParse(
|
|
857
|
+
jsonString,
|
|
858
|
+
(x) => RequestBody1$inboundSchema.parse(JSON.parse(x)),
|
|
859
|
+
`Failed to parse 'RequestBody1' from JSON`,
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/** @internal */
|
|
864
|
+
export const UpdateInvoiceRequestBody$inboundSchema: z.ZodType<
|
|
865
|
+
UpdateInvoiceRequestBody,
|
|
866
|
+
z.ZodTypeDef,
|
|
867
|
+
unknown
|
|
868
|
+
> = z.union([
|
|
869
|
+
z.lazy(() => RequestBody1$inboundSchema),
|
|
870
|
+
z.lazy(() => RequestBody2$inboundSchema),
|
|
871
|
+
z.lazy(() => Three$inboundSchema),
|
|
872
|
+
z.lazy(() => Four$inboundSchema),
|
|
873
|
+
]);
|
|
874
|
+
|
|
875
|
+
/** @internal */
|
|
876
|
+
export type UpdateInvoiceRequestBody$Outbound =
|
|
877
|
+
| RequestBody1$Outbound
|
|
878
|
+
| RequestBody2$Outbound
|
|
879
|
+
| Three$Outbound
|
|
880
|
+
| Four$Outbound;
|
|
881
|
+
|
|
882
|
+
/** @internal */
|
|
883
|
+
export const UpdateInvoiceRequestBody$outboundSchema: z.ZodType<
|
|
884
|
+
UpdateInvoiceRequestBody$Outbound,
|
|
885
|
+
z.ZodTypeDef,
|
|
886
|
+
UpdateInvoiceRequestBody
|
|
887
|
+
> = z.union([
|
|
888
|
+
z.lazy(() => RequestBody1$outboundSchema),
|
|
889
|
+
z.lazy(() => RequestBody2$outboundSchema),
|
|
890
|
+
z.lazy(() => Three$outboundSchema),
|
|
891
|
+
z.lazy(() => Four$outboundSchema),
|
|
892
|
+
]);
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* @internal
|
|
896
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
897
|
+
*/
|
|
898
|
+
export namespace UpdateInvoiceRequestBody$ {
|
|
899
|
+
/** @deprecated use `UpdateInvoiceRequestBody$inboundSchema` instead. */
|
|
900
|
+
export const inboundSchema = UpdateInvoiceRequestBody$inboundSchema;
|
|
901
|
+
/** @deprecated use `UpdateInvoiceRequestBody$outboundSchema` instead. */
|
|
902
|
+
export const outboundSchema = UpdateInvoiceRequestBody$outboundSchema;
|
|
903
|
+
/** @deprecated use `UpdateInvoiceRequestBody$Outbound` instead. */
|
|
904
|
+
export type Outbound = UpdateInvoiceRequestBody$Outbound;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
export function updateInvoiceRequestBodyToJSON(
|
|
908
|
+
updateInvoiceRequestBody: UpdateInvoiceRequestBody,
|
|
909
|
+
): string {
|
|
910
|
+
return JSON.stringify(
|
|
911
|
+
UpdateInvoiceRequestBody$outboundSchema.parse(updateInvoiceRequestBody),
|
|
912
|
+
);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export function updateInvoiceRequestBodyFromJSON(
|
|
916
|
+
jsonString: string,
|
|
917
|
+
): SafeParseResult<UpdateInvoiceRequestBody, SDKValidationError> {
|
|
918
|
+
return safeParse(
|
|
919
|
+
jsonString,
|
|
920
|
+
(x) => UpdateInvoiceRequestBody$inboundSchema.parse(JSON.parse(x)),
|
|
921
|
+
`Failed to parse 'UpdateInvoiceRequestBody' from JSON`,
|
|
922
|
+
);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/** @internal */
|
|
926
|
+
export const UpdateInvoiceRequest$inboundSchema: z.ZodType<
|
|
927
|
+
UpdateInvoiceRequest,
|
|
928
|
+
z.ZodTypeDef,
|
|
929
|
+
unknown
|
|
930
|
+
> = z.object({
|
|
931
|
+
id: z.number().int(),
|
|
932
|
+
RequestBody: z.union([
|
|
933
|
+
z.lazy(() => RequestBody1$inboundSchema),
|
|
934
|
+
z.lazy(() => RequestBody2$inboundSchema),
|
|
935
|
+
z.lazy(() => Three$inboundSchema),
|
|
936
|
+
z.lazy(() => Four$inboundSchema),
|
|
937
|
+
]),
|
|
938
|
+
}).transform((v) => {
|
|
939
|
+
return remap$(v, {
|
|
940
|
+
"RequestBody": "requestBody",
|
|
941
|
+
});
|
|
942
|
+
});
|
|
943
|
+
|
|
944
|
+
/** @internal */
|
|
945
|
+
export type UpdateInvoiceRequest$Outbound = {
|
|
946
|
+
id: number;
|
|
947
|
+
RequestBody:
|
|
948
|
+
| RequestBody1$Outbound
|
|
949
|
+
| RequestBody2$Outbound
|
|
950
|
+
| Three$Outbound
|
|
951
|
+
| Four$Outbound;
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
/** @internal */
|
|
955
|
+
export const UpdateInvoiceRequest$outboundSchema: z.ZodType<
|
|
956
|
+
UpdateInvoiceRequest$Outbound,
|
|
957
|
+
z.ZodTypeDef,
|
|
958
|
+
UpdateInvoiceRequest
|
|
959
|
+
> = z.object({
|
|
960
|
+
id: z.number().int(),
|
|
961
|
+
requestBody: z.union([
|
|
962
|
+
z.lazy(() => RequestBody1$outboundSchema),
|
|
963
|
+
z.lazy(() => RequestBody2$outboundSchema),
|
|
964
|
+
z.lazy(() => Three$outboundSchema),
|
|
965
|
+
z.lazy(() => Four$outboundSchema),
|
|
966
|
+
]),
|
|
967
|
+
}).transform((v) => {
|
|
968
|
+
return remap$(v, {
|
|
969
|
+
requestBody: "RequestBody",
|
|
970
|
+
});
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* @internal
|
|
975
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
976
|
+
*/
|
|
977
|
+
export namespace UpdateInvoiceRequest$ {
|
|
978
|
+
/** @deprecated use `UpdateInvoiceRequest$inboundSchema` instead. */
|
|
979
|
+
export const inboundSchema = UpdateInvoiceRequest$inboundSchema;
|
|
980
|
+
/** @deprecated use `UpdateInvoiceRequest$outboundSchema` instead. */
|
|
981
|
+
export const outboundSchema = UpdateInvoiceRequest$outboundSchema;
|
|
982
|
+
/** @deprecated use `UpdateInvoiceRequest$Outbound` instead. */
|
|
983
|
+
export type Outbound = UpdateInvoiceRequest$Outbound;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
export function updateInvoiceRequestToJSON(
|
|
987
|
+
updateInvoiceRequest: UpdateInvoiceRequest,
|
|
988
|
+
): string {
|
|
989
|
+
return JSON.stringify(
|
|
990
|
+
UpdateInvoiceRequest$outboundSchema.parse(updateInvoiceRequest),
|
|
991
|
+
);
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
export function updateInvoiceRequestFromJSON(
|
|
995
|
+
jsonString: string,
|
|
996
|
+
): SafeParseResult<UpdateInvoiceRequest, SDKValidationError> {
|
|
997
|
+
return safeParse(
|
|
998
|
+
jsonString,
|
|
999
|
+
(x) => UpdateInvoiceRequest$inboundSchema.parse(JSON.parse(x)),
|
|
1000
|
+
`Failed to parse 'UpdateInvoiceRequest' from JSON`,
|
|
1001
|
+
);
|
|
1002
|
+
}
|