@babav/knowledge-core-client 0.23.0 → 0.23.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/index.d.ts CHANGED
@@ -533,6 +533,13 @@ export declare class KnowledgeCoreClient extends HttpBase {
533
533
  }) => Promise<Document>;
534
534
  contentUrl: (id: UUID, disposition?: "inline" | "attachment") => Promise<ContentUrl>;
535
535
  delete: (id: UUID) => Promise<void>;
536
+ /** Delete MANY documents (by id) from one corpus in ONE call (202) — collapses N deletes into
537
+ * one request. IDs not in the corpus are skipped. Completion observable via documents.events /
538
+ * documents.get() → 404. Returns { deleting: ids, count }. */
539
+ deleteMany: (corpusId: UUID, documentIds: UUID[]) => Promise<{
540
+ deleting: UUID[];
541
+ count: number;
542
+ }>;
536
543
  /** Live ingestion-status stream for a corpus (SSE PUSH — replaces polling count). Snapshot on
537
544
  * connect, then a delta per transition, then `complete` when nothing is in-flight. Abort via
538
545
  * the signal. 501 (onError) if the environment has no doc-status bus — fall back to polling. */
package/dist/index.js CHANGED
@@ -313,6 +313,10 @@ export class KnowledgeCoreClient extends HttpBase {
313
313
  update: (id, b) => this.request("PATCH", `/v1/documents/${id}`, { json: b }),
314
314
  contentUrl: (id, disposition = "inline") => this.request("GET", `/v1/documents/${id}/content-url`, { query: { disposition } }),
315
315
  delete: (id) => this.request("DELETE", `/v1/documents/${id}`),
316
+ /** Delete MANY documents (by id) from one corpus in ONE call (202) — collapses N deletes into
317
+ * one request. IDs not in the corpus are skipped. Completion observable via documents.events /
318
+ * documents.get() → 404. Returns { deleting: ids, count }. */
319
+ deleteMany: (corpusId, documentIds) => this.request("POST", `/v1/corpora/${corpusId}/documents/batch-delete`, { json: { document_ids: documentIds } }),
316
320
  /** Live ingestion-status stream for a corpus (SSE PUSH — replaces polling count). Snapshot on
317
321
  * connect, then a delta per transition, then `complete` when nothing is in-flight. Abort via
318
322
  * the signal. 501 (onError) if the environment has no doc-status bus — fall back to polling. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babav/knowledge-core-client",
3
- "version": "0.23.0",
3
+ "version": "0.23.2",
4
4
  "description": "TypeScript client for the Babav Knowledge Core API (Deno + Node 18+, zero deps). Includes the babav.visual grammar TYPES at the ./visual subpath (types only; all visual rendering is server-side).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -491,7 +491,7 @@ export interface DocumentStatusEvent {
491
491
  document_id: string;
492
492
  corpus_id?: string | null;
493
493
  folder_id?: string | null;
494
- status: string; // pending | ingesting | indexed | failed | deleting
494
+ status: string; // pending | ingesting | indexed | failed | deleting | deleted (terminal: row is gone)
495
495
  filename?: string | null;
496
496
  chunk_count?: number | null;
497
497
  error?: string | null;
@@ -709,6 +709,12 @@ export class KnowledgeCoreClient extends HttpBase {
709
709
  contentUrl: (id: UUID, disposition: "inline" | "attachment" = "inline") =>
710
710
  this.request<ContentUrl>("GET", `/v1/documents/${id}/content-url`, { query: { disposition } }),
711
711
  delete: (id: UUID) => this.request<void>("DELETE", `/v1/documents/${id}`),
712
+ /** Delete MANY documents (by id) from one corpus in ONE call (202) — collapses N deletes into
713
+ * one request. IDs not in the corpus are skipped. Completion observable via documents.events /
714
+ * documents.get() → 404. Returns { deleting: ids, count }. */
715
+ deleteMany: (corpusId: UUID, documentIds: UUID[]) =>
716
+ this.request<{ deleting: UUID[]; count: number }>(
717
+ "POST", `/v1/corpora/${corpusId}/documents/batch-delete`, { json: { document_ids: documentIds } }),
712
718
  /** Live ingestion-status stream for a corpus (SSE PUSH — replaces polling count). Snapshot on
713
719
  * connect, then a delta per transition, then `complete` when nothing is in-flight. Abort via
714
720
  * the signal. 501 (onError) if the environment has no doc-status bus — fall back to polling. */