@matech/thebigpos-sdk 3.16.0 → 3.17.0-dev-6270
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 +39 -0
- package/dist/index.d.ts +83 -6
- package/dist/index.js +54 -2
- package/dist/index.js.map +1 -1
- package/docs/sdk_generation.md +149 -0
- package/package.json +16 -6
- package/scripts/apply-json-patch-content-type.js +189 -36
- package/src/index.ts +158 -7
package/README.md
CHANGED
|
@@ -40,5 +40,44 @@ apiClient.api.getSiteConfiguration().then((response) => {
|
|
|
40
40
|
});
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
## Generate SDK from Swagger
|
|
44
|
+
|
|
45
|
+
To regenerate the SDK from a specific API version, run:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx swagger-typescript-api generate -p https://api.thebigpos.dev/swagger/{version}/swagger.json -o ./src -n index.ts -r true --axios --enum-names-as-values --enum-style union
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Replace `{version}` with the target API version (e.g. `v2.34.0`):
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx swagger-typescript-api generate -p https://api.thebigpos.dev/swagger/v2.34.0/swagger.json -o ./src -n index.ts -r true --axios --enum-names-as-values --enum-style union
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then apply the PATCH content-type fixup, passing the **same** spec that was given
|
|
58
|
+
to the generator. The generator does not propagate `application/json-patch+json`,
|
|
59
|
+
so this step sets each PATCH method's content type from the spec (no hard-coded
|
|
60
|
+
endpoint list):
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
node scripts/apply-json-patch-content-type.js https://api.thebigpos.dev/swagger/v2.34.0/swagger.json
|
|
64
|
+
yarn build
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Publishing
|
|
68
|
+
|
|
69
|
+
1. Update the `version` field in `package.json` before publishing.
|
|
70
|
+
2. Build the project:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
yarn build
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
3. Publish to npm:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
yarn publish
|
|
80
|
+
```
|
|
81
|
+
|
|
43
82
|
____
|
|
44
83
|
© 2024 Mortgage Automation Technologies. All rights reserved
|
package/dist/index.d.ts
CHANGED
|
@@ -101,6 +101,7 @@ export type BulkLoanTaskOperationType = "SetStatus" | "Delete" | "SetDueDate";
|
|
|
101
101
|
export type BranchType = "Mortgage" | "RealEstate";
|
|
102
102
|
export type BorrowerType = "Borrower" | "CoBorrower" | "Unknown";
|
|
103
103
|
export type BorrowerRelationship = "NotApplicable" | "Spouse" | "NonSpouse";
|
|
104
|
+
export type BorrowerApplicationWarningCode = "UnknownKey" | "NotWritable" | "CustomFieldUnresolved" | "CustomFieldInactive" | "CustomFieldReadOnly" | "CustomFieldDuplicateDefinition" | "LoanOfficerUnresolved";
|
|
104
105
|
export type BorrowerApplicationStatus = "Draft" | "Complete";
|
|
105
106
|
export type BillingType = "ClosedLoan" | "LoanOfficer";
|
|
106
107
|
export type AuditChangeType = "Created" | "Modified" | "SoftDeleted" | "HardDeleted" | "Restored" | "Deactivated" | "Reactivated" | "Accessed";
|
|
@@ -188,6 +189,7 @@ export interface AccountFailureCount {
|
|
|
188
189
|
export interface AccountSettings {
|
|
189
190
|
isSmsEnabled: boolean;
|
|
190
191
|
isLoanEditEnabled: boolean;
|
|
192
|
+
isApplicationEditEnabled?: boolean | null;
|
|
191
193
|
smsNumber?: string | null;
|
|
192
194
|
ssoHostOverride?: string | null;
|
|
193
195
|
isEarlyAdopter: boolean;
|
|
@@ -196,6 +198,7 @@ export interface AccountSettingsRequest {
|
|
|
196
198
|
isSmsEnabled: boolean;
|
|
197
199
|
smsNumber?: string | null;
|
|
198
200
|
isEarlyAdopter: boolean;
|
|
201
|
+
isApplicationEditEnabled?: boolean | null;
|
|
199
202
|
}
|
|
200
203
|
export interface Address {
|
|
201
204
|
/** @format uuid */
|
|
@@ -458,8 +461,6 @@ export interface AiCanonicalField {
|
|
|
458
461
|
isDefault: boolean;
|
|
459
462
|
category?: string | null;
|
|
460
463
|
jsonPropertyName?: string | null;
|
|
461
|
-
textractKey?: string | null;
|
|
462
|
-
textractKeyAliases: string[];
|
|
463
464
|
hasAccountOverride: boolean;
|
|
464
465
|
writable: boolean;
|
|
465
466
|
patchPath?: string | null;
|
|
@@ -1015,6 +1016,32 @@ export interface AutomatedService {
|
|
|
1015
1016
|
skipped: string[];
|
|
1016
1017
|
rateLimited: string[];
|
|
1017
1018
|
}
|
|
1019
|
+
export interface BorrowerApplication {
|
|
1020
|
+
/** @format uuid */
|
|
1021
|
+
loanId: string;
|
|
1022
|
+
/** @format uuid */
|
|
1023
|
+
borrowerId: string;
|
|
1024
|
+
/** @format uuid */
|
|
1025
|
+
coBorrowerId?: string | null;
|
|
1026
|
+
applicationStatus: BorrowerApplicationApplicationStatusEnum;
|
|
1027
|
+
answers: Record<string, any>;
|
|
1028
|
+
additionalFields: Record<string, string>;
|
|
1029
|
+
cursor?: LoanApplicationSession | null;
|
|
1030
|
+
}
|
|
1031
|
+
export interface BorrowerApplicationUpdate {
|
|
1032
|
+
warnings: BorrowerApplicationWarning[];
|
|
1033
|
+
application: BorrowerApplication;
|
|
1034
|
+
}
|
|
1035
|
+
export interface BorrowerApplicationUpdateRequest {
|
|
1036
|
+
answers: Record<string, any>;
|
|
1037
|
+
additionalFields?: Record<string, any> | null;
|
|
1038
|
+
cursor?: LoanApplicationSessionRequest | null;
|
|
1039
|
+
}
|
|
1040
|
+
export interface BorrowerApplicationWarning {
|
|
1041
|
+
key: string;
|
|
1042
|
+
code: BorrowerApplicationWarningCodeEnum;
|
|
1043
|
+
message: string;
|
|
1044
|
+
}
|
|
1018
1045
|
export interface BorrowerCount {
|
|
1019
1046
|
/** @format uuid */
|
|
1020
1047
|
userId: string;
|
|
@@ -1550,7 +1577,6 @@ export interface CreateAiCanonicalFieldRequest {
|
|
|
1550
1577
|
description: string;
|
|
1551
1578
|
allowedRoles: string[];
|
|
1552
1579
|
isPii: boolean;
|
|
1553
|
-
dataSource: string;
|
|
1554
1580
|
category?: string | null;
|
|
1555
1581
|
}
|
|
1556
1582
|
export interface CreateAiGuardrailRequest {
|
|
@@ -2702,7 +2728,7 @@ export interface Invite {
|
|
|
2702
2728
|
phoneNumber: string;
|
|
2703
2729
|
relationship: string;
|
|
2704
2730
|
/** @deprecated */
|
|
2705
|
-
loanID
|
|
2731
|
+
loanID?: string | null;
|
|
2706
2732
|
route?: string | null;
|
|
2707
2733
|
/** @format uuid */
|
|
2708
2734
|
siteConfigurationID: string;
|
|
@@ -2718,7 +2744,7 @@ export interface Invite {
|
|
|
2718
2744
|
/** @format date-time */
|
|
2719
2745
|
expiresAt?: string | null;
|
|
2720
2746
|
status: string;
|
|
2721
|
-
loan
|
|
2747
|
+
loan?: LoanIdentifier | null;
|
|
2722
2748
|
url: string;
|
|
2723
2749
|
linksBorrowerApplication?: boolean | null;
|
|
2724
2750
|
}
|
|
@@ -5104,6 +5130,9 @@ export interface NotificationTemplateVersionUpdateRequest {
|
|
|
5104
5130
|
textBody?: string | null;
|
|
5105
5131
|
pushNotificationBody?: string | null;
|
|
5106
5132
|
}
|
|
5133
|
+
export interface OpenBorrowerApplicationEditRequest {
|
|
5134
|
+
isCoBorrower: boolean;
|
|
5135
|
+
}
|
|
5107
5136
|
export type OpenTasksWidgetConfig = UtilRequiredKeys<BaseCanvasWidgetConfig, "type"> & {
|
|
5108
5137
|
/** @format int32 */
|
|
5109
5138
|
maxItems: number;
|
|
@@ -7160,6 +7189,8 @@ export type AiUrlSourceScopeEnum = "FullDomain" | "SpecificPath";
|
|
|
7160
7189
|
export type AiUrlSourceApprovalStatusEnum = "Pending" | "Approved" | "Rejected";
|
|
7161
7190
|
export type AmortizationWidgetConfigTypeEnum = "Amortization";
|
|
7162
7191
|
export type AuditLogEntryChangeTypeEnum = "Created" | "Modified" | "SoftDeleted" | "HardDeleted" | "Restored" | "Deactivated" | "Reactivated" | "Accessed";
|
|
7192
|
+
export type BorrowerApplicationApplicationStatusEnum = "Draft" | "Complete";
|
|
7193
|
+
export type BorrowerApplicationWarningCodeEnum = "UnknownKey" | "NotWritable" | "CustomFieldUnresolved" | "CustomFieldInactive" | "CustomFieldReadOnly" | "CustomFieldDuplicateDefinition" | "LoanOfficerUnresolved";
|
|
7163
7194
|
export type BorrowerCountRoleEnum = "Borrower" | "CoBorrower" | "NonBorrower" | "LoanOfficer" | "LoanProcessor" | "LoanOfficerAssistant" | "SupportingLoanOfficer" | "BuyerAgent" | "SellerAgent" | "TitleInsuranceAgent" | "EscrowAgent" | "SettlementAgent" | "Admin";
|
|
7164
7195
|
export type BorrowerIdentityRoleEnum = "Borrower" | "CoBorrower" | "NonBorrower" | "LoanOfficer" | "LoanProcessor" | "LoanOfficerAssistant" | "SupportingLoanOfficer" | "BuyerAgent" | "SellerAgent" | "TitleInsuranceAgent" | "EscrowAgent" | "SettlementAgent" | "Admin";
|
|
7165
7196
|
export type CanvasFieldDescriptorSourceEnum = "Standard" | "Custom";
|
|
@@ -7352,7 +7383,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
7352
7383
|
}
|
|
7353
7384
|
/**
|
|
7354
7385
|
* @title The Big POS API
|
|
7355
|
-
* @version v3.
|
|
7386
|
+
* @version v3.17.0
|
|
7356
7387
|
* @termsOfService https://www.thebigpos.com/terms-of-use/
|
|
7357
7388
|
* @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
|
|
7358
7389
|
*/
|
|
@@ -8649,6 +8680,35 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
8649
8680
|
/** @default true */
|
|
8650
8681
|
revokeSessions?: boolean;
|
|
8651
8682
|
}, params?: RequestParams) => Promise<AxiosResponse<NoContentResult, any, {}>>;
|
|
8683
|
+
/**
|
|
8684
|
+
* No description
|
|
8685
|
+
*
|
|
8686
|
+
* @tags BorrowerApplication
|
|
8687
|
+
* @name GetBorrowerApplication
|
|
8688
|
+
* @summary Get a borrower's application as flat answers
|
|
8689
|
+
* @request GET:/api/loans/{loanId}/borrowers/{borrowerId}/application
|
|
8690
|
+
* @secure
|
|
8691
|
+
* @response `200` `BorrowerApplication` OK
|
|
8692
|
+
* @response `400` `any` Bad Request
|
|
8693
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
8694
|
+
* @response `404` `ProblemDetails` Not Found
|
|
8695
|
+
*/
|
|
8696
|
+
getBorrowerApplication: (loanId: string, borrowerId: string, params?: RequestParams) => Promise<AxiosResponse<BorrowerApplication, any, {}>>;
|
|
8697
|
+
/**
|
|
8698
|
+
* No description
|
|
8699
|
+
*
|
|
8700
|
+
* @tags BorrowerApplication
|
|
8701
|
+
* @name UpdateBorrowerApplication
|
|
8702
|
+
* @summary Save a step of a borrower's application from flat answers
|
|
8703
|
+
* @request PATCH:/api/loans/{loanId}/borrowers/{borrowerId}/application
|
|
8704
|
+
* @secure
|
|
8705
|
+
* @response `200` `BorrowerApplicationUpdate` OK
|
|
8706
|
+
* @response `400` `any` Bad Request
|
|
8707
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
8708
|
+
* @response `404` `ProblemDetails` Not Found
|
|
8709
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
8710
|
+
*/
|
|
8711
|
+
updateBorrowerApplication: (loanId: string, borrowerId: string, data: JsonPatchDocument, params?: RequestParams) => Promise<AxiosResponse<BorrowerApplicationUpdate, any, {}>>;
|
|
8652
8712
|
/**
|
|
8653
8713
|
* No description
|
|
8654
8714
|
*
|
|
@@ -10672,6 +10732,22 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10672
10732
|
* @response `200` `File` OK
|
|
10673
10733
|
*/
|
|
10674
10734
|
getListingOpenHouseFlyer: (id: string, params?: RequestParams) => Promise<AxiosResponse<File, any, {}>>;
|
|
10735
|
+
/**
|
|
10736
|
+
* No description
|
|
10737
|
+
*
|
|
10738
|
+
* @tags LoanApplicationEdit
|
|
10739
|
+
* @name OpenBorrowerApplicationEdit
|
|
10740
|
+
* @summary Open a borrower's submitted application for editing
|
|
10741
|
+
* @request POST:/api/loans/{loanId}/application/edit
|
|
10742
|
+
* @secure
|
|
10743
|
+
* @response `200` `BorrowerApplication` OK
|
|
10744
|
+
* @response `400` `any` Bad Request
|
|
10745
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
10746
|
+
* @response `404` `ProblemDetails` Not Found
|
|
10747
|
+
* @response `409` `ProblemDetails` Conflict
|
|
10748
|
+
* @response `423` `any` Locked
|
|
10749
|
+
*/
|
|
10750
|
+
openBorrowerApplicationEdit: (loanId: string, data: OpenBorrowerApplicationEditRequest, params?: RequestParams) => Promise<AxiosResponse<BorrowerApplication, any, {}>>;
|
|
10675
10751
|
/**
|
|
10676
10752
|
* No description
|
|
10677
10753
|
*
|
|
@@ -11773,6 +11849,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11773
11849
|
* @response `404` `ProblemDetails` Not Found
|
|
11774
11850
|
* @response `409` `ProblemDetails` Conflict
|
|
11775
11851
|
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
11852
|
+
* @response `423` `ProblemDetails` Locked
|
|
11776
11853
|
*/
|
|
11777
11854
|
completeBorrowerApplication: (loanId: string, borrowerId: string, params?: RequestParams) => Promise<AxiosResponse<void, any, {}>>;
|
|
11778
11855
|
/**
|
package/dist/index.js
CHANGED
|
@@ -86,7 +86,13 @@ export class HttpClient {
|
|
|
86
86
|
const property = input[key];
|
|
87
87
|
const propertyContent = property instanceof Array ? property : [property];
|
|
88
88
|
for (const formItem of propertyContent) {
|
|
89
|
-
|
|
89
|
+
// React Native files are plain { uri, name, type } objects, not Blob/File.
|
|
90
|
+
const isReactNativeFile = !!formItem &&
|
|
91
|
+
typeof formItem === "object" &&
|
|
92
|
+
"uri" in formItem &&
|
|
93
|
+
"name" in formItem &&
|
|
94
|
+
"type" in formItem;
|
|
95
|
+
const isFileType = isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
|
|
90
96
|
formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
|
|
91
97
|
}
|
|
92
98
|
return formData;
|
|
@@ -95,7 +101,7 @@ export class HttpClient {
|
|
|
95
101
|
}
|
|
96
102
|
/**
|
|
97
103
|
* @title The Big POS API
|
|
98
|
-
* @version v3.
|
|
104
|
+
* @version v3.17.0
|
|
99
105
|
* @termsOfService https://www.thebigpos.com/terms-of-use/
|
|
100
106
|
* @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
|
|
101
107
|
*/
|
|
@@ -1229,6 +1235,35 @@ export class Api extends HttpClient {
|
|
|
1229
1235
|
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
1230
1236
|
*/
|
|
1231
1237
|
logOut: (query, params = {}) => this.request(Object.assign({ path: `/api/logout`, method: "POST", query: query, secure: true, format: "json" }, params)),
|
|
1238
|
+
/**
|
|
1239
|
+
* No description
|
|
1240
|
+
*
|
|
1241
|
+
* @tags BorrowerApplication
|
|
1242
|
+
* @name GetBorrowerApplication
|
|
1243
|
+
* @summary Get a borrower's application as flat answers
|
|
1244
|
+
* @request GET:/api/loans/{loanId}/borrowers/{borrowerId}/application
|
|
1245
|
+
* @secure
|
|
1246
|
+
* @response `200` `BorrowerApplication` OK
|
|
1247
|
+
* @response `400` `any` Bad Request
|
|
1248
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
1249
|
+
* @response `404` `ProblemDetails` Not Found
|
|
1250
|
+
*/
|
|
1251
|
+
getBorrowerApplication: (loanId, borrowerId, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/borrowers/${borrowerId}/application`, method: "GET", secure: true, format: "json" }, params)),
|
|
1252
|
+
/**
|
|
1253
|
+
* No description
|
|
1254
|
+
*
|
|
1255
|
+
* @tags BorrowerApplication
|
|
1256
|
+
* @name UpdateBorrowerApplication
|
|
1257
|
+
* @summary Save a step of a borrower's application from flat answers
|
|
1258
|
+
* @request PATCH:/api/loans/{loanId}/borrowers/{borrowerId}/application
|
|
1259
|
+
* @secure
|
|
1260
|
+
* @response `200` `BorrowerApplicationUpdate` OK
|
|
1261
|
+
* @response `400` `any` Bad Request
|
|
1262
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
1263
|
+
* @response `404` `ProblemDetails` Not Found
|
|
1264
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
1265
|
+
*/
|
|
1266
|
+
updateBorrowerApplication: (loanId, borrowerId, data, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/borrowers/${borrowerId}/application`, method: "PATCH", body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
1232
1267
|
/**
|
|
1233
1268
|
* No description
|
|
1234
1269
|
*
|
|
@@ -3033,6 +3068,22 @@ export class Api extends HttpClient {
|
|
|
3033
3068
|
* @response `200` `File` OK
|
|
3034
3069
|
*/
|
|
3035
3070
|
getListingOpenHouseFlyer: (id, params = {}) => this.request(Object.assign({ path: `/api/listings/${id}/open-house-flyer`, method: "GET", secure: true, format: "json" }, params)),
|
|
3071
|
+
/**
|
|
3072
|
+
* No description
|
|
3073
|
+
*
|
|
3074
|
+
* @tags LoanApplicationEdit
|
|
3075
|
+
* @name OpenBorrowerApplicationEdit
|
|
3076
|
+
* @summary Open a borrower's submitted application for editing
|
|
3077
|
+
* @request POST:/api/loans/{loanId}/application/edit
|
|
3078
|
+
* @secure
|
|
3079
|
+
* @response `200` `BorrowerApplication` OK
|
|
3080
|
+
* @response `400` `any` Bad Request
|
|
3081
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
3082
|
+
* @response `404` `ProblemDetails` Not Found
|
|
3083
|
+
* @response `409` `ProblemDetails` Conflict
|
|
3084
|
+
* @response `423` `any` Locked
|
|
3085
|
+
*/
|
|
3086
|
+
openBorrowerApplicationEdit: (loanId, data, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/application/edit`, method: "POST", body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
3036
3087
|
/**
|
|
3037
3088
|
* No description
|
|
3038
3089
|
*
|
|
@@ -4043,6 +4094,7 @@ export class Api extends HttpClient {
|
|
|
4043
4094
|
* @response `404` `ProblemDetails` Not Found
|
|
4044
4095
|
* @response `409` `ProblemDetails` Conflict
|
|
4045
4096
|
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
4097
|
+
* @response `423` `ProblemDetails` Locked
|
|
4046
4098
|
*/
|
|
4047
4099
|
completeBorrowerApplication: (loanId, borrowerId, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/borrowers/${borrowerId}/complete`, method: "POST", secure: true }, params)),
|
|
4048
4100
|
/**
|