@matech/thebigpos-sdk 2.36.16-rc1 → 2.36.16-rc3
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/.husky/pre-commit +2 -2
- package/LICENSE +21 -21
- package/README.md +73 -73
- package/dist/index.d.ts +26 -1
- package/dist/index.js +19 -6
- package/dist/index.js.map +1 -1
- package/docs/sdk_generation.md +149 -149
- package/package.json +39 -39
- package/scripts/apply-json-patch-content-type.js +56 -56
- package/src/index.ts +61 -7
- package/tsconfig.json +27 -27
package/.husky/pre-commit
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
[ -f ./src/index.ts ] && node scripts/apply-json-patch-content-type.js
|
|
2
|
-
yarn build
|
|
1
|
+
[ -f ./src/index.ts ] && node scripts/apply-json-patch-content-type.js
|
|
2
|
+
yarn build
|
|
3
3
|
git add .
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Mortgage Automation Technologies
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Mortgage Automation Technologies
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
# The BIG POS Typescript SDK
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
Using npm:
|
|
5
|
-
|
|
6
|
-
```bash
|
|
7
|
-
$ npm install @matech/thebigpos-sdk
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
Using yarn:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
$ yarn add @matech/thebigpos-sdk
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Quick Start
|
|
17
|
-
```js
|
|
18
|
-
import { Api } from "@matech/thebigpos-sdk";
|
|
19
|
-
|
|
20
|
-
const securityWorker = (data: any) => {
|
|
21
|
-
return { headers: data }
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const setBearerSecurityWorker = (accessToken:string) => {
|
|
25
|
-
const data = {
|
|
26
|
-
Authorization: `Bearer ${accessToken}`
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
apiClient.setSecurityData(data);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const apiClient = new Api({
|
|
33
|
-
baseURL:
|
|
34
|
-
process.env.REACT_APP_POS_API_HOST || 'https://api.thebigpos.com',
|
|
35
|
-
securityWorker,
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
apiClient.api.getSiteConfiguration().then((response) => {
|
|
39
|
-
console.log(response.data);
|
|
40
|
-
});
|
|
41
|
-
```
|
|
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 --generate-union-enums
|
|
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 --generate-union-enums
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Publishing
|
|
58
|
-
|
|
59
|
-
1. Update the `version` field in `package.json` before publishing.
|
|
60
|
-
2. Build the project:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
yarn build
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
3. Publish to npm:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
yarn publish
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
____
|
|
73
|
-
© 2024 Mortgage Automation Technologies. All rights reserved
|
|
1
|
+
# The BIG POS Typescript SDK
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
Using npm:
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
$ npm install @matech/thebigpos-sdk
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Using yarn:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
$ yarn add @matech/thebigpos-sdk
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
```js
|
|
18
|
+
import { Api } from "@matech/thebigpos-sdk";
|
|
19
|
+
|
|
20
|
+
const securityWorker = (data: any) => {
|
|
21
|
+
return { headers: data }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const setBearerSecurityWorker = (accessToken:string) => {
|
|
25
|
+
const data = {
|
|
26
|
+
Authorization: `Bearer ${accessToken}`
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
apiClient.setSecurityData(data);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const apiClient = new Api({
|
|
33
|
+
baseURL:
|
|
34
|
+
process.env.REACT_APP_POS_API_HOST || 'https://api.thebigpos.com',
|
|
35
|
+
securityWorker,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
apiClient.api.getSiteConfiguration().then((response) => {
|
|
39
|
+
console.log(response.data);
|
|
40
|
+
});
|
|
41
|
+
```
|
|
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 --generate-union-enums
|
|
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 --generate-union-enums
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Publishing
|
|
58
|
+
|
|
59
|
+
1. Update the `version` field in `package.json` before publishing.
|
|
60
|
+
2. Build the project:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
yarn build
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
3. Publish to npm:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
yarn publish
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
____
|
|
73
|
+
© 2024 Mortgage Automation Technologies. All rights reserved
|
package/dist/index.d.ts
CHANGED
|
@@ -2860,6 +2860,16 @@ export interface LoanLog {
|
|
|
2860
2860
|
/** @format date-time */
|
|
2861
2861
|
createdAt: string;
|
|
2862
2862
|
}
|
|
2863
|
+
export interface LoanLogDetail {
|
|
2864
|
+
/** @format uuid */
|
|
2865
|
+
id: string;
|
|
2866
|
+
level: LoanLogDetailLevelEnum;
|
|
2867
|
+
type: LoanLogDetailTypeEnum;
|
|
2868
|
+
message: string;
|
|
2869
|
+
/** @format date-time */
|
|
2870
|
+
createdAt: string;
|
|
2871
|
+
context?: string | null;
|
|
2872
|
+
}
|
|
2863
2873
|
export interface LoanLogPaginated {
|
|
2864
2874
|
rows: LoanLog[];
|
|
2865
2875
|
pagination: Pagination;
|
|
@@ -3388,7 +3398,7 @@ export interface NotificationTemplateVersionUpdateRequest {
|
|
|
3388
3398
|
}
|
|
3389
3399
|
export interface Operation {
|
|
3390
3400
|
op?: string;
|
|
3391
|
-
value?:
|
|
3401
|
+
value?: string | number | boolean | null | object;
|
|
3392
3402
|
path?: string;
|
|
3393
3403
|
}
|
|
3394
3404
|
export interface OverridePasswordRequest {
|
|
@@ -5191,6 +5201,8 @@ export type LoanImportImportModeEnum = "All" | "NewOnly" | "UpdateOnly";
|
|
|
5191
5201
|
export type LoanImportLogLevelEnum = "None" | "Info" | "Warning" | "Error";
|
|
5192
5202
|
export type LoanLogLevelEnum = "None" | "Info" | "Warning" | "Error";
|
|
5193
5203
|
export type LoanLogTypeEnum = "Loan" | "Queue" | "POSFlagChanged" | "Verification" | "DocumentUploaded" | "LoanCreated" | "WorkflowSubmitted" | "UserInvitationSent" | "CoBorrowerAdded" | "TaskCompleted" | "LoanStatusChanged" | "EConsent" | "SensitiveDataPurge" | "ClosingDateUpdated";
|
|
5204
|
+
export type LoanLogDetailLevelEnum = "None" | "Info" | "Warning" | "Error";
|
|
5205
|
+
export type LoanLogDetailTypeEnum = "Loan" | "Queue" | "POSFlagChanged" | "Verification" | "DocumentUploaded" | "LoanCreated" | "WorkflowSubmitted" | "UserInvitationSent" | "CoBorrowerAdded" | "TaskCompleted" | "LoanStatusChanged" | "EConsent" | "SensitiveDataPurge" | "ClosingDateUpdated";
|
|
5194
5206
|
export type LoanUserLoanRoleEnum = "Borrower" | "CoBorrower" | "NonBorrower" | "LoanOfficer" | "LoanProcessor" | "LoanOfficerAssistant" | "SupportingLoanOfficer" | "BuyerAgent" | "SellerAgent" | "TitleInsuranceAgent" | "EscrowAgent" | "SettlementAgent";
|
|
5195
5207
|
export type SamlMetadataRequestSsoIntegrationEnum = "ConsumerConnect" | "TheBigPOS" | "POSF";
|
|
5196
5208
|
export type SiteConfigurationTypeEnum = "None" | "Account" | "Corporate" | "Branch" | "LoanOfficer" | "Partner";
|
|
@@ -5233,6 +5245,7 @@ export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequest
|
|
|
5233
5245
|
format?: ResponseType;
|
|
5234
5246
|
}
|
|
5235
5247
|
export declare enum ContentType {
|
|
5248
|
+
JsonPatch = "application/json-patch+json",
|
|
5236
5249
|
Json = "application/json",
|
|
5237
5250
|
JsonApi = "application/vnd.api+json",
|
|
5238
5251
|
FormData = "multipart/form-data",
|
|
@@ -7272,6 +7285,18 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
7272
7285
|
sortBy?: string;
|
|
7273
7286
|
sortDirection?: string;
|
|
7274
7287
|
}, params?: RequestParams) => Promise<AxiosResponse<LoanLogPaginated, any, {}>>;
|
|
7288
|
+
/**
|
|
7289
|
+
* No description
|
|
7290
|
+
*
|
|
7291
|
+
* @tags LoanLogs
|
|
7292
|
+
* @name GetLoanLogById
|
|
7293
|
+
* @summary Get loan log by ID
|
|
7294
|
+
* @request GET:/api/loans/{loanId}/logs/{loanLogId}
|
|
7295
|
+
* @secure
|
|
7296
|
+
* @response `200` `LoanLogDetail` Success
|
|
7297
|
+
* @response `404` `ProblemDetails` Not Found
|
|
7298
|
+
*/
|
|
7299
|
+
getLoanLogById: (loanId: string, loanLogId: string, params?: RequestParams) => Promise<AxiosResponse<LoanLogDetail, any, {}>>;
|
|
7275
7300
|
/**
|
|
7276
7301
|
* No description
|
|
7277
7302
|
*
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
32
32
|
import axios from "axios";
|
|
33
33
|
export var ContentType;
|
|
34
34
|
(function (ContentType) {
|
|
35
|
+
ContentType["JsonPatch"] = "application/json-patch+json";
|
|
35
36
|
ContentType["Json"] = "application/json";
|
|
36
37
|
ContentType["JsonApi"] = "application/vnd.api+json";
|
|
37
38
|
ContentType["FormData"] = "multipart/form-data";
|
|
@@ -1203,7 +1204,7 @@ export class Api extends HttpClient {
|
|
|
1203
1204
|
* @response `200` `string` Success
|
|
1204
1205
|
* @response `422` `UnprocessableEntity` Client Error
|
|
1205
1206
|
*/
|
|
1206
|
-
updateLoanConsentAndCustomFieldsObsolete: (loanId, data, params = {}) => this.request(Object.assign({ path: `/api/los/loan/application/${loanId}`, method: "PATCH", body: data, secure: true, type: ContentType.
|
|
1207
|
+
updateLoanConsentAndCustomFieldsObsolete: (loanId, data, params = {}) => this.request(Object.assign({ path: `/api/los/loan/application/${loanId}`, method: "PATCH", body: data, secure: true, type: ContentType.JsonPatch, format: "json" }, params)),
|
|
1207
1208
|
/**
|
|
1208
1209
|
* No description
|
|
1209
1210
|
*
|
|
@@ -1253,7 +1254,7 @@ export class Api extends HttpClient {
|
|
|
1253
1254
|
* @response `200` `string` Success
|
|
1254
1255
|
* @response `422` `UnprocessableEntity` Client Error
|
|
1255
1256
|
*/
|
|
1256
|
-
updateLoanCustomFields: (loanId, data, params = {}) => this.request(Object.assign({ path: `/api/los/loan/application/${loanId}/custom-fields`, method: "PATCH", body: data, secure: true, type: ContentType.
|
|
1257
|
+
updateLoanCustomFields: (loanId, data, params = {}) => this.request(Object.assign({ path: `/api/los/loan/application/${loanId}/custom-fields`, method: "PATCH", body: data, secure: true, type: ContentType.JsonPatch, format: "json" }, params)),
|
|
1257
1258
|
/**
|
|
1258
1259
|
* No description
|
|
1259
1260
|
*
|
|
@@ -1266,7 +1267,7 @@ export class Api extends HttpClient {
|
|
|
1266
1267
|
* @response `202` `string` Accepted
|
|
1267
1268
|
* @response `422` `UnprocessableEntity` Client Error
|
|
1268
1269
|
*/
|
|
1269
|
-
updateLoanConsent: (loanId, data, params = {}) => this.request(Object.assign({ path: `/api/los/loan/application/${loanId}/consent`, method: "PATCH", body: data, secure: true, type: ContentType.
|
|
1270
|
+
updateLoanConsent: (loanId, data, params = {}) => this.request(Object.assign({ path: `/api/los/loan/application/${loanId}/consent`, method: "PATCH", body: data, secure: true, type: ContentType.JsonPatch, format: "json" }, params)),
|
|
1270
1271
|
/**
|
|
1271
1272
|
* No description
|
|
1272
1273
|
*
|
|
@@ -1380,7 +1381,7 @@ export class Api extends HttpClient {
|
|
|
1380
1381
|
* @secure
|
|
1381
1382
|
* @response `200` `ListingFile` Success
|
|
1382
1383
|
*/
|
|
1383
|
-
updateListingFiles: (listingId, data, params = {}) => this.request(Object.assign({ path: `/api/listings/${listingId}/files`, method: "PATCH", body: data, secure: true, type: ContentType.
|
|
1384
|
+
updateListingFiles: (listingId, data, params = {}) => this.request(Object.assign({ path: `/api/listings/${listingId}/files`, method: "PATCH", body: data, secure: true, type: ContentType.JsonPatch, format: "json" }, params)),
|
|
1384
1385
|
/**
|
|
1385
1386
|
* No description
|
|
1386
1387
|
*
|
|
@@ -1413,7 +1414,7 @@ export class Api extends HttpClient {
|
|
|
1413
1414
|
* @secure
|
|
1414
1415
|
* @response `200` `(ListingPhoto)[]` Success
|
|
1415
1416
|
*/
|
|
1416
|
-
updateListingPhotos: (listingId, data, params = {}) => this.request(Object.assign({ path: `/api/listings/${listingId}/photos`, method: "PATCH", body: data, secure: true, type: ContentType.
|
|
1417
|
+
updateListingPhotos: (listingId, data, params = {}) => this.request(Object.assign({ path: `/api/listings/${listingId}/photos`, method: "PATCH", body: data, secure: true, type: ContentType.JsonPatch, format: "json" }, params)),
|
|
1417
1418
|
/**
|
|
1418
1419
|
* No description
|
|
1419
1420
|
*
|
|
@@ -1916,6 +1917,18 @@ export class Api extends HttpClient {
|
|
|
1916
1917
|
* @response `200` `LoanLogPaginated` Success
|
|
1917
1918
|
*/
|
|
1918
1919
|
searchLoanLogs: (loanId, data, query, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/logs/search`, method: "POST", query: query, body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
1920
|
+
/**
|
|
1921
|
+
* No description
|
|
1922
|
+
*
|
|
1923
|
+
* @tags LoanLogs
|
|
1924
|
+
* @name GetLoanLogById
|
|
1925
|
+
* @summary Get loan log by ID
|
|
1926
|
+
* @request GET:/api/loans/{loanId}/logs/{loanLogId}
|
|
1927
|
+
* @secure
|
|
1928
|
+
* @response `200` `LoanLogDetail` Success
|
|
1929
|
+
* @response `404` `ProblemDetails` Not Found
|
|
1930
|
+
*/
|
|
1931
|
+
getLoanLogById: (loanId, loanLogId, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/logs/${loanLogId}`, method: "GET", secure: true, format: "json" }, params)),
|
|
1919
1932
|
/**
|
|
1920
1933
|
* No description
|
|
1921
1934
|
*
|
|
@@ -2142,7 +2155,7 @@ export class Api extends HttpClient {
|
|
|
2142
2155
|
* @response `200` `TaskCommentPaginated` Success
|
|
2143
2156
|
* @response `404` `ProblemDetails` Not Found
|
|
2144
2157
|
*/
|
|
2145
|
-
searchLoanTaskComments: (loanId, userLoanTaskId, data, query, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/tasks/${userLoanTaskId}/comments/search`, method: "POST", query: query, body: data, secure: true, type: ContentType.
|
|
2158
|
+
searchLoanTaskComments: (loanId, userLoanTaskId, data, query, params = {}) => this.request(Object.assign({ path: `/api/loans/${loanId}/tasks/${userLoanTaskId}/comments/search`, method: "POST", query: query, body: data, secure: true, type: ContentType.JsonPatch, format: "json" }, params)),
|
|
2146
2159
|
/**
|
|
2147
2160
|
* No description
|
|
2148
2161
|
*
|