@matech/thebigpos-sdk 3.27.0 → 3.28.0-dev-8422

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.27.0",
3
+ "version": "3.28.0-dev-8422",
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": "1b9a12511f5e1d48d13a62145ba27118cc62f8043083bc09e835fe986be53ddb"
49
+ "resolutions": {
50
+ "brace-expansion": "^5.0.12",
51
+ "follow-redirects": "^1.16.1"
52
+ },
53
+ "swaggerSha256": "3f398613e39f55237bc465e28c7e933254a8781933800a01fc06eb87e0be1218"
40
54
  }
package/src/index.ts CHANGED
@@ -6324,6 +6324,17 @@ export interface MyPartner {
6324
6324
  createdAt: string;
6325
6325
  }
6326
6326
 
6327
+ export interface MyPartnerPaginated {
6328
+ rows: MyPartner[];
6329
+ pagination: Pagination;
6330
+ /** @format int64 */
6331
+ count: number;
6332
+ }
6333
+
6334
+ export interface MyPartnerSearchCriteria {
6335
+ searchText?: string | null;
6336
+ }
6337
+
6327
6338
  export type MyTasksWidgetConfig = UtilRequiredKeys<
6328
6339
  BaseCanvasWidgetConfig,
6329
6340
  "type"
@@ -8223,6 +8234,13 @@ export interface UpdatePartnerPortalRequest {
8223
8234
  isEnabled?: boolean | null;
8224
8235
  }
8225
8236
 
