@matech/thebigpos-sdk 3.21.0 → 3.22.0-main-7349
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 +6525 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +560 -565
- package/dist/index.js +41 -28
- package/dist/index.js.map +1 -1
- package/index.js +1 -1
- package/package.json +24 -10
- package/src/index.ts +76 -70
- 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.22.0-main-7349",
|
|
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": "383cf016f569a137e7923378cc3b78b3fe97fbf2ffe50af0c5bf868a4048668f"
|
|
40
54
|
}
|
package/src/index.ts
CHANGED
|
@@ -1446,7 +1446,6 @@ export interface AiPrompt {
|
|
|
1446
1446
|
isFeatured: boolean;
|
|
1447
1447
|
icon?: string | null;
|
|
1448
1448
|
agentSystemPrompt?: string | null;
|
|
1449
|
-
tools?: AiPromptTool[] | null;
|
|
1450
1449
|
hasAccountOverride: boolean;
|
|
1451
1450
|
/** @format date-time */
|
|
1452
1451
|
createdAt: string;
|
|
@@ -1548,14 +1547,6 @@ export interface AiPromptSummary {
|
|
|
1548
1547
|
icon?: string | null;
|
|
1549
1548
|
}
|
|
1550
1549
|
|
|
1551
|
-
export interface AiPromptTool {
|
|
1552
|
-
toolName: string;
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
|
-
export interface AiPromptToolInput {
|
|
1556
|
-
toolName: string;
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
1550
|
export interface AiTokenBudgetStatus {
|
|
1560
1551
|
/** @format int32 */
|
|
1561
1552
|
limit: number;
|
|
@@ -1601,13 +1592,6 @@ export interface AiTokenUsageWindowPaginated {
|
|
|
1601
1592
|
count: number;
|
|
1602
1593
|
}
|
|
1603
1594
|
|
|
1604
|
-
export interface AiToolCatalogItem {
|
|
1605
|
-
toolName: string;
|
|
1606
|
-
displayName: string;
|
|
1607
|
-
description: string;
|
|
1608
|
-
isWriteTool: boolean;
|
|
1609
|
-
}
|
|
1610
|
-
|
|
1611
1595
|
export interface AiUpdatedBy {
|
|
1612
1596
|
/** @format uuid */
|
|
1613
1597
|
id: string;
|
|
@@ -2792,6 +2776,11 @@ export interface CustomFieldValue {
|
|
|
2792
2776
|
dataType: CustomFieldValueDataTypeEnum;
|
|
2793
2777
|
}
|
|
2794
2778
|
|
|
2779
|
+
export interface DeactivateLoanDocumentFolderRequest {
|
|
2780
|
+
/** @format uuid */
|
|
2781
|
+
reassignToFolderId?: string | null;
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2795
2784
|
export interface DetailedUser {
|
|
2796
2785
|
/** @format date-time */
|
|
2797
2786
|
createdAt: string;
|
|
@@ -8049,10 +8038,6 @@ export interface UpdateAiPromptRequest {
|
|
|
8049
8038
|
inputHint?: string | null;
|
|
8050
8039
|
isFeatured?: boolean | null;
|
|
8051
8040
|
icon?: string | null;
|
|
8052
|
-
}
|
|
8053
|
-
|
|
8054
|
-
export interface UpdateAiPromptToolsRequest {
|
|
8055
|
-
tools: AiPromptToolInput[];
|
|
8056
8041
|
agentSystemPrompt?: string | null;
|
|
8057
8042
|
}
|
|
8058
8043
|
|
|
@@ -10056,7 +10041,15 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
10056
10041
|
property instanceof Array ? property : [property];
|
|
10057
10042
|
|
|
10058
10043
|
for (const formItem of propertyContent) {
|
|
10059
|
-
|
|
10044
|
+
// React Native files are plain { uri, name, type } objects, not Blob/File.
|
|
10045
|
+
const isReactNativeFile =
|
|
10046
|
+
!!formItem &&
|
|
10047
|
+
typeof formItem === "object" &&
|
|
10048
|
+
"uri" in formItem &&
|
|
10049
|
+
"name" in formItem &&
|
|
10050
|
+
"type" in formItem;
|
|
10051
|
+
const isFileType =
|
|
10052
|
+
isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
|
|
10060
10053
|
formData.append(
|
|
10061
10054
|
key,
|
|
10062
10055
|
isFileType ? formItem : this.stringifyFormItem(formItem),
|
|
@@ -10118,7 +10111,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
10118
10111
|
|
|
10119
10112
|
/**
|
|
10120
10113
|
* @title The Big POS API
|
|
10121
|
-
* @version v3.
|
|
10114
|
+
* @version v3.22.0
|
|
10122
10115
|
* @termsOfService https://www.thebigpos.com/terms-of-use/
|
|
10123
10116
|
* @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
|
|
10124
10117
|
*/
|
|
@@ -10617,52 +10610,6 @@ export class Api<
|
|
|
10617
10610
|
...params,
|
|
10618
10611
|
}),
|
|
10619
10612
|
|
|
10620
|
-
/**
|
|
10621
|
-
* No description
|
|
10622
|
-
*
|
|
10623
|
-
* @tags AiAdminPrompt
|
|
10624
|
-
* @name GetAiTools
|
|
10625
|
-
* @summary List available agent tools and their settings schema
|
|
10626
|
-
* @request GET:/api/ai/prompts/tools
|
|
10627
|
-
* @secure
|
|
10628
|
-
* @response `200` `(AiToolCatalogItem)[]` OK
|
|
10629
|
-
*/
|
|
10630
|
-
getAiTools: (params: RequestParams = {}) =>
|
|
10631
|
-
this.request<AiToolCatalogItem[], any>({
|
|
10632
|
-
path: `/api/ai/prompts/tools`,
|
|
10633
|
-
method: "GET",
|
|
10634
|
-
secure: true,
|
|
10635
|
-
format: "json",
|
|
10636
|
-
...params,
|
|
10637
|
-
}),
|
|
10638
|
-
|
|
10639
|
-
/**
|
|
10640
|
-
* No description
|
|
10641
|
-
*
|
|
10642
|
-
* @tags AiAdminPrompt
|
|
10643
|
-
* @name UpdateAiPromptTools
|
|
10644
|
-
* @summary Replace the prompt's agent tool configuration
|
|
10645
|
-
* @request PUT:/api/ai/prompts/{id}/tools
|
|
10646
|
-
* @secure
|
|
10647
|
-
* @response `200` `AiPrompt` OK
|
|
10648
|
-
* @response `400` `ProblemDetails` Bad Request
|
|
10649
|
-
* @response `404` `ProblemDetails` Not Found
|
|
10650
|
-
*/
|
|
10651
|
-
updateAiPromptTools: (
|
|
10652
|
-
id: string,
|
|
10653
|
-
data: UpdateAiPromptToolsRequest,
|
|
10654
|
-
params: RequestParams = {},
|
|
10655
|
-
) =>
|
|
10656
|
-
this.request<AiPrompt, ProblemDetails>({
|
|
10657
|
-
path: `/api/ai/prompts/${id}/tools`,
|
|
10658
|
-
method: "PUT",
|
|
10659
|
-
body: data,
|
|
10660
|
-
secure: true,
|
|
10661
|
-
type: "application/json",
|
|
10662
|
-
format: "json",
|
|
10663
|
-
...params,
|
|
10664
|
-
}),
|
|
10665
|
-
|
|
10666
10613
|
/**
|
|
10667
10614
|
* No description
|
|
10668
10615
|
*
|
|
@@ -16277,6 +16224,58 @@ export class Api<
|
|
|
16277
16224
|
...params,
|
|
16278
16225
|
}),
|
|
16279
16226
|
|
|
16227
|
+
/**
|
|
16228
|
+
* No description
|
|
16229
|
+
*
|
|
16230
|
+
* @tags LoanBorrowerRemoval
|
|
16231
|
+
* @name RemoveLoanBorrower
|
|
16232
|
+
* @summary Remove a co-borrower from an application in progress
|
|
16233
|
+
* @request POST:/api/loans/{loanId}/borrowers/{borrowerId}/remove
|
|
16234
|
+
* @secure
|
|
16235
|
+
* @response `204` `void` No Content
|
|
16236
|
+
* @response `400` `ProblemDetails` Bad Request
|
|
16237
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
16238
|
+
* @response `404` `ProblemDetails` Not Found
|
|
16239
|
+
* @response `409` `ProblemDetails` Conflict
|
|
16240
|
+
*/
|
|
16241
|
+
removeLoanBorrower: (
|
|
16242
|
+
loanId: string,
|
|
16243
|
+
borrowerId: string,
|
|
16244
|
+
params: RequestParams = {},
|
|
16245
|
+
) =>
|
|
16246
|
+
this.request<void, ProblemDetails>({
|
|
16247
|
+
path: `/api/loans/${loanId}/borrowers/${borrowerId}/remove`,
|
|
16248
|
+
method: "POST",
|
|
16249
|
+
secure: true,
|
|
16250
|
+
...params,
|
|
16251
|
+
}),
|
|
16252
|
+
|
|
16253
|
+
/**
|
|
16254
|
+
* No description
|
|
16255
|
+
*
|
|
16256
|
+
* @tags LoanBorrowerRemoval
|
|
16257
|
+
* @name RestoreLoanBorrower
|
|
16258
|
+
* @summary Restore a removed co-borrower to an application in progress
|
|
16259
|
+
* @request POST:/api/loans/{loanId}/borrowers/{borrowerId}/restore
|
|
16260
|
+
* @secure
|
|
16261
|
+
* @response `204` `void` No Content
|
|
16262
|
+
* @response `400` `ProblemDetails` Bad Request
|
|
16263
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
16264
|
+
* @response `404` `ProblemDetails` Not Found
|
|
16265
|
+
* @response `409` `ProblemDetails` Conflict
|
|
16266
|
+
*/
|
|
16267
|
+
restoreLoanBorrower: (
|
|
16268
|
+
loanId: string,
|
|
16269
|
+
borrowerId: string,
|
|
16270
|
+
params: RequestParams = {},
|
|
16271
|
+
) =>
|
|
16272
|
+
this.request<void, ProblemDetails>({
|
|
16273
|
+
path: `/api/loans/${loanId}/borrowers/${borrowerId}/restore`,
|
|
16274
|
+
method: "POST",
|
|
16275
|
+
secure: true,
|
|
16276
|
+
...params,
|
|
16277
|
+
}),
|
|
16278
|
+
|
|
16280
16279
|
/**
|
|
16281
16280
|
* No description
|
|
16282
16281
|
*
|
|
@@ -16716,18 +16715,25 @@ export class Api<
|
|
|
16716
16715
|
*
|
|
16717
16716
|
* @tags LoanDocumentFolders
|
|
16718
16717
|
* @name DeactivateLoanDocumentFolder
|
|
16719
|
-
* @summary Deactivate a loan document folder. Rejected for the system-default Unassigned folder.
|
|
16718
|
+
* @summary Deactivate a loan document folder. Rejected with 409 (errorCode FolderInUse, the referencing tasks and templates in references) while tasks or document templates still reference it, unless reassignToFolderId names an active replacement folder, in which case every reference is moved there and the folder is deactivated in one transaction. Rejected for the system-default Unassigned folder.
|
|
16720
16719
|
* @request POST:/api/loan-document-folders/{id}/deactivate
|
|
16721
16720
|
* @secure
|
|
16722
16721
|
* @response `204` `void` No Content
|
|
16723
16722
|
* @response `400` `ProblemDetails` Bad Request
|
|
16724
16723
|
* @response `404` `ProblemDetails` Not Found
|
|
16724
|
+
* @response `409` `ProblemDetails` Conflict
|
|
16725
16725
|
*/
|
|
16726
|
-
deactivateLoanDocumentFolder: (
|
|
16726
|
+
deactivateLoanDocumentFolder: (
|
|
16727
|
+
id: string,
|
|
16728
|
+
data: DeactivateLoanDocumentFolderRequest,
|
|
16729
|
+
params: RequestParams = {},
|
|
16730
|
+
) =>
|
|
16727
16731
|
this.request<void, ProblemDetails>({
|
|
16728
16732
|
path: `/api/loan-document-folders/${id}/deactivate`,
|
|
16729
16733
|
method: "POST",
|
|
16734
|
+
body: data,
|
|
16730
16735
|
secure: true,
|
|
16736
|
+
type: "application/json",
|
|
16731
16737
|
...params,
|
|
16732
16738
|
}),
|
|
16733
16739
|
|
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
|
-
}
|