@matech/thebigpos-sdk 3.22.0 → 3.23.0-dev-7390
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/README.md +39 -0
- package/dist/index.cjs +6452 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +521 -631
- package/dist/index.js +8 -75
- package/dist/index.js.map +1 -1
- package/index.js +1 -1
- package/package.json +24 -10
- package/src/index.ts +11 -174
- package/.husky/pre-commit +0 -3
- package/scripts/apply-json-patch-content-type.js +0 -56
- package/tsconfig.json +0 -27
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matech/thebigpos-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.23.0-dev-7390",
|
|
4
4
|
"description": "The Big POS Typescript SDK",
|
|
5
|
-
"main": "dist/index.
|
|
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
|
-
"
|
|
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
|
-
"
|
|
30
|
-
"
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"axios": "^1"
|
|
31
41
|
},
|
|
32
42
|
"devDependencies": {
|
|
33
|
-
"
|
|
43
|
+
"axios": "^1.20.0",
|
|
44
|
+
"esbuild": "^0.28.1",
|
|
34
45
|
"husky": "^9.1.5",
|
|
35
|
-
"rimraf": "6.1.
|
|
36
|
-
"ts-node": "^10.9.2",
|
|
46
|
+
"rimraf": "6.1.3",
|
|
37
47
|
"typescript": "^5.5.4"
|
|
38
48
|
},
|
|
39
|
-
"
|
|
49
|
+
"resolutions": {
|
|
50
|
+
"brace-expansion": "^5.0.12",
|
|
51
|
+
"follow-redirects": "^1.16.1"
|
|
52
|
+
},
|
|
53
|
+
"swaggerSha256": "224eeb9fbfe774cc390fb25a4a18112127be4908677d123b123c95ce85482730"
|
|
40
54
|
}
|
package/src/index.ts
CHANGED
|
@@ -1203,30 +1203,6 @@ export interface AiAuditLogPaginated {
|
|
|
1203
1203
|
count: number;
|
|
1204
1204
|
}
|
|
1205
1205
|
|
|
1206
|
-
export interface AiCanonicalField {
|
|
1207
|
-
/** @format uuid */
|
|
1208
|
-
id: string;
|
|
1209
|
-
canonicalName: string;
|
|
1210
|
-
displayName: string;
|
|
1211
|
-
description: string;
|
|
1212
|
-
allowedRoles: string[];
|
|
1213
|
-
efPath?: string | null;
|
|
1214
|
-
isPii: boolean;
|
|
1215
|
-
isActive: boolean;
|
|
1216
|
-
dataSource: string;
|
|
1217
|
-
isDefault: boolean;
|
|
1218
|
-
category?: string | null;
|
|
1219
|
-
jsonPropertyName?: string | null;
|
|
1220
|
-
hasAccountOverride: boolean;
|
|
1221
|
-
writable: boolean;
|
|
1222
|
-
patchPath?: string | null;
|
|
1223
|
-
/** @format date-time */
|
|
1224
|
-
createdAt: string;
|
|
1225
|
-
/** @format date-time */
|
|
1226
|
-
updatedAt?: string | null;
|
|
1227
|
-
updatedBy?: AiUpdatedBy | null;
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
1206
|
export interface AiChat {
|
|
1231
1207
|
/** @format uuid */
|
|
1232
1208
|
conversationId: string;
|
|
@@ -2482,14 +2458,6 @@ export interface CreateAccountRequest {
|
|
|
2482
2458
|
billingSettings: AccountBillingRequest;
|
|
2483
2459
|
}
|
|
2484
2460
|
|
|
2485
|
-
export interface CreateAiCanonicalFieldRequest {
|
|
2486
|
-
displayName: string;
|
|
2487
|
-
description: string;
|
|
2488
|
-
allowedRoles: string[];
|
|
2489
|
-
isPii: boolean;
|
|
2490
|
-
category?: string | null;
|
|
2491
|
-
}
|
|
2492
|
-
|
|
2493
2461
|
export interface CreateAiGuardrailRequest {
|
|
2494
2462
|
name: string;
|
|
2495
2463
|
category: CreateAiGuardrailRequestCategoryEnum;
|
|
@@ -7711,7 +7679,7 @@ export interface StandardLoanField {
|
|
|
7711
7679
|
mappings: LoanFieldMappings;
|
|
7712
7680
|
access: Record<string, CustomFieldAccessLevel>;
|
|
7713
7681
|
isCustomized: boolean;
|
|
7714
|
-
isAiEnabled
|
|
7682
|
+
isAiEnabled: boolean;
|
|
7715
7683
|
}
|
|
7716
7684
|
|
|
7717
7685
|
export interface SupportedModel {
|
|
@@ -8005,14 +7973,6 @@ export interface UpdateAiAccountTokenLimitRequest {
|
|
|
8005
7973
|
tokenLimit: number;
|
|
8006
7974
|
}
|
|
8007
7975
|
|
|
8008
|
-
export interface UpdateAiCanonicalFieldRequest {
|
|
8009
|
-
displayName: string;
|
|
8010
|
-
description: string;
|
|
8011
|
-
allowedRoles: string[];
|
|
8012
|
-
isPii: boolean;
|
|
8013
|
-
category?: string | null;
|
|
8014
|
-
}
|
|
8015
|
-
|
|
8016
7976
|
export interface UpdateAiGuardrailRequest {
|
|
8017
7977
|
name: string;
|
|
8018
7978
|
category: UpdateAiGuardrailRequestCategoryEnum;
|
|
@@ -10041,7 +10001,15 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
10041
10001
|
property instanceof Array ? property : [property];
|
|
10042
10002
|
|
|
10043
10003
|
for (const formItem of propertyContent) {
|
|
10044
|
-
|
|
10004
|
+
// React Native files are plain { uri, name, type } objects, not Blob/File.
|
|
10005
|
+
const isReactNativeFile =
|
|
10006
|
+
!!formItem &&
|
|
10007
|
+
typeof formItem === "object" &&
|
|
10008
|
+
"uri" in formItem &&
|
|
10009
|
+
"name" in formItem &&
|
|
10010
|
+
"type" in formItem;
|
|
10011
|
+
const isFileType =
|
|
10012
|
+
isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
|
|
10045
10013
|
formData.append(
|
|
10046
10014
|
key,
|
|
10047
10015
|
isFileType ? formItem : this.stringifyFormItem(formItem),
|
|
@@ -10103,7 +10071,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
10103
10071
|
|
|
10104
10072
|
/**
|
|
10105
10073
|
* @title The Big POS API
|
|
10106
|
-
* @version v3.
|
|
10074
|
+
* @version v3.23.0
|
|
10107
10075
|
* @termsOfService https://www.thebigpos.com/terms-of-use/
|
|
10108
10076
|
* @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
|
|
10109
10077
|
*/
|
|
@@ -10904,136 +10872,6 @@ export class Api<
|
|
|
10904
10872
|
...params,
|
|
10905
10873
|
}),
|
|
10906
10874
|
|
|
10907
|
-
/**
|
|
10908
|
-
* No description
|
|
10909
|
-
*
|
|
10910
|
-
* @tags AiCanonicalField
|
|
10911
|
-
* @name GetAiCanonicalFields
|
|
10912
|
-
* @summary Get all canonical fields
|
|
10913
|
-
* @request GET:/api/ai/canonical-fields
|
|
10914
|
-
* @secure
|
|
10915
|
-
* @response `200` `(AiCanonicalField)[]` OK
|
|
10916
|
-
*/
|
|
10917
|
-
getAiCanonicalFields: (params: RequestParams = {}) =>
|
|
10918
|
-
this.request<AiCanonicalField[], any>({
|
|
10919
|
-
path: `/api/ai/canonical-fields`,
|
|
10920
|
-
method: "GET",
|
|
10921
|
-
secure: true,
|
|
10922
|
-
format: "json",
|
|
10923
|
-
...params,
|
|
10924
|
-
}),
|
|
10925
|
-
|
|
10926
|
-
/**
|
|
10927
|
-
* No description
|
|
10928
|
-
*
|
|
10929
|
-
* @tags AiCanonicalField
|
|
10930
|
-
* @name CreateAiCanonicalField
|
|
10931
|
-
* @summary Create canonical field
|
|
10932
|
-
* @request POST:/api/ai/canonical-fields
|
|
10933
|
-
* @secure
|
|
10934
|
-
* @response `201` `AiCanonicalField` Created
|
|
10935
|
-
* @response `400` `ProblemDetails` Bad Request
|
|
10936
|
-
*/
|
|
10937
|
-
createAiCanonicalField: (
|
|
10938
|
-
data: CreateAiCanonicalFieldRequest,
|
|
10939
|
-
params: RequestParams = {},
|
|
10940
|
-
) =>
|
|
10941
|
-
this.request<AiCanonicalField, ProblemDetails>({
|
|
10942
|
-
path: `/api/ai/canonical-fields`,
|
|
10943
|
-
method: "POST",
|
|
10944
|
-
body: data,
|
|
10945
|
-
secure: true,
|
|
10946
|
-
type: "application/json",
|
|
10947
|
-
format: "json",
|
|
10948
|
-
...params,
|
|
10949
|
-
}),
|
|
10950
|
-
|
|
10951
|
-
/**
|
|
10952
|
-
* No description
|
|
10953
|
-
*
|
|
10954
|
-
* @tags AiCanonicalField
|
|
10955
|
-
* @name GetAiCanonicalField
|
|
10956
|
-
* @summary Get canonical field by ID
|
|
10957
|
-
* @request GET:/api/ai/canonical-fields/{id}
|
|
10958
|
-
* @secure
|
|
10959
|
-
* @response `200` `AiCanonicalField` OK
|
|
10960
|
-
* @response `404` `ProblemDetails` Not Found
|
|
10961
|
-
*/
|
|
10962
|
-
getAiCanonicalField: (id: string, params: RequestParams = {}) =>
|
|
10963
|
-
this.request<AiCanonicalField, ProblemDetails>({
|
|
10964
|
-
path: `/api/ai/canonical-fields/${id}`,
|
|
10965
|
-
method: "GET",
|
|
10966
|
-
secure: true,
|
|
10967
|
-
format: "json",
|
|
10968
|
-
...params,
|
|
10969
|
-
}),
|
|
10970
|
-
|
|
10971
|
-
/**
|
|
10972
|
-
* No description
|
|
10973
|
-
*
|
|
10974
|
-
* @tags AiCanonicalField
|
|
10975
|
-
* @name UpdateAiCanonicalField
|
|
10976
|
-
* @summary Update canonical field
|
|
10977
|
-
* @request PUT:/api/ai/canonical-fields/{id}
|
|
10978
|
-
* @secure
|
|
10979
|
-
* @response `200` `AiCanonicalField` OK
|
|
10980
|
-
* @response `400` `ProblemDetails` Bad Request
|
|
10981
|
-
* @response `404` `ProblemDetails` Not Found
|
|
10982
|
-
*/
|
|
10983
|
-
updateAiCanonicalField: (
|
|
10984
|
-
id: string,
|
|
10985
|
-
data: UpdateAiCanonicalFieldRequest,
|
|
10986
|
-
params: RequestParams = {},
|
|
10987
|
-
) =>
|
|
10988
|
-
this.request<AiCanonicalField, ProblemDetails>({
|
|
10989
|
-
path: `/api/ai/canonical-fields/${id}`,
|
|
10990
|
-
method: "PUT",
|
|
10991
|
-
body: data,
|
|
10992
|
-
secure: true,
|
|
10993
|
-
type: "application/json",
|
|
10994
|
-
format: "json",
|
|
10995
|
-
...params,
|
|
10996
|
-
}),
|
|
10997
|
-
|
|
10998
|
-
/**
|
|
10999
|
-
* No description
|
|
11000
|
-
*
|
|
11001
|
-
* @tags AiCanonicalField
|
|
11002
|
-
* @name DeleteAiCanonicalField
|
|
11003
|
-
* @summary Delete canonical field
|
|
11004
|
-
* @request DELETE:/api/ai/canonical-fields/{id}
|
|
11005
|
-
* @secure
|
|
11006
|
-
* @response `204` `void` No Content
|
|
11007
|
-
* @response `404` `ProblemDetails` Not Found
|
|
11008
|
-
*/
|
|
11009
|
-
deleteAiCanonicalField: (id: string, params: RequestParams = {}) =>
|
|
11010
|
-
this.request<void, ProblemDetails>({
|
|
11011
|
-
path: `/api/ai/canonical-fields/${id}`,
|
|
11012
|
-
method: "DELETE",
|
|
11013
|
-
secure: true,
|
|
11014
|
-
...params,
|
|
11015
|
-
}),
|
|
11016
|
-
|
|
11017
|
-
/**
|
|
11018
|
-
* No description
|
|
11019
|
-
*
|
|
11020
|
-
* @tags AiCanonicalField
|
|
11021
|
-
* @name ToggleAiCanonicalField
|
|
11022
|
-
* @summary Toggle canonical field active/inactive
|
|
11023
|
-
* @request PATCH:/api/ai/canonical-fields/{id}/toggle
|
|
11024
|
-
* @secure
|
|
11025
|
-
* @response `200` `AiCanonicalField` OK
|
|
11026
|
-
* @response `404` `ProblemDetails` Not Found
|
|
11027
|
-
*/
|
|
11028
|
-
toggleAiCanonicalField: (id: string, params: RequestParams = {}) =>
|
|
11029
|
-
this.request<AiCanonicalField, ProblemDetails>({
|
|
11030
|
-
path: `/api/ai/canonical-fields/${id}/toggle`,
|
|
11031
|
-
method: "PATCH",
|
|
11032
|
-
secure: true,
|
|
11033
|
-
format: "json",
|
|
11034
|
-
...params,
|
|
11035
|
-
}),
|
|
11036
|
-
|
|
11037
10875
|
/**
|
|
11038
10876
|
* No description
|
|
11039
10877
|
*
|
|
@@ -17425,7 +17263,6 @@ export class Api<
|
|
|
17425
17263
|
* @response `200` `BulkLoanFieldOperation` OK
|
|
17426
17264
|
* @response `401` `ProblemDetails` Unauthorized
|
|
17427
17265
|
* @response `403` `ProblemDetails` Forbidden
|
|
17428
|
-
* @response `404` `ProblemDetails` Not Found
|
|
17429
17266
|
* @response `422` `UnprocessableEntity` Unprocessable Content
|
|
17430
17267
|
*/
|
|
17431
17268
|
bulkLoanFieldOperation: (
|
package/.husky/pre-commit
DELETED
|
@@ -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
|
-
}
|