@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.
Files changed (183) hide show
  1. package/.eslintrc.js +32 -0
  2. package/.prettierrc +5 -0
  3. package/README.md +21 -2
  4. package/dist/api/extraction-plan-preset.api.d.ts +9 -0
  5. package/dist/api/extraction-plan-preset.api.js +36 -0
  6. package/dist/api/extraction-plan-preset.api.js.map +1 -0
  7. package/dist/api/extraction-plan-preset.api.test.d.ts +1 -0
  8. package/dist/api/extraction-plan-preset.api.test.js +51 -0
  9. package/dist/api/extraction-plan-preset.api.test.js.map +1 -0
  10. package/dist/api/extraction-settings.api.d.ts +4 -0
  11. package/dist/api/extraction-settings.api.js +22 -0
  12. package/dist/api/extraction-settings.api.js.map +1 -0
  13. package/dist/api/extraction.api.d.ts +76 -0
  14. package/dist/api/extraction.api.js +414 -0
  15. package/dist/api/extraction.api.js.map +1 -0
  16. package/dist/api/extraction.application.api.d.ts +4 -0
  17. package/dist/api/extraction.application.api.js +23 -0
  18. package/dist/api/extraction.application.api.js.map +1 -0
  19. package/dist/api/extraction.application.api.test.d.ts +1 -0
  20. package/dist/api/extraction.application.api.test.js +69 -0
  21. package/dist/api/extraction.application.api.test.js.map +1 -0
  22. package/dist/api/index.d.ts +4 -0
  23. package/dist/api/index.js +21 -0
  24. package/dist/api/index.js.map +1 -0
  25. package/dist/constants/extract.constants.d.ts +4 -0
  26. package/dist/constants/extract.constants.js +91 -0
  27. package/dist/constants/extract.constants.js.map +1 -0
  28. package/dist/constants/index.d.ts +1 -0
  29. package/dist/constants/index.js +18 -0
  30. package/dist/constants/index.js.map +1 -0
  31. package/dist/index.d.ts +127 -0
  32. package/dist/index.js +210 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/types/enum/api-error.enum.d.ts +31 -0
  35. package/dist/types/enum/api-error.enum.js +37 -0
  36. package/dist/types/enum/api-error.enum.js.map +1 -0
  37. package/dist/types/enum/combine-strategy.enum.d.ts +5 -0
  38. package/dist/types/enum/combine-strategy.enum.js +10 -0
  39. package/dist/types/enum/combine-strategy.enum.js.map +1 -0
  40. package/dist/types/enum/document-type.enum.d.ts +10 -0
  41. package/dist/types/enum/document-type.enum.js +15 -0
  42. package/dist/types/enum/document-type.enum.js.map +1 -0
  43. package/dist/types/enum/extract-bank.enum.d.ts +50 -0
  44. package/dist/types/enum/extract-bank.enum.js +327 -0
  45. package/dist/types/enum/extract-bank.enum.js.map +1 -0
  46. package/dist/types/enum/extract-field-format.enum.d.ts +7 -0
  47. package/dist/types/enum/extract-field-format.enum.js +12 -0
  48. package/dist/types/enum/extract-field-format.enum.js.map +1 -0
  49. package/dist/types/enum/extract-field-key.enum.d.ts +59 -0
  50. package/dist/types/enum/extract-field-key.enum.js +64 -0
  51. package/dist/types/enum/extract-field-key.enum.js.map +1 -0
  52. package/dist/types/enum/extraction-feedback-issue-type.enum.d.ts +8 -0
  53. package/dist/types/enum/extraction-feedback-issue-type.enum.js +13 -0
  54. package/dist/types/enum/extraction-feedback-issue-type.enum.js.map +1 -0
  55. package/dist/types/enum/extraction-step-status.enum.d.ts +6 -0
  56. package/dist/types/enum/extraction-step-status.enum.js +11 -0
  57. package/dist/types/enum/extraction-step-status.enum.js.map +1 -0
  58. package/dist/types/enum/extraction-warning.enum.d.ts +10 -0
  59. package/dist/types/enum/extraction-warning.enum.js +15 -0
  60. package/dist/types/enum/extraction-warning.enum.js.map +1 -0
  61. package/dist/types/enum/file-scan-status.enum.d.ts +1 -0
  62. package/dist/types/enum/file-scan-status.enum.js +3 -0
  63. package/dist/types/enum/file-scan-status.enum.js.map +1 -0
  64. package/dist/types/enum/index.d.ts +12 -0
  65. package/dist/types/enum/index.js +29 -0
  66. package/dist/types/enum/index.js.map +1 -0
  67. package/dist/types/enum/interpreter-kind.enum.d.ts +5 -0
  68. package/dist/types/enum/interpreter-kind.enum.js +10 -0
  69. package/dist/types/enum/interpreter-kind.enum.js.map +1 -0
  70. package/dist/types/enum/provider-kind.enum.d.ts +10 -0
  71. package/dist/types/enum/provider-kind.enum.js +16 -0
  72. package/dist/types/enum/provider-kind.enum.js.map +1 -0
  73. package/dist/types/index.d.ts +2 -0
  74. package/dist/types/index.js +19 -0
  75. package/dist/types/index.js.map +1 -0
  76. package/dist/types/interface/api/index.d.ts +5 -0
  77. package/dist/types/interface/api/index.js +22 -0
  78. package/dist/types/interface/api/index.js.map +1 -0
  79. package/dist/types/interface/api/requests/extraction.request.d.ts +259 -0
  80. package/dist/types/interface/api/requests/extraction.request.js +3 -0
  81. package/dist/types/interface/api/requests/extraction.request.js.map +1 -0
  82. package/dist/types/interface/api/requests/index.d.ts +1 -0
  83. package/dist/types/interface/api/requests/index.js +18 -0
  84. package/dist/types/interface/api/requests/index.js.map +1 -0
  85. package/dist/types/interface/api/responses/extraction.response.d.ts +424 -0
  86. package/dist/types/interface/api/responses/extraction.response.js +3 -0
  87. package/dist/types/interface/api/responses/extraction.response.js.map +1 -0
  88. package/dist/types/interface/api/responses/index.d.ts +1 -0
  89. package/dist/types/interface/api/responses/index.js +18 -0
  90. package/dist/types/interface/api/responses/index.js.map +1 -0
  91. package/dist/types/interface/api/type-message/api-error.d.ts +6 -0
  92. package/dist/types/interface/api/type-message/api-error.js +3 -0
  93. package/dist/types/interface/api/type-message/api-error.js.map +1 -0
  94. package/dist/types/interface/api/type-message/base-paginate.d.ts +10 -0
  95. package/dist/types/interface/api/type-message/base-paginate.js +3 -0
  96. package/dist/types/interface/api/type-message/base-paginate.js.map +1 -0
  97. package/dist/types/interface/api/type-message/response.d.ts +5 -0
  98. package/dist/types/interface/api/type-message/response.js +3 -0
  99. package/dist/types/interface/api/type-message/response.js.map +1 -0
  100. package/dist/types/interface/index.d.ts +2 -0
  101. package/dist/types/interface/index.js +19 -0
  102. package/dist/types/interface/index.js.map +1 -0
  103. package/dist/types/interface/models/extraction-fetched-provenance.dto.test.d.ts +1 -0
  104. package/dist/types/interface/models/extraction-fetched-provenance.dto.test.js +165 -0
  105. package/dist/types/interface/models/extraction-fetched-provenance.dto.test.js.map +1 -0
  106. package/dist/types/interface/models/extraction-plan.dto.d.ts +192 -0
  107. package/dist/types/interface/models/extraction-plan.dto.js +13 -0
  108. package/dist/types/interface/models/extraction-plan.dto.js.map +1 -0
  109. package/dist/types/interface/models/extraction-plan.dto.test.d.ts +1 -0
  110. package/dist/types/interface/models/extraction-plan.dto.test.js +40 -0
  111. package/dist/types/interface/models/extraction-plan.dto.test.js.map +1 -0
  112. package/dist/types/interface/models/extraction-spatial-template.dto.d.ts +37 -0
  113. package/dist/types/interface/models/extraction-spatial-template.dto.js +3 -0
  114. package/dist/types/interface/models/extraction-spatial-template.dto.js.map +1 -0
  115. package/dist/types/interface/models/extraction-spatial-template.dto.test.d.ts +1 -0
  116. package/dist/types/interface/models/extraction-spatial-template.dto.test.js +32 -0
  117. package/dist/types/interface/models/extraction-spatial-template.dto.test.js.map +1 -0
  118. package/dist/types/interface/models/extraction.dto.d.ts +255 -0
  119. package/dist/types/interface/models/extraction.dto.js +28 -0
  120. package/dist/types/interface/models/extraction.dto.js.map +1 -0
  121. package/dist/types/interface/models/index.d.ts +3 -0
  122. package/dist/types/interface/models/index.js +20 -0
  123. package/dist/types/interface/models/index.js.map +1 -0
  124. package/dist/utils/enum.utils.d.ts +1 -0
  125. package/dist/utils/enum.utils.js +3 -0
  126. package/dist/utils/enum.utils.js.map +1 -0
  127. package/dist/utils/error.utils.d.ts +15 -0
  128. package/dist/utils/error.utils.js +25 -0
  129. package/dist/utils/error.utils.js.map +1 -0
  130. package/dist/utils/extraction-webhook.utils.d.ts +6 -0
  131. package/dist/utils/extraction-webhook.utils.js +17 -0
  132. package/dist/utils/extraction-webhook.utils.js.map +1 -0
  133. package/dist/utils/index.d.ts +3 -0
  134. package/dist/utils/index.js +20 -0
  135. package/dist/utils/index.js.map +1 -0
  136. package/package.json +58 -4
  137. package/src/api/extraction-plan-preset.api.test.ts +24 -0
  138. package/src/api/extraction-plan-preset.api.ts +97 -0
  139. package/src/api/extraction-settings.api.ts +53 -0
  140. package/src/api/extraction.api.ts +1012 -0
  141. package/src/api/extraction.application.api.test.ts +55 -0
  142. package/src/api/extraction.application.api.ts +73 -0
  143. package/src/api/index.ts +4 -0
  144. package/src/constants/extract.constants.ts +109 -0
  145. package/src/constants/index.ts +1 -0
  146. package/src/index.ts +305 -0
  147. package/src/types/enum/api-error.enum.ts +33 -0
  148. package/src/types/enum/combine-strategy.enum.ts +7 -0
  149. package/src/types/enum/document-type.enum.ts +11 -0
  150. package/src/types/enum/extract-bank.enum.ts +363 -0
  151. package/src/types/enum/extract-field-format.enum.ts +16 -0
  152. package/src/types/enum/extract-field-key.enum.ts +77 -0
  153. package/src/types/enum/extraction-feedback-issue-type.enum.ts +10 -0
  154. package/src/types/enum/extraction-step-status.enum.ts +7 -0
  155. package/src/types/enum/extraction-warning.enum.ts +78 -0
  156. package/src/types/enum/file-scan-status.enum.ts +33 -0
  157. package/src/types/enum/index.ts +12 -0
  158. package/src/types/enum/interpreter-kind.enum.ts +7 -0
  159. package/src/types/enum/provider-kind.enum.ts +13 -0
  160. package/src/types/index.ts +2 -0
  161. package/src/types/interface/api/index.ts +5 -0
  162. package/src/types/interface/api/requests/extraction.request.ts +423 -0
  163. package/src/types/interface/api/requests/index.ts +1 -0
  164. package/src/types/interface/api/responses/extraction.response.ts +488 -0
  165. package/src/types/interface/api/responses/index.ts +1 -0
  166. package/src/types/interface/api/type-message/api-error.ts +7 -0
  167. package/src/types/interface/api/type-message/base-paginate.ts +11 -0
  168. package/src/types/interface/api/type-message/response.ts +6 -0
  169. package/src/types/interface/index.ts +2 -0
  170. package/src/types/interface/models/extraction-fetched-provenance.dto.test.ts +204 -0
  171. package/src/types/interface/models/extraction-plan.dto.test.ts +60 -0
  172. package/src/types/interface/models/extraction-plan.dto.ts +280 -0
  173. package/src/types/interface/models/extraction-spatial-template.dto.test.ts +48 -0
  174. package/src/types/interface/models/extraction-spatial-template.dto.ts +48 -0
  175. package/src/types/interface/models/extraction.dto.ts +399 -0
  176. package/src/types/interface/models/index.ts +3 -0
  177. package/src/types/tests/extract-bank-catalogue.spec.ts +74 -0
  178. package/src/utils/enum.utils.ts +1 -0
  179. package/src/utils/error.utils.ts +30 -0
  180. package/src/utils/extraction-webhook.utils.ts +30 -0
  181. package/src/utils/index.ts +3 -0
  182. package/tsconfig.check.json +15 -0
  183. package/tsconfig.json +36 -0
@@ -0,0 +1,363 @@
1
+ // ──────────────────────────────────────────────
2
+ // Extract — Formal catalogue of supported banks and versions.
3
+ //
4
+ // Mirrors the server-side registry (BANK_VERSIONS in abyss-tools/apps/api).
5
+ // Use these enums whenever you reference a bank or version in hint mode,
6
+ // UI dropdowns, or per-bank metrics. Adding a bank?
7
+ // 1. Add the entry to BANK_VERSIONS in apps/api.
8
+ // 2. Add the matching id here. CI will catch any mismatch.
9
+ // ──────────────────────────────────────────────
10
+
11
+ /**
12
+ * Stable id of a bank+version profile. The wire-format string used in
13
+ * `hint.bank` (POST /rcb/extract mode=hint) and returned in
14
+ * extraction.strategy_used.
15
+ */
16
+ export enum ExtractBankVersionId {
17
+ BNP_CONNEXIS_DEFAULT = 'bnp-connexis-default',
18
+ BNP_PARIBAS_DEFAULT = 'bnp-paribas-default',
19
+ SOCIETE_GENERALE_DEFAULT = 'societe-generale-default',
20
+ CREDIT_AGRICOLE_DEFAULT = 'credit-agricole-default',
21
+ LCL_DEFAULT = 'lcl-default',
22
+ BOURSORAMA_DEFAULT = 'boursorama-default',
23
+ SPENDESK_DEFAULT = 'spendesk-default',
24
+ LA_BANQUE_POSTALE_DEFAULT = 'la-banque-postale-default',
25
+ CAISSE_EPARGNE_DEFAULT = 'caisse-epargne-default',
26
+ THEMIS_DEFAULT = 'themis-default',
27
+ CIC_EBICS_DEFAULT = 'cic-ebics-default',
28
+ CIC_DEFAULT = 'cic-default',
29
+ CREDIT_MUTUEL_DEFAULT = 'credit-mutuel-default',
30
+ N26_DEFAULT = 'n26-default',
31
+ REVOLUT_DEFAULT = 'revolut-default',
32
+ HSBC_DEFAULT = 'hsbc-default',
33
+ HSBC_UK_DEFAULT = 'hsbc-uk-default',
34
+ WISE_DEFAULT = 'wise-default',
35
+ CREDIT_DU_NORD_DEFAULT = 'cdn-default',
36
+ BRED_DEFAULT = 'bred-default',
37
+ QONTO_DEFAULT = 'qonto-default',
38
+ SHINE_DEFAULT = 'shine-default',
39
+ SWAN_DEFAULT = 'swan-default',
40
+ ROTHSCHILD_DEFAULT = 'rothschild-default',
41
+ FINOM_DEFAULT = 'finom-default',
42
+ TIIME_DEFAULT = 'tiime-default',
43
+ UBS_DEFAULT = 'ubs-default',
44
+ CAIXA_DEFAULT = 'caixa-default',
45
+ CDE_NET_DEFAULT = 'cde-net-default',
46
+ DELUBAC_DEFAULT = 'delubac-default',
47
+ AIRWALLEX_DEFAULT = 'airwallex-default',
48
+ PAYPAL_DEFAULT = 'paypal-default',
49
+ VIVA_WALLET_DEFAULT = 'viva-wallet-default',
50
+ PALATINE_DEFAULT = 'palatine-default',
51
+ NATIXIS_DEFAULT = 'natixis-default',
52
+ JPMORGAN_DEFAULT = 'jpmorgan-default',
53
+ LA_NEF_V1 = 'la-nef-v1',
54
+ LA_NEF_V2 = 'la-nef-v2',
55
+ }
56
+
57
+ /**
58
+ * Display catalogue — one entry per supported (bank, version) pair.
59
+ * Drives dropdowns, "supported banks" pages, and customer docs.
60
+ */
61
+ export interface ExtractBankCatalogueEntry {
62
+ id: ExtractBankVersionId;
63
+ bank: string;
64
+ version: string;
65
+ country: 'FR' | 'UK' | 'CH' | 'US' | 'PT' | 'EU' | 'INTL';
66
+ type: 'retail' | 'business' | 'neobank' | 'fintech' | 'corporate';
67
+ }
68
+
69
+ export const EXTRACT_BANK_CATALOGUE: ReadonlyArray<ExtractBankCatalogueEntry> = [
70
+ // ─── French retail / business ─────────────
71
+ {
72
+ id: ExtractBankVersionId.BNP_CONNEXIS_DEFAULT,
73
+ bank: 'BNP Connexis',
74
+ version: 'default',
75
+ country: 'FR',
76
+ type: 'business',
77
+ },
78
+ {
79
+ id: ExtractBankVersionId.BNP_PARIBAS_DEFAULT,
80
+ bank: 'BNP Paribas',
81
+ version: 'default',
82
+ country: 'FR',
83
+ type: 'retail',
84
+ },
85
+ {
86
+ id: ExtractBankVersionId.SOCIETE_GENERALE_DEFAULT,
87
+ bank: 'Société Générale',
88
+ version: 'default',
89
+ country: 'FR',
90
+ type: 'retail',
91
+ },
92
+ {
93
+ id: ExtractBankVersionId.CREDIT_AGRICOLE_DEFAULT,
94
+ bank: 'Crédit Agricole',
95
+ version: 'default',
96
+ country: 'FR',
97
+ type: 'retail',
98
+ },
99
+ {
100
+ id: ExtractBankVersionId.LCL_DEFAULT,
101
+ bank: 'LCL',
102
+ version: 'default',
103
+ country: 'FR',
104
+ type: 'retail',
105
+ },
106
+ {
107
+ id: ExtractBankVersionId.BOURSORAMA_DEFAULT,
108
+ bank: 'Boursorama',
109
+ version: 'default',
110
+ country: 'FR',
111
+ type: 'retail',
112
+ },
113
+ {
114
+ id: ExtractBankVersionId.LA_BANQUE_POSTALE_DEFAULT,
115
+ bank: 'La Banque Postale',
116
+ version: 'default',
117
+ country: 'FR',
118
+ type: 'retail',
119
+ },
120
+ {
121
+ id: ExtractBankVersionId.CAISSE_EPARGNE_DEFAULT,
122
+ bank: "Caisse d'Épargne",
123
+ version: 'default',
124
+ country: 'FR',
125
+ type: 'retail',
126
+ },
127
+ {
128
+ id: ExtractBankVersionId.CIC_EBICS_DEFAULT,
129
+ bank: 'CIC',
130
+ version: 'ebics',
131
+ country: 'FR',
132
+ type: 'business',
133
+ },
134
+ {
135
+ id: ExtractBankVersionId.CIC_DEFAULT,
136
+ bank: 'CIC',
137
+ version: 'default',
138
+ country: 'FR',
139
+ type: 'retail',
140
+ },
141
+ {
142
+ id: ExtractBankVersionId.CREDIT_MUTUEL_DEFAULT,
143
+ bank: 'Crédit Mutuel',
144
+ version: 'default',
145
+ country: 'FR',
146
+ type: 'retail',
147
+ },
148
+ {
149
+ id: ExtractBankVersionId.BRED_DEFAULT,
150
+ bank: 'BRED',
151
+ version: 'default',
152
+ country: 'FR',
153
+ type: 'retail',
154
+ },
155
+ {
156
+ id: ExtractBankVersionId.CREDIT_DU_NORD_DEFAULT,
157
+ bank: 'Crédit du Nord',
158
+ version: 'default',
159
+ country: 'FR',
160
+ type: 'retail',
161
+ },
162
+ {
163
+ id: ExtractBankVersionId.CDE_NET_DEFAULT,
164
+ bank: 'CDE Net',
165
+ version: 'default',
166
+ country: 'FR',
167
+ type: 'business',
168
+ },
169
+ {
170
+ id: ExtractBankVersionId.DELUBAC_DEFAULT,
171
+ bank: 'Delubac',
172
+ version: 'default',
173
+ country: 'FR',
174
+ type: 'business',
175
+ },
176
+ {
177
+ id: ExtractBankVersionId.PALATINE_DEFAULT,
178
+ bank: 'Palatine',
179
+ version: 'default',
180
+ country: 'FR',
181
+ type: 'business',
182
+ },
183
+ {
184
+ id: ExtractBankVersionId.NATIXIS_DEFAULT,
185
+ bank: 'Natixis',
186
+ version: 'default',
187
+ country: 'FR',
188
+ type: 'corporate',
189
+ },
190
+ {
191
+ id: ExtractBankVersionId.THEMIS_DEFAULT,
192
+ bank: 'Themis Banque',
193
+ version: 'default',
194
+ country: 'FR',
195
+ type: 'business',
196
+ },
197
+ {
198
+ id: ExtractBankVersionId.ROTHSCHILD_DEFAULT,
199
+ bank: 'Rothschild Martin Maurel',
200
+ version: 'default',
201
+ country: 'FR',
202
+ type: 'corporate',
203
+ },
204
+ {
205
+ id: ExtractBankVersionId.LA_NEF_V1,
206
+ bank: 'La Nef',
207
+ version: 'v1',
208
+ country: 'FR',
209
+ type: 'retail',
210
+ },
211
+ {
212
+ id: ExtractBankVersionId.LA_NEF_V2,
213
+ bank: 'La Nef',
214
+ version: 'v2',
215
+ country: 'FR',
216
+ type: 'retail',
217
+ },
218
+
219
+ // ─── Neobanks / fintech ───────────────────
220
+ {
221
+ id: ExtractBankVersionId.QONTO_DEFAULT,
222
+ bank: 'Qonto',
223
+ version: 'default',
224
+ country: 'FR',
225
+ type: 'neobank',
226
+ },
227
+ {
228
+ id: ExtractBankVersionId.SHINE_DEFAULT,
229
+ bank: 'Shine',
230
+ version: 'default',
231
+ country: 'FR',
232
+ type: 'neobank',
233
+ },
234
+ {
235
+ id: ExtractBankVersionId.FINOM_DEFAULT,
236
+ bank: 'Finom',
237
+ version: 'default',
238
+ country: 'EU',
239
+ type: 'neobank',
240
+ },
241
+ {
242
+ id: ExtractBankVersionId.TIIME_DEFAULT,
243
+ bank: 'Tiime',
244
+ version: 'default',
245
+ country: 'FR',
246
+ type: 'neobank',
247
+ },
248
+ {
249
+ id: ExtractBankVersionId.SPENDESK_DEFAULT,
250
+ bank: 'Spendesk',
251
+ version: 'default',
252
+ country: 'FR',
253
+ type: 'fintech',
254
+ },
255
+ {
256
+ id: ExtractBankVersionId.SWAN_DEFAULT,
257
+ bank: 'Swan',
258
+ version: 'default',
259
+ country: 'FR',
260
+ type: 'fintech',
261
+ },
262
+ {
263
+ id: ExtractBankVersionId.N26_DEFAULT,
264
+ bank: 'N26',
265
+ version: 'default',
266
+ country: 'EU',
267
+ type: 'neobank',
268
+ },
269
+ {
270
+ id: ExtractBankVersionId.REVOLUT_DEFAULT,
271
+ bank: 'Revolut',
272
+ version: 'default',
273
+ country: 'EU',
274
+ type: 'neobank',
275
+ },
276
+ {
277
+ id: ExtractBankVersionId.WISE_DEFAULT,
278
+ bank: 'Wise',
279
+ version: 'default',
280
+ country: 'INTL',
281
+ type: 'fintech',
282
+ },
283
+ {
284
+ id: ExtractBankVersionId.PAYPAL_DEFAULT,
285
+ bank: 'PayPal',
286
+ version: 'default',
287
+ country: 'INTL',
288
+ type: 'fintech',
289
+ },
290
+ {
291
+ id: ExtractBankVersionId.AIRWALLEX_DEFAULT,
292
+ bank: 'Airwallex',
293
+ version: 'default',
294
+ country: 'INTL',
295
+ type: 'fintech',
296
+ },
297
+ {
298
+ id: ExtractBankVersionId.VIVA_WALLET_DEFAULT,
299
+ bank: 'Viva Wallet',
300
+ version: 'default',
301
+ country: 'EU',
302
+ type: 'fintech',
303
+ },
304
+
305
+ // ─── International retail / corporate ─────
306
+ {
307
+ id: ExtractBankVersionId.HSBC_DEFAULT,
308
+ bank: 'HSBC',
309
+ version: 'default',
310
+ country: 'FR',
311
+ type: 'retail',
312
+ },
313
+ {
314
+ id: ExtractBankVersionId.HSBC_UK_DEFAULT,
315
+ bank: 'HSBC UK',
316
+ version: 'default',
317
+ country: 'UK',
318
+ type: 'retail',
319
+ },
320
+ {
321
+ id: ExtractBankVersionId.UBS_DEFAULT,
322
+ bank: 'UBS',
323
+ version: 'default',
324
+ country: 'CH',
325
+ type: 'corporate',
326
+ },
327
+ {
328
+ id: ExtractBankVersionId.CAIXA_DEFAULT,
329
+ bank: 'Caixa',
330
+ version: 'default',
331
+ country: 'PT',
332
+ type: 'retail',
333
+ },
334
+ {
335
+ id: ExtractBankVersionId.JPMORGAN_DEFAULT,
336
+ bank: 'JPMorgan',
337
+ version: 'default',
338
+ country: 'US',
339
+ type: 'corporate',
340
+ },
341
+ ];
342
+
343
+ /**
344
+ * Lookup by id (typed). Returns undefined for unknown ids — callers should
345
+ * treat that as "use auto mode" rather than crash.
346
+ */
347
+ export function getExtractBankCatalogueEntry(id: string): ExtractBankCatalogueEntry | undefined {
348
+ return EXTRACT_BANK_CATALOGUE.find((e) => e.id === id);
349
+ }
350
+
351
+ /**
352
+ * Group catalogue entries by the bank display name. Useful for UIs that
353
+ * show "BNP Paribas" once with a sub-menu listing all supported versions.
354
+ */
355
+ export function groupExtractCatalogueByBank(): Map<string, ExtractBankCatalogueEntry[]> {
356
+ const out = new Map<string, ExtractBankCatalogueEntry[]>();
357
+ for (const entry of EXTRACT_BANK_CATALOGUE) {
358
+ const list = out.get(entry.bank) ?? [];
359
+ list.push(entry);
360
+ out.set(entry.bank, list);
361
+ }
362
+ return out;
363
+ }
@@ -0,0 +1,16 @@
1
+ // ──────────────────────────────────────────────
2
+ // ExtractFieldFormat — the shape of a published field value, so a client can
3
+ // display it without knowing each key.
4
+ // ──────────────────────────────────────────────
5
+
6
+ export enum ExtractFieldFormat {
7
+ /** Integer amount in cents; the currency is the `currency` field. */
8
+ AMOUNT = 'amount',
9
+ /** ISO 8601 date (`YYYY-MM-DD`). */
10
+ DATE = 'date',
11
+ /** The percent itself: `9` for 9 %. */
12
+ PERCENT = 'percent',
13
+ BOOLEAN = 'boolean',
14
+ /** Free text or identifier (IBAN, SIRET, VAT number…), to display as is. */
15
+ TEXT = 'text',
16
+ }
@@ -0,0 +1,77 @@
1
+ // ──────────────────────────────────────────────
2
+ // ExtractFieldKey — every field key AbyssExtract can publish for a known
3
+ // document type (`generic` excluded: its fields are defined by the client).
4
+ // The value is the key found in `fields` of an extraction result. Which type
5
+ // publishes which key, and in which format: `EXTRACT_PUBLISHABLE_FIELDS`.
6
+ // A valid machine-readable zone publishes its fields and `mrzValid` whatever
7
+ // the document type.
8
+ // ──────────────────────────────────────────────
9
+
10
+ export enum ExtractFieldKey {
11
+ // Amounts
12
+ TOTAL_TTC = 'totalTtc',
13
+ TOTAL_HT = 'totalHt',
14
+ TOTAL_VAT = 'totalVat',
15
+ TOTAL = 'total',
16
+ VAT = 'vat',
17
+ OPENING_BALANCE = 'openingBalance',
18
+ CLOSING_BALANCE = 'closingBalance',
19
+ TOTAL_ACTIF = 'totalActif',
20
+ TOTAL_PASSIF = 'totalPassif',
21
+ FIXED_ASSETS = 'fixedAssets',
22
+ CURRENT_ASSETS = 'currentAssets',
23
+ CREDITORS_WITHIN_ONE_YEAR = 'creditorsWithinOneYear',
24
+ NET_CURRENT_LIABILITIES = 'netCurrentLiabilities',
25
+ TOTAL_ASSETS_LESS_CURRENT_LIABILITIES = 'totalAssetsLessCurrentLiabilities',
26
+ NET_ASSETS = 'netAssets',
27
+ CALLED_UP_SHARE_CAPITAL = 'calledUpShareCapital',
28
+ PROFIT_AND_LOSS_ACCOUNT = 'profitAndLossAccount',
29
+ TOTAL_SHAREHOLDERS_FUNDS = 'totalShareholdersFunds',
30
+ NET_CENTS = 'netCents',
31
+ GROSS_CENTS = 'grossCents',
32
+ NET_TAXABLE_CENTS = 'netTaxableCents',
33
+ PAS_AMOUNT_CENTS = 'pasAmountCents',
34
+ // Dates
35
+ INVOICE_DATE = 'invoiceDate',
36
+ DUE_DATE = 'dueDate',
37
+ DATE = 'date',
38
+ PERIOD_START = 'periodStart',
39
+ PERIOD_END = 'periodEnd',
40
+ FISCAL_YEAR_END = 'fiscalYearEnd',
41
+ BIRTH_DATE = 'birthDate',
42
+ EXPIRY_DATE = 'expiryDate',
43
+ ISSUE_DATE = 'issueDate',
44
+ // Percentages
45
+ PAS_RATE_PCT = 'pasRatePct',
46
+ // Identifiers
47
+ IBAN = 'iban',
48
+ BIC = 'bic',
49
+ SIRET = 'siret',
50
+ SIREN = 'siren',
51
+ VAT_NUMBER = 'vatNumber',
52
+ INVOICE_NUMBER = 'invoiceNumber',
53
+ DOCUMENT_NUMBER = 'documentNumber',
54
+ REGISTRATION_NUMBER = 'registrationNumber',
55
+ // Names and labels
56
+ SUPPLIER = 'supplier',
57
+ SUPPLIER_LEGAL_NAME = 'supplierLegalName',
58
+ MARKETPLACE = 'marketplace',
59
+ MERCHANT = 'merchant',
60
+ HOLDER_NAME = 'holderName',
61
+ BANK_NAME = 'bankName',
62
+ COMPANY = 'company',
63
+ EMPLOYER = 'employer',
64
+ LAST_NAME = 'lastName',
65
+ FIRST_NAMES = 'firstNames',
66
+ NATIONALITY = 'nationality',
67
+ /** ISO 4217 code of the published amounts. */
68
+ CURRENCY = 'currency',
69
+ /** Payslip period label: an ISO month (`2026-06`) or a day range (`2026-06-01..2026-06-30`). */
70
+ PERIOD = 'period',
71
+ // Machine-readable zone of an identity document
72
+ SEX = 'sex',
73
+ ISSUING_COUNTRY = 'issuingCountry',
74
+ DOCUMENT_KIND = 'documentKind',
75
+ /** Whether the check digits of the machine-readable zone are correct. */
76
+ MRZ_VALID = 'mrzValid',
77
+ }
@@ -0,0 +1,10 @@
1
+ // Global, document-type-agnostic feedback issue taxonomy for AbyssExtract.
2
+ // fieldKey localizes the issue to a specific extracted field when relevant.
3
+ export enum ExtractionFeedbackIssueType {
4
+ WRONG_VALUE = 'WRONG_VALUE',
5
+ MISSING_FIELD = 'MISSING_FIELD',
6
+ WRONG_DOCUMENT_TYPE = 'WRONG_DOCUMENT_TYPE',
7
+ EXTRA_RECORD = 'EXTRA_RECORD',
8
+ WRONG_RECORD = 'WRONG_RECORD',
9
+ OTHER = 'OTHER',
10
+ }
@@ -0,0 +1,7 @@
1
+ /** Terminal disposition of a single plan pass in the execution trace (P1). Mirrors server. */
2
+ export enum ExtractionStepStatus {
3
+ RAN = 'ran',
4
+ SKIPPED_BY_GATE = 'skippedByGate',
5
+ TIMEOUT = 'timeout',
6
+ FAILED = 'failed',
7
+ }
@@ -0,0 +1,78 @@
1
+ // ──────────────────────────────────────────────
2
+ // ExtractionWarningCode — structured warning codes emitted by the extraction
3
+ // orchestrator. The `code` is the i18n key suffix; `data` carries numeric/
4
+ // string values the UI formats locally (currencies, dates, etc.).
5
+ // ──────────────────────────────────────────────
6
+
7
+ export enum ExtractionWarningCode {
8
+ NO_RECORDS = 'no_records',
9
+ NO_IBAN = 'no_iban',
10
+ NO_BALANCES = 'no_balances',
11
+ BALANCE_MISMATCH = 'balance_mismatch',
12
+ /**
13
+ * A coherence validation error produced by an adapter's `validate()` call.
14
+ * `data.type` carries the adapter-specific error/warning type (e.g.
15
+ * `ACTIF_PASSIF_MISMATCH`, `TOTAL_MISMATCH`, `MRZ_INVALID`) and
16
+ * `data.message` carries the human-readable explanation. This allows
17
+ * arbitrary adapter validation results to surface without extending the
18
+ * enum for each domain-specific rule.
19
+ */
20
+ ADAPTER_VALIDATION_ERROR = 'adapter_validation_error',
21
+ /**
22
+ * A field was extracted but NOT published, because its calibrated confidence
23
+ * fell below the publish floor for its (documentType, fieldKey).
24
+ *
25
+ * This is deliberately its own code rather than an `ADAPTER_VALIDATION_ERROR`
26
+ * carrying a `data.type`. Suppression is a first-class product behaviour a
27
+ * client must be able to detect reliably — «did the engine find nothing, or
28
+ * did it find something it judged not worth sending?» are two different
29
+ * questions, and a client should not have to parse a free-text field to tell
30
+ * them apart.
31
+ *
32
+ * `data.fieldKey` names the field, `data.confidence` its calibrated value and
33
+ * `data.floor` the threshold it missed. The value itself is never in the
34
+ * warning: it stays in `provenance`, flagged `suppressed`.
35
+ */
36
+ FIELD_BELOW_PUBLISH_FLOOR = 'field_below_publish_floor',
37
+ /**
38
+ * A date field was extracted but NOT published, because nothing besides its
39
+ * format supported it: no label next to it, and it did not sit in the page
40
+ * band the document type expects for that field (#575).
41
+ *
42
+ * This is deliberately its own code rather than folded into
43
+ * `FIELD_BELOW_PUBLISH_FLOOR`: the confidence can sit ABOVE the field's
44
+ * publish floor (corroboration alone can carry a format-only date from 0.42
45
+ * to 0.565) and still not be published — a client checking only the floor
46
+ * would see no reason for the field's absence. Suppression is a first-class
47
+ * product behaviour a client must be able to detect reliably, here as much
48
+ * as for a below-floor drop.
49
+ *
50
+ * `data.fieldKey` names the field, `data.confidence` its calibrated value.
51
+ * The value itself is never in the warning: it stays in internal
52
+ * traceability only (`suppressedFields`, reason `format_only_date`), which
53
+ * is neither persisted nor returned to the client — only this warning is.
54
+ */
55
+ FIELD_FORMAT_ONLY_DATE = 'field_format_only_date',
56
+ /**
57
+ * A field of an identity document's machine-readable zone was read but NOT
58
+ * published, because its value lies outside the domain the zone allows
59
+ * (#614): a sex other than `M`, `F` or `X`, or a nationality or issuing
60
+ * state that is neither an ISO 3166-1 alpha-3 code nor one of the special
61
+ * codes of ICAO Doc 9303 part 3 (`D`, `UNO`, `XXA`, `RKS`…).
62
+ *
63
+ * These three fields are covered by no check digit, not even the composite
64
+ * one: a misread letter there leaves every key closing. The domain is the
65
+ * only check the zone itself offers for them, and a value that fails it is
66
+ * withheld rather than published at full confidence.
67
+ *
68
+ * This is deliberately its own code: the zone is valid and its other fields
69
+ * are published, so neither `FIELD_BELOW_PUBLISH_FLOOR` nor an
70
+ * `ADAPTER_VALIDATION_ERROR` of type `MRZ_INVALID` would tell the client why
71
+ * this one field is missing.
72
+ *
73
+ * `data.fieldKey` names the field. The value itself is never in the warning:
74
+ * it stays in internal traceability only (`suppressedFields`, reason
75
+ * `mrz_out_of_domain`), which is neither persisted nor returned to the client.
76
+ */
77
+ FIELD_MRZ_OUT_OF_DOMAIN = 'field_mrz_out_of_domain',
78
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Antivirus scan verdict for a stored file, mirrored from AbyssStorage.
3
+ *
4
+ * Same vocabulary as `@abyss-project/storage`'s `FileScanStatus` enum
5
+ * (`application_files.scanStatus`): `pending_scan` | `clean` | `infected` |
6
+ * `skipped` | `error`. Intentionally re-declared here as a string union — NOT
7
+ * imported — because abyss-tools-core is standalone (does not depend on
8
+ * `@abyss-project/storage`), the same approach every other core package
9
+ * (abyss-main asset-core, abyss-banking-core, abyss-memories-core) takes for
10
+ * a mirrored external vocabulary. `BeamFileScanStatus` (beam.enum.ts) mirrors
11
+ * the SAME storage vocabulary as a real TS enum instead: that shape fits
12
+ * beam, which converts a single Map of live-read values at ONE serialization
13
+ * boundary (an explicit `Record<FileScanStatus, BeamFileScanStatus>`
14
+ * suffices there). This column is denormalized and WRITTEN from several call
15
+ * sites (webhook UPLOAD seed, webhook SCAN_RESULT update, cloud-import
16
+ * mirror, archive-upload seed) — a string union lets the backend assign a
17
+ * storage `FileScanStatus` enum value straight into it with no cast (a
18
+ * string-enum member is assignable to a matching string-literal union, but
19
+ * NOT to a distinct local enum with identical values), avoiding a repeated
20
+ * conversion Record at every one of those sites. Keep the members in sync
21
+ * with storage's enum.
22
+ *
23
+ * Storage-neutral posture (ADR-0038): this field is purely informational —
24
+ * exposed so the front can render an AbyssProbe indicator (clean / "en
25
+ * analyse" / infected). Nothing in abyss-tools purges an infected row,
26
+ * redacts a servable id, or blocks a read while pending; the front decides
27
+ * what to show (e.g. blurring a pending thumbnail).
28
+ *
29
+ * Used by BoardCardDocument, AtlasDocument and ExtractionFile (the last only
30
+ * for an archive-owned row — see ExtractionFile.scanStatus's own doc
31
+ * comment).
32
+ */
33
+ export type FileScanStatus = 'pending_scan' | 'clean' | 'infected' | 'skipped' | 'error';
@@ -0,0 +1,12 @@
1
+ export * from './api-error.enum';
2
+ export * from './document-type.enum';
3
+ export * from './extract-bank.enum';
4
+ export * from './extraction-warning.enum';
5
+ export * from './extract-field-key.enum';
6
+ export * from './extract-field-format.enum';
7
+ export * from './extraction-feedback-issue-type.enum';
8
+ export * from './provider-kind.enum';
9
+ export * from './interpreter-kind.enum';
10
+ export * from './combine-strategy.enum';
11
+ export * from './extraction-step-status.enum';
12
+ export * from './file-scan-status.enum';
@@ -0,0 +1,7 @@
1
+ // Interpreter kind enum — mirror apps/api interpreter.interface.ts exactly.
2
+
3
+ export enum InterpreterKind {
4
+ ALGORITHMIC = 'algorithmic',
5
+ TEMPLATE = 'template',
6
+ LLM = 'llm',
7
+ }
@@ -0,0 +1,13 @@
1
+ // Provider kind and cost tier enums — mirror apps/api provider.interface.ts exactly.
2
+
3
+ export enum ProviderKind {
4
+ TEXT = 'text',
5
+ OCR = 'ocr',
6
+ AI = 'ai',
7
+ }
8
+
9
+ export enum CostTier {
10
+ CHEAP = 'cheap',
11
+ MEDIUM = 'medium',
12
+ EXPENSIVE = 'expensive',
13
+ }
@@ -0,0 +1,2 @@
1
+ export * from './interface';
2
+ export * from './enum';
@@ -0,0 +1,5 @@
1
+ export * from './requests';
2
+ export * from './responses';
3
+ export * from './type-message/response';
4
+ export * from './type-message/api-error';
5
+ export * from './type-message/base-paginate';