@matech/thebigpos-sdk 3.31.0-main-9036 → 3.32.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.31.0-main-9036",
3
+ "version": "3.32.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": "9b35860ed24aa28054e297e6652c9fb9bfd3628605d9fc79e3c69cdb7d131400"
39
+ "swaggerSha256": "146118641aaffa2d0b0d2b1b4d38dddc5f999cb8526382f7eb30e950f21e3804"
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
@@ -195,7 +195,11 @@ export type LoanQueueReason =
195
195
  | "Exception"
196
196
  | "TransientError";
197
197
 
198
- export type LoanPurpose = "Purchase" | "Refinance";
198
+ export type LoanPurpose =
199
+ | "Purchase"
200
+ | "Refinance"
201
+ | "ConstructionOnly"
202
+ | "ConstructionToPermanent";
199
203
 
200
204
  export type LoanPropertyType =
201
205
  | "SingleFamily"
@@ -205,7 +209,14 @@ export type LoanPropertyType =
205
209
  | "ManufacturedHome"
206
210
  | "PlannedUnitDevelopment"
207
211
  | "ModularHome"
208
- | "Other";
212
+ | "Other"
213
+ | "DetachedCondo"
214
+ | "HighRiseCondominium"
215
+ | "Cooperative"
216
+ | "ManufacturedHomeCondoPudCoOp"
217
+ | "MHHomeChoice"
218
+ | "MHSelect"
219
+ | "MHAdvantage";
209
220
 
210
221
  export type LoanPhoneNumberType = "Home" | "Cell" | "Work" | "Fax" | "Other";
211
222
 
@@ -6136,12 +6147,6 @@ export interface LosSyncStep {
6136
6147
  atUtc: string;
6137
6148
  }
6138
6149
 
