@apideck/unify 0.31.0 → 0.33.0
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/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/lib/config.js.map +1 -1
- package/models/components/bill.d.ts +3 -0
- package/models/components/bill.d.ts.map +1 -1
- package/models/components/bill.js +1 -0
- package/models/components/bill.js.map +1 -1
- package/models/components/billsfilter.d.ts +40 -0
- package/models/components/billsfilter.d.ts.map +1 -1
- package/models/components/billsfilter.js +26 -1
- package/models/components/billsfilter.js.map +1 -1
- package/models/components/category.d.ts +5 -0
- package/models/components/category.d.ts.map +1 -1
- package/models/components/category.js +4 -0
- package/models/components/category.js.map +1 -1
- package/models/components/connection.d.ts +54 -2
- package/models/components/connection.d.ts.map +1 -1
- package/models/components/connection.js +40 -5
- package/models/components/connection.js.map +1 -1
- package/models/components/ecommerceorder.d.ts +3 -0
- package/models/components/ecommerceorder.d.ts.map +1 -1
- package/models/components/ecommerceorder.js +1 -0
- package/models/components/ecommerceorder.js.map +1 -1
- package/models/components/invoice.d.ts +3 -0
- package/models/components/invoice.d.ts.map +1 -1
- package/models/components/invoice.js +1 -0
- package/models/components/invoice.js.map +1 -1
- package/models/components/invoiceitem.d.ts +10 -0
- package/models/components/invoiceitem.d.ts.map +1 -1
- package/models/components/invoiceitem.js +8 -0
- package/models/components/invoiceitem.js.map +1 -1
- package/models/components/journalentry.d.ts +10 -0
- package/models/components/journalentry.d.ts.map +1 -1
- package/models/components/journalentry.js +8 -0
- package/models/components/journalentry.js.map +1 -1
- package/models/components/purchaseorder.d.ts +10 -0
- package/models/components/purchaseorder.d.ts.map +1 -1
- package/models/components/purchaseorder.js +8 -0
- package/models/components/purchaseorder.js.map +1 -1
- package/models/components/subsidiary.d.ts +10 -0
- package/models/components/subsidiary.d.ts.map +1 -1
- package/models/components/subsidiary.js +8 -0
- package/models/components/subsidiary.js.map +1 -1
- package/models/components/taxrate.d.ts +10 -0
- package/models/components/taxrate.d.ts.map +1 -1
- package/models/components/taxrate.js +8 -0
- package/models/components/taxrate.js.map +1 -1
- package/models/components/webhookeventtype.d.ts +9 -0
- package/models/components/webhookeventtype.d.ts.map +1 -1
- package/models/components/webhookeventtype.js +3 -0
- package/models/components/webhookeventtype.js.map +1 -1
- package/models/errors/badrequestresponse.d.ts +2 -2
- package/models/errors/badrequestresponse.d.ts.map +1 -1
- package/models/errors/notfoundresponse.d.ts +2 -2
- package/models/errors/notfoundresponse.d.ts.map +1 -1
- package/models/errors/unauthorizedresponse.d.ts +158 -17
- package/models/errors/unauthorizedresponse.d.ts.map +1 -1
- package/models/errors/unauthorizedresponse.js +144 -5
- package/models/errors/unauthorizedresponse.js.map +1 -1
- package/models/errors/unprocessableresponse.d.ts +2 -2
- package/models/errors/unprocessableresponse.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/connections.test.ts +7 -7
- package/src/__tests__/connectionsettings.test.ts +2 -2
- package/src/lib/config.ts +4 -4
- package/src/models/components/bill.ts +1 -0
- package/src/models/components/billsfilter.ts +42 -0
- package/src/models/components/category.ts +9 -0
- package/src/models/components/connection.ts +64 -6
- package/src/models/components/ecommerceorder.ts +1 -0
- package/src/models/components/invoice.ts +1 -0
- package/src/models/components/invoiceitem.ts +18 -0
- package/src/models/components/journalentry.ts +18 -0
- package/src/models/components/purchaseorder.ts +18 -0
- package/src/models/components/subsidiary.ts +18 -0
- package/src/models/components/taxrate.ts +18 -0
- package/src/models/components/webhookeventtype.ts +3 -0
- package/src/models/errors/badrequestresponse.ts +1 -1
- package/src/models/errors/notfoundresponse.ts +1 -1
- package/src/models/errors/unauthorizedresponse.ts +303 -11
- package/src/models/errors/unprocessableresponse.ts +1 -1
|
@@ -53,6 +53,10 @@ export type TaxRate = {
|
|
|
53
53
|
* ID assigned to identify this tax rate.
|
|
54
54
|
*/
|
|
55
55
|
id?: string | null | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Display ID of the tax rate
|
|
58
|
+
*/
|
|
59
|
+
displayId?: string | null | undefined;
|
|
56
60
|
/**
|
|
57
61
|
* Name assigned to identify this tax rate.
|
|
58
62
|
*/
|
|
@@ -138,6 +142,10 @@ export type TaxRateInput = {
|
|
|
138
142
|
* ID assigned to identify this tax rate.
|
|
139
143
|
*/
|
|
140
144
|
id?: string | null | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Display ID of the tax rate
|
|
147
|
+
*/
|
|
148
|
+
displayId?: string | null | undefined;
|
|
141
149
|
/**
|
|
142
150
|
* Name assigned to identify this tax rate.
|
|
143
151
|
*/
|
|
@@ -332,6 +340,7 @@ export function subsidiariesFromJSON(
|
|
|
332
340
|
export const TaxRate$inboundSchema: z.ZodType<TaxRate, z.ZodTypeDef, unknown> =
|
|
333
341
|
z.object({
|
|
334
342
|
id: z.nullable(z.string()).optional(),
|
|
343
|
+
display_id: z.nullable(z.string()).optional(),
|
|
335
344
|
name: z.string().optional(),
|
|
336
345
|
code: z.nullable(z.string()).optional(),
|
|
337
346
|
description: z.nullable(z.string()).optional(),
|
|
@@ -360,6 +369,7 @@ export const TaxRate$inboundSchema: z.ZodType<TaxRate, z.ZodTypeDef, unknown> =
|
|
|
360
369
|
custom_fields: z.array(CustomField$inboundSchema).optional(),
|
|
361
370
|
}).transform((v) => {
|
|
362
371
|
return remap$(v, {
|
|
372
|
+
"display_id": "displayId",
|
|
363
373
|
"effective_tax_rate": "effectiveTaxRate",
|
|
364
374
|
"total_tax_rate": "totalTaxRate",
|
|
365
375
|
"tax_payable_account_id": "taxPayableAccountId",
|
|
@@ -380,6 +390,7 @@ export const TaxRate$inboundSchema: z.ZodType<TaxRate, z.ZodTypeDef, unknown> =
|
|
|
380
390
|
/** @internal */
|
|
381
391
|
export type TaxRate$Outbound = {
|
|
382
392
|
id?: string | null | undefined;
|
|
393
|
+
display_id?: string | null | undefined;
|
|
383
394
|
name?: string | undefined;
|
|
384
395
|
code?: string | null | undefined;
|
|
385
396
|
description?: string | null | undefined;
|
|
@@ -410,6 +421,7 @@ export const TaxRate$outboundSchema: z.ZodType<
|
|
|
410
421
|
TaxRate
|
|
411
422
|
> = z.object({
|
|
412
423
|
id: z.nullable(z.string()).optional(),
|
|
424
|
+
displayId: z.nullable(z.string()).optional(),
|
|
413
425
|
name: z.string().optional(),
|
|
414
426
|
code: z.nullable(z.string()).optional(),
|
|
415
427
|
description: z.nullable(z.string()).optional(),
|
|
@@ -434,6 +446,7 @@ export const TaxRate$outboundSchema: z.ZodType<
|
|
|
434
446
|
customFields: z.array(CustomField$outboundSchema).optional(),
|
|
435
447
|
}).transform((v) => {
|
|
436
448
|
return remap$(v, {
|
|
449
|
+
displayId: "display_id",
|
|
437
450
|
effectiveTaxRate: "effective_tax_rate",
|
|
438
451
|
totalTaxRate: "total_tax_rate",
|
|
439
452
|
taxPayableAccountId: "tax_payable_account_id",
|
|
@@ -485,6 +498,7 @@ export const TaxRateInput$inboundSchema: z.ZodType<
|
|
|
485
498
|
unknown
|
|
486
499
|
> = z.object({
|
|
487
500
|
id: z.nullable(z.string()).optional(),
|
|
501
|
+
display_id: z.nullable(z.string()).optional(),
|
|
488
502
|
name: z.string().optional(),
|
|
489
503
|
code: z.nullable(z.string()).optional(),
|
|
490
504
|
description: z.nullable(z.string()).optional(),
|
|
@@ -504,6 +518,7 @@ export const TaxRateInput$inboundSchema: z.ZodType<
|
|
|
504
518
|
custom_fields: z.array(CustomField$inboundSchema).optional(),
|
|
505
519
|
}).transform((v) => {
|
|
506
520
|
return remap$(v, {
|
|
521
|
+
"display_id": "displayId",
|
|
507
522
|
"effective_tax_rate": "effectiveTaxRate",
|
|
508
523
|
"total_tax_rate": "totalTaxRate",
|
|
509
524
|
"tax_payable_account_id": "taxPayableAccountId",
|
|
@@ -519,6 +534,7 @@ export const TaxRateInput$inboundSchema: z.ZodType<
|
|
|
519
534
|
/** @internal */
|
|
520
535
|
export type TaxRateInput$Outbound = {
|
|
521
536
|
id?: string | null | undefined;
|
|
537
|
+
display_id?: string | null | undefined;
|
|
522
538
|
name?: string | undefined;
|
|
523
539
|
code?: string | null | undefined;
|
|
524
540
|
description?: string | null | undefined;
|
|
@@ -544,6 +560,7 @@ export const TaxRateInput$outboundSchema: z.ZodType<
|
|
|
544
560
|
TaxRateInput
|
|
545
561
|
> = z.object({
|
|
546
562
|
id: z.nullable(z.string()).optional(),
|
|
563
|
+
displayId: z.nullable(z.string()).optional(),
|
|
547
564
|
name: z.string().optional(),
|
|
548
565
|
code: z.nullable(z.string()).optional(),
|
|
549
566
|
description: z.nullable(z.string()).optional(),
|
|
@@ -563,6 +580,7 @@ export const TaxRateInput$outboundSchema: z.ZodType<
|
|
|
563
580
|
customFields: z.array(CustomField$outboundSchema).optional(),
|
|
564
581
|
}).transform((v) => {
|
|
565
582
|
return remap$(v, {
|
|
583
|
+
displayId: "display_id",
|
|
566
584
|
effectiveTaxRate: "effective_tax_rate",
|
|
567
585
|
totalTaxRate: "total_tax_rate",
|
|
568
586
|
taxPayableAccountId: "tax_payable_account_id",
|
|
@@ -59,6 +59,9 @@ export const WebhookEventType = {
|
|
|
59
59
|
AccountingBillCreated: "accounting.bill.created",
|
|
60
60
|
AccountingBillUpdated: "accounting.bill.updated",
|
|
61
61
|
AccountingBillDeleted: "accounting.bill.deleted",
|
|
62
|
+
AccountingBillPaymentCreated: "accounting.bill_payment.created",
|
|
63
|
+
AccountingBillPaymentUpdated: "accounting.bill_payment.updated",
|
|
64
|
+
AccountingBillPaymentDeleted: "accounting.bill_payment.deleted",
|
|
62
65
|
AccountingPaymentCreated: "accounting.payment.created",
|
|
63
66
|
AccountingPaymentUpdated: "accounting.payment.updated",
|
|
64
67
|
AccountingPaymentDeleted: "accounting.payment.deleted",
|
|
@@ -103,7 +103,7 @@ export type NotFoundResponseDetail$Outbound = string | { [k: string]: any };
|
|
|
103
103
|
export const NotFoundResponseDetail$outboundSchema: z.ZodType<
|
|
104
104
|
NotFoundResponseDetail$Outbound,
|
|
105
105
|
z.ZodTypeDef,
|
|
106
|
-
|
|
106
|
+
unknown
|
|
107
107
|
> = z.union([z.string(), z.record(z.any())]);
|
|
108
108
|
|
|
109
109
|
/**
|
|
@@ -4,15 +4,78 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
collectExtraKeys as collectExtraKeys$,
|
|
9
|
+
safeParse,
|
|
10
|
+
} from "../../lib/schemas.js";
|
|
8
11
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
12
|
import { ApideckError } from "./apideckerror.js";
|
|
10
13
|
import { SDKValidationError } from "./sdkvalidationerror.js";
|
|
11
14
|
|
|
15
|
+
/**
|
|
16
|
+
* HTTP request details
|
|
17
|
+
*/
|
|
18
|
+
export type RequestT = {};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* HTTP response details
|
|
22
|
+
*/
|
|
23
|
+
export type ResponseT = {};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Debug information including request/response details and OAuth timing metadata
|
|
27
|
+
*/
|
|
28
|
+
export type Debug = {
|
|
29
|
+
/**
|
|
30
|
+
* HTTP request details
|
|
31
|
+
*/
|
|
32
|
+
request?: RequestT | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* HTTP response details
|
|
35
|
+
*/
|
|
36
|
+
response?: ResponseT | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Error message from downstream provider or network layer
|
|
39
|
+
*/
|
|
40
|
+
message?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Error code (e.g., ETIMEDOUT, ECONNREFUSED)
|
|
43
|
+
*/
|
|
44
|
+
code?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Unix timestamp (milliseconds) when credentials will be deleted if not refreshed. Only present for non-recoverable errors (401, 400). Credentials are preserved indefinitely for recoverable/network errors.
|
|
47
|
+
*/
|
|
48
|
+
credentialsExpireAtMs?: number | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Unix timestamp (milliseconds) when token refresh retry is allowed after cooldown period expires.
|
|
51
|
+
*/
|
|
52
|
+
retryAfterMs?: number | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Milliseconds remaining in cooldown period before retry is allowed.
|
|
55
|
+
*/
|
|
56
|
+
cooldownRemainingMs?: number | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type Two = {
|
|
60
|
+
/**
|
|
61
|
+
* Error type identifier
|
|
62
|
+
*/
|
|
63
|
+
type?: string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Detailed error message
|
|
66
|
+
*/
|
|
67
|
+
message?: string | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Debug information including request/response details and OAuth timing metadata
|
|
70
|
+
*/
|
|
71
|
+
debug?: Debug | undefined;
|
|
72
|
+
additionalProperties?: { [k: string]: any } | undefined;
|
|
73
|
+
};
|
|
74
|
+
|
|
12
75
|
/**
|
|
13
76
|
* Contains parameter or domain specific information related to the error and why it occurred.
|
|
14
77
|
*/
|
|
15
|
-
export type UnauthorizedResponseDetail = string |
|
|
78
|
+
export type UnauthorizedResponseDetail = string | Two;
|
|
16
79
|
|
|
17
80
|
/**
|
|
18
81
|
* Unauthorized
|
|
@@ -37,7 +100,7 @@ export type UnauthorizedResponseData = {
|
|
|
37
100
|
/**
|
|
38
101
|
* Contains parameter or domain specific information related to the error and why it occurred.
|
|
39
102
|
*/
|
|
40
|
-
detail?: string |
|
|
103
|
+
detail?: string | Two | undefined;
|
|
41
104
|
/**
|
|
42
105
|
* Link to documentation of error type
|
|
43
106
|
*/
|
|
@@ -63,7 +126,7 @@ export class UnauthorizedResponse extends ApideckError {
|
|
|
63
126
|
/**
|
|
64
127
|
* Contains parameter or domain specific information related to the error and why it occurred.
|
|
65
128
|
*/
|
|
66
|
-
detail?: string |
|
|
129
|
+
detail?: string | Two | undefined;
|
|
67
130
|
/**
|
|
68
131
|
* Link to documentation of error type
|
|
69
132
|
*/
|
|
@@ -89,22 +152,250 @@ export class UnauthorizedResponse extends ApideckError {
|
|
|
89
152
|
}
|
|
90
153
|
}
|
|
91
154
|
|
|
155
|
+
/** @internal */
|
|
156
|
+
export const RequestT$inboundSchema: z.ZodType<
|
|
157
|
+
RequestT,
|
|
158
|
+
z.ZodTypeDef,
|
|
159
|
+
unknown
|
|
160
|
+
> = z.object({});
|
|
161
|
+
|
|
162
|
+
/** @internal */
|
|
163
|
+
export type RequestT$Outbound = {};
|
|
164
|
+
|
|
165
|
+
/** @internal */
|
|
166
|
+
export const RequestT$outboundSchema: z.ZodType<
|
|
167
|
+
RequestT$Outbound,
|
|
168
|
+
z.ZodTypeDef,
|
|
169
|
+
RequestT
|
|
170
|
+
> = z.object({});
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @internal
|
|
174
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
175
|
+
*/
|
|
176
|
+
export namespace RequestT$ {
|
|
177
|
+
/** @deprecated use `RequestT$inboundSchema` instead. */
|
|
178
|
+
export const inboundSchema = RequestT$inboundSchema;
|
|
179
|
+
/** @deprecated use `RequestT$outboundSchema` instead. */
|
|
180
|
+
export const outboundSchema = RequestT$outboundSchema;
|
|
181
|
+
/** @deprecated use `RequestT$Outbound` instead. */
|
|
182
|
+
export type Outbound = RequestT$Outbound;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function requestToJSON(requestT: RequestT): string {
|
|
186
|
+
return JSON.stringify(RequestT$outboundSchema.parse(requestT));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export function requestFromJSON(
|
|
190
|
+
jsonString: string,
|
|
191
|
+
): SafeParseResult<RequestT, SDKValidationError> {
|
|
192
|
+
return safeParse(
|
|
193
|
+
jsonString,
|
|
194
|
+
(x) => RequestT$inboundSchema.parse(JSON.parse(x)),
|
|
195
|
+
`Failed to parse 'RequestT' from JSON`,
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** @internal */
|
|
200
|
+
export const ResponseT$inboundSchema: z.ZodType<
|
|
201
|
+
ResponseT,
|
|
202
|
+
z.ZodTypeDef,
|
|
203
|
+
unknown
|
|
204
|
+
> = z.object({});
|
|
205
|
+
|
|
206
|
+
/** @internal */
|
|
207
|
+
export type ResponseT$Outbound = {};
|
|
208
|
+
|
|
209
|
+
/** @internal */
|
|
210
|
+
export const ResponseT$outboundSchema: z.ZodType<
|
|
211
|
+
ResponseT$Outbound,
|
|
212
|
+
z.ZodTypeDef,
|
|
213
|
+
ResponseT
|
|
214
|
+
> = z.object({});
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @internal
|
|
218
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
219
|
+
*/
|
|
220
|
+
export namespace ResponseT$ {
|
|
221
|
+
/** @deprecated use `ResponseT$inboundSchema` instead. */
|
|
222
|
+
export const inboundSchema = ResponseT$inboundSchema;
|
|
223
|
+
/** @deprecated use `ResponseT$outboundSchema` instead. */
|
|
224
|
+
export const outboundSchema = ResponseT$outboundSchema;
|
|
225
|
+
/** @deprecated use `ResponseT$Outbound` instead. */
|
|
226
|
+
export type Outbound = ResponseT$Outbound;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function responseToJSON(responseT: ResponseT): string {
|
|
230
|
+
return JSON.stringify(ResponseT$outboundSchema.parse(responseT));
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export function responseFromJSON(
|
|
234
|
+
jsonString: string,
|
|
235
|
+
): SafeParseResult<ResponseT, SDKValidationError> {
|
|
236
|
+
return safeParse(
|
|
237
|
+
jsonString,
|
|
238
|
+
(x) => ResponseT$inboundSchema.parse(JSON.parse(x)),
|
|
239
|
+
`Failed to parse 'ResponseT' from JSON`,
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** @internal */
|
|
244
|
+
export const Debug$inboundSchema: z.ZodType<Debug, z.ZodTypeDef, unknown> = z
|
|
245
|
+
.object({
|
|
246
|
+
request: z.lazy(() => RequestT$inboundSchema).optional(),
|
|
247
|
+
response: z.lazy(() => ResponseT$inboundSchema).optional(),
|
|
248
|
+
message: z.string().optional(),
|
|
249
|
+
code: z.string().optional(),
|
|
250
|
+
credentials_expire_at_ms: z.number().optional(),
|
|
251
|
+
retry_after_ms: z.number().optional(),
|
|
252
|
+
cooldown_remaining_ms: z.number().optional(),
|
|
253
|
+
}).transform((v) => {
|
|
254
|
+
return remap$(v, {
|
|
255
|
+
"credentials_expire_at_ms": "credentialsExpireAtMs",
|
|
256
|
+
"retry_after_ms": "retryAfterMs",
|
|
257
|
+
"cooldown_remaining_ms": "cooldownRemainingMs",
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
/** @internal */
|
|
262
|
+
export type Debug$Outbound = {
|
|
263
|
+
request?: RequestT$Outbound | undefined;
|
|
264
|
+
response?: ResponseT$Outbound | undefined;
|
|
265
|
+
message?: string | undefined;
|
|
266
|
+
code?: string | undefined;
|
|
267
|
+
credentials_expire_at_ms?: number | undefined;
|
|
268
|
+
retry_after_ms?: number | undefined;
|
|
269
|
+
cooldown_remaining_ms?: number | undefined;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/** @internal */
|
|
273
|
+
export const Debug$outboundSchema: z.ZodType<
|
|
274
|
+
Debug$Outbound,
|
|
275
|
+
z.ZodTypeDef,
|
|
276
|
+
Debug
|
|
277
|
+
> = z.object({
|
|
278
|
+
request: z.lazy(() => RequestT$outboundSchema).optional(),
|
|
279
|
+
response: z.lazy(() => ResponseT$outboundSchema).optional(),
|
|
280
|
+
message: z.string().optional(),
|
|
281
|
+
code: z.string().optional(),
|
|
282
|
+
credentialsExpireAtMs: z.number().optional(),
|
|
283
|
+
retryAfterMs: z.number().optional(),
|
|
284
|
+
cooldownRemainingMs: z.number().optional(),
|
|
285
|
+
}).transform((v) => {
|
|
286
|
+
return remap$(v, {
|
|
287
|
+
credentialsExpireAtMs: "credentials_expire_at_ms",
|
|
288
|
+
retryAfterMs: "retry_after_ms",
|
|
289
|
+
cooldownRemainingMs: "cooldown_remaining_ms",
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* @internal
|
|
295
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
296
|
+
*/
|
|
297
|
+
export namespace Debug$ {
|
|
298
|
+
/** @deprecated use `Debug$inboundSchema` instead. */
|
|
299
|
+
export const inboundSchema = Debug$inboundSchema;
|
|
300
|
+
/** @deprecated use `Debug$outboundSchema` instead. */
|
|
301
|
+
export const outboundSchema = Debug$outboundSchema;
|
|
302
|
+
/** @deprecated use `Debug$Outbound` instead. */
|
|
303
|
+
export type Outbound = Debug$Outbound;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export function debugToJSON(debug: Debug): string {
|
|
307
|
+
return JSON.stringify(Debug$outboundSchema.parse(debug));
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export function debugFromJSON(
|
|
311
|
+
jsonString: string,
|
|
312
|
+
): SafeParseResult<Debug, SDKValidationError> {
|
|
313
|
+
return safeParse(
|
|
314
|
+
jsonString,
|
|
315
|
+
(x) => Debug$inboundSchema.parse(JSON.parse(x)),
|
|
316
|
+
`Failed to parse 'Debug' from JSON`,
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** @internal */
|
|
321
|
+
export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> =
|
|
322
|
+
collectExtraKeys$(
|
|
323
|
+
z.object({
|
|
324
|
+
type: z.string().optional(),
|
|
325
|
+
message: z.string().optional(),
|
|
326
|
+
debug: z.lazy(() => Debug$inboundSchema).optional(),
|
|
327
|
+
}).catchall(z.any()),
|
|
328
|
+
"additionalProperties",
|
|
329
|
+
true,
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
/** @internal */
|
|
333
|
+
export type Two$Outbound = {
|
|
334
|
+
type?: string | undefined;
|
|
335
|
+
message?: string | undefined;
|
|
336
|
+
debug?: Debug$Outbound | undefined;
|
|
337
|
+
[additionalProperties: string]: unknown;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
/** @internal */
|
|
341
|
+
export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
|
|
342
|
+
.object({
|
|
343
|
+
type: z.string().optional(),
|
|
344
|
+
message: z.string().optional(),
|
|
345
|
+
debug: z.lazy(() => Debug$outboundSchema).optional(),
|
|
346
|
+
additionalProperties: z.record(z.any()).optional(),
|
|
347
|
+
}).transform((v) => {
|
|
348
|
+
return {
|
|
349
|
+
...v.additionalProperties,
|
|
350
|
+
...remap$(v, {
|
|
351
|
+
additionalProperties: null,
|
|
352
|
+
}),
|
|
353
|
+
};
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @internal
|
|
358
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
359
|
+
*/
|
|
360
|
+
export namespace Two$ {
|
|
361
|
+
/** @deprecated use `Two$inboundSchema` instead. */
|
|
362
|
+
export const inboundSchema = Two$inboundSchema;
|
|
363
|
+
/** @deprecated use `Two$outboundSchema` instead. */
|
|
364
|
+
export const outboundSchema = Two$outboundSchema;
|
|
365
|
+
/** @deprecated use `Two$Outbound` instead. */
|
|
366
|
+
export type Outbound = Two$Outbound;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export function twoToJSON(two: Two): string {
|
|
370
|
+
return JSON.stringify(Two$outboundSchema.parse(two));
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export function twoFromJSON(
|
|
374
|
+
jsonString: string,
|
|
375
|
+
): SafeParseResult<Two, SDKValidationError> {
|
|
376
|
+
return safeParse(
|
|
377
|
+
jsonString,
|
|
378
|
+
(x) => Two$inboundSchema.parse(JSON.parse(x)),
|
|
379
|
+
`Failed to parse 'Two' from JSON`,
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
|
|
92
383
|
/** @internal */
|
|
93
384
|
export const UnauthorizedResponseDetail$inboundSchema: z.ZodType<
|
|
94
385
|
UnauthorizedResponseDetail,
|
|
95
386
|
z.ZodTypeDef,
|
|
96
387
|
unknown
|
|
97
|
-
> = z.union([z.string(), z.
|
|
388
|
+
> = z.union([z.string(), z.lazy(() => Two$inboundSchema)]);
|
|
98
389
|
|
|
99
390
|
/** @internal */
|
|
100
|
-
export type UnauthorizedResponseDetail$Outbound = string |
|
|
391
|
+
export type UnauthorizedResponseDetail$Outbound = string | Two$Outbound;
|
|
101
392
|
|
|
102
393
|
/** @internal */
|
|
103
394
|
export const UnauthorizedResponseDetail$outboundSchema: z.ZodType<
|
|
104
395
|
UnauthorizedResponseDetail$Outbound,
|
|
105
396
|
z.ZodTypeDef,
|
|
106
|
-
|
|
107
|
-
> = z.union([z.string(), z.
|
|
397
|
+
unknown
|
|
398
|
+
> = z.union([z.string(), z.lazy(() => Two$outboundSchema)]);
|
|
108
399
|
|
|
109
400
|
/**
|
|
110
401
|
* @internal
|
|
@@ -147,7 +438,7 @@ export const UnauthorizedResponse$inboundSchema: z.ZodType<
|
|
|
147
438
|
error: z.string().optional(),
|
|
148
439
|
type_name: z.string().optional(),
|
|
149
440
|
message: z.string().optional(),
|
|
150
|
-
detail: z.union([z.string(), z.
|
|
441
|
+
detail: z.union([z.string(), z.lazy(() => Two$inboundSchema)]).optional(),
|
|
151
442
|
ref: z.string().optional(),
|
|
152
443
|
request$: z.instanceof(Request),
|
|
153
444
|
response$: z.instanceof(Response),
|
|
@@ -172,7 +463,7 @@ export type UnauthorizedResponse$Outbound = {
|
|
|
172
463
|
error?: string | undefined;
|
|
173
464
|
type_name?: string | undefined;
|
|
174
465
|
message?: string | undefined;
|
|
175
|
-
detail?: string |
|
|
466
|
+
detail?: string | Two$Outbound | undefined;
|
|
176
467
|
ref?: string | undefined;
|
|
177
468
|
};
|
|
178
469
|
|
|
@@ -189,7 +480,8 @@ export const UnauthorizedResponse$outboundSchema: z.ZodType<
|
|
|
189
480
|
error: z.string().optional(),
|
|
190
481
|
typeName: z.string().optional(),
|
|
191
482
|
message: z.string().optional(),
|
|
192
|
-
detail: z.union([z.string(), z.
|
|
483
|
+
detail: z.union([z.string(), z.lazy(() => Two$outboundSchema)])
|
|
484
|
+
.optional(),
|
|
193
485
|
ref: z.string().optional(),
|
|
194
486
|
}).transform((v) => {
|
|
195
487
|
return remap$(v, {
|
|
@@ -105,7 +105,7 @@ export type UnprocessableResponseDetail$Outbound = string | {
|
|
|
105
105
|
export const UnprocessableResponseDetail$outboundSchema: z.ZodType<
|
|
106
106
|
UnprocessableResponseDetail$Outbound,
|
|
107
107
|
z.ZodTypeDef,
|
|
108
|
-
|
|
108
|
+
unknown
|
|
109
109
|
> = z.union([z.string(), z.record(z.any())]);
|
|
110
110
|
|
|
111
111
|
/**
|