@matech/thebigpos-sdk 3.28.0 → 3.29.0-dev-8529

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,12 +1,19 @@
1
1
  {
2
2
  "name": "@matech/thebigpos-sdk",
3
- "version": "3.28.0",
3
+ "version": "3.29.0-dev-8529",
4
4
  "description": "The Big POS Typescript SDK",
5
- "main": "dist/index.js",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "react-native": "dist/index.js",
6
8
  "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "src",
12
+ "index.js"
13
+ ],
7
14
  "scripts": {
8
- "build": "rimraf dist && tsc",
9
- "test": "mocha -r ts-node/register 'src/api_test.spec.ts' --exit",
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) }\"",
10
17
  "browserify": "tsc && esbuild dist/index.js --bundle --minify --sourcemap --global-name=thebigpos --outfile=dist/thebigpos.min.js",
11
18
  "prepare": "husky"
12
19
  },
@@ -26,15 +33,22 @@
26
33
  "url": "https://github.com/MortgageAutomationTechnologies/thebigpos-sdk-typescript/issues"
27
34
  },
28
35
  "homepage": "https://github.com/MortgageAutomationTechnologies/thebigpos-sdk-typescript#readme",
29
- "dependencies": {
30
- "axios": "^1.7.7"
36
+ "engines": {
37
+ "node": ">=18"
38
+ },
39
+ "peerDependencies": {
40
+ "axios": "^1"
31
41
  },
32
42
  "devDependencies": {
33
- "esbuild": "^0.27.0",
43
+ "axios": "^1.20.0",
44
+ "esbuild": "^0.28.1",
34
45
  "husky": "^9.1.5",
35
- "rimraf": "6.1.1",
36
- "ts-node": "^10.9.2",
46
+ "rimraf": "6.1.4",
37
47
  "typescript": "^5.5.4"
38
48
  },
39
- "swaggerSha256": "8361d7b583d417c35a6cfe67414057bd29adf98e11084504c6616b1981e9096c"
49
+ "resolutions": {
50
+ "brace-expansion": "^5.0.12",
51
+ "follow-redirects": "^1.16.1"
52
+ },
53
+ "swaggerSha256": "1fa4b71673eb2b9b28b329579057c3d8164b2d868312a731fe759e16001f93c8"
40
54
  }
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
 
@@ -825,6 +831,8 @@ export type AddressFamily =
825
831
  | "ControllerAreaNetwork"
826
832
  | "Unknown";
827
833
 
834
+ export type AccountPartnerStatus = "Active" | "Invited";
835
+
828
836
  export type CanvasWidgetConfig = BaseCanvasWidgetConfig &
