This repository was archived by the owner on Mar 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +31
-7
lines changed
Expand file tree Collapse file tree 3 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " getindexify" ,
3- "version" : " 0.0.40 " ,
3+ "version" : " 0.0.41 " ,
44 "description" : " This is the TypeScript client for interacting with the Indexify service." ,
55 "main" : " ./dist/index.js" ,
66 "module" : " ./dist/index.mjs" ,
Original file line number Diff line number Diff line change @@ -21,9 +21,16 @@ export interface IExtractor {
2121}
2222
2323export interface ISchema {
24- columns : Record < string , string | number | boolean > ;
25- content_source : string ;
24+ id : string ;
25+ extraction_graph_name : string ;
2626 namespace : string ;
27+ columns : Record <
28+ string ,
29+ {
30+ column_type : string ;
31+ comment ?: string ;
32+ }
33+ > ;
2734}
2835export interface IIndex {
2936 name : string ;
@@ -91,11 +98,10 @@ export interface ITaskContentMetadata {
9198 extraction_policy_ids : Record < string , number > ;
9299}
93100
94-
95101export enum TaskStatus {
96102 Unknown = 0 ,
97103 Failure = 1 ,
98- Success = 2
104+ Success = 2 ,
99105}
100106
101107export interface ITask {
Original file line number Diff line number Diff line change @@ -205,8 +205,26 @@ test("getStructuredMetadata", async () => {
205205} ) ;
206206
207207test ( "getSchemas" , async ( ) => {
208- const client = await IndexifyClient . createClient ( ) ;
209- await client . getSchemas ( ) ;
208+ const nanoid = generateNanoId ( 8 ) ;
209+ const client = await IndexifyClient . createNamespace ( {
210+ name : `testgetcontent.${ nanoid } ` ,
211+ } ) ;
212+ const extractionGraphName = "schematestgraph" ;
213+ await setupExtractionGraph (
214+ client ,
215+ extractionGraphName ,
216+ "tensorlake/wikipedia"
217+ ) ;
218+
219+ // upload html
220+ await client . uploadFile ( extractionGraphName , `${ __dirname } /files/steph_curry.html` ) ;
221+ await new Promise ( ( r ) => setTimeout ( r , 10000 ) ) ;
222+
223+
224+ const schemas = await client . getSchemas ( ) ;
225+ expect ( schemas . length ) . toBe ( 1 ) ;
226+ expect ( schemas [ 0 ] . extraction_graph_name ) . toBe ( extractionGraphName )
227+ expect ( Object . keys ( schemas [ 0 ] . columns ) . length ) . toBe ( 13 )
210228} ) ;
211229
212230test ( "downloadContent" , async ( ) => {
You can’t perform that action at this time.
0 commit comments