import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as Supermemory from "../../../index.js"; export declare namespace DocumentsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class DocumentsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: DocumentsClient.Options); /** * Permanently remove documents and their derived knowledge by document ID or caller-defined ID. Each requested ID is handled independently so successful deletions are preserved when another ID fails. * * @param {string} namespace - The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents. * @param {Supermemory.DeleteDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Supermemory.BadRequestError} * @throws {@link Supermemory.UnauthorizedError} * @throws {@link Supermemory.ForbiddenError} * @throws {@link Supermemory.InternalServerError} * @throws {@link errors.SupermemoryError} * @throws {@link errors.SupermemoryTimeoutError} * * @example * await client.documents.delete("user_alex", { * ids: ["my-doc-123"] * }) */ delete(namespace: string, request: Supermemory.DeleteDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Build a knowledge base efficiently by ingesting up to 600 text or URL documents at once. Existing caller-defined IDs append new information using the same semantics as single-document ingestion. * * @param {string} namespace - The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents. * @param {Supermemory.BatchAddDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Supermemory.BadRequestError} * @throws {@link Supermemory.UnauthorizedError} * @throws {@link Supermemory.PaymentRequiredError} * @throws {@link Supermemory.ForbiddenError} * @throws {@link Supermemory.InternalServerError} * @throws {@link errors.SupermemoryError} * @throws {@link errors.SupermemoryTimeoutError} * * @example * await client.documents.batchAdd("user_alex", { * documents: [{ * content: "Supermemory turns unstructured content into evolving memory." * }] * }) */ batchAdd(namespace: string, request: Supermemory.BatchAddDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions): core.HttpResponsePromise; private __batchAdd; /** * Retrieve a document's canonical content, metadata, and processing state by document ID or caller-defined ID. Optionally include its source chunks, derived memories, or both in the same response. * * @param {string} namespace - The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents. * @param {string} id - The public document ID * @param {Supermemory.GetDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Supermemory.BadRequestError} * @throws {@link Supermemory.UnauthorizedError} * @throws {@link Supermemory.ForbiddenError} * @throws {@link Supermemory.NotFoundError} * @throws {@link Supermemory.InternalServerError} * @throws {@link errors.SupermemoryError} * @throws {@link errors.SupermemoryTimeoutError} * * @example * await client.documents.get("user_alex", "my-doc-123") */ get(namespace: string, id: string, request?: Supermemory.GetDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions): core.HttpResponsePromise; private __get; /** * Refresh an existing document without changing its stable ID. Supplied content replaces the canonical content and is reprocessed; omitted fields remain unchanged. * * @param {string} namespace - The isolated namespace. This can be an ID for your user, a project ID, or any other identifier you wish to use to scope documents. * @param {string} id - The public document ID * @param {Supermemory.UpdateDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Supermemory.BadRequestError} * @throws {@link Supermemory.UnauthorizedError} * @throws {@link Supermemory.PaymentRequiredError} * @throws {@link Supermemory.ForbiddenError} * @throws {@link Supermemory.NotFoundError} * @throws {@link Supermemory.ConflictError} * @throws {@link Supermemory.InternalServerError} * @throws {@link errors.SupermemoryError} * @throws {@link errors.SupermemoryTimeoutError} * * @example * await client.documents.update("user_alex", "my-doc-123") */ update(namespace: string, id: string, request?: Supermemory.UpdateDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions): core.HttpResponsePromise; private __update; /** * Transform an uploaded file into searchable knowledge and learned memory. The response returns as soon as ingestion is safely queued while extraction and memory formation continue asynchronously. * * @param {string} namespace * @param {Supermemory.UploadFileDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Supermemory.BadRequestError} * @throws {@link Supermemory.UnauthorizedError} * @throws {@link Supermemory.PaymentRequiredError} * @throws {@link Supermemory.ForbiddenError} * @throws {@link Supermemory.ConflictError} * @throws {@link Supermemory.InternalServerError} * @throws {@link errors.SupermemoryError} * @throws {@link errors.SupermemoryTimeoutError} * * @example * import { createReadStream } from "fs"; * await client.documents.uploadFile("user_alex", { * file: fs.createReadStream("/path/to/your/file") * }) */ uploadFile(namespace: string, request: Supermemory.UploadFileDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions): core.HttpResponsePromise; private __uploadFile; /** * Replace an existing document with a new file while keeping its stable document ID. Content and caller metadata are overwritten, then the document is reprocessed asynchronously. * * @param {string} namespace * @param {string} id * @param {Supermemory.ReplaceWithFileDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Supermemory.BadRequestError} * @throws {@link Supermemory.UnauthorizedError} * @throws {@link Supermemory.PaymentRequiredError} * @throws {@link Supermemory.ForbiddenError} * @throws {@link Supermemory.NotFoundError} * @throws {@link Supermemory.ConflictError} * @throws {@link Supermemory.InternalServerError} * @throws {@link errors.SupermemoryError} * @throws {@link errors.SupermemoryTimeoutError} * * @example * import { createReadStream } from "fs"; * await client.documents.replaceWithFile("user_alex", "my-doc-123", { * file: fs.createReadStream("/path/to/your/file") * }) */ replaceWithFile(namespace: string, id: string, request: Supermemory.ReplaceWithFileDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions): core.HttpResponsePromise; private __replaceWithFile; /** * Refresh only the file-backed fields you provide. Supplying a file replaces the canonical content; omitted metadata and processing context remain unchanged. * * @param {string} namespace * @param {string} id * @param {Supermemory.UpdateFileDocumentsRequest} request * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Supermemory.BadRequestError} * @throws {@link Supermemory.UnauthorizedError} * @throws {@link Supermemory.PaymentRequiredError} * @throws {@link Supermemory.ForbiddenError} * @throws {@link Supermemory.NotFoundError} * @throws {@link Supermemory.ConflictError} * @throws {@link Supermemory.InternalServerError} * @throws {@link errors.SupermemoryError} * @throws {@link errors.SupermemoryTimeoutError} * * @example * import { createReadStream } from "fs"; * await client.documents.updateFile("user_alex", "my-doc-123", {}) */ updateFile(namespace: string, id: string, request: Supermemory.UpdateFileDocumentsRequest, requestOptions?: DocumentsClient.RequestOptions): core.HttpResponsePromise; private __updateFile; } //# sourceMappingURL=Client.d.ts.map