@rjromeoent/ein-supabase 0.2.1 → 0.2.2
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/document-intake.d.ts +120 -2
- package/dist/document-intake.js +0 -1
- package/package.json +1 -1
|
@@ -3,7 +3,6 @@ export declare const DOCUMENT_INTAKE_EDGE_FUNCTIONS: {
|
|
|
3
3
|
readonly createBatch: "document-intake-create-batch";
|
|
4
4
|
readonly registerFiles: "document-intake-register-files";
|
|
5
5
|
readonly processFile: "document-intake-process-file";
|
|
6
|
-
readonly processFileWorker: "document-intake-process-file-worker";
|
|
7
6
|
readonly processingReaper: "document-intake-processing-reaper";
|
|
8
7
|
readonly getBatch: "document-intake-get-batch";
|
|
9
8
|
readonly listBatches: "document-intake-list-batches";
|
|
@@ -14,6 +13,8 @@ export declare const DOCUMENT_INTAKE_EDGE_FUNCTIONS: {
|
|
|
14
13
|
export type DocumentIntakeEndpointKey = keyof typeof DOCUMENT_INTAKE_EDGE_FUNCTIONS;
|
|
15
14
|
export type DocumentIntakeEdgeFunctionName = (typeof DOCUMENT_INTAKE_EDGE_FUNCTIONS)[DocumentIntakeEndpointKey];
|
|
16
15
|
export type DocumentIntakeDomainKey = "availability" | string;
|
|
16
|
+
export type DocumentIntakeProcessorOutputMode = "inline" | "summary_only" | "storage_artifact";
|
|
17
|
+
export type DocumentIntakeProcessorResultStatus = "completed" | "failed" | "partial";
|
|
17
18
|
export type DocumentIntakeBatchStatus = "draft" | "uploading" | "uploaded" | "processing" | "extracting" | "ready_for_review" | "submitting" | "submitted" | "normalizing" | "completed" | "completed_with_exceptions" | "failed" | "canceled";
|
|
18
19
|
export type DocumentIntakeFileStatus = "pending_upload" | "uploaded" | "queued" | "processing" | "extracting" | "parsed" | "ready_for_review" | "failed" | "ignored" | "canceled";
|
|
19
20
|
export type DocumentIntakeProcessingStatus = "queued" | "running" | "succeeded" | "failed" | "canceled";
|
|
@@ -21,7 +22,7 @@ export type DocumentIntakeReviewStatus = "needs_review" | "accepted" | "rejected
|
|
|
21
22
|
export type DocumentFindingSeverity = "info" | "warning" | "error";
|
|
22
23
|
export type DocumentFindingSource = "parser" | "validator" | "ai" | "reconciliation" | "system";
|
|
23
24
|
export type DocumentFindingScope = "batch" | "file" | "chunk" | "record" | "record_group" | "entity" | "evidence";
|
|
24
|
-
export type DocumentFindingAction = "resolve" | "dismiss" | "reopen" | "request_ai_verification" | "apply_reconciliation_operation" | "edit_record" | "map_entity" | "create_entity";
|
|
25
|
+
export type DocumentFindingAction = "resolve" | "dismiss" | "reopen" | "request_ai_verification" | "apply_reconciliation_operation" | "edit_record" | "map_entity" | "request_entity_review" | "create_entity";
|
|
25
26
|
export type DocumentFindingStatus = "open" | "resolved" | "dismissed" | "superseded";
|
|
26
27
|
export type DocumentFindingStatusUpdate = Extract<DocumentFindingStatus, "open" | "resolved" | "dismissed">;
|
|
27
28
|
export type DocumentFindingActionStatus = "applied" | "queued" | "rejected" | "failed";
|
|
@@ -34,6 +35,116 @@ export interface DocumentIntakeErrorResponse {
|
|
|
34
35
|
error: string;
|
|
35
36
|
details?: unknown;
|
|
36
37
|
}
|
|
38
|
+
export interface DocumentIntakeProcessorSourceDto extends JsonRecord {
|
|
39
|
+
signed_url?: string | null;
|
|
40
|
+
data_base64?: string | null;
|
|
41
|
+
file_name?: string | null;
|
|
42
|
+
mime_type?: string | null;
|
|
43
|
+
byte_size?: number | null;
|
|
44
|
+
}
|
|
45
|
+
export interface DocumentIntakeProcessorRouteDto extends JsonRecord {
|
|
46
|
+
domain_key?: DocumentIntakeDomainKey;
|
|
47
|
+
document_family?: string | null;
|
|
48
|
+
layout_hint?: string | null;
|
|
49
|
+
layout_variant?: string | null;
|
|
50
|
+
processor_key: string;
|
|
51
|
+
processor_version: string;
|
|
52
|
+
source_kind?: string | null;
|
|
53
|
+
source_extension?: string | null;
|
|
54
|
+
source_mime_type?: string | null;
|
|
55
|
+
strategy?: string | null;
|
|
56
|
+
include_rects?: boolean | null;
|
|
57
|
+
route_source?: string | null;
|
|
58
|
+
evidence?: string[];
|
|
59
|
+
}
|
|
60
|
+
export interface DocumentIntakeProcessorOptionsDto extends JsonRecord {
|
|
61
|
+
output_mode?: DocumentIntakeProcessorOutputMode;
|
|
62
|
+
allow_ai_fallback?: boolean;
|
|
63
|
+
max_pages?: number;
|
|
64
|
+
max_rows?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface DocumentIntakeProcessorResultSinkDto extends JsonRecord {
|
|
67
|
+
provider: "supabase_storage" | string;
|
|
68
|
+
bucket: string;
|
|
69
|
+
path: string;
|
|
70
|
+
}
|
|
71
|
+
export interface DocumentIntakeProcessorRequestDto<TDefaultContext extends JsonRecord = JsonRecord> extends JsonRecord {
|
|
72
|
+
version: "document_intake_process_request_v1" | string;
|
|
73
|
+
organization_id: string;
|
|
74
|
+
domain_key: DocumentIntakeDomainKey;
|
|
75
|
+
source_system?: string | null;
|
|
76
|
+
batch_id: string;
|
|
77
|
+
file_id: string;
|
|
78
|
+
processing_job_id: string;
|
|
79
|
+
processing_chunk_id?: string | null;
|
|
80
|
+
source: DocumentIntakeProcessorSourceDto;
|
|
81
|
+
default_context?: TDefaultContext;
|
|
82
|
+
routing: DocumentIntakeProcessorRouteDto;
|
|
83
|
+
options?: DocumentIntakeProcessorOptionsDto;
|
|
84
|
+
result_sink?: DocumentIntakeProcessorResultSinkDto | null;
|
|
85
|
+
}
|
|
86
|
+
export interface DocumentIntakeProcessorResultArtifactDto extends JsonRecord {
|
|
87
|
+
version?: "document_intake_process_result_artifact_ref_v1" | string;
|
|
88
|
+
kind?: "document_intake_process_result" | string;
|
|
89
|
+
provider: "supabase_storage" | string;
|
|
90
|
+
storage_bucket: string;
|
|
91
|
+
storage_path: string;
|
|
92
|
+
content_type?: string | null;
|
|
93
|
+
logical_content_type?: string | null;
|
|
94
|
+
content_encoding?: "gzip" | string | null;
|
|
95
|
+
byte_size?: number | null;
|
|
96
|
+
uncompressed_byte_size?: number | null;
|
|
97
|
+
candidate_count?: number | null;
|
|
98
|
+
finding_count?: number | null;
|
|
99
|
+
}
|
|
100
|
+
export interface DocumentIntakeProcessorTimingStageDto extends JsonRecord {
|
|
101
|
+
name: string;
|
|
102
|
+
elapsed_ms: number;
|
|
103
|
+
}
|
|
104
|
+
export interface DocumentIntakeProcessorTimingDto extends JsonRecord {
|
|
105
|
+
total_ms: number;
|
|
106
|
+
stages: DocumentIntakeProcessorTimingStageDto[];
|
|
107
|
+
}
|
|
108
|
+
export interface DocumentIntakeProcessorSummaryDto extends JsonRecord {
|
|
109
|
+
candidate_count: number;
|
|
110
|
+
inline_candidate_count?: number;
|
|
111
|
+
finding_count: number;
|
|
112
|
+
inline_finding_count?: number;
|
|
113
|
+
processor_key?: string | null;
|
|
114
|
+
processor_version?: string | null;
|
|
115
|
+
output_mode?: DocumentIntakeProcessorOutputMode | string;
|
|
116
|
+
diagnostics?: JsonRecord | null;
|
|
117
|
+
result_artifact?: DocumentIntakeProcessorResultArtifactDto | null;
|
|
118
|
+
}
|
|
119
|
+
export interface DocumentIntakeProcessorResultDto<TCandidate extends JsonRecord = JsonRecord, TFinding extends JsonRecord = JsonRecord> extends JsonRecord {
|
|
120
|
+
version: "document_intake_process_result_v1" | string;
|
|
121
|
+
status: DocumentIntakeProcessorResultStatus | string;
|
|
122
|
+
error_code?: string | null;
|
|
123
|
+
error_message?: string | null;
|
|
124
|
+
domain_key: DocumentIntakeDomainKey;
|
|
125
|
+
batch_id: string;
|
|
126
|
+
file_id: string;
|
|
127
|
+
processing_job_id: string;
|
|
128
|
+
processing_chunk_id?: string | null;
|
|
129
|
+
candidates: TCandidate[];
|
|
130
|
+
findings: TFinding[];
|
|
131
|
+
reconciliation_operations?: JsonRecord[];
|
|
132
|
+
evidence_artifacts?: JsonRecord[];
|
|
133
|
+
entity_resolutions?: JsonRecord[];
|
|
134
|
+
tool_runs?: JsonRecord[];
|
|
135
|
+
ai_invocations?: AiModelInvocationSummaryDto[];
|
|
136
|
+
result_artifacts?: DocumentIntakeProcessorResultArtifactDto[];
|
|
137
|
+
timing?: DocumentIntakeProcessorTimingDto;
|
|
138
|
+
summary: DocumentIntakeProcessorSummaryDto;
|
|
139
|
+
}
|
|
140
|
+
export interface DocumentIntakeProcessorResultArtifactPayloadDto<TCandidate extends JsonRecord = JsonRecord, TFinding extends JsonRecord = JsonRecord> extends JsonRecord {
|
|
141
|
+
version?: "document_intake_process_result_artifact_v1" | string;
|
|
142
|
+
artifact_version?: "document_intake_process_result_artifact_v1" | string;
|
|
143
|
+
created_at?: string;
|
|
144
|
+
generated_at?: string;
|
|
145
|
+
request?: JsonRecord;
|
|
146
|
+
result: DocumentIntakeProcessorResultDto<TCandidate, TFinding>;
|
|
147
|
+
}
|
|
37
148
|
export interface DocumentIntakeBatchDto<TDefaultContext extends JsonRecord = JsonRecord, TMetadata extends JsonRecord = JsonRecord> {
|
|
38
149
|
id: string;
|
|
39
150
|
organization_id: string;
|
|
@@ -399,6 +510,7 @@ export interface DocumentIntakeProcessFileRequest {
|
|
|
399
510
|
}
|
|
400
511
|
export interface DocumentIntakeProcessFileResponse {
|
|
401
512
|
fileId: string;
|
|
513
|
+
domainKey?: DocumentIntakeDomainKey;
|
|
402
514
|
parsedRows: number;
|
|
403
515
|
processingJobId?: string;
|
|
404
516
|
queuedRows?: number;
|
|
@@ -407,6 +519,12 @@ export interface DocumentIntakeProcessFileResponse {
|
|
|
407
519
|
pageCount?: number;
|
|
408
520
|
asyncWorkerFunction?: DocumentIntakeEdgeFunctionName | string;
|
|
409
521
|
documentProcessorFallbackUsed?: boolean;
|
|
522
|
+
parserFindings?: number;
|
|
523
|
+
cloudRunProcessor?: {
|
|
524
|
+
route: DocumentIntakeProcessorRouteDto;
|
|
525
|
+
resultArtifact?: DocumentIntakeProcessorResultArtifactDto | null;
|
|
526
|
+
summary?: DocumentIntakeProcessorSummaryDto | null;
|
|
527
|
+
};
|
|
410
528
|
counts?: JsonRecord;
|
|
411
529
|
error?: string;
|
|
412
530
|
[key: string]: unknown;
|
package/dist/document-intake.js
CHANGED
|
@@ -2,7 +2,6 @@ export const DOCUMENT_INTAKE_EDGE_FUNCTIONS = {
|
|
|
2
2
|
createBatch: "document-intake-create-batch",
|
|
3
3
|
registerFiles: "document-intake-register-files",
|
|
4
4
|
processFile: "document-intake-process-file",
|
|
5
|
-
processFileWorker: "document-intake-process-file-worker",
|
|
6
5
|
processingReaper: "document-intake-processing-reaper",
|
|
7
6
|
getBatch: "document-intake-get-batch",
|
|
8
7
|
listBatches: "document-intake-list-batches",
|