6139
- export interface LosUnlinkedRecipient {
6140
- email: string;
6141
- contactType: string;
6142
- recipientId: string;
6143
- }
6144
-
6145
6150
  export interface LosWebhook {
6146
6151
  /** @format uuid */
6147
6152
  id: string;
@@ -7216,6 +7221,7 @@ export interface SiteConfiguration {
7216
7221
  addCoBorrowerAnimatedIconID?: string | null;
7217
7222
  disclosuresSSOSiteID?: string | null;
7218
7223
  signingMethodOverride?: SigningMethod | null;
7224
+ signingMethod: SiteConfigurationSigningMethodEnum;
7219
7225
  loanChannel?: string | null;
7220
7226
  loanFolder?: string | null;
7221
7227
  loanTemplate?: string | null;
@@ -7412,6 +7418,7 @@ export interface SiteConfigurationByUrl {
7412
7418
  addCoBorrowerAnimatedIconID?: string | null;
7413
7419
  disclosuresSSOSiteID?: string | null;
7414
7420
  signingMethodOverride?: SigningMethod | null;
7421
+ signingMethod: SiteConfigurationByUrlSigningMethodEnum;
7415
7422
  loanChannel?: string | null;
7416
7423
  loanFolder?: string | null;
7417
7424
  loanTemplate?: string | null;
@@ -9835,6 +9842,8 @@ export type SiteConfigurationTypeEnum =
9835
9842
  | "LoanOfficer"
9836
9843
  | "Partner";
9837
9844
 
9845
+ export type SiteConfigurationSigningMethodEnum = "ConsumerConnect" | "POSF";
9846
+
9838
9847
  export type SiteConfigurationByUrlTypeEnum =
9839
9848
  | "None"
9840
9849
  | "Account"
@@ -9843,6 +9852,10 @@ export type SiteConfigurationByUrlTypeEnum =
9843
9852
  | "LoanOfficer"
9844
9853
  | "Partner";
9845
9854
 
9855
+ export type SiteConfigurationByUrlSigningMethodEnum =
9856
+ | "ConsumerConnect"
9857
+ | "POSF";
9858
+
9846
9859
  export type SiteConfigurationReducedTypeEnum =
9847
9860
  | "None"
9848
9861
  | "Account"
@@ -10214,15 +10227,7 @@ export class HttpClient<SecurityDataType = unknown> {
10214
10227
  property instanceof Array ? property : [property];
10215
10228
 
10216
10229
  for (const formItem of propertyContent) {
10217
- // React Native files are plain { uri, name, type } objects, not Blob/File.
10218
- const isReactNativeFile =
10219
- !!formItem &&
10220
- typeof formItem === "object" &&
10221
- "uri" in formItem &&
10222
- "name" in formItem &&
10223
- "type" in formItem;
10224
- const isFileType =
10225
- isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
10230
+ const isFileType = formItem instanceof Blob || formItem instanceof File;
10226
10231
  formData.append(
10227
10232
  key,
10228
10233
  isFileType ? formItem : this.stringifyFormItem(formItem),
@@ -10284,7 +10289,7 @@ export class HttpClient<SecurityDataType = unknown> {
10284
10289
 
10285
10290
  /**
10286
10291
  * @title The Big POS API
10287
- * @version v3.31.0
10292
+ * @version v3.32.0
10288
10293
  * @termsOfService https://www.thebigpos.com/terms-of-use/
10289
10294
  * @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
10290
10295
  */
@@ -18934,35 +18939,6 @@ export class Api<
18934
18939
  ...params,
18935
18940
  }),
18936
18941
 
18937
- /**
18938
- * No description
18939
- *
18940
- * @tags LoanSigningMethod
18941
- * @name UnlinkLoanFromConsumerConnect
18942
- * @summary Unlink the loan's borrowers from Consumer Connect
18943
- * @request POST:/api/loans/{loanId}/signing-method/unlink
18944
- * @secure
18945
- * @response `200` `(LosUnlinkedRecipient)[]` OK
18946
- * @response `400` `ProblemDetails` Bad Request
18947
- * @response `403` `ProblemDetails` Forbidden
18948
- * @response `404` `ProblemDetails` Not Found
18949
- * @response `422` `ProblemDetails` Unprocessable Content
18950
- * @response `423` `ProblemDetails` Locked
18951
- * @response `429` `ProblemDetails` Too Many Requests
18952
- * @response `504` `void` Gateway Timeout
18953
- */
18954
- unlinkLoanFromConsumerConnect: (
18955
- loanId: string,
18956
- params: RequestParams = {},
18957
- ) =>
18958
- this.request<LosUnlinkedRecipient[], ProblemDetails | void>({
18959
- path: `/api/loans/${loanId}/signing-method/unlink`,
18960
- method: "POST",
18961
- secure: true,
18962
- format: "json",
18963
- ...params,
18964
- }),
18965
-
18966
18942
  /**
18967
18943
  * No description
18968
18944
  *
@@ -18972,16 +18948,20 @@ export class Api<
18972
18948
  * @request PUT:/api/loans/{loanId}/signing-method
18973
18949
  * @secure
18974
18950
  * @response `204` `void` No Content
18951
+ * @response `400` `ProblemDetails` Bad Request
18975
18952
  * @response `403` `ProblemDetails` Forbidden
18976
18953
  * @response `404` `ProblemDetails` Not Found
18977
18954
  * @response `422` `ProblemDetails` Unprocessable Content
18955
+ * @response `423` `ProblemDetails` Locked
18956
+ * @response `429` `ProblemDetails` Too Many Requests
18957
+ * @response `504` `void` Gateway Timeout
18978
18958
  */
18979
18959
  updateLoanSigningMethod: (
18980
18960
  loanId: string,
18981
18961
  data: UpdateLoanSigningMethodRequest,
18982
18962
  params: RequestParams = {},
18983
18963
  ) =>
18984
- this.request<void, ProblemDetails>({
18964
+ this.request<void, ProblemDetails | void>({
18985
18965
  path: `/api/loans/${loanId}/signing-method`,
18986
18966
  method: "PUT",
18987
18967
  body: data,
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
+ }