@abyss-project/tools 1.0.3 → 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/abyss.admin.api.d.ts +0 -3
- package/dist/api/abyss.admin.api.js +1 -13
- package/dist/api/abyss.admin.api.js.map +1 -1
- 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 +5 -1
- package/dist/api/index.js +5 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/monitor.api.d.ts +2 -0
- package/dist/api/monitor.api.js +9 -0
- package/dist/api/monitor.api.js.map +1 -0
- 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 +111 -61
- package/dist/index.js +109 -61
- 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/rcb.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 +3 -1
- package/dist/types/interface/api/responses/index.js +3 -1
- package/dist/types/interface/api/responses/index.js.map +1 -1
- package/dist/types/interface/api/responses/monitor.response.d.ts +7 -0
- package/dist/types/interface/api/{requests/user-tag.request.js → responses/monitor.response.js} +1 -1
- package/dist/types/interface/api/responses/monitor.response.js.map +1 -0
- 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/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 +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/abyss.admin.api.ts +0 -18
- 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 -48
- package/src/api/monitor.api.ts +6 -0
- 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 -746
- 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 -31
- package/src/types/interface/api/responses/monitor.response.ts +8 -0
- 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
|
@@ -1,267 +1,317 @@
|
|
|
1
|
-
// ──────────────────────────────────────────────
|
|
2
|
-
//
|
|
3
|
-
// Mirror server-side Sequelize models, dates serialized as ISO strings.
|
|
4
|
-
// ──────────────────────────────────────────────
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export type
|
|
20
|
-
|
|
21
|
-
export type
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
| 'extract.sync.
|
|
25
|
-
| 'extract.
|
|
26
|
-
| 'extract.
|
|
27
|
-
| 'extract.queue.
|
|
28
|
-
| 'extract.queue.
|
|
29
|
-
| '
|
|
30
|
-
| '
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
export
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
export interface
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
createdAt: string;
|
|
241
|
-
updatedAt: string;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
1
|
+
// ──────────────────────────────────────────────
|
|
2
|
+
// Extraction DTOs.
|
|
3
|
+
// Mirror server-side Sequelize models, dates serialized as ISO strings.
|
|
4
|
+
// ──────────────────────────────────────────────
|
|
5
|
+
|
|
6
|
+
import { ExtractionWarningCode } from '../../../types/enum/extraction-warning.enum';
|
|
7
|
+
import { ExtractionFeedbackIssueType } from '../../../types/enum/extraction-feedback-issue-type.enum';
|
|
8
|
+
import type {
|
|
9
|
+
IFieldValue,
|
|
10
|
+
IExecutionManifest,
|
|
11
|
+
IGlobalConfidence,
|
|
12
|
+
} from './extraction-plan.dto';
|
|
13
|
+
|
|
14
|
+
// Re-export so consumers can import ExtractionFeedbackIssueType from the DTO barrel.
|
|
15
|
+
export { ExtractionFeedbackIssueType };
|
|
16
|
+
|
|
17
|
+
export type ExtractionMode = 'auto' | 'hint' | 'template';
|
|
18
|
+
export type ProcessingMode = 'sync' | 'queue';
|
|
19
|
+
export type ExtractionStatus = 'pending' | 'completed' | 'failed' | 'cached';
|
|
20
|
+
|
|
21
|
+
export type ExtractionFeedbackStatus = 'open' | 'triaged' | 'fixed' | 'closed';
|
|
22
|
+
|
|
23
|
+
export type ExtractionUsageEventType =
|
|
24
|
+
| 'extract.sync.success'
|
|
25
|
+
| 'extract.sync.cached'
|
|
26
|
+
| 'extract.sync.failed'
|
|
27
|
+
| 'extract.queue.enqueued'
|
|
28
|
+
| 'extract.queue.success'
|
|
29
|
+
| 'extract.queue.cached'
|
|
30
|
+
| 'extract.queue.failed'
|
|
31
|
+
| 'template.run.success'
|
|
32
|
+
| 'template.run.failed';
|
|
33
|
+
|
|
34
|
+
export interface IExtractionBankHint {
|
|
35
|
+
bank: string;
|
|
36
|
+
version?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IExtractionTransaction {
|
|
40
|
+
date?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
amount?: number;
|
|
43
|
+
balance?: number;
|
|
44
|
+
valueDate?: string;
|
|
45
|
+
bookingDate?: string;
|
|
46
|
+
reference?: string;
|
|
47
|
+
[k: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface IExtractionMetadata {
|
|
51
|
+
iban?: string;
|
|
52
|
+
bic?: string;
|
|
53
|
+
bank?: string;
|
|
54
|
+
accountHolder?: string;
|
|
55
|
+
periodStart?: string;
|
|
56
|
+
periodEnd?: string;
|
|
57
|
+
openingBalance?: number;
|
|
58
|
+
closingBalance?: number;
|
|
59
|
+
currency?: string;
|
|
60
|
+
[k: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface IExtractionFile {
|
|
64
|
+
id: string;
|
|
65
|
+
userId: string;
|
|
66
|
+
applicationId: string | null;
|
|
67
|
+
pdfHash: string;
|
|
68
|
+
pdfSizeBytes: number;
|
|
69
|
+
pdfMimeType: string;
|
|
70
|
+
pdfPageCount: number | null;
|
|
71
|
+
pdfFilename: string | null;
|
|
72
|
+
applicationFileId: string | null;
|
|
73
|
+
userExternalId: string | null;
|
|
74
|
+
userMetadata: Record<string, unknown> | null;
|
|
75
|
+
detectedBank: string | null;
|
|
76
|
+
detectedVersion: string | null;
|
|
77
|
+
detectedIban: string | null;
|
|
78
|
+
detectedBic: string | null;
|
|
79
|
+
detectedCurrency: string | null;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
updatedAt: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Re-export ExtractionWarningCode so consumers can import it from the dto barrel.
|
|
85
|
+
export { ExtractionWarningCode };
|
|
86
|
+
|
|
87
|
+
export interface IExtractionWarning {
|
|
88
|
+
code: ExtractionWarningCode;
|
|
89
|
+
data?: {
|
|
90
|
+
/** Balance mismatch data (bank_statement). */
|
|
91
|
+
actualCents?: number;
|
|
92
|
+
expectedCents?: number;
|
|
93
|
+
currency?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Adapter-specific validation error/warning type string, e.g.
|
|
96
|
+
* `ACTIF_PASSIF_MISMATCH`, `TOTAL_MISMATCH`, `MRZ_INVALID`.
|
|
97
|
+
* Present when `code === ExtractionWarningCode.ADAPTER_VALIDATION_ERROR`.
|
|
98
|
+
*/
|
|
99
|
+
type?: string;
|
|
100
|
+
/** Human-readable explanation from the adapter's ValidationResult. */
|
|
101
|
+
message?: string;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface IExtraction {
|
|
106
|
+
id: string;
|
|
107
|
+
fileId: string;
|
|
108
|
+
mode: ExtractionMode;
|
|
109
|
+
hintBank: string | null;
|
|
110
|
+
hintVersion: string | null;
|
|
111
|
+
templateId: string | null;
|
|
112
|
+
templateVersion: number | null;
|
|
113
|
+
status: ExtractionStatus;
|
|
114
|
+
strategyUsed: string | null;
|
|
115
|
+
confidence: number | null;
|
|
116
|
+
recordsCount: number | null;
|
|
117
|
+
balanceValidated: boolean | null;
|
|
118
|
+
durationMs: number | null;
|
|
119
|
+
error: string | null;
|
|
120
|
+
recordsJson: IExtractionTransaction[] | null;
|
|
121
|
+
metadataJson: IExtractionMetadata | null;
|
|
122
|
+
warningsJson: IExtractionWarning[] | null;
|
|
123
|
+
tags: string[] | null;
|
|
124
|
+
note: string | null;
|
|
125
|
+
shareToken: string | null;
|
|
126
|
+
shareExpiresAt: string | null;
|
|
127
|
+
documentType: string | null;
|
|
128
|
+
documentTypeConfidence: number | null;
|
|
129
|
+
/**
|
|
130
|
+
* Persisted per-field results. Widened (V2-P1, ADDITIVE) to the IFieldValue
|
|
131
|
+
* superset: value + confidence stay at the SAME path (old readers unaffected),
|
|
132
|
+
* and the plan path additionally surfaces chosen / sources / signals /
|
|
133
|
+
* agreement provenance. Legacy template/hints rows persist only value +
|
|
134
|
+
* confidence (still a valid IFieldValue subset on the wire).
|
|
135
|
+
*/
|
|
136
|
+
fieldsJson: Record<string, IFieldValue> | null;
|
|
137
|
+
improvementConsent: boolean;
|
|
138
|
+
usableForTraining: boolean;
|
|
139
|
+
supportTicketId: string | null;
|
|
140
|
+
/** AbyssExtract-owned training copy (extraction-training bucket). Purgeable. */
|
|
141
|
+
trainingFileId: string | null;
|
|
142
|
+
/** Whether the OCR layer was used for this extraction run. */
|
|
143
|
+
usedOcr: boolean;
|
|
144
|
+
/** Number of pages processed by the OCR layer. */
|
|
145
|
+
ocrPageCount: number;
|
|
146
|
+
/**
|
|
147
|
+
* Frozen execution manifest (resolved plan + per-pass impl/version) — the
|
|
148
|
+
* reproducible recipe. Present on plan-path rows; absent (null/undefined) on
|
|
149
|
+
* legacy template/hints rows. ADDITIVE, optional.
|
|
150
|
+
*/
|
|
151
|
+
executionManifest?: IExecutionManifest | null;
|
|
152
|
+
/**
|
|
153
|
+
* Auditable global confidence (stats + aggregation + per-pass contributions).
|
|
154
|
+
* Surfaced where available; optional/absent otherwise. ADDITIVE, optional.
|
|
155
|
+
*/
|
|
156
|
+
globalConfidence?: IGlobalConfidence | null;
|
|
157
|
+
createdAt: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface IExtractionTemplate {
|
|
161
|
+
id: string;
|
|
162
|
+
userId: string;
|
|
163
|
+
name: string;
|
|
164
|
+
description: string | null;
|
|
165
|
+
isActive: boolean;
|
|
166
|
+
createdAt: string;
|
|
167
|
+
updatedAt: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Spatial zone on a PDF page (PDF coords: origin bottom-left, points).
|
|
172
|
+
* Restricts regex matching to a specific rectangle.
|
|
173
|
+
*/
|
|
174
|
+
export interface IExtractionTemplateZone {
|
|
175
|
+
name: string;
|
|
176
|
+
page: number; // 1-indexed
|
|
177
|
+
x: number;
|
|
178
|
+
y: number;
|
|
179
|
+
w: number;
|
|
180
|
+
h: number;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Typed shape of the template DSL JSON stored in `templateJson`. Mirrors
|
|
185
|
+
* `TemplateDSL` server-side. UI editors should narrow `templateJson` to this
|
|
186
|
+
* shape via `templateJson as IExtractionTemplateDsl`.
|
|
187
|
+
*/
|
|
188
|
+
export interface IExtractionTemplateDsl {
|
|
189
|
+
regex_iban?: string;
|
|
190
|
+
regex_bic?: string;
|
|
191
|
+
period?: { regex: string };
|
|
192
|
+
balance?: { opening_regex?: string; closing_regex?: string };
|
|
193
|
+
transactions?: {
|
|
194
|
+
row_pattern: string;
|
|
195
|
+
date_format?: string;
|
|
196
|
+
amount_locale?: 'fr' | 'en';
|
|
197
|
+
sign_rule?: 'explicit' | 'keyword';
|
|
198
|
+
};
|
|
199
|
+
skip_patterns?: string[];
|
|
200
|
+
zones?: IExtractionTemplateZone[];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface IExtractionTemplateVersion {
|
|
204
|
+
id: string;
|
|
205
|
+
templateId: string;
|
|
206
|
+
version: number;
|
|
207
|
+
templateJson: Record<string, unknown>;
|
|
208
|
+
comment: string | null;
|
|
209
|
+
createdAt: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface IExtractionFeedback {
|
|
213
|
+
id: string;
|
|
214
|
+
extractionId: string;
|
|
215
|
+
userId: string;
|
|
216
|
+
issueType: ExtractionFeedbackIssueType;
|
|
217
|
+
fieldKey: string | null;
|
|
218
|
+
expectedValue: string | null;
|
|
219
|
+
description: string | null;
|
|
220
|
+
supportTicketId: string | null;
|
|
221
|
+
status: ExtractionFeedbackStatus;
|
|
222
|
+
createdAt: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface IExtractionWebhookDelivery {
|
|
226
|
+
id: string;
|
|
227
|
+
userId: string | null;
|
|
228
|
+
organizationId: string | null;
|
|
229
|
+
projectId: string | null;
|
|
230
|
+
createdByUserId: string | null;
|
|
231
|
+
webhookId: string | null;
|
|
232
|
+
jobId: string | null;
|
|
233
|
+
event: string;
|
|
234
|
+
url: string;
|
|
235
|
+
payloadJson: Record<string, unknown>;
|
|
236
|
+
attempts: number;
|
|
237
|
+
lastStatus: number | null;
|
|
238
|
+
lastError: string | null;
|
|
239
|
+
deliveredAt: string | null;
|
|
240
|
+
createdAt: string;
|
|
241
|
+
updatedAt: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Webhook event identifier. Values mirror AbyssApplicationEvent's RCB_*
|
|
245
|
+
// entries so a logger.log(applicationEvent: ...) and a webhook delivery
|
|
246
|
+
// can never drift.
|
|
247
|
+
export enum ExtractionWebhookEvent {
|
|
248
|
+
EXTRACT_COMPLETED = 'rcb.extract.completed',
|
|
249
|
+
EXTRACT_FAILED = 'rcb.extract.failed',
|
|
250
|
+
EXTRACT_LOW_CONFIDENCE = 'rcb.extract.low-confidence',
|
|
251
|
+
EXTRACT_BALANCE_KO = 'rcb.extract.balance-ko',
|
|
252
|
+
FILE_ARCHIVED = 'rcb.file.archived',
|
|
253
|
+
SHARE_MINTED = 'rcb.share.minted',
|
|
254
|
+
SHARE_REVOKED = 'rcb.share.revoked',
|
|
255
|
+
FEEDBACK_SUBMITTED = 'rcb.feedback.submitted',
|
|
256
|
+
JOB_FAILED = 'rcb.job.failed',
|
|
257
|
+
EXPORT_COMPLETED = 'rcb.export.completed',
|
|
258
|
+
EXPORT_FAILED = 'rcb.export.failed',
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export const EXTRACTION_WEBHOOK_EVENTS: ExtractionWebhookEvent[] =
|
|
262
|
+
Object.values(ExtractionWebhookEvent);
|
|
263
|
+
|
|
264
|
+
export interface IExtractionWebhook {
|
|
265
|
+
id: string;
|
|
266
|
+
userId: string | null;
|
|
267
|
+
organizationId: string | null;
|
|
268
|
+
projectId: string | null;
|
|
269
|
+
createdByUserId: string | null;
|
|
270
|
+
webhookUrl: string;
|
|
271
|
+
webhookSecret: string;
|
|
272
|
+
isEnabled: boolean;
|
|
273
|
+
name: string;
|
|
274
|
+
description: string;
|
|
275
|
+
scopes: ExtractionWebhookEvent[];
|
|
276
|
+
consecutiveFailures: number;
|
|
277
|
+
createdAt: string;
|
|
278
|
+
updatedAt: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface IExtractionBankVersion {
|
|
282
|
+
id: string;
|
|
283
|
+
bank: string;
|
|
284
|
+
version: string;
|
|
285
|
+
validFrom: string | null;
|
|
286
|
+
validTo: string | null;
|
|
287
|
+
detectorJson: Record<string, unknown>;
|
|
288
|
+
parserKind: string;
|
|
289
|
+
configJson: Record<string, unknown>;
|
|
290
|
+
isActive: boolean;
|
|
291
|
+
createdAt: string;
|
|
292
|
+
updatedAt: string;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// ─── EXTRACTION SETTINGS (P4) ────────────────────────────────────────────────
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Scope discriminator for extraction settings.
|
|
299
|
+
* 'user' = personal scope; 'org' = organization scope.
|
|
300
|
+
*/
|
|
301
|
+
export enum ExtractionSettingsScopeKind {
|
|
302
|
+
USER = 'user',
|
|
303
|
+
ORG = 'org',
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** Per-scope improvement-consent settings row. */
|
|
307
|
+
export interface IExtractionSettings {
|
|
308
|
+
id: string;
|
|
309
|
+
/** Set for personal scope. XOR with organizationId. */
|
|
310
|
+
userId: string | null;
|
|
311
|
+
/** Set for organization scope. XOR with userId. */
|
|
312
|
+
organizationId: string | null;
|
|
313
|
+
/** Factory default for per-extraction improvementConsent. OFF (false) by default. */
|
|
314
|
+
improvementDefault: boolean;
|
|
315
|
+
createdAt: string;
|
|
316
|
+
updatedAt: string;
|
|
317
|
+
}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
export * from './user.dto';
|
|
2
|
-
export * from './organization.dto';
|
|
3
|
-
export * from './project.dto';
|
|
4
|
-
export * from './atlas.dto';
|
|
5
|
-
export * from './atlas-document.dto';
|
|
6
|
-
export * from './atlas-group.dto';
|
|
7
|
-
export * from './atlas-page.dto';
|
|
8
|
-
export * from './atlas-page-content.dto';
|
|
9
|
-
export * from './draw.dto';
|
|
10
|
-
export * from './memo.dto';
|
|
11
|
-
export * from './retrospective.dto';
|
|
12
|
-
export * from './retrospective-section.dto';
|
|
13
|
-
export * from './retrospective-card.dto';
|
|
14
|
-
export * from './retrospective-member.dto';
|
|
15
|
-
export * from './short-link.dto';
|
|
16
|
-
export * from './short-link-click.dto';
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './board
|
|
19
|
-
export * from './board-
|
|
20
|
-
export * from './board-card
|
|
21
|
-
export * from './board-card-checklist
|
|
22
|
-
export * from './board-card-
|
|
23
|
-
export * from './board-card-
|
|
24
|
-
export * from './board-card-
|
|
25
|
-
export * from './board-card-
|
|
26
|
-
export * from './board-
|
|
27
|
-
export * from './board-
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './
|
|
30
|
-
export * from './
|
|
31
|
-
export * from './
|
|
1
|
+
export * from './user.dto';
|
|
2
|
+
export * from './organization.dto';
|
|
3
|
+
export * from './project.dto';
|
|
4
|
+
export * from './atlas.dto';
|
|
5
|
+
export * from './atlas-document.dto';
|
|
6
|
+
export * from './atlas-group.dto';
|
|
7
|
+
export * from './atlas-page.dto';
|
|
8
|
+
export * from './atlas-page-content.dto';
|
|
9
|
+
export * from './draw.dto';
|
|
10
|
+
export * from './memo.dto';
|
|
11
|
+
export * from './retrospective.dto';
|
|
12
|
+
export * from './retrospective-section.dto';
|
|
13
|
+
export * from './retrospective-card.dto';
|
|
14
|
+
export * from './retrospective-member.dto';
|
|
15
|
+
export * from './short-link.dto';
|
|
16
|
+
export * from './short-link-click.dto';
|
|
17
|
+
export * from './beam.dto';
|
|
18
|
+
export * from './board.dto';
|
|
19
|
+
export * from './board-activity.dto';
|
|
20
|
+
export * from './board-card.dto';
|
|
21
|
+
export * from './board-card-checklist.dto';
|
|
22
|
+
export * from './board-card-checklist-row.dto';
|
|
23
|
+
export * from './board-card-comment.dto';
|
|
24
|
+
export * from './board-card-document.dto';
|
|
25
|
+
export * from './board-card-label.dto';
|
|
26
|
+
export * from './board-card-member.dto';
|
|
27
|
+
export * from './board-column.dto';
|
|
28
|
+
export * from './board-label.dto';
|
|
29
|
+
export * from './team.dto';
|
|
30
|
+
export * from './tag.dto';
|
|
31
|
+
export * from './content-share.dto';
|
|
32
|
+
export * from './extraction.dto';
|
|
33
|
+
export * from './extraction-plan.dto';
|
|
34
|
+
export * from './extraction-spatial-template.dto';
|