@matech/thebigpos-sdk 3.20.0-main-7027 → 3.21.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 +3 -0
- package/README.md +0 -39
- package/dist/index.d.ts +533 -526
- package/dist/index.js +2 -8
- package/dist/index.js.map +1 -1
- package/index.js +1 -1
- package/package.json +10 -24
- package/scripts/apply-json-patch-content-type.js +56 -0
- package/src/index.ts +29 -10
- package/tsconfig.json +27 -0
- package/dist/index.cjs +0 -6518
- package/dist/index.cjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matech/thebigpos-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "The Big POS Typescript SDK",
|
|
5
|
-
"main": "dist/index.
|
|
6
|
-
"module": "dist/index.js",
|
|
7
|
-
"react-native": "dist/index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
8
6
|
"types": "dist/index.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"dist",
|
|
11
|
-
"src",
|
|
12
|
-
"index.js"
|
|
13
|
-
],
|
|
14
7
|
"scripts": {
|
|
15
|
-
"build": "rimraf dist && tsc
|
|
16
|
-
"
|
|
8
|
+
"build": "rimraf dist && tsc",
|
|
9
|
+
"test": "mocha -r ts-node/register 'src/api_test.spec.ts' --exit",
|
|
17
10
|
"browserify": "tsc && esbuild dist/index.js --bundle --minify --sourcemap --global-name=thebigpos --outfile=dist/thebigpos.min.js",
|
|
18
11
|
"prepare": "husky"
|
|
19
12
|
},
|
|
@@ -33,22 +26,15 @@
|
|
|
33
26
|
"url": "https://github.com/MortgageAutomationTechnologies/thebigpos-sdk-typescript/issues"
|
|
34
27
|
},
|
|
35
28
|
"homepage": "https://github.com/MortgageAutomationTechnologies/thebigpos-sdk-typescript#readme",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"axios": "^1"
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"axios": "^1.7.7"
|
|
41
31
|
},
|
|
42
32
|
"devDependencies": {
|
|
43
|
-
"
|
|
44
|
-
"esbuild": "^0.28.1",
|
|
33
|
+
"esbuild": "^0.27.0",
|
|
45
34
|
"husky": "^9.1.5",
|
|
46
|
-
"rimraf": "6.1.
|
|
35
|
+
"rimraf": "6.1.1",
|
|
36
|
+
"ts-node": "^10.9.2",
|
|
47
37
|
"typescript": "^5.5.4"
|
|
48
38
|
},
|
|
49
|
-
"
|
|
50
|
-
"brace-expansion": "^5.0.12",
|
|
51
|
-
"follow-redirects": "^1.16.1"
|
|
52
|
-
},
|
|
53
|
-
"swaggerSha256": "2d6bb437f90a90b09c97c1964289f7016cdaae36056ae37bb3226bf8e2f37713"
|
|
39
|
+
"swaggerSha256": "b230eb1ddebbe38c29fb2cfee9a1a8779e25e7dac0a5b81336bf13fbfbaf68a6"
|
|
54
40
|
}
|
|
@@ -0,0 +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.')
|
package/src/index.ts
CHANGED
|
@@ -5046,6 +5046,11 @@ export interface LoanDocumentFolderPermission {
|
|
|
5046
5046
|
readScope: LoanDocumentFolderPermissionReadScopeEnum;
|
|
5047
5047
|
}
|
|
5048
5048
|
|
|
5049
|
+
export interface LoanDocumentFolderPermissionFilter {
|
|
5050
|
+
role: LoanDocumentFolderPermissionFilterRoleEnum;
|
|
5051
|
+
minimumPermissionLevel: LoanDocumentFolderPermissionFilterMinimumPermissionLevelEnum;
|
|
5052
|
+
}
|
|
5053
|
+
|
|
5049
5054
|
export interface LoanDocumentFolderPermissionRequest {
|
|
5050
5055
|
role: LoanDocumentFolderPermissionRequestRoleEnum;
|
|
5051
5056
|
level: LoanDocumentFolderPermissionRequestLevelEnum;
|
|
@@ -5057,6 +5062,7 @@ export interface LoanDocumentFolderSearchCriteria {
|
|
|
5057
5062
|
isActive?: boolean | null;
|
|
5058
5063
|
isSystemDefault?: boolean | null;
|
|
5059
5064
|
role?: LoanRole | null;
|
|
5065
|
+
permissions?: LoanDocumentFolderPermissionFilter[] | null;
|
|
5060
5066
|
}
|
|
5061
5067
|
|
|
5062
5068
|
export interface LoanDocumentFolderSummary {
|
|
@@ -9316,6 +9322,27 @@ export type LoanDocumentFolderPermissionLevelEnum =
|
|
|
9316
9322
|
|
|
9317
9323
|
export type LoanDocumentFolderPermissionReadScopeEnum = "Own" | "All";
|
|
9318
9324
|
|
|
9325
|
+
export type LoanDocumentFolderPermissionFilterRoleEnum =
|
|
9326
|
+
| "Borrower"
|
|
9327
|
+
| "CoBorrower"
|
|
9328
|
+
| "NonBorrower"
|
|
9329
|
+
| "LoanOfficer"
|
|
9330
|
+
| "LoanProcessor"
|
|
9331
|
+
| "LoanOfficerAssistant"
|
|
9332
|
+
| "SupportingLoanOfficer"
|
|
9333
|
+
| "BuyerAgent"
|
|
9334
|
+
| "SellerAgent"
|
|
9335
|
+
| "TitleInsuranceAgent"
|
|
9336
|
+
| "EscrowAgent"
|
|
9337
|
+
| "SettlementAgent"
|
|
9338
|
+
| "Admin";
|
|
9339
|
+
|
|
9340
|
+
export type LoanDocumentFolderPermissionFilterMinimumPermissionLevelEnum =
|
|
9341
|
+
| "None"
|
|
9342
|
+
| "Read"
|
|
9343
|
+
| "Write"
|
|
9344
|
+
| "Manage";
|
|
9345
|
+
|
|
9319
9346
|
export type LoanDocumentFolderPermissionRequestRoleEnum =
|
|
9320
9347
|
| "Borrower"
|
|
9321
9348
|
| "CoBorrower"
|
|
@@ -10029,15 +10056,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
10029
10056
|
property instanceof Array ? property : [property];
|
|
10030
10057
|
|
|
10031
10058
|
for (const formItem of propertyContent) {
|
|
10032
|
-
|
|
10033
|
-
const isReactNativeFile =
|
|
10034
|
-
!!formItem &&
|
|
10035
|
-
typeof formItem === "object" &&
|
|
10036
|
-
"uri" in formItem &&
|
|
10037
|
-
"name" in formItem &&
|
|
10038
|
-
"type" in formItem;
|
|
10039
|
-
const isFileType =
|
|
10040
|
-
isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
|
|
10059
|
+
const isFileType = formItem instanceof Blob || formItem instanceof File;
|
|
10041
10060
|
formData.append(
|
|
10042
10061
|
key,
|
|
10043
10062
|
isFileType ? formItem : this.stringifyFormItem(formItem),
|
|
@@ -10099,7 +10118,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
10099
10118
|
|
|
10100
10119
|
/**
|
|
10101
10120
|
* @title The Big POS API
|
|
10102
|
-
* @version v3.
|
|
10121
|
+
* @version v3.21.0
|
|
10103
10122
|
* @termsOfService https://www.thebigpos.com/terms-of-use/
|
|
10104
10123
|
* @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
|
|
10105
10124
|
*/
|
package/tsconfig.json
ADDED
|
@@ -0,0 +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
|
+
}
|