@abyss-project/extract 0.0.0-stage → 1.0.0
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/.eslintrc.js +32 -0
- package/.prettierrc +5 -0
- package/README.md +21 -2
- package/dist/api/extraction-plan-preset.api.d.ts +9 -0
- package/dist/api/extraction-plan-preset.api.js +36 -0
- package/dist/api/extraction-plan-preset.api.js.map +1 -0
- package/dist/api/extraction-plan-preset.api.test.d.ts +1 -0
- package/dist/api/extraction-plan-preset.api.test.js +51 -0
- package/dist/api/extraction-plan-preset.api.test.js.map +1 -0
- package/dist/api/extraction-settings.api.d.ts +4 -0
- package/dist/api/extraction-settings.api.js +22 -0
- package/dist/api/extraction-settings.api.js.map +1 -0
- package/dist/api/extraction.api.d.ts +76 -0
- package/dist/api/extraction.api.js +414 -0
- package/dist/api/extraction.api.js.map +1 -0
- package/dist/api/extraction.application.api.d.ts +4 -0
- package/dist/api/extraction.application.api.js +23 -0
- package/dist/api/extraction.application.api.js.map +1 -0
- package/dist/api/extraction.application.api.test.d.ts +1 -0
- package/dist/api/extraction.application.api.test.js +69 -0
- package/dist/api/extraction.application.api.test.js.map +1 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +21 -0
- package/dist/api/index.js.map +1 -0
- package/dist/constants/extract.constants.d.ts +4 -0
- package/dist/constants/extract.constants.js +91 -0
- package/dist/constants/extract.constants.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +18 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/index.d.ts +127 -0
- package/dist/index.js +210 -0
- package/dist/index.js.map +1 -0
- package/dist/types/enum/api-error.enum.d.ts +31 -0
- package/dist/types/enum/api-error.enum.js +37 -0
- package/dist/types/enum/api-error.enum.js.map +1 -0
- package/dist/types/enum/combine-strategy.enum.d.ts +5 -0
- package/dist/types/enum/combine-strategy.enum.js +10 -0
- package/dist/types/enum/combine-strategy.enum.js.map +1 -0
- package/dist/types/enum/document-type.enum.d.ts +10 -0
- package/dist/types/enum/document-type.enum.js +15 -0
- package/dist/types/enum/document-type.enum.js.map +1 -0
- package/dist/types/enum/extract-bank.enum.d.ts +50 -0
- package/dist/types/enum/extract-bank.enum.js +327 -0
- package/dist/types/enum/extract-bank.enum.js.map +1 -0
- package/dist/types/enum/extract-field-format.enum.d.ts +7 -0
- package/dist/types/enum/extract-field-format.enum.js +12 -0
- package/dist/types/enum/extract-field-format.enum.js.map +1 -0
- package/dist/types/enum/extract-field-key.enum.d.ts +59 -0
- package/dist/types/enum/extract-field-key.enum.js +64 -0
- package/dist/types/enum/extract-field-key.enum.js.map +1 -0
- package/dist/types/enum/extraction-feedback-issue-type.enum.d.ts +8 -0
- package/dist/types/enum/extraction-feedback-issue-type.enum.js +13 -0
- package/dist/types/enum/extraction-feedback-issue-type.enum.js.map +1 -0
- package/dist/types/enum/extraction-step-status.enum.d.ts +6 -0
- package/dist/types/enum/extraction-step-status.enum.js +11 -0
- package/dist/types/enum/extraction-step-status.enum.js.map +1 -0
- package/dist/types/enum/extraction-warning.enum.d.ts +10 -0
- package/dist/types/enum/extraction-warning.enum.js +15 -0
- package/dist/types/enum/extraction-warning.enum.js.map +1 -0
- package/dist/types/enum/file-scan-status.enum.d.ts +1 -0
- package/dist/types/enum/file-scan-status.enum.js +3 -0
- package/dist/types/enum/file-scan-status.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +12 -0
- package/dist/types/enum/index.js +29 -0
- package/dist/types/enum/index.js.map +1 -0
- package/dist/types/enum/interpreter-kind.enum.d.ts +5 -0
- package/dist/types/enum/interpreter-kind.enum.js +10 -0
- package/dist/types/enum/interpreter-kind.enum.js.map +1 -0
- package/dist/types/enum/provider-kind.enum.d.ts +10 -0
- package/dist/types/enum/provider-kind.enum.js +16 -0
- package/dist/types/enum/provider-kind.enum.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interface/api/index.d.ts +5 -0
- package/dist/types/interface/api/index.js +22 -0
- package/dist/types/interface/api/index.js.map +1 -0
- package/dist/types/interface/api/requests/extraction.request.d.ts +259 -0
- package/dist/types/interface/api/requests/extraction.request.js +3 -0
- package/dist/types/interface/api/requests/extraction.request.js.map +1 -0
- package/dist/types/interface/api/requests/index.d.ts +1 -0
- package/dist/types/interface/api/requests/index.js +18 -0
- package/dist/types/interface/api/requests/index.js.map +1 -0
- package/dist/types/interface/api/responses/extraction.response.d.ts +424 -0
- package/dist/types/interface/api/responses/extraction.response.js +3 -0
- package/dist/types/interface/api/responses/extraction.response.js.map +1 -0
- package/dist/types/interface/api/responses/index.d.ts +1 -0
- package/dist/types/interface/api/responses/index.js +18 -0
- package/dist/types/interface/api/responses/index.js.map +1 -0
- package/dist/types/interface/api/type-message/api-error.d.ts +6 -0
- package/dist/types/interface/api/type-message/api-error.js +3 -0
- package/dist/types/interface/api/type-message/api-error.js.map +1 -0
- package/dist/types/interface/api/type-message/base-paginate.d.ts +10 -0
- package/dist/types/interface/api/type-message/base-paginate.js +3 -0
- package/dist/types/interface/api/type-message/base-paginate.js.map +1 -0
- package/dist/types/interface/api/type-message/response.d.ts +5 -0
- package/dist/types/interface/api/type-message/response.js +3 -0
- package/dist/types/interface/api/type-message/response.js.map +1 -0
- package/dist/types/interface/index.d.ts +2 -0
- package/dist/types/interface/index.js +19 -0
- package/dist/types/interface/index.js.map +1 -0
- package/dist/types/interface/models/extraction-fetched-provenance.dto.test.d.ts +1 -0
- package/dist/types/interface/models/extraction-fetched-provenance.dto.test.js +165 -0
- package/dist/types/interface/models/extraction-fetched-provenance.dto.test.js.map +1 -0
- package/dist/types/interface/models/extraction-plan.dto.d.ts +192 -0
- package/dist/types/interface/models/extraction-plan.dto.js +13 -0
- package/dist/types/interface/models/extraction-plan.dto.js.map +1 -0
- package/dist/types/interface/models/extraction-plan.dto.test.d.ts +1 -0
- package/dist/types/interface/models/extraction-plan.dto.test.js +40 -0
- package/dist/types/interface/models/extraction-plan.dto.test.js.map +1 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.d.ts +37 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.js +3 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.js.map +1 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.test.d.ts +1 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.test.js +32 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.test.js.map +1 -0
- package/dist/types/interface/models/extraction.dto.d.ts +255 -0
- package/dist/types/interface/models/extraction.dto.js +28 -0
- package/dist/types/interface/models/extraction.dto.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +3 -0
- package/dist/types/interface/models/index.js +20 -0
- package/dist/types/interface/models/index.js.map +1 -0
- package/dist/utils/enum.utils.d.ts +1 -0
- package/dist/utils/enum.utils.js +3 -0
- package/dist/utils/enum.utils.js.map +1 -0
- package/dist/utils/error.utils.d.ts +15 -0
- package/dist/utils/error.utils.js +25 -0
- package/dist/utils/error.utils.js.map +1 -0
- package/dist/utils/extraction-webhook.utils.d.ts +6 -0
- package/dist/utils/extraction-webhook.utils.js +17 -0
- package/dist/utils/extraction-webhook.utils.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +20 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +58 -4
- package/src/api/extraction-plan-preset.api.test.ts +24 -0
- package/src/api/extraction-plan-preset.api.ts +97 -0
- package/src/api/extraction-settings.api.ts +53 -0
- package/src/api/extraction.api.ts +1012 -0
- package/src/api/extraction.application.api.test.ts +55 -0
- package/src/api/extraction.application.api.ts +73 -0
- package/src/api/index.ts +4 -0
- package/src/constants/extract.constants.ts +109 -0
- package/src/constants/index.ts +1 -0
- package/src/index.ts +305 -0
- package/src/types/enum/api-error.enum.ts +33 -0
- package/src/types/enum/combine-strategy.enum.ts +7 -0
- package/src/types/enum/document-type.enum.ts +11 -0
- package/src/types/enum/extract-bank.enum.ts +363 -0
- package/src/types/enum/extract-field-format.enum.ts +16 -0
- package/src/types/enum/extract-field-key.enum.ts +77 -0
- package/src/types/enum/extraction-feedback-issue-type.enum.ts +10 -0
- package/src/types/enum/extraction-step-status.enum.ts +7 -0
- package/src/types/enum/extraction-warning.enum.ts +78 -0
- package/src/types/enum/file-scan-status.enum.ts +33 -0
- package/src/types/enum/index.ts +12 -0
- package/src/types/enum/interpreter-kind.enum.ts +7 -0
- package/src/types/enum/provider-kind.enum.ts +13 -0
- package/src/types/index.ts +2 -0
- package/src/types/interface/api/index.ts +5 -0
- package/src/types/interface/api/requests/extraction.request.ts +423 -0
- package/src/types/interface/api/requests/index.ts +1 -0
- package/src/types/interface/api/responses/extraction.response.ts +488 -0
- package/src/types/interface/api/responses/index.ts +1 -0
- package/src/types/interface/api/type-message/api-error.ts +7 -0
- package/src/types/interface/api/type-message/base-paginate.ts +11 -0
- package/src/types/interface/api/type-message/response.ts +6 -0
- package/src/types/interface/index.ts +2 -0
- package/src/types/interface/models/extraction-fetched-provenance.dto.test.ts +204 -0
- package/src/types/interface/models/extraction-plan.dto.test.ts +60 -0
- package/src/types/interface/models/extraction-plan.dto.ts +280 -0
- package/src/types/interface/models/extraction-spatial-template.dto.test.ts +48 -0
- package/src/types/interface/models/extraction-spatial-template.dto.ts +48 -0
- package/src/types/interface/models/extraction.dto.ts +399 -0
- package/src/types/interface/models/index.ts +3 -0
- package/src/types/tests/extract-bank-catalogue.spec.ts +74 -0
- package/src/utils/enum.utils.ts +1 -0
- package/src/utils/error.utils.ts +30 -0
- package/src/utils/extraction-webhook.utils.ts +30 -0
- package/src/utils/index.ts +3 -0
- package/tsconfig.check.json +15 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { IResponse } from '../type-message/response';
|
|
2
|
+
import type { IExtractionPlanPreset, IExtractModesData, IFieldValue } from '../../models/extraction-plan.dto';
|
|
3
|
+
import { IExtractionBankVersion, IExtraction, IExtractionMetadata, IExtractionFeedback, IExtractionFile, IExtractionTemplate, IExtractionTemplateVersion, IExtractionTransaction, IExtractionWebhookDelivery, ExtractionMode } from '../../models/extraction.dto';
|
|
4
|
+
export interface IExtractSyncData {
|
|
5
|
+
extraction_id: string;
|
|
6
|
+
file_id: string;
|
|
7
|
+
application_file_id: string | null;
|
|
8
|
+
cached: boolean;
|
|
9
|
+
records: IExtractionTransaction[];
|
|
10
|
+
metadata: IExtractionMetadata;
|
|
11
|
+
extraction: {
|
|
12
|
+
mode: ExtractionMode;
|
|
13
|
+
strategy_used: string | null;
|
|
14
|
+
confidence: number | null;
|
|
15
|
+
detected_bank: string | null;
|
|
16
|
+
detected_version: string | null;
|
|
17
|
+
balance_validated: boolean | null;
|
|
18
|
+
duration_ms: number | null;
|
|
19
|
+
warnings: string[];
|
|
20
|
+
alternatives: unknown[];
|
|
21
|
+
used_ocr: boolean;
|
|
22
|
+
ocr_page_count: number;
|
|
23
|
+
};
|
|
24
|
+
documentType: string | null;
|
|
25
|
+
documentTypeConfidence: number | null;
|
|
26
|
+
fields: Record<string, {
|
|
27
|
+
value: unknown;
|
|
28
|
+
confidence: number;
|
|
29
|
+
}> | null;
|
|
30
|
+
}
|
|
31
|
+
export type IExtractSyncResponse = IResponse<IExtractSyncData>;
|
|
32
|
+
export interface IExtractQueueData {
|
|
33
|
+
job_id: string;
|
|
34
|
+
status: string;
|
|
35
|
+
queued_at: string;
|
|
36
|
+
poll_url: string;
|
|
37
|
+
documentType: string | null;
|
|
38
|
+
documentTypeConfidence: number | null;
|
|
39
|
+
fields: Record<string, {
|
|
40
|
+
value: unknown;
|
|
41
|
+
confidence: number;
|
|
42
|
+
}> | null;
|
|
43
|
+
}
|
|
44
|
+
export type IExtractQueueResponse = IResponse<IExtractQueueData>;
|
|
45
|
+
export interface IExtractBulkData {
|
|
46
|
+
accepted: number;
|
|
47
|
+
rejected: number;
|
|
48
|
+
jobs: Array<{
|
|
49
|
+
index: number;
|
|
50
|
+
job_id: string;
|
|
51
|
+
}>;
|
|
52
|
+
errors: Array<{
|
|
53
|
+
index: number;
|
|
54
|
+
error: string;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
57
|
+
export type IExtractBulkResponse = IResponse<IExtractBulkData>;
|
|
58
|
+
export interface IDetectData {
|
|
59
|
+
pdfHash: string;
|
|
60
|
+
pageCount: number;
|
|
61
|
+
metadata: {
|
|
62
|
+
ibans: Array<{
|
|
63
|
+
iban: string;
|
|
64
|
+
bankCode: string;
|
|
65
|
+
countryCode: string;
|
|
66
|
+
}>;
|
|
67
|
+
bics: Array<{
|
|
68
|
+
bic: string;
|
|
69
|
+
bankCode: string;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
candidates: Array<{
|
|
73
|
+
id: string;
|
|
74
|
+
bankName: string;
|
|
75
|
+
version: string;
|
|
76
|
+
score: number;
|
|
77
|
+
matchedSignals: string[];
|
|
78
|
+
}>;
|
|
79
|
+
durationMs: number;
|
|
80
|
+
}
|
|
81
|
+
export type IDetectResponse = IResponse<IDetectData>;
|
|
82
|
+
export interface IDetectBulkData {
|
|
83
|
+
count: number;
|
|
84
|
+
results: Array<{
|
|
85
|
+
index: number;
|
|
86
|
+
result?: IDetectData;
|
|
87
|
+
error?: string;
|
|
88
|
+
}>;
|
|
89
|
+
}
|
|
90
|
+
export type IDetectBulkResponse = IResponse<IDetectBulkData>;
|
|
91
|
+
export interface IListFilesData {
|
|
92
|
+
data: IExtractionFile[];
|
|
93
|
+
total?: number;
|
|
94
|
+
}
|
|
95
|
+
export type IListFilesResponse = IListFilesData;
|
|
96
|
+
export type IGetFileResponse = IResponse<IExtractionFile>;
|
|
97
|
+
export interface IListFileExtractionsData {
|
|
98
|
+
data: IExtraction[];
|
|
99
|
+
total?: number;
|
|
100
|
+
}
|
|
101
|
+
export type IListFileExtractionsResponse = IListFileExtractionsData;
|
|
102
|
+
export interface IGetExtractionData extends IExtraction {
|
|
103
|
+
documentType: string | null;
|
|
104
|
+
documentTypeConfidence: number | null;
|
|
105
|
+
fields: Record<string, IFieldValue> | null;
|
|
106
|
+
}
|
|
107
|
+
export type IGetExtractionResponse = IResponse<IGetExtractionData>;
|
|
108
|
+
export interface ISearchExtractionRecordsResponse {
|
|
109
|
+
data: IExtractionTransaction[];
|
|
110
|
+
matched: number;
|
|
111
|
+
total: number;
|
|
112
|
+
}
|
|
113
|
+
export interface IDiffExtractionsData {
|
|
114
|
+
left: {
|
|
115
|
+
id: string;
|
|
116
|
+
mode: ExtractionMode;
|
|
117
|
+
recordsCount: number | null;
|
|
118
|
+
};
|
|
119
|
+
right: {
|
|
120
|
+
id: string;
|
|
121
|
+
mode: ExtractionMode;
|
|
122
|
+
recordsCount: number | null;
|
|
123
|
+
};
|
|
124
|
+
same: number;
|
|
125
|
+
added: IExtractionTransaction[];
|
|
126
|
+
removed: IExtractionTransaction[];
|
|
127
|
+
changed: Array<{
|
|
128
|
+
before: IExtractionTransaction;
|
|
129
|
+
after: IExtractionTransaction;
|
|
130
|
+
fields: string[];
|
|
131
|
+
}>;
|
|
132
|
+
summary: {
|
|
133
|
+
leftCount: number;
|
|
134
|
+
rightCount: number;
|
|
135
|
+
sumDeltaCents: number;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export type IDiffExtractionsResponse = IResponse<IDiffExtractionsData>;
|
|
139
|
+
export interface IAsyncExportData {
|
|
140
|
+
job_id: string;
|
|
141
|
+
status: string;
|
|
142
|
+
poll_url: string;
|
|
143
|
+
}
|
|
144
|
+
export type IAsyncExportResponse = IResponse<IAsyncExportData>;
|
|
145
|
+
export interface IGetExportJobData {
|
|
146
|
+
id: string;
|
|
147
|
+
status: string;
|
|
148
|
+
progress: number | object | string | boolean;
|
|
149
|
+
result: {
|
|
150
|
+
applicationFileId: string;
|
|
151
|
+
filename: string;
|
|
152
|
+
contentType: string;
|
|
153
|
+
byteSize: number;
|
|
154
|
+
} | null;
|
|
155
|
+
error: string | null;
|
|
156
|
+
}
|
|
157
|
+
export type IGetExportJobResponse = IResponse<IGetExportJobData>;
|
|
158
|
+
export interface ITemplateAndVersionData {
|
|
159
|
+
template: IExtractionTemplate;
|
|
160
|
+
version: IExtractionTemplateVersion;
|
|
161
|
+
warnings?: string[];
|
|
162
|
+
}
|
|
163
|
+
export type ICreateTemplateResponse = IResponse<ITemplateAndVersionData>;
|
|
164
|
+
export type IUpdateTemplateResponse = IResponse<ITemplateAndVersionData>;
|
|
165
|
+
export type IListTemplatesResponse = IResponse<IExtractionTemplate[]>;
|
|
166
|
+
export interface IGetTemplateData {
|
|
167
|
+
template: IExtractionTemplate;
|
|
168
|
+
latest_version: IExtractionTemplateVersion | null;
|
|
169
|
+
}
|
|
170
|
+
export type IGetTemplateResponse = IResponse<IGetTemplateData>;
|
|
171
|
+
export type IListTemplateVersionsResponse = IResponse<IExtractionTemplateVersion[]>;
|
|
172
|
+
export interface IGetTemplateWitnessUrlData {
|
|
173
|
+
url: string;
|
|
174
|
+
filename: string | null;
|
|
175
|
+
size_bytes: number | null;
|
|
176
|
+
}
|
|
177
|
+
export type IGetTemplateWitnessUrlResponse = IResponse<IGetTemplateWitnessUrlData>;
|
|
178
|
+
export interface IExtractionTemplateCollection {
|
|
179
|
+
$schema: 'abyss-rcb-template-collection/v1';
|
|
180
|
+
exported_at: string;
|
|
181
|
+
templates: Array<{
|
|
182
|
+
name: string;
|
|
183
|
+
description: string | null;
|
|
184
|
+
versions: Array<{
|
|
185
|
+
version: number;
|
|
186
|
+
comment: string | null;
|
|
187
|
+
template_json: Record<string, unknown>;
|
|
188
|
+
}>;
|
|
189
|
+
}>;
|
|
190
|
+
}
|
|
191
|
+
export interface IImportTemplateCollectionData {
|
|
192
|
+
imported: Array<{
|
|
193
|
+
originalName: string;
|
|
194
|
+
createdName: string;
|
|
195
|
+
templateId: string;
|
|
196
|
+
versions: number;
|
|
197
|
+
}>;
|
|
198
|
+
errors: Array<{
|
|
199
|
+
originalName: string;
|
|
200
|
+
error: string;
|
|
201
|
+
}>;
|
|
202
|
+
}
|
|
203
|
+
export type IImportTemplateCollectionResponse = IResponse<IImportTemplateCollectionData>;
|
|
204
|
+
export interface IExtractionJob {
|
|
205
|
+
id: string;
|
|
206
|
+
status: 'waiting' | 'active' | 'completed' | 'failed' | 'delayed' | 'paused' | 'pending' | 'stuck';
|
|
207
|
+
progress: number | object | string | boolean;
|
|
208
|
+
result: {
|
|
209
|
+
extractionId: string;
|
|
210
|
+
fileId: string;
|
|
211
|
+
cached: boolean;
|
|
212
|
+
recordsCount: number;
|
|
213
|
+
strategyUsed: string | null;
|
|
214
|
+
} | null;
|
|
215
|
+
error: string | null;
|
|
216
|
+
createdAt: number;
|
|
217
|
+
processedOn: number | null;
|
|
218
|
+
finishedOn: number | null;
|
|
219
|
+
attemptsMade: number;
|
|
220
|
+
}
|
|
221
|
+
export type IGetJobResponse = IResponse<IExtractionJob>;
|
|
222
|
+
export type ICreateFeedbackResponse = IResponse<IExtractionFeedback>;
|
|
223
|
+
export interface IListFeedbackResponse {
|
|
224
|
+
data: IExtractionFeedback[];
|
|
225
|
+
total?: number;
|
|
226
|
+
}
|
|
227
|
+
export type IGetFeedbackResponse = IResponse<IExtractionFeedback>;
|
|
228
|
+
export interface IExtractionHealth {
|
|
229
|
+
status: 'ok' | 'degraded' | 'down';
|
|
230
|
+
redis: 'ok' | 'down';
|
|
231
|
+
queue: 'ok' | 'down';
|
|
232
|
+
worker: 'ok' | 'down';
|
|
233
|
+
isShuttingDown: boolean;
|
|
234
|
+
rssMb: number;
|
|
235
|
+
heapUsedMb: number;
|
|
236
|
+
uptimeSec: number;
|
|
237
|
+
}
|
|
238
|
+
export type IHealthResponse = IResponse<IExtractionHealth>;
|
|
239
|
+
export interface IExtractionStats {
|
|
240
|
+
waiting: number;
|
|
241
|
+
active: number;
|
|
242
|
+
completed: number;
|
|
243
|
+
failed: number;
|
|
244
|
+
delayed: number;
|
|
245
|
+
workerConcurrency: number;
|
|
246
|
+
isPaused: boolean;
|
|
247
|
+
}
|
|
248
|
+
export type IStatsResponse = IResponse<IExtractionStats>;
|
|
249
|
+
export interface IExtractionUsageSummary {
|
|
250
|
+
totalEvents: number;
|
|
251
|
+
successCount: number;
|
|
252
|
+
failedCount: number;
|
|
253
|
+
cachedCount: number;
|
|
254
|
+
totalDurationMs: number;
|
|
255
|
+
totalRecordsExtracted: number;
|
|
256
|
+
totalBytesProcessed: number;
|
|
257
|
+
byEventType: Record<string, number>;
|
|
258
|
+
byBank: Record<string, number>;
|
|
259
|
+
}
|
|
260
|
+
export type ISummaryUsageResponse = IResponse<IExtractionUsageSummary>;
|
|
261
|
+
export interface IUsageByConfigRow {
|
|
262
|
+
planPresetId: string;
|
|
263
|
+
providerId: string | null;
|
|
264
|
+
interpreterId: string | null;
|
|
265
|
+
count: number;
|
|
266
|
+
successCount: number;
|
|
267
|
+
successRate: number;
|
|
268
|
+
avgDurationMs: number;
|
|
269
|
+
avgRecords: number;
|
|
270
|
+
ocrPagesConsumed: number;
|
|
271
|
+
}
|
|
272
|
+
export interface IUsageByConfig {
|
|
273
|
+
rows: IUsageByConfigRow[];
|
|
274
|
+
}
|
|
275
|
+
export type IUsageByConfigResponse = IResponse<IUsageByConfig>;
|
|
276
|
+
export interface IListWebhookDeliveriesResponse {
|
|
277
|
+
data: IExtractionWebhookDelivery[];
|
|
278
|
+
total?: number;
|
|
279
|
+
}
|
|
280
|
+
export type IGetWebhookDeliveryResponse = IResponse<IExtractionWebhookDelivery>;
|
|
281
|
+
export interface IGetSharedExtractionData {
|
|
282
|
+
id: string;
|
|
283
|
+
mode: ExtractionMode;
|
|
284
|
+
strategy_used: string | null;
|
|
285
|
+
confidence: number | null;
|
|
286
|
+
records_count: number | null;
|
|
287
|
+
balance_validated: boolean | null;
|
|
288
|
+
records: IExtractionTransaction[];
|
|
289
|
+
metadata: IExtractionMetadata;
|
|
290
|
+
warnings: string[];
|
|
291
|
+
share_expires_at: string | null;
|
|
292
|
+
created_at: string;
|
|
293
|
+
}
|
|
294
|
+
export type IGetSharedExtractionResponse = IResponse<IGetSharedExtractionData>;
|
|
295
|
+
export interface IMintShareExtractionData {
|
|
296
|
+
share_url: string;
|
|
297
|
+
share_token: string;
|
|
298
|
+
share_expires_at: string | null;
|
|
299
|
+
}
|
|
300
|
+
export type IMintShareExtractionResponse = IResponse<IMintShareExtractionData>;
|
|
301
|
+
export interface IChangelogData {
|
|
302
|
+
current_version: string;
|
|
303
|
+
entries: Array<{
|
|
304
|
+
version: string;
|
|
305
|
+
date: string;
|
|
306
|
+
highlights: string[];
|
|
307
|
+
}>;
|
|
308
|
+
}
|
|
309
|
+
export type IChangelogResponse = IResponse<IChangelogData>;
|
|
310
|
+
export interface IListBankVersionsAdminResponse {
|
|
311
|
+
data: IExtractionBankVersion[];
|
|
312
|
+
total?: number;
|
|
313
|
+
}
|
|
314
|
+
export type IGetBankVersionAdminResponse = IResponse<IExtractionBankVersion>;
|
|
315
|
+
export type IUpsertBankVersionAdminResponse = IResponse<IExtractionBankVersion>;
|
|
316
|
+
export interface IReloadBankVersionsAdminData {
|
|
317
|
+
loaded: number;
|
|
318
|
+
skipped: number;
|
|
319
|
+
total: number;
|
|
320
|
+
}
|
|
321
|
+
export type IReloadBankVersionsAdminResponse = IResponse<IReloadBankVersionsAdminData>;
|
|
322
|
+
export interface IDetectorReplayAdminData {
|
|
323
|
+
scanned: number;
|
|
324
|
+
kept: number;
|
|
325
|
+
flipped: number;
|
|
326
|
+
newDetections: number;
|
|
327
|
+
skipped: number;
|
|
328
|
+
details: unknown[];
|
|
329
|
+
durationMs: number;
|
|
330
|
+
}
|
|
331
|
+
export type IDetectorReplayAdminResponse = IResponse<IDetectorReplayAdminData>;
|
|
332
|
+
export interface IListRequestLogAdminData {
|
|
333
|
+
data: Array<{
|
|
334
|
+
ts: number;
|
|
335
|
+
method: string;
|
|
336
|
+
path: string;
|
|
337
|
+
status: number;
|
|
338
|
+
durationMs: number;
|
|
339
|
+
userId: string | null;
|
|
340
|
+
requestId: string | null;
|
|
341
|
+
rateLimitBucket: string | null;
|
|
342
|
+
}>;
|
|
343
|
+
meta: {
|
|
344
|
+
capacity: number;
|
|
345
|
+
used: number;
|
|
346
|
+
oldestTs: number | null;
|
|
347
|
+
newestTs: number | null;
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
export interface IExtractionPerBankMetric {
|
|
351
|
+
bank: string;
|
|
352
|
+
extractions: number;
|
|
353
|
+
avgConfidence: number;
|
|
354
|
+
avgRecords: number;
|
|
355
|
+
balanceValidatedRate: number;
|
|
356
|
+
avgDurationMs: number;
|
|
357
|
+
feedbackOpen: number;
|
|
358
|
+
}
|
|
359
|
+
export type IPerBankMetricsAdminResponse = IResponse<IExtractionPerBankMetric[]>;
|
|
360
|
+
export interface IExtractionLatencyBucket {
|
|
361
|
+
bucket: string;
|
|
362
|
+
count: number;
|
|
363
|
+
}
|
|
364
|
+
export type ILatencyMetricsAdminResponse = IResponse<IExtractionLatencyBucket[]>;
|
|
365
|
+
export interface IExtractionOverviewMetrics {
|
|
366
|
+
last24h: {
|
|
367
|
+
extractions: number;
|
|
368
|
+
failures: number;
|
|
369
|
+
avgLatencyMs: number;
|
|
370
|
+
};
|
|
371
|
+
last30d: {
|
|
372
|
+
extractions: number;
|
|
373
|
+
uniqueUsers: number;
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
export type IOverviewMetricsAdminResponse = IResponse<IExtractionOverviewMetrics>;
|
|
377
|
+
import type { IExtractionWebhook } from '../../models/extraction.dto';
|
|
378
|
+
export interface IPaginateExtractionWebhookData {
|
|
379
|
+
rows: IExtractionWebhook[];
|
|
380
|
+
total: number;
|
|
381
|
+
}
|
|
382
|
+
export type IPaginateExtractionWebhookResponse = IResponse<IPaginateExtractionWebhookData>;
|
|
383
|
+
export type IGetExtractionWebhookResponse = IResponse<{
|
|
384
|
+
webhook: IExtractionWebhook;
|
|
385
|
+
}>;
|
|
386
|
+
export type ICreateExtractionWebhookResponse = IResponse<{
|
|
387
|
+
webhook: IExtractionWebhook;
|
|
388
|
+
}>;
|
|
389
|
+
export type IUpdateExtractionWebhookResponse = IResponse<{
|
|
390
|
+
webhook: IExtractionWebhook;
|
|
391
|
+
}>;
|
|
392
|
+
export type IDeleteExtractionWebhookResponse = IResponse<{
|
|
393
|
+
ok: true;
|
|
394
|
+
}>;
|
|
395
|
+
export type IResetSecretExtractionWebhookResponse = IResponse<{
|
|
396
|
+
webhook: IExtractionWebhook;
|
|
397
|
+
}>;
|
|
398
|
+
export interface IGetExtractionSettingsResponse {
|
|
399
|
+
data: {
|
|
400
|
+
improvement_default: boolean;
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
export type IUpsertExtractionSettingsResponse = IGetExtractionSettingsResponse;
|
|
404
|
+
export interface IToggleExtractionTrainingResponse {
|
|
405
|
+
data: {
|
|
406
|
+
id: string;
|
|
407
|
+
usable_for_training: boolean;
|
|
408
|
+
training_file_id: string | null;
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
export interface IListModesResponse {
|
|
412
|
+
data: IExtractModesData;
|
|
413
|
+
}
|
|
414
|
+
export interface IListPlanPresetsResponse {
|
|
415
|
+
data: IExtractionPlanPreset[];
|
|
416
|
+
}
|
|
417
|
+
export interface IGetPlanPresetResponse {
|
|
418
|
+
data: IExtractionPlanPreset;
|
|
419
|
+
}
|
|
420
|
+
export interface IDeletePlanPresetResponse {
|
|
421
|
+
data: {
|
|
422
|
+
id: string;
|
|
423
|
+
};
|
|
424
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extraction.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/extraction.response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './extraction.response';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./extraction.response"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-error.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/type-message/api-error.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-paginate.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/type-message/base-paginate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/type-message/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
18
|
+
__exportStar(require("./api"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,wCAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|