@matech/thebigpos-sdk 3.28.0-main-8476 → 3.29.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.28.0-main-8476",
3
+ "version": "3.29.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": "8361d7b583d417c35a6cfe67414057bd29adf98e11084504c6616b1981e9096c"
39
+ "swaggerSha256": "8ec54dadaa4052cd5f60c1a51f6f1048aab11fab0dabebf4351afd7350ae2823"
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
@@ -825,6 +825,8 @@ export type AddressFamily =
825
825
  | "ControllerAreaNetwork"
826
826
  | "Unknown";
827
827
 
828
+ export type AccountPartnerStatus = "Active" | "Invited";
829
+
828
830
  export type CanvasWidgetConfig = BaseCanvasWidgetConfig &
829
831
  (
830
832
  | BaseCanvasWidgetConfigTypeMapping<"Information", InformationWidgetConfig>
@@ -937,6 +939,32 @@ export interface AccountFailureCount {
937
939
  count: number;
938
940
  }
939
941
 
942
+ export interface AccountPartner {
943
+ /** @format uuid */
944
+ partnerProfileID?: string | null;
945
+ /** @format uuid */
946
+ partnerID?: string | null;
947
+ firstName: string;
948
+ lastName: string;
949
+ email: string;
950
+ phone?: string | null;
951
+ status: AccountPartnerStatusEnum;
952
+ tier: AccountPartnerTierEnum;
953
+ /** @format date-time */
954
+ createdAt: string;
955
+ }
956
+
957
+ export interface AccountPartnerPaginated {
958
+ rows: AccountPartner[];
959
+ pagination: Pagination;
960
+ /** @format int64 */
961
+ count: number;
962
+ }
963
+
964
+ export interface AccountPartnerSearchCriteria {
965
+ searchText?: string | null;
966
+ }
967
+
940
968
  export interface AccountSettings {
941
969
  isSmsEnabled: boolean;
942
970
  smsNumber?: string | null;
@@ -4038,6 +4066,8 @@ export interface LoanApplicationRequest {
4038
4066
  userID: string;
4039
4067
  /** @format uuid */
4040
4068
  siteConfigurationID: string;
4069
+ /** @format uuid */
4070
+ submissionKey?: string | null;
4041
4071
  loanOfficerEmail?: string | null;
4042
4072
  purpose?: LoanPurpose | null;
4043
4073
  referrer?: string | null;
@@ -6324,6 +6354,17 @@ export interface MyPartner {
6324
6354
  createdAt: string;
6325
6355
  }
6326
6356
 
6357
+ export interface MyPartnerPaginated {
6358
+ rows: MyPartner[];
6359
+ pagination: Pagination;
6360
+ /** @format int64 */
6361
+ count: number;
6362
+ }
6363
+
6364
+ export interface MyPartnerSearchCriteria {
6365
+ searchText?: string | null;
6366
+ }
6367
+
6327
6368
  export type MyTasksWidgetConfig = UtilRequiredKeys<
6328
6369
  BaseCanvasWidgetConfig,
6329
6370
  "type"
@@ -8223,6 +8264,13 @@ export interface UpdatePartnerPortalRequest {
8223
8264
  isEnabled?: boolean | null;
8224
8265
  }
8225
8266
 
8267
+ export interface UpdatePartnerRequest {
8268
+ firstName: string;
8269
+ lastName: string;
8270
+ email: string;
8271
+ phone?: string | null;
8272
+ }
8273
+
8226
8274
  export interface UpdateUserGroupRequest {
8227
8275
  name: string;
8228
8276
  description?: string | null;
@@ -8826,6 +8874,10 @@ type BaseCanvasWidgetConfigTypeMapping<Key, Type> = {
8826
8874
 
8827
8875
  export type AccountBillingRequestBillingTypeEnum = "ClosedLoan" | "LoanOfficer";
8828
8876
 
8877
+ export type AccountPartnerStatusEnum = "Active" | "Invited";
8878
+
8879
+ export type AccountPartnerTierEnum = "Lite" | "LitePlusPortal" | "Pending";
8880
+
8829
8881
  export type AdminAccessUserMfaFactorEnum = "None" | "Sms" | "Email";
8830
8882
 
8831
8883
  export type AiAccessReadAloudVoiceEnum =
@@ -10152,15 +10204,7 @@ export class HttpClient<SecurityDataType = unknown> {
10152
10204
  property instanceof Array ? property : [property];
10153
10205
 
10154
10206
  for (const formItem of propertyContent) {
10155
- // React Native files are plain { uri, name, type } objects, not Blob/File.
10156
- const isReactNativeFile =
10157
- !!formItem &&
10158
- typeof formItem === "object" &&
10159
- "uri" in formItem &&
10160
- "name" in formItem &&
10161
- "type" in formItem;
10162
- const isFileType =
10163
- isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
10207
+ const isFileType = formItem instanceof Blob || formItem instanceof File;
10164
10208
  formData.append(
10165
10209
  key,
10166
10210
  isFileType ? formItem : this.stringifyFormItem(formItem),
@@ -10222,7 +10266,7 @@ export class HttpClient<SecurityDataType = unknown> {
10222
10266
 
10223
10267
  /**
10224
10268
  * @title The Big POS API
10225
- * @version v3.28.0
10269
+ * @version v3.29.0
10226
10270
  * @termsOfService https://www.thebigpos.com/terms-of-use/
10227
10271
  * @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
10228
10272
  */
@@ -10354,6 +10398,141 @@ export class Api<
10354
10398
  ...params,
10355
10399
  }),
10356
10400
 
10401
+ /**
10402
+ * @description Every partner of the caller's account: Realtors with an account and pending partners who have not signed up yet
10403
+ *
10404
+ * @tags AccountPartners
10405
+ * @name SearchAccountPartners
10406
+ * @summary Search Account Partners
10407
+ * @request POST:/api/account/partners/search
10408
+ * @secure
10409
+ * @response `200` `AccountPartnerPaginated` OK
10410
+ * @response `400` `ProblemDetails` Bad Request
10411
+ * @response `403` `ProblemDetails` Forbidden
10412
+ * @response `422` `ProblemDetails` Unprocessable Content
10413
+ */
10414
+ searchAccountPartners: (
10415
+ data: AccountPartnerSearchCriteria,
10416
+ query?: {
10417
+ /** @format int32 */
10418
+ pageSize?: number;
10419
+ /** @format int32 */
10420
+ pageNumber?: number;
10421
+ sortBy?: string;
10422
+ sortDirection?: string;
10423
+ },
10424
+ params: RequestParams = {},
10425
+ ) =>
10426
+ this.request<AccountPartnerPaginated, ProblemDetails>({
10427
+ path: `/api/account/partners/search`,
10428
+ method: "POST",
10429
+ query: query,
10430
+ body: data,
10431
+ secure: true,
10432
+ type: "application/json",
10433
+ format: "json",
10434
+ ...params,
10435
+ }),
10436
+
10437
+ /**
10438
+ * @description Makes a settlement agent, by user ID or by an open invite's ID, a partner with no loan officer
10439
+ *
10440
+ * @tags AccountPartners
10441
+ * @name PromotePartner
10442
+ * @summary Promote To Partner
10443
+ * @request POST:/api/account/partners/promotions
10444
+ * @secure
10445
+ * @response `200` `PromotePartner` OK
10446
+ * @response `400` `ProblemDetails` Bad Request
10447
+ * @response `403` `ProblemDetails` Forbidden
10448
+ * @response `404` `ProblemDetails` Not Found
10449
+ * @response `409` `ProblemDetails` Conflict
10450
+ * @response `422` `ProblemDetails` Unprocessable Content
10451
+ */
10452
+ promotePartner: (data: PromotePartnerRequest, params: RequestParams = {}) =>
10453
+ this.request<PromotePartner, ProblemDetails>({
10454
+ path: `/api/account/partners/promotions`,
10455
+ method: "POST",
10456
+ body: data,
10457
+ secure: true,
10458
+ type: "application/json",
10459
+ format: "json",
10460
+ ...params,
10461
+ }),
10462
+
10463
+ /**
10464
+ * @description Changes a registered partner's name, sign-in email and phone
10465
+ *
10466
+ * @tags AccountPartners
10467
+ * @name ReplacePartner
10468
+ * @summary Replace Partner
10469
+ * @request PUT:/api/account/partners/{partnerProfileId}
10470
+ * @secure
10471
+ * @response `204` `void` No Content
10472
+ * @response `403` `ProblemDetails` Forbidden
10473
+ * @response `404` `ProblemDetails` Not Found
10474
+ * @response `409` `ProblemDetails` Conflict
10475
+ * @response `422` `ProblemDetails` Unprocessable Content
10476
+ */
10477
+ replacePartner: (
10478
+ partnerProfileId: string,
10479
+ data: UpdatePartnerRequest,
10480
+ params: RequestParams = {},
10481
+ ) =>
10482
+ this.request<void, ProblemDetails>({
10483
+ path: `/api/account/partners/${partnerProfileId}`,
10484
+ method: "PUT",
10485
+ body: data,
10486
+ secure: true,
10487
+ type: "application/json",
10488
+ ...params,
10489
+ }),
10490
+
10491
+ /**
10492
+ * @description Makes a registered partner a settlement agent again and retires their partner profile; their account and loans stay
10493
+ *
10494
+ * @tags AccountPartners
10495
+ * @name DemotePartner
10496
+ * @summary Demote Partner
10497
+ * @request POST:/api/account/partners/{partnerProfileId}/demote
10498
+ * @secure
10499
+ * @response `204` `void` No Content
10500
+ * @response `403` `ProblemDetails` Forbidden
10501
+ * @response `404` `ProblemDetails` Not Found
10502
+ * @response `409` `ProblemDetails` Conflict
10503
+ */
10504
+ demotePartner: (partnerProfileId: string, params: RequestParams = {}) =>
10505
+ this.request<void, ProblemDetails>({
10506
+ path: `/api/account/partners/${partnerProfileId}/demote`,
10507
+ method: "POST",
10508
+ secure: true,
10509
+ ...params,
10510
+ }),
10511
+
10512
+ /**
10513
+ * @description Cancels a pending partner's invites and retires their partner profile; inviting the email again restores it
10514
+ *
10515
+ * @tags AccountPartners
10516
+ * @name CancelPartnerInvite
10517
+ * @summary Cancel Partner Invite
10518
+ * @request POST:/api/account/partners/{partnerProfileId}/cancel
10519
+ * @secure
10520
+ * @response `204` `void` No Content
10521
+ * @response `403` `ProblemDetails` Forbidden
10522
+ * @response `404` `ProblemDetails` Not Found
10523
+ * @response `409` `ProblemDetails` Conflict
10524
+ */
10525
+ cancelPartnerInvite: (
10526
+ partnerProfileId: string,
10527
+ params: RequestParams = {},
10528
+ ) =>
10529
+ this.request<void, ProblemDetails>({
10530
+ path: `/api/account/partners/${partnerProfileId}/cancel`,
10531
+ method: "POST",
10532
+ secure: true,
10533
+ ...params,
10534
+ }),
10535
+
10357
10536
  /**
10358
10537
  * No description
10359
10538
  *
@@ -15642,6 +15821,7 @@ export class Api<
15642
15821
  * @request POST:/api/los/loan/application/internal
15643
15822
  * @secure
15644
15823
  * @response `200` `string` OK
15824
+ * @response `409` `ProblemDetails` Conflict
15645
15825
  * @response `422` `UnprocessableEntity` Unprocessable Content
15646
15826
  * @response `423` `UnprocessableEntity` Locked
15647
15827
  */
@@ -15653,7 +15833,7 @@ export class Api<
15653
15833
  },
15654
15834
  params: RequestParams = {},
15655
15835
  ) =>
15656
- this.request<string, UnprocessableEntity>({
15836
+ this.request<string, ProblemDetails | UnprocessableEntity>({
15657
15837
  path: `/api/los/loan/application/internal`,
15658
15838
  method: "POST",
15659
15839
  query: query,
@@ -18398,6 +18578,7 @@ export class Api<
18398
18578
  * @response `401` `ProblemDetails` Unauthorized
18399
18579
  * @response `403` `ProblemDetails` Forbidden
18400
18580
  * @response `404` `ProblemDetails` Not Found
18581
+ * @response `409` `ProblemDetails` Conflict
18401
18582
  */
18402
18583
  createLoanv3: (
18403
18584
  data: LoanApplicationRequest,
@@ -23131,6 +23312,41 @@ export class Api<
23131
23312
  ...params,
23132
23313
  }),
23133
23314
 
23315
+ /**
23316
+ * @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
23317
+ *
23318
+ * @tags UsersMe
23319
+ * @name SearchMyPartners
23320
+ * @summary Search My Partners
23321
+ * @request POST:/api/users/me/partners/search
23322
+ * @secure
23323
+ * @response `200` `MyPartnerPaginated` OK
23324
+ * @response `400` `ProblemDetails` Bad Request
23325
+ * @response `403` `ProblemDetails` Forbidden
23326
+ */
23327
+ searchMyPartners: (
23328
+ data: MyPartnerSearchCriteria,
23329
+ query?: {
23330
+ /** @format int32 */
23331
+ pageSize?: number;
23332
+ /** @format int32 */
23333
+ pageNumber?: number;
23334
+ sortBy?: string;
23335
+ sortDirection?: string;
23336
+ },
23337
+ params: RequestParams = {},
23338
+ ) =>
23339
+ this.request<MyPartnerPaginated, ProblemDetails>({
23340
+ path: `/api/users/me/partners/search`,
23341
+ method: "POST",
23342
+ query: query,
23343
+ body: data,
23344
+ secure: true,
23345
+ type: "application/json",
23346
+ format: "json",
23347
+ ...params,
23348
+ }),
23349
+
23134
23350
  /**
23135
23351
  * @description Adds a partner, by partner profile ID, to the loan officer's list; a pending partner can be added too
23136
23352
  *
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
+ }