@abyss-project/extract 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +32 -0
- package/.prettierrc +5 -0
- package/README.md +21 -2
- package/dist/api/extraction-plan-preset.api.d.ts +9 -0
- package/dist/api/extraction-plan-preset.api.js +36 -0
- package/dist/api/extraction-plan-preset.api.js.map +1 -0
- package/dist/api/extraction-plan-preset.api.test.d.ts +1 -0
- package/dist/api/extraction-plan-preset.api.test.js +51 -0
- package/dist/api/extraction-plan-preset.api.test.js.map +1 -0
- package/dist/api/extraction-settings.api.d.ts +4 -0
- package/dist/api/extraction-settings.api.js +22 -0
- package/dist/api/extraction-settings.api.js.map +1 -0
- package/dist/api/extraction.api.d.ts +76 -0
- package/dist/api/extraction.api.js +414 -0
- package/dist/api/extraction.api.js.map +1 -0
- package/dist/api/extraction.application.api.d.ts +4 -0
- package/dist/api/extraction.application.api.js +23 -0
- package/dist/api/extraction.application.api.js.map +1 -0
- package/dist/api/extraction.application.api.test.d.ts +1 -0
- package/dist/api/extraction.application.api.test.js +69 -0
- package/dist/api/extraction.application.api.test.js.map +1 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +21 -0
- package/dist/api/index.js.map +1 -0
- package/dist/constants/extract.constants.d.ts +4 -0
- package/dist/constants/extract.constants.js +91 -0
- package/dist/constants/extract.constants.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +18 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/index.d.ts +127 -0
- package/dist/index.js +210 -0
- package/dist/index.js.map +1 -0
- package/dist/types/enum/api-error.enum.d.ts +31 -0
- package/dist/types/enum/api-error.enum.js +37 -0
- package/dist/types/enum/api-error.enum.js.map +1 -0
- package/dist/types/enum/combine-strategy.enum.d.ts +5 -0
- package/dist/types/enum/combine-strategy.enum.js +10 -0
- package/dist/types/enum/combine-strategy.enum.js.map +1 -0
- package/dist/types/enum/document-type.enum.d.ts +10 -0
- package/dist/types/enum/document-type.enum.js +15 -0
- package/dist/types/enum/document-type.enum.js.map +1 -0
- package/dist/types/enum/extract-bank.enum.d.ts +50 -0
- package/dist/types/enum/extract-bank.enum.js +327 -0
- package/dist/types/enum/extract-bank.enum.js.map +1 -0
- package/dist/types/enum/extract-field-format.enum.d.ts +7 -0
- package/dist/types/enum/extract-field-format.enum.js +12 -0
- package/dist/types/enum/extract-field-format.enum.js.map +1 -0
- package/dist/types/enum/extract-field-key.enum.d.ts +59 -0
- package/dist/types/enum/extract-field-key.enum.js +64 -0
- package/dist/types/enum/extract-field-key.enum.js.map +1 -0
- package/dist/types/enum/extraction-feedback-issue-type.enum.d.ts +8 -0
- package/dist/types/enum/extraction-feedback-issue-type.enum.js +13 -0
- package/dist/types/enum/extraction-feedback-issue-type.enum.js.map +1 -0
- package/dist/types/enum/extraction-step-status.enum.d.ts +6 -0
- package/dist/types/enum/extraction-step-status.enum.js +11 -0
- package/dist/types/enum/extraction-step-status.enum.js.map +1 -0
- package/dist/types/enum/extraction-warning.enum.d.ts +10 -0
- package/dist/types/enum/extraction-warning.enum.js +15 -0
- package/dist/types/enum/extraction-warning.enum.js.map +1 -0
- package/dist/types/enum/file-scan-status.enum.d.ts +1 -0
- package/dist/types/enum/file-scan-status.enum.js +3 -0
- package/dist/types/enum/file-scan-status.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +12 -0
- package/dist/types/enum/index.js +29 -0
- package/dist/types/enum/index.js.map +1 -0
- package/dist/types/enum/interpreter-kind.enum.d.ts +5 -0
- package/dist/types/enum/interpreter-kind.enum.js +10 -0
- package/dist/types/enum/interpreter-kind.enum.js.map +1 -0
- package/dist/types/enum/provider-kind.enum.d.ts +10 -0
- package/dist/types/enum/provider-kind.enum.js +16 -0
- package/dist/types/enum/provider-kind.enum.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interface/api/index.d.ts +5 -0
- package/dist/types/interface/api/index.js +22 -0
- package/dist/types/interface/api/index.js.map +1 -0
- package/dist/types/interface/api/requests/extraction.request.d.ts +259 -0
- package/dist/types/interface/api/requests/extraction.request.js +3 -0
- package/dist/types/interface/api/requests/extraction.request.js.map +1 -0
- package/dist/types/interface/api/requests/index.d.ts +1 -0
- package/dist/types/interface/api/requests/index.js +18 -0
- package/dist/types/interface/api/requests/index.js.map +1 -0
- package/dist/types/interface/api/responses/extraction.response.d.ts +424 -0
- package/dist/types/interface/api/responses/extraction.response.js +3 -0
- package/dist/types/interface/api/responses/extraction.response.js.map +1 -0
- package/dist/types/interface/api/responses/index.d.ts +1 -0
- package/dist/types/interface/api/responses/index.js +18 -0
- package/dist/types/interface/api/responses/index.js.map +1 -0
- package/dist/types/interface/api/type-message/api-error.d.ts +6 -0
- package/dist/types/interface/api/type-message/api-error.js +3 -0
- package/dist/types/interface/api/type-message/api-error.js.map +1 -0
- package/dist/types/interface/api/type-message/base-paginate.d.ts +10 -0
- package/dist/types/interface/api/type-message/base-paginate.js +3 -0
- package/dist/types/interface/api/type-message/base-paginate.js.map +1 -0
- package/dist/types/interface/api/type-message/response.d.ts +5 -0
- package/dist/types/interface/api/type-message/response.js +3 -0
- package/dist/types/interface/api/type-message/response.js.map +1 -0
- package/dist/types/interface/index.d.ts +2 -0
- package/dist/types/interface/index.js +19 -0
- package/dist/types/interface/index.js.map +1 -0
- package/dist/types/interface/models/extraction-fetched-provenance.dto.test.d.ts +1 -0
- package/dist/types/interface/models/extraction-fetched-provenance.dto.test.js +165 -0
- package/dist/types/interface/models/extraction-fetched-provenance.dto.test.js.map +1 -0
- package/dist/types/interface/models/extraction-plan.dto.d.ts +192 -0
- package/dist/types/interface/models/extraction-plan.dto.js +13 -0
- package/dist/types/interface/models/extraction-plan.dto.js.map +1 -0
- package/dist/types/interface/models/extraction-plan.dto.test.d.ts +1 -0
- package/dist/types/interface/models/extraction-plan.dto.test.js +40 -0
- package/dist/types/interface/models/extraction-plan.dto.test.js.map +1 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.d.ts +37 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.js +3 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.js.map +1 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.test.d.ts +1 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.test.js +32 -0
- package/dist/types/interface/models/extraction-spatial-template.dto.test.js.map +1 -0
- package/dist/types/interface/models/extraction.dto.d.ts +255 -0
- package/dist/types/interface/models/extraction.dto.js +28 -0
- package/dist/types/interface/models/extraction.dto.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +3 -0
- package/dist/types/interface/models/index.js +20 -0
- package/dist/types/interface/models/index.js.map +1 -0
- package/dist/utils/enum.utils.d.ts +1 -0
- package/dist/utils/enum.utils.js +3 -0
- package/dist/utils/enum.utils.js.map +1 -0
- package/dist/utils/error.utils.d.ts +15 -0
- package/dist/utils/error.utils.js +25 -0
- package/dist/utils/error.utils.js.map +1 -0
- package/dist/utils/extraction-webhook.utils.d.ts +6 -0
- package/dist/utils/extraction-webhook.utils.js +17 -0
- package/dist/utils/extraction-webhook.utils.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +20 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +58 -4
- package/src/api/extraction-plan-preset.api.test.ts +24 -0
- package/src/api/extraction-plan-preset.api.ts +97 -0
- package/src/api/extraction-settings.api.ts +53 -0
- package/src/api/extraction.api.ts +1012 -0
- package/src/api/extraction.application.api.test.ts +55 -0
- package/src/api/extraction.application.api.ts +73 -0
- package/src/api/index.ts +4 -0
- package/src/constants/extract.constants.ts +109 -0
- package/src/constants/index.ts +1 -0
- package/src/index.ts +305 -0
- package/src/types/enum/api-error.enum.ts +33 -0
- package/src/types/enum/combine-strategy.enum.ts +7 -0
- package/src/types/enum/document-type.enum.ts +11 -0
- package/src/types/enum/extract-bank.enum.ts +363 -0
- package/src/types/enum/extract-field-format.enum.ts +16 -0
- package/src/types/enum/extract-field-key.enum.ts +77 -0
- package/src/types/enum/extraction-feedback-issue-type.enum.ts +10 -0
- package/src/types/enum/extraction-step-status.enum.ts +7 -0
- package/src/types/enum/extraction-warning.enum.ts +78 -0
- package/src/types/enum/file-scan-status.enum.ts +33 -0
- package/src/types/enum/index.ts +12 -0
- package/src/types/enum/interpreter-kind.enum.ts +7 -0
- package/src/types/enum/provider-kind.enum.ts +13 -0
- package/src/types/index.ts +2 -0
- package/src/types/interface/api/index.ts +5 -0
- package/src/types/interface/api/requests/extraction.request.ts +423 -0
- package/src/types/interface/api/requests/index.ts +1 -0
- package/src/types/interface/api/responses/extraction.response.ts +488 -0
- package/src/types/interface/api/responses/index.ts +1 -0
- package/src/types/interface/api/type-message/api-error.ts +7 -0
- package/src/types/interface/api/type-message/base-paginate.ts +11 -0
- package/src/types/interface/api/type-message/response.ts +6 -0
- package/src/types/interface/index.ts +2 -0
- package/src/types/interface/models/extraction-fetched-provenance.dto.test.ts +204 -0
- package/src/types/interface/models/extraction-plan.dto.test.ts +60 -0
- package/src/types/interface/models/extraction-plan.dto.ts +280 -0
- package/src/types/interface/models/extraction-spatial-template.dto.test.ts +48 -0
- package/src/types/interface/models/extraction-spatial-template.dto.ts +48 -0
- package/src/types/interface/models/extraction.dto.ts +399 -0
- package/src/types/interface/models/index.ts +3 -0
- package/src/types/tests/extract-bank-catalogue.spec.ts +74 -0
- package/src/utils/enum.utils.ts +1 -0
- package/src/utils/error.utils.ts +30 -0
- package/src/utils/extraction-webhook.utils.ts +30 -0
- package/src/utils/index.ts +3 -0
- package/tsconfig.check.json +15 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { ExtractionWarningCode } from '../../../types/enum/extraction-warning.enum';
|
|
2
|
+
import { ExtractionFeedbackIssueType } from '../../../types/enum/extraction-feedback-issue-type.enum';
|
|
3
|
+
import { DocumentType } from '../../../types/enum/document-type.enum';
|
|
4
|
+
import { FileScanStatus } from '../../enum/file-scan-status.enum';
|
|
5
|
+
import type { IFieldValue, IExecutionManifest, IGlobalConfidence, IExecutionTrace } from './extraction-plan.dto';
|
|
6
|
+
export { ExtractionFeedbackIssueType };
|
|
7
|
+
export type ExtractionMode = 'auto' | 'hint' | 'template';
|
|
8
|
+
export type ProcessingMode = 'sync' | 'queue';
|
|
9
|
+
export type ExtractionStatus = 'pending' | 'completed' | 'failed' | 'cached';
|
|
10
|
+
export type ExtractionFeedbackStatus = 'open' | 'triaged' | 'fixed' | 'closed';
|
|
11
|
+
export type ExtractionUsageEventType = 'extract.sync.success' | 'extract.sync.cached' | 'extract.sync.failed' | 'extract.queue.enqueued' | 'extract.queue.success' | 'extract.queue.cached' | 'extract.queue.failed' | 'template.run.success' | 'template.run.failed';
|
|
12
|
+
export interface IExtractionBankHint {
|
|
13
|
+
bank: string;
|
|
14
|
+
version?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IExtractionTransaction {
|
|
17
|
+
date?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
amount?: number;
|
|
20
|
+
balance?: number;
|
|
21
|
+
valueDate?: string;
|
|
22
|
+
bookingDate?: string;
|
|
23
|
+
reference?: string;
|
|
24
|
+
[k: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface IExtractionMetadata {
|
|
27
|
+
iban?: string;
|
|
28
|
+
bic?: string;
|
|
29
|
+
bank?: string;
|
|
30
|
+
accountHolder?: string;
|
|
31
|
+
periodStart?: string;
|
|
32
|
+
periodEnd?: string;
|
|
33
|
+
openingBalance?: number;
|
|
34
|
+
closingBalance?: number;
|
|
35
|
+
currency?: string;
|
|
36
|
+
[k: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
export interface IPayslipMetadata {
|
|
39
|
+
netCents?: number;
|
|
40
|
+
grossCents?: number;
|
|
41
|
+
netTaxableCents?: number;
|
|
42
|
+
pasRatePct?: number;
|
|
43
|
+
pasAmountCents?: number;
|
|
44
|
+
period?: string;
|
|
45
|
+
employer?: string;
|
|
46
|
+
currency?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface IExtractionFile {
|
|
49
|
+
id: string;
|
|
50
|
+
userId: string;
|
|
51
|
+
applicationId: string | null;
|
|
52
|
+
pdfHash: string;
|
|
53
|
+
pdfSizeBytes: number;
|
|
54
|
+
pdfMimeType: string;
|
|
55
|
+
pdfPageCount: number | null;
|
|
56
|
+
pdfFilename: string | null;
|
|
57
|
+
applicationFileId: string | null;
|
|
58
|
+
userExternalId: string | null;
|
|
59
|
+
userMetadata: Record<string, unknown> | null;
|
|
60
|
+
detectedBank: string | null;
|
|
61
|
+
detectedVersion: string | null;
|
|
62
|
+
detectedIban: string | null;
|
|
63
|
+
detectedBic: string | null;
|
|
64
|
+
detectedCurrency: string | null;
|
|
65
|
+
scanStatus: FileScanStatus | null;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
}
|
|
69
|
+
export { ExtractionWarningCode };
|
|
70
|
+
export interface IExtractionWarning {
|
|
71
|
+
code: ExtractionWarningCode;
|
|
72
|
+
data?: {
|
|
73
|
+
actualCents?: number;
|
|
74
|
+
expectedCents?: number;
|
|
75
|
+
currency?: string;
|
|
76
|
+
type?: string;
|
|
77
|
+
message?: string;
|
|
78
|
+
fieldKey?: string;
|
|
79
|
+
confidence?: number;
|
|
80
|
+
floor?: number;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface IExtraction {
|
|
84
|
+
id: string;
|
|
85
|
+
fileId: string;
|
|
86
|
+
mode: ExtractionMode;
|
|
87
|
+
hintBank: string | null;
|
|
88
|
+
hintVersion: string | null;
|
|
89
|
+
templateId: string | null;
|
|
90
|
+
templateVersion: number | null;
|
|
91
|
+
status: ExtractionStatus;
|
|
92
|
+
strategyUsed: string | null;
|
|
93
|
+
confidence: number | null;
|
|
94
|
+
recordsCount: number | null;
|
|
95
|
+
balanceValidated: boolean | null;
|
|
96
|
+
durationMs: number | null;
|
|
97
|
+
error: string | null;
|
|
98
|
+
recordsJson: IExtractionTransaction[] | null;
|
|
99
|
+
metadataJson: IExtractionMetadata | null;
|
|
100
|
+
warningsJson: IExtractionWarning[] | null;
|
|
101
|
+
tags: string[] | null;
|
|
102
|
+
note: string | null;
|
|
103
|
+
shareToken: string | null;
|
|
104
|
+
shareExpiresAt: string | null;
|
|
105
|
+
documentType: string | null;
|
|
106
|
+
documentTypeConfidence: number | null;
|
|
107
|
+
fieldsJson: Record<string, IFieldValue> | null;
|
|
108
|
+
improvementConsent: boolean;
|
|
109
|
+
usableForTraining: boolean;
|
|
110
|
+
supportTicketId: string | null;
|
|
111
|
+
trainingFileId: string | null;
|
|
112
|
+
usedOcr: boolean;
|
|
113
|
+
ocrPageCount: number;
|
|
114
|
+
executionManifest?: IExecutionManifest | null;
|
|
115
|
+
globalConfidence?: IGlobalConfidence | null;
|
|
116
|
+
executionTrace?: IExecutionTrace | null;
|
|
117
|
+
createdAt: string;
|
|
118
|
+
}
|
|
119
|
+
export interface IExtractionTemplate {
|
|
120
|
+
id: string;
|
|
121
|
+
userId: string | null;
|
|
122
|
+
organizationId: string | null;
|
|
123
|
+
projectId: string | null;
|
|
124
|
+
createdByUserId: string | null;
|
|
125
|
+
name: string;
|
|
126
|
+
description: string | null;
|
|
127
|
+
documentType: DocumentType | null;
|
|
128
|
+
isActive: boolean;
|
|
129
|
+
lastUsedAt: string | null;
|
|
130
|
+
createdAt: string;
|
|
131
|
+
updatedAt: string;
|
|
132
|
+
}
|
|
133
|
+
export interface IExtractionTemplateZone {
|
|
134
|
+
name: string;
|
|
135
|
+
page: number;
|
|
136
|
+
x: number;
|
|
137
|
+
y: number;
|
|
138
|
+
w: number;
|
|
139
|
+
h: number;
|
|
140
|
+
}
|
|
141
|
+
export interface IExtractionTemplateDsl {
|
|
142
|
+
regex_iban?: string;
|
|
143
|
+
regex_bic?: string;
|
|
144
|
+
period?: {
|
|
145
|
+
regex: string;
|
|
146
|
+
};
|
|
147
|
+
balance?: {
|
|
148
|
+
opening_regex?: string;
|
|
149
|
+
closing_regex?: string;
|
|
150
|
+
};
|
|
151
|
+
transactions?: {
|
|
152
|
+
row_pattern: string;
|
|
153
|
+
date_format?: string;
|
|
154
|
+
amount_locale?: 'fr' | 'en';
|
|
155
|
+
sign_rule?: 'explicit' | 'keyword';
|
|
156
|
+
};
|
|
157
|
+
skip_patterns?: string[];
|
|
158
|
+
zones?: IExtractionTemplateZone[];
|
|
159
|
+
}
|
|
160
|
+
export interface IExtractionTemplateVersion {
|
|
161
|
+
id: string;
|
|
162
|
+
templateId: string;
|
|
163
|
+
version: number;
|
|
164
|
+
templateJson: Record<string, unknown>;
|
|
165
|
+
comment: string | null;
|
|
166
|
+
witnessFileId: string | null;
|
|
167
|
+
witnessSizeBytes: number | null;
|
|
168
|
+
witnessFilename: string | null;
|
|
169
|
+
createdAt: string;
|
|
170
|
+
}
|
|
171
|
+
export interface IExtractionFeedback {
|
|
172
|
+
id: string;
|
|
173
|
+
extractionId: string;
|
|
174
|
+
userId: string;
|
|
175
|
+
issueType: ExtractionFeedbackIssueType;
|
|
176
|
+
fieldKey: string | null;
|
|
177
|
+
expectedValue: string | null;
|
|
178
|
+
description: string | null;
|
|
179
|
+
supportTicketId: string | null;
|
|
180
|
+
status: ExtractionFeedbackStatus;
|
|
181
|
+
createdAt: string;
|
|
182
|
+
}
|
|
183
|
+
export interface IExtractionWebhookDelivery {
|
|
184
|
+
id: string;
|
|
185
|
+
userId: string | null;
|
|
186
|
+
organizationId: string | null;
|
|
187
|
+
projectId: string | null;
|
|
188
|
+
createdByUserId: string | null;
|
|
189
|
+
webhookId: string | null;
|
|
190
|
+
jobId: string | null;
|
|
191
|
+
event: string;
|
|
192
|
+
url: string;
|
|
193
|
+
payloadJson: Record<string, unknown>;
|
|
194
|
+
attempts: number;
|
|
195
|
+
lastStatus: number | null;
|
|
196
|
+
lastError: string | null;
|
|
197
|
+
deliveredAt: string | null;
|
|
198
|
+
createdAt: string;
|
|
199
|
+
updatedAt: string;
|
|
200
|
+
}
|
|
201
|
+
export declare enum ExtractionWebhookEvent {
|
|
202
|
+
EXTRACT_COMPLETED = "rcb.extract.completed",
|
|
203
|
+
EXTRACT_FAILED = "rcb.extract.failed",
|
|
204
|
+
EXTRACT_LOW_CONFIDENCE = "rcb.extract.low-confidence",
|
|
205
|
+
EXTRACT_BALANCE_KO = "rcb.extract.balance-ko",
|
|
206
|
+
FILE_ARCHIVED = "rcb.file.archived",
|
|
207
|
+
SHARE_MINTED = "rcb.share.minted",
|
|
208
|
+
SHARE_REVOKED = "rcb.share.revoked",
|
|
209
|
+
FEEDBACK_SUBMITTED = "rcb.feedback.submitted",
|
|
210
|
+
JOB_FAILED = "rcb.job.failed",
|
|
211
|
+
EXPORT_COMPLETED = "rcb.export.completed",
|
|
212
|
+
EXPORT_FAILED = "rcb.export.failed"
|
|
213
|
+
}
|
|
214
|
+
export declare const EXTRACTION_WEBHOOK_EVENTS: ExtractionWebhookEvent[];
|
|
215
|
+
export interface IExtractionWebhook {
|
|
216
|
+
id: string;
|
|
217
|
+
userId: string | null;
|
|
218
|
+
organizationId: string | null;
|
|
219
|
+
projectId: string | null;
|
|
220
|
+
createdByUserId: string | null;
|
|
221
|
+
webhookUrl: string;
|
|
222
|
+
webhookSecret: string;
|
|
223
|
+
isEnabled: boolean;
|
|
224
|
+
name: string;
|
|
225
|
+
description: string;
|
|
226
|
+
scopes: ExtractionWebhookEvent[];
|
|
227
|
+
consecutiveFailures: number;
|
|
228
|
+
createdAt: string;
|
|
229
|
+
updatedAt: string;
|
|
230
|
+
}
|
|
231
|
+
export interface IExtractionBankVersion {
|
|
232
|
+
id: string;
|
|
233
|
+
bank: string;
|
|
234
|
+
version: string;
|
|
235
|
+
validFrom: string | null;
|
|
236
|
+
validTo: string | null;
|
|
237
|
+
detectorJson: Record<string, unknown>;
|
|
238
|
+
parserKind: string;
|
|
239
|
+
configJson: Record<string, unknown>;
|
|
240
|
+
isActive: boolean;
|
|
241
|
+
createdAt: string;
|
|
242
|
+
updatedAt: string;
|
|
243
|
+
}
|
|
244
|
+
export declare enum ExtractionSettingsScopeKind {
|
|
245
|
+
USER = "user",
|
|
246
|
+
ORG = "org"
|
|
247
|
+
}
|
|
248
|
+
export interface IExtractionSettings {
|
|
249
|
+
id: string;
|
|
250
|
+
userId: string | null;
|
|
251
|
+
organizationId: string | null;
|
|
252
|
+
improvementDefault: boolean;
|
|
253
|
+
createdAt: string;
|
|
254
|
+
updatedAt: string;
|
|
255
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtractionSettingsScopeKind = exports.EXTRACTION_WEBHOOK_EVENTS = exports.ExtractionWebhookEvent = exports.ExtractionWarningCode = exports.ExtractionFeedbackIssueType = void 0;
|
|
4
|
+
const extraction_warning_enum_1 = require("../../../types/enum/extraction-warning.enum");
|
|
5
|
+
Object.defineProperty(exports, "ExtractionWarningCode", { enumerable: true, get: function () { return extraction_warning_enum_1.ExtractionWarningCode; } });
|
|
6
|
+
const extraction_feedback_issue_type_enum_1 = require("../../../types/enum/extraction-feedback-issue-type.enum");
|
|
7
|
+
Object.defineProperty(exports, "ExtractionFeedbackIssueType", { enumerable: true, get: function () { return extraction_feedback_issue_type_enum_1.ExtractionFeedbackIssueType; } });
|
|
8
|
+
var ExtractionWebhookEvent;
|
|
9
|
+
(function (ExtractionWebhookEvent) {
|
|
10
|
+
ExtractionWebhookEvent["EXTRACT_COMPLETED"] = "rcb.extract.completed";
|
|
11
|
+
ExtractionWebhookEvent["EXTRACT_FAILED"] = "rcb.extract.failed";
|
|
12
|
+
ExtractionWebhookEvent["EXTRACT_LOW_CONFIDENCE"] = "rcb.extract.low-confidence";
|
|
13
|
+
ExtractionWebhookEvent["EXTRACT_BALANCE_KO"] = "rcb.extract.balance-ko";
|
|
14
|
+
ExtractionWebhookEvent["FILE_ARCHIVED"] = "rcb.file.archived";
|
|
15
|
+
ExtractionWebhookEvent["SHARE_MINTED"] = "rcb.share.minted";
|
|
16
|
+
ExtractionWebhookEvent["SHARE_REVOKED"] = "rcb.share.revoked";
|
|
17
|
+
ExtractionWebhookEvent["FEEDBACK_SUBMITTED"] = "rcb.feedback.submitted";
|
|
18
|
+
ExtractionWebhookEvent["JOB_FAILED"] = "rcb.job.failed";
|
|
19
|
+
ExtractionWebhookEvent["EXPORT_COMPLETED"] = "rcb.export.completed";
|
|
20
|
+
ExtractionWebhookEvent["EXPORT_FAILED"] = "rcb.export.failed";
|
|
21
|
+
})(ExtractionWebhookEvent || (exports.ExtractionWebhookEvent = ExtractionWebhookEvent = {}));
|
|
22
|
+
exports.EXTRACTION_WEBHOOK_EVENTS = Object.values(ExtractionWebhookEvent);
|
|
23
|
+
var ExtractionSettingsScopeKind;
|
|
24
|
+
(function (ExtractionSettingsScopeKind) {
|
|
25
|
+
ExtractionSettingsScopeKind["USER"] = "user";
|
|
26
|
+
ExtractionSettingsScopeKind["ORG"] = "org";
|
|
27
|
+
})(ExtractionSettingsScopeKind || (exports.ExtractionSettingsScopeKind = ExtractionSettingsScopeKind = {}));
|
|
28
|
+
//# sourceMappingURL=extraction.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extraction.dto.js","sourceRoot":"","sources":["../../../../src/types/interface/models/extraction.dto.ts"],"names":[],"mappings":";;;AAKA,yFAAoF;AA8G3E,sGA9GA,+CAAqB,OA8GA;AA7G9B,iHAAsG;AAW7F,4GAXA,iEAA2B,OAWA;AAuTpC,IAAY,sBAYX;AAZD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,+DAAqC,CAAA;IACrC,+EAAqD,CAAA;IACrD,uEAA6C,CAAA;IAC7C,6DAAmC,CAAA;IACnC,2DAAiC,CAAA;IACjC,6DAAmC,CAAA;IACnC,uEAA6C,CAAA;IAC7C,uDAA6B,CAAA;IAC7B,mEAAyC,CAAA;IACzC,6DAAmC,CAAA;AACrC,CAAC,EAZW,sBAAsB,sCAAtB,sBAAsB,QAYjC;AAEY,QAAA,yBAAyB,GACpC,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAuCxC,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,4CAAa,CAAA;IACb,0CAAW,CAAA;AACb,CAAC,EAHW,2BAA2B,2CAA3B,2BAA2B,QAGtC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./extraction.dto"), exports);
|
|
18
|
+
__exportStar(require("./extraction-plan.dto"), exports);
|
|
19
|
+
__exportStar(require("./extraction-spatial-template.dto"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/interface/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,wDAAsC;AACtC,oEAAkD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ValueOf<T> = T[keyof T];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.utils.js","sourceRoot":"","sources":["../../src/utils/enum.utils.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Code, ErrorType } from '../types';
|
|
2
|
+
type ErrorParams = {
|
|
3
|
+
code: Code;
|
|
4
|
+
type: ErrorType;
|
|
5
|
+
message?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class ServiceException extends Error {
|
|
8
|
+
private readonly code;
|
|
9
|
+
private readonly type;
|
|
10
|
+
getCode(): Code;
|
|
11
|
+
getType(): ErrorType;
|
|
12
|
+
constructor(params: ErrorParams);
|
|
13
|
+
}
|
|
14
|
+
export declare const handleError: (error: Error | ErrorParams, _params?: ErrorParams) => Error;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleError = exports.ServiceException = void 0;
|
|
4
|
+
class ServiceException extends Error {
|
|
5
|
+
getCode() {
|
|
6
|
+
return this.code;
|
|
7
|
+
}
|
|
8
|
+
getType() {
|
|
9
|
+
return this.type;
|
|
10
|
+
}
|
|
11
|
+
constructor(params) {
|
|
12
|
+
super(params.message);
|
|
13
|
+
this.code = params.code;
|
|
14
|
+
this.type = params.type;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ServiceException = ServiceException;
|
|
18
|
+
const handleError = (error, _params) => {
|
|
19
|
+
if (error instanceof Error) {
|
|
20
|
+
return error;
|
|
21
|
+
}
|
|
22
|
+
return new ServiceException(error);
|
|
23
|
+
};
|
|
24
|
+
exports.handleError = handleError;
|
|
25
|
+
//# sourceMappingURL=error.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.utils.js","sourceRoot":"","sources":["../../src/utils/error.utils.ts"],"names":[],"mappings":";;;AAIA,MAAa,gBAAiB,SAAQ,KAAK;IAKzC,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;CACF;AAlBD,4CAkBC;AAEM,MAAM,WAAW,GAAG,CAAC,KAA0B,EAAE,OAAqB,EAAS,EAAE;IACtF,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC;AALW,QAAA,WAAW,eAKtB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.verifyExtractionWebhook = verifyExtractionWebhook;
|
|
4
|
+
function verifyExtractionWebhook(input) {
|
|
5
|
+
if (!input.signatureHeader || !input.secret)
|
|
6
|
+
return false;
|
|
7
|
+
const crypto = require('crypto');
|
|
8
|
+
const provided = input.signatureHeader.replace(/^sha256=/, '');
|
|
9
|
+
const computed = crypto
|
|
10
|
+
.createHmac('sha256', input.secret)
|
|
11
|
+
.update(input.rawBody)
|
|
12
|
+
.digest('hex');
|
|
13
|
+
if (provided.length !== computed.length)
|
|
14
|
+
return false;
|
|
15
|
+
return crypto.timingSafeEqual(Buffer.from(provided, 'hex'), Buffer.from(computed, 'hex'));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=extraction-webhook.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extraction-webhook.utils.js","sourceRoot":"","sources":["../../src/utils/extraction-webhook.utils.ts"],"names":[],"mappings":";;AAkBA,0DAWC;AAXD,SAAgB,uBAAuB,CAAC,KAAmC;IACzE,IAAI,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAE1D,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAW,MAAM;SAC5B,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;SAClC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;SACrB,MAAM,CAAC,KAAK,CAAC,CAAC;IACjB,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACtD,OAAO,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./error.utils"), exports);
|
|
18
|
+
__exportStar(require("./enum.utils"), exports);
|
|
19
|
+
__exportStar(require("./extraction-webhook.utils"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,+CAA6B;AAC7B,6DAA2C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyss-project/extract",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Core package to interact with AbyssExtract",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"lint": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --fix",
|
|
13
|
+
"lint:check": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --max-warnings 0",
|
|
14
|
+
"tsc": "tsc",
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"prepublishOnly": "tsc && node ../../scripts/check-sdk-surface.cjs",
|
|
17
|
+
"dev": "tsc --watch"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://gitlab.com/abyss-group/abyss-tools/abyss-tools"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [],
|
|
24
|
+
"author": "scylla",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=19.8"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"axios": "^1.6.0",
|
|
31
|
+
"axios-retry": "^4.5.0",
|
|
32
|
+
"date-fns": "^2.30.0",
|
|
33
|
+
"dayjs": "^1.10.7",
|
|
34
|
+
"jsonwebtoken": "^8.5.1",
|
|
35
|
+
"reflect-metadata": "^0.1.13",
|
|
36
|
+
"ts-node": "^10.4.0",
|
|
37
|
+
"ts-node-dev": "^1.1.1",
|
|
38
|
+
"uuid": "^8.3.2"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/express-serve-static-core": "^4.19.6",
|
|
42
|
+
"@types/jsonwebtoken": "^8.5.0",
|
|
43
|
+
"@types/node": "^20.11.0",
|
|
44
|
+
"@types/uuid": "^8.3.0",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "8.71.0",
|
|
46
|
+
"@typescript-eslint/parser": "8.71.0",
|
|
47
|
+
"eslint": "^8.57.1",
|
|
48
|
+
"eslint-config-airbnb-base": "^14.2.1",
|
|
49
|
+
"eslint-config-prettier": "^8.3.0",
|
|
50
|
+
"eslint-config-standard": "^16.0.3",
|
|
51
|
+
"eslint-plugin-filenames-simple": "^0.7.0",
|
|
52
|
+
"eslint-plugin-import": "^2.23.4",
|
|
53
|
+
"eslint-plugin-node": "^11.1.0",
|
|
54
|
+
"eslint-plugin-prettier": "^3.4.0",
|
|
55
|
+
"eslint-plugin-promise": "^5.1.0",
|
|
56
|
+
"prettier": "2.3.1",
|
|
57
|
+
"tsc-watch": "^4.6.2",
|
|
58
|
+
"typescript": "5.9.3"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Type-level compile test for the extraction-plan-preset api surface.
|
|
2
|
+
// No jest runner in this SDK package; compile guard only.
|
|
3
|
+
// Run: npx tsc --noEmit (from packages/abyss_extract_core).
|
|
4
|
+
|
|
5
|
+
import * as api from './extraction-plan-preset.api';
|
|
6
|
+
|
|
7
|
+
// All seven functions must be exported.
|
|
8
|
+
const _listModes: typeof api.listModes = api.listModes;
|
|
9
|
+
const _listPresets: typeof api.listExtractionPlanPresets = api.listExtractionPlanPresets;
|
|
10
|
+
const _getPreset: typeof api.getExtractionPlanPreset = api.getExtractionPlanPreset;
|
|
11
|
+
const _createPreset: typeof api.createExtractionPlanPreset = api.createExtractionPlanPreset;
|
|
12
|
+
const _updatePreset: typeof api.updateExtractionPlanPreset = api.updateExtractionPlanPreset;
|
|
13
|
+
const _deletePreset: typeof api.deleteExtractionPlanPreset = api.deleteExtractionPlanPreset;
|
|
14
|
+
const _setDefault: typeof api.setDefaultExtractionPlanPreset = api.setDefaultExtractionPlanPreset;
|
|
15
|
+
|
|
16
|
+
void _listModes;
|
|
17
|
+
void _listPresets;
|
|
18
|
+
void _getPreset;
|
|
19
|
+
void _createPreset;
|
|
20
|
+
void _updatePreset;
|
|
21
|
+
void _deletePreset;
|
|
22
|
+
void _setDefault;
|
|
23
|
+
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// ──────────────────────────────────────────────
|
|
2
|
+
// Extraction Plan Preset API (V2-P1).
|
|
3
|
+
//
|
|
4
|
+
// GET /extract/modes — list registered providers + interpreters.
|
|
5
|
+
// GET /extract/plans — list plan presets (system + scoped).
|
|
6
|
+
// GET /extract/plans/:id — get a single preset.
|
|
7
|
+
// POST /extract/plans — create a preset.
|
|
8
|
+
// PUT /extract/plans/:id — update a preset.
|
|
9
|
+
// DELETE /extract/plans/:id — delete a preset.
|
|
10
|
+
// POST /extract/plans/:id/default — set as scope default.
|
|
11
|
+
// ──────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
import { AbyssExtractCore } from '..';
|
|
14
|
+
import type { ICreatePlanPresetBody, IUpdatePlanPresetBody, IListPlanPresetQuery } from '../types';
|
|
15
|
+
import type {
|
|
16
|
+
IListModesResponse,
|
|
17
|
+
IListPlanPresetsResponse,
|
|
18
|
+
IGetPlanPresetResponse,
|
|
19
|
+
IDeletePlanPresetResponse,
|
|
20
|
+
} from '../types';
|
|
21
|
+
|
|
22
|
+
const DEFAULT_API_KEY_HEADER = 'abyss-api-key';
|
|
23
|
+
|
|
24
|
+
function authHeader(apiKey?: string): Record<string, string> {
|
|
25
|
+
return apiKey ? { [DEFAULT_API_KEY_HEADER]: apiKey } : {};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const listModes = async (apiKey?: string): Promise<IListModesResponse> =>
|
|
29
|
+
(
|
|
30
|
+
await AbyssExtractCore.axios.get<IListModesResponse>(`extract/modes`, {
|
|
31
|
+
headers: authHeader(apiKey),
|
|
32
|
+
})
|
|
33
|
+
).data;
|
|
34
|
+
|
|
35
|
+
export const listExtractionPlanPresets = async (
|
|
36
|
+
query: IListPlanPresetQuery = {},
|
|
37
|
+
apiKey?: string,
|
|
38
|
+
): Promise<IListPlanPresetsResponse> =>
|
|
39
|
+
(
|
|
40
|
+
await AbyssExtractCore.axios.get<IListPlanPresetsResponse>(`extract/plans`, {
|
|
41
|
+
params: query,
|
|
42
|
+
headers: authHeader(apiKey),
|
|
43
|
+
})
|
|
44
|
+
).data;
|
|
45
|
+
|
|
46
|
+
export const getExtractionPlanPreset = async (
|
|
47
|
+
id: string,
|
|
48
|
+
apiKey?: string,
|
|
49
|
+
): Promise<IGetPlanPresetResponse> =>
|
|
50
|
+
(
|
|
51
|
+
await AbyssExtractCore.axios.get<IGetPlanPresetResponse>(`extract/plans/${id}`, {
|
|
52
|
+
headers: authHeader(apiKey),
|
|
53
|
+
})
|
|
54
|
+
).data;
|
|
55
|
+
|
|
56
|
+
export const createExtractionPlanPreset = async (
|
|
57
|
+
body: ICreatePlanPresetBody,
|
|
58
|
+
apiKey?: string,
|
|
59
|
+
): Promise<IGetPlanPresetResponse> =>
|
|
60
|
+
(
|
|
61
|
+
await AbyssExtractCore.axios.post<IGetPlanPresetResponse>(`extract/plans`, body, {
|
|
62
|
+
headers: authHeader(apiKey),
|
|
63
|
+
})
|
|
64
|
+
).data;
|
|
65
|
+
|
|
66
|
+
export const updateExtractionPlanPreset = async (
|
|
67
|
+
id: string,
|
|
68
|
+
body: IUpdatePlanPresetBody,
|
|
69
|
+
apiKey?: string,
|
|
70
|
+
): Promise<IGetPlanPresetResponse> =>
|
|
71
|
+
(
|
|
72
|
+
await AbyssExtractCore.axios.put<IGetPlanPresetResponse>(`extract/plans/${id}`, body, {
|
|
73
|
+
headers: authHeader(apiKey),
|
|
74
|
+
})
|
|
75
|
+
).data;
|
|
76
|
+
|
|
77
|
+
export const deleteExtractionPlanPreset = async (
|
|
78
|
+
id: string,
|
|
79
|
+
apiKey?: string,
|
|
80
|
+
): Promise<IDeletePlanPresetResponse> =>
|
|
81
|
+
(
|
|
82
|
+
await AbyssExtractCore.axios.delete<IDeletePlanPresetResponse>(`extract/plans/${id}`, {
|
|
83
|
+
headers: authHeader(apiKey),
|
|
84
|
+
})
|
|
85
|
+
).data;
|
|
86
|
+
|
|
87
|
+
export const setDefaultExtractionPlanPreset = async (
|
|
88
|
+
id: string,
|
|
89
|
+
apiKey?: string,
|
|
90
|
+
): Promise<IGetPlanPresetResponse> =>
|
|
91
|
+
(
|
|
92
|
+
await AbyssExtractCore.axios.post<IGetPlanPresetResponse>(
|
|
93
|
+
`extract/plans/${id}/default`,
|
|
94
|
+
{},
|
|
95
|
+
{ headers: authHeader(apiKey) },
|
|
96
|
+
)
|
|
97
|
+
).data;
|