@matech/thebigpos-sdk 2.35.0 → 2.36.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/.husky/pre-commit +2 -2
- package/LICENSE +21 -21
- package/README.md +73 -73
- package/dist/index.d.ts +27 -14
- package/dist/index.js +17 -19
- package/dist/index.js.map +1 -1
- package/docs/sdk_generation.md +149 -0
- package/package.json +39 -39
- package/scripts/apply-json-patch-content-type.js +56 -56
- package/src/index.ts +43 -24
- package/tsconfig.json +27 -27
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/*
|
|
2
|
-
This script is meant to run after the SDK has been generated.
|
|
3
|
-
|
|
4
|
-
- It updates the generated code to ensure that all PATCH methods use ContentType.JsonPatch.
|
|
5
|
-
- It also ensures that the ContentType enum includes JsonPatch and modifies the Operation interface
|
|
6
|
-
to allow any value for the `value` property instead of just object or null.
|
|
7
|
-
|
|
8
|
-
This is necessary because the SDK generation does not currently handle these cases correctly.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const fs = require('fs')
|
|
12
|
-
|
|
13
|
-
const path = require('path').resolve(__dirname, '../src/index.ts')
|
|
14
|
-
|
|
15
|
-
if (!fs.existsSync(path)) {
|
|
16
|
-
console.error(`Error: File not found at path "${path}". Please ensure the SDK has been generated.`)
|
|
17
|
-
process.exit(1)
|
|
18
|
-
}
|
|
19
|
-
let content
|
|
20
|
-
try {
|
|
21
|
-
content = fs.readFileSync(path, 'utf8')
|
|
22
|
-
} catch (err) {
|
|
23
|
-
console.error(`Error: Unable to read file at path "${path}". Details: ${err.message}`)
|
|
24
|
-
process.exit(1)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Update PATCH methods to use ContentType.JsonPatch
|
|
28
|
-
content = content.replace(
|
|
29
|
-
/(method:\s*"PATCH"[\s\S]+?)type:\s*ContentType\.Json/g,
|
|
30
|
-
(match) => match.replace('ContentType.Json', 'ContentType.JsonPatch')
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
// Ensure JsonPatch is included in the ContentType enum
|
|
34
|
-
content = content.replace(
|
|
35
|
-
/export enum ContentType\s*{([\s\S]*?)}/,
|
|
36
|
-
(match, enumBody) => {
|
|
37
|
-
if (enumBody.includes('JsonPatch')) return match
|
|
38
|
-
const insertion = ` JsonPatch = "application/json-patch+json",\n `
|
|
39
|
-
return `export enum ContentType {\n${insertion}${enumBody.trim()}\n}`
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
// Fix the Operation interface to allow any value
|
|
44
|
-
content = content.replace(
|
|
45
|
-
/export interface Operation\s*{([\s\S]*?)}/,
|
|
46
|
-
(match, body) => {
|
|
47
|
-
const updated = body.replace(
|
|
48
|
-
/value\?:\s*object\s*\|?\s*null?;/,
|
|
49
|
-
'value?: string | number | boolean | null | object;'
|
|
50
|
-
)
|
|
51
|
-
return `export interface Operation {\n ${updated.trim()}\n}`
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
fs.writeFileSync(path, content)
|
|
56
|
-
console.log('SDK patch complete: All PATCH methods now use ContentType.JsonPatch.')
|
|
1
|
+
/*
|
|
2
|
+
This script is meant to run after the SDK has been generated.
|
|
3
|
+
|
|
4
|
+
- It updates the generated code to ensure that all PATCH methods use ContentType.JsonPatch.
|
|
5
|
+
- It also ensures that the ContentType enum includes JsonPatch and modifies the Operation interface
|
|
6
|
+
to allow any value for the `value` property instead of just object or null.
|
|
7
|
+
|
|
8
|
+
This is necessary because the SDK generation does not currently handle these cases correctly.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs')
|
|
12
|
+
|
|
13
|
+
const path = require('path').resolve(__dirname, '../src/index.ts')
|
|
14
|
+
|
|
15
|
+
if (!fs.existsSync(path)) {
|
|
16
|
+
console.error(`Error: File not found at path "${path}". Please ensure the SDK has been generated.`)
|
|
17
|
+
process.exit(1)
|
|
18
|
+
}
|
|
19
|
+
let content
|
|
20
|
+
try {
|
|
21
|
+
content = fs.readFileSync(path, 'utf8')
|
|
22
|
+
} catch (err) {
|
|
23
|
+
console.error(`Error: Unable to read file at path "${path}". Details: ${err.message}`)
|
|
24
|
+
process.exit(1)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Update PATCH methods to use ContentType.JsonPatch
|
|
28
|
+
content = content.replace(
|
|
29
|
+
/(method:\s*"PATCH"[\s\S]+?)type:\s*ContentType\.Json/g,
|
|
30
|
+
(match) => match.replace('ContentType.Json', 'ContentType.JsonPatch')
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
// Ensure JsonPatch is included in the ContentType enum
|
|
34
|
+
content = content.replace(
|
|
35
|
+
/export enum ContentType\s*{([\s\S]*?)}/,
|
|
36
|
+
(match, enumBody) => {
|
|
37
|
+
if (enumBody.includes('JsonPatch')) return match
|
|
38
|
+
const insertion = ` JsonPatch = "application/json-patch+json",\n `
|
|
39
|
+
return `export enum ContentType {\n${insertion}${enumBody.trim()}\n}`
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
// Fix the Operation interface to allow any value
|
|
44
|
+
content = content.replace(
|
|
45
|
+
/export interface Operation\s*{([\s\S]*?)}/,
|
|
46
|
+
(match, body) => {
|
|
47
|
+
const updated = body.replace(
|
|
48
|
+
/value\?:\s*object\s*\|?\s*null?;/,
|
|
49
|
+
'value?: string | number | boolean | null | object;'
|
|
50
|
+
)
|
|
51
|
+
return `export interface Operation {\n ${updated.trim()}\n}`
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
fs.writeFileSync(path, content)
|
|
56
|
+
console.log('SDK patch complete: All PATCH methods now use ContentType.JsonPatch.')
|
package/src/index.ts
CHANGED
|
@@ -1298,9 +1298,18 @@ export interface DocumentFolder {
|
|
|
1298
1298
|
files: DocumentFile[];
|
|
1299
1299
|
}
|
|
1300
1300
|
|
|
1301
|
+
export interface DocumentFoldersRequest {
|
|
1302
|
+
searchText?: string | null;
|
|
1303
|
+
losStatuses?: LOSStatus[] | null;
|
|
1304
|
+
sortBy?: string | null;
|
|
1305
|
+
sortDirection?: string | null;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1301
1308
|
export interface DocumentSync {
|
|
1302
1309
|
/** @format int32 */
|
|
1303
1310
|
syncedCount: number;
|
|
1311
|
+
/** @format date-time */
|
|
1312
|
+
lastLosDocumentsSyncDate?: string | null;
|
|
1304
1313
|
}
|
|
1305
1314
|
|
|
1306
1315
|
export interface DocumentTemplate {
|
|
@@ -2127,6 +2136,8 @@ export interface Loan {
|
|
|
2127
2136
|
isInSync: boolean;
|
|
2128
2137
|
/** @format date-time */
|
|
2129
2138
|
syncDate?: string | null;
|
|
2139
|
+
/** @format date-time */
|
|
2140
|
+
lastLosDocumentsSyncDate?: string | null;
|
|
2130
2141
|
isLocked: boolean;
|
|
2131
2142
|
isLockedFromEditing: boolean;
|
|
2132
2143
|
excludeFromAutoTaskReminders?: boolean | null;
|
|
@@ -2177,6 +2188,8 @@ export interface LoanApplicationRequest {
|
|
|
2177
2188
|
borrowers: LoanBorrowerRequest[];
|
|
2178
2189
|
nonOwningBorrowers: LoanNonOwningBorrowerRequest[];
|
|
2179
2190
|
/** @format uuid */
|
|
2191
|
+
draftId?: string | null;
|
|
2192
|
+
/** @format uuid */
|
|
2180
2193
|
existingLoanId?: string | null;
|
|
2181
2194
|
}
|
|
2182
2195
|
|
|
@@ -3893,7 +3906,7 @@ export interface NotificationTemplateVersionUpdateRequest {
|
|
|
3893
3906
|
|
|
3894
3907
|
export interface Operation {
|
|
3895
3908
|
op?: string;
|
|
3896
|
-
value?:
|
|
3909
|
+
value?: object | null;
|
|
3897
3910
|
path?: string;
|
|
3898
3911
|
}
|
|
3899
3912
|
|
|
@@ -6101,7 +6114,6 @@ export interface ApiConfig<SecurityDataType = unknown>
|
|
|
6101
6114
|
}
|
|
6102
6115
|
|
|
6103
6116
|
export enum ContentType {
|
|
6104
|
-
JsonPatch = "application/json-patch+json",
|
|
6105
6117
|
Json = "application/json",
|
|
6106
6118
|
JsonApi = "application/vnd.api+json",
|
|
6107
6119
|
FormData = "multipart/form-data",
|
|
@@ -6237,7 +6249,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
6237
6249
|
|
|
6238
6250
|
/**
|
|
6239
6251
|
* @title The Big POS API
|
|
6240
|
-
* @version v2.
|
|
6252
|
+
* @version v2.36.0
|
|
6241
6253
|
* @termsOfService https://www.thebigpos.com/terms-of-use/
|
|
6242
6254
|
* @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
|
|
6243
6255
|
*/
|
|
@@ -8493,7 +8505,7 @@ export class Api<
|
|
|
8493
8505
|
method: "PATCH",
|
|
8494
8506
|
body: data,
|
|
8495
8507
|
secure: true,
|
|
8496
|
-
type: ContentType.
|
|
8508
|
+
type: ContentType.Json,
|
|
8497
8509
|
format: "json",
|
|
8498
8510
|
...params,
|
|
8499
8511
|
}),
|
|
@@ -8603,7 +8615,7 @@ export class Api<
|
|
|
8603
8615
|
method: "PATCH",
|
|
8604
8616
|
body: data,
|
|
8605
8617
|
secure: true,
|
|
8606
|
-
type: ContentType.
|
|
8618
|
+
type: ContentType.Json,
|
|
8607
8619
|
format: "json",
|
|
8608
8620
|
...params,
|
|
8609
8621
|
}),
|
|
@@ -8630,7 +8642,7 @@ export class Api<
|
|
|
8630
8642
|
method: "PATCH",
|
|
8631
8643
|
body: data,
|
|
8632
8644
|
secure: true,
|
|
8633
|
-
type: ContentType.
|
|
8645
|
+
type: ContentType.Json,
|
|
8634
8646
|
format: "json",
|
|
8635
8647
|
...params,
|
|
8636
8648
|
}),
|
|
@@ -8872,7 +8884,7 @@ export class Api<
|
|
|
8872
8884
|
method: "PATCH",
|
|
8873
8885
|
body: data,
|
|
8874
8886
|
secure: true,
|
|
8875
|
-
type: ContentType.
|
|
8887
|
+
type: ContentType.Json,
|
|
8876
8888
|
format: "json",
|
|
8877
8889
|
...params,
|
|
8878
8890
|
}),
|
|
@@ -8952,7 +8964,7 @@ export class Api<
|
|
|
8952
8964
|
method: "PATCH",
|
|
8953
8965
|
body: data,
|
|
8954
8966
|
secure: true,
|
|
8955
|
-
type: ContentType.
|
|
8967
|
+
type: ContentType.Json,
|
|
8956
8968
|
format: "json",
|
|
8957
8969
|
...params,
|
|
8958
8970
|
}),
|
|
@@ -9458,20 +9470,31 @@ export class Api<
|
|
|
9458
9470
|
}),
|
|
9459
9471
|
|
|
9460
9472
|
/**
|
|
9461
|
-
* @description Returns all documents grouped by folder for sidebar display
|
|
9473
|
+
* @description Returns all documents grouped by folder for sidebar display. Use folderNamesOnly=true to get simplified response with folder names and counts for mobile (Files array will be empty).
|
|
9462
9474
|
*
|
|
9463
9475
|
* @tags LoanDocuments
|
|
9464
9476
|
* @name GetLoanDocumentFolders
|
|
9465
9477
|
* @summary Get document folder hierarchy
|
|
9466
|
-
* @request
|
|
9478
|
+
* @request POST:/api/loans/{loanId}/documents/folders
|
|
9467
9479
|
* @secure
|
|
9468
9480
|
* @response `200` `(DocumentFolder)[]` Success
|
|
9469
9481
|
*/
|
|
9470
|
-
getLoanDocumentFolders: (
|
|
9482
|
+
getLoanDocumentFolders: (
|
|
9483
|
+
loanId: string,
|
|
9484
|
+
data: DocumentFoldersRequest,
|
|
9485
|
+
query?: {
|
|
9486
|
+
/** @default false */
|
|
9487
|
+
folderNamesOnly?: boolean;
|
|
9488
|
+
},
|
|
9489
|
+
params: RequestParams = {},
|
|
9490
|
+
) =>
|
|
9471
9491
|
this.request<DocumentFolder[], any>({
|
|
9472
9492
|
path: `/api/loans/${loanId}/documents/folders`,
|
|
9473
|
-
method: "
|
|
9493
|
+
method: "POST",
|
|
9494
|
+
query: query,
|
|
9495
|
+
body: data,
|
|
9474
9496
|
secure: true,
|
|
9497
|
+
type: ContentType.Json,
|
|
9475
9498
|
format: "json",
|
|
9476
9499
|
...params,
|
|
9477
9500
|
}),
|
|
@@ -9612,17 +9635,14 @@ export class Api<
|
|
|
9612
9635
|
* @description Fetches all documents from Encompass that don't exist locally and stores them in S3
|
|
9613
9636
|
*
|
|
9614
9637
|
* @tags LoanDocuments
|
|
9615
|
-
* @name
|
|
9616
|
-
* @summary Sync documents from
|
|
9638
|
+
* @name SyncLoanDocumentsFromLos
|
|
9639
|
+
* @summary Sync documents from LOS
|
|
9617
9640
|
* @request POST:/api/loans/{loanId}/documents/sync
|
|
9618
9641
|
* @secure
|
|
9619
9642
|
* @response `200` `DocumentSync` Success
|
|
9620
9643
|
* @response `404` `ProblemDetails` Not Found
|
|
9621
9644
|
*/
|
|
9622
|
-
|
|
9623
|
-
loanId: string,
|
|
9624
|
-
params: RequestParams = {},
|
|
9625
|
-
) =>
|
|
9645
|
+
syncLoanDocumentsFromLos: (loanId: string, params: RequestParams = {}) =>
|
|
9626
9646
|
this.request<DocumentSync, ProblemDetails>({
|
|
9627
9647
|
path: `/api/loans/${loanId}/documents/sync`,
|
|
9628
9648
|
method: "POST",
|
|
@@ -9632,18 +9652,18 @@ export class Api<
|
|
|
9632
9652
|
}),
|
|
9633
9653
|
|
|
9634
9654
|
/**
|
|
9635
|
-
* @description Re-attempts to push a failed document to
|
|
9655
|
+
* @description Re-attempts to push a failed document to LOS
|
|
9636
9656
|
*
|
|
9637
9657
|
* @tags LoanDocuments
|
|
9638
|
-
* @name
|
|
9639
|
-
* @summary Retry syncing a document to
|
|
9658
|
+
* @name RetrySyncLoanDocumentToLos
|
|
9659
|
+
* @summary Retry syncing a document to LOS
|
|
9640
9660
|
* @request POST:/api/loans/{loanId}/documents/{documentId}/sync/retry
|
|
9641
9661
|
* @secure
|
|
9642
9662
|
* @response `200` `void` Success
|
|
9643
9663
|
* @response `404` `ProblemDetails` Not Found
|
|
9644
9664
|
* @response `423` `ProblemDetails` Client Error
|
|
9645
9665
|
*/
|
|
9646
|
-
|
|
9666
|
+
retrySyncLoanDocumentToLos: (
|
|
9647
9667
|
loanId: string,
|
|
9648
9668
|
documentId: string,
|
|
9649
9669
|
params: RequestParams = {},
|
|
@@ -10327,7 +10347,6 @@ export class Api<
|
|
|
10327
10347
|
* @name GetLoans
|
|
10328
10348
|
* @summary Get Loans
|
|
10329
10349
|
* @request GET:/api/loans
|
|
10330
|
-
* @deprecated
|
|
10331
10350
|
* @secure
|
|
10332
10351
|
* @response `200` `GetApplications` Success
|
|
10333
10352
|
*/
|
|
@@ -10496,7 +10515,7 @@ export class Api<
|
|
|
10496
10515
|
query: query,
|
|
10497
10516
|
body: data,
|
|
10498
10517
|
secure: true,
|
|
10499
|
-
type: ContentType.
|
|
10518
|
+
type: ContentType.Json,
|
|
10500
10519
|
format: "json",
|
|
10501
10520
|
...params,
|
|
10502
10521
|
}),
|
package/tsconfig.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es6",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"sourceMap": true,
|
|
7
|
-
"outDir": "./dist",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"moduleResolution": "node",
|
|
10
|
-
"baseUrl": "./",
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"paths": {
|
|
13
|
-
"*": [
|
|
14
|
-
"node_modules/*"
|
|
15
|
-
]
|
|
16
|
-
},
|
|
17
|
-
"typeRoots": [
|
|
18
|
-
"./node_modules/@types"
|
|
19
|
-
],
|
|
20
|
-
"esModuleInterop": true,
|
|
21
|
-
"skipLibCheck": true,
|
|
22
|
-
"forceConsistentCasingInFileNames": true,
|
|
23
|
-
"resolveJsonModule": true
|
|
24
|
-
},
|
|
25
|
-
"include": ["./src/**/*"],
|
|
26
|
-
"exclude": ["./dist"]
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es6",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"baseUrl": "./",
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"paths": {
|
|
13
|
+
"*": [
|
|
14
|
+
"node_modules/*"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"typeRoots": [
|
|
18
|
+
"./node_modules/@types"
|
|
19
|
+
],
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"skipLibCheck": true,
|
|
22
|
+
"forceConsistentCasingInFileNames": true,
|
|
23
|
+
"resolveJsonModule": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["./src/**/*"],
|
|
26
|
+
"exclude": ["./dist"]
|
|
27
|
+
}
|