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

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-8410",
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": "e26f4cce9ace29fed3eb03fd1a7d2e19d2766088ff3fe0b4c2b20cc05eed74f8"
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"
@@ -10152,7 +10163,15 @@ export class HttpClient<SecurityDataType = unknown> {
10152
10163
  property instanceof Array ? property : [property];
10153
10164
 
10154
10165
  for (const formItem of propertyContent) {
10155
- const isFileType = formItem instanceof Blob || formItem instanceof File;
10166
+ // React Native files are plain { uri, name, type } objects, not Blob/File.
10167
+ const isReactNativeFile =
10168
+ !!formItem &&
10169
+ typeof formItem === "object" &&
10170
+ "uri" in formItem &&
10171
+ "name" in formItem &&
10172
+ "type" in formItem;
10173
+ const isFileType =
10174
+ isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
10156
10175
  formData.append(
10157
10176
  key,
10158
10177
  isFileType ? formItem : this.stringifyFormItem(formItem),
@@ -10214,7 +10233,7 @@ export class HttpClient<SecurityDataType = unknown> {
10214
10233
 
10215
10234
  /**
10216
10235
  * @title The Big POS API
10217
- * @version v3.27.0
10236
+ * @version v3.28.0
10218
10237
  * @termsOfService https://www.thebigpos.com/terms-of-use/
10219
10238
  * @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
10220
10239
  */
@@ -15808,6 +15827,7 @@ export class Api<
15808
15827
  * @secure
15809
15828
  * @response `200` `Draft` OK
15810
15829
  * @response `400` `ProblemDetails` Bad Request
15830
+ * @response `403` `ProblemDetails` Forbidden
15811
15831
  * @response `404` `ProblemDetails` Not Found
15812
15832
  * @response `423` `ProblemDetails` Locked
15813
15833
  */
@@ -23122,6 +23142,41 @@ export class Api<
23122
23142
  ...params,
23123
23143
  }),
23124
23144
 
23145
+ /**
23146
+ * @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
23147
+ *
23148
+ * @tags UsersMe
23149
+ * @name SearchMyPartners
23150
+ * @summary Search My Partners
23151
+ * @request POST:/api/users/me/partners/search
23152
+ * @secure
23153
+ * @response `200` `MyPartnerPaginated` OK
23154
+ * @response `400` `ProblemDetails` Bad Request
23155
+ * @response `403` `ProblemDetails` Forbidden
23156
+ */
23157
+ searchMyPartners: (
23158
+ data: MyPartnerSearchCriteria,
23159
+ query?: {
23160
+ /** @format int32 */
23161
+ pageSize?: number;
23162
+ /** @format int32 */
23163
+ pageNumber?: number;
23164
+ sortBy?: string;
23165
+ sortDirection?: string;
23166
+ },
23167
+ params: RequestParams = {},
23168
+ ) =>
23169
+ this.request<MyPartnerPaginated, ProblemDetails>({
23170
+ path: `/api/users/me/partners/search`,
23171
+ method: "POST",
23172
+ query: query,
23173
+ body: data,
23174
+ secure: true,
23175
+ type: "application/json",
23176
+ format: "json",
23177
+ ...params,
23178
+ }),
23179
+
23125
23180
  /**
23126
23181
  * @description Adds a partner, by partner profile ID, to the loan officer's list; a pending partner can be added too
23127
23182
  *
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
- }