@matech/thebigpos-sdk 3.11.1 → 3.11.2-stag-5036
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 +0 -39
- package/dist/index.d.ts +59 -39
- package/dist/index.js +16 -19
- package/dist/index.js.map +1 -1
- package/package.json +5 -15
- package/scripts/apply-json-patch-content-type.js +36 -189
- package/src/index.ts +74 -91
- package/docs/sdk_generation.md +0 -149
|
@@ -1,209 +1,56 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
This script is meant to run after the SDK has been generated.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
it by reading the OpenAPI spec the SDK was generated from and, for every
|
|
8
|
-
generated PATCH method, setting:
|
|
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.
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
advertises application/json-patch+json
|
|
12
|
-
- ContentType.Json -> for every other PATCH method
|
|
13
|
-
(e.g. updateLoan, which the backend declares as
|
|
14
|
-
[Consumes("application/json")])
|
|
15
|
-
|
|
16
|
-
The decision is taken entirely from the spec — there is no hard-coded list of
|
|
17
|
-
endpoints to keep in sync. It also ensures the ContentType enum includes
|
|
18
|
-
JsonPatch and relaxes the Operation interface `value` to accept any value.
|
|
19
|
-
|
|
20
|
-
It additionally teaches `createFormData` to recognise React Native files. The
|
|
21
|
-
generator assumes a browser and detects file parts with `instanceof Blob ||
|
|
22
|
-
instanceof File`; in React Native a file is a plain `{ uri, name, type }`
|
|
23
|
-
object, so without the extra branch every mobile upload is serialised as the
|
|
24
|
-
string "[object Object]". This used to live as a patch-package patch in
|
|
25
|
-
pos-mobile-v2, which had to be re-created on every SDK bump.
|
|
26
|
-
|
|
27
|
-
Usage (pass the SAME spec given to `swagger-typescript-api -p`):
|
|
28
|
-
node scripts/apply-json-patch-content-type.js https://api.thebigpos.dev/swagger/<version>/swagger.json
|
|
29
|
-
node scripts/apply-json-patch-content-type.js ./swagger.json
|
|
30
|
-
SWAGGER_SPEC=<url-or-file> node scripts/apply-json-patch-content-type.js
|
|
31
|
-
|
|
32
|
-
Design notes:
|
|
33
|
-
- The rewrite is scoped to a single generated method block at a time
|
|
34
|
-
(anchored on that method's own `...params,`), so it can never bleed across
|
|
35
|
-
method boundaries.
|
|
36
|
-
- It sets each method's content type to its target value rather than doing a
|
|
37
|
-
conditional replace, so it is idempotent and self-healing (it also repairs
|
|
38
|
-
a previously-seen ContentType.JsonPatchPatch double-application).
|
|
39
|
-
- If no spec is provided (e.g. a plain commit-hook run), the content-type
|
|
40
|
-
rewrite is skipped instead of guessing, so it can never silently corrupt
|
|
41
|
-
the generated output.
|
|
8
|
+
This is necessary because the SDK generation does not currently handle these cases correctly.
|
|
42
9
|
*/
|
|
43
10
|
|
|
44
11
|
const fs = require('fs')
|
|
45
|
-
const nodePath = require('path')
|
|
46
12
|
|
|
47
|
-
const
|
|
13
|
+
const path = require('path').resolve(__dirname, '../src/index.ts')
|
|
48
14
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const res = await fetch(source)
|
|
53
|
-
if (!res.ok) throw new Error(`Failed to fetch spec from "${source}": HTTP ${res.status}`)
|
|
54
|
-
return res.json()
|
|
55
|
-
}
|
|
56
|
-
return JSON.parse(fs.readFileSync(nodePath.resolve(source), 'utf8'))
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Collapse spec ("{id}") and generated ("${id}") path params to a common token
|
|
60
|
-
// so generated paths can be matched against spec paths regardless of param names.
|
|
61
|
-
function normalizePath(p) {
|
|
62
|
-
return p.replace(/\$\{[^}]+\}/g, '{}').replace(/\{[^}]+\}/g, '{}')
|
|
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)
|
|
63
18
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
set.add(normalizePath(route))
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return set
|
|
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)
|
|
74
25
|
}
|
|
75
26
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return block.replace(/\n(\s*)\.\.\.params,/, `\n$1${target},\n$1...params,`)
|
|
82
|
-
}
|
|
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
|
+
)
|
|
83
32
|
|
|
84
|
-
|
|
85
|
-
|
|
33
|
+
// Ensure JsonPatch is included in the ContentType enum
|
|
34
|
+
content = content.replace(
|
|
35
|
+
/export enum ContentType\s*{([\s\S]*?)}/,
|
|
36
|
+
(match, enumBody) => {
|
|
86
37
|
if (enumBody.includes('JsonPatch')) return match
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
38
|
+
const insertion = ` JsonPatch = "application/json-patch+json",\n `
|
|
39
|
+
return `export enum ContentType {\n${insertion}${enumBody.trim()}\n}`
|
|
40
|
+
}
|
|
41
|
+
)
|
|
90
42
|
|
|
91
|
-
|
|
92
|
-
|
|
43
|
+
// Fix the Operation interface to allow any value
|
|
44
|
+
content = content.replace(
|
|
45
|
+
/export interface Operation\s*{([\s\S]*?)}/,
|
|
46
|
+
(match, body) => {
|
|
93
47
|
const updated = body.replace(
|
|
94
48
|
/value\?:\s*object\s*\|?\s*null?;/,
|
|
95
49
|
'value?: string | number | boolean | null | object;'
|
|
96
50
|
)
|
|
97
51
|
return `export interface Operation {\n ${updated.trim()}\n}`
|
|
98
|
-
})
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const RN_FILE_MARKER = 'isReactNativeFile'
|
|
102
|
-
|
|
103
|
-
// swagger-typescript-api assumes a browser: it detects multipart file parts with
|
|
104
|
-
// `instanceof Blob || instanceof File`. React Native has neither in a usable form —
|
|
105
|
-
// a file there is a plain `{ uri, name, type }` object. Without this branch those
|
|
106
|
-
// objects fall through to `stringifyFormItem` and every upload from the mobile app
|
|
107
|
-
// goes out as the string "[object Object]".
|
|
108
|
-
//
|
|
109
|
-
// The React Native check runs first so the `instanceof` operands are never even
|
|
110
|
-
// evaluated on that path.
|
|
111
|
-
//
|
|
112
|
-
// The pattern is deliberately whitespace-tolerant instead of matching one exact
|
|
113
|
-
// line. As generated today that statement is exactly 80 characters wide, which is
|
|
114
|
-
// Prettier's default printWidth — so the moment the generator nests it one level
|
|
115
|
-
// deeper, or renames `formItem`, Prettier reflows it across two lines. Anchoring
|
|
116
|
-
// on the single-line form would then quietly stop matching.
|
|
117
|
-
const GENERATED_FILE_CHECK =
|
|
118
|
-
/^([ \t]*)const isFileType\s*=\s*formItem instanceof Blob\s*\|\|\s*formItem instanceof File;/m
|
|
119
|
-
|
|
120
|
-
function applyReactNativeFileSupport(content) {
|
|
121
|
-
if (content.includes(RN_FILE_MARKER)) return content
|
|
122
|
-
|
|
123
|
-
// Never fail open. A silent no-op here ships an SDK where every React Native
|
|
124
|
-
// upload is serialised as "[object Object]", with nothing in the build to
|
|
125
|
-
// suggest anything went wrong.
|
|
126
|
-
if (!GENERATED_FILE_CHECK.test(content)) {
|
|
127
|
-
throw new Error(
|
|
128
|
-
'applyReactNativeFileSupport: could not find the generated `isFileType` check in ' +
|
|
129
|
-
'createFormData.\n' +
|
|
130
|
-
'swagger-typescript-api has most likely changed its output. Update ' +
|
|
131
|
-
'GENERATED_FILE_CHECK in this script — do not skip this step, or React Native ' +
|
|
132
|
-
'file uploads will break with no visible error.'
|
|
133
|
-
)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return content.replace(
|
|
137
|
-
GENERATED_FILE_CHECK,
|
|
138
|
-
(match, indent) =>
|
|
139
|
-
[
|
|
140
|
-
`${indent}// React Native files are plain { uri, name, type } objects, not Blob/File.`,
|
|
141
|
-
`${indent}const ${RN_FILE_MARKER} =`,
|
|
142
|
-
`${indent} !!formItem &&`,
|
|
143
|
-
`${indent} typeof formItem === "object" &&`,
|
|
144
|
-
`${indent} "uri" in formItem &&`,
|
|
145
|
-
`${indent} "name" in formItem &&`,
|
|
146
|
-
`${indent} "type" in formItem;`,
|
|
147
|
-
`${indent}const isFileType =`,
|
|
148
|
-
`${indent} ${RN_FILE_MARKER} || formItem instanceof Blob || formItem instanceof File;`,
|
|
149
|
-
].join('\n')
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function applyContentTypes(content, patchPaths) {
|
|
154
|
-
// Heal any earlier double-application (ContentType.JsonPatchPatch...).
|
|
155
|
-
content = content.replace(/ContentType\.JsonPatch(?:Patch)+\b/g, 'ContentType.JsonPatch')
|
|
156
|
-
|
|
157
|
-
const METHOD_BLOCK = /[a-zA-Z0-9_]+:\s*\([\s\S]*?\)\s*=>\s*this\.request<[^>]*>\(\{[\s\S]*?\.\.\.params,/g
|
|
158
|
-
return content.replace(METHOD_BLOCK, (block) => {
|
|
159
|
-
if (!/method:\s*"PATCH"/.test(block)) {
|
|
160
|
-
// Non-PATCH methods must never be JSON Patch.
|
|
161
|
-
return /type:\s*ContentType\.JsonPatch\b/.test(block)
|
|
162
|
-
? block.replace(/type:\s*ContentType\.JsonPatch\b/, 'type: ContentType.Json')
|
|
163
|
-
: block
|
|
164
|
-
}
|
|
165
|
-
const routeMatch = block.match(/path:\s*`([^`]*)`/)
|
|
166
|
-
const route = routeMatch ? normalizePath(routeMatch[1]) : ''
|
|
167
|
-
return setContentType(block, patchPaths.has(route) ? 'JsonPatch' : 'Json')
|
|
168
|
-
})
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
;(async () => {
|
|
172
|
-
if (!fs.existsSync(SRC)) {
|
|
173
|
-
console.error(`Error: File not found at "${SRC}". Generate the SDK first.`)
|
|
174
|
-
process.exit(1)
|
|
175
52
|
}
|
|
53
|
+
)
|
|
176
54
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
try {
|
|
180
|
-
spec = await loadSpec(source)
|
|
181
|
-
} catch (err) {
|
|
182
|
-
console.error(`Error loading OpenAPI spec: ${err.message}`)
|
|
183
|
-
process.exit(1)
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
let content = fs.readFileSync(SRC, 'utf8')
|
|
187
|
-
content = ensureJsonPatchEnum(content)
|
|
188
|
-
content = relaxOperationValue(content)
|
|
189
|
-
content = applyReactNativeFileSupport(content)
|
|
190
|
-
|
|
191
|
-
if (!spec) {
|
|
192
|
-
console.warn(
|
|
193
|
-
'No OpenAPI spec provided (argument / SWAGGER_SPEC / SWAGGER_URL) — skipping PATCH content-type rewrite.\n' +
|
|
194
|
-
'Re-run with the spec used for generation to apply it, e.g.:\n' +
|
|
195
|
-
' node scripts/apply-json-patch-content-type.js https://api.thebigpos.dev/swagger/<version>/swagger.json'
|
|
196
|
-
)
|
|
197
|
-
fs.writeFileSync(SRC, content)
|
|
198
|
-
return
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
const patchPaths = jsonPatchPaths(spec)
|
|
202
|
-
content = applyContentTypes(content, patchPaths)
|
|
203
|
-
|
|
204
|
-
fs.writeFileSync(SRC, content)
|
|
205
|
-
console.log(`SDK patch complete: PATCH content types set from the OpenAPI spec (${patchPaths.size} json-patch endpoint(s)).`)
|
|
206
|
-
})().catch((err) => {
|
|
207
|
-
console.error(err)
|
|
208
|
-
process.exit(1)
|
|
209
|
-
})
|
|
55
|
+
fs.writeFileSync(path, content)
|
|
56
|
+
console.log('SDK patch complete: All PATCH methods now use ContentType.JsonPatch.')
|
package/src/index.ts
CHANGED
|
@@ -491,21 +491,6 @@ export type LOSStatus =
|
|
|
491
491
|
| "Uploaded"
|
|
492
492
|
| "PendingSync";
|
|
493
493
|
|
|
494
|
-
export type FilterType =
|
|
495
|
-
| "DateGreaterThanOrEqualTo"
|
|
496
|
-
| "DateGreaterThan"
|
|
497
|
-
| "DateLessThan"
|
|
498
|
-
| "DateLessThanOrEqualTo"
|
|
499
|
-
| "DateEquals"
|
|
500
|
-
| "DateDoesntEqual"
|
|
501
|
-
| "DateNonEmpty"
|
|
502
|
-
| "DateEmpty"
|
|
503
|
-
| "StringContains"
|
|
504
|
-
| "StringEquals"
|
|
505
|
-
| "StringNotEmpty"
|
|
506
|
-
| "StringNotEquals"
|
|
507
|
-
| "StringNotContains";
|
|
508
|
-
|
|
509
494
|
export type Environment = "Development" | "Staging" | "UAT" | "Production";
|
|
510
495
|
|
|
511
496
|
export type EntityType =
|
|
@@ -1347,6 +1332,38 @@ export interface AiPromptRunResult {
|
|
|
1347
1332
|
confidence?: number | null;
|
|
1348
1333
|
}
|
|
1349
1334
|
|
|
1335
|
+
export interface AiPromptRunRetry {
|
|
1336
|
+
dryRun: boolean;
|
|
1337
|
+
/** @format int32 */
|
|
1338
|
+
failedRuns: number;
|
|
1339
|
+
/** @format int32 */
|
|
1340
|
+
tasks: number;
|
|
1341
|
+
/** @format int32 */
|
|
1342
|
+
republished: number;
|
|
1343
|
+
/** @format int32 */
|
|
1344
|
+
skipped: number;
|
|
1345
|
+
/** @format int32 */
|
|
1346
|
+
remainingTasks: number;
|
|
1347
|
+
/** @format int32 */
|
|
1348
|
+
scheduledOverSeconds: number;
|
|
1349
|
+
items: AiPromptRunRetryItem[];
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
export interface AiPromptRunRetryItem {
|
|
1353
|
+
/** @format uuid */
|
|
1354
|
+
accountId: string;
|
|
1355
|
+
/** @format uuid */
|
|
1356
|
+
subjectEntityId: string;
|
|
1357
|
+
/** @format uuid */
|
|
1358
|
+
loanId?: string | null;
|
|
1359
|
+
runIds: string[];
|
|
1360
|
+
/** @format date-time */
|
|
1361
|
+
lastFailedAt: string;
|
|
1362
|
+
/** @format int32 */
|
|
1363
|
+
delaySeconds: number;
|
|
1364
|
+
outcome: string;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1350
1367
|
export interface AiPromptRunVerdictBackfill {
|
|
1351
1368
|
/** @format int32 */
|
|
1352
1369
|
updated: number;
|
|
@@ -3087,16 +3104,6 @@ export interface FormVersionUpdateRequest {
|
|
|
3087
3104
|
id: string;
|
|
3088
3105
|
}
|
|
3089
3106
|
|
|
3090
|
-
export interface FusionFieldDisplay {
|
|
3091
|
-
fieldValue: string;
|
|
3092
|
-
}
|
|
3093
|
-
|
|
3094
|
-
export interface FusionReportFilter {
|
|
3095
|
-
filterType: FusionReportFilterFilterTypeEnum;
|
|
3096
|
-
targetField: string;
|
|
3097
|
-
targetValue: string;
|
|
3098
|
-
}
|
|
3099
|
-
|
|
3100
3107
|
export interface GenerateDocumentRequest {
|
|
3101
3108
|
/** @format uuid */
|
|
3102
3109
|
templateID: string;
|
|
@@ -3166,21 +3173,6 @@ export interface GetForm {
|
|
|
3166
3173
|
id: string;
|
|
3167
3174
|
}
|
|
3168
3175
|
|
|
3169
|
-
export interface GetReport {
|
|
3170
|
-
loanRecords: LoanRecord[];
|
|
3171
|
-
invalidFieldIDs: string[];
|
|
3172
|
-
}
|
|
3173
|
-
|
|
3174
|
-
export interface GetReportRequest {
|
|
3175
|
-
fields: FusionFieldDisplay[];
|
|
3176
|
-
filters?: FusionReportFilter[] | null;
|
|
3177
|
-
loanIDs?: string[] | null;
|
|
3178
|
-
/** @format int32 */
|
|
3179
|
-
startIndex?: number | null;
|
|
3180
|
-
/** @format int32 */
|
|
3181
|
-
limit?: number | null;
|
|
3182
|
-
}
|
|
3183
|
-
|
|
3184
3176
|
export interface GetSiteConfigurationByLOUserIDRequest {
|
|
3185
3177
|
loUserID: string;
|
|
3186
3178
|
}
|
|
@@ -5088,11 +5080,6 @@ export interface LoanRecommendation {
|
|
|
5088
5080
|
detectedAt: string;
|
|
5089
5081
|
}
|
|
5090
5082
|
|
|
5091
|
-
export interface LoanRecord {
|
|
5092
|
-
loanGuid: string;
|
|
5093
|
-
loanFields: Record<string, string>;
|
|
5094
|
-
}
|
|
5095
|
-
|
|
5096
5083
|
export interface LoanRefinance {
|
|
5097
5084
|
/** @format uuid */
|
|
5098
5085
|
id?: string | null;
|
|
@@ -8295,21 +8282,6 @@ export type EncompassWebhookSubscriptionWebhookTypeEnum =
|
|
|
8295
8282
|
| "WebDocuments"
|
|
8296
8283
|
| "PosfCreatePackage";
|
|
8297
8284
|
|
|
8298
|
-
export type FusionReportFilterFilterTypeEnum =
|
|
8299
|
-
| "DateGreaterThanOrEqualTo"
|
|
8300
|
-
| "DateGreaterThan"
|
|
8301
|
-
| "DateLessThan"
|
|
8302
|
-
| "DateLessThanOrEqualTo"
|
|
8303
|
-
| "DateEquals"
|
|
8304
|
-
| "DateDoesntEqual"
|
|
8305
|
-
| "DateNonEmpty"
|
|
8306
|
-
| "DateEmpty"
|
|
8307
|
-
| "StringContains"
|
|
8308
|
-
| "StringEquals"
|
|
8309
|
-
| "StringNotEmpty"
|
|
8310
|
-
| "StringNotEquals"
|
|
8311
|
-
| "StringNotContains";
|
|
8312
|
-
|
|
8313
8285
|
export type GenerateSystemPromptRequestCategoryEnum =
|
|
8314
8286
|
| "DocumentAnalysis"
|
|
8315
8287
|
| "DataQuery"
|
|
@@ -8983,15 +8955,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
8983
8955
|
property instanceof Array ? property : [property];
|
|
8984
8956
|
|
|
8985
8957
|
for (const formItem of propertyContent) {
|
|
8986
|
-
|
|
8987
|
-
const isReactNativeFile =
|
|
8988
|
-
!!formItem &&
|
|
8989
|
-
typeof formItem === "object" &&
|
|
8990
|
-
"uri" in formItem &&
|
|
8991
|
-
"name" in formItem &&
|
|
8992
|
-
"type" in formItem;
|
|
8993
|
-
const isFileType =
|
|
8994
|
-
isReactNativeFile || formItem instanceof Blob || formItem instanceof File;
|
|
8958
|
+
const isFileType = formItem instanceof Blob || formItem instanceof File;
|
|
8995
8959
|
formData.append(
|
|
8996
8960
|
key,
|
|
8997
8961
|
isFileType ? formItem : this.stringifyFormItem(formItem),
|
|
@@ -9053,7 +9017,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
9053
9017
|
|
|
9054
9018
|
/**
|
|
9055
9019
|
* @title The Big POS API
|
|
9056
|
-
* @version v3.11.
|
|
9020
|
+
* @version v3.11.2
|
|
9057
9021
|
* @termsOfService https://www.thebigpos.com/terms-of-use/
|
|
9058
9022
|
* @contact Mortgage Automation Technologies <support@thebigpos.com> (https://www.thebigpos.com/terms-of-use/)
|
|
9059
9023
|
*/
|
|
@@ -10533,6 +10497,46 @@ export class Api<
|
|
|
10533
10497
|
...params,
|
|
10534
10498
|
}),
|
|
10535
10499
|
|
|
10500
|
+
/**
|
|
10501
|
+
* No description
|
|
10502
|
+
*
|
|
10503
|
+
* @tags AiPromptRunAdmin
|
|
10504
|
+
* @name RetryFailedAiPromptRuns
|
|
10505
|
+
* @summary Republish the trigger for failed prompt runs so they run again, staggered by spacingSeconds (SuperAdmin)
|
|
10506
|
+
* @request POST:/api/ai/prompt-runs/retry-failed
|
|
10507
|
+
* @secure
|
|
10508
|
+
* @response `200` `AiPromptRunRetry` OK
|
|
10509
|
+
* @response `400` `ProblemDetails` Bad Request
|
|
10510
|
+
* @response `401` `ProblemDetails` Unauthorized
|
|
10511
|
+
* @response `403` `ProblemDetails` Forbidden
|
|
10512
|
+
*/
|
|
10513
|
+
retryFailedAiPromptRuns: (
|
|
10514
|
+
query?: {
|
|
10515
|
+
/** @format uuid */
|
|
10516
|
+
accountId?: string;
|
|
10517
|
+
/** @format date-time */
|
|
10518
|
+
from?: string;
|
|
10519
|
+
/** @format date-time */
|
|
10520
|
+
to?: string;
|
|
10521
|
+
errorType?: string;
|
|
10522
|
+
dryRun?: boolean;
|
|
10523
|
+
/** @format int32 */
|
|
10524
|
+
spacingSeconds?: number;
|
|
10525
|
+
/** @format int32 */
|
|
10526
|
+
limit?: number;
|
|
10527
|
+
includeAlreadyRetried?: boolean;
|
|
10528
|
+
},
|
|
10529
|
+
params: RequestParams = {},
|
|
10530
|
+
) =>
|
|
10531
|
+
this.request<AiPromptRunRetry, ProblemDetails>({
|
|
10532
|
+
path: `/api/ai/prompt-runs/retry-failed`,
|
|
10533
|
+
method: "POST",
|
|
10534
|
+
query: query,
|
|
10535
|
+
secure: true,
|
|
10536
|
+
format: "json",
|
|
10537
|
+
...params,
|
|
10538
|
+
}),
|
|
10539
|
+
|
|
10536
10540
|
/**
|
|
10537
10541
|
* No description
|
|
10538
10542
|
*
|
|
@@ -14361,27 +14365,6 @@ export class Api<
|
|
|
14361
14365
|
...params,
|
|
14362
14366
|
}),
|
|
14363
14367
|
|
|
14364
|
-
/**
|
|
14365
|
-
* No description
|
|
14366
|
-
*
|
|
14367
|
-
* @tags LegacyLoan
|
|
14368
|
-
* @name GetLoansReport
|
|
14369
|
-
* @summary Get Report
|
|
14370
|
-
* @request POST:/api/los/loan/reports
|
|
14371
|
-
* @secure
|
|
14372
|
-
* @response `200` `GetReport` OK
|
|
14373
|
-
*/
|
|
14374
|
-
getLoansReport: (data: GetReportRequest, params: RequestParams = {}) =>
|
|
14375
|
-
this.request<GetReport, any>({
|
|
14376
|
-
path: `/api/los/loan/reports`,
|
|
14377
|
-
method: "POST",
|
|
14378
|
-
body: data,
|
|
14379
|
-
secure: true,
|
|
14380
|
-
type: "application/json",
|
|
14381
|
-
format: "json",
|
|
14382
|
-
...params,
|
|
14383
|
-
}),
|
|
14384
|
-
|
|
14385
14368
|
/**
|
|
14386
14369
|
* No description
|
|
14387
14370
|
*
|
package/docs/sdk_generation.md
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
# Publishing the POS Typescript SDK
|
|
2
|
-
|
|
3
|
-
## Prerequisites
|
|
4
|
-
|
|
5
|
-
1. Clone the repository (if you haven't already):
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
git clone https://github.com/MortgageAutomationTechnologies/thebigpos-sdk-typescript
|
|
9
|
-
cd thebigpos-sdk-typescript
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
2. Install swagger-typescript-api globally:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm i -g swagger-typescript-api
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
3. Connect to the MAT VPN
|
|
19
|
-
|
|
20
|
-
## Step 1: Create a release branch
|
|
21
|
-
|
|
22
|
-
Create a new branch for the version you're releasing:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
git checkout develop
|
|
26
|
-
git pull origin develop
|
|
27
|
-
git checkout -b release/X.Y.Z
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Step 2: Generate the SDK
|
|
31
|
-
|
|
32
|
-
Replace `{version}` with the target API version (e.g., `v2.31.0`):
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npx swagger-typescript-api generate -p https://api.thebigpos.dev/swagger/{version}/swagger.json -o ./src -n index.ts -r true --axios --enum-names-as-values --generate-union-enums
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
> **Note:** If generating locally, use `http://localhost:5212/swagger/{version}/swagger.json` due to self-signed cert issues with https.
|
|
39
|
-
|
|
40
|
-
## Step 3: Apply post-generation fixes
|
|
41
|
-
|
|
42
|
-
Run the script to fix PATCH methods content type and Operation interface:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
node scripts/apply-json-patch-content-type.js
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
This script:
|
|
49
|
-
- Sets all PATCH methods to use `ContentType.JsonPatch`
|
|
50
|
-
- Adds `JsonPatch` to the `ContentType` enum
|
|
51
|
-
- Fixes the `Operation` interface to allow any value type
|
|
52
|
-
|
|
53
|
-
## Step 4: Update the version
|
|
54
|
-
|
|
55
|
-
Use npm's version command to update the version in `package.json`:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npm version X.Y.Z
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**Version conventions:**
|
|
62
|
-
|
|
63
|
-
- Match the SDK version to the API version being released
|
|
64
|
-
- For release candidates (pre-release), use: `npm version X.Y.Z-rc.N --preid=rc`
|
|
65
|
-
- For patch increments: `npm version patch`
|
|
66
|
-
- For minor increments: `npm version minor`
|
|
67
|
-
|
|
68
|
-
## Step 5: Build the SDK
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
npm run build
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Ensure there are no TypeScript compilation errors.
|
|
75
|
-
|
|
76
|
-
## Step 6: Merge develop (if needed)
|
|
77
|
-
|
|
78
|
-
If there are changes in develop that need to be included:
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
git fetch origin develop
|
|
82
|
-
git merge origin/develop
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
If there are conflicts in `src/index.ts` or `dist/*`, regenerate the SDK (Step 2), apply fixes (Step 3), and rebuild (Step 5) to resolve them.
|
|
86
|
-
|
|
87
|
-
## Step 7: Commit and push
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
git add .
|
|
91
|
-
git commit -m "X.Y.Z"
|
|
92
|
-
git push -u origin release/X.Y.Z
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Step 8: Publish to NPM
|
|
96
|
-
|
|
97
|
-
### Authentication
|
|
98
|
-
|
|
99
|
-
NPM requires a granular access token with publish permissions and 2FA bypass enabled.
|
|
100
|
-
|
|
101
|
-
1. Go to [npmjs.com](https://www.npmjs.com) > Access Tokens > Generate New Token
|
|
102
|
-
2. Select "Granular Access Token"
|
|
103
|
-
3. Enable "Bypass 2FA for automation"
|
|
104
|
-
4. Set permissions to publish to `@matech/thebigpos-sdk`
|
|
105
|
-
|
|
106
|
-
Configure the token:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
npm config set //registry.npmjs.org/:_authToken YOUR_TOKEN
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Publish
|
|
113
|
-
|
|
114
|
-
**To latest (stable release):**
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
npm publish --access public
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
**To next (pre-release):**
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
npm publish --tag next
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**To a feature tag (for testing):**
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
npm publish --tag feature-name
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Installing the SDK
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
# Latest stable
|
|
136
|
-
yarn add @matech/thebigpos-sdk
|
|
137
|
-
|
|
138
|
-
# Next pre-release
|
|
139
|
-
yarn add @matech/thebigpos-sdk@next
|
|
140
|
-
|
|
141
|
-
# Specific version
|
|
142
|
-
yarn add @matech/thebigpos-sdk@X.Y.Z
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## Step 9: Clean up
|
|
146
|
-
|
|
147
|
-
1. **Revoke the NPM token** after publishing for security
|
|
148
|
-
2. **Create a Pull Request** from `release/X.Y.Z` to `develop` and `main`
|
|
149
|
-
3. **Create a GitHub Release** with release notes
|