@babav/knowledge-core-client 0.3.0 → 0.4.0
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/index.d.ts +10 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
- package/src/index.ts +6 -0
package/dist/index.d.ts
CHANGED
|
@@ -276,6 +276,11 @@ export declare class KnowledgeCoreClient extends HttpBase {
|
|
|
276
276
|
}) => Promise<Page<Document>>;
|
|
277
277
|
/** Count documents in the corpus: { total, indexed, in_flight, failed }. */
|
|
278
278
|
countDocuments: (id: UUID) => Promise<DocumentCount>;
|
|
279
|
+
/** Documents in the corpus whose filename contains `q` (case-insensitive), paginated. */
|
|
280
|
+
searchDocuments: (id: UUID, q: string, opts?: {
|
|
281
|
+
limit?: number;
|
|
282
|
+
cursor?: string;
|
|
283
|
+
}) => Promise<Page<Document>>;
|
|
279
284
|
/** Upload a file and ingest it ASYNCHRONOUSLY — resolves with the created
|
|
280
285
|
* document at status `pending` (HTTP 202); track via documents.get() polling
|
|
281
286
|
* the status to `indexed`/`failed`, or the tenant result webhook. */
|
|
@@ -305,6 +310,11 @@ export declare class KnowledgeCoreClient extends HttpBase {
|
|
|
305
310
|
}) => Promise<Page<Document>>;
|
|
306
311
|
/** Count documents in the folder: { total, indexed, in_flight, failed }. */
|
|
307
312
|
countDocuments: (folderId: UUID) => Promise<DocumentCount>;
|
|
313
|
+
/** Documents in the folder whose filename contains `q` (case-insensitive), paginated. */
|
|
314
|
+
searchDocuments: (folderId: UUID, q: string, opts?: {
|
|
315
|
+
limit?: number;
|
|
316
|
+
cursor?: string;
|
|
317
|
+
}) => Promise<Page<Document>>;
|
|
308
318
|
};
|
|
309
319
|
documents: {
|
|
310
320
|
get: (id: UUID) => Promise<Document>;
|
package/dist/index.js
CHANGED
|
@@ -166,6 +166,8 @@ export class KnowledgeCoreClient extends HttpBase {
|
|
|
166
166
|
listDocuments: (id, q) => this.request("GET", `/v1/corpora/${id}/documents`, { query: q }),
|
|
167
167
|
/** Count documents in the corpus: { total, indexed, in_flight, failed }. */
|
|
168
168
|
countDocuments: (id) => this.request("GET", `/v1/corpora/${id}/documents/count`),
|
|
169
|
+
/** Documents in the corpus whose filename contains `q` (case-insensitive), paginated. */
|
|
170
|
+
searchDocuments: (id, q, opts) => this.request("GET", `/v1/corpora/${id}/documents/search`, { query: { q, ...opts } }),
|
|
169
171
|
/** Upload a file and ingest it ASYNCHRONOUSLY — resolves with the created
|
|
170
172
|
* document at status `pending` (HTTP 202); track via documents.get() polling
|
|
171
173
|
* the status to `indexed`/`failed`, or the tenant result webhook. */
|
|
@@ -195,6 +197,8 @@ export class KnowledgeCoreClient extends HttpBase {
|
|
|
195
197
|
listDocuments: (folderId, q) => this.request("GET", `/v1/folders/${folderId}/documents`, { query: q }),
|
|
196
198
|
/** Count documents in the folder: { total, indexed, in_flight, failed }. */
|
|
197
199
|
countDocuments: (folderId) => this.request("GET", `/v1/folders/${folderId}/documents/count`),
|
|
200
|
+
/** Documents in the folder whose filename contains `q` (case-insensitive), paginated. */
|
|
201
|
+
searchDocuments: (folderId, q, opts) => this.request("GET", `/v1/folders/${folderId}/documents/search`, { query: { q, ...opts } }),
|
|
198
202
|
};
|
|
199
203
|
// --- documents ---
|
|
200
204
|
documents = {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -392,6 +392,9 @@ export class KnowledgeCoreClient extends HttpBase {
|
|
|
392
392
|
/** Count documents in the corpus: { total, indexed, in_flight, failed }. */
|
|
393
393
|
countDocuments: (id: UUID) =>
|
|
394
394
|
this.request<DocumentCount>("GET", `/v1/corpora/${id}/documents/count`),
|
|
395
|
+
/** Documents in the corpus whose filename contains `q` (case-insensitive), paginated. */
|
|
396
|
+
searchDocuments: (id: UUID, q: string, opts?: { limit?: number; cursor?: string }) =>
|
|
397
|
+
this.request<Page<Document>>("GET", `/v1/corpora/${id}/documents/search`, { query: { q, ...opts } }),
|
|
395
398
|
/** Upload a file and ingest it ASYNCHRONOUSLY — resolves with the created
|
|
396
399
|
* document at status `pending` (HTTP 202); track via documents.get() polling
|
|
397
400
|
* the status to `indexed`/`failed`, or the tenant result webhook. */
|
|
@@ -422,6 +425,9 @@ export class KnowledgeCoreClient extends HttpBase {
|
|
|
422
425
|
/** Count documents in the folder: { total, indexed, in_flight, failed }. */
|
|
423
426
|
countDocuments: (folderId: UUID) =>
|
|
424
427
|
this.request<DocumentCount>("GET", `/v1/folders/${folderId}/documents/count`),
|
|
428
|
+
/** Documents in the folder whose filename contains `q` (case-insensitive), paginated. */
|
|
429
|
+
searchDocuments: (folderId: UUID, q: string, opts?: { limit?: number; cursor?: string }) =>
|
|
430
|
+
this.request<Page<Document>>("GET", `/v1/folders/${folderId}/documents/search`, { query: { q, ...opts } }),
|
|
425
431
|
};
|
|
426
432
|
|
|
427
433
|
// --- documents ---
|