@matech/thebigpos-sdk 3.5.0-stag-2100 → 3.5.1-dev-2413
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 +23 -5
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/docs/sdk_generation.md +149 -0
- package/package.json +15 -5
- package/scripts/apply-json-patch-content-type.js +189 -36
- package/src/index.ts +39 -11
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
|
@@ -53,6 +53,7 @@ export type LoanGiftSource = "CommunityNonProfit" | "Employer" | "FederalAgency"
|
|
|
53
53
|
export type LoanGiftAssetType = "Cash" | "Asset" | "Equity" | "Grant";
|
|
54
54
|
export type LoanGenderType = "Male" | "Female";
|
|
55
55
|
export type LoanDocumentType = "W2" | "Paystub" | "Form1099" | "Form1099Int" | "Form1099Misc" | "Form1099Nec" | "Form1099R" | "Form1099G" | "Form1099Div" | "Form1099Ssa" | "FederalTaxReturn1040" | "TaxReturnScheduleC" | "TaxReturnScheduleD" | "TaxReturnScheduleE" | "Form1065" | "Form1120" | "Form1120S" | "ProfitAndLossStatement" | "VerificationOfEmployment" | "BankStatement" | "InvestmentStatement" | "CreditCardStatement" | "MortgageStatement" | "PayoffStatement" | "HoaDocuments" | "UtilityBill" | "IdentityDocument" | "DemographicAddendum" | "Ssa89" | "Vba260551" | "Hud92900B" | "Check" | "Invoice" | "Receipt" | "LoanApplication1003" | "UnderwritingTransmittal1008" | "Other" | "SalesContract" | "TitleCommitment" | "DriversLicense" | "VerificationOfIncome" | "VerificationOfAssets" | "FloodCertificate" | "FraudReport" | "AddendumToSalesContract" | "GiftLetter" | "CpaLetter" | "TaxBill" | "CondoQuestionnaire" | "CondoBudget" | "CondoBylaws" | "RentalAgreements" | "Lease" | "HazardInsurance" | "VaCertificateOfEligibility" | "Appraisal" | "CreditReport" | "CondoMasterPolicy" | "EConsent" | "CreditAuthorization" | "TextOptIn" | "LoanComparison" | "AiGeneratedDocument" | "Unidentified";
|
|
56
|
+
export type LoanDocumentFolderScope = "Any" | "Assigned" | "Unassigned";
|
|
56
57
|
export type LoanDocumentFolderPermissionLevel = "None" | "Read" | "Write" | "Manage";
|
|
57
58
|
export type LoanCitizenship = "USCitizen" | "PermanentResidentAlien" | "NonPermanentResidentAlien";
|
|
58
59
|
export type LoanBankruptcyType = "Chapter7" | "Chapter11" | "Chapter12" | "Chapter13";
|
|
@@ -2350,6 +2351,12 @@ export interface GuidPatchOperation {
|
|
|
2350
2351
|
value?: any | null;
|
|
2351
2352
|
from?: string | null;
|
|
2352
2353
|
}
|
|
2354
|
+
export interface HttpError {
|
|
2355
|
+
logId?: string | null;
|
|
2356
|
+
message?: string | null;
|
|
2357
|
+
errorCode?: string | null;
|
|
2358
|
+
errors?: string[] | null;
|
|
2359
|
+
}
|
|
2353
2360
|
export interface IPAddress {
|
|
2354
2361
|
addressFamily: IpAddressAddressFamilyEnum;
|
|
2355
2362
|
/** @format int64 */
|
|
@@ -2932,6 +2939,8 @@ export interface LoanBorrowerEmploymentCurrentGrossIncome {
|
|
|
2932
2939
|
/** @format double */
|
|
2933
2940
|
hourlyRate?: number | null;
|
|
2934
2941
|
/** @format double */
|
|
2942
|
+
annualBasePay?: number | null;
|
|
2943
|
+
/** @format double */
|
|
2935
2944
|
other?: number | null;
|
|
2936
2945
|
/** @format double */
|
|
2937
2946
|
bonus?: number | null;
|
|
@@ -3482,6 +3491,8 @@ export interface LoanDocument {
|
|
|
3482
3491
|
losStatus: string;
|
|
3483
3492
|
contents?: string | null;
|
|
3484
3493
|
failoverDocumentPath?: string | null;
|
|
3494
|
+
/** @format int64 */
|
|
3495
|
+
fileSizeBytes?: number | null;
|
|
3485
3496
|
/** @format date-time */
|
|
3486
3497
|
sensitiveDataPurgedOn?: string | null;
|
|
3487
3498
|
observedDocumentType?: LoanDocumentType | null;
|
|
@@ -3550,6 +3561,7 @@ export interface LoanDocumentFolderWithCount {
|
|
|
3550
3561
|
isActive: boolean;
|
|
3551
3562
|
/** @format int32 */
|
|
3552
3563
|
documentCount: number;
|
|
3564
|
+
isUnassigned: boolean;
|
|
3553
3565
|
}
|
|
3554
3566
|
export interface LoanDocumentPreviewsRequest {
|
|
3555
3567
|
documentIds: string[];
|
|
@@ -3587,6 +3599,7 @@ export interface LoanDocumentSearchCriteria {
|
|
|
3587
3599
|
bucket?: string | null;
|
|
3588
3600
|
/** @format uuid */
|
|
3589
3601
|
folderID?: string | null;
|
|
3602
|
+
folderScope?: LoanDocumentFolderScope | null;
|
|
3590
3603
|
/** @format uuid */
|
|
3591
3604
|
userID?: string | null;
|
|
3592
3605
|
documentIDs?: string[] | null;
|
|
@@ -6686,7 +6699,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
6686
6699
|
}
|
|
6687
6700
|
/**
|
|
6688
6701
|
* @title The Big POS API
|
|
6689
|
-
* @version v3.5.
|
|
6702
|
+
* @version v3.5.1
|
|
6690
6703
|
* @termsOfService https://www.thebigpos.com/terms-of-use/
|
|
6691
6704
|
* @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
|
|
6692
6705
|
*/
|
|
@@ -9854,7 +9867,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
9854
9867
|
* @request POST:/api/listings
|
|
9855
9868
|
* @secure
|
|
9856
9869
|
* @response `201` `Listing` Created
|
|
9857
|
-
* @response `
|
|
9870
|
+
* @response `401` `HttpError` Unauthorized
|
|
9871
|
+
* @response `403` `HttpError` Forbidden
|
|
9858
9872
|
*/
|
|
9859
9873
|
createListing: (data: ListingRequest, params?: RequestParams) => Promise<AxiosResponse<Listing, any, {}>>;
|
|
9860
9874
|
/**
|
|
@@ -9888,7 +9902,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
9888
9902
|
* @request PUT:/api/listings/{id}
|
|
9889
9903
|
* @secure
|
|
9890
9904
|
* @response `200` `Listing` OK
|
|
9891
|
-
* @response `
|
|
9905
|
+
* @response `401` `HttpError` Unauthorized
|
|
9906
|
+
* @response `403` `HttpError` Forbidden
|
|
9892
9907
|
*/
|
|
9893
9908
|
replaceListing: (id: string, data: ListingRequest, params?: RequestParams) => Promise<AxiosResponse<Listing, any, {}>>;
|
|
9894
9909
|
/**
|
|
@@ -10212,7 +10227,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10212
10227
|
*/
|
|
10213
10228
|
getLoanDocumentFolderUsage: (id: string, params?: RequestParams) => Promise<AxiosResponse<LoanDocumentFolderUsage, any, {}>>;
|
|
10214
10229
|
/**
|
|
10215
|
-
* @description Returns each folder that holds at least one document the caller can read, with the document count per folder. Documents that are not assigned to a folder are returned as a synthetic 'Unassigned' folder (ID = empty GUID).
|
|
10230
|
+
* @description Returns each folder that holds at least one document the caller can read, with the document count per folder. 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.
|
|
10216
10231
|
*
|
|
10217
10232
|
* @tags LoanDocumentFoldersForSingleLoan
|
|
10218
10233
|
* @name ListLoanDocumentFolders
|
|
@@ -10265,7 +10280,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10265
10280
|
*/
|
|
10266
10281
|
getLoanDocumentPreviews: (loanId: string, data: LoanDocumentPreviewsRequest, params?: RequestParams) => Promise<AxiosResponse<Record<string, string>, any, {}>>;
|
|
10267
10282
|
/**
|
|
10268
|
-
*
|
|
10283
|
+
* @description Filters the loan's readable documents. Pass folderID to filter to one folder, or folderScope 'Unassigned' for the documents that have no folder (the synthetic folder listLoanDocumentFolders reports with isUnassigned true); the two cannot be combined.
|
|
10269
10284
|
*
|
|
10270
10285
|
* @tags LoanDocuments
|
|
10271
10286
|
* @name SearchLoanDocuments
|
|
@@ -10273,6 +10288,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10273
10288
|
* @request POST:/api/loans/{loanId}/documents/search
|
|
10274
10289
|
* @secure
|
|
10275
10290
|
* @response `200` `LoanDocumentSearchPaginated` OK
|
|
10291
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
10276
10292
|
*/
|
|
10277
10293
|
searchLoanDocuments: (loanId: string, data: LoanDocumentSearchCriteria, query?: {
|
|
10278
10294
|
/** @format int32 */
|
|
@@ -10975,6 +10991,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10975
10991
|
* @secure
|
|
10976
10992
|
* @response `201` `TaskComment` Created
|
|
10977
10993
|
* @response `404` `ProblemDetails` Not Found
|
|
10994
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
10978
10995
|
*/
|
|
10979
10996
|
createLoanTaskComment: (loanId: string, userLoanTaskId: string, data: TaskCommentRequest, params?: RequestParams) => Promise<AxiosResponse<TaskComment, any, {}>>;
|
|
10980
10997
|
/**
|
|
@@ -10987,6 +11004,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10987
11004
|
* @secure
|
|
10988
11005
|
* @response `200` `TaskComment` OK
|
|
10989
11006
|
* @response `404` `ProblemDetails` Not Found
|
|
11007
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
10990
11008
|
*/
|
|
10991
11009
|
replaceLoanTaskComment: (loanId: string, userLoanTaskId: string, commentId: string, data: TaskCommentRequest, params?: RequestParams) => Promise<AxiosResponse<TaskComment, any, {}>>;
|
|
10992
11010
|
/**
|
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.5.
|
|
104
|
+
* @version v3.5.1
|
|
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
|
*/
|
|
@@ -2921,7 +2927,8 @@ export class Api extends HttpClient {
|
|
|
2921
2927
|
* @request POST:/api/listings
|
|
2922
2928
|
* @secure
|
|
2923
2929
|
* @response `201` `Listing` Created
|
|
2924
|
-
* @response `
|
|
2930
|
+
* @response `401` `HttpError` Unauthorized
|
|
2931
|
+
* @response `403` `HttpError` Forbidden
|
|
2925
2932
|
*/
|
|
2926
2933
|
createListing: (data, params = {}) => this.request(Object.assign({ path: `/api/listings`, method: "POST", body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
2927
2934
|
/**
|
|
@@ -2955,7 +2962,8 @@ export class Api extends HttpClient {
|
|
|
2955
2962
|
* @request PUT:/api/listings/{id}
|
|
2956
2963
|
* @secure
|
|
2957
2964
|
* @response `200` `Listing` OK
|
|
2958
|
-
* @response `
|
|
2965
|
+
* @response `401` `HttpError` Unauthorized
|
|
2966
|
+
* @response `403` `HttpError` Forbidden
|
|
2959
2967
|
*/
|
|
2960
2968
|
replaceListing: (id, data, params = {}) => this.request(Object.assign({ path: `/api/listings/${id}`, method: "PUT", body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
2961
2969
|
/**
|
|
@@ -3262,7 +3270,7 @@ export class Api extends HttpClient {
|
|
|
3262
3270
|
*/
|
|
3263
3271
|
getLoanDocumentFolderUsage: (id, params = {}) => this.request(Object.assign({ path: `/api/loan-document-folders/${id}/usage`, method: "GET", secure: true, format: "json" }, params)),
|
|
3264
3272
|
/**
|
|
3265
|
-
* @description Returns each folder that holds at least one document the caller can read, with the document count per folder. Documents that are not assigned to a folder are returned as a synthetic 'Unassigned' folder (ID = empty GUID).
|
|
3273
|
+
* @description Returns each folder that holds at least one document the caller can read, with the document count per folder. 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.
|
|
3266
3274
|
*
|
|
3267
3275
|
* @tags LoanDocumentFoldersForSingleLoan
|
|
3268
3276
|
* @name ListLoanDocumentFolders
|
|
@@ -3309,7 +3317,7 @@ export class Api extends HttpClient {
|
|
|
3309
3317
|
*/
|
|
3310
3318
|
getLoanDocumentPreviews: (loanId, data, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/documents/previews`, method: "POST", body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
3311
3319
|
/**
|
|
3312
|
-
*
|
|
3320
|
+
* @description Filters the loan's readable documents. Pass folderID to filter to one folder, or folderScope 'Unassigned' for the documents that have no folder (the synthetic folder listLoanDocumentFolders reports with isUnassigned true); the two cannot be combined.
|
|
3313
3321
|
*
|
|
3314
3322
|
* @tags LoanDocuments
|
|
3315
3323
|
* @name SearchLoanDocuments
|
|
@@ -3317,6 +3325,7 @@ export class Api extends HttpClient {
|
|
|
3317
3325
|
* @request POST:/api/loans/{loanId}/documents/search
|
|
3318
3326
|
* @secure
|
|
3319
3327
|
* @response `200` `LoanDocumentSearchPaginated` OK
|
|
3328
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
3320
3329
|
*/
|
|
3321
3330
|
searchLoanDocuments: (loanId, data, query, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/documents/search`, method: "POST", query: query, body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
3322
3331
|
/**
|
|
@@ -3936,6 +3945,7 @@ export class Api extends HttpClient {
|
|
|
3936
3945
|
* @secure
|
|
3937
3946
|
* @response `201` `TaskComment` Created
|
|
3938
3947
|
* @response `404` `ProblemDetails` Not Found
|
|
3948
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
3939
3949
|
*/
|
|
3940
3950
|
createLoanTaskComment: (loanId, userLoanTaskId, data, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/tasks/${userLoanTaskId}/comments`, method: "POST", body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
3941
3951
|
/**
|
|
@@ -3948,6 +3958,7 @@ export class Api extends HttpClient {
|
|
|
3948
3958
|
* @secure
|
|
3949
3959
|
* @response `200` `TaskComment` OK
|
|
3950
3960
|
* @response `404` `ProblemDetails` Not Found
|
|
3961
|
+
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
3951
3962
|
*/
|
|
3952
3963
|
replaceLoanTaskComment: (loanId, userLoanTaskId, commentId, data, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/tasks/${userLoanTaskId}/comments/${commentId}`, method: "PUT", body: data, secure: true, type: "application/json", format: "json" }, params)),
|
|
3953
3964
|
/**
|