8237
+ export interface UpdatePartnerRequest {
8238
+ firstName: string;
8239
+ lastName: string;
8240
+ email: string;
8241
+ phone?: string | null;
8242
+ }
8243
+
8226
8244
  export interface UpdateUserGroupRequest {
8227
8245
  name: string;
8228
8246
  description?: string | null;
@@ -10152,7 +10170,15 @@ export class HttpClient<SecurityDataType = unknown> {
10152
10170
  property instanceof Array ? property : [property];
10153
10171
 
10154
10172
  for (const formItem of propertyContent) {
10155
- const isFileType = formItem instanceof Blob || formItem instanceof File;
10173
+ // React Native files are plain { uri, name, type } objects, not Blob/File.
10174
+ const isReactNativeFile =
10175
+ !!formItem &&
10176
+ typeof formItem === "object" &&
10177
+ "uri" in formItem &&
10178
+ "name" in formItem &&
10179
+ "type" in formItem;
10180
+ const isFileType =
10181
+ isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
10156
10182
  formData.append(
10157
10183
  key,
10158
10184
  isFileType ? formItem : this.stringifyFormItem(formItem),
@@ -10214,7 +10240,7 @@ export class HttpClient<SecurityDataType = unknown> {
10214
10240
 
10215
10241
  /**
10216
10242
  * @title The Big POS API
10217
- * @version v3.27.0
10243
+ * @version v3.28.0
10218
10244
  * @termsOfService https://www.thebigpos.com/terms-of-use/
10219
10245
  * @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
10220
10246
  */
@@ -10346,6 +10372,105 @@ export class Api<
10346
10372
  ...params,
10347
10373
  }),
10348
10374
 
10375
+ /**
10376
+ * @description Makes a settlement agent, by user ID or by an open invite's ID, a partner with no loan officer
10377
+ *
10378
+ * @tags AccountPartners
10379
+ * @name PromotePartner
10380
+ * @summary Promote To Partner
10381
+ * @request POST:/api/account/partners/promotions
10382
+ * @secure
10383
+ * @response `200` `PromotePartner` OK
10384
+ * @response `400` `ProblemDetails` Bad Request
10385
+ * @response `403` `ProblemDetails` Forbidden
10386
+ * @response `404` `ProblemDetails` Not Found
10387
+ * @response `409` `ProblemDetails` Conflict
10388
+ * @response `422` `ProblemDetails` Unprocessable Content
10389
+ */
10390
+ promotePartner: (data: PromotePartnerRequest, params: RequestParams = {}) =>
10391
+ this.request<PromotePartner, ProblemDetails>({
10392
+ path: `/api/account/partners/promotions`,
10393
+ method: "POST",
10394
+ body: data,
10395
+ secure: true,
10396
+ type: "application/json",
10397
+ format: "json",
10398
+ ...params,
10399
+ }),
10400
+
10401
+ /**
10402
+ * @description Changes a registered partner's name, sign-in email and phone
10403
+ *
10404
+ * @tags AccountPartners
10405
+ * @name ReplacePartner
10406
+ * @summary Replace Partner
10407
+ * @request PUT:/api/account/partners/{partnerProfileId}
10408
+ * @secure
10409
+ * @response `204` `void` No Content
10410
+ * @response `403` `ProblemDetails` Forbidden
10411
+ * @response `404` `ProblemDetails` Not Found
10412
+ * @response `409` `ProblemDetails` Conflict
10413
+ * @response `422` `ProblemDetails` Unprocessable Content
10414
+ */
10415
+ replacePartner: (
10416
+ partnerProfileId: string,
10417
+ data: UpdatePartnerRequest,
10418
+ params: RequestParams = {},
10419
+ ) =>
10420
+ this.request<void, ProblemDetails>({
10421
+ path: `/api/account/partners/${partnerProfileId}`,
10422
+ method: "PUT",
10423
+ body: data,
10424
+ secure: true,
10425
+ type: "application/json",
10426
+ ...params,
10427
+ }),
10428
+
10429
+ /**
10430
+ * @description Makes a registered partner a settlement agent again and retires their partner profile; their account and loans stay
10431
+ *
10432
+ * @tags AccountPartners
10433
+ * @name DemotePartner
10434
+ * @summary Demote Partner
10435
+ * @request POST:/api/account/partners/{partnerProfileId}/demote
10436
+ * @secure
10437
+ * @response `204` `void` No Content
10438
+ * @response `403` `ProblemDetails` Forbidden
10439
+ * @response `404` `ProblemDetails` Not Found
10440
+ * @response `409` `ProblemDetails` Conflict
10441
+ */
10442
+ demotePartner: (partnerProfileId: string, params: RequestParams = {}) =>
10443
+ this.request<void, ProblemDetails>({
10444
+ path: `/api/account/partners/${partnerProfileId}/demote`,
10445
+ method: "POST",
10446
+ secure: true,
10447
+ ...params,
10448
+ }),
10449
+
10450
+ /**
10451
+ * @description Cancels a pending partner's invites and retires their partner profile; inviting the email again restores it
10452
+ *
10453
+ * @tags AccountPartners
10454
+ * @name CancelPartnerInvite
10455
+ * @summary Cancel Partner Invite
10456
+ * @request POST:/api/account/partners/{partnerProfileId}/cancel
10457
+ * @secure
10458
+ * @response `204` `void` No Content
10459
+ * @response `403` `ProblemDetails` Forbidden
10460
+ * @response `404` `ProblemDetails` Not Found
10461
+ * @response `409` `ProblemDetails` Conflict
10462
+ */
10463
+ cancelPartnerInvite: (
10464
+ partnerProfileId: string,
10465
+ params: RequestParams = {},
10466
+ ) =>
10467
+ this.request<void, ProblemDetails>({
10468
+ path: `/api/account/partners/${partnerProfileId}/cancel`,
10469
+ method: "POST",
10470
+ secure: true,
10471
+ ...params,
10472
+ }),
10473
+
10349
10474
  /**
10350
10475
  * No description
10351
10476
  *
@@ -15808,6 +15933,7 @@ export class Api<
15808
15933
  * @secure
15809
15934
  * @response `200` `Draft` OK
15810
15935
  * @response `400` `ProblemDetails` Bad Request
15936
+ * @response `403` `ProblemDetails` Forbidden
15811
15937
  * @response `404` `ProblemDetails` Not Found
15812
15938
  * @response `423` `ProblemDetails` Locked
15813
15939
  */
@@ -23122,6 +23248,41 @@ export class Api<
23122
23248
  ...params,
23123
23249
  }),
23124
23250
 
23251
+ /**
23252
+ * @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
23253
+ *
23254
+ * @tags UsersMe
23255
+ * @name SearchMyPartners
23256
+ * @summary Search My Partners
23257
+ * @request POST:/api/users/me/partners/search
23258
+ * @secure
23259
+ * @response `200` `MyPartnerPaginated` OK
23260
+ * @response `400` `ProblemDetails` Bad Request
23261
+ * @response `403` `ProblemDetails` Forbidden
23262
+ */
23263
+ searchMyPartners: (
23264
+ data: MyPartnerSearchCriteria,
23265
+ query?: {
23266
+ /** @format int32 */
23267
+ pageSize?: number;
23268
+ /** @format int32 */
23269
+ pageNumber?: number;
23270
+ sortBy?: string;
23271
+ sortDirection?: string;
23272
+ },
23273
+ params: RequestParams = {},
23274
+ ) =>
23275
+ this.request<MyPartnerPaginated, ProblemDetails>({
23276
+ path: `/api/users/me/partners/search`,
23277
+ method: "POST",
23278
+ query: query,
23279
+ body: data,
23280
+ secure: true,
23281
+ type: "application/json",
23282
+ format: "json",
23283
+ ...params,
23284
+ }),
23285
+
23125
23286
  /**
23126
23287
  * @description Adds a partner, by partner profile ID, to the loan officer's list; a pending partner can be added too
23127
23288
  *
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
- }