@matech/thebigpos-sdk 3.29.0-pr-6058-8513 → 3.30.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/package.json CHANGED
@@ -1,19 +1,12 @@
1
1
  {
2
2
  "name": "@matech/thebigpos-sdk",
3
- "version": "3.29.0-pr-6058-8513",
3
+ "version": "3.30.0",
4
4
  "description": "The Big POS Typescript SDK",
5
- "main": "dist/index.cjs",
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 && esbuild dist/index.js --format=cjs --platform=node --packages=external --sourcemap --outfile=dist/index.cjs",
16
- "postbuild": "node -e \"if (typeof require('./').Api !== 'function') { console.error('Smoke check failed: the CommonJS entry does not export Api'); process.exit(1) }\"",
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
- "engines": {
37
- "node": ">=18"
38
- },
39
- "peerDependencies": {
40
- "axios": "^1"
29
+ "dependencies": {
30
+ "axios": "^1.7.7"
41
31
  },
42
32
  "devDependencies": {
43
- "axios": "^1.20.0",
44
- "esbuild": "^0.28.1",
33
+ "esbuild": "^0.27.0",
45
34
  "husky": "^9.1.5",
46
- "rimraf": "6.1.4",
35
+ "rimraf": "6.1.1",
36
+ "ts-node": "^10.9.2",
47
37
  "typescript": "^5.5.4"
48
38
  },
49
- "resolutions": {
50
- "brace-expansion": "^5.0.12",
51
- "follow-redirects": "^1.16.1"
52
- },
53
- "swaggerSha256": "5e7ccac347eb1a08551a22b724fe8a3de00ac7709e79e35adafce6f993a4f532"
39
+ "swaggerSha256": "559b6b2ba69a254a45166ef53bfe5e6c02b96b80947924d3ce04ecae65b0e095"
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
@@ -110,7 +110,13 @@ export type LosCredentialHealthStatus =
110
110
 
111
111
  export type LogLevel = "None" | "Info" | "Warning" | "Error";
112
112
 
113
- export type LoanType = "Fha" | "Conventional" | "UsdaRd" | "Va" | "Other";
113
+ export type LoanType =
114
+ | "Fha"
115
+ | "Conventional"
116
+ | "UsdaRd"
117
+ | "Va"
118
+ | "Other"
119
+ | "Heloc";
114
120
 
115
121
  export type LoanTrustType = "Living" | "Land" | "Testamentary" | "Other";
116
122
 
@@ -4066,6 +4072,7 @@ export interface LoanApplicationRequest {
4066
4072
  submissionKey?: string | null;
4067
4073
  loanOfficerEmail?: string | null;
4068
4074
  purpose?: LoanPurpose | null;
4075
+ type?: LoanType | null;
4069
4076
  referrer?: string | null;
4070
4077
  companyName?: string | null;
4071
4078
  relationship?: BorrowerRelationship | null;
@@ -4527,6 +4534,11 @@ export interface LoanBorrowerEmploymentPreviousRequest {
4527
4534
  /** @format double */
4528
4535
  grossIncome?: number | null;
4529
4536
  isSelfEmployed?: boolean | null;
4537
+ payType?: string | null;
4538
+ /** @format double */
4539
+ hourlyRate?: number | null;
4540
+ /** @format int32 */
4541
+ hoursPerWeek?: number | null;
4530
4542
  /** @format double */
4531
4543
  bonus?: number | null;
4532
4544
  /** @format double */
@@ -10193,15 +10205,7 @@ export class HttpClient<SecurityDataType = unknown> {
10193
10205
  property instanceof Array ? property : [property];
10194
10206
 
10195
10207
  for (const formItem of propertyContent) {
10196
- // React Native files are plain { uri, name, type } objects, not Blob/File.
10197
- const isReactNativeFile =
10198
- !!formItem &&
10199
- typeof formItem === "object" &&
10200
- "uri" in formItem &&
10201
- "name" in formItem &&
10202
- "type" in formItem;
10203
- const isFileType =
10204
- isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
10208
+ const isFileType = formItem instanceof Blob || formItem instanceof File;
10205
10209
  formData.append(
10206
10210
  key,
10207
10211
  isFileType ? formItem : this.stringifyFormItem(formItem),
@@ -10263,7 +10267,7 @@ export class HttpClient<SecurityDataType = unknown> {
10263
10267
 
10264
10268
  /**
10265
10269
  * @title The Big POS API
10266
- * @version v3.29.0
10270
+ * @version v3.30.0
10267
10271
  * @termsOfService https://www.thebigpos.com/terms-of-use/
10268
10272
  * @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
10269
10273
  */
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
+ }