diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d6926d..7225d3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 20.1.0 + +* Deprecate `createVerification` method in `Account` service +* Add `createEmailVerification` method in `Account` service + ## 17.2.0 * Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md new file mode 100644 index 0000000..e2aaf80 --- /dev/null +++ b/docs/examples/account/create-email-verification.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createEmailVerification({ + url: 'https://example.com' +}); diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md new file mode 100644 index 0000000..eb6507e --- /dev/null +++ b/docs/examples/account/update-email-verification.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateEmailVerification({ + userId: '', + secret: '' +}); diff --git a/package.json b/package.json index cb1300a..5e6c400 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "20.0.0", + "version": "20.1.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 5b856de..210d5fc 100644 --- a/src/client.ts +++ b/src/client.ts @@ -33,7 +33,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/20.0.0'; + let ua = 'AppwriteNodeJSSDK/20.1.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -82,7 +82,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '20.0.0', + 'x-sdk-version': '20.1.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.8.0', }; diff --git a/src/services/account.ts b/src/services/account.ts index 979d905..4636d4e 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -2448,6 +2448,68 @@ export class Account { * @throws {AppwriteException} * @returns {Promise} */ + createEmailVerification(params: { url: string }): Promise; + /** + * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. + * + * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + * + * + * @param {string} url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createEmailVerification(url: string): Promise; + createEmailVerification( + paramsOrFirst: { url: string } | string + ): Promise { + let params: { url: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { url: string }; + } else { + params = { + url: paramsOrFirst as string + }; + } + + const url = params.url; + + if (typeof url === 'undefined') { + throw new AppwriteException('Missing required parameter: "url"'); + } + + const apiPath = '/account/verifications/email'; + const payload: Payload = {}; + if (typeof url !== 'undefined') { + payload['url'] = url; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. + * + * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + * + * + * @param {string} params.url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createEmailVerification` instead. + */ createVerification(params: { url: string }): Promise; /** * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. @@ -2480,7 +2542,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "url"'); } - const apiPath = '/account/verification'; + const apiPath = '/account/verifications/email'; const payload: Payload = {}; if (typeof url !== 'undefined') { payload['url'] = url; @@ -2507,6 +2569,73 @@ export class Account { * @throws {AppwriteException} * @returns {Promise} */ + updateEmailVerification(params: { userId: string, secret: string }): Promise; + /** + * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. + * + * @param {string} userId - User ID. + * @param {string} secret - Valid verification token. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateEmailVerification(userId: string, secret: string): Promise; + updateEmailVerification( + paramsOrFirst: { userId: string, secret: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { userId: string, secret: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { userId: string, secret: string }; + } else { + params = { + userId: paramsOrFirst as string, + secret: rest[0] as string + }; + } + + const userId = params.userId; + const secret = params.secret; + + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (typeof secret === 'undefined') { + throw new AppwriteException('Missing required parameter: "secret"'); + } + + const apiPath = '/account/verifications/email'; + const payload: Payload = {}; + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. + * + * @param {string} params.userId - User ID. + * @param {string} params.secret - Valid verification token. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateEmailVerification` instead. + */ updateVerification(params: { userId: string, secret: string }): Promise; /** * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. @@ -2543,7 +2672,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/account/verification'; + const apiPath = '/account/verifications/email'; const payload: Payload = {}; if (typeof userId !== 'undefined') { payload['userId'] = userId; @@ -2573,7 +2702,7 @@ export class Account { */ createPhoneVerification(): Promise { - const apiPath = '/account/verification/phone'; + const apiPath = '/account/verifications/phone'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2633,7 +2762,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/account/verification/phone'; + const apiPath = '/account/verifications/phone'; const payload: Payload = {}; if (typeof userId !== 'undefined') { payload['userId'] = userId; diff --git a/src/services/functions.ts b/src/services/functions.ts index 6c0239d..d379d26 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -878,7 +878,7 @@ export class Functions { /** * Create a deployment based on a template. * - * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. + * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details. * * @param {string} params.functionId - Function ID. * @param {string} params.repository - Repository name of the template. @@ -893,7 +893,7 @@ export class Functions { /** * Create a deployment based on a template. * - * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. + * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details. * * @param {string} functionId - Function ID. * @param {string} repository - Repository name of the template. diff --git a/src/services/sites.ts b/src/services/sites.ts index e8c0aed..3236d1a 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -877,7 +877,7 @@ export class Sites { /** * Create a deployment based on a template. * - * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. + * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details. * * @param {string} params.siteId - Site ID. * @param {string} params.repository - Repository name of the template. @@ -892,7 +892,7 @@ export class Sites { /** * Create a deployment based on a template. * - * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. + * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details. * * @param {string} siteId - Site ID. * @param {string} repository - Repository name of the template. diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index a01149f..b0db3a2 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -386,7 +386,7 @@ export class TablesDB { } /** - * Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - 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. @@ -399,7 +399,7 @@ export class TablesDB { */ createTable(params: { databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }): Promise; /** - * Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * @param {string} databaseId - Database ID. * @param {string} tableId - 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. @@ -760,7 +760,7 @@ export class TablesDB { * * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {boolean} params.xdefault - Default value for column when not provided. Cannot be set when column is required. @@ -774,7 +774,7 @@ export class TablesDB { * * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {boolean} xdefault - Default value for column when not provided. Cannot be set when column is required. @@ -855,7 +855,7 @@ export class TablesDB { * Update a boolean column. Changing the `default` value will not update already existing rows. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {boolean} params.xdefault - Default value for column when not provided. Cannot be set when column is required. @@ -868,7 +868,7 @@ export class TablesDB { * Update a boolean column. Changing the `default` value will not update already existing rows. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {boolean} xdefault - Default value for column when not provided. Cannot be set when column is required. @@ -2171,7 +2171,7 @@ export class TablesDB { * Create a geometric line column. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {any[]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. @@ -2183,7 +2183,7 @@ export class TablesDB { * Create a geometric line column. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {any[]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. @@ -2258,7 +2258,7 @@ export class TablesDB { * Update a line column. Changing the `default` value will not update already existing rows. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {any[]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. @@ -2271,7 +2271,7 @@ export class TablesDB { * Update a line column. Changing the `default` value will not update already existing rows. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {any[]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. @@ -2349,7 +2349,7 @@ export class TablesDB { * Create a geometric point column. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {any[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. @@ -2361,7 +2361,7 @@ export class TablesDB { * Create a geometric point column. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {any[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. @@ -2436,7 +2436,7 @@ export class TablesDB { * Update a point column. Changing the `default` value will not update already existing rows. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {any[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. @@ -2449,7 +2449,7 @@ export class TablesDB { * Update a point column. Changing the `default` value will not update already existing rows. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {any[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. @@ -2527,7 +2527,7 @@ export class TablesDB { * Create a geometric polygon column. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {any[]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. @@ -2539,7 +2539,7 @@ export class TablesDB { * Create a geometric polygon column. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {any[]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. @@ -2614,7 +2614,7 @@ export class TablesDB { * Update a polygon column. Changing the `default` value will not update already existing rows. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {any[]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. @@ -2627,7 +2627,7 @@ export class TablesDB { * Update a polygon column. Changing the `default` value will not update already existing rows. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {any[]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. @@ -2816,7 +2816,7 @@ export class TablesDB { * * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {number} params.size - Column size for text columns, in number of characters. * @param {boolean} params.required - Is column required? @@ -2832,7 +2832,7 @@ export class TablesDB { * * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {number} size - Column size for text columns, in number of characters. * @param {boolean} required - Is column required? @@ -2929,7 +2929,7 @@ export class TablesDB { * * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {string} params.xdefault - Default value for column when not provided. Cannot be set when column is required. @@ -2944,7 +2944,7 @@ export class TablesDB { * * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. @@ -3439,7 +3439,7 @@ export class TablesDB { * List indexes on the table. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @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: key, type, status, attributes, error * @throws {AppwriteException} * @returns {Promise} @@ -3449,7 +3449,7 @@ export class TablesDB { * List indexes on the table. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @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: key, type, status, attributes, error * @throws {AppwriteException} * @returns {Promise} @@ -3506,7 +3506,7 @@ export class TablesDB { * Type can be `key`, `fulltext`, or `unique`. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Index Key. * @param {IndexType} params.type - Index type. * @param {string[]} params.columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. @@ -3521,7 +3521,7 @@ export class TablesDB { * Type can be `key`, `fulltext`, or `unique`. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Index Key. * @param {IndexType} type - Index type. * @param {string[]} columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. @@ -3611,7 +3611,7 @@ export class TablesDB { * Get index by ID. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Index Key. * @throws {AppwriteException} * @returns {Promise} @@ -3621,7 +3621,7 @@ export class TablesDB { * Get index by ID. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Index Key. * @throws {AppwriteException} * @returns {Promise} @@ -3677,7 +3677,7 @@ export class TablesDB { * Delete an index. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Index Key. * @throws {AppwriteException} * @returns {Promise<{}>} @@ -3687,7 +3687,7 @@ export class TablesDB { * Delete an index. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Index Key. * @throws {AppwriteException} * @returns {Promise<{}>} @@ -3744,7 +3744,7 @@ export class TablesDB { * Get a list of all the user's rows in a given table. You can use the query params to filter your results. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). * @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. * @throws {AppwriteException} * @returns {Promise>} @@ -3754,7 +3754,7 @@ export class TablesDB { * Get a list of all the user's rows in a given table. You can use the query params to filter your results. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate). + * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). * @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. * @throws {AppwriteException} * @returns {Promise>} @@ -3807,10 +3807,10 @@ export class TablesDB { } /** - * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows. * @param {string} params.rowId - Row 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 {Row extends Models.DefaultRow ? Partial & Record : Partial & Omit} params.data - Row 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). @@ -3819,10 +3819,10 @@ export class TablesDB { */ createRow(params: { databaseId: string, tableId: string, rowId: string, data: Row extends Models.DefaultRow ? Partial & Record : Partial & Omit, permissions?: string[] }): Promise; /** - * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows. * @param {string} rowId - Row 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 {Row extends Models.DefaultRow ? Partial & Record : Partial & Omit} data - Row 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). @@ -3894,20 +3894,20 @@ export class TablesDB { } /** - * Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows. * @param {object[]} params.rows - Array of rows data as JSON objects. * @throws {AppwriteException} * @returns {Promise>} */ createRows(params: { databaseId: string, tableId: string, rows: object[] }): Promise>; /** - * Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows. * @param {object[]} rows - Array of rows data as JSON objects. * @throws {AppwriteException} * @returns {Promise>} @@ -3964,7 +3964,7 @@ export class TablesDB { } /** - * Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * * @param {string} params.databaseId - Database ID. @@ -3975,7 +3975,7 @@ export class TablesDB { */ upsertRows(params: { databaseId: string, tableId: string, rows: object[] }): Promise>; /** - * Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * * @param {string} databaseId - Database ID. @@ -4113,7 +4113,7 @@ export class TablesDB { * Bulk delete rows using queries, if no queries are passed then all rows are deleted. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @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. * @throws {AppwriteException} * @returns {Promise>} @@ -4123,7 +4123,7 @@ export class TablesDB { * Bulk delete rows using queries, if no queries are passed then all rows are deleted. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @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. * @throws {AppwriteException} * @returns {Promise>} @@ -4180,7 +4180,7 @@ export class TablesDB { * Get a row by its unique ID. This endpoint response returns a JSON object with the row data. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.rowId - Row 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. * @throws {AppwriteException} @@ -4191,7 +4191,7 @@ export class TablesDB { * Get a row by its unique ID. This endpoint response returns a JSON object with the row data. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} rowId - Row 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. * @throws {AppwriteException} @@ -4250,7 +4250,7 @@ export class TablesDB { } /** - * Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. @@ -4262,7 +4262,7 @@ export class TablesDB { */ upsertRow(params: { databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[] }): Promise; /** - * Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. @@ -4415,7 +4415,7 @@ export class TablesDB { * Delete a row by its unique ID. * * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.rowId - Row ID. * @throws {AppwriteException} * @returns {Promise<{}>} @@ -4425,7 +4425,7 @@ export class TablesDB { * Delete a row by its unique ID. * * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} rowId - Row ID. * @throws {AppwriteException} * @returns {Promise<{}>}