@matech/thebigpos-sdk 3.12.0 → 3.13.0-dev-5466
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 +71 -4
- package/dist/index.js +44 -5
- 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 +116 -6
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
|
@@ -249,8 +249,10 @@ export interface AdminAccessUser {
|
|
|
249
249
|
preferredLoanOfficer?: PreferredLoanOfficer | null;
|
|
250
250
|
loanIDs: string[];
|
|
251
251
|
drafts: Draft[];
|
|
252
|
+
inProgressLoans?: InProgressLoan[] | null;
|
|
252
253
|
notificationSettings?: UserNotificationSettings | null;
|
|
253
254
|
hasExtendedLoanVisibility: boolean;
|
|
255
|
+
applicationV3Enabled?: boolean | null;
|
|
254
256
|
/** @format uuid */
|
|
255
257
|
accountID?: string | null;
|
|
256
258
|
loans: UserLoan[];
|
|
@@ -1064,8 +1066,10 @@ export interface BranchUser {
|
|
|
1064
1066
|
preferredLoanOfficer?: PreferredLoanOfficer | null;
|
|
1065
1067
|
loanIDs: string[];
|
|
1066
1068
|
drafts: Draft[];
|
|
1069
|
+
inProgressLoans?: InProgressLoan[] | null;
|
|
1067
1070
|
notificationSettings?: UserNotificationSettings | null;
|
|
1068
1071
|
hasExtendedLoanVisibility: boolean;
|
|
1072
|
+
applicationV3Enabled?: boolean | null;
|
|
1069
1073
|
/** @format uuid */
|
|
1070
1074
|
branchID: string;
|
|
1071
1075
|
branchName: string;
|
|
@@ -1623,8 +1627,10 @@ export interface DetailedUser {
|
|
|
1623
1627
|
preferredLoanOfficer?: PreferredLoanOfficer | null;
|
|
1624
1628
|
loanIDs: string[];
|
|
1625
1629
|
drafts: Draft[];
|
|
1630
|
+
inProgressLoans?: InProgressLoan[] | null;
|
|
1626
1631
|
notificationSettings?: UserNotificationSettings | null;
|
|
1627
1632
|
hasExtendedLoanVisibility: boolean;
|
|
1633
|
+
applicationV3Enabled?: boolean | null;
|
|
1628
1634
|
}
|
|
1629
1635
|
export interface DocumentDataRequest {
|
|
1630
1636
|
documentID?: string | null;
|
|
@@ -2374,8 +2380,10 @@ export interface ImpersonatedDetailedUser {
|
|
|
2374
2380
|
preferredLoanOfficer?: PreferredLoanOfficer | null;
|
|
2375
2381
|
loanIDs: string[];
|
|
2376
2382
|
drafts: Draft[];
|
|
2383
|
+
inProgressLoans?: InProgressLoan[] | null;
|
|
2377
2384
|
notificationSettings?: UserNotificationSettings | null;
|
|
2378
2385
|
hasExtendedLoanVisibility: boolean;
|
|
2386
|
+
applicationV3Enabled?: boolean | null;
|
|
2379
2387
|
/** @deprecated */
|
|
2380
2388
|
impersonatedBy?: string | null;
|
|
2381
2389
|
impersonatingUser?: User | null;
|
|
@@ -2386,6 +2394,16 @@ export interface ImportUserLoanTaskRequest {
|
|
|
2386
2394
|
/** @format uuid */
|
|
2387
2395
|
userID: string;
|
|
2388
2396
|
}
|
|
2397
|
+
export interface InProgressLoan {
|
|
2398
|
+
/** @format uuid */
|
|
2399
|
+
id: string;
|
|
2400
|
+
/** @format uuid */
|
|
2401
|
+
borrowerId: string;
|
|
2402
|
+
/** @format uuid */
|
|
2403
|
+
siteConfigurationId?: string | null;
|
|
2404
|
+
/** @format date-time */
|
|
2405
|
+
updatedAt?: string | null;
|
|
2406
|
+
}
|
|
2389
2407
|
export interface IncompleteApplicationSummary {
|
|
2390
2408
|
/** @format int32 */
|
|
2391
2409
|
total: number;
|
|
@@ -2642,6 +2660,18 @@ export interface LoanApplicationRequest {
|
|
|
2642
2660
|
/** @format uuid */
|
|
2643
2661
|
existingLoanId?: string | null;
|
|
2644
2662
|
}
|
|
2663
|
+
export interface LoanApplicationSession {
|
|
2664
|
+
routeName: string;
|
|
2665
|
+
currentQuestionId?: string | null;
|
|
2666
|
+
questionHistory: string[];
|
|
2667
|
+
/** @format date-time */
|
|
2668
|
+
completedAt?: string | null;
|
|
2669
|
+
}
|
|
2670
|
+
export interface LoanApplicationSessionRequest {
|
|
2671
|
+
routeName: string;
|
|
2672
|
+
currentQuestionId?: string | null;
|
|
2673
|
+
questionHistory: string[];
|
|
2674
|
+
}
|
|
2645
2675
|
export interface LoanBorrower {
|
|
2646
2676
|
/** @format uuid */
|
|
2647
2677
|
id: string;
|
|
@@ -4192,6 +4222,8 @@ export interface LoanTaskCounts {
|
|
|
4192
4222
|
completed: number;
|
|
4193
4223
|
/** @format int32 */
|
|
4194
4224
|
rejected: number;
|
|
4225
|
+
/** @format int32 */
|
|
4226
|
+
awaitingRegistration: number;
|
|
4195
4227
|
}
|
|
4196
4228
|
export interface LoanTaskSearchRequest {
|
|
4197
4229
|
searchText?: string | null;
|
|
@@ -6883,7 +6915,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
6883
6915
|
}
|
|
6884
6916
|
/**
|
|
6885
6917
|
* @title The Big POS API
|
|
6886
|
-
* @version v3.
|
|
6918
|
+
* @version v3.13.0
|
|
6887
6919
|
* @termsOfService https://www.thebigpos.com/terms-of-use/
|
|
6888
6920
|
* @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
|
|
6889
6921
|
*/
|
|
@@ -10395,7 +10427,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10395
10427
|
*/
|
|
10396
10428
|
getLoanDocumentFolderUsage: (id: string, params?: RequestParams) => Promise<AxiosResponse<LoanDocumentFolderUsage, any, {}>>;
|
|
10397
10429
|
/**
|
|
10398
|
-
* @description Returns
|
|
10430
|
+
* @description Returns the folders the caller can access that are relevant to this loan — those holding a document the caller can read, plus those bound to one of the loan's tasks, even when empty — with the caller's effective accessLevel and the count of documents they can read in each. Upload destinations are the active entries with accessLevel at least Write. Documents that are not assigned to a folder are returned as a synthetic 'Unassigned' folder (ID = empty GUID, isUnassigned = true); filter to its documents with searchLoanDocuments folderScope 'Unassigned' rather than by echoing that ID.
|
|
10399
10431
|
*
|
|
10400
10432
|
* @tags LoanDocumentFoldersForSingleLoan
|
|
10401
10433
|
* @name ListLoanDocumentFolders
|
|
@@ -11026,7 +11058,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11026
11058
|
*/
|
|
11027
11059
|
getLoanRoleTasks: (loanId: string, params?: RequestParams) => Promise<AxiosResponse<LoanRoleSlotTasks[], any, {}>>;
|
|
11028
11060
|
/**
|
|
11029
|
-
* @description Queues an account template against a borrower slot that has no registered user yet. The row owns a per-loan copy of the template, so editing it never changes the account's catalogue. An optional due date is stored on the row; without one the row has none.
|
|
11061
|
+
* @description Queues an account template against a borrower slot that has no registered user yet. The row owns a per-loan copy of the template, so editing it never changes the account's catalogue. An optional due date is stored on the row; without one the row has none. A template already queued for the slot is refused; one staff removed earlier can be queued again this way.
|
|
11030
11062
|
*
|
|
11031
11063
|
* @tags LoanRoleTasks
|
|
11032
11064
|
* @name CreateLoanRoleTask
|
|
@@ -11141,8 +11173,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11141
11173
|
* @response `400` `any` Bad Request
|
|
11142
11174
|
* @response `401` `ProblemDetails` Unauthorized
|
|
11143
11175
|
* @response `403` `ProblemDetails` Forbidden
|
|
11176
|
+
* @response `404` `ProblemDetails` Not Found
|
|
11144
11177
|
*/
|
|
11145
|
-
createLoanv3: (data: LoanApplicationRequest,
|
|
11178
|
+
createLoanv3: (data: LoanApplicationRequest, query?: {
|
|
11179
|
+
application?: string;
|
|
11180
|
+
}, params?: RequestParams) => Promise<AxiosResponse<LoanApplication, any, {}>>;
|
|
11146
11181
|
/**
|
|
11147
11182
|
* No description
|
|
11148
11183
|
*
|
|
@@ -11190,6 +11225,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11190
11225
|
* @response `400` `ProblemDetails` Bad Request
|
|
11191
11226
|
* @response `404` `ProblemDetails` Not Found
|
|
11192
11227
|
* @response `409` `ProblemDetails` Conflict
|
|
11228
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
11193
11229
|
*/
|
|
11194
11230
|
completeBorrowerApplication: (loanId: string, borrowerId: string, params?: RequestParams) => Promise<AxiosResponse<void, any, {}>>;
|
|
11195
11231
|
/**
|
|
@@ -11203,8 +11239,39 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11203
11239
|
* @response `200` `LoanBorrowerSsn` OK
|
|
11204
11240
|
* @response `403` `ProblemDetails` Forbidden
|
|
11205
11241
|
* @response `404` `ProblemDetails` Not Found
|
|
11242
|
+
* @response `429` `ProblemDetails` Too Many Requests
|
|
11206
11243
|
*/
|
|
11207
11244
|
getLoanBorrowerSsn: (loanId: string, borrowerId: string, params?: RequestParams) => Promise<AxiosResponse<LoanBorrowerSsn, any, {}>>;
|
|
11245
|
+
/**
|
|
11246
|
+
* No description
|
|
11247
|
+
*
|
|
11248
|
+
* @tags Loans
|
|
11249
|
+
* @name GetBorrowerApplicationSession
|
|
11250
|
+
* @summary Get borrower application session
|
|
11251
|
+
* @request GET:/api/loans/{loanId}/borrowers/{borrowerId}/application-session
|
|
11252
|
+
* @secure
|
|
11253
|
+
* @response `200` `LoanApplicationSession` OK
|
|
11254
|
+
* @response `400` `any` Bad Request
|
|
11255
|
+
* @response `401` `ProblemDetails` Unauthorized
|
|
11256
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
11257
|
+
* @response `404` `ProblemDetails` Not Found
|
|
11258
|
+
*/
|
|
11259
|
+
getBorrowerApplicationSession: (loanId: string, borrowerId: string, params?: RequestParams) => Promise<AxiosResponse<LoanApplicationSession, any, {}>>;
|
|
11260
|
+
/**
|
|
11261
|
+
* No description
|
|
11262
|
+
*
|
|
11263
|
+
* @tags Loans
|
|
11264
|
+
* @name UpdateBorrowerApplicationSession
|
|
11265
|
+
* @summary Update borrower application session
|
|
11266
|
+
* @request PUT:/api/loans/{loanId}/borrowers/{borrowerId}/application-session
|
|
11267
|
+
* @secure
|
|
11268
|
+
* @response `200` `LoanApplicationSession` OK
|
|
11269
|
+
* @response `400` `any` Bad Request
|
|
11270
|
+
* @response `401` `ProblemDetails` Unauthorized
|
|
11271
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
11272
|
+
* @response `404` `ProblemDetails` Not Found
|
|
11273
|
+
*/
|
|
11274
|
+
updateBorrowerApplicationSession: (loanId: string, borrowerId: string, data: LoanApplicationSessionRequest, params?: RequestParams) => Promise<AxiosResponse<LoanApplicationSession, any, {}>>;
|
|
11208
11275
|
/**
|
|
11209
11276
|
* No description
|
|
11210
11277
|
*
|
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.13.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
|
*/
|
|
@@ -3228,7 +3234,7 @@ export class Api extends HttpClient {
|
|
|
3228
3234
|
*/
|
|
3229
3235
|
getLoanDocumentFolderUsage: (id, params = {}) => this.request(Object.assign({ path: `/api/loan-document-folders/${id}/usage`, method: "GET", secure: true, format: "json" }, params)),
|
|
3230
3236
|
/**
|
|
3231
|
-
* @description Returns
|
|
3237
|
+
* @description Returns the folders the caller can access that are relevant to this loan — those holding a document the caller can read, plus those bound to one of the loan's tasks, even when empty — with the caller's effective accessLevel and the count of documents they can read in each. Upload destinations are the active entries with accessLevel at least Write. Documents that are not assigned to a folder are returned as a synthetic 'Unassigned' folder (ID = empty GUID, isUnassigned = true); filter to its documents with searchLoanDocuments folderScope 'Unassigned' rather than by echoing that ID.
|
|
3232
3238
|
*
|
|
3233
3239
|
* @tags LoanDocumentFoldersForSingleLoan
|
|
3234
3240
|
* @name ListLoanDocumentFolders
|
|
@@ -3784,7 +3790,7 @@ export class Api extends HttpClient {
|
|
|
3784
3790
|
*/
|
|
3785
3791
|
getLoanRoleTasks: (loanId, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/role-tasks`, method: "GET", secure: true, format: "json" }, params)),
|
|
3786
3792
|
/**
|
|
3787
|
-
* @description Queues an account template against a borrower slot that has no registered user yet. The row owns a per-loan copy of the template, so editing it never changes the account's catalogue. An optional due date is stored on the row; without one the row has none.
|
|
3793
|
+
* @description Queues an account template against a borrower slot that has no registered user yet. The row owns a per-loan copy of the template, so editing it never changes the account's catalogue. An optional due date is stored on the row; without one the row has none. A template already queued for the slot is refused; one staff removed earlier can be queued again this way.
|
|
3788
3794
|
*
|
|
3789
3795
|
* @tags LoanRoleTasks
|
|
3790
3796
|
* @name CreateLoanRoleTask
|
|
@@ -3899,8 +3905,9 @@ export class Api extends HttpClient {
|
|
|
3899
3905
|
* @response `400` `any` Bad Request
|
|
3900
3906
|
* @response `401` `ProblemDetails` Unauthorized
|
|
3901
3907
|
* @response `403` `ProblemDetails` Forbidden
|
|
3908
|
+
* @response `404` `ProblemDetails` Not Found
|
|
3902
3909
|
*/
|
|
3903
|
-
createLoanv3: (data, params = {}) => this.request(Object.assign({ path: `/api/loans`, method: "POST", body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
3910
|
+
createLoanv3: (data, query, params = {}) => this.request(Object.assign({ path: `/api/loans`, method: "POST", query: query, body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
3904
3911
|
/**
|
|
3905
3912
|
* No description
|
|
3906
3913
|
*
|
|
@@ -3941,6 +3948,7 @@ export class Api extends HttpClient {
|
|
|
3941
3948
|
* @response `400` `ProblemDetails` Bad Request
|
|
3942
3949
|
* @response `404` `ProblemDetails` Not Found
|
|
3943
3950
|
* @response `409` `ProblemDetails` Conflict
|
|
3951
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
3944
3952
|
*/
|
|
3945
3953
|
completeBorrowerApplication: (loanId, borrowerId, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/borrowers/${borrowerId}/complete`, method: "POST", secure: true }, params)),
|
|
3946
3954
|
/**
|
|
@@ -3954,8 +3962,39 @@ export class Api extends HttpClient {
|
|
|
3954
3962
|
* @response `200` `LoanBorrowerSsn` OK
|
|
3955
3963
|
* @response `403` `ProblemDetails` Forbidden
|
|
3956
3964
|
* @response `404` `ProblemDetails` Not Found
|
|
3965
|
+
* @response `429` `ProblemDetails` Too Many Requests
|
|
3957
3966
|
*/
|
|
3958
3967
|
getLoanBorrowerSsn: (loanId, borrowerId, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/borrowers/${borrowerId}/ssn`, method: "GET", secure: true, format: "json" }, params)),
|
|
3968
|
+
/**
|
|
3969
|
+
* No description
|
|
3970
|
+
*
|
|
3971
|
+
* @tags Loans
|
|
3972
|
+
* @name GetBorrowerApplicationSession
|
|
3973
|
+
* @summary Get borrower application session
|
|
3974
|
+
* @request GET:/api/loans/{loanId}/borrowers/{borrowerId}/application-session
|
|
3975
|
+
* @secure
|
|
3976
|
+
* @response `200` `LoanApplicationSession` OK
|
|
3977
|
+
* @response `400` `any` Bad Request
|
|
3978
|
+
* @response `401` `ProblemDetails` Unauthorized
|
|
3979
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
3980
|
+
* @response `404` `ProblemDetails` Not Found
|
|
3981
|
+
*/
|
|
3982
|
+
getBorrowerApplicationSession: (loanId, borrowerId, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/borrowers/${borrowerId}/application-session`, method: "GET", secure: true, format: "json" }, params)),
|
|
3983
|
+
/**
|
|
3984
|
+
* No description
|
|
3985
|
+
*
|
|
3986
|
+
* @tags Loans
|
|
3987
|
+
* @name UpdateBorrowerApplicationSession
|
|
3988
|
+
* @summary Update borrower application session
|
|
3989
|
+
* @request PUT:/api/loans/{loanId}/borrowers/{borrowerId}/application-session
|
|
3990
|
+
* @secure
|
|
3991
|
+
* @response `200` `LoanApplicationSession` OK
|
|
3992
|
+
* @response `400` `any` Bad Request
|
|
3993
|
+
* @response `401` `ProblemDetails` Unauthorized
|
|
3994
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
3995
|
+
* @response `404` `ProblemDetails` Not Found
|
|
3996
|
+
*/
|
|
3997
|
+
updateBorrowerApplicationSession: (loanId, borrowerId, data, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/borrowers/${borrowerId}/application-session`, method: "PUT", body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
3959
3998
|
/**
|
|
3960
3999
|
* No description
|
|
3961
4000
|
*
|