@abyss-project/tools 1.0.5 → 1.1.1
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/dist/api/beam.api.d.ts +48 -0
- package/dist/api/beam.api.js +104 -0
- package/dist/api/beam.api.js.map +1 -0
- package/dist/api/extraction-plan-preset.api.d.ts +9 -0
- package/dist/api/extraction-plan-preset.api.js +23 -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 +41 -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 +74 -0
- package/dist/api/extraction.api.js +416 -0
- package/dist/api/extraction.api.js.map +1 -0
- package/dist/api/index.d.ts +4 -1
- package/dist/api/index.js +4 -1
- package/dist/api/index.js.map +1 -1
- package/dist/constants/beam.constants.d.ts +1 -0
- package/dist/constants/beam.constants.js +5 -0
- package/dist/constants/beam.constants.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/index.d.ts +107 -58
- package/dist/index.js +105 -58
- package/dist/index.js.map +1 -1
- package/dist/types/enum/beam.enum.d.ts +12 -0
- package/dist/types/enum/beam.enum.js +18 -0
- package/dist/types/enum/beam.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/content-share.enum.d.ts +3 -1
- package/dist/types/enum/content-share.enum.js +2 -0
- package/dist/types/enum/content-share.enum.js.map +1 -1
- package/dist/types/enum/document-type.enum.d.ts +9 -0
- package/dist/types/enum/document-type.enum.js +14 -0
- package/dist/types/enum/document-type.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-warning.enum.d.ts +7 -0
- package/dist/types/enum/extraction-warning.enum.js +12 -0
- package/dist/types/enum/extraction-warning.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +7 -0
- package/dist/types/enum/index.js +7 -0
- package/dist/types/enum/index.js.map +1 -1
- 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/interface/api/requests/beam.request.d.ts +122 -0
- package/dist/types/interface/api/{responses/pdf.response.js → requests/beam.request.js} +1 -1
- package/dist/types/interface/api/requests/beam.request.js.map +1 -0
- package/dist/types/interface/api/requests/{rcb.request.d.ts → extraction.request.d.ts} +81 -52
- package/dist/types/interface/api/requests/{pdf.public.request.js → extraction.request.js} +1 -1
- package/dist/types/interface/api/requests/extraction.request.js.map +1 -0
- package/dist/types/interface/api/requests/index.d.ts +2 -1
- package/dist/types/interface/api/requests/index.js +2 -1
- package/dist/types/interface/api/requests/index.js.map +1 -1
- package/dist/types/interface/api/responses/beam.response.d.ts +92 -0
- package/dist/types/interface/api/responses/{rcb.response.js → beam.response.js} +1 -1
- package/dist/types/interface/api/responses/beam.response.js.map +1 -0
- package/dist/types/interface/api/responses/extraction.response.d.ts +403 -0
- package/dist/types/interface/api/{requests/user-tag.request.js → responses/extraction.response.js} +1 -1
- package/dist/types/interface/api/responses/extraction.response.js.map +1 -0
- package/dist/types/interface/api/responses/index.d.ts +2 -1
- package/dist/types/interface/api/responses/index.js +2 -1
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/models/beam.dto.d.ts +58 -0
- package/dist/types/interface/{api/requests/pdf.request.js → models/beam.dto.js} +1 -1
- package/dist/types/interface/models/beam.dto.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 +159 -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 +163 -0
- package/dist/types/interface/models/extraction-plan.dto.js +11 -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 +35 -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/{api/requests/rcb.request.js → models/extraction-spatial-template.dto.js} +1 -1
- 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 +15 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.test.js.map +1 -0
- package/dist/types/interface/models/{rcb.dto.d.ts → extraction.dto.d.ts} +64 -48
- 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 +4 -1
- package/dist/types/interface/models/index.js +4 -1
- package/dist/types/interface/models/index.js.map +1 -1
- package/dist/types/interface/models/organization.dto.d.ts +2 -0
- package/dist/utils/{rcb-webhook.utils.d.ts → extraction-webhook.utils.d.ts} +2 -2
- package/dist/utils/{rcb-webhook.utils.js → extraction-webhook.utils.js} +4 -4
- package/dist/utils/extraction-webhook.utils.js.map +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/beam.api.ts +300 -0
- package/src/api/extraction-plan-preset.api.test.ts +24 -0
- package/src/api/extraction-plan-preset.api.ts +51 -0
- package/src/api/extraction-settings.api.ts +59 -0
- package/src/api/extraction.api.ts +899 -0
- package/src/api/index.ts +56 -51
- package/src/api/tests/beam.api.spec.ts +42 -0
- package/src/constants/beam.constants.ts +4 -0
- package/src/constants/index.ts +6 -5
- package/src/index.ts +840 -747
- package/src/types/enum/beam.enum.ts +24 -0
- package/src/types/enum/combine-strategy.enum.ts +7 -0
- package/src/types/enum/content-share.enum.ts +38 -36
- package/src/types/enum/document-type.enum.ts +10 -0
- package/src/types/enum/extraction-feedback-issue-type.enum.ts +10 -0
- package/src/types/enum/extraction-warning.enum.ts +21 -0
- package/src/types/enum/index.ts +13 -6
- package/src/types/enum/interpreter-kind.enum.ts +7 -0
- package/src/types/enum/provider-kind.enum.ts +13 -0
- package/src/types/interface/api/requests/beam.request.ts +152 -0
- package/src/types/interface/api/requests/extraction.request.ts +366 -0
- package/src/types/interface/api/requests/index.ts +29 -28
- package/src/types/interface/api/responses/beam.response.ts +122 -0
- package/src/types/interface/api/responses/extraction.response.ts +454 -0
- package/src/types/interface/api/responses/index.ts +33 -32
- package/src/types/interface/models/beam.dto.ts +67 -0
- package/src/types/interface/models/extraction-fetched-provenance.dto.test.ts +193 -0
- package/src/types/interface/models/extraction-plan.dto.test.ts +47 -0
- package/src/types/interface/models/extraction-plan.dto.ts +241 -0
- package/src/types/interface/models/extraction-spatial-template.dto.test.ts +27 -0
- package/src/types/interface/models/extraction-spatial-template.dto.ts +48 -0
- package/src/types/interface/models/{rcb.dto.ts → extraction.dto.ts} +317 -267
- package/src/types/interface/models/index.ts +34 -31
- package/src/types/interface/models/organization.dto.ts +21 -12
- package/src/types/tests/beam-management-types.spec.ts +38 -0
- package/src/types/tests/beam-share-enums.spec.ts +11 -0
- package/src/types/tests/beam.dto.spec.ts +61 -0
- package/src/types/tests/beam.request-response.spec.ts +43 -0
- package/src/utils/{rcb-webhook.utils.ts → extraction-webhook.utils.ts} +30 -30
- package/src/utils/index.ts +6 -6
- package/tsconfig.json +36 -35
- package/dist/api/atlas-page-content.api.d.ts +0 -0
- package/dist/api/atlas-page-content.api.js +0 -2
- package/dist/api/atlas-page-content.api.js.map +0 -1
- package/dist/api/pdf.api.d.ts +0 -15
- package/dist/api/pdf.api.js +0 -61
- package/dist/api/pdf.api.js.map +0 -1
- package/dist/api/pdf.public.api.d.ts +0 -8
- package/dist/api/pdf.public.api.js +0 -33
- package/dist/api/pdf.public.api.js.map +0 -1
- package/dist/api/rcb.api.d.ts +0 -72
- package/dist/api/rcb.api.js +0 -400
- package/dist/api/rcb.api.js.map +0 -1
- package/dist/api/user-tag.api.d.ts +0 -9
- package/dist/api/user-tag.api.js +0 -37
- package/dist/api/user-tag.api.js.map +0 -1
- package/dist/constants/user-tag.constants.d.ts +0 -3
- package/dist/constants/user-tag.constants.js +0 -7
- package/dist/constants/user-tag.constants.js.map +0 -1
- package/dist/types/enum/pdf-session.enum.d.ts +0 -10
- package/dist/types/enum/pdf-session.enum.js +0 -16
- package/dist/types/enum/pdf-session.enum.js.map +0 -1
- package/dist/types/interface/api/requests/pdf.public.request.d.ts +0 -19
- package/dist/types/interface/api/requests/pdf.public.request.js.map +0 -1
- package/dist/types/interface/api/requests/pdf.request.d.ts +0 -50
- package/dist/types/interface/api/requests/pdf.request.js.map +0 -1
- package/dist/types/interface/api/requests/rcb.request.js.map +0 -1
- package/dist/types/interface/api/requests/user-tag.request.d.ts +0 -44
- package/dist/types/interface/api/requests/user-tag.request.js.map +0 -1
- package/dist/types/interface/api/responses/pdf.public.response.d.ts +0 -33
- package/dist/types/interface/api/responses/pdf.public.response.js +0 -3
- package/dist/types/interface/api/responses/pdf.public.response.js.map +0 -1
- package/dist/types/interface/api/responses/pdf.response.d.ts +0 -35
- package/dist/types/interface/api/responses/pdf.response.js.map +0 -1
- package/dist/types/interface/api/responses/rcb.response.d.ts +0 -376
- package/dist/types/interface/api/responses/rcb.response.js.map +0 -1
- package/dist/types/interface/api/responses/user-tag.response.d.ts +0 -32
- package/dist/types/interface/api/responses/user-tag.response.js +0 -3
- package/dist/types/interface/api/responses/user-tag.response.js.map +0 -1
- package/dist/types/interface/models/pdf-session.dto.d.ts +0 -28
- package/dist/types/interface/models/pdf-session.dto.js +0 -3
- package/dist/types/interface/models/pdf-session.dto.js.map +0 -1
- package/dist/types/interface/models/rcb.dto.js +0 -26
- package/dist/types/interface/models/rcb.dto.js.map +0 -1
- package/dist/types/interface/models/user-tag.dto.d.ts +0 -22
- package/dist/types/interface/models/user-tag.dto.js +0 -3
- package/dist/types/interface/models/user-tag.dto.js.map +0 -1
- package/dist/utils/rcb-webhook.utils.js.map +0 -1
- package/src/api/rcb.api.ts +0 -829
- package/src/types/interface/api/requests/rcb.request.ts +0 -267
- package/src/types/interface/api/responses/rcb.response.ts +0 -399
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
// ──────────────────────────────────────────────
|
|
2
|
+
// Extraction API responses.
|
|
3
|
+
// ──────────────────────────────────────────────
|
|
4
|
+
|
|
5
|
+
import { IResponse } from '../type-message/response';
|
|
6
|
+
import type { IExtractionPlanPreset, IExtractModesData, IFieldValue } from '../../models/extraction-plan.dto';
|
|
7
|
+
import {
|
|
8
|
+
IExtractionBankVersion,
|
|
9
|
+
IExtraction,
|
|
10
|
+
IExtractionMetadata,
|
|
11
|
+
IExtractionFeedback,
|
|
12
|
+
IExtractionFile,
|
|
13
|
+
IExtractionTemplate,
|
|
14
|
+
IExtractionTemplateVersion,
|
|
15
|
+
IExtractionTransaction,
|
|
16
|
+
IExtractionWebhookDelivery,
|
|
17
|
+
ExtractionMode,
|
|
18
|
+
} from '../../models/extraction.dto';
|
|
19
|
+
|
|
20
|
+
// ─── EXTRACT ─────────────────────────────────
|
|
21
|
+
|
|
22
|
+
export interface IExtractSyncData {
|
|
23
|
+
extraction_id: string;
|
|
24
|
+
file_id: string;
|
|
25
|
+
application_file_id: string | null;
|
|
26
|
+
cached: boolean;
|
|
27
|
+
records: IExtractionTransaction[];
|
|
28
|
+
metadata: IExtractionMetadata;
|
|
29
|
+
extraction: {
|
|
30
|
+
mode: ExtractionMode;
|
|
31
|
+
strategy_used: string | null;
|
|
32
|
+
confidence: number | null;
|
|
33
|
+
detected_bank: string | null;
|
|
34
|
+
detected_version: string | null;
|
|
35
|
+
balance_validated: boolean | null;
|
|
36
|
+
duration_ms: number | null;
|
|
37
|
+
warnings: string[];
|
|
38
|
+
alternatives: unknown[];
|
|
39
|
+
/** Whether the OCR layer was used for this extraction run. */
|
|
40
|
+
used_ocr: boolean;
|
|
41
|
+
/** Number of pages processed by the OCR layer. */
|
|
42
|
+
ocr_page_count: number;
|
|
43
|
+
};
|
|
44
|
+
documentType: string | null;
|
|
45
|
+
documentTypeConfidence: number | null;
|
|
46
|
+
fields: Record<string, { value: unknown; confidence: number }> | null;
|
|
47
|
+
}
|
|
48
|
+
export type IExtractSyncResponse = IResponse<IExtractSyncData>;
|
|
49
|
+
|
|
50
|
+
export interface IExtractQueueData {
|
|
51
|
+
job_id: string;
|
|
52
|
+
status: string;
|
|
53
|
+
queued_at: string;
|
|
54
|
+
poll_url: string;
|
|
55
|
+
documentType: string | null;
|
|
56
|
+
documentTypeConfidence: number | null;
|
|
57
|
+
fields: Record<string, { value: unknown; confidence: number }> | null;
|
|
58
|
+
}
|
|
59
|
+
export type IExtractQueueResponse = IResponse<IExtractQueueData>;
|
|
60
|
+
|
|
61
|
+
export interface IExtractBulkData {
|
|
62
|
+
accepted: number;
|
|
63
|
+
rejected: number;
|
|
64
|
+
jobs: Array<{ index: number; job_id: string }>;
|
|
65
|
+
errors: Array<{ index: number; error: string }>;
|
|
66
|
+
}
|
|
67
|
+
export type IExtractBulkResponse = IResponse<IExtractBulkData>;
|
|
68
|
+
|
|
69
|
+
// ─── DETECT ──────────────────────────────────
|
|
70
|
+
|
|
71
|
+
export interface IDetectData {
|
|
72
|
+
pdfHash: string;
|
|
73
|
+
pageCount: number;
|
|
74
|
+
metadata: {
|
|
75
|
+
ibans: Array<{ iban: string; bankCode: string; countryCode: string }>;
|
|
76
|
+
bics: Array<{ bic: string; bankCode: string }>;
|
|
77
|
+
};
|
|
78
|
+
candidates: Array<{
|
|
79
|
+
id: string;
|
|
80
|
+
bankName: string;
|
|
81
|
+
version: string;
|
|
82
|
+
score: number;
|
|
83
|
+
matchedSignals: string[];
|
|
84
|
+
}>;
|
|
85
|
+
durationMs: number;
|
|
86
|
+
}
|
|
87
|
+
export type IDetectResponse = IResponse<IDetectData>;
|
|
88
|
+
|
|
89
|
+
export interface IDetectBulkData {
|
|
90
|
+
count: number;
|
|
91
|
+
results: Array<{ index: number; result?: IDetectData; error?: string }>;
|
|
92
|
+
}
|
|
93
|
+
export type IDetectBulkResponse = IResponse<IDetectBulkData>;
|
|
94
|
+
|
|
95
|
+
// ─── FILES / EXTRACTIONS ─────────────────────
|
|
96
|
+
|
|
97
|
+
export interface IListFilesData {
|
|
98
|
+
data: IExtractionFile[];
|
|
99
|
+
total?: number;
|
|
100
|
+
}
|
|
101
|
+
export type IListFilesResponse = IListFilesData;
|
|
102
|
+
|
|
103
|
+
export type IGetFileResponse = IResponse<IExtractionFile>;
|
|
104
|
+
|
|
105
|
+
export interface IListFileExtractionsData {
|
|
106
|
+
data: IExtraction[];
|
|
107
|
+
total?: number;
|
|
108
|
+
}
|
|
109
|
+
export type IListFileExtractionsResponse = IListFileExtractionsData;
|
|
110
|
+
|
|
111
|
+
export interface IGetExtractionData extends IExtraction {
|
|
112
|
+
documentType: string | null;
|
|
113
|
+
documentTypeConfidence: number | null;
|
|
114
|
+
/**
|
|
115
|
+
* `fieldsJson` exposed under the public name `fields`. Widened (V2-P1,
|
|
116
|
+
* ADDITIVE) to the IFieldValue superset — value + confidence stay at the same
|
|
117
|
+
* path; the plan path adds chosen / sources / signals / agreement provenance.
|
|
118
|
+
* `executionManifest` + `globalConfidence` are inherited (optional) from
|
|
119
|
+
* IExtraction.
|
|
120
|
+
*/
|
|
121
|
+
fields: Record<string, IFieldValue> | null;
|
|
122
|
+
}
|
|
123
|
+
export type IGetExtractionResponse = IResponse<IGetExtractionData>;
|
|
124
|
+
|
|
125
|
+
export interface ISearchExtractionRecordsResponse {
|
|
126
|
+
data: IExtractionTransaction[];
|
|
127
|
+
matched: number;
|
|
128
|
+
total: number;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface IDiffExtractionsData {
|
|
132
|
+
left: { id: string; mode: ExtractionMode; recordsCount: number | null };
|
|
133
|
+
right: { id: string; mode: ExtractionMode; recordsCount: number | null };
|
|
134
|
+
same: number;
|
|
135
|
+
added: IExtractionTransaction[];
|
|
136
|
+
removed: IExtractionTransaction[];
|
|
137
|
+
changed: Array<{ before: IExtractionTransaction; after: IExtractionTransaction; fields: string[] }>;
|
|
138
|
+
summary: { leftCount: number; rightCount: number; sumDeltaCents: number };
|
|
139
|
+
}
|
|
140
|
+
export type IDiffExtractionsResponse = IResponse<IDiffExtractionsData>;
|
|
141
|
+
|
|
142
|
+
export interface IAsyncExportData {
|
|
143
|
+
job_id: string;
|
|
144
|
+
status: string;
|
|
145
|
+
poll_url: string;
|
|
146
|
+
}
|
|
147
|
+
export type IAsyncExportResponse = IResponse<IAsyncExportData>;
|
|
148
|
+
|
|
149
|
+
export interface IGetExportJobData {
|
|
150
|
+
id: string;
|
|
151
|
+
status: string;
|
|
152
|
+
progress: number | object | string | boolean;
|
|
153
|
+
result: {
|
|
154
|
+
applicationFileId: string;
|
|
155
|
+
filename: string;
|
|
156
|
+
contentType: string;
|
|
157
|
+
byteSize: number;
|
|
158
|
+
} | null;
|
|
159
|
+
error: string | null;
|
|
160
|
+
}
|
|
161
|
+
export type IGetExportJobResponse = IResponse<IGetExportJobData>;
|
|
162
|
+
|
|
163
|
+
// ─── TEMPLATES ───────────────────────────────
|
|
164
|
+
|
|
165
|
+
export interface ITemplateAndVersionData {
|
|
166
|
+
template: IExtractionTemplate;
|
|
167
|
+
version: IExtractionTemplateVersion;
|
|
168
|
+
warnings?: string[];
|
|
169
|
+
}
|
|
170
|
+
export type ICreateTemplateResponse = IResponse<ITemplateAndVersionData>;
|
|
171
|
+
export type IUpdateTemplateResponse = IResponse<ITemplateAndVersionData>;
|
|
172
|
+
|
|
173
|
+
export type IListTemplatesResponse = IResponse<IExtractionTemplate[]>;
|
|
174
|
+
|
|
175
|
+
export interface IGetTemplateData {
|
|
176
|
+
template: IExtractionTemplate;
|
|
177
|
+
latest_version: IExtractionTemplateVersion | null;
|
|
178
|
+
}
|
|
179
|
+
export type IGetTemplateResponse = IResponse<IGetTemplateData>;
|
|
180
|
+
|
|
181
|
+
export type IListTemplateVersionsResponse = IResponse<IExtractionTemplateVersion[]>;
|
|
182
|
+
|
|
183
|
+
// Deferred wire-schema rename — must match server SCHEMA constant in
|
|
184
|
+
// extraction-template-portability.service.ts; rename together in the server/main batch.
|
|
185
|
+
export interface IExtractionTemplateCollection {
|
|
186
|
+
$schema: 'abyss-rcb-template-collection/v1';
|
|
187
|
+
exported_at: string;
|
|
188
|
+
templates: Array<{
|
|
189
|
+
name: string;
|
|
190
|
+
description: string | null;
|
|
191
|
+
versions: Array<{
|
|
192
|
+
version: number;
|
|
193
|
+
comment: string | null;
|
|
194
|
+
template_json: Record<string, unknown>;
|
|
195
|
+
}>;
|
|
196
|
+
}>;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface IImportTemplateCollectionData {
|
|
200
|
+
imported: Array<{
|
|
201
|
+
originalName: string;
|
|
202
|
+
createdName: string;
|
|
203
|
+
templateId: string;
|
|
204
|
+
versions: number;
|
|
205
|
+
}>;
|
|
206
|
+
errors: Array<{ originalName: string; error: string }>;
|
|
207
|
+
}
|
|
208
|
+
export type IImportTemplateCollectionResponse = IResponse<IImportTemplateCollectionData>;
|
|
209
|
+
|
|
210
|
+
// ─── JOBS ────────────────────────────────────
|
|
211
|
+
|
|
212
|
+
export interface IExtractionJob {
|
|
213
|
+
id: string;
|
|
214
|
+
status:
|
|
215
|
+
| 'waiting'
|
|
216
|
+
| 'active'
|
|
217
|
+
| 'completed'
|
|
218
|
+
| 'failed'
|
|
219
|
+
| 'delayed'
|
|
220
|
+
| 'paused'
|
|
221
|
+
| 'pending'
|
|
222
|
+
| 'stuck';
|
|
223
|
+
progress: number | object | string | boolean;
|
|
224
|
+
result: {
|
|
225
|
+
extractionId: string;
|
|
226
|
+
fileId: string;
|
|
227
|
+
cached: boolean;
|
|
228
|
+
recordsCount: number;
|
|
229
|
+
strategyUsed: string | null;
|
|
230
|
+
} | null;
|
|
231
|
+
error: string | null;
|
|
232
|
+
createdAt: number;
|
|
233
|
+
processedOn: number | null;
|
|
234
|
+
finishedOn: number | null;
|
|
235
|
+
attemptsMade: number;
|
|
236
|
+
}
|
|
237
|
+
export type IGetJobResponse = IResponse<IExtractionJob>;
|
|
238
|
+
|
|
239
|
+
// ─── FEEDBACK ────────────────────────────────
|
|
240
|
+
|
|
241
|
+
export type ICreateFeedbackResponse = IResponse<IExtractionFeedback>;
|
|
242
|
+
export interface IListFeedbackResponse {
|
|
243
|
+
data: IExtractionFeedback[];
|
|
244
|
+
total?: number;
|
|
245
|
+
}
|
|
246
|
+
export type IGetFeedbackResponse = IResponse<IExtractionFeedback>;
|
|
247
|
+
|
|
248
|
+
// ─── HEALTH / STATS ─────────────────────────
|
|
249
|
+
|
|
250
|
+
export interface IExtractionHealth {
|
|
251
|
+
status: 'ok' | 'degraded' | 'down';
|
|
252
|
+
redis: 'ok' | 'down';
|
|
253
|
+
queue: 'ok' | 'down';
|
|
254
|
+
worker: 'ok' | 'down';
|
|
255
|
+
isShuttingDown: boolean;
|
|
256
|
+
rssMb: number;
|
|
257
|
+
heapUsedMb: number;
|
|
258
|
+
uptimeSec: number;
|
|
259
|
+
}
|
|
260
|
+
export type IHealthResponse = IResponse<IExtractionHealth>;
|
|
261
|
+
|
|
262
|
+
export interface IExtractionStats {
|
|
263
|
+
waiting: number;
|
|
264
|
+
active: number;
|
|
265
|
+
completed: number;
|
|
266
|
+
failed: number;
|
|
267
|
+
delayed: number;
|
|
268
|
+
workerConcurrency: number;
|
|
269
|
+
isPaused: boolean;
|
|
270
|
+
}
|
|
271
|
+
export type IStatsResponse = IResponse<IExtractionStats>;
|
|
272
|
+
|
|
273
|
+
export interface IExtractionUsageSummary {
|
|
274
|
+
totalEvents: number;
|
|
275
|
+
successCount: number;
|
|
276
|
+
failedCount: number;
|
|
277
|
+
cachedCount: number;
|
|
278
|
+
totalDurationMs: number;
|
|
279
|
+
totalRecordsExtracted: number;
|
|
280
|
+
totalBytesProcessed: number;
|
|
281
|
+
byEventType: Record<string, number>;
|
|
282
|
+
byBank: Record<string, number>;
|
|
283
|
+
}
|
|
284
|
+
export type ISummaryUsageResponse = IResponse<IExtractionUsageSummary>;
|
|
285
|
+
|
|
286
|
+
// ─── WEBHOOK DELIVERIES ─────────────────────
|
|
287
|
+
|
|
288
|
+
export interface IListWebhookDeliveriesResponse {
|
|
289
|
+
data: IExtractionWebhookDelivery[];
|
|
290
|
+
total?: number;
|
|
291
|
+
}
|
|
292
|
+
export type IGetWebhookDeliveryResponse = IResponse<IExtractionWebhookDelivery>;
|
|
293
|
+
|
|
294
|
+
// ─── SHARE (public) ──────────────────────────
|
|
295
|
+
|
|
296
|
+
export interface IGetSharedExtractionData {
|
|
297
|
+
id: string;
|
|
298
|
+
mode: ExtractionMode;
|
|
299
|
+
strategy_used: string | null;
|
|
300
|
+
confidence: number | null;
|
|
301
|
+
records_count: number | null;
|
|
302
|
+
balance_validated: boolean | null;
|
|
303
|
+
records: IExtractionTransaction[];
|
|
304
|
+
metadata: IExtractionMetadata;
|
|
305
|
+
warnings: string[];
|
|
306
|
+
share_expires_at: string | null;
|
|
307
|
+
created_at: string;
|
|
308
|
+
}
|
|
309
|
+
export type IGetSharedExtractionResponse = IResponse<IGetSharedExtractionData>;
|
|
310
|
+
|
|
311
|
+
export interface IMintShareExtractionData {
|
|
312
|
+
share_url: string;
|
|
313
|
+
share_token: string;
|
|
314
|
+
share_expires_at: string | null;
|
|
315
|
+
}
|
|
316
|
+
export type IMintShareExtractionResponse = IResponse<IMintShareExtractionData>;
|
|
317
|
+
|
|
318
|
+
// ─── CHANGELOG ──────────────────────────────
|
|
319
|
+
|
|
320
|
+
export interface IChangelogData {
|
|
321
|
+
current_version: string;
|
|
322
|
+
entries: Array<{ version: string; date: string; highlights: string[] }>;
|
|
323
|
+
}
|
|
324
|
+
export type IChangelogResponse = IResponse<IChangelogData>;
|
|
325
|
+
|
|
326
|
+
// ─── ADMIN: CATALOGUE ────────────────────────
|
|
327
|
+
|
|
328
|
+
export interface IListBankVersionsAdminResponse {
|
|
329
|
+
data: IExtractionBankVersion[];
|
|
330
|
+
total?: number;
|
|
331
|
+
}
|
|
332
|
+
export type IGetBankVersionAdminResponse = IResponse<IExtractionBankVersion>;
|
|
333
|
+
export type IUpsertBankVersionAdminResponse = IResponse<IExtractionBankVersion>;
|
|
334
|
+
|
|
335
|
+
export interface IReloadBankVersionsAdminData {
|
|
336
|
+
loaded: number;
|
|
337
|
+
skipped: number;
|
|
338
|
+
total: number;
|
|
339
|
+
}
|
|
340
|
+
export type IReloadBankVersionsAdminResponse = IResponse<IReloadBankVersionsAdminData>;
|
|
341
|
+
|
|
342
|
+
export interface IDetectorReplayAdminData {
|
|
343
|
+
scanned: number;
|
|
344
|
+
kept: number;
|
|
345
|
+
flipped: number;
|
|
346
|
+
newDetections: number;
|
|
347
|
+
skipped: number;
|
|
348
|
+
details: unknown[];
|
|
349
|
+
durationMs: number;
|
|
350
|
+
}
|
|
351
|
+
export type IDetectorReplayAdminResponse = IResponse<IDetectorReplayAdminData>;
|
|
352
|
+
|
|
353
|
+
export interface IListRequestLogAdminData {
|
|
354
|
+
data: Array<{
|
|
355
|
+
ts: number;
|
|
356
|
+
method: string;
|
|
357
|
+
path: string;
|
|
358
|
+
status: number;
|
|
359
|
+
durationMs: number;
|
|
360
|
+
userId: string | null;
|
|
361
|
+
requestId: string | null;
|
|
362
|
+
rateLimitBucket: string | null;
|
|
363
|
+
}>;
|
|
364
|
+
meta: { capacity: number; used: number; oldestTs: number | null; newestTs: number | null };
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// ─── METRICS ────────────────────────────────
|
|
368
|
+
|
|
369
|
+
export interface IExtractionPerBankMetric {
|
|
370
|
+
bank: string;
|
|
371
|
+
extractions: number;
|
|
372
|
+
avgConfidence: number;
|
|
373
|
+
avgRecords: number;
|
|
374
|
+
balanceValidatedRate: number;
|
|
375
|
+
avgDurationMs: number;
|
|
376
|
+
feedbackOpen: number;
|
|
377
|
+
}
|
|
378
|
+
export type IPerBankMetricsAdminResponse = IResponse<IExtractionPerBankMetric[]>;
|
|
379
|
+
|
|
380
|
+
export interface IExtractionLatencyBucket {
|
|
381
|
+
bucket: string;
|
|
382
|
+
count: number;
|
|
383
|
+
}
|
|
384
|
+
export type ILatencyMetricsAdminResponse = IResponse<IExtractionLatencyBucket[]>;
|
|
385
|
+
|
|
386
|
+
export interface IExtractionOverviewMetrics {
|
|
387
|
+
last24h: { extractions: number; failures: number; avgLatencyMs: number };
|
|
388
|
+
last30d: { extractions: number; uniqueUsers: number };
|
|
389
|
+
}
|
|
390
|
+
export type IOverviewMetricsAdminResponse = IResponse<IExtractionOverviewMetrics>;
|
|
391
|
+
|
|
392
|
+
// ─── WEBHOOK SUBSCRIPTIONS ──────────────────
|
|
393
|
+
|
|
394
|
+
import type { IExtractionWebhook } from '../../models/extraction.dto';
|
|
395
|
+
|
|
396
|
+
export interface IPaginateExtractionWebhookData {
|
|
397
|
+
rows: IExtractionWebhook[];
|
|
398
|
+
total: number;
|
|
399
|
+
}
|
|
400
|
+
export type IPaginateExtractionWebhookResponse = IResponse<IPaginateExtractionWebhookData>;
|
|
401
|
+
export type IGetExtractionWebhookResponse = IResponse<{ webhook: IExtractionWebhook }>;
|
|
402
|
+
export type ICreateExtractionWebhookResponse = IResponse<{ webhook: IExtractionWebhook }>;
|
|
403
|
+
export type IUpdateExtractionWebhookResponse = IResponse<{ webhook: IExtractionWebhook }>;
|
|
404
|
+
export type IDeleteExtractionWebhookResponse = IResponse<{ ok: true }>;
|
|
405
|
+
export type IResetSecretExtractionWebhookResponse = IResponse<{ webhook: IExtractionWebhook }>;
|
|
406
|
+
|
|
407
|
+
// ─── EXTRACTION SETTINGS (P4) ───────────────
|
|
408
|
+
// The server returns only the effective flag, not the full settings row.
|
|
409
|
+
|
|
410
|
+
/** Response shape for GET /extract/settings and PUT /extract/settings. */
|
|
411
|
+
export interface IGetExtractionSettingsResponse {
|
|
412
|
+
data: { improvement_default: boolean };
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** Alias: PUT /extract/settings returns the same shape as GET. */
|
|
416
|
+
export type IUpsertExtractionSettingsResponse = IGetExtractionSettingsResponse;
|
|
417
|
+
|
|
418
|
+
// ─── TRAINING TOGGLE (P4-T8) ─────────────────
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Response shape for PATCH /extract/extractions/:id/training.
|
|
422
|
+
* Returns the updated extraction identifiers relevant to the training state.
|
|
423
|
+
*/
|
|
424
|
+
export interface IToggleExtractionTrainingResponse {
|
|
425
|
+
data: {
|
|
426
|
+
id: string;
|
|
427
|
+
usable_for_training: boolean;
|
|
428
|
+
training_file_id: string | null;
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// ─── EXTRACTION MODES (V2-P1) ────────────────
|
|
433
|
+
|
|
434
|
+
/** Response for GET /extract/modes — lists all registered providers + interpreters. */
|
|
435
|
+
export interface IListModesResponse {
|
|
436
|
+
data: IExtractModesData;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// ─── EXTRACTION PLAN PRESETS (V2-P1) ─────────
|
|
440
|
+
|
|
441
|
+
/** Response for GET /extract/plans — list all presets (system + scoped). */
|
|
442
|
+
export interface IListPlanPresetsResponse {
|
|
443
|
+
data: IExtractionPlanPreset[];
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/** Response for GET/POST/PUT /extract/plans/:id (and POST /extract/plans/:id/default). */
|
|
447
|
+
export interface IGetPlanPresetResponse {
|
|
448
|
+
data: IExtractionPlanPreset;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/** Response for DELETE /extract/plans/:id. */
|
|
452
|
+
export interface IDeletePlanPresetResponse {
|
|
453
|
+
data: { id: string };
|
|
454
|
+
}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
export * from './abyss.admin.response';
|
|
2
|
-
export * from './atlas.response';
|
|
3
|
-
export * from './atlas.public.response';
|
|
4
|
-
export * from './atlas-document.response';
|
|
5
|
-
export * from './atlas-group.response';
|
|
6
|
-
export * from './atlas-page.response';
|
|
7
|
-
export * from './board.response';
|
|
8
|
-
export * from './board-card.response';
|
|
9
|
-
export * from './board-card-checklist.response';
|
|
10
|
-
export * from './board-card-comment.response';
|
|
11
|
-
export * from './board-card-document.response';
|
|
12
|
-
export * from './board-column.response';
|
|
13
|
-
export * from './board-label.response';
|
|
14
|
-
export * from './draw.response';
|
|
15
|
-
export * from './draw.public.response';
|
|
16
|
-
export * from './memo.response';
|
|
17
|
-
export * from './retrospective.response';
|
|
18
|
-
export * from './retrospective.public.response';
|
|
19
|
-
export * from './retrospective-card.response';
|
|
20
|
-
export * from './retrospective-member.response';
|
|
21
|
-
export * from './retrospective-section.response';
|
|
22
|
-
export * from './short-link.response';
|
|
23
|
-
export * from './short-link.public.response';
|
|
24
|
-
export * from './short-link.admin.response';
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './
|
|
30
|
-
export * from './
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
1
|
+
export * from './abyss.admin.response';
|
|
2
|
+
export * from './atlas.response';
|
|
3
|
+
export * from './atlas.public.response';
|
|
4
|
+
export * from './atlas-document.response';
|
|
5
|
+
export * from './atlas-group.response';
|
|
6
|
+
export * from './atlas-page.response';
|
|
7
|
+
export * from './board.response';
|
|
8
|
+
export * from './board-card.response';
|
|
9
|
+
export * from './board-card-checklist.response';
|
|
10
|
+
export * from './board-card-comment.response';
|
|
11
|
+
export * from './board-card-document.response';
|
|
12
|
+
export * from './board-column.response';
|
|
13
|
+
export * from './board-label.response';
|
|
14
|
+
export * from './draw.response';
|
|
15
|
+
export * from './draw.public.response';
|
|
16
|
+
export * from './memo.response';
|
|
17
|
+
export * from './retrospective.response';
|
|
18
|
+
export * from './retrospective.public.response';
|
|
19
|
+
export * from './retrospective-card.response';
|
|
20
|
+
export * from './retrospective-member.response';
|
|
21
|
+
export * from './retrospective-section.response';
|
|
22
|
+
export * from './short-link.response';
|
|
23
|
+
export * from './short-link.public.response';
|
|
24
|
+
export * from './short-link.admin.response';
|
|
25
|
+
export * from './beam.response';
|
|
26
|
+
export * from './metrics.response';
|
|
27
|
+
export * from './tag.response';
|
|
28
|
+
export * from './enriched-paginate.response';
|
|
29
|
+
export * from './count.response';
|
|
30
|
+
export * from './recent.response';
|
|
31
|
+
export * from './transfer.response';
|
|
32
|
+
export * from './extraction.response';
|
|
33
|
+
export * from './monitor.response';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IOrganization } from './organization.dto';
|
|
2
|
+
import { IUser } from './user.dto';
|
|
3
|
+
import { IProject } from './project.dto';
|
|
4
|
+
import { BeamVisibility } from '../../enum/beam.enum';
|
|
5
|
+
|
|
6
|
+
export interface IBeamTransfer {
|
|
7
|
+
id: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
// sha256 of the anonymous management token; the plaintext is returned once at
|
|
10
|
+
// finalize (B5) and never stored.
|
|
11
|
+
manageTokenHash: string | null;
|
|
12
|
+
userId: string | null;
|
|
13
|
+
organizationId: string | null;
|
|
14
|
+
projectId: string | null;
|
|
15
|
+
createdByUserId: string | null;
|
|
16
|
+
visibility: BeamVisibility;
|
|
17
|
+
passwordHash: string | null;
|
|
18
|
+
title: string | null;
|
|
19
|
+
message: string | null;
|
|
20
|
+
isActive: boolean;
|
|
21
|
+
expiresAt: Date | null;
|
|
22
|
+
finalizedAt: Date | null;
|
|
23
|
+
maxDownloads: number | null;
|
|
24
|
+
downloadCount: number;
|
|
25
|
+
lastDownloadedAt: Date | null;
|
|
26
|
+
totalSizeOctet: number;
|
|
27
|
+
fileCount: number;
|
|
28
|
+
createdAt?: Date;
|
|
29
|
+
updatedAt?: Date;
|
|
30
|
+
|
|
31
|
+
user?: IUser | null;
|
|
32
|
+
project?: IProject | null;
|
|
33
|
+
organization?: IOrganization | null;
|
|
34
|
+
files?: IBeamFile[];
|
|
35
|
+
recipients?: IBeamRecipient[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface IBeamFile {
|
|
39
|
+
id: string;
|
|
40
|
+
transferId: string;
|
|
41
|
+
// abyss-storage applicationFileId (PRIVATE bucket); resolved at serve time (B4).
|
|
42
|
+
storageFileId: string;
|
|
43
|
+
thumbnailStorageFileId: string | null;
|
|
44
|
+
name: string;
|
|
45
|
+
mimeType: string | null;
|
|
46
|
+
sizeOctet: number;
|
|
47
|
+
isImage: boolean;
|
|
48
|
+
width: number | null;
|
|
49
|
+
height: number | null;
|
|
50
|
+
downloadCount: number;
|
|
51
|
+
position: number;
|
|
52
|
+
createdAt?: Date;
|
|
53
|
+
|
|
54
|
+
transfer?: IBeamTransfer;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface IBeamRecipient {
|
|
58
|
+
id: string;
|
|
59
|
+
transferId: string;
|
|
60
|
+
email: string;
|
|
61
|
+
locale: string | null;
|
|
62
|
+
sentAt: Date | null;
|
|
63
|
+
firstOpenedAt: Date | null;
|
|
64
|
+
createdAt?: Date;
|
|
65
|
+
|
|
66
|
+
transfer?: IBeamTransfer;
|
|
67
|
+
}
|