829
837
  (
830
838
  | BaseCanvasWidgetConfigTypeMapping<"Information", InformationWidgetConfig>
@@ -937,6 +945,32 @@ export interface AccountFailureCount {
937
945
  count: number;
938
946
  }
939
947
 
948
+ export interface AccountPartner {
949
+ /** @format uuid */
950
+ partnerProfileID?: string | null;
951
+ /** @format uuid */
952
+ partnerID?: string | null;
953
+ firstName: string;
954
+ lastName: string;
955
+ email: string;
956
+ phone?: string | null;
957
+ status: AccountPartnerStatusEnum;
958
+ tier: AccountPartnerTierEnum;
959
+ /** @format date-time */
960
+ createdAt: string;
961
+ }
962
+
963
+ export interface AccountPartnerPaginated {
964
+ rows: AccountPartner[];
965
+ pagination: Pagination;
966
+ /** @format int64 */
967
+ count: number;
968
+ }
969
+
970
+ export interface AccountPartnerSearchCriteria {
971
+ searchText?: string | null;
972
+ }
973
+
940
974
  export interface AccountSettings {
941
975
  isSmsEnabled: boolean;
942
976
  smsNumber?: string | null;
@@ -4038,8 +4072,11 @@ export interface LoanApplicationRequest {
4038
4072
  userID: string;
4039
4073
  /** @format uuid */
4040
4074
  siteConfigurationID: string;
4075
+ /** @format uuid */
4076
+ submissionKey?: string | null;
4041
4077
  loanOfficerEmail?: string | null;
4042
4078
  purpose?: LoanPurpose | null;
4079
+ type?: LoanType | null;
4043
4080
  referrer?: string | null;
4044
4081
  companyName?: string | null;
4045
4082
  relationship?: BorrowerRelationship | null;
@@ -6324,6 +6361,17 @@ export interface MyPartner {
6324
6361
  createdAt: string;
6325
6362
  }
6326
6363
 
6364
+ export interface MyPartnerPaginated {
6365
+ rows: MyPartner[];
6366
+ pagination: Pagination;
6367
+ /** @format int64 */
6368
+ count: number;
6369
+ }
6370
+
6371
+ export interface MyPartnerSearchCriteria {
6372
+ searchText?: string | null;
6373
+ }
6374
+
6327
6375
  export type MyTasksWidgetConfig = UtilRequiredKeys<
6328
6376
  BaseCanvasWidgetConfig,
6329
6377
  "type"
@@ -8223,6 +8271,13 @@ export interface UpdatePartnerPortalRequest {
8223
8271
  isEnabled?: boolean | null;
8224
8272
  }
8225
8273
 
8274
+ export interface UpdatePartnerRequest {
8275
+ firstName: string;
8276
+ lastName: string;
8277
+ email: string;
8278
+ phone?: string | null;
8279
+ }
8280
+
8226
8281
  export interface UpdateUserGroupRequest {
8227
8282
  name: string;
8228
8283
  description?: string | null;
@@ -8826,6 +8881,10 @@ type BaseCanvasWidgetConfigTypeMapping<Key, Type> = {
8826
8881
 
8827
8882
  export type AccountBillingRequestBillingTypeEnum = "ClosedLoan" | "LoanOfficer";
8828
8883
 
8884
+ export type AccountPartnerStatusEnum = "Active" | "Invited";
8885
+
8886
+ export type AccountPartnerTierEnum = "Lite" | "LitePlusPortal" | "Pending";
8887
+
8829
8888
  export type AdminAccessUserMfaFactorEnum = "None" | "Sms" | "Email";
8830
8889
 
8831
8890
  export type AiAccessReadAloudVoiceEnum =
@@ -10152,7 +10211,15 @@ export class HttpClient<SecurityDataType = unknown> {
10152
10211
  property instanceof Array ? property : [property];
10153
10212
 
10154
10213
  for (const formItem of propertyContent) {
10155
- const isFileType = formItem instanceof Blob || formItem instanceof File;
10214
+ // React Native files are plain { uri, name, type } objects, not Blob/File.
10215
+ const isReactNativeFile =
10216
+ !!formItem &&
10217
+ typeof formItem === "object" &&
10218
+ "uri" in formItem &&
10219
+ "name" in formItem &&
10220
+ "type" in formItem;
10221
+ const isFileType =
10222
+ isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
10156
10223
  formData.append(
10157
10224
  key,
10158
10225
  isFileType ? formItem : this.stringifyFormItem(formItem),
@@ -10214,7 +10281,7 @@ export class HttpClient<SecurityDataType = unknown> {
10214
10281
 
10215
10282
  /**
10216
10283
  * @title The Big POS API
10217
- * @version v3.28.0
10284
+ * @version v3.29.0
10218
10285
  * @termsOfService https://www.thebigpos.com/terms-of-use/
10219
10286
  * @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
10220
10287
  */
@@ -10346,6 +10413,141 @@ export class Api<
10346
10413
  ...params,
10347
10414
  }),
10348
10415
 
10416
+ /**
10417
+ * @description Every partner of the caller's account: Realtors with an account and pending partners who have not signed up yet
10418
+ *
10419
+ * @tags AccountPartners
10420
+ * @name SearchAccountPartners
10421
+ * @summary Search Account Partners
10422
+ * @request POST:/api/account/partners/search
10423
+ * @secure
10424
+ * @response `200` `AccountPartnerPaginated` OK
10425
+ * @response `400` `ProblemDetails` Bad Request
10426
+ * @response `403` `ProblemDetails` Forbidden
10427
+ * @response `422` `ProblemDetails` Unprocessable Content
10428
+ */
10429
+ searchAccountPartners: (
10430
+ data: AccountPartnerSearchCriteria,
10431
+ query?: {
10432
+ /** @format int32 */
10433
+ pageSize?: number;
10434
+ /** @format int32 */
10435
+ pageNumber?: number;
10436
+ sortBy?: string;
10437
+ sortDirection?: string;
10438
+ },
10439
+ params: RequestParams = {},
10440
+ ) =>
10441
+ this.request<AccountPartnerPaginated, ProblemDetails>({
10442
+ path: `/api/account/partners/search`,
10443
+ method: "POST",
10444
+ query: query,
10445
+ body: data,
10446
+ secure: true,
10447
+ type: "application/json",
10448
+ format: "json",
10449
+ ...params,
10450
+ }),
10451
+
10452
+ /**
10453
+ * @description Makes a settlement agent, by user ID or by an open invite's ID, a partner with no loan officer
10454
+ *
10455
+ * @tags AccountPartners
10456
+ * @name PromotePartner
10457
+ * @summary Promote To Partner
10458
+ * @request POST:/api/account/partners/promotions
10459
+ * @secure
10460
+ * @response `200` `PromotePartner` OK
10461
+ * @response `400` `ProblemDetails` Bad Request
10462
+ * @response `403` `ProblemDetails` Forbidden
10463
+ * @response `404` `ProblemDetails` Not Found
10464
+ * @response `409` `ProblemDetails` Conflict
10465
+ * @response `422` `ProblemDetails` Unprocessable Content
10466
+ */
10467
+ promotePartner: (data: PromotePartnerRequest, params: RequestParams = {}) =>
10468
+ this.request<PromotePartner, ProblemDetails>({
10469
+ path: `/api/account/partners/promotions`,
10470
+ method: "POST",
10471
+ body: data,
10472
+ secure: true,
10473
+ type: "application/json",
10474
+ format: "json",
10475
+ ...params,
10476
+ }),
10477
+
10478
+ /**
10479
+ * @description Changes a registered partner's name, sign-in email and phone
10480
+ *
10481
+ * @tags AccountPartners
10482
+ * @name ReplacePartner
10483
+ * @summary Replace Partner
10484
+ * @request PUT:/api/account/partners/{partnerProfileId}
10485
+ * @secure
10486
+ * @response `204` `void` No Content
10487
+ * @response `403` `ProblemDetails` Forbidden
10488
+ * @response `404` `ProblemDetails` Not Found
10489
+ * @response `409` `ProblemDetails` Conflict
10490
+ * @response `422` `ProblemDetails` Unprocessable Content
10491
+ */
10492
+ replacePartner: (
10493
+ partnerProfileId: string,
10494
+ data: UpdatePartnerRequest,
10495
+ params: RequestParams = {},
10496
+ ) =>
10497
+ this.request<void, ProblemDetails>({
10498
+ path: `/api/account/partners/${partnerProfileId}`,
10499
+ method: "PUT",
10500
+ body: data,
10501
+ secure: true,
10502
+ type: "application/json",
10503
+ ...params,
10504
+ }),
10505
+
10506
+ /**
10507
+ * @description Makes a registered partner a settlement agent again and retires their partner profile; their account and loans stay
10508
+ *
10509
+ * @tags AccountPartners
10510
+ * @name DemotePartner
10511
+ * @summary Demote Partner
10512
+ * @request POST:/api/account/partners/{partnerProfileId}/demote
10513
+ * @secure
10514
+ * @response `204` `void` No Content
10515
+ * @response `403` `ProblemDetails` Forbidden
10516
+ * @response `404` `ProblemDetails` Not Found
10517
+ * @response `409` `ProblemDetails` Conflict
10518
+ */
10519
+ demotePartner: (partnerProfileId: string, params: RequestParams = {}) =>
10520
+ this.request<void, ProblemDetails>({
10521
+ path: `/api/account/partners/${partnerProfileId}/demote`,
10522
+ method: "POST",
10523
+ secure: true,
10524
+ ...params,
10525
+ }),
10526
+
10527
+ /**
10528
+ * @description Cancels a pending partner's invites and retires their partner profile; inviting the email again restores it
10529
+ *
10530
+ * @tags AccountPartners
10531
+ * @name CancelPartnerInvite
10532
+ * @summary Cancel Partner Invite
10533
+ * @request POST:/api/account/partners/{partnerProfileId}/cancel
10534
+ * @secure
10535
+ * @response `204` `void` No Content
10536
+ * @response `403` `ProblemDetails` Forbidden
10537
+ * @response `404` `ProblemDetails` Not Found
10538
+ * @response `409` `ProblemDetails` Conflict
10539
+ */
10540
+ cancelPartnerInvite: (
10541
+ partnerProfileId: string,
10542
+ params: RequestParams = {},
10543
+ ) =>
10544
+ this.request<void, ProblemDetails>({
10545
+ path: `/api/account/partners/${partnerProfileId}/cancel`,
10546
+ method: "POST",
10547
+ secure: true,
10548
+ ...params,
10549
+ }),
10550
+
10349
10551
  /**
10350
10552
  * No description
10351
10553
  *
@@ -15634,6 +15836,7 @@ export class Api<
15634
15836
  * @request POST:/api/los/loan/application/internal
15635
15837
  * @secure
15636
15838
  * @response `200` `string` OK
15839
+ * @response `409` `ProblemDetails` Conflict
15637
15840
  * @response `422` `UnprocessableEntity` Unprocessable Content
15638
15841
  * @response `423` `UnprocessableEntity` Locked
15639
15842
  */
@@ -15645,7 +15848,7 @@ export class Api<
15645
15848
  },
15646
15849
  params: RequestParams = {},
15647
15850
  ) =>
15648
- this.request<string, UnprocessableEntity>({
15851
+ this.request<string, ProblemDetails | UnprocessableEntity>({
15649
15852
  path: `/api/los/loan/application/internal`,
15650
15853
  method: "POST",
15651
15854
  query: query,
@@ -18390,6 +18593,7 @@ export class Api<
18390
18593
  * @response `401` `ProblemDetails` Unauthorized
18391
18594
  * @response `403` `ProblemDetails` Forbidden
18392
18595
  * @response `404` `ProblemDetails` Not Found
18596
+ * @response `409` `ProblemDetails` Conflict
18393
18597
  */
18394
18598
  createLoanv3: (
18395
18599
  data: LoanApplicationRequest,
@@ -23123,6 +23327,41 @@ export class Api<
23123
23327
  ...params,
23124
23328
  }),
23125
23329
 
23330
+ /**
23331
+ * @description Searches the rows getMyPartners returns by first name, last name, full name or email, and pages them. Sorts by firstName, lastName, email, tier or createdAt when both sortBy and sortDirection are given, else newest first
23332
+ *
23333
+ * @tags UsersMe
23334
+ * @name SearchMyPartners
23335
+ * @summary Search My Partners
23336
+ * @request POST:/api/users/me/partners/search
23337
+ * @secure
23338
+ * @response `200` `MyPartnerPaginated` OK
23339
+ * @response `400` `ProblemDetails` Bad Request
23340
+ * @response `403` `ProblemDetails` Forbidden
23341
+ */
23342
+ searchMyPartners: (
23343
+ data: MyPartnerSearchCriteria,
23344
+ query?: {
23345
+ /** @format int32 */
23346
+ pageSize?: number;
23347
+ /** @format int32 */
23348
+ pageNumber?: number;
23349
+ sortBy?: string;
23350
+ sortDirection?: string;
23351
+ },
23352
+ params: RequestParams = {},
23353
+ ) =>
23354
+ this.request<MyPartnerPaginated, ProblemDetails>({
23355
+ path: `/api/users/me/partners/search`,
23356
+ method: "POST",
23357
+ query: query,
23358
+ body: data,
23359
+ secure: true,
23360
+ type: "application/json",
23361
+ format: "json",
23362
+ ...params,
23363
+ }),
23364
+
23126
23365
  /**
23127
23366
  * @description Adds a partner, by partner profile ID, to the loan officer's list; a pending partner can be added too
23128
23367
  *
package/.husky/pre-commit DELETED
@@ -1,3 +0,0 @@
1
- [ -f ./src/index.ts ] && node scripts/apply-json-patch-content-type.js
2
- yarn build
3
- git add .
@@ -1,56 +0,0 @@
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/tsconfig.json DELETED
@@ -1,27 +0,0 @@
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
- }