22
33import { APIResource } from '../resource' ;
44import * as Core from '../core' ;
5+ import { GetDocumentInfoListCursor , type GetDocumentInfoListCursorParams } from '../pagination' ;
56
67export class Documents extends APIResource {
78 /**
@@ -60,8 +61,12 @@ export class Documents extends APIResource {
6061 getInfoList (
6162 body : DocumentGetInfoListParams ,
6263 options ?: Core . RequestOptions ,
63- ) : Core . APIPromise < DocumentGetInfoListResponse > {
64- return this . _client . post ( '/documents/get-document-info-list' , { body, ...options } ) ;
64+ ) : Core . PagePromise < DocumentGetInfoListResponsesGetDocumentInfoListCursor , DocumentGetInfoListResponse > {
65+ return this . _client . getAPIList (
66+ '/documents/get-document-info-list' ,
67+ DocumentGetInfoListResponsesGetDocumentInfoListCursor ,
68+ { body, method : 'post' , ...options } ,
69+ ) ;
6570 }
6671
6772 /**
@@ -79,6 +84,8 @@ export class Documents extends APIResource {
7984 }
8085}
8186
87+ export class DocumentGetInfoListResponsesGetDocumentInfoListCursor extends GetDocumentInfoListCursor < DocumentGetInfoListResponse > { }
88+
8289export interface DocumentDeleteResponse {
8390 /**
8491 * This string will always be "Success!". This may change in the future.
@@ -124,28 +131,22 @@ export namespace DocumentGetInfoResponse {
124131}
125132
126133export interface DocumentGetInfoListResponse {
127- documents : Array < DocumentGetInfoListResponse . Document > ;
128- }
134+ id : string ;
129135
130- export namespace DocumentGetInfoListResponse {
131- export interface Document {
132- id : string ;
133-
134- collection_name : string ;
136+ collection_name : string ;
135137
136- index_status : 'parsing_failed' | 'not_parsed' | 'not_indexed' | 'indexing' | 'indexed' ;
138+ index_status : 'parsing_failed' | 'not_parsed' | 'not_indexed' | 'indexing' | 'indexed' ;
137139
138- metadata : Record < string , string | Array < string > > ;
140+ metadata : Record < string , string | Array < string > > ;
139141
140- /**
141- * The number of pages in this document. This will be `null` if the document is
142- * parsing or failed to parse. It can also be `null` if the document is a filetype
143- * that does not support pages.
144- */
145- num_pages : number | null ;
142+ /**
143+ * The number of pages in this document. This will be `null` if the document is
144+ * parsing or failed to parse. It can also be `null` if the document is a filetype
145+ * that does not support pages.
146+ */
147+ num_pages : number | null ;
146148
147- path : string ;
148- }
149+ path : string ;
149150}
150151
151152export interface DocumentGetPageInfoResponse {
@@ -309,23 +310,11 @@ export interface DocumentGetInfoParams {
309310 include_content ?: boolean ;
310311}
311312
312- export interface DocumentGetInfoListParams {
313+ export interface DocumentGetInfoListParams extends GetDocumentInfoListCursorParams {
313314 /**
314315 * The name of the collection.
315316 */
316317 collection_name : string ;
317-
318- /**
319- * All documents returned will have a UUID strictly greater than the provided UUID.
320- * (Comparison will be on the binary representations of the UUIDs)
321- */
322- id_gt ?: string | null ;
323-
324- /**
325- * The maximum number of documents to return. This field is by default 1024, and
326- * cannot be set larger than 1024
327- */
328- limit ?: number ;
329318}
330319
331320export interface DocumentGetPageInfoParams {
@@ -367,13 +356,17 @@ export interface DocumentGetPageInfoParams {
367356 include_image ?: boolean ;
368357}
369358
359+ Documents . DocumentGetInfoListResponsesGetDocumentInfoListCursor =
360+ DocumentGetInfoListResponsesGetDocumentInfoListCursor ;
361+
370362export declare namespace Documents {
371363 export {
372364 type DocumentDeleteResponse as DocumentDeleteResponse ,
373365 type DocumentAddResponse as DocumentAddResponse ,
374366 type DocumentGetInfoResponse as DocumentGetInfoResponse ,
375367 type DocumentGetInfoListResponse as DocumentGetInfoListResponse ,
376368 type DocumentGetPageInfoResponse as DocumentGetPageInfoResponse ,
369+ DocumentGetInfoListResponsesGetDocumentInfoListCursor as DocumentGetInfoListResponsesGetDocumentInfoListCursor ,
377370 type DocumentDeleteParams as DocumentDeleteParams ,
378371 type DocumentAddParams as DocumentAddParams ,
379372 type DocumentGetInfoParams as DocumentGetInfoParams ,
0 commit comments