UNPKG

node-appwrite

Version:

Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API

912 lines (911 loc) 136 kB
import { Client } from '../client.mjs'; import { Models } from '../models.mjs'; import { RelationshipType } from '../enums/relationship-type.mjs'; import { RelationMutate } from '../enums/relation-mutate.mjs'; import { IndexType } from '../enums/index-type.mjs'; import { OrderBy } from '../enums/order-by.mjs'; 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-trigger.mjs'; import '../enums/execution-status.mjs'; import '../enums/health-antivirus-status.mjs'; import '../enums/health-check-status.mjs'; import '../enums/message-status.mjs'; declare class Databases { 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 attributes: name * @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<Models.DatabaseList>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.list` instead. */ list(params?: { queries?: string[]; search?: string; total?: boolean; }): Promise<Models.DatabaseList>; /** * 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 attributes: name * @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<Models.DatabaseList>} * @deprecated Use the object parameter style method for a better developer experience. */ list(queries?: string[], search?: string, total?: boolean): Promise<Models.DatabaseList>; /** * 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. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.create` instead. */ create(params: { databaseId: string; name: string; enabled?: boolean; }): Promise<Models.Database>; /** * 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. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. */ create(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database>; /** * 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<Models.TransactionList>} */ listTransactions(params?: { queries?: string[]; }): Promise<Models.TransactionList>; /** * 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<Models.TransactionList>} * @deprecated Use the object parameter style method for a better developer experience. */ listTransactions(queries?: string[]): Promise<Models.TransactionList>; /** * Create a new transaction. * * @param {number} params.ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise<Models.Transaction>} */ createTransaction(params?: { ttl?: number; }): Promise<Models.Transaction>; /** * Create a new transaction. * * @param {number} ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise<Models.Transaction>} * @deprecated Use the object parameter style method for a better developer experience. */ createTransaction(ttl?: number): Promise<Models.Transaction>; /** * Get a transaction by its unique ID. * * @param {string} params.transactionId - Transaction ID. * @throws {AppwriteException} * @returns {Promise<Models.Transaction>} */ getTransaction(params: { transactionId: string; }): Promise<Models.Transaction>; /** * Get a transaction by its unique ID. * * @param {string} transactionId - Transaction ID. * @throws {AppwriteException} * @returns {Promise<Models.Transaction>} * @deprecated Use the object parameter style method for a better developer experience. */ getTransaction(transactionId: string): Promise<Models.Transaction>; /** * 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<Models.Transaction>} */ updateTransaction(params: { transactionId: string; commit?: boolean; rollback?: boolean; }): Promise<Models.Transaction>; /** * 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<Models.Transaction>} * @deprecated Use the object parameter style method for a better developer experience. */ updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise<Models.Transaction>; /** * 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<Models.Transaction>} */ createOperations(params: { transactionId: string; operations?: object[]; }): Promise<Models.Transaction>; /** * Create multiple operations in a single transaction. * * @param {string} transactionId - Transaction ID. * @param {object[]} operations - Array of staged operations. * @throws {AppwriteException} * @returns {Promise<Models.Transaction>} * @deprecated Use the object parameter style method for a better developer experience. */ createOperations(transactionId: string, operations?: object[]): Promise<Models.Transaction>; /** * 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<Models.Database>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.get` instead. */ get(params: { databaseId: string; }): Promise<Models.Database>; /** * 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<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. */ get(databaseId: string): Promise<Models.Database>; /** * 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. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.update` instead. */ update(params: { databaseId: string; name?: string; enabled?: boolean; }): Promise<Models.Database>; /** * 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. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. */ update(databaseId: string, name?: string, enabled?: boolean): Promise<Models.Database>; /** * 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<{}>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.delete` instead. */ 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<Models.CollectionList>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listTables` instead. */ listCollections(params: { databaseId: string; queries?: string[]; search?: string; total?: boolean; }): Promise<Models.CollectionList>; /** * 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<Models.CollectionList>} * @deprecated Use the object parameter style method for a better developer experience. */ listCollections(databaseId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.CollectionList>; /** * 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#databasesCreateCollection) 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 {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. * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). * @throws {AppwriteException} * @returns {Promise<Models.Collection>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead. */ createCollection(params: { databaseId: string; collectionId: string; name: string; permissions?: string[]; documentSecurity?: boolean; enabled?: boolean; attributes?: object[]; indexes?: object[]; }): Promise<Models.Collection>; /** * 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#databasesCreateCollection) 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 {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. * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). * @throws {AppwriteException} * @returns {Promise<Models.Collection>} * @deprecated Use the object parameter style method for a better developer experience. */ createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[]): Promise<Models.Collection>; /** * 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<Models.Collection>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getTable` instead. */ getCollection(params: { databaseId: string; collectionId: string; }): Promise<Models.Collection>; /** * 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<Models.Collection>} * @deprecated Use the object parameter style method for a better developer experience. */ getCollection(databaseId: string, collectionId: string): Promise<Models.Collection>; /** * 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 {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<Models.Collection>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead. */ updateCollection(params: { databaseId: string; collectionId: string; name?: string; permissions?: string[]; documentSecurity?: boolean; enabled?: boolean; }): Promise<Models.Collection>; /** * 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 {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<Models.Collection>} * @deprecated Use the object parameter style method for a better developer experience. */ updateCollection(databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>; /** * 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<{}>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTable` instead. */ 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<{}>; /** * List attributes in the collection. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection 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: key, type, size, required, array, status, 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<Models.AttributeList>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listColumns` instead. */ listAttributes(params: { databaseId: string; collectionId: string; queries?: string[]; total?: boolean; }): Promise<Models.AttributeList>; /** * List attributes in the collection. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection 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: key, type, size, required, array, status, error * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AttributeList>} * @deprecated Use the object parameter style method for a better developer experience. */ listAttributes(databaseId: string, collectionId: string, queries?: string[], total?: boolean): Promise<Models.AttributeList>; /** * Create a boolean attribute. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {boolean} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeBoolean>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createBooleanColumn` instead. */ createBooleanAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; xdefault?: boolean; array?: boolean; }): Promise<Models.AttributeBoolean>; /** * Create a boolean attribute. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {boolean} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeBoolean>} * @deprecated Use the object parameter style method for a better developer experience. */ createBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean>; /** * Update a boolean attribute. Changing the `default` value will not update already existing documents. * * @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#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {boolean} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {string} params.newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBoolean>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateBooleanColumn` instead. */ updateBooleanAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; xdefault?: boolean; newKey?: string; }): Promise<Models.AttributeBoolean>; /** * Update a boolean attribute. Changing the `default` value will not update already existing documents. * * @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#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {boolean} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {string} newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBoolean>} * @deprecated Use the object parameter style method for a better developer experience. */ updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, newKey?: string): Promise<Models.AttributeBoolean>; /** * Create a date time attribute according to the ISO 8601 standard. * * @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#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeDatetime>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createDatetimeColumn` instead. */ createDatetimeAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; xdefault?: string; array?: boolean; }): Promise<Models.AttributeDatetime>; /** * Create a date time attribute according to the ISO 8601 standard. * * @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#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeDatetime>} * @deprecated Use the object parameter style method for a better developer experience. */ createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeDatetime>; /** * Update a date time attribute. Changing the `default` value will not update already existing documents. * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {string} params.newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeDatetime>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateDatetimeColumn` instead. */ updateDatetimeAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; xdefault?: string; newKey?: string; }): Promise<Models.AttributeDatetime>; /** * Update a date time attribute. Changing the `default` value will not update already existing documents. * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {string} newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeDatetime>} * @deprecated Use the object parameter style method for a better developer experience. */ updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeDatetime>; /** * Create an email attribute. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeEmail>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEmailColumn` instead. */ createEmailAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; xdefault?: string; array?: boolean; }): Promise<Models.AttributeEmail>; /** * Create an email attribute. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeEmail>} * @deprecated Use the object parameter style method for a better developer experience. */ createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail>; /** * Update an email attribute. Changing the `default` value will not update already existing documents. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEmail>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEmailColumn` instead. */ updateEmailAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; xdefault?: string; newKey?: string; }): Promise<Models.AttributeEmail>; /** * Update an email attribute. Changing the `default` value will not update already existing documents. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEmail>} * @deprecated Use the object parameter style method for a better developer experience. */ updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEmail>; /** * Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {string[]} params.elements - Array of enum values. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeEnum>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEnumColumn` instead. */ createEnumAttribute(params: { databaseId: string; collectionId: string; key: string; elements: string[]; required: boolean; xdefault?: string; array?: boolean; }): Promise<Models.AttributeEnum>; /** * Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {string[]} elements - Array of enum values. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeEnum>} * @deprecated Use the object parameter style method for a better developer experience. */ createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum>; /** * Update an enum attribute. Changing the `default` value will not update already existing documents. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {string[]} params.elements - Updated list of enum values. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEnum>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEnumColumn` instead. */ updateEnumAttribute(params: { databaseId: string; collectionId: string; key: string; elements: string[]; required: boolean; xdefault?: string; newKey?: string; }): Promise<Models.AttributeEnum>; /** * Update an enum attribute. Changing the `default` value will not update already existing documents. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {string[]} elements - Updated list of enum values. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEnum>} * @deprecated Use the object parameter style method for a better developer experience. */ updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEnum>; /** * Create a float attribute. Optionally, minimum and maximum values can be provided. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {number} params.min - Minimum value. * @param {number} params.max - Maximum value. * @param {number} params.xdefault - Default value. Cannot be set when required. * @param {boolean} params.array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeFloat>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead. */ createFloatAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; min?: number; max?: number; xdefault?: number; array?: boolean; }): Promise<Models.AttributeFloat>; /** * Create a float attribute. Optionally, minimum and maximum values can be provided. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {number} min - Minimum value. * @param {number} max - Maximum value. * @param {number} xdefault - Default value. Cannot be set when required. * @param {boolean} array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeFloat>} * @deprecated Use the object parameter style method for a better developer experience. */ createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat>; /** * Update a float attribute. Changing the `default` value will not update already existing documents. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {number} params.xdefault - Default value. Cannot be set when required. * @param {number} params.min - Minimum value. * @param {number} params.max - Maximum value. * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeFloat>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead. */ updateFloatAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; xdefault?: number; min?: number; max?: number; newKey?: string; }): Promise<Models.AttributeFloat>; /** * Update a float attribute. Changing the `default` value will not update already existing documents. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {number} xdefault - Default value. Cannot be set when required. * @param {number} min - Minimum value. * @param {number} max - Maximum value. * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeFloat>} * @deprecated Use the object parameter style method for a better developer experience. */ updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeFloat>; /** * Create an integer attribute. Optionally, minimum and maximum values can be provided. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {number | bigint} params.min - Minimum value * @param {number | bigint} params.max - Maximum value * @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeInteger>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead. */ createIntegerAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; min?: number | bigint; max?: number | bigint; xdefault?: number | bigint; array?: boolean; }): Promise<Models.AttributeInteger>; /** * Create an integer attribute. Optionally, minimum and maximum values can be provided. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {number | bigint} min - Minimum value * @param {number | bigint} max - Maximum value * @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise<Models.AttributeInteger>} * @deprecated Use the object parameter style method for a better developer experience. */ createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise<Models.AttributeInteger>; /** * Update an integer attribute. Changing the `default` value will not update already existing documents. * * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required. * @param {number | bigint} params.min - Minimum value * @param {number | bigint} params.max - Maximum value * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeInteger>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead. */ updateIntegerAttribute(params: { databaseId: string; collectionId: string; key: string; required: boolean; xdefault?: number | bigint; min?: number | bigint; max?: number | bigint; newKey?: string; }): Promise<Models.AttributeInteger>; /** * Update an integer attribute. Changing the `default` value will not update already existing documents. * * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required. * @param {number | bigint} min - Minimum value * @param {number | bigint} max - Maximum value * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise<Models.AttributeInteger>} * @deprecated Use the object parameter style method for a better developer experience. */ updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number |