import { Client } from '../client.mjs'; import { Models } from '../models.mjs'; import { VectorsDBIndexType } from '../enums/vectors-db-index-type.mjs'; import { OrderBy } from '../enums/order-by.mjs'; import 'undici'; import '../query.mjs'; import '../enums/database-type.mjs'; import '../enums/attribute-status.mjs'; import '../enums/column-status.mjs'; import '../enums/index-status.mjs'; import '../enums/deployment-status.mjs'; import '../enums/execution-resource-type.mjs'; import '../enums/execution-trigger.mjs'; import '../enums/execution-status.mjs'; import '../enums/project-auth-method-id.mjs'; import '../enums/project-service-id.mjs'; import '../enums/project-protocol-id.mjs'; import '../enums/o-auth-2-google-prompt.mjs'; import '../enums/o-auth-2-oidc-prompt.mjs'; import '../enums/platform-type.mjs'; import '../enums/proxy-rule-deployment-resource-type.mjs'; import '../enums/proxy-rule-status.mjs'; import '../enums/message-status.mjs'; import '../enums/billing-plan-group.mjs'; declare class VectorsDB { client: Client; constructor(client: Client); /** * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. * * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} */ list(params?: { queries?: string[]; total?: boolean; }): Promise; /** * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ list(queries?: string[], total?: boolean): Promise; /** * Create a new Database. * * * @param {string} params.databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @param {string} params.specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise} */ create(params: { databaseId: string; name: string; enabled?: boolean; specification?: string; replicas?: number; syncMode?: string; }): Promise; /** * Create a new Database. * * * @param {string} databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @param {string} specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise; /** * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization. * * @throws {AppwriteException} * @returns {Promise} */ listSpecifications(): Promise; /** * List transactions across all databases. * * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). * @throws {AppwriteException} * @returns {Promise} */ listTransactions(params?: { queries?: string[]; }): Promise; /** * List transactions across all databases. * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listTransactions(queries?: string[]): Promise; /** * Create a new transaction. * * @param {number} params.ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} */ createTransaction(params?: { ttl?: number; }): Promise; /** * Create a new transaction. * * @param {number} ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createTransaction(ttl?: number): Promise; /** * Get a transaction by its unique ID. * * @param {string} params.transactionId - Transaction ID. * @throws {AppwriteException} * @returns {Promise} */ getTransaction(params: { transactionId: string; }): Promise; /** * Get a transaction by its unique ID. * * @param {string} transactionId - Transaction ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getTransaction(transactionId: string): Promise; /** * Update a transaction, to either commit or roll back its operations. * * @param {string} params.transactionId - Transaction ID. * @param {boolean} params.commit - Commit transaction? * @param {boolean} params.rollback - Rollback transaction? * @throws {AppwriteException} * @returns {Promise} */ updateTransaction(params: { transactionId: string; commit?: boolean; rollback?: boolean; }): Promise; /** * Update a transaction, to either commit or roll back its operations. * * @param {string} transactionId - Transaction ID. * @param {boolean} commit - Commit transaction? * @param {boolean} rollback - Rollback transaction? * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise; /** * Delete a transaction by its unique ID. * * @param {string} params.transactionId - Transaction ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteTransaction(params: { transactionId: string; }): Promise<{}>; /** * Delete a transaction by its unique ID. * * @param {string} transactionId - Transaction ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteTransaction(transactionId: string): Promise<{}>; /** * Create multiple operations in a single transaction. * * @param {string} params.transactionId - Transaction ID. * @param {object[]} params.operations - Array of staged operations. * @throws {AppwriteException} * @returns {Promise} */ createOperations(params: { transactionId: string; operations?: object[]; }): Promise; /** * Create multiple operations in a single transaction. * * @param {string} transactionId - Transaction ID. * @param {object[]} operations - Array of staged operations. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createOperations(transactionId: string, operations?: object[]): Promise; /** * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ get(params: { databaseId: string; }): Promise; /** * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ get(databaseId: string): Promise; /** * Update a database by its unique ID. * * @param {string} params.databaseId - Database ID. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @param {string} params.specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise} */ update(params: { databaseId: string; name: string; enabled?: boolean; specification?: string; replicas?: number; syncMode?: string; }): Promise; /** * Update a database by its unique ID. * * @param {string} databaseId - Database ID. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @param {string} specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ update(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise; /** * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ delete(params: { databaseId: string; }): Promise<{}>; /** * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ delete(databaseId: string): Promise<{}>; /** * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. * * @param {string} params.databaseId - Database ID. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} */ listCollections(params: { databaseId: string; queries?: string[]; search?: string; total?: boolean; }): Promise; /** * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. * * @param {string} databaseId - Database ID. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity * @param {string} search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listCollections(databaseId: string, queries?: string[], search?: string, total?: boolean): Promise; /** * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Collection name. Max length: 128 chars. * @param {number} params.dimension - Embedding dimension. * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @throws {AppwriteException} * @returns {Promise} */ createCollection(params: { databaseId: string; collectionId: string; name: string; dimension: number; permissions?: string[]; documentSecurity?: boolean; enabled?: boolean; }): Promise; /** * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Collection name. Max length: 128 chars. * @param {number} dimension - Embedding dimension. * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createCollection(databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; /** * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @throws {AppwriteException} * @returns {Promise} */ getCollection(params: { databaseId: string; collectionId: string; }): Promise; /** * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getCollection(databaseId: string, collectionId: string): Promise; /** * Update a collection by its unique ID. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.name - Collection name. Max length: 128 chars. * @param {number} params.dimension - Embedding dimensions. * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @throws {AppwriteException} * @returns {Promise} */ updateCollection(params: { databaseId: string; collectionId: string; name: string; dimension?: number; permissions?: string[]; documentSecurity?: boolean; enabled?: boolean; }): Promise; /** * Update a collection by its unique ID. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} name - Collection name. Max length: 128 chars. * @param {number} dimension - Embedding dimensions. * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateCollection(databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; /** * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteCollection(params: { databaseId: string; collectionId: string; }): Promise<{}>; /** * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteCollection(databaseId: string, collectionId: string): Promise<{}>; /** * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long. * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} */ listDocuments(params: { databaseId: string; collectionId: string; queries?: string[]; transactionId?: string; total?: boolean; ttl?: number; }): Promise>; /** * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long. * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ listDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise>; /** * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. * @param {string} params.documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} params.data - Document data as JSON object. * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} */ createDocument(params: { databaseId: string; collectionId: string; documentId: string; data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit; permissions?: string[]; transactionId?: string; }): Promise; /** * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. * @param {string} documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} data - Document data as JSON object. * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createDocument(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string): Promise; /** * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. * @param {object[]} params.documents - Array of documents data as JSON objects. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise>} */ createDocuments(params: { databaseId: string; collectionId: string; documents: object[]; transactionId?: string; }): Promise>; /** * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. * @param {object[]} documents - Array of documents data as JSON objects. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ createDocuments(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise>; /** * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {object[]} params.documents - Array of document data as JSON objects. May contain partial documents. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise>} */ upsertDocuments(params: { databaseId: string; collectionId: string; documents: object[]; transactionId?: string; }): Promise>; /** * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {object[]} documents - Array of document data as JSON objects. May contain partial documents. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ upsertDocuments(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise>; /** * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {object} params.data - Document data as JSON object. Include only attribute and value pairs to be updated. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise>} */ updateDocuments(params: { databaseId: string; collectionId: string; data?: object; queries?: string[]; transactionId?: string; }): Promise>; /** * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {object} data - Document data as JSON object. Include only attribute and value pairs to be updated. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ updateDocuments(databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string): Promise>; /** * Bulk delete documents using queries, if no queries are passed then all documents are deleted. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise>} */ deleteDocuments(params: { databaseId: string; collectionId: string; queries?: string[]; transactionId?: string; }): Promise>; /** * Bulk delete documents using queries, if no queries are passed then all documents are deleted. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string): Promise>; /** * Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long. * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} */ createQuery(params: { databaseId: string; collectionId: string; queries?: string[]; transactionId?: string; total?: boolean; ttl?: number; }): Promise>; /** * Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 524288 characters long. * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ createQuery(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise>; /** * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.documentId - Document ID. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. * @throws {AppwriteException} * @returns {Promise} */ getDocument(params: { databaseId: string; collectionId: string; documentId: string; queries?: string[]; transactionId?: string; }): Promise; /** * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} documentId - Document ID. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise; /** * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.documentId - Document ID. * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include all required fields of the document to be created or updated. * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} */ upsertDocument(params: { databaseId: string; collectionId: string; documentId: string; data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>; permissions?: string[]; transactionId?: string; }): Promise; /** * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} documentId - Document ID. * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include all required fields of the document to be created or updated. * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ upsertDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; /** * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.documentId - Document ID. * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include only fields and value pairs to be updated. * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} */ updateDocument(params: { databaseId: string; collectionId: string; documentId: string; data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>; permissions?: string[]; transactionId?: string; }): Promise; /** * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} documentId - Document ID. * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include only fields and value pairs to be updated. * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; /** * Delete a document by its unique ID. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.documentId - Document ID. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteDocument(params: { databaseId: string; collectionId: string; documentId: string; transactionId?: string; }): Promise<{}>; /** * Delete a document by its unique ID. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} documentId - Document ID. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>; /** * List indexes in the collection. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} */ listIndexes(params: { databaseId: string; collectionId: string; queries?: string[]; total?: boolean; }): Promise; /** * List indexes in the collection. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listIndexes(databaseId: string, collectionId: string, queries?: string[], total?: boolean): Promise; /** * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. * Attributes can be `key`, `fulltext`, and `unique`. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Index Key. * @param {VectorsDBIndexType} params.type - Index type. * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} params.lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} */ createIndex(params: { databaseId: string; collectionId: string; key: string; type: VectorsDBIndexType; attributes: string[]; orders?: OrderBy[]; lengths?: number[]; }): Promise; /** * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. * Attributes can be `key`, `fulltext`, and `unique`. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Index Key. * @param {VectorsDBIndexType} type - Index type. * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createIndex(databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise; /** * Get index by ID. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Index Key. * @throws {AppwriteException} * @returns {Promise} */ getIndex(params: { databaseId: string; collectionId: string; key: string; }): Promise; /** * Get index by ID. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Index Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getIndex(databaseId: string, collectionId: string, key: string): Promise; /** * Delete an index. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Index Key. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteIndex(params: { databaseId: string; collectionId: string; key: string; }): Promise<{}>; /** * Delete an index. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Index Key. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} params.databaseId - Database ID. * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise} */ createFailover(params: { databaseId: string; targetReplicaId?: string; }): Promise; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} databaseId - Database ID. * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createFailover(databaseId: string, targetReplicaId?: string): Promise; /** * List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database. * * @param {string} params.databaseId - Database ID. * @param {string} params.status - Filter by operation status. * @param {number} params.limit - Maximum number of operations to return. * @param {number} params.offset - Number of operations to skip. * @throws {AppwriteException} * @returns {Promise} */ listOperations(params: { databaseId: string; status?: string; limit?: number; offset?: number; }): Promise; /** * List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database. * * @param {string} databaseId - Database ID. * @param {string} status - Filter by operation status. * @param {number} limit - Maximum number of operations to return. * @param {number} offset - Number of operations to skip. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listOperations(databaseId: string, status?: string, limit?: number, offset?: number): Promise; /** * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ getReplicas(params: { databaseId: string; }): Promise; /** * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getReplicas(databaseId: string): Promise; /** * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ getStatus(params: { databaseId: string; }): Promise; /** * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getStatus(databaseId: string): Promise; } export { VectorsDB };