1
1
import ExtractionGraph from "./ExtractionGraph" ;
2
2
3
+ interface IBase {
4
+ id : string ;
5
+ namespace : string ;
6
+ }
7
+
8
+ interface IMetadata extends IBase {
9
+ name : string ;
10
+ labels : Record < string , string > ;
11
+ created_at : number ;
12
+ }
13
+
3
14
export interface INamespace {
4
15
name : string ;
5
16
extraction_graphs : ExtractionGraph [ ] ;
@@ -11,21 +22,19 @@ export interface IEmbeddingSchema {
11
22
}
12
23
13
24
export interface IExtractorSchema {
14
- outputs : { [ key : string ] : IEmbeddingSchema | { [ key : string ] : any } } ;
25
+ outputs : Record < string , IEmbeddingSchema | Record < string , any > > ;
15
26
}
16
27
17
28
export interface IExtractor {
18
29
name : string ;
19
30
input_mime_types : string [ ] ;
20
31
description : string ;
21
- input_params : { [ key : string ] : any } ;
32
+ input_params : Record < string , any > ;
22
33
outputs : IExtractorSchema ;
23
34
}
24
35
25
- export interface ISchema {
26
- id : string ;
36
+ export interface ISchema extends IBase {
27
37
extraction_graph_name : string ;
28
- namespace : string ;
29
38
columns : Record <
30
39
string ,
31
40
{
@@ -34,21 +43,17 @@ export interface ISchema {
34
43
}
35
44
> ;
36
45
}
46
+
37
47
export interface IIndex {
38
48
name : string ;
39
49
schema : Record < string , string | number | boolean > ;
40
50
}
41
51
42
- export interface IBaseContentMetadata {
43
- id : string ;
52
+ export interface IBaseContentMetadata extends IMetadata {
44
53
parent_id : string ;
45
54
ingested_content_id : string ;
46
- namespace : string ;
47
- name : string ;
48
55
mime_type : string ;
49
- labels : Record < string , string > ;
50
56
storage_url : string ;
51
- created_at : number ;
52
57
source : string ;
53
58
size : number ;
54
59
hash : string ;
@@ -59,10 +64,9 @@ export interface IContentMetadata extends IBaseContentMetadata {
59
64
content_url : string ;
60
65
}
61
66
62
- export interface IExtractedMetadata {
63
- id : string ;
67
+ export interface IExtractedMetadata extends IBase {
64
68
content_id : string ;
65
- metadata : { [ key : string ] : any } ;
69
+ metadata : Record < string , any > ;
66
70
extractor_name : string ;
67
71
}
68
72
@@ -76,16 +80,11 @@ export interface IExtractionPolicy {
76
80
graph_name ?: string ;
77
81
}
78
82
79
- export interface ITaskContentMetadata {
80
- id : string ;
83
+ export interface ITaskContentMetadata extends IMetadata {
81
84
parent_id : string ;
82
85
root_content_id : string ;
83
- namespace : string ;
84
- name : string ;
85
86
content_type : string ;
86
- labels : Record < string , string > ;
87
87
storage_url : string ;
88
- created_at : number ;
89
88
source : string ;
90
89
size_bytes : number ;
91
90
tombstoned : boolean ;
@@ -99,14 +98,12 @@ export enum TaskStatus {
99
98
Success = 2 ,
100
99
}
101
100
102
- export interface ITask {
103
- id : string ;
101
+ export interface ITask extends IBase {
104
102
extractor : string ;
105
103
extraction_policy_id : string ;
106
104
output_index_table_mapping : Record < string , string > ;
107
- namespace : string ;
108
105
content_metadata : ITaskContentMetadata ;
109
- input_params : { [ key : string ] : any } ;
106
+ input_params : Record < string , any > ;
110
107
outcome : TaskStatus ;
111
108
index_tables : string [ ] ;
112
109
}
@@ -120,7 +117,7 @@ export interface IDocument {
120
117
export interface IFeature {
121
118
feature_type : "embedding" | "metadata" | "unknown" ;
122
119
name : string ;
123
- data : { [ key : string ] : any } ;
120
+ data : Record < string , any > ;
124
121
}
125
122
126
123
export interface IContent {
@@ -130,17 +127,15 @@ export interface IContent {
130
127
labels ?: Record < string , string > ;
131
128
}
132
129
133
- export interface IContentResp {
134
- content_type : string ;
130
+ export interface IContentResp extends Omit < IContent , 'bytes' > {
135
131
bytes : number [ ] ;
136
- features ?: IFeature [ ] ;
137
- labels ?: Record < string , string > ;
138
132
}
139
133
140
134
export interface IExtractResponse {
141
135
features : IFeature [ ] ;
142
136
content : IContentResp [ ] ;
143
137
}
138
+
144
139
export interface ISearchIndexResponse {
145
140
content_id : string ;
146
141
text : string ;
@@ -160,11 +155,9 @@ export interface IMtlsConfig {
160
155
caPath ?: string ; // Optional, only if using a custom CA
161
156
}
162
157
163
- export interface StateChange {
164
- id : number ;
165
- object_id : string ;
158
+ export interface StateChange extends IBase {
166
159
change_type : string ;
167
160
created_at : number ;
168
161
processed_at : number ;
169
162
refcnt_object_id : string | null ;
170
- }
163
+ }
0 commit comments