feat(fetch-requests): pdf/xlsx source types + trust_fallback create field
This commit is contained in:
@@ -7,7 +7,10 @@ export type FetchRequestStatus =
|
||||
| "completed"
|
||||
| "failed";
|
||||
|
||||
export type SourceType = "file" | "pdf" | "xlsx" | "email";
|
||||
|
||||
export interface FileSource {
|
||||
type?: SourceType;
|
||||
path: string;
|
||||
bank: string;
|
||||
raw_lines?: string[];
|
||||
@@ -17,7 +20,16 @@ export interface FileSource {
|
||||
txn_dicts_count?: number;
|
||||
}
|
||||
|
||||
export interface PdfSource extends FileSource {
|
||||
type: "pdf";
|
||||
}
|
||||
|
||||
export interface XlsxSource extends FileSource {
|
||||
type: "xlsx";
|
||||
}
|
||||
|
||||
export interface EmailSource {
|
||||
type: "email";
|
||||
bank: string;
|
||||
from_email?: string;
|
||||
subject?: string;
|
||||
@@ -28,10 +40,13 @@ export interface EmailSource {
|
||||
|
||||
export type PipelineType = "heuristic" | "llm" | "llama_parse";
|
||||
|
||||
export type TrustFallback = "amount" | "balance";
|
||||
|
||||
export interface FetchRequestCreate {
|
||||
source: FileSource | EmailSource;
|
||||
source: PdfSource | XlsxSource | FileSource | EmailSource;
|
||||
account_name: string;
|
||||
pipeline?: PipelineType;
|
||||
trust_fallback?: TrustFallback | null;
|
||||
payor_username?: string;
|
||||
start_date?: string;
|
||||
end_date?: string;
|
||||
@@ -113,7 +128,7 @@ export interface SSEEvent {
|
||||
export interface FetchRequestFilters {
|
||||
status?: FetchRequestStatus[];
|
||||
account_name?: string;
|
||||
source_type?: "file" | "email";
|
||||
source_type?: SourceType;
|
||||
}
|
||||
|
||||
export function formatApiError(err: any): string {
|
||||
|
||||
Reference in New Issue
Block a user