@financeable/aggregation 0.5.1 → 0.6.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/FUNCTIONS.md +11 -132
- package/README.md +262 -1515
- package/docs/sdks/applications/README.md +171 -295
- package/docs/sdks/oauthtoken/README.md +5 -5
- package/docs/sdks/supportingdocuments/README.md +113 -0
- package/funcs/applicationsCreate.d.ts +1 -2
- package/funcs/applicationsCreate.d.ts.map +1 -1
- package/funcs/applicationsCreate.js +2 -3
- package/funcs/applicationsCreate.js.map +1 -1
- package/funcs/{oauthTokenGet.d.ts → oauthTokenOauthToken.d.ts} +2 -2
- package/funcs/oauthTokenOauthToken.d.ts.map +1 -0
- package/funcs/{oauthTokenGet.js → oauthTokenOauthToken.js} +3 -3
- package/funcs/oauthTokenOauthToken.js.map +1 -0
- package/funcs/supportingDocumentsCreate.d.ts +15 -0
- package/funcs/supportingDocumentsCreate.d.ts.map +1 -0
- package/funcs/{applicationsList.js → supportingDocumentsCreate.js} +15 -12
- package/funcs/supportingDocumentsCreate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +4 -7
- package/lib/config.js.map +1 -1
- package/lib/matchers.d.ts +3 -1
- package/lib/matchers.d.ts.map +1 -1
- package/lib/matchers.js +12 -0
- package/lib/matchers.js.map +1 -1
- package/lib/sdks.d.ts +3 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +13 -13
- package/lib/sdks.js.map +1 -1
- package/models/components/addressattributes.d.ts +8 -8
- package/models/components/addressattributes.d.ts.map +1 -1
- package/models/components/addressattributes.js +13 -14
- package/models/components/addressattributes.js.map +1 -1
- package/models/components/applicationresource.d.ts +30 -0
- package/models/components/applicationresource.d.ts.map +1 -0
- package/models/components/applicationresource.js +73 -0
- package/models/components/applicationresource.js.map +1 -0
- package/models/components/badrequesterror.d.ts +119 -0
- package/models/components/badrequesterror.d.ts.map +1 -0
- package/models/components/badrequesterror.js +140 -0
- package/models/components/badrequesterror.js.map +1 -0
- package/models/components/commercialapplicationjsonapirelationships.d.ts +384 -0
- package/models/components/commercialapplicationjsonapirelationships.d.ts.map +1 -0
- package/models/components/commercialapplicationjsonapirelationships.js +391 -0
- package/models/components/commercialapplicationjsonapirelationships.js.map +1 -0
- package/models/components/commercialapplicationresource.d.ts +191 -0
- package/models/components/commercialapplicationresource.d.ts.map +1 -0
- package/models/components/commercialapplicationresource.js +183 -0
- package/models/components/commercialapplicationresource.js.map +1 -0
- package/models/components/commercialsecuredloanapplicationsubmissionpayload.d.ts +124 -0
- package/models/components/commercialsecuredloanapplicationsubmissionpayload.d.ts.map +1 -0
- package/models/components/commercialsecuredloanapplicationsubmissionpayload.js +144 -0
- package/models/components/commercialsecuredloanapplicationsubmissionpayload.js.map +1 -0
- package/models/components/commercialsecuredloanassetattributes.d.ts +235 -0
- package/models/components/commercialsecuredloanassetattributes.d.ts.map +1 -0
- package/models/components/commercialsecuredloanassetattributes.js +168 -0
- package/models/components/commercialsecuredloanassetattributes.js.map +1 -0
- package/models/components/commercialsecuredloanassettype.d.ts +100 -0
- package/models/components/commercialsecuredloanassettype.d.ts.map +1 -0
- package/models/components/commercialsecuredloanassettype.js +84 -0
- package/models/components/commercialsecuredloanassettype.js.map +1 -0
- package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts +455 -0
- package/models/components/commercialsecuredloancommercialapplicationrelationships.d.ts.map +1 -0
- package/models/components/commercialsecuredloancommercialapplicationrelationships.js +504 -0
- package/models/components/commercialsecuredloancommercialapplicationrelationships.js.map +1 -0
- package/models/components/consumerapplicationjsonapirelationships.d.ts +296 -0
- package/models/components/consumerapplicationjsonapirelationships.d.ts.map +1 -0
- package/models/components/consumerapplicationjsonapirelationships.js +310 -0
- package/models/components/consumerapplicationjsonapirelationships.js.map +1 -0
- package/models/components/consumerapplicationresource.d.ts +191 -0
- package/models/components/consumerapplicationresource.d.ts.map +1 -0
- package/models/components/consumerapplicationresource.js +187 -0
- package/models/components/consumerapplicationresource.js.map +1 -0
- package/models/components/consumersecuredloanapplicationsubmissionpayload.d.ts +124 -0
- package/models/components/consumersecuredloanapplicationsubmissionpayload.d.ts.map +1 -0
- package/models/components/consumersecuredloanapplicationsubmissionpayload.js +146 -0
- package/models/components/consumersecuredloanapplicationsubmissionpayload.js.map +1 -0
- package/models/components/consumersecuredloanassetattributes.d.ts +235 -0
- package/models/components/consumersecuredloanassetattributes.d.ts.map +1 -0
- package/models/components/consumersecuredloanassetattributes.js +170 -0
- package/models/components/consumersecuredloanassetattributes.js.map +1 -0
- package/models/components/consumersecuredloanassettype.d.ts +64 -0
- package/models/components/consumersecuredloanassettype.d.ts.map +1 -0
- package/models/components/{consumerassettype.js → consumersecuredloanassettype.js} +27 -28
- package/models/components/consumersecuredloanassettype.js.map +1 -0
- package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts +376 -0
- package/models/components/consumersecuredloanconsumerapplicationrelationships.d.ts.map +1 -0
- package/models/components/consumersecuredloanconsumerapplicationrelationships.js +426 -0
- package/models/components/consumersecuredloanconsumerapplicationrelationships.js.map +1 -0
- package/models/components/createsupportingdocumentsresponse.d.ts +121 -0
- package/models/components/createsupportingdocumentsresponse.d.ts.map +1 -0
- package/models/components/createsupportingdocumentsresponse.js +149 -0
- package/models/components/createsupportingdocumentsresponse.js.map +1 -0
- package/models/components/documenttype.d.ts +70 -0
- package/models/components/documenttype.d.ts.map +1 -0
- package/models/components/documenttype.js +75 -0
- package/models/components/documenttype.js.map +1 -0
- package/models/components/entityattributes.d.ts +0 -22
- package/models/components/entityattributes.d.ts.map +1 -1
- package/models/components/entityattributes.js +0 -19
- package/models/components/entityattributes.js.map +1 -1
- package/models/components/forbiddenerror.d.ts +17 -39
- package/models/components/forbiddenerror.d.ts.map +1 -1
- package/models/components/forbiddenerror.js +27 -46
- package/models/components/forbiddenerror.js.map +1 -1
- package/models/components/index.d.ts +25 -8
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +25 -8
- package/models/components/index.js.map +1 -1
- package/models/components/linkobject.d.ts +47 -0
- package/models/components/linkobject.d.ts.map +1 -0
- package/models/components/linkobject.js +77 -0
- package/models/components/linkobject.js.map +1 -0
- package/models/components/relationshipresourcenotfound.d.ts +116 -0
- package/models/components/relationshipresourcenotfound.d.ts.map +1 -0
- package/models/components/relationshipresourcenotfound.js +139 -0
- package/models/components/relationshipresourcenotfound.js.map +1 -0
- package/models/components/resourcenotfound.d.ts +119 -0
- package/models/components/resourcenotfound.d.ts.map +1 -0
- package/models/components/resourcenotfound.js +139 -0
- package/models/components/resourcenotfound.js.map +1 -0
- package/models/components/resourcetypes.d.ts +46 -0
- package/models/components/resourcetypes.d.ts.map +1 -0
- package/models/components/{links.js → resourcetypes.js} +21 -27
- package/models/components/resourcetypes.js.map +1 -0
- package/models/components/supportingdocumentattributes.d.ts +40 -0
- package/models/components/supportingdocumentattributes.d.ts.map +1 -0
- package/models/components/{applicationattributescreate.js → supportingdocumentattributes.js} +24 -24
- package/models/components/supportingdocumentattributes.js.map +1 -0
- package/models/components/supportingdocumentattributesinput.d.ts +38 -0
- package/models/components/supportingdocumentattributesinput.d.ts.map +1 -0
- package/models/components/supportingdocumentattributesinput.js +72 -0
- package/models/components/supportingdocumentattributesinput.js.map +1 -0
- package/models/components/supportingdocumentrelationships.d.ts +448 -0
- package/models/components/supportingdocumentrelationships.d.ts.map +1 -0
- package/models/components/supportingdocumentrelationships.js +434 -0
- package/models/components/supportingdocumentrelationships.js.map +1 -0
- package/models/components/supportingdocumentresource.d.ts +91 -0
- package/models/components/supportingdocumentresource.d.ts.map +1 -0
- package/models/components/supportingdocumentresource.js +121 -0
- package/models/components/supportingdocumentresource.js.map +1 -0
- package/models/components/uploadmimetype.d.ts +49 -0
- package/models/components/uploadmimetype.d.ts.map +1 -0
- package/models/components/{applicationtype.js → uploadmimetype.js} +22 -14
- package/models/components/uploadmimetype.js.map +1 -0
- package/models/errors/createapplication.d.ts +38 -0
- package/models/errors/createapplication.d.ts.map +1 -0
- package/models/errors/{responsebody.js → createapplication.js} +15 -15
- package/models/errors/createapplication.js.map +1 -0
- package/models/errors/index.d.ts +2 -1
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +2 -1
- package/models/errors/index.js.map +1 -1
- package/models/errors/supportingdocumentscreate.d.ts +143 -0
- package/models/errors/supportingdocumentscreate.d.ts.map +1 -0
- package/models/errors/supportingdocumentscreate.js +225 -0
- package/models/errors/supportingdocumentscreate.js.map +1 -0
- package/models/operations/createapplication.d.ts +66 -808
- package/models/operations/createapplication.d.ts.map +1 -1
- package/models/operations/createapplication.js +82 -837
- package/models/operations/createapplication.js.map +1 -1
- package/models/operations/index.d.ts +1 -2
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -2
- package/models/operations/index.js.map +1 -1
- package/models/operations/supportingdocumentscreate.d.ts +60 -0
- package/models/operations/supportingdocumentscreate.d.ts.map +1 -0
- package/models/operations/supportingdocumentscreate.js +108 -0
- package/models/operations/supportingdocumentscreate.js.map +1 -0
- package/package.json +2 -2
- package/sdk/applications.d.ts +1 -10
- package/sdk/applications.d.ts.map +1 -1
- package/sdk/applications.js +0 -14
- package/sdk/applications.js.map +1 -1
- package/sdk/oauthtoken.d.ts +1 -1
- package/sdk/oauthtoken.d.ts.map +1 -1
- package/sdk/oauthtoken.js +3 -3
- package/sdk/oauthtoken.js.map +1 -1
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/supportingdocuments.d.ts +10 -0
- package/sdk/supportingdocuments.d.ts.map +1 -0
- package/sdk/supportingdocuments.js +19 -0
- package/sdk/supportingdocuments.js.map +1 -0
- package/src/funcs/applicationsCreate.ts +7 -8
- package/src/funcs/{oauthTokenGet.ts → oauthTokenOauthToken.ts} +1 -1
- package/src/funcs/{applicationsList.ts → supportingDocumentsCreate.ts} +31 -20
- package/src/lib/config.ts +4 -7
- package/src/lib/matchers.ts +20 -0
- package/src/lib/sdks.ts +19 -13
- package/src/models/components/addressattributes.ts +18 -14
- package/src/models/components/applicationresource.ts +83 -0
- package/src/models/components/badrequesterror.ts +182 -0
- package/src/models/components/commercialapplicationjsonapirelationships.ts +894 -0
- package/src/models/components/commercialapplicationresource.ts +355 -0
- package/src/models/components/commercialsecuredloanapplicationsubmissionpayload.ts +237 -0
- package/src/models/components/commercialsecuredloanassetattributes.ts +315 -0
- package/src/models/components/commercialsecuredloanassettype.ts +64 -0
- package/src/models/components/commercialsecuredloancommercialapplicationrelationships.ts +1148 -0
- package/src/models/components/consumerapplicationjsonapirelationships.ts +683 -0
- package/src/models/components/consumerapplicationresource.ts +342 -0
- package/src/models/components/consumersecuredloanapplicationsubmissionpayload.ts +270 -0
- package/src/models/components/consumersecuredloanassetattributes.ts +330 -0
- package/src/models/components/consumersecuredloanassettype.ts +47 -0
- package/src/models/components/consumersecuredloanconsumerapplicationrelationships.ts +1011 -0
- package/src/models/components/createsupportingdocumentsresponse.ts +252 -0
- package/src/models/components/documenttype.ts +49 -0
- package/src/models/components/entityattributes.ts +0 -44
- package/src/models/components/forbiddenerror.ts +35 -58
- package/src/models/components/index.ts +25 -8
- package/src/models/components/linkobject.ts +84 -0
- package/src/models/components/relationshipresourcenotfound.ts +195 -0
- package/src/models/components/resourcenotfound.ts +188 -0
- package/src/models/components/resourcetypes.ts +39 -0
- package/src/models/components/supportingdocumentattributes.ts +87 -0
- package/src/models/components/supportingdocumentattributesinput.ts +84 -0
- package/src/models/components/supportingdocumentrelationships.ts +828 -0
- package/src/models/components/supportingdocumentresource.ts +163 -0
- package/src/models/components/uploadmimetype.ts +44 -0
- package/src/models/errors/createapplication.ts +76 -0
- package/src/models/errors/index.ts +2 -1
- package/src/models/errors/supportingdocumentscreate.ts +342 -0
- package/src/models/operations/createapplication.ts +143 -1778
- package/src/models/operations/index.ts +1 -2
- package/src/models/operations/supportingdocumentscreate.ts +150 -0
- package/src/sdk/applications.ts +1 -32
- package/src/sdk/oauthtoken.ts +3 -3
- package/src/sdk/sdk.ts +8 -0
- package/src/sdk/supportingdocuments.ts +25 -0
- package/funcs/applicationsGet.d.ts +0 -14
- package/funcs/applicationsGet.d.ts.map +0 -1
- package/funcs/applicationsGet.js +0 -120
- package/funcs/applicationsGet.js.map +0 -1
- package/funcs/applicationsList.d.ts +0 -14
- package/funcs/applicationsList.d.ts.map +0 -1
- package/funcs/applicationsList.js.map +0 -1
- package/funcs/oauthTokenGet.d.ts.map +0 -1
- package/funcs/oauthTokenGet.js.map +0 -1
- package/models/components/applicationattributes.d.ts +0 -69
- package/models/components/applicationattributes.d.ts.map +0 -1
- package/models/components/applicationattributes.js +0 -85
- package/models/components/applicationattributes.js.map +0 -1
- package/models/components/applicationattributescreate.d.ts +0 -43
- package/models/components/applicationattributescreate.d.ts.map +0 -1
- package/models/components/applicationattributescreate.js.map +0 -1
- package/models/components/applicationresourcebulksubmission.d.ts +0 -527
- package/models/components/applicationresourcebulksubmission.d.ts.map +0 -1
- package/models/components/applicationresourcebulksubmission.js +0 -565
- package/models/components/applicationresourcebulksubmission.js.map +0 -1
- package/models/components/applicationtype.d.ts +0 -28
- package/models/components/applicationtype.d.ts.map +0 -1
- package/models/components/applicationtype.js.map +0 -1
- package/models/components/assetattributes.d.ts +0 -311
- package/models/components/assetattributes.d.ts.map +0 -1
- package/models/components/assetattributes.js +0 -234
- package/models/components/assetattributes.js.map +0 -1
- package/models/components/commercialassettype.d.ts +0 -44
- package/models/components/commercialassettype.d.ts.map +0 -1
- package/models/components/commercialassettype.js +0 -85
- package/models/components/commercialassettype.js.map +0 -1
- package/models/components/consumerassettype.d.ts +0 -32
- package/models/components/consumerassettype.d.ts.map +0 -1
- package/models/components/consumerassettype.js.map +0 -1
- package/models/components/links.d.ts +0 -40
- package/models/components/links.d.ts.map +0 -1
- package/models/components/links.js.map +0 -1
- package/models/errors/responsebody.d.ts +0 -38
- package/models/errors/responsebody.d.ts.map +0 -1
- package/models/errors/responsebody.js.map +0 -1
- package/models/operations/getapplication.d.ts +0 -962
- package/models/operations/getapplication.d.ts.map +0 -1
- package/models/operations/getapplication.js +0 -1030
- package/models/operations/getapplication.js.map +0 -1
- package/models/operations/getapplications.d.ts +0 -962
- package/models/operations/getapplications.d.ts.map +0 -1
- package/models/operations/getapplications.js +0 -1029
- package/models/operations/getapplications.js.map +0 -1
- package/src/funcs/applicationsGet.ts +0 -168
- package/src/models/components/applicationattributes.ts +0 -128
- package/src/models/components/applicationattributescreate.ts +0 -90
- package/src/models/components/applicationresourcebulksubmission.ts +0 -1172
- package/src/models/components/applicationtype.ts +0 -33
- package/src/models/components/assetattributes.ts +0 -411
- package/src/models/components/commercialassettype.ts +0 -61
- package/src/models/components/consumerassettype.ts +0 -43
- package/src/models/components/links.ts +0 -72
- package/src/models/errors/responsebody.ts +0 -76
- package/src/models/operations/getapplication.ts +0 -2246
- package/src/models/operations/getapplications.ts +0 -2191
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { FinanceableCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
13
14
|
import { APIError } from "../models/errors/apierror.js";
|
|
14
15
|
import {
|
|
15
16
|
ConnectionError,
|
|
@@ -25,16 +26,17 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
25
26
|
import { Result } from "../types/fp.js";
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Create a supporting document record in Financeable, and returns a pre-signed URL to upload this document with.
|
|
29
30
|
*/
|
|
30
|
-
export function
|
|
31
|
+
export function supportingDocumentsCreate(
|
|
31
32
|
client: FinanceableCore,
|
|
32
|
-
request: operations.
|
|
33
|
+
request: operations.SupportingDocumentsCreateRequest,
|
|
33
34
|
options?: RequestOptions,
|
|
34
35
|
): APIPromise<
|
|
35
36
|
Result<
|
|
36
|
-
|
|
37
|
-
| errors.
|
|
37
|
+
components.CreateSupportingDocumentsResponse,
|
|
38
|
+
| errors.SupportingDocumentsCreateResponseBody
|
|
39
|
+
| errors.SupportingDocumentsCreateSupportingDocumentsResponseBody
|
|
38
40
|
| APIError
|
|
39
41
|
| SDKValidationError
|
|
40
42
|
| UnexpectedClientError
|
|
@@ -53,13 +55,14 @@ export function applicationsList(
|
|
|
53
55
|
|
|
54
56
|
async function $do(
|
|
55
57
|
client: FinanceableCore,
|
|
56
|
-
request: operations.
|
|
58
|
+
request: operations.SupportingDocumentsCreateRequest,
|
|
57
59
|
options?: RequestOptions,
|
|
58
60
|
): Promise<
|
|
59
61
|
[
|
|
60
62
|
Result<
|
|
61
|
-
|
|
62
|
-
| errors.
|
|
63
|
+
components.CreateSupportingDocumentsResponse,
|
|
64
|
+
| errors.SupportingDocumentsCreateResponseBody
|
|
65
|
+
| errors.SupportingDocumentsCreateSupportingDocumentsResponseBody
|
|
63
66
|
| APIError
|
|
64
67
|
| SDKValidationError
|
|
65
68
|
| UnexpectedClientError
|
|
@@ -73,22 +76,24 @@ async function $do(
|
|
|
73
76
|
> {
|
|
74
77
|
const parsed = safeParse(
|
|
75
78
|
request,
|
|
76
|
-
(value) =>
|
|
79
|
+
(value) =>
|
|
80
|
+
operations.SupportingDocumentsCreateRequest$outboundSchema.parse(value),
|
|
77
81
|
"Input validation failed",
|
|
78
82
|
);
|
|
79
83
|
if (!parsed.ok) {
|
|
80
84
|
return [parsed, { status: "invalid" }];
|
|
81
85
|
}
|
|
82
86
|
const payload = parsed.value;
|
|
83
|
-
const body =
|
|
87
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
84
88
|
|
|
85
|
-
const path = pathToFunc("/
|
|
89
|
+
const path = pathToFunc("/")();
|
|
86
90
|
|
|
87
91
|
const query = encodeFormQuery({
|
|
88
|
-
"
|
|
92
|
+
"mimeType": payload.mimeType,
|
|
89
93
|
}, { explode: false });
|
|
90
94
|
|
|
91
95
|
const headers = new Headers(compactMap({
|
|
96
|
+
"Content-Type": "application/json",
|
|
92
97
|
Accept: "application/json",
|
|
93
98
|
}));
|
|
94
99
|
|
|
@@ -100,7 +105,7 @@ async function $do(
|
|
|
100
105
|
|
|
101
106
|
const context = {
|
|
102
107
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
103
|
-
operationID: "
|
|
108
|
+
operationID: "SupportingDocuments_create",
|
|
104
109
|
oAuth2Scopes: [],
|
|
105
110
|
|
|
106
111
|
resolvedSecurity: requestSecurity,
|
|
@@ -114,7 +119,7 @@ async function $do(
|
|
|
114
119
|
|
|
115
120
|
const requestRes = client._createRequest(context, {
|
|
116
121
|
security: requestSecurity,
|
|
117
|
-
method: "
|
|
122
|
+
method: "POST",
|
|
118
123
|
baseURL: options?.serverURL,
|
|
119
124
|
path: path,
|
|
120
125
|
headers: headers,
|
|
@@ -129,7 +134,7 @@ async function $do(
|
|
|
129
134
|
|
|
130
135
|
const doResult = await client._do(req, {
|
|
131
136
|
context,
|
|
132
|
-
errorCodes: ["
|
|
137
|
+
errorCodes: ["400", "404", "4XX", "5XX"],
|
|
133
138
|
retryConfig: context.retryConfig,
|
|
134
139
|
retryCodes: context.retryCodes,
|
|
135
140
|
});
|
|
@@ -143,8 +148,9 @@ async function $do(
|
|
|
143
148
|
};
|
|
144
149
|
|
|
145
150
|
const [result] = await M.match<
|
|
146
|
-
|
|
147
|
-
| errors.
|
|
151
|
+
components.CreateSupportingDocumentsResponse,
|
|
152
|
+
| errors.SupportingDocumentsCreateResponseBody
|
|
153
|
+
| errors.SupportingDocumentsCreateSupportingDocumentsResponseBody
|
|
148
154
|
| APIError
|
|
149
155
|
| SDKValidationError
|
|
150
156
|
| UnexpectedClientError
|
|
@@ -153,8 +159,13 @@ async function $do(
|
|
|
153
159
|
| RequestTimeoutError
|
|
154
160
|
| ConnectionError
|
|
155
161
|
>(
|
|
156
|
-
M.json(
|
|
157
|
-
M.jsonErr(
|
|
162
|
+
M.json(201, components.CreateSupportingDocumentsResponse$inboundSchema),
|
|
163
|
+
M.jsonErr(400, errors.SupportingDocumentsCreateResponseBody$inboundSchema),
|
|
164
|
+
M.jsonErr(
|
|
165
|
+
404,
|
|
166
|
+
errors
|
|
167
|
+
.SupportingDocumentsCreateSupportingDocumentsResponseBody$inboundSchema,
|
|
168
|
+
),
|
|
158
169
|
M.fail("4XX"),
|
|
159
170
|
M.fail("5XX"),
|
|
160
171
|
)(response, { extraFields: responseFields });
|
package/src/lib/config.ts
CHANGED
|
@@ -11,10 +11,7 @@ import { Params, pathToFunc } from "./url.js";
|
|
|
11
11
|
* Contains the list of servers available to the SDK
|
|
12
12
|
*/
|
|
13
13
|
export const ServerList = [
|
|
14
|
-
|
|
15
|
-
* Production Server
|
|
16
|
-
*/
|
|
17
|
-
"https://api.financeable.com.au",
|
|
14
|
+
"https://server.api.financeable.com.au",
|
|
18
15
|
] as const;
|
|
19
16
|
|
|
20
17
|
export type SDKOptions = {
|
|
@@ -57,8 +54,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
57
54
|
export const SDK_METADATA = {
|
|
58
55
|
language: "typescript",
|
|
59
56
|
openapiDocVersion: "0.4.0",
|
|
60
|
-
sdkVersion: "0.
|
|
61
|
-
genVersion: "2.
|
|
57
|
+
sdkVersion: "0.6.0",
|
|
58
|
+
genVersion: "2.599.0",
|
|
62
59
|
userAgent:
|
|
63
|
-
"speakeasy-sdk/typescript 0.
|
|
60
|
+
"speakeasy-sdk/typescript 0.6.0 2.599.0 0.4.0 @financeable/aggregation",
|
|
64
61
|
} as const;
|
package/src/lib/matchers.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { isPlainObject } from "./is-plain-object.js";
|
|
|
10
10
|
import { safeParse } from "./schemas.js";
|
|
11
11
|
|
|
12
12
|
export type Encoding =
|
|
13
|
+
| "jsonl"
|
|
13
14
|
| "json"
|
|
14
15
|
| "text"
|
|
15
16
|
| "bytes"
|
|
@@ -19,6 +20,7 @@ export type Encoding =
|
|
|
19
20
|
| "fail";
|
|
20
21
|
|
|
21
22
|
const DEFAULT_CONTENT_TYPES: Record<Encoding, string> = {
|
|
23
|
+
jsonl: "application/jsonl",
|
|
22
24
|
json: "application/json",
|
|
23
25
|
text: "text/plain",
|
|
24
26
|
bytes: "application/octet-stream",
|
|
@@ -72,6 +74,21 @@ export function json<T>(
|
|
|
72
74
|
return { ...options, enc: "json", codes, schema };
|
|
73
75
|
}
|
|
74
76
|
|
|
77
|
+
export function jsonl<T>(
|
|
78
|
+
codes: StatusCodePredicate,
|
|
79
|
+
schema: Schema<T>,
|
|
80
|
+
options?: MatchOptions,
|
|
81
|
+
): ValueMatcher<T> {
|
|
82
|
+
return { ...options, enc: "jsonl", codes, schema };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function jsonlErr<E>(
|
|
86
|
+
codes: StatusCodePredicate,
|
|
87
|
+
schema: Schema<E>,
|
|
88
|
+
options?: MatchOptions,
|
|
89
|
+
): ErrorMatcher<E> {
|
|
90
|
+
return { ...options, err: true, enc: "jsonl", codes, schema };
|
|
91
|
+
}
|
|
75
92
|
export function textErr<E>(
|
|
76
93
|
codes: StatusCodePredicate,
|
|
77
94
|
schema: Schema<E>,
|
|
@@ -204,6 +221,9 @@ export function match<T, E>(
|
|
|
204
221
|
case "json":
|
|
205
222
|
raw = await response.json();
|
|
206
223
|
break;
|
|
224
|
+
case "jsonl":
|
|
225
|
+
raw = response.body;
|
|
226
|
+
break;
|
|
207
227
|
case "bytes":
|
|
208
228
|
raw = new Uint8Array(await response.arrayBuffer());
|
|
209
229
|
break;
|
package/src/lib/sdks.ts
CHANGED
|
@@ -47,12 +47,14 @@ export type RequestOptions = {
|
|
|
47
47
|
*/
|
|
48
48
|
serverURL?: string | URL;
|
|
49
49
|
/**
|
|
50
|
+
* @deprecated `fetchOptions` has been flattened into `RequestOptions`.
|
|
51
|
+
*
|
|
50
52
|
* Sets various request options on the `fetch` call made by an SDK method.
|
|
51
53
|
*
|
|
52
54
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request}
|
|
53
55
|
*/
|
|
54
56
|
fetchOptions?: Omit<RequestInit, "method" | "body">;
|
|
55
|
-
}
|
|
57
|
+
} & Omit<RequestInit, "method" | "body">;
|
|
56
58
|
|
|
57
59
|
type RequestConfig = {
|
|
58
60
|
method: string;
|
|
@@ -172,7 +174,9 @@ export class ClientSDK {
|
|
|
172
174
|
cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie;
|
|
173
175
|
headers.set("cookie", cookie);
|
|
174
176
|
|
|
175
|
-
const userHeaders = new Headers(
|
|
177
|
+
const userHeaders = new Headers(
|
|
178
|
+
options?.headers ?? options?.fetchOptions?.headers,
|
|
179
|
+
);
|
|
176
180
|
for (const [k, v] of userHeaders) {
|
|
177
181
|
headers.set(k, v);
|
|
178
182
|
}
|
|
@@ -183,20 +187,16 @@ export class ClientSDK {
|
|
|
183
187
|
headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
|
|
184
188
|
}
|
|
185
189
|
|
|
186
|
-
|
|
190
|
+
const fetchOptions: Omit<RequestInit, "method" | "body"> = {
|
|
191
|
+
...options?.fetchOptions,
|
|
192
|
+
...options,
|
|
193
|
+
};
|
|
187
194
|
if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) {
|
|
188
195
|
const timeoutSignal = AbortSignal.timeout(conf.timeoutMs);
|
|
189
|
-
|
|
190
|
-
fetchOptions = { signal: timeoutSignal };
|
|
191
|
-
} else {
|
|
192
|
-
fetchOptions.signal = timeoutSignal;
|
|
193
|
-
}
|
|
196
|
+
fetchOptions.signal = timeoutSignal;
|
|
194
197
|
}
|
|
195
198
|
|
|
196
199
|
if (conf.body instanceof ReadableStream) {
|
|
197
|
-
if (!fetchOptions) {
|
|
198
|
-
fetchOptions = {};
|
|
199
|
-
}
|
|
200
200
|
Object.assign(fetchOptions, { duplex: "half" });
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -302,7 +302,9 @@ export class ClientSDK {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
const jsonLikeContentTypeRE =
|
|
305
|
+
const jsonLikeContentTypeRE = /(application|text)\/.*?\+*json.*/;
|
|
306
|
+
const jsonlLikeContentTypeRE =
|
|
307
|
+
/(application|text)\/(.*?\+*\bjsonl\b.*|.*?\+*\bx-ndjson\b.*)/;
|
|
306
308
|
async function logRequest(logger: Logger | undefined, req: Request) {
|
|
307
309
|
if (!logger) {
|
|
308
310
|
return;
|
|
@@ -368,9 +370,13 @@ async function logResponse(
|
|
|
368
370
|
logger.group("Body:");
|
|
369
371
|
switch (true) {
|
|
370
372
|
case matchContentType(res, "application/json")
|
|
371
|
-
|| jsonLikeContentTypeRE.test(ct):
|
|
373
|
+
|| jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct):
|
|
372
374
|
logger.log(await res.clone().json());
|
|
373
375
|
break;
|
|
376
|
+
case matchContentType(res, "application/jsonl")
|
|
377
|
+
|| jsonlLikeContentTypeRE.test(ct):
|
|
378
|
+
logger.log(await res.clone().text());
|
|
379
|
+
break;
|
|
374
380
|
case matchContentType(res, "text/event-stream"):
|
|
375
381
|
logger.log(`<${contentType}>`);
|
|
376
382
|
break;
|
|
@@ -13,11 +13,13 @@ import {
|
|
|
13
13
|
AustralianStatesAndTerritories$outboundSchema,
|
|
14
14
|
} from "./australianstatesandterritories.js";
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const AddressAttributesStatus = {
|
|
17
17
|
Current: "current",
|
|
18
18
|
Previous: "previous",
|
|
19
19
|
} as const;
|
|
20
|
-
export type
|
|
20
|
+
export type AddressAttributesStatus = ClosedEnum<
|
|
21
|
+
typeof AddressAttributesStatus
|
|
22
|
+
>;
|
|
21
23
|
|
|
22
24
|
export type AddressAttributes = {
|
|
23
25
|
unitNumber?: number | undefined;
|
|
@@ -32,28 +34,30 @@ export type AddressAttributes = {
|
|
|
32
34
|
street: string;
|
|
33
35
|
state: AustralianStatesAndTerritories;
|
|
34
36
|
country: string;
|
|
35
|
-
status:
|
|
37
|
+
status: AddressAttributesStatus;
|
|
36
38
|
monthsAt?: number | undefined;
|
|
37
39
|
yearsAt?: number | undefined;
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
/** @internal */
|
|
41
|
-
export const
|
|
42
|
-
|
|
43
|
+
export const AddressAttributesStatus$inboundSchema: z.ZodNativeEnum<
|
|
44
|
+
typeof AddressAttributesStatus
|
|
45
|
+
> = z.nativeEnum(AddressAttributesStatus);
|
|
43
46
|
|
|
44
47
|
/** @internal */
|
|
45
|
-
export const
|
|
46
|
-
|
|
48
|
+
export const AddressAttributesStatus$outboundSchema: z.ZodNativeEnum<
|
|
49
|
+
typeof AddressAttributesStatus
|
|
50
|
+
> = AddressAttributesStatus$inboundSchema;
|
|
47
51
|
|
|
48
52
|
/**
|
|
49
53
|
* @internal
|
|
50
54
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
51
55
|
*/
|
|
52
|
-
export namespace
|
|
53
|
-
/** @deprecated use `
|
|
54
|
-
export const inboundSchema =
|
|
55
|
-
/** @deprecated use `
|
|
56
|
-
export const outboundSchema =
|
|
56
|
+
export namespace AddressAttributesStatus$ {
|
|
57
|
+
/** @deprecated use `AddressAttributesStatus$inboundSchema` instead. */
|
|
58
|
+
export const inboundSchema = AddressAttributesStatus$inboundSchema;
|
|
59
|
+
/** @deprecated use `AddressAttributesStatus$outboundSchema` instead. */
|
|
60
|
+
export const outboundSchema = AddressAttributesStatus$outboundSchema;
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
/** @internal */
|
|
@@ -74,7 +78,7 @@ export const AddressAttributes$inboundSchema: z.ZodType<
|
|
|
74
78
|
street: z.string(),
|
|
75
79
|
state: AustralianStatesAndTerritories$inboundSchema,
|
|
76
80
|
country: z.string(),
|
|
77
|
-
status:
|
|
81
|
+
status: AddressAttributesStatus$inboundSchema,
|
|
78
82
|
monthsAt: z.number().int().optional(),
|
|
79
83
|
yearsAt: z.number().int().optional(),
|
|
80
84
|
});
|
|
@@ -116,7 +120,7 @@ export const AddressAttributes$outboundSchema: z.ZodType<
|
|
|
116
120
|
street: z.string(),
|
|
117
121
|
state: AustralianStatesAndTerritories$outboundSchema,
|
|
118
122
|
country: z.string(),
|
|
119
|
-
status:
|
|
123
|
+
status: AddressAttributesStatus$outboundSchema,
|
|
120
124
|
monthsAt: z.number().int().optional(),
|
|
121
125
|
yearsAt: z.number().int().optional(),
|
|
122
126
|
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
CommercialApplicationResource,
|
|
11
|
+
CommercialApplicationResource$inboundSchema,
|
|
12
|
+
CommercialApplicationResource$Outbound,
|
|
13
|
+
CommercialApplicationResource$outboundSchema,
|
|
14
|
+
} from "./commercialapplicationresource.js";
|
|
15
|
+
import {
|
|
16
|
+
ConsumerApplicationResource,
|
|
17
|
+
ConsumerApplicationResource$inboundSchema,
|
|
18
|
+
ConsumerApplicationResource$Outbound,
|
|
19
|
+
ConsumerApplicationResource$outboundSchema,
|
|
20
|
+
} from "./consumerapplicationresource.js";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents either a Consumer or Commercial Application resource
|
|
24
|
+
*/
|
|
25
|
+
export type ApplicationResource =
|
|
26
|
+
| ConsumerApplicationResource
|
|
27
|
+
| CommercialApplicationResource;
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const ApplicationResource$inboundSchema: z.ZodType<
|
|
31
|
+
ApplicationResource,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
unknown
|
|
34
|
+
> = z.union([
|
|
35
|
+
ConsumerApplicationResource$inboundSchema,
|
|
36
|
+
CommercialApplicationResource$inboundSchema,
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export type ApplicationResource$Outbound =
|
|
41
|
+
| ConsumerApplicationResource$Outbound
|
|
42
|
+
| CommercialApplicationResource$Outbound;
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const ApplicationResource$outboundSchema: z.ZodType<
|
|
46
|
+
ApplicationResource$Outbound,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
ApplicationResource
|
|
49
|
+
> = z.union([
|
|
50
|
+
ConsumerApplicationResource$outboundSchema,
|
|
51
|
+
CommercialApplicationResource$outboundSchema,
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
+
*/
|
|
58
|
+
export namespace ApplicationResource$ {
|
|
59
|
+
/** @deprecated use `ApplicationResource$inboundSchema` instead. */
|
|
60
|
+
export const inboundSchema = ApplicationResource$inboundSchema;
|
|
61
|
+
/** @deprecated use `ApplicationResource$outboundSchema` instead. */
|
|
62
|
+
export const outboundSchema = ApplicationResource$outboundSchema;
|
|
63
|
+
/** @deprecated use `ApplicationResource$Outbound` instead. */
|
|
64
|
+
export type Outbound = ApplicationResource$Outbound;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function applicationResourceToJSON(
|
|
68
|
+
applicationResource: ApplicationResource,
|
|
69
|
+
): string {
|
|
70
|
+
return JSON.stringify(
|
|
71
|
+
ApplicationResource$outboundSchema.parse(applicationResource),
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function applicationResourceFromJSON(
|
|
76
|
+
jsonString: string,
|
|
77
|
+
): SafeParseResult<ApplicationResource, SDKValidationError> {
|
|
78
|
+
return safeParse(
|
|
79
|
+
jsonString,
|
|
80
|
+
(x) => ApplicationResource$inboundSchema.parse(JSON.parse(x)),
|
|
81
|
+
`Failed to parse 'ApplicationResource' from JSON`,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
APIErrorLinks,
|
|
12
|
+
APIErrorLinks$inboundSchema,
|
|
13
|
+
APIErrorLinks$Outbound,
|
|
14
|
+
APIErrorLinks$outboundSchema,
|
|
15
|
+
} from "./apierrorlinks.js";
|
|
16
|
+
import {
|
|
17
|
+
ErrorSource,
|
|
18
|
+
ErrorSource$inboundSchema,
|
|
19
|
+
ErrorSource$Outbound,
|
|
20
|
+
ErrorSource$outboundSchema,
|
|
21
|
+
} from "./errorsource.js";
|
|
22
|
+
|
|
23
|
+
export const Status = {
|
|
24
|
+
FourHundred: "400",
|
|
25
|
+
} as const;
|
|
26
|
+
export type Status = ClosedEnum<typeof Status>;
|
|
27
|
+
|
|
28
|
+
export const Code = {
|
|
29
|
+
BadRequest: "BadRequest",
|
|
30
|
+
} as const;
|
|
31
|
+
export type Code = ClosedEnum<typeof Code>;
|
|
32
|
+
|
|
33
|
+
export const Title = {
|
|
34
|
+
BadRequest: "Bad Request",
|
|
35
|
+
} as const;
|
|
36
|
+
export type Title = ClosedEnum<typeof Title>;
|
|
37
|
+
|
|
38
|
+
export type BadRequestError = {
|
|
39
|
+
id?: string | undefined;
|
|
40
|
+
links?: APIErrorLinks | undefined;
|
|
41
|
+
status: Status;
|
|
42
|
+
code: Code;
|
|
43
|
+
title: Title;
|
|
44
|
+
detail: string;
|
|
45
|
+
/**
|
|
46
|
+
* An object describing the source of the error from the request
|
|
47
|
+
*/
|
|
48
|
+
source?: ErrorSource | undefined;
|
|
49
|
+
meta?: { [k: string]: any } | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const Status$inboundSchema: z.ZodNativeEnum<typeof Status> = z
|
|
54
|
+
.nativeEnum(Status);
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export const Status$outboundSchema: z.ZodNativeEnum<typeof Status> =
|
|
58
|
+
Status$inboundSchema;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
63
|
+
*/
|
|
64
|
+
export namespace Status$ {
|
|
65
|
+
/** @deprecated use `Status$inboundSchema` instead. */
|
|
66
|
+
export const inboundSchema = Status$inboundSchema;
|
|
67
|
+
/** @deprecated use `Status$outboundSchema` instead. */
|
|
68
|
+
export const outboundSchema = Status$outboundSchema;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const Code$inboundSchema: z.ZodNativeEnum<typeof Code> = z.nativeEnum(
|
|
73
|
+
Code,
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const Code$outboundSchema: z.ZodNativeEnum<typeof Code> =
|
|
78
|
+
Code$inboundSchema;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
83
|
+
*/
|
|
84
|
+
export namespace Code$ {
|
|
85
|
+
/** @deprecated use `Code$inboundSchema` instead. */
|
|
86
|
+
export const inboundSchema = Code$inboundSchema;
|
|
87
|
+
/** @deprecated use `Code$outboundSchema` instead. */
|
|
88
|
+
export const outboundSchema = Code$outboundSchema;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** @internal */
|
|
92
|
+
export const Title$inboundSchema: z.ZodNativeEnum<typeof Title> = z.nativeEnum(
|
|
93
|
+
Title,
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
/** @internal */
|
|
97
|
+
export const Title$outboundSchema: z.ZodNativeEnum<typeof Title> =
|
|
98
|
+
Title$inboundSchema;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
103
|
+
*/
|
|
104
|
+
export namespace Title$ {
|
|
105
|
+
/** @deprecated use `Title$inboundSchema` instead. */
|
|
106
|
+
export const inboundSchema = Title$inboundSchema;
|
|
107
|
+
/** @deprecated use `Title$outboundSchema` instead. */
|
|
108
|
+
export const outboundSchema = Title$outboundSchema;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const BadRequestError$inboundSchema: z.ZodType<
|
|
113
|
+
BadRequestError,
|
|
114
|
+
z.ZodTypeDef,
|
|
115
|
+
unknown
|
|
116
|
+
> = z.object({
|
|
117
|
+
id: z.string().optional(),
|
|
118
|
+
links: APIErrorLinks$inboundSchema.optional(),
|
|
119
|
+
status: Status$inboundSchema,
|
|
120
|
+
code: Code$inboundSchema,
|
|
121
|
+
title: Title$inboundSchema,
|
|
122
|
+
detail: z.string(),
|
|
123
|
+
source: ErrorSource$inboundSchema.optional(),
|
|
124
|
+
meta: z.record(z.any()).optional(),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
/** @internal */
|
|
128
|
+
export type BadRequestError$Outbound = {
|
|
129
|
+
id?: string | undefined;
|
|
130
|
+
links?: APIErrorLinks$Outbound | undefined;
|
|
131
|
+
status: string;
|
|
132
|
+
code: string;
|
|
133
|
+
title: string;
|
|
134
|
+
detail: string;
|
|
135
|
+
source?: ErrorSource$Outbound | undefined;
|
|
136
|
+
meta?: { [k: string]: any } | undefined;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/** @internal */
|
|
140
|
+
export const BadRequestError$outboundSchema: z.ZodType<
|
|
141
|
+
BadRequestError$Outbound,
|
|
142
|
+
z.ZodTypeDef,
|
|
143
|
+
BadRequestError
|
|
144
|
+
> = z.object({
|
|
145
|
+
id: z.string().optional(),
|
|
146
|
+
links: APIErrorLinks$outboundSchema.optional(),
|
|
147
|
+
status: Status$outboundSchema,
|
|
148
|
+
code: Code$outboundSchema,
|
|
149
|
+
title: Title$outboundSchema,
|
|
150
|
+
detail: z.string(),
|
|
151
|
+
source: ErrorSource$outboundSchema.optional(),
|
|
152
|
+
meta: z.record(z.any()).optional(),
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @internal
|
|
157
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
158
|
+
*/
|
|
159
|
+
export namespace BadRequestError$ {
|
|
160
|
+
/** @deprecated use `BadRequestError$inboundSchema` instead. */
|
|
161
|
+
export const inboundSchema = BadRequestError$inboundSchema;
|
|
162
|
+
/** @deprecated use `BadRequestError$outboundSchema` instead. */
|
|
163
|
+
export const outboundSchema = BadRequestError$outboundSchema;
|
|
164
|
+
/** @deprecated use `BadRequestError$Outbound` instead. */
|
|
165
|
+
export type Outbound = BadRequestError$Outbound;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function badRequestErrorToJSON(
|
|
169
|
+
badRequestError: BadRequestError,
|
|
170
|
+
): string {
|
|
171
|
+
return JSON.stringify(BadRequestError$outboundSchema.parse(badRequestError));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function badRequestErrorFromJSON(
|
|
175
|
+
jsonString: string,
|
|
176
|
+
): SafeParseResult<BadRequestError, SDKValidationError> {
|
|
177
|
+
return safeParse(
|
|
178
|
+
jsonString,
|
|
179
|
+
(x) => BadRequestError$inboundSchema.parse(JSON.parse(x)),
|
|
180
|
+
`Failed to parse 'BadRequestError' from JSON`,
|
|
181
|
+
);
|
|
182
|
+
}
|