From 9ae8c4fc5bc595a2a21c9fae18d612cfbd59fb91 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 May 2026 08:33:39 +0000 Subject: [PATCH 01/13] chore: update Command Line SDK to 20.2.0 --- CHANGELOG.md | 6 +++ README.md | 8 ++-- .../databases/create-big-int-attribute.md | 7 +++ .../databases/update-big-int-attribute.md | 8 ++++ docs/examples/functions/create-variable.md | 1 + docs/examples/functions/list-variables.md | 3 +- docs/examples/functions/update-variable.md | 3 +- docs/examples/project/create-ephemeral-key.md | 2 +- .../examples/project/get-o-auth-2-provider.md | 2 +- .../project/list-o-auth-2-providers.md | 3 +- docs/examples/proxy/update-rule-status.md | 4 ++ .../proxy/update-rule-verification.md | 4 -- docs/examples/sites/create-variable.md | 1 + docs/examples/sites/list-variables.md | 3 +- docs/examples/sites/update-variable.md | 3 +- .../tablesdb/create-big-int-column.md | 7 +++ .../tablesdb/update-big-int-column.md | 8 ++++ install.ps1 | 4 +- install.sh | 2 +- lib/commands/services/databases.ts | 45 +++++++++++++++++++ lib/commands/services/functions.ts | 25 ++++++++--- lib/commands/services/project.ts | 44 +++++++++++------- lib/commands/services/proxy.ts | 29 +++++++----- lib/commands/services/sites.ts | 25 ++++++++--- lib/commands/services/tables-db.ts | 45 +++++++++++++++++++ lib/constants.ts | 2 +- package-lock.json | 4 +- package.json | 2 +- scoop/appwrite.config.json | 6 +-- 29 files changed, 241 insertions(+), 65 deletions(-) create mode 100644 docs/examples/databases/create-big-int-attribute.md create mode 100644 docs/examples/databases/update-big-int-attribute.md create mode 100644 docs/examples/proxy/update-rule-status.md delete mode 100644 docs/examples/proxy/update-rule-verification.md create mode 100644 docs/examples/tablesdb/create-big-int-column.md create mode 100644 docs/examples/tablesdb/update-big-int-column.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 79a2a713..5c4e311f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 20.2.0 + +* Added: Introduced `bigint` create/update APIs for legacy Databases attributes +* Added: Introduced `bigint` create/update APIs for `TablesDB` columns +* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` + ## 20.1.0 * Added `--switch` and `--new` flags on `appwrite login` to explicitly manage multiple saved accounts diff --git a/README.md b/README.md index 500e4e61..b5e102ef 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Command Line SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-cli.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.9.3-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.4-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** +**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using ```sh $ appwrite -v -20.1.0 +20.2.0 ``` ### Install using prebuilt binaries @@ -83,7 +83,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc Once the installation completes, you can verify your install using ``` $ appwrite -v -20.1.0 +20.2.0 ``` ## Getting Started diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md new file mode 100644 index 00000000..4ac556d6 --- /dev/null +++ b/docs/examples/databases/create-big-int-attribute.md @@ -0,0 +1,7 @@ +```bash +appwrite databases create-big-int-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false +``` diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md new file mode 100644 index 00000000..fdb8fe60 --- /dev/null +++ b/docs/examples/databases/update-big-int-attribute.md @@ -0,0 +1,8 @@ +```bash +appwrite databases update-big-int-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default null +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 1b6fe426..57d8344f 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,6 +1,7 @@ ```bash appwrite functions create-variable \ --function-id \ + --variable-id \ --key \ --value ``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 5639a066..2f9db0e4 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,4 +1,5 @@ ```bash appwrite functions list-variables \ - --function-id + --function-id \ + --limit 25 ``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 7c7e7583..b8bd3dbf 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,6 +1,5 @@ ```bash appwrite functions update-variable \ --function-id \ - --variable-id \ - --key + --variable-id ``` diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md index d80508a3..d4ab3852 100644 --- a/docs/examples/project/create-ephemeral-key.md +++ b/docs/examples/project/create-ephemeral-key.md @@ -1,5 +1,5 @@ ```bash appwrite project create-ephemeral-key \ --scopes one two three \ - --duration 1 + --duration 600 ``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index ba47af11..1c54d95c 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -1,4 +1,4 @@ ```bash appwrite project get-o-auth-2-provider \ - --provider + --provider-id amazon ``` diff --git a/docs/examples/project/list-o-auth-2-providers.md b/docs/examples/project/list-o-auth-2-providers.md index df16be41..fe4d21d1 100644 --- a/docs/examples/project/list-o-auth-2-providers.md +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -1,3 +1,4 @@ ```bash -appwrite project list-o-auth-2-providers +appwrite project list-o-auth-2-providers \ + --limit 25 ``` diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md new file mode 100644 index 00000000..4c9b24e3 --- /dev/null +++ b/docs/examples/proxy/update-rule-status.md @@ -0,0 +1,4 @@ +```bash +appwrite proxy update-rule-status \ + --rule-id +``` diff --git a/docs/examples/proxy/update-rule-verification.md b/docs/examples/proxy/update-rule-verification.md deleted file mode 100644 index 3e5734d2..00000000 --- a/docs/examples/proxy/update-rule-verification.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite proxy update-rule-verification \ - --rule-id -``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 100ac21e..21d7c65c 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -1,6 +1,7 @@ ```bash appwrite sites create-variable \ --site-id \ + --variable-id \ --key \ --value ``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 67861820..49f6b833 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -1,4 +1,5 @@ ```bash appwrite sites list-variables \ - --site-id + --site-id \ + --limit 25 ``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 06fe2cd7..e8a2d4b7 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -1,6 +1,5 @@ ```bash appwrite sites update-variable \ --site-id \ - --variable-id \ - --key + --variable-id ``` diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md new file mode 100644 index 00000000..49167996 --- /dev/null +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,7 @@ +```bash +appwrite tables-db create-big-int-column \ + --database-id \ + --table-id \ + --key '' \ + --required false +``` diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md new file mode 100644 index 00000000..267ec29d --- /dev/null +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,8 @@ +```bash +appwrite tables-db update-big-int-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default null +``` diff --git a/install.ps1 b/install.ps1 index 25204a16..54ea2a90 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,8 @@ # You can use "View source" of this page to see the full script. # REPO -$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 49b9fbb4..6bd9885a 100644 --- a/install.sh +++ b/install.sh @@ -120,7 +120,7 @@ verifyMacOSCodeSignature() { downloadBinary() { echo "[2/5] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="20.1.0" + GITHUB_LATEST_VERSION="20.2.0" GITHUB_FILE="appwrite-cli-${OS}-${ARCH}" GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE" diff --git a/lib/commands/services/databases.ts b/lib/commands/services/databases.ts index a62f7afb..71f33abc 100644 --- a/lib/commands/services/databases.ts +++ b/lib/commands/services/databases.ts @@ -367,6 +367,51 @@ const databasesListAttributesCommand = databases ); +const databasesCreateBigIntAttributeCommand = databases + .command(`create-big-int-attribute`) + .description(`Create a bigint attribute. Optionally, minimum and maximum values can be provided. +`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--collection-id `, `Collection ID.`) + .requiredOption(`--key `, `Attribute Key.`) + .requiredOption(`--required `, `Is attribute required?`, parseBool) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--xdefault `, `Default value. Cannot be set when attribute is required.`, parseInteger) + .option( + `--array [value]`, + `Is attribute an array?`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .action( + actionRunner( + async ({ databaseId, collectionId, key, required, min, max, xdefault, array }) => + parse(await (await getDatabasesClient()).createBigIntAttribute(databaseId, collectionId, key, required, min, max, xdefault, array)), + ), + ); + + +const databasesUpdateBigIntAttributeCommand = databases + .command(`update-big-int-attribute`) + .description(`Update a bigint attribute. Changing the \`default\` value will not update already existing documents. +`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--collection-id `, `Collection ID.`) + .requiredOption(`--key `, `Attribute Key.`) + .requiredOption(`--required `, `Is attribute required?`, parseBool) + .requiredOption(`--xdefault `, `Default value. Cannot be set when attribute is required.`, parseInteger) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--new-key `, `New Attribute Key.`) + .action( + actionRunner( + async ({ databaseId, collectionId, key, required, xdefault, min, max, newKey }) => + parse(await (await getDatabasesClient()).updateBigIntAttribute(databaseId, collectionId, key, required, xdefault, min, max, newKey)), + ), + ); + + const databasesCreateBooleanAttributeCommand = databases .command(`create-boolean-attribute`) .description(`Create a boolean attribute. diff --git a/lib/commands/services/functions.ts b/lib/commands/services/functions.ts index db803b47..f5f2d2f4 100644 --- a/lib/commands/services/functions.ts +++ b/lib/commands/services/functions.ts @@ -513,10 +513,24 @@ const functionsListVariablesCommand = functions .command(`list-variables`) .description(`Get a list of all variables of a specific function.`) .requiredOption(`--function-id `, `Function unique ID.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, resourceType, resourceId, secret`) + .option( + `--total [value]`, + `When set to false, the total count returned will be 0 and will not be calculated.`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--limit `, `Maximum number of results to return.`, parseInteger) + .option(`--offset `, `Number of results to skip.`, parseInteger) + .option(`--cursor-after `, `Return results after this cursor ID.`) + .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ functionId }) => - parse(await (await getFunctionsClient()).listVariables(functionId)), + async ({ functionId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getFunctionsClient()).listVariables(functionId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -525,6 +539,7 @@ const functionsCreateVariableCommand = functions .command(`create-variable`) .description(`Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.`) .requiredOption(`--function-id `, `Function unique ID.`) + .requiredOption(`--variable-id `, `Variable 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.`) .requiredOption(`--key `, `Variable key. Max length: 255 chars.`) .requiredOption(`--value `, `Variable value. Max length: 8192 chars.`) .option( @@ -535,8 +550,8 @@ const functionsCreateVariableCommand = functions ) .action( actionRunner( - async ({ functionId, key, value, secret }) => - parse(await (await getFunctionsClient()).createVariable(functionId, key, value, secret)), + async ({ functionId, variableId, key, value, secret }) => + parse(await (await getFunctionsClient()).createVariable(functionId, variableId, key, value, secret)), ), ); @@ -559,7 +574,7 @@ const functionsUpdateVariableCommand = functions .description(`Update variable by its unique ID.`) .requiredOption(`--function-id `, `Function unique ID.`) .requiredOption(`--variable-id `, `Variable unique ID.`) - .requiredOption(`--key `, `Variable key. Max length: 255 chars.`) + .option(`--key `, `Variable key. Max length: 255 chars.`) .option(`--value `, `Variable value. Max length: 8192 chars.`) .option( `--secret [value]`, diff --git a/lib/commands/services/project.ts b/lib/commands/services/project.ts index b30e5580..3bf63d8d 100644 --- a/lib/commands/services/project.ts +++ b/lib/commands/services/project.ts @@ -271,9 +271,31 @@ const projectDeleteMockPhoneCommand = project const projectListOAuth2ProvidersCommand = project .command(`list-o-auth-2-providers`) .description(`Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common pagination prefer --limit and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries). Only supported methods are limit and offset`) + .option( + `--total [value]`, + `When set to false, the total count returned will be 0 and will not be calculated.`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .option(`--limit `, `Maximum number of results to return.`, parseInteger) + .option(`--offset `, `Number of results to skip.`, parseInteger) + .action( + actionRunner( + async ({ queries, total, limit, offset }) => + parse(await (await getProjectClient()).listOAuth2Providers(buildQueries({ queries, limit, offset }), total)), + ), + ); + + +const projectGetOAuth2ProviderCommand = project + .command(`get-o-auth-2-provider`) + .description(`Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty.`) + .requiredOption(`--provider-id `, `OAuth2 provider key. For example: github, google, apple.`) .action( actionRunner( - async () => parse(await (await getProjectClient()).listOAuth2Providers()), + async ({ providerId }) => + parse(await (await getProjectClient()).getOAuth2Provider(providerId)), ), ); @@ -1091,18 +1113,6 @@ const projectUpdateOAuth2ZoomCommand = project ); -const projectGetOAuth2ProviderCommand = project - .command(`get-o-auth-2-provider`) - .description(`Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty.`) - .requiredOption(`--provider `, `OAuth2 provider key. For example: github, google, apple.`) - .action( - actionRunner( - async ({ provider }) => - parse(await (await getProjectClient()).getOAuth2Provider(provider)), - ), - ); - - const projectListPlatformsCommand = project .command(`list-platforms`) .description(`Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations.`) @@ -1621,7 +1631,7 @@ const projectListVariablesCommand = project const projectCreateVariableCommand = project .command(`create-variable`) .description(`Create a new project environment variable. These variables can be accessed by all functions and sites in the project.`) - .requiredOption(`--variable-id `, `Variable 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.`) + .requiredOption(`--variable-id `, `Variable 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.`) .requiredOption(`--key `, `Variable key. Max length: 255 chars.`) .requiredOption(`--value `, `Variable value. Max length: 8192 chars.`) .option( @@ -1641,7 +1651,7 @@ const projectCreateVariableCommand = project const projectGetVariableCommand = project .command(`get-variable`) .description(`Get a variable by its unique ID. `) - .requiredOption(`--variable-id `, `Variable ID.`) + .requiredOption(`--variable-id `, `Variable unique ID.`) .action( actionRunner( async ({ variableId }) => @@ -1653,7 +1663,7 @@ const projectGetVariableCommand = project const projectUpdateVariableCommand = project .command(`update-variable`) .description(`Update variable by its unique ID.`) - .requiredOption(`--variable-id `, `Variable ID.`) + .requiredOption(`--variable-id `, `Variable unique ID.`) .option(`--key `, `Variable key. Max length: 255 chars.`) .option(`--value `, `Variable value. Max length: 8192 chars.`) .option( @@ -1673,7 +1683,7 @@ const projectUpdateVariableCommand = project const projectDeleteVariableCommand = project .command(`delete-variable`) .description(`Delete a variable by its unique ID. `) - .requiredOption(`--variable-id `, `Variable ID.`) + .requiredOption(`--variable-id `, `Variable unique ID.`) .action( actionRunner( async ({ variableId }) => diff --git a/lib/commands/services/proxy.ts b/lib/commands/services/proxy.ts index dc9542bb..1d5afe0a 100644 --- a/lib/commands/services/proxy.ts +++ b/lib/commands/services/proxy.ts @@ -35,7 +35,6 @@ const proxyListRulesCommand = proxy .command(`list-rules`) .description(`Get a list of all the proxy rules. You can use the query params to filter your results.`) .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch`) - .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, @@ -51,15 +50,17 @@ const proxyListRulesCommand = proxy .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ queries, search, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getProxyClient()).listRules(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), search, total)), + async ({ queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getProxyClient()).listRules(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); const proxyCreateAPIRuleCommand = proxy .command(`create-api-rule`) - .description(`Create a new proxy rule for serving Appwrite's API on custom domain.`) + .description(`Create a new proxy rule for serving Appwrite's API on custom domain. + +Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.`) .requiredOption(`--domain `, `Domain name.`) .action( actionRunner( @@ -71,7 +72,9 @@ const proxyCreateAPIRuleCommand = proxy const proxyCreateFunctionRuleCommand = proxy .command(`create-function-rule`) - .description(`Create a new proxy rule for executing Appwrite Function on custom domain.`) + .description(`Create a new proxy rule for executing Appwrite Function on custom domain. + +Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.`) .requiredOption(`--domain `, `Domain name.`) .requiredOption(`--function-id `, `ID of function to be executed.`) .option(`--branch `, `Name of VCS branch to deploy changes automatically`) @@ -85,7 +88,9 @@ const proxyCreateFunctionRuleCommand = proxy const proxyCreateRedirectRuleCommand = proxy .command(`create-redirect-rule`) - .description(`Create a new proxy rule for to redirect from custom domain to another domain.`) + .description(`Create a new proxy rule for to redirect from custom domain to another domain. + +Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.`) .requiredOption(`--domain `, `Domain name.`) .requiredOption(`--url `, `Target URL of redirection`) .requiredOption(`--status-code `, `Status code of redirection`) @@ -101,7 +106,9 @@ const proxyCreateRedirectRuleCommand = proxy const proxyCreateSiteRuleCommand = proxy .command(`create-site-rule`) - .description(`Create a new proxy rule for serving Appwrite Site on custom domain.`) + .description(`Create a new proxy rule for serving Appwrite Site on custom domain. + +Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes.`) .requiredOption(`--domain `, `Domain name.`) .requiredOption(`--site-id `, `ID of site to be executed.`) .option(`--branch `, `Name of VCS branch to deploy changes automatically`) @@ -137,14 +144,14 @@ const proxyDeleteRuleCommand = proxy ); -const proxyUpdateRuleVerificationCommand = proxy - .command(`update-rule-verification`) - .description(`Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.`) +const proxyUpdateRuleStatusCommand = proxy + .command(`update-rule-status`) + .description(`If not succeeded yet, retry verification process of a proxy rule domain. This endpoint triggers domain verification by checking DNS records. If verification is successful, a TLS certificate will be automatically provisioned for the domain asynchronously in the background.`) .requiredOption(`--rule-id `, `Rule ID.`) .action( actionRunner( async ({ ruleId }) => - parse(await (await getProxyClient()).updateRuleVerification(ruleId)), + parse(await (await getProxyClient()).updateRuleStatus(ruleId)), ), ); diff --git a/lib/commands/services/sites.ts b/lib/commands/services/sites.ts index 68bb68b8..a802767d 100644 --- a/lib/commands/services/sites.ts +++ b/lib/commands/services/sites.ts @@ -486,10 +486,24 @@ const sitesListVariablesCommand = sites .command(`list-variables`) .description(`Get a list of all variables of a specific site.`) .requiredOption(`--site-id `, `Site unique ID.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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, resourceType, resourceId, secret`) + .option( + `--total [value]`, + `When set to false, the total count returned will be 0 and will not be calculated.`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--limit `, `Maximum number of results to return.`, parseInteger) + .option(`--offset `, `Number of results to skip.`, parseInteger) + .option(`--cursor-after `, `Return results after this cursor ID.`) + .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ siteId }) => - parse(await (await getSitesClient()).listVariables(siteId)), + async ({ siteId, queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getSitesClient()).listVariables(siteId, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), ), ); @@ -498,6 +512,7 @@ const sitesCreateVariableCommand = sites .command(`create-variable`) .description(`Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.`) .requiredOption(`--site-id `, `Site unique ID.`) + .requiredOption(`--variable-id `, `Variable 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.`) .requiredOption(`--key `, `Variable key. Max length: 255 chars.`) .requiredOption(`--value `, `Variable value. Max length: 8192 chars.`) .option( @@ -508,8 +523,8 @@ const sitesCreateVariableCommand = sites ) .action( actionRunner( - async ({ siteId, key, value, secret }) => - parse(await (await getSitesClient()).createVariable(siteId, key, value, secret)), + async ({ siteId, variableId, key, value, secret }) => + parse(await (await getSitesClient()).createVariable(siteId, variableId, key, value, secret)), ), ); @@ -532,7 +547,7 @@ const sitesUpdateVariableCommand = sites .description(`Update variable by its unique ID.`) .requiredOption(`--site-id `, `Site unique ID.`) .requiredOption(`--variable-id `, `Variable unique ID.`) - .requiredOption(`--key `, `Variable key. Max length: 255 chars.`) + .option(`--key `, `Variable key. Max length: 255 chars.`) .option(`--value `, `Variable value. Max length: 8192 chars.`) .option( `--secret [value]`, diff --git a/lib/commands/services/tables-db.ts b/lib/commands/services/tables-db.ts index eae8e72a..f6207acd 100644 --- a/lib/commands/services/tables-db.ts +++ b/lib/commands/services/tables-db.ts @@ -367,6 +367,51 @@ const tablesDBListColumnsCommand = tablesDB ); +const tablesDBCreateBigIntColumnCommand = tablesDB + .command(`create-big-int-column`) + .description(`Create a bigint column. Optionally, minimum and maximum values can be provided. +`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required `, `Is column required?`, parseBool) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--xdefault `, `Default value. Cannot be set when column is required.`, parseInteger) + .option( + `--array [value]`, + `Is column an array?`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .action( + actionRunner( + async ({ databaseId, tableId, key, required, min, max, xdefault, array }) => + parse(await (await getTablesDBClient()).createBigIntColumn(databaseId, tableId, key, required, min, max, xdefault, array)), + ), + ); + + +const tablesDBUpdateBigIntColumnCommand = tablesDB + .command(`update-big-int-column`) + .description(`Update a bigint column. Changing the \`default\` value will not update already existing rows. +`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required `, `Is column required?`, parseBool) + .requiredOption(`--xdefault `, `Default value. Cannot be set when column is required.`, parseInteger) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--new-key `, `New Column Key.`) + .action( + actionRunner( + async ({ databaseId, tableId, key, required, xdefault, min, max, newKey }) => + parse(await (await getTablesDBClient()).updateBigIntColumn(databaseId, tableId, key, required, xdefault, min, max, newKey)), + ), + ); + + const tablesDBCreateBooleanColumnCommand = tablesDB .command(`create-boolean-column`) .description(`Create a boolean column. diff --git a/lib/constants.ts b/lib/constants.ts index 6b6d9935..5302c744 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,7 +1,7 @@ // SDK export const SDK_TITLE = 'Appwrite'; export const SDK_TITLE_LOWER = 'appwrite'; -export const SDK_VERSION = '20.1.0'; +export const SDK_VERSION = '20.2.0'; export const SDK_NAME = 'Command Line'; export const SDK_PLATFORM = 'console'; export const SDK_LANGUAGE = 'cli'; diff --git a/package-lock.json b/package-lock.json index f2a94c3c..0aa42480 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "appwrite-cli", - "version": "20.1.0", + "version": "20.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "appwrite-cli", - "version": "20.1.0", + "version": "20.2.0", "license": "BSD-3-Clause", "dependencies": { "@appwrite.io/console": "12.0.0", diff --git a/package.json b/package.json index 08eea694..c6c3b4c0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "20.1.0", + "version": "20.2.0", "license": "BSD-3-Clause", "main": "dist/index.cjs", "module": "dist/index.js", diff --git a/scoop/appwrite.config.json b/scoop/appwrite.config.json index 25d0cd84..ba3dab4f 100644 --- a/scoop/appwrite.config.json +++ b/scoop/appwrite.config.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "20.1.0", + "version": "20.2.0", "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.", "homepage": "https://github.com/appwrite/sdk-for-cli", "license": "BSD-3-Clause", "architecture": { "64bit": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe", "bin": [ [ "appwrite-cli-win-x64.exe", @@ -15,7 +15,7 @@ ] }, "arm64": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe", From fe081e277a995a78f99221fd8fe41bcda9d3598b Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 May 2026 11:35:47 +0000 Subject: [PATCH 02/13] chore: update Command Line SDK to 20.2.0 --- lib/commands/services/migrations.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/commands/services/migrations.ts b/lib/commands/services/migrations.ts index 9b7c2bd7..a77991c6 100644 --- a/lib/commands/services/migrations.ts +++ b/lib/commands/services/migrations.ts @@ -64,10 +64,11 @@ const migrationsCreateAppwriteMigrationCommand = migrations .requiredOption(`--endpoint `, `Source Appwrite endpoint`) .requiredOption(`--project-id `, `Source Project ID`) .requiredOption(`--api-key `, `Source API Key`) + .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ resources, endpoint, projectId, apiKey }) => - parse(await (await getMigrationsClient()).createAppwriteMigration(resources, endpoint, projectId, apiKey)), + async ({ resources, endpoint, projectId, apiKey, onDuplicate }) => + parse(await (await getMigrationsClient()).createAppwriteMigration(resources, endpoint, projectId, apiKey, onDuplicate)), ), ); @@ -136,10 +137,11 @@ const migrationsCreateCSVImportCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) + .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ bucketId, fileId, resourceId, internalFile }) => - parse(await (await getMigrationsClient()).createCSVImport(bucketId, fileId, resourceId, internalFile)), + async ({ bucketId, fileId, resourceId, internalFile, onDuplicate }) => + parse(await (await getMigrationsClient()).createCSVImport(bucketId, fileId, resourceId, internalFile, onDuplicate)), ), ); @@ -212,10 +214,11 @@ const migrationsCreateJSONImportCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) + .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ bucketId, fileId, resourceId, internalFile }) => - parse(await (await getMigrationsClient()).createJSONImport(bucketId, fileId, resourceId, internalFile)), + async ({ bucketId, fileId, resourceId, internalFile, onDuplicate }) => + parse(await (await getMigrationsClient()).createJSONImport(bucketId, fileId, resourceId, internalFile, onDuplicate)), ), ); From 1f49ed7da8bcf159e1d08bbf577ce2595479beb7 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 May 2026 11:46:45 +0000 Subject: [PATCH 03/13] chore: update Command Line SDK to 20.2.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b5e102ef..5c0f25ff 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** +**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) From c5a44e3949a054c1db71cf974d2b4186575be9d0 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 May 2026 11:49:48 +0000 Subject: [PATCH 04/13] chore: update Command Line SDK to 20.2.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c0f25ff..b5e102ef 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** +**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) From c5047b57f5faac1e4fafc829b3e1a59019f33e5f Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 7 May 2026 18:50:11 +0530 Subject: [PATCH 05/13] chore: refresh sdk for latest spec (sanitized oauth examples) --- CHANGELOG.md | 6 ------ README.md | 4 ++-- install.ps1 | 4 ++-- install.sh | 2 +- lib/commands/services/project.ts | 6 +++--- lib/constants.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- scoop/appwrite.config.json | 6 +++--- 9 files changed, 15 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c4e311f..79a2a713 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,5 @@ # Change Log -## 20.2.0 - -* Added: Introduced `bigint` create/update APIs for legacy Databases attributes -* Added: Introduced `bigint` create/update APIs for `TablesDB` columns -* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` - ## 20.1.0 * Added `--switch` and `--new` flags on `appwrite login` to explicitly manage multiple saved accounts diff --git a/README.md b/README.md index b5e102ef..a6a48273 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using ```sh $ appwrite -v -20.2.0 +20.1.0 ``` ### Install using prebuilt binaries @@ -83,7 +83,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc Once the installation completes, you can verify your install using ``` $ appwrite -v -20.2.0 +20.1.0 ``` ## Getting Started diff --git a/install.ps1 b/install.ps1 index 54ea2a90..25204a16 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,8 @@ # You can use "View source" of this page to see the full script. # REPO -$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 6bd9885a..49b9fbb4 100644 --- a/install.sh +++ b/install.sh @@ -120,7 +120,7 @@ verifyMacOSCodeSignature() { downloadBinary() { echo "[2/5] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="20.2.0" + GITHUB_LATEST_VERSION="20.1.0" GITHUB_FILE="appwrite-cli-${OS}-${ARCH}" GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE" diff --git a/lib/commands/services/project.ts b/lib/commands/services/project.ts index 3bf63d8d..6622b7a9 100644 --- a/lib/commands/services/project.ts +++ b/lib/commands/services/project.ts @@ -651,8 +651,8 @@ const projectUpdateOAuth2GitlabCommand = project const projectUpdateOAuth2GoogleCommand = project .command(`update-o-auth-2-google`) .description(`Update the project OAuth2 Google configuration.`) - .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com`) - .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj`) + .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: your-google-client-id.apps.googleusercontent.com`) + .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: your-google-client-secret`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -711,7 +711,7 @@ const projectUpdateOAuth2LinkedinCommand = project .command(`update-o-auth-2-linkedin`) .description(`Update the project OAuth2 Linkedin configuration.`) .option(`--client-id `, `'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv`) - .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw==`) + .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-linkedin-client-secret`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, diff --git a/lib/constants.ts b/lib/constants.ts index 5302c744..6b6d9935 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,7 +1,7 @@ // SDK export const SDK_TITLE = 'Appwrite'; export const SDK_TITLE_LOWER = 'appwrite'; -export const SDK_VERSION = '20.2.0'; +export const SDK_VERSION = '20.1.0'; export const SDK_NAME = 'Command Line'; export const SDK_PLATFORM = 'console'; export const SDK_LANGUAGE = 'cli'; diff --git a/package-lock.json b/package-lock.json index 0aa42480..f2a94c3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "appwrite-cli", - "version": "20.2.0", + "version": "20.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "appwrite-cli", - "version": "20.2.0", + "version": "20.1.0", "license": "BSD-3-Clause", "dependencies": { "@appwrite.io/console": "12.0.0", diff --git a/package.json b/package.json index c6c3b4c0..08eea694 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "20.2.0", + "version": "20.1.0", "license": "BSD-3-Clause", "main": "dist/index.cjs", "module": "dist/index.js", diff --git a/scoop/appwrite.config.json b/scoop/appwrite.config.json index ba3dab4f..25d0cd84 100644 --- a/scoop/appwrite.config.json +++ b/scoop/appwrite.config.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "20.2.0", + "version": "20.1.0", "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.", "homepage": "https://github.com/appwrite/sdk-for-cli", "license": "BSD-3-Clause", "architecture": { "64bit": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-x64.exe", "bin": [ [ "appwrite-cli-win-x64.exe", @@ -15,7 +15,7 @@ ] }, "arm64": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe", From 47ee300ab2e05657fa447b439530c0a1d6e9b92f Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 7 May 2026 18:57:54 +0530 Subject: [PATCH 06/13] chore: refresh sdk for latest spec (sanitized oauth examples) --- CHANGELOG.md | 6 ++++++ README.md | 4 ++-- install.ps1 | 4 ++-- install.sh | 2 +- lib/constants.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- scoop/appwrite.config.json | 6 +++--- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79a2a713..5c4e311f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 20.2.0 + +* Added: Introduced `bigint` create/update APIs for legacy Databases attributes +* Added: Introduced `bigint` create/update APIs for `TablesDB` columns +* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` + ## 20.1.0 * Added `--switch` and `--new` flags on `appwrite login` to explicitly manage multiple saved accounts diff --git a/README.md b/README.md index a6a48273..b5e102ef 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using ```sh $ appwrite -v -20.1.0 +20.2.0 ``` ### Install using prebuilt binaries @@ -83,7 +83,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc Once the installation completes, you can verify your install using ``` $ appwrite -v -20.1.0 +20.2.0 ``` ## Getting Started diff --git a/install.ps1 b/install.ps1 index 25204a16..54ea2a90 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,8 @@ # You can use "View source" of this page to see the full script. # REPO -$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 49b9fbb4..6bd9885a 100644 --- a/install.sh +++ b/install.sh @@ -120,7 +120,7 @@ verifyMacOSCodeSignature() { downloadBinary() { echo "[2/5] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="20.1.0" + GITHUB_LATEST_VERSION="20.2.0" GITHUB_FILE="appwrite-cli-${OS}-${ARCH}" GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE" diff --git a/lib/constants.ts b/lib/constants.ts index 6b6d9935..5302c744 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,7 +1,7 @@ // SDK export const SDK_TITLE = 'Appwrite'; export const SDK_TITLE_LOWER = 'appwrite'; -export const SDK_VERSION = '20.1.0'; +export const SDK_VERSION = '20.2.0'; export const SDK_NAME = 'Command Line'; export const SDK_PLATFORM = 'console'; export const SDK_LANGUAGE = 'cli'; diff --git a/package-lock.json b/package-lock.json index f2a94c3c..0aa42480 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "appwrite-cli", - "version": "20.1.0", + "version": "20.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "appwrite-cli", - "version": "20.1.0", + "version": "20.2.0", "license": "BSD-3-Clause", "dependencies": { "@appwrite.io/console": "12.0.0", diff --git a/package.json b/package.json index 08eea694..c6c3b4c0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "20.1.0", + "version": "20.2.0", "license": "BSD-3-Clause", "main": "dist/index.cjs", "module": "dist/index.js", diff --git a/scoop/appwrite.config.json b/scoop/appwrite.config.json index 25d0cd84..ba3dab4f 100644 --- a/scoop/appwrite.config.json +++ b/scoop/appwrite.config.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "20.1.0", + "version": "20.2.0", "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.", "homepage": "https://github.com/appwrite/sdk-for-cli", "license": "BSD-3-Clause", "architecture": { "64bit": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe", "bin": [ [ "appwrite-cli-win-x64.exe", @@ -15,7 +15,7 @@ ] }, "arm64": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.1.0/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe", From fa46fdc073370b59e2af3a6ba7d2f38fe33f9d65 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 10:38:39 +0000 Subject: [PATCH 07/13] chore: update Command Line SDK to 20.3.0 --- README.md | 6 +- cli.ts | 2 + docs/examples/presences/delete.md | 4 + docs/examples/presences/get-usage.md | 3 + docs/examples/presences/get.md | 4 + docs/examples/presences/list.md | 4 + docs/examples/presences/update-presence.md | 5 + docs/examples/presences/upsert.md | 6 + install.ps1 | 4 +- install.sh | 2 +- lib/commands/generic.ts | 149 +++------------------ lib/commands/services/migrations.ts | 15 +-- lib/commands/services/presences.ts | 136 +++++++++++++++++++ lib/commands/services/project.ts | 6 +- lib/config.ts | 27 +--- lib/constants.ts | 2 +- lib/questions.ts | 31 +++-- lib/utils.ts | 2 +- package-lock.json | 4 +- package.json | 2 +- scoop/appwrite.config.json | 6 +- 21 files changed, 233 insertions(+), 187 deletions(-) create mode 100644 docs/examples/presences/delete.md create mode 100644 docs/examples/presences/get-usage.md create mode 100644 docs/examples/presences/get.md create mode 100644 docs/examples/presences/list.md create mode 100644 docs/examples/presences/update-presence.md create mode 100644 docs/examples/presences/upsert.md create mode 100644 lib/commands/services/presences.ts diff --git a/README.md b/README.md index b5e102ef..e5ea2d71 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** +**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using ```sh $ appwrite -v -20.2.0 +20.3.0 ``` ### Install using prebuilt binaries @@ -83,7 +83,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc Once the installation completes, you can verify your install using ``` $ appwrite -v -20.2.0 +20.3.0 ``` ## Getting Started diff --git a/cli.ts b/cli.ts index 293f5336..bc6dd17a 100644 --- a/cli.ts +++ b/cli.ts @@ -45,6 +45,7 @@ import { locale } from './lib/commands/services/locale.js'; import { messaging } from './lib/commands/services/messaging.js'; import { migrations } from './lib/commands/services/migrations.js'; import { organizations } from './lib/commands/services/organizations.js'; +import { presences } from './lib/commands/services/presences.js'; import { project } from './lib/commands/services/project.js'; import { projects } from './lib/commands/services/projects.js'; import { proxy } from './lib/commands/services/proxy.js'; @@ -215,6 +216,7 @@ if (process.argv.includes('-v') || process.argv.includes('--version')) { .addCommand(messaging) .addCommand(migrations) .addCommand(organizations) + .addCommand(presences) .addCommand(project) .addCommand(projects) .addCommand(proxy) diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md new file mode 100644 index 00000000..c64c0006 --- /dev/null +++ b/docs/examples/presences/delete.md @@ -0,0 +1,4 @@ +```bash +appwrite presences delete \ + --presence-id +``` diff --git a/docs/examples/presences/get-usage.md b/docs/examples/presences/get-usage.md new file mode 100644 index 00000000..65daeca2 --- /dev/null +++ b/docs/examples/presences/get-usage.md @@ -0,0 +1,3 @@ +```bash +appwrite presences get-usage +``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md new file mode 100644 index 00000000..86a1b5d7 --- /dev/null +++ b/docs/examples/presences/get.md @@ -0,0 +1,4 @@ +```bash +appwrite presences get \ + --presence-id +``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md new file mode 100644 index 00000000..83c77666 --- /dev/null +++ b/docs/examples/presences/list.md @@ -0,0 +1,4 @@ +```bash +appwrite presences list \ + --limit 25 +``` diff --git a/docs/examples/presences/update-presence.md b/docs/examples/presences/update-presence.md new file mode 100644 index 00000000..800fd721 --- /dev/null +++ b/docs/examples/presences/update-presence.md @@ -0,0 +1,5 @@ +```bash +appwrite presences update-presence \ + --presence-id \ + --user-id +``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md new file mode 100644 index 00000000..4261cc0c --- /dev/null +++ b/docs/examples/presences/upsert.md @@ -0,0 +1,6 @@ +```bash +appwrite presences upsert \ + --presence-id \ + --user-id \ + --status +``` diff --git a/install.ps1 b/install.ps1 index 54ea2a90..5e5e8682 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,8 @@ # You can use "View source" of this page to see the full script. # REPO -$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.3.0/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.3.0/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 6bd9885a..67764116 100644 --- a/install.sh +++ b/install.sh @@ -120,7 +120,7 @@ verifyMacOSCodeSignature() { downloadBinary() { echo "[2/5] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="20.2.0" + GITHUB_LATEST_VERSION="20.3.0" GITHUB_FILE="appwrite-cli-${OS}-${ARCH}" GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE" diff --git a/lib/commands/generic.ts b/lib/commands/generic.ts index 7941e134..730133de 100644 --- a/lib/commands/generic.ts +++ b/lib/commands/generic.ts @@ -2,11 +2,7 @@ import inquirer from "inquirer"; import { Command } from "commander"; import { Client } from "@appwrite.io/console"; import { sdkForConsole } from "../sdks.js"; -import { - globalConfig, - localConfig, - normalizeCloudConsoleEndpoint, -} from "../config.js"; +import { globalConfig, localConfig } from "../config.js"; import { EXECUTABLE_NAME } from "../constants.js"; import { actionRunner, @@ -20,20 +16,14 @@ import { drawTable, cliConfig, } from "../parser.js"; -import { isCloudHostname } from "../utils.js"; import ID from "../id.js"; import { questionsLogin, questionsLogout, questionsListFactors, questionsMFAChallenge, - questionsSwitchAccount, } from "../questions.js"; -import { - Account, - Client as ConsoleClient, - type Models, -} from "@appwrite.io/console"; +import { Account, Client as ConsoleClient } from "@appwrite.io/console"; import ClientLegacy from "../client.js"; const DEFAULT_ENDPOINT = "https://cloud.appwrite.io/v1"; @@ -47,56 +37,6 @@ const isMfaRequiredError = (err: unknown): err is AppwriteError => (err as AppwriteError)?.type === "user_more_factors_required" || (err as AppwriteError)?.response === "user_more_factors_required"; -const isGuestUnauthorizedError = (err: unknown): err is AppwriteError => - (err as AppwriteError)?.type === "general_unauthorized_scope" || - (err as AppwriteError)?.response === "general_unauthorized_scope"; - -const isRegionalCloudEndpoint = (endpoint: string): boolean => { - try { - const hostname = new URL(endpoint).hostname; - return isCloudHostname(hostname) && hostname !== "cloud.appwrite.io"; - } catch (_error) { - return false; - } -}; - -const restoreCurrentSession = (sessionId: string): void => { - globalConfig.setCurrentSession( - globalConfig.getSessionIds().includes(sessionId) ? sessionId : "", - ); -}; - -const removeCurrentSession = (): void => { - const current = globalConfig.getCurrentSession(); - globalConfig.setCurrentSession(""); - globalConfig.removeSession(current); -}; - -const getCurrentAccount = async (): Promise => { - if (globalConfig.getEndpoint() === "" || globalConfig.getCookie() === "") { - return null; - } - - const endpoint = normalizeCloudConsoleEndpoint(globalConfig.getEndpoint()); - if (endpoint !== globalConfig.getEndpoint()) { - globalConfig.setEndpoint(endpoint); - } - - const client = await sdkForConsole(false); - const accountClient = new Account(client); - - try { - const account = await accountClient.get(); - globalConfig.setEmail(account.email); - return account; - } catch (err) { - if (isGuestUnauthorizedError(err)) { - removeCurrentSession(); - } - return null; - } -}; - const createLegacyConsoleClient = (endpoint: string): ClientLegacy => { const legacyClient = new ClientLegacy(); legacyClient.setEndpoint(endpoint); @@ -175,9 +115,7 @@ const getSessionAccountKey = (sessionId: string): string | undefined => { | { email?: string; endpoint?: string } | undefined; if (!session) return undefined; - return `${session.email ?? ""}|${normalizeCloudConsoleEndpoint( - session.endpoint ?? "", - )}`; + return `${session.email ?? ""}|${session.endpoint ?? ""}`; }; /** @@ -227,62 +165,33 @@ export const loginCommand = async ({ endpoint, mfa, code, - switch: switchAccount, - new: newAccount, }: { email?: string; password?: string; endpoint?: string; mfa?: string; code?: string; - switch?: boolean; - new?: boolean; }): Promise => { - let oldCurrent = globalConfig.getCurrentSession(); - - if (switchAccount && newAccount) { - throw new Error("Use either --switch or --new, not both."); - } + const oldCurrent = globalConfig.getCurrentSession(); - if (endpoint && isRegionalCloudEndpoint(endpoint)) { - throw new Error( - `Cloud login uses ${DEFAULT_ENDPOINT}. Regional Cloud endpoints are for project API calls, not account login.`, - ); - } - - const configEndpoint = normalizeCloudConsoleEndpoint( - (endpoint ?? globalConfig.getEndpoint()) || DEFAULT_ENDPOINT, - ); + const configEndpoint = + (endpoint ?? globalConfig.getEndpoint()) || DEFAULT_ENDPOINT; if (globalConfig.getCurrentSession() !== "") { - const account = await getCurrentAccount(); - oldCurrent = globalConfig.getCurrentSession(); + log("You are currently signed in as " + globalConfig.getEmail()); - if (account) { - if (!email && !password && !endpoint && !switchAccount && !newAccount) { - success("Already logged in as " + account.email); - hint(`Use '${EXECUTABLE_NAME} login --new' to add another account`); - return; - } + if (globalConfig.getSessions().length === 1) { + hint("You can sign in and manage multiple accounts with Appwrite CLI"); } } - let answers; - if (switchAccount) { - if (!globalConfig.getSessions().some((session) => session.email)) { - throw new Error( - `No signed-in accounts found. Run '${EXECUTABLE_NAME} login' to sign in.`, - ); - } - answers = await inquirer.prompt(questionsSwitchAccount); - } else if (email && password) { - answers = { email, password }; - } else { - answers = await inquirer.prompt(questionsLogin); - } + const answers = + email && password + ? { email, password } + : await inquirer.prompt(questionsLogin); if (!answers.method) { - answers.method = switchAccount ? "select" : "login"; + answers.method = "login"; } if (answers.method === "select") { @@ -292,21 +201,7 @@ export const loginCommand = async ({ throw Error("Session ID not found"); } - if (accountId === oldCurrent) { - const account = await getCurrentAccount(); - if (account) { - success(`Already using ${account.email}`); - return; - } - throw new Error( - `Selected account session is no longer valid. Run '${EXECUTABLE_NAME} login --switch' again.`, - ); - } - globalConfig.setCurrentSession(accountId); - globalConfig.setEndpoint( - normalizeCloudConsoleEndpoint(globalConfig.getEndpoint()), - ); const client = await sdkForConsole(false); const accountClient = new Account(client); @@ -318,10 +213,6 @@ export const loginCommand = async ({ await accountClient.get(); } catch (err) { if (!isMfaRequiredError(err)) { - if (isGuestUnauthorizedError(err)) { - globalConfig.removeSession(accountId); - } - restoreCurrentSession(oldCurrent); throw err; } @@ -415,8 +306,14 @@ export const whoami = new Command("whoami") return; } - const account = await getCurrentAccount(); - if (!account) { + const client = await sdkForConsole(false); + const accountClient = new Account(client); + + let account; + + try { + account = await accountClient.get(); + } catch (_) { error("No user is signed in. To sign in, run 'appwrite login'"); return; } @@ -461,8 +358,6 @@ export const login = new Command("login") `Multi-factor authentication login factor: totp, email, phone or recoveryCode`, ) .option(`--code [code]`, `Multi-factor code`) - .option(`--switch`, `Switch to another signed-in account`) - .option(`--new`, `Sign in to another account`) .configureHelp({ helpWidth: process.stdout.columns || 80, }) diff --git a/lib/commands/services/migrations.ts b/lib/commands/services/migrations.ts index a77991c6..9b7c2bd7 100644 --- a/lib/commands/services/migrations.ts +++ b/lib/commands/services/migrations.ts @@ -64,11 +64,10 @@ const migrationsCreateAppwriteMigrationCommand = migrations .requiredOption(`--endpoint `, `Source Appwrite endpoint`) .requiredOption(`--project-id `, `Source Project ID`) .requiredOption(`--api-key `, `Source API Key`) - .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ resources, endpoint, projectId, apiKey, onDuplicate }) => - parse(await (await getMigrationsClient()).createAppwriteMigration(resources, endpoint, projectId, apiKey, onDuplicate)), + async ({ resources, endpoint, projectId, apiKey }) => + parse(await (await getMigrationsClient()).createAppwriteMigration(resources, endpoint, projectId, apiKey)), ), ); @@ -137,11 +136,10 @@ const migrationsCreateCSVImportCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ bucketId, fileId, resourceId, internalFile, onDuplicate }) => - parse(await (await getMigrationsClient()).createCSVImport(bucketId, fileId, resourceId, internalFile, onDuplicate)), + async ({ bucketId, fileId, resourceId, internalFile }) => + parse(await (await getMigrationsClient()).createCSVImport(bucketId, fileId, resourceId, internalFile)), ), ); @@ -214,11 +212,10 @@ const migrationsCreateJSONImportCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) - .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ bucketId, fileId, resourceId, internalFile, onDuplicate }) => - parse(await (await getMigrationsClient()).createJSONImport(bucketId, fileId, resourceId, internalFile, onDuplicate)), + async ({ bucketId, fileId, resourceId, internalFile }) => + parse(await (await getMigrationsClient()).createJSONImport(bucketId, fileId, resourceId, internalFile)), ), ); diff --git a/lib/commands/services/presences.ts b/lib/commands/services/presences.ts new file mode 100644 index 00000000..48b7346a --- /dev/null +++ b/lib/commands/services/presences.ts @@ -0,0 +1,136 @@ +import { Command } from "commander"; +import { + buildQueries, + collectQueryValue, + parseWhereQuery, +} from "../utils/query.js"; +import { sdkForProject } from "../../sdks.js"; +import { + actionRunner, + commandDescriptions, + success, + parse, + parseBool, + parseInteger, + parseJsonObject, +} from "../../parser.js"; +import { Presences } from "@appwrite.io/console"; + +let presencesClient: Presences | null = null; + +const getPresencesClient = async (): Promise => { + if (!presencesClient) { + const sdkClient = await sdkForProject(); + presencesClient = new Presences(sdkClient); + } + return presencesClient; +}; + +export const presences = new Command("presences") + .description(commandDescriptions["presences"] ?? "") + .configureHelp({ + helpWidth: process.stdout.columns || 80, + }); + +const presencesListCommand = presences + .command(`list`) + .description(`List presence logs.`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK.`) + .option( + `--total [value]`, + `When set to false, the total count returned will be 0 and will not be calculated.`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .option(`--ttl `, `TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).`, parseInteger) + .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--limit `, `Maximum number of results to return.`, parseInteger) + .option(`--offset `, `Number of results to skip.`, parseInteger) + .option(`--cursor-after `, `Return results after this cursor ID.`) + .option(`--cursor-before `, `Return results before this cursor ID.`) + .action( + actionRunner( + async ({ queries, total, ttl, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getPresencesClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total, ttl)), + ), + ); + + +const presencesGetUsageCommand = presences + .command(`get-usage`) + .description(`Get presence usage metrics and statistics, including the current total of online users and historical online user counts for the selected time range.`) + .option(`--range `, `Date range.`) + .action( + actionRunner( + async ({ range }) => + parse(await (await getPresencesClient()).getUsage(range)), + ), + ); + + +const presencesGetCommand = presences + .command(`get`) + .description(`Get a presence log by its unique ID.`) + .requiredOption(`--presence-id `, `Presence unique ID.`) + .action( + actionRunner( + async ({ presenceId }) => + parse(await (await getPresencesClient()).get(presenceId)), + ), + ); + + +const presencesUpsertCommand = presences + .command(`upsert`) + .description(`Create or update a presence log by its unique ID.`) + .requiredOption(`--presence-id `, `Presence unique ID.`) + .requiredOption(`--user-id `, `User ID.`) + .requiredOption(`--status `, `Presence status.`) + .option(`--permissions [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).`) + .option(`--expires-at `, `Presence expiry datetime.`) + .option(`--metadata `, `Presence metadata object.`) + .action( + actionRunner( + async ({ presenceId, userId, status, permissions, expiresAt, metadata }) => + parse(await (await getPresencesClient()).upsert(presenceId, userId, status, permissions, expiresAt, parseJsonObject(metadata, "--metadata"))), + ), + ); + + +const presencesUpdatePresenceCommand = presences + .command(`update-presence`) + .description(`Update a presence log by its unique ID.`) + .requiredOption(`--presence-id `, `Presence unique ID.`) + .requiredOption(`--user-id `, `User ID.`) + .option(`--status `, `Presence status.`) + .option(`--expires-at `, `Presence expiry datetime.`) + .option(`--metadata `, `Presence metadata object.`) + .option(`--permissions [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).`) + .option( + `--purge [value]`, + `When true, purge cached responses used by list presences endpoint.`, + (value: string | undefined) => + value === undefined ? true : parseBool(value), + ) + .action( + actionRunner( + async ({ presenceId, userId, status, expiresAt, metadata, permissions, purge }) => + parse(await (await getPresencesClient()).updatePresence(presenceId, userId, status, expiresAt, parseJsonObject(metadata, "--metadata"), permissions, purge)), + ), + ); + + +const presencesDeleteCommand = presences + .command(`delete`) + .description(`Delete a presence log by its unique ID.`) + .requiredOption(`--presence-id `, `Presence unique ID.`) + .action( + actionRunner( + async ({ presenceId }) => + parse(await (await getPresencesClient()).delete(presenceId)), + ), + ); + + diff --git a/lib/commands/services/project.ts b/lib/commands/services/project.ts index 6622b7a9..3bf63d8d 100644 --- a/lib/commands/services/project.ts +++ b/lib/commands/services/project.ts @@ -651,8 +651,8 @@ const projectUpdateOAuth2GitlabCommand = project const projectUpdateOAuth2GoogleCommand = project .command(`update-o-auth-2-google`) .description(`Update the project OAuth2 Google configuration.`) - .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: your-google-client-id.apps.googleusercontent.com`) - .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: your-google-client-secret`) + .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com`) + .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -711,7 +711,7 @@ const projectUpdateOAuth2LinkedinCommand = project .command(`update-o-auth-2-linkedin`) .description(`Update the project OAuth2 Linkedin configuration.`) .option(`--client-id `, `'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv`) - .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-linkedin-client-secret`) + .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw==`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, diff --git a/lib/config.ts b/lib/config.ts index 4789c074..c3d7e74f 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -103,22 +103,6 @@ function isRecord(value: unknown): value is Record { return value !== null && typeof value === "object" && !Array.isArray(value); } -export function normalizeCloudConsoleEndpoint(endpoint: string): string { - try { - const url = new URL(endpoint); - if ( - url.hostname === "cloud.appwrite.io" || - url.hostname.endsWith(".cloud.appwrite.io") - ) { - return "https://cloud.appwrite.io/v1"; - } - } catch (_error) { - return endpoint; - } - - return endpoint; -} - function ensureDirectoryForFile(filePath: string): void { const dir = _path.dirname(filePath); if (!fs.existsSync(dir)) { @@ -1217,17 +1201,10 @@ class Global extends Config { sessions.forEach((sessionId) => { const sessionData = (this.data as any)[sessionId]; const email = sessionData[Global.PREFERENCE_EMAIL] ?? ""; - const endpoint = normalizeCloudConsoleEndpoint( - sessionData[Global.PREFERENCE_ENDPOINT] ?? "", - ); + const endpoint = sessionData[Global.PREFERENCE_ENDPOINT] ?? ""; const key = `${email}|${endpoint}`; - const existingSession = sessionMap.get(key); - if ( - !existingSession || - sessionId === current || - existingSession.id !== current - ) { + if (sessionId === current || !sessionMap.has(key)) { sessionMap.set(key, { id: sessionId, endpoint, diff --git a/lib/constants.ts b/lib/constants.ts index 5302c744..2e0c8475 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,7 +1,7 @@ // SDK export const SDK_TITLE = 'Appwrite'; export const SDK_TITLE_LOWER = 'appwrite'; -export const SDK_VERSION = '20.2.0'; +export const SDK_VERSION = '20.3.0'; export const SDK_NAME = 'Command Line'; export const SDK_PLATFORM = 'console'; export const SDK_LANGUAGE = 'cli'; diff --git a/lib/questions.ts b/lib/questions.ts index bea21526..3f7a5183 100644 --- a/lib/questions.ts +++ b/lib/questions.ts @@ -822,6 +822,16 @@ export const questionsPullCollection: Question[] = [ ]; export const questionsLogin: Question[] = [ + { + type: "list", + name: "method", + message: "What would you like to do?", + choices: [ + { name: "Login to an account", value: "login" }, + { name: "Switch to an account", value: "select" }, + ], + when: () => globalConfig.getSessions().length >= 2, + }, { type: "input", name: "email", @@ -832,6 +842,7 @@ export const questionsLogin: Question[] = [ } return true; }, + when: (answers: Answers) => answers.method !== "select", }, { type: "password", @@ -844,36 +855,38 @@ export const questionsLogin: Question[] = [ } return true; }, + when: (answers: Answers) => answers.method !== "select", }, -]; - -export const questionsSwitchAccount: Question[] = [ { type: "list", name: "accountId", - message: "Select account:", + message: "Select an account to use", choices() { const sessions = globalConfig.getSessions(); const current = globalConfig.getCurrentSession(); const data: Choice[] = []; + const longestEmail = sessions.reduce((prev: any, current: any) => + prev && (prev.email ?? "").length > (current.email ?? "").length + ? prev + : current, + ).email.length; + sessions.forEach((session: any) => { if (session.email) { data.push({ current: current === session.id, value: session.id, - short: session.email, - name: - session.endpoint === DEFAULT_ENDPOINT - ? session.email - : `${session.email} (${session.endpoint})`, + short: `${session.email} (${session.endpoint})`, + name: `${session.email.padEnd(longestEmail)} ${current === session.id ? chalk.green.bold("current") : " ".repeat(6)} ${session.endpoint}`, }); } }); return data.sort((a, b) => Number(b.current) - Number(a.current)); }, + when: (answers: Answers) => answers.method === "select", }, ]; diff --git a/lib/utils.ts b/lib/utils.ts index fd307162..3e5e727d 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -317,7 +317,7 @@ const getHomebrewLatestVersion = async ( } }; -export const isCloudHostname = (hostname: string): boolean => +const isCloudHostname = (hostname: string): boolean => hostname === "cloud.appwrite.io" || hostname.endsWith(".cloud.appwrite.io"); export const getConsoleBaseUrl = (endpoint: string): string => { diff --git a/package-lock.json b/package-lock.json index 0aa42480..bcc44a8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "appwrite-cli", - "version": "20.2.0", + "version": "20.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "appwrite-cli", - "version": "20.2.0", + "version": "20.3.0", "license": "BSD-3-Clause", "dependencies": { "@appwrite.io/console": "12.0.0", diff --git a/package.json b/package.json index c6c3b4c0..b1480c38 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "20.2.0", + "version": "20.3.0", "license": "BSD-3-Clause", "main": "dist/index.cjs", "module": "dist/index.js", diff --git a/scoop/appwrite.config.json b/scoop/appwrite.config.json index ba3dab4f..56379948 100644 --- a/scoop/appwrite.config.json +++ b/scoop/appwrite.config.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "20.2.0", + "version": "20.3.0", "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.", "homepage": "https://github.com/appwrite/sdk-for-cli", "license": "BSD-3-Clause", "architecture": { "64bit": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.3.0/appwrite-cli-win-x64.exe", "bin": [ [ "appwrite-cli-win-x64.exe", @@ -15,7 +15,7 @@ ] }, "arm64": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.3.0/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe", From 6e397d0216d49cbc03bcf5b6773f03611fd6299e Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 10:42:22 +0000 Subject: [PATCH 08/13] chore: update Command Line SDK to 20.3.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e5ea2d71..cbec5e59 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** +**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) From 11f70e3d7ec90b3a6f925e1f7a7d17a04c1edcea Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 10:59:11 +0000 Subject: [PATCH 09/13] chore: update Command Line SDK to 20.2.0 --- README.md | 4 ++-- install.ps1 | 4 ++-- install.sh | 2 +- lib/constants.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- scoop/appwrite.config.json | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index cbec5e59..b5e102ef 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using ```sh $ appwrite -v -20.3.0 +20.2.0 ``` ### Install using prebuilt binaries @@ -83,7 +83,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc Once the installation completes, you can verify your install using ``` $ appwrite -v -20.3.0 +20.2.0 ``` ## Getting Started diff --git a/install.ps1 b/install.ps1 index 5e5e8682..54ea2a90 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,8 @@ # You can use "View source" of this page to see the full script. # REPO -$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.3.0/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.3.0/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 67764116..6bd9885a 100644 --- a/install.sh +++ b/install.sh @@ -120,7 +120,7 @@ verifyMacOSCodeSignature() { downloadBinary() { echo "[2/5] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="20.3.0" + GITHUB_LATEST_VERSION="20.2.0" GITHUB_FILE="appwrite-cli-${OS}-${ARCH}" GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE" diff --git a/lib/constants.ts b/lib/constants.ts index 2e0c8475..5302c744 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,7 +1,7 @@ // SDK export const SDK_TITLE = 'Appwrite'; export const SDK_TITLE_LOWER = 'appwrite'; -export const SDK_VERSION = '20.3.0'; +export const SDK_VERSION = '20.2.0'; export const SDK_NAME = 'Command Line'; export const SDK_PLATFORM = 'console'; export const SDK_LANGUAGE = 'cli'; diff --git a/package-lock.json b/package-lock.json index bcc44a8f..0aa42480 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "appwrite-cli", - "version": "20.3.0", + "version": "20.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "appwrite-cli", - "version": "20.3.0", + "version": "20.2.0", "license": "BSD-3-Clause", "dependencies": { "@appwrite.io/console": "12.0.0", diff --git a/package.json b/package.json index b1480c38..c6c3b4c0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "20.3.0", + "version": "20.2.0", "license": "BSD-3-Clause", "main": "dist/index.cjs", "module": "dist/index.js", diff --git a/scoop/appwrite.config.json b/scoop/appwrite.config.json index 56379948..ba3dab4f 100644 --- a/scoop/appwrite.config.json +++ b/scoop/appwrite.config.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "20.3.0", + "version": "20.2.0", "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.", "homepage": "https://github.com/appwrite/sdk-for-cli", "license": "BSD-3-Clause", "architecture": { "64bit": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.3.0/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe", "bin": [ [ "appwrite-cli-win-x64.exe", @@ -15,7 +15,7 @@ ] }, "arm64": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.3.0/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe", From 37682f333541744b1bdb5450687c15032ce78663 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 11:04:58 +0000 Subject: [PATCH 10/13] chore: remove presences API artifacts --- lib/commands/services/project.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/commands/services/project.ts b/lib/commands/services/project.ts index 3bf63d8d..6622b7a9 100644 --- a/lib/commands/services/project.ts +++ b/lib/commands/services/project.ts @@ -651,8 +651,8 @@ const projectUpdateOAuth2GitlabCommand = project const projectUpdateOAuth2GoogleCommand = project .command(`update-o-auth-2-google`) .description(`Update the project OAuth2 Google configuration.`) - .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com`) - .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj`) + .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: your-google-client-id.apps.googleusercontent.com`) + .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: your-google-client-secret`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -711,7 +711,7 @@ const projectUpdateOAuth2LinkedinCommand = project .command(`update-o-auth-2-linkedin`) .description(`Update the project OAuth2 Linkedin configuration.`) .option(`--client-id `, `'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv`) - .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw==`) + .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-linkedin-client-secret`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, From b3197feb14546f79aad08677b443cab89199fe3b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 11:13:20 +0000 Subject: [PATCH 11/13] chore: update Command Line SDK to 20.2.0 --- cli.ts | 2 - docs/examples/presences/delete.md | 4 - docs/examples/presences/get-usage.md | 3 - docs/examples/presences/get.md | 4 - docs/examples/presences/list.md | 4 - docs/examples/presences/update-presence.md | 5 - docs/examples/presences/upsert.md | 6 - lib/commands/services/presences.ts | 136 --------------------- lib/commands/services/project.ts | 6 +- 9 files changed, 3 insertions(+), 167 deletions(-) delete mode 100644 docs/examples/presences/delete.md delete mode 100644 docs/examples/presences/get-usage.md delete mode 100644 docs/examples/presences/get.md delete mode 100644 docs/examples/presences/list.md delete mode 100644 docs/examples/presences/update-presence.md delete mode 100644 docs/examples/presences/upsert.md delete mode 100644 lib/commands/services/presences.ts diff --git a/cli.ts b/cli.ts index bc6dd17a..293f5336 100644 --- a/cli.ts +++ b/cli.ts @@ -45,7 +45,6 @@ import { locale } from './lib/commands/services/locale.js'; import { messaging } from './lib/commands/services/messaging.js'; import { migrations } from './lib/commands/services/migrations.js'; import { organizations } from './lib/commands/services/organizations.js'; -import { presences } from './lib/commands/services/presences.js'; import { project } from './lib/commands/services/project.js'; import { projects } from './lib/commands/services/projects.js'; import { proxy } from './lib/commands/services/proxy.js'; @@ -216,7 +215,6 @@ if (process.argv.includes('-v') || process.argv.includes('--version')) { .addCommand(messaging) .addCommand(migrations) .addCommand(organizations) - .addCommand(presences) .addCommand(project) .addCommand(projects) .addCommand(proxy) diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md deleted file mode 100644 index c64c0006..00000000 --- a/docs/examples/presences/delete.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite presences delete \ - --presence-id -``` diff --git a/docs/examples/presences/get-usage.md b/docs/examples/presences/get-usage.md deleted file mode 100644 index 65daeca2..00000000 --- a/docs/examples/presences/get-usage.md +++ /dev/null @@ -1,3 +0,0 @@ -```bash -appwrite presences get-usage -``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md deleted file mode 100644 index 86a1b5d7..00000000 --- a/docs/examples/presences/get.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite presences get \ - --presence-id -``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md deleted file mode 100644 index 83c77666..00000000 --- a/docs/examples/presences/list.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite presences list \ - --limit 25 -``` diff --git a/docs/examples/presences/update-presence.md b/docs/examples/presences/update-presence.md deleted file mode 100644 index 800fd721..00000000 --- a/docs/examples/presences/update-presence.md +++ /dev/null @@ -1,5 +0,0 @@ -```bash -appwrite presences update-presence \ - --presence-id \ - --user-id -``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md deleted file mode 100644 index 4261cc0c..00000000 --- a/docs/examples/presences/upsert.md +++ /dev/null @@ -1,6 +0,0 @@ -```bash -appwrite presences upsert \ - --presence-id \ - --user-id \ - --status -``` diff --git a/lib/commands/services/presences.ts b/lib/commands/services/presences.ts deleted file mode 100644 index 48b7346a..00000000 --- a/lib/commands/services/presences.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { Command } from "commander"; -import { - buildQueries, - collectQueryValue, - parseWhereQuery, -} from "../utils/query.js"; -import { sdkForProject } from "../../sdks.js"; -import { - actionRunner, - commandDescriptions, - success, - parse, - parseBool, - parseInteger, - parseJsonObject, -} from "../../parser.js"; -import { Presences } from "@appwrite.io/console"; - -let presencesClient: Presences | null = null; - -const getPresencesClient = async (): Promise => { - if (!presencesClient) { - const sdkClient = await sdkForProject(); - presencesClient = new Presences(sdkClient); - } - return presencesClient; -}; - -export const presences = new Command("presences") - .description(commandDescriptions["presences"] ?? "") - .configureHelp({ - helpWidth: process.stdout.columns || 80, - }); - -const presencesListCommand = presences - .command(`list`) - .description(`List presence logs.`) - .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK.`) - .option( - `--total [value]`, - `When set to false, the total count returned will be 0 and will not be calculated.`, - (value: string | undefined) => - value === undefined ? true : parseBool(value), - ) - .option(`--ttl `, `TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).`, parseInteger) - .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) - .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) - .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) - .option(`--limit `, `Maximum number of results to return.`, parseInteger) - .option(`--offset `, `Number of results to skip.`, parseInteger) - .option(`--cursor-after `, `Return results after this cursor ID.`) - .option(`--cursor-before `, `Return results before this cursor ID.`) - .action( - actionRunner( - async ({ queries, total, ttl, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => - parse(await (await getPresencesClient()).list(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total, ttl)), - ), - ); - - -const presencesGetUsageCommand = presences - .command(`get-usage`) - .description(`Get presence usage metrics and statistics, including the current total of online users and historical online user counts for the selected time range.`) - .option(`--range `, `Date range.`) - .action( - actionRunner( - async ({ range }) => - parse(await (await getPresencesClient()).getUsage(range)), - ), - ); - - -const presencesGetCommand = presences - .command(`get`) - .description(`Get a presence log by its unique ID.`) - .requiredOption(`--presence-id `, `Presence unique ID.`) - .action( - actionRunner( - async ({ presenceId }) => - parse(await (await getPresencesClient()).get(presenceId)), - ), - ); - - -const presencesUpsertCommand = presences - .command(`upsert`) - .description(`Create or update a presence log by its unique ID.`) - .requiredOption(`--presence-id `, `Presence unique ID.`) - .requiredOption(`--user-id `, `User ID.`) - .requiredOption(`--status `, `Presence status.`) - .option(`--permissions [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).`) - .option(`--expires-at `, `Presence expiry datetime.`) - .option(`--metadata `, `Presence metadata object.`) - .action( - actionRunner( - async ({ presenceId, userId, status, permissions, expiresAt, metadata }) => - parse(await (await getPresencesClient()).upsert(presenceId, userId, status, permissions, expiresAt, parseJsonObject(metadata, "--metadata"))), - ), - ); - - -const presencesUpdatePresenceCommand = presences - .command(`update-presence`) - .description(`Update a presence log by its unique ID.`) - .requiredOption(`--presence-id `, `Presence unique ID.`) - .requiredOption(`--user-id `, `User ID.`) - .option(`--status `, `Presence status.`) - .option(`--expires-at `, `Presence expiry datetime.`) - .option(`--metadata `, `Presence metadata object.`) - .option(`--permissions [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).`) - .option( - `--purge [value]`, - `When true, purge cached responses used by list presences endpoint.`, - (value: string | undefined) => - value === undefined ? true : parseBool(value), - ) - .action( - actionRunner( - async ({ presenceId, userId, status, expiresAt, metadata, permissions, purge }) => - parse(await (await getPresencesClient()).updatePresence(presenceId, userId, status, expiresAt, parseJsonObject(metadata, "--metadata"), permissions, purge)), - ), - ); - - -const presencesDeleteCommand = presences - .command(`delete`) - .description(`Delete a presence log by its unique ID.`) - .requiredOption(`--presence-id `, `Presence unique ID.`) - .action( - actionRunner( - async ({ presenceId }) => - parse(await (await getPresencesClient()).delete(presenceId)), - ), - ); - - diff --git a/lib/commands/services/project.ts b/lib/commands/services/project.ts index 6622b7a9..3bf63d8d 100644 --- a/lib/commands/services/project.ts +++ b/lib/commands/services/project.ts @@ -651,8 +651,8 @@ const projectUpdateOAuth2GitlabCommand = project const projectUpdateOAuth2GoogleCommand = project .command(`update-o-auth-2-google`) .description(`Update the project OAuth2 Google configuration.`) - .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: your-google-client-id.apps.googleusercontent.com`) - .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: your-google-client-secret`) + .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com`) + .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -711,7 +711,7 @@ const projectUpdateOAuth2LinkedinCommand = project .command(`update-o-auth-2-linkedin`) .description(`Update the project OAuth2 Linkedin configuration.`) .option(`--client-id `, `'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv`) - .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-linkedin-client-secret`) + .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw==`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, From 99591050c80a72c2dacaaffd18ab6c0942d7e315 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 11:56:38 +0000 Subject: [PATCH 12/13] chore: update Command Line SDK to 20.2.0 --- README.md | 2 +- lib/commands/generic.ts | 149 ++++++++++++++++++++++++---- lib/commands/services/migrations.ts | 15 +-- lib/commands/services/project.ts | 106 ++++++++++---------- lib/commands/services/vcs.ts | 8 +- lib/config.ts | 27 ++++- lib/questions.ts | 31 ++---- lib/utils.ts | 2 +- 8 files changed, 230 insertions(+), 110 deletions(-) diff --git a/README.md b/README.md index b5e102ef..5c0f25ff 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** +**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/lib/commands/generic.ts b/lib/commands/generic.ts index 730133de..7941e134 100644 --- a/lib/commands/generic.ts +++ b/lib/commands/generic.ts @@ -2,7 +2,11 @@ import inquirer from "inquirer"; import { Command } from "commander"; import { Client } from "@appwrite.io/console"; import { sdkForConsole } from "../sdks.js"; -import { globalConfig, localConfig } from "../config.js"; +import { + globalConfig, + localConfig, + normalizeCloudConsoleEndpoint, +} from "../config.js"; import { EXECUTABLE_NAME } from "../constants.js"; import { actionRunner, @@ -16,14 +20,20 @@ import { drawTable, cliConfig, } from "../parser.js"; +import { isCloudHostname } from "../utils.js"; import ID from "../id.js"; import { questionsLogin, questionsLogout, questionsListFactors, questionsMFAChallenge, + questionsSwitchAccount, } from "../questions.js"; -import { Account, Client as ConsoleClient } from "@appwrite.io/console"; +import { + Account, + Client as ConsoleClient, + type Models, +} from "@appwrite.io/console"; import ClientLegacy from "../client.js"; const DEFAULT_ENDPOINT = "https://cloud.appwrite.io/v1"; @@ -37,6 +47,56 @@ const isMfaRequiredError = (err: unknown): err is AppwriteError => (err as AppwriteError)?.type === "user_more_factors_required" || (err as AppwriteError)?.response === "user_more_factors_required"; +const isGuestUnauthorizedError = (err: unknown): err is AppwriteError => + (err as AppwriteError)?.type === "general_unauthorized_scope" || + (err as AppwriteError)?.response === "general_unauthorized_scope"; + +const isRegionalCloudEndpoint = (endpoint: string): boolean => { + try { + const hostname = new URL(endpoint).hostname; + return isCloudHostname(hostname) && hostname !== "cloud.appwrite.io"; + } catch (_error) { + return false; + } +}; + +const restoreCurrentSession = (sessionId: string): void => { + globalConfig.setCurrentSession( + globalConfig.getSessionIds().includes(sessionId) ? sessionId : "", + ); +}; + +const removeCurrentSession = (): void => { + const current = globalConfig.getCurrentSession(); + globalConfig.setCurrentSession(""); + globalConfig.removeSession(current); +}; + +const getCurrentAccount = async (): Promise => { + if (globalConfig.getEndpoint() === "" || globalConfig.getCookie() === "") { + return null; + } + + const endpoint = normalizeCloudConsoleEndpoint(globalConfig.getEndpoint()); + if (endpoint !== globalConfig.getEndpoint()) { + globalConfig.setEndpoint(endpoint); + } + + const client = await sdkForConsole(false); + const accountClient = new Account(client); + + try { + const account = await accountClient.get(); + globalConfig.setEmail(account.email); + return account; + } catch (err) { + if (isGuestUnauthorizedError(err)) { + removeCurrentSession(); + } + return null; + } +}; + const createLegacyConsoleClient = (endpoint: string): ClientLegacy => { const legacyClient = new ClientLegacy(); legacyClient.setEndpoint(endpoint); @@ -115,7 +175,9 @@ const getSessionAccountKey = (sessionId: string): string | undefined => { | { email?: string; endpoint?: string } | undefined; if (!session) return undefined; - return `${session.email ?? ""}|${session.endpoint ?? ""}`; + return `${session.email ?? ""}|${normalizeCloudConsoleEndpoint( + session.endpoint ?? "", + )}`; }; /** @@ -165,33 +227,62 @@ export const loginCommand = async ({ endpoint, mfa, code, + switch: switchAccount, + new: newAccount, }: { email?: string; password?: string; endpoint?: string; mfa?: string; code?: string; + switch?: boolean; + new?: boolean; }): Promise => { - const oldCurrent = globalConfig.getCurrentSession(); + let oldCurrent = globalConfig.getCurrentSession(); + + if (switchAccount && newAccount) { + throw new Error("Use either --switch or --new, not both."); + } - const configEndpoint = - (endpoint ?? globalConfig.getEndpoint()) || DEFAULT_ENDPOINT; + if (endpoint && isRegionalCloudEndpoint(endpoint)) { + throw new Error( + `Cloud login uses ${DEFAULT_ENDPOINT}. Regional Cloud endpoints are for project API calls, not account login.`, + ); + } + + const configEndpoint = normalizeCloudConsoleEndpoint( + (endpoint ?? globalConfig.getEndpoint()) || DEFAULT_ENDPOINT, + ); if (globalConfig.getCurrentSession() !== "") { - log("You are currently signed in as " + globalConfig.getEmail()); + const account = await getCurrentAccount(); + oldCurrent = globalConfig.getCurrentSession(); - if (globalConfig.getSessions().length === 1) { - hint("You can sign in and manage multiple accounts with Appwrite CLI"); + if (account) { + if (!email && !password && !endpoint && !switchAccount && !newAccount) { + success("Already logged in as " + account.email); + hint(`Use '${EXECUTABLE_NAME} login --new' to add another account`); + return; + } } } - const answers = - email && password - ? { email, password } - : await inquirer.prompt(questionsLogin); + let answers; + if (switchAccount) { + if (!globalConfig.getSessions().some((session) => session.email)) { + throw new Error( + `No signed-in accounts found. Run '${EXECUTABLE_NAME} login' to sign in.`, + ); + } + answers = await inquirer.prompt(questionsSwitchAccount); + } else if (email && password) { + answers = { email, password }; + } else { + answers = await inquirer.prompt(questionsLogin); + } if (!answers.method) { - answers.method = "login"; + answers.method = switchAccount ? "select" : "login"; } if (answers.method === "select") { @@ -201,7 +292,21 @@ export const loginCommand = async ({ throw Error("Session ID not found"); } + if (accountId === oldCurrent) { + const account = await getCurrentAccount(); + if (account) { + success(`Already using ${account.email}`); + return; + } + throw new Error( + `Selected account session is no longer valid. Run '${EXECUTABLE_NAME} login --switch' again.`, + ); + } + globalConfig.setCurrentSession(accountId); + globalConfig.setEndpoint( + normalizeCloudConsoleEndpoint(globalConfig.getEndpoint()), + ); const client = await sdkForConsole(false); const accountClient = new Account(client); @@ -213,6 +318,10 @@ export const loginCommand = async ({ await accountClient.get(); } catch (err) { if (!isMfaRequiredError(err)) { + if (isGuestUnauthorizedError(err)) { + globalConfig.removeSession(accountId); + } + restoreCurrentSession(oldCurrent); throw err; } @@ -306,14 +415,8 @@ export const whoami = new Command("whoami") return; } - const client = await sdkForConsole(false); - const accountClient = new Account(client); - - let account; - - try { - account = await accountClient.get(); - } catch (_) { + const account = await getCurrentAccount(); + if (!account) { error("No user is signed in. To sign in, run 'appwrite login'"); return; } @@ -358,6 +461,8 @@ export const login = new Command("login") `Multi-factor authentication login factor: totp, email, phone or recoveryCode`, ) .option(`--code [code]`, `Multi-factor code`) + .option(`--switch`, `Switch to another signed-in account`) + .option(`--new`, `Sign in to another account`) .configureHelp({ helpWidth: process.stdout.columns || 80, }) diff --git a/lib/commands/services/migrations.ts b/lib/commands/services/migrations.ts index 9b7c2bd7..a77991c6 100644 --- a/lib/commands/services/migrations.ts +++ b/lib/commands/services/migrations.ts @@ -64,10 +64,11 @@ const migrationsCreateAppwriteMigrationCommand = migrations .requiredOption(`--endpoint `, `Source Appwrite endpoint`) .requiredOption(`--project-id `, `Source Project ID`) .requiredOption(`--api-key `, `Source API Key`) + .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ resources, endpoint, projectId, apiKey }) => - parse(await (await getMigrationsClient()).createAppwriteMigration(resources, endpoint, projectId, apiKey)), + async ({ resources, endpoint, projectId, apiKey, onDuplicate }) => + parse(await (await getMigrationsClient()).createAppwriteMigration(resources, endpoint, projectId, apiKey, onDuplicate)), ), ); @@ -136,10 +137,11 @@ const migrationsCreateCSVImportCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) + .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ bucketId, fileId, resourceId, internalFile }) => - parse(await (await getMigrationsClient()).createCSVImport(bucketId, fileId, resourceId, internalFile)), + async ({ bucketId, fileId, resourceId, internalFile, onDuplicate }) => + parse(await (await getMigrationsClient()).createCSVImport(bucketId, fileId, resourceId, internalFile, onDuplicate)), ), ); @@ -212,10 +214,11 @@ const migrationsCreateJSONImportCommand = migrations (value: string | undefined) => value === undefined ? true : parseBool(value), ) + .option(`--on-duplicate `, `Behavior when a row with an existing $id is encountered. "fail" (default): abort on first conflict. "skip": silently ignore. "overwrite": replace existing row.`) .action( actionRunner( - async ({ bucketId, fileId, resourceId, internalFile }) => - parse(await (await getMigrationsClient()).createJSONImport(bucketId, fileId, resourceId, internalFile)), + async ({ bucketId, fileId, resourceId, internalFile, onDuplicate }) => + parse(await (await getMigrationsClient()).createJSONImport(bucketId, fileId, resourceId, internalFile, onDuplicate)), ), ); diff --git a/lib/commands/services/project.ts b/lib/commands/services/project.ts index 3bf63d8d..74d79a61 100644 --- a/lib/commands/services/project.ts +++ b/lib/commands/services/project.ts @@ -288,23 +288,11 @@ const projectListOAuth2ProvidersCommand = project ); -const projectGetOAuth2ProviderCommand = project - .command(`get-o-auth-2-provider`) - .description(`Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty.`) - .requiredOption(`--provider-id `, `OAuth2 provider key. For example: github, google, apple.`) - .action( - actionRunner( - async ({ providerId }) => - parse(await (await getProjectClient()).getOAuth2Provider(providerId)), - ), - ); - - const projectUpdateOAuth2AmazonCommand = project .command(`update-o-auth-2-amazon`) .description(`Update the project OAuth2 Amazon configuration.`) .option(`--client-id `, `'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2`) - .option(`--client-secret `, `'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55`) + .option(`--client-secret `, `'Client Secret' of Amazon OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -344,7 +332,7 @@ const projectUpdateOAuth2Auth0Command = project .command(`update-o-auth-2-auth-0`) .description(`Update the project OAuth2 Auth0 configuration.`) .option(`--client-id `, `'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq`) - .option(`--client-secret `, `'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF`) + .option(`--client-secret `, `'Client Secret' of Auth0 OAuth2 app. For example: `) .option(`--endpoint `, `Domain of Auth0 instance. For example: example.us.auth0.com`) .option( `--enabled [value]`, @@ -364,7 +352,7 @@ const projectUpdateOAuth2AuthentikCommand = project .command(`update-o-auth-2-authentik`) .description(`Update the project OAuth2 Authentik configuration.`) .option(`--client-id `, `'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv`) - .option(`--client-secret `, `'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK`) + .option(`--client-secret `, `'Client Secret' of Authentik OAuth2 app. For example: `) .option(`--endpoint `, `Domain of Authentik instance. For example: example.authentik.com`) .option( `--enabled [value]`, @@ -384,7 +372,7 @@ const projectUpdateOAuth2AutodeskCommand = project .command(`update-o-auth-2-autodesk`) .description(`Update the project OAuth2 Autodesk configuration.`) .option(`--client-id `, `'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7`) - .option(`--client-secret `, `'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW`) + .option(`--client-secret `, `'Client Secret' of Autodesk OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -403,7 +391,7 @@ const projectUpdateOAuth2BitbucketCommand = project .command(`update-o-auth-2-bitbucket`) .description(`Update the project OAuth2 Bitbucket configuration.`) .option(`--key `, `'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc`) - .option(`--secret `, `'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx`) + .option(`--secret `, `'Secret' of Bitbucket OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -422,7 +410,7 @@ const projectUpdateOAuth2BitlyCommand = project .command(`update-o-auth-2-bitly`) .description(`Update the project OAuth2 Bitly configuration.`) .option(`--client-id `, `'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b`) - .option(`--client-secret `, `'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095`) + .option(`--client-secret `, `'Client Secret' of Bitly OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -441,7 +429,7 @@ const projectUpdateOAuth2BoxCommand = project .command(`update-o-auth-2-box`) .description(`Update the project OAuth2 Box configuration.`) .option(`--client-id `, `'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y`) - .option(`--client-secret `, `'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif`) + .option(`--client-secret `, `'Client Secret' of Box OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -460,7 +448,7 @@ const projectUpdateOAuth2DailymotionCommand = project .command(`update-o-auth-2-dailymotion`) .description(`Update the project OAuth2 Dailymotion configuration.`) .option(`--api-key `, `'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f`) - .option(`--api-secret `, `'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639`) + .option(`--api-secret `, `'API Secret' of Dailymotion OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -479,7 +467,7 @@ const projectUpdateOAuth2DiscordCommand = project .command(`update-o-auth-2-discord`) .description(`Update the project OAuth2 Discord configuration.`) .option(`--client-id `, `'Client ID' of Discord OAuth2 app. For example: 950722000000343754`) - .option(`--client-secret `, `'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D`) + .option(`--client-secret `, `'Client Secret' of Discord OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -498,7 +486,7 @@ const projectUpdateOAuth2DisqusCommand = project .command(`update-o-auth-2-disqus`) .description(`Update the project OAuth2 Disqus configuration.`) .option(`--public-key `, `'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX`) - .option(`--secret-key `, `'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9`) + .option(`--secret-key `, `'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -517,7 +505,7 @@ const projectUpdateOAuth2DropboxCommand = project .command(`update-o-auth-2-dropbox`) .description(`Update the project OAuth2 Dropbox configuration.`) .option(`--app-key `, `'App Key' of Dropbox OAuth2 app. For example: jl000000000009t`) - .option(`--app-secret `, `'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw`) + .option(`--app-secret `, `'App Secret' of Dropbox OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -536,7 +524,7 @@ const projectUpdateOAuth2EtsyCommand = project .command(`update-o-auth-2-etsy`) .description(`Update the project OAuth2 Etsy configuration.`) .option(`--key-string `, `'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2`) - .option(`--shared-secret `, `'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru`) + .option(`--shared-secret `, `'Shared Secret' of Etsy OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -555,7 +543,7 @@ const projectUpdateOAuth2FacebookCommand = project .command(`update-o-auth-2-facebook`) .description(`Update the project OAuth2 Facebook configuration.`) .option(`--app-id `, `'App ID' of Facebook OAuth2 app. For example: 260600000007694`) - .option(`--app-secret `, `'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4`) + .option(`--app-secret `, `'App Secret' of Facebook OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -574,7 +562,7 @@ const projectUpdateOAuth2FigmaCommand = project .command(`update-o-auth-2-figma`) .description(`Update the project OAuth2 Figma configuration.`) .option(`--client-id `, `'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40`) - .option(`--client-secret `, `'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5`) + .option(`--client-secret `, `'Client Secret' of Figma OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -593,7 +581,7 @@ const projectUpdateOAuth2FusionAuthCommand = project .command(`update-o-auth-2-fusion-auth`) .description(`Update the project OAuth2 FusionAuth configuration.`) .option(`--client-id `, `'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097`) - .option(`--client-secret `, `'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc`) + .option(`--client-secret `, `'Client Secret' of FusionAuth OAuth2 app. For example: `) .option(`--endpoint `, `Domain of FusionAuth instance. For example: example.fusionauth.io`) .option( `--enabled [value]`, @@ -613,7 +601,7 @@ const projectUpdateOAuth2GitHubCommand = project .command(`update-o-auth-2-git-hub`) .description(`Update the project OAuth2 GitHub configuration.`) .option(`--client-id `, `'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006`) - .option(`--client-secret `, `'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc`) + .option(`--client-secret `, `'Client Secret' of GitHub OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -632,7 +620,7 @@ const projectUpdateOAuth2GitlabCommand = project .command(`update-o-auth-2-gitlab`) .description(`Update the project OAuth2 Gitlab configuration.`) .option(`--application-id `, `'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252`) - .option(`--secret `, `'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38`) + .option(`--secret `, `'Secret' of Gitlab OAuth2 app. For example: `) .option(`--endpoint `, `Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com`) .option( `--enabled [value]`, @@ -652,7 +640,7 @@ const projectUpdateOAuth2GoogleCommand = project .command(`update-o-auth-2-google`) .description(`Update the project OAuth2 Google configuration.`) .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com`) - .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj`) + .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -671,7 +659,7 @@ const projectUpdateOAuth2KeycloakCommand = project .command(`update-o-auth-2-keycloak`) .description(`Update the project OAuth2 Keycloak configuration.`) .option(`--client-id `, `'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app`) - .option(`--client-secret `, `'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO`) + .option(`--client-secret `, `'Client Secret' of Keycloak OAuth2 app. For example: `) .option(`--endpoint `, `Domain of Keycloak instance. For example: keycloak.example.com`) .option(`--realm-name `, `Keycloak realm name. For example: appwrite-realm`) .option( @@ -692,7 +680,7 @@ const projectUpdateOAuth2KickCommand = project .command(`update-o-auth-2-kick`) .description(`Update the project OAuth2 Kick configuration.`) .option(`--client-id `, `'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32`) - .option(`--client-secret `, `'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b`) + .option(`--client-secret `, `'Client Secret' of Kick OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -711,7 +699,7 @@ const projectUpdateOAuth2LinkedinCommand = project .command(`update-o-auth-2-linkedin`) .description(`Update the project OAuth2 Linkedin configuration.`) .option(`--client-id `, `'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv`) - .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw==`) + .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -730,7 +718,7 @@ const projectUpdateOAuth2MicrosoftCommand = project .command(`update-o-auth-2-microsoft`) .description(`Update the project OAuth2 Microsoft configuration.`) .option(`--application-id `, `'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444`) - .option(`--application-secret `, `'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u`) + .option(`--application-secret `, `'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: `) .option(`--tenant `, `Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common`) .option( `--enabled [value]`, @@ -750,7 +738,7 @@ const projectUpdateOAuth2NotionCommand = project .command(`update-o-auth-2-notion`) .description(`Update the project OAuth2 Notion configuration.`) .option(`--oauth-client-id `, `'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3`) - .option(`--oauth-client-secret `, `'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9`) + .option(`--oauth-client-secret `, `'OAuth Client Secret' of Notion OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -769,7 +757,7 @@ const projectUpdateOAuth2OidcCommand = project .command(`update-o-auth-2-oidc`) .description(`Update the project OAuth2 Oidc configuration.`) .option(`--client-id `, `'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG`) - .option(`--client-secret `, `'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV`) + .option(`--client-secret `, `'Client Secret' of Oidc OAuth2 app. For example: `) .option(`--well-known-url `, `OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration`) .option(`--authorization-url `, `OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize`) .option(`--token-url `, `OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token`) @@ -792,7 +780,7 @@ const projectUpdateOAuth2OktaCommand = project .command(`update-o-auth-2-okta`) .description(`Update the project OAuth2 Okta configuration.`) .option(`--client-id `, `'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698`) - .option(`--client-secret `, `'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV`) + .option(`--client-secret `, `'Client Secret' of Okta OAuth2 app. For example: `) .option(`--domain `, `Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/`) .option(`--authorization-server-id `, `Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z`) .option( @@ -813,7 +801,7 @@ const projectUpdateOAuth2PaypalCommand = project .command(`update-o-auth-2-paypal`) .description(`Update the project OAuth2 Paypal configuration.`) .option(`--client-id `, `'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB`) - .option(`--secret-key `, `'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp`) + .option(`--secret-key `, `'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -832,7 +820,7 @@ const projectUpdateOAuth2PaypalSandboxCommand = project .command(`update-o-auth-2-paypal-sandbox`) .description(`Update the project OAuth2 PaypalSandbox configuration.`) .option(`--client-id `, `'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB`) - .option(`--secret-key `, `'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp`) + .option(`--secret-key `, `'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -851,7 +839,7 @@ const projectUpdateOAuth2PodioCommand = project .command(`update-o-auth-2-podio`) .description(`Update the project OAuth2 Podio configuration.`) .option(`--client-id `, `'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app`) - .option(`--client-secret `, `'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN`) + .option(`--client-secret `, `'Client Secret' of Podio OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -870,7 +858,7 @@ const projectUpdateOAuth2SalesforceCommand = project .command(`update-o-auth-2-salesforce`) .description(`Update the project OAuth2 Salesforce configuration.`) .option(`--customer-key `, `'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq`) - .option(`--customer-secret `, `'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2`) + .option(`--customer-secret `, `'Consumer Secret' of Salesforce OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -889,7 +877,7 @@ const projectUpdateOAuth2SlackCommand = project .command(`update-o-auth-2-slack`) .description(`Update the project OAuth2 Slack configuration.`) .option(`--client-id `, `'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023`) - .option(`--client-secret `, `'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd`) + .option(`--client-secret `, `'Client Secret' of Slack OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -908,7 +896,7 @@ const projectUpdateOAuth2SpotifyCommand = project .command(`update-o-auth-2-spotify`) .description(`Update the project OAuth2 Spotify configuration.`) .option(`--client-id `, `'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace`) - .option(`--client-secret `, `'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f`) + .option(`--client-secret `, `'Client Secret' of Spotify OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -927,7 +915,7 @@ const projectUpdateOAuth2StripeCommand = project .command(`update-o-auth-2-stripe`) .description(`Update the project OAuth2 Stripe configuration.`) .option(`--client-id `, `'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR`) - .option(`--api-secret-key `, `'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp`) + .option(`--api-secret-key `, `'API Secret Key' of Stripe OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -946,7 +934,7 @@ const projectUpdateOAuth2TradeshiftCommand = project .command(`update-o-auth-2-tradeshift`) .description(`Update the project OAuth2 Tradeshift configuration.`) .option(`--oauth-2-client-id `, `'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app`) - .option(`--oauth-2-client-secret `, `'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83`) + .option(`--oauth-2-client-secret `, `'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -965,7 +953,7 @@ const projectUpdateOAuth2TradeshiftSandboxCommand = project .command(`update-o-auth-2-tradeshift-sandbox`) .description(`Update the project OAuth2 Tradeshift Sandbox configuration.`) .option(`--oauth-2-client-id `, `'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app`) - .option(`--oauth-2-client-secret `, `'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83`) + .option(`--oauth-2-client-secret `, `'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -984,7 +972,7 @@ const projectUpdateOAuth2TwitchCommand = project .command(`update-o-auth-2-twitch`) .description(`Update the project OAuth2 Twitch configuration.`) .option(`--client-id `, `'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p`) - .option(`--client-secret `, `'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v`) + .option(`--client-secret `, `'Client Secret' of Twitch OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1003,7 +991,7 @@ const projectUpdateOAuth2WordPressCommand = project .command(`update-o-auth-2-word-press`) .description(`Update the project OAuth2 WordPress configuration.`) .option(`--client-id `, `'Client ID' of WordPress OAuth2 app. For example: 130005`) - .option(`--client-secret `, `'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk`) + .option(`--client-secret `, `'Client Secret' of WordPress OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1022,7 +1010,7 @@ const projectUpdateOAuth2XCommand = project .command(`update-o-auth-2x`) .description(`Update the project OAuth2 X configuration.`) .option(`--customer-key `, `'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT`) - .option(`--secret-key `, `'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9`) + .option(`--secret-key `, `'Secret Key' of X OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1041,7 +1029,7 @@ const projectUpdateOAuth2YahooCommand = project .command(`update-o-auth-2-yahoo`) .description(`Update the project OAuth2 Yahoo configuration.`) .option(`--client-id `, `'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm`) - .option(`--client-secret `, `'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9`) + .option(`--client-secret `, `'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1060,7 +1048,7 @@ const projectUpdateOAuth2YandexCommand = project .command(`update-o-auth-2-yandex`) .description(`Update the project OAuth2 Yandex configuration.`) .option(`--client-id `, `'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c`) - .option(`--client-secret `, `'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63`) + .option(`--client-secret `, `'Client Secret' of Yandex OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1079,7 +1067,7 @@ const projectUpdateOAuth2ZohoCommand = project .command(`update-o-auth-2-zoho`) .description(`Update the project OAuth2 Zoho configuration.`) .option(`--client-id `, `'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B`) - .option(`--client-secret `, `'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e`) + .option(`--client-secret `, `'Client Secret' of Zoho OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1098,7 +1086,7 @@ const projectUpdateOAuth2ZoomCommand = project .command(`update-o-auth-2-zoom`) .description(`Update the project OAuth2 Zoom configuration.`) .option(`--client-id `, `'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ`) - .option(`--client-secret `, `'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON`) + .option(`--client-secret `, `'Client Secret' of Zoom OAuth2 app. For example: `) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1113,6 +1101,18 @@ const projectUpdateOAuth2ZoomCommand = project ); +const projectGetOAuth2ProviderCommand = project + .command(`get-o-auth-2-provider`) + .description(`Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty.`) + .requiredOption(`--provider-id `, `OAuth2 provider key. For example: github, google, apple.`) + .action( + actionRunner( + async ({ providerId }) => + parse(await (await getProjectClient()).getOAuth2Provider(providerId)), + ), + ); + + const projectListPlatformsCommand = project .command(`list-platforms`) .description(`Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations.`) diff --git a/lib/commands/services/vcs.ts b/lib/commands/services/vcs.ts index 96ac14c1..de9c173d 100644 --- a/lib/commands/services/vcs.ts +++ b/lib/commands/services/vcs.ts @@ -92,14 +92,16 @@ const vcsGetRepositoryCommand = vcs const vcsListRepositoryBranchesCommand = vcs .command(`list-repository-branches`) - .description(`Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work. + .description(`Get a list of branches from a GitHub repository in your installation. This endpoint supports filtering by a search term and pagination using query strings such as \`Query.limit()\`, \`Query.offset()\`, \`Query.cursorAfter()\`, and \`Query.cursorBefore()\`. It returns branch names along with the total number of matches. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work. `) .requiredOption(`--installation-id `, `Installation Id`) .requiredOption(`--provider-repository-id `, `Repository Id`) + .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) + .option(`--queries `, `Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore`) .action( actionRunner( - async ({ installationId, providerRepositoryId }) => - parse(await (await getVcsClient()).listRepositoryBranches(installationId, providerRepositoryId)), + async ({ installationId, providerRepositoryId, search, queries }) => + parse(await (await getVcsClient()).listRepositoryBranches(installationId, providerRepositoryId, search, queries)), ), ); diff --git a/lib/config.ts b/lib/config.ts index c3d7e74f..4789c074 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -103,6 +103,22 @@ function isRecord(value: unknown): value is Record { return value !== null && typeof value === "object" && !Array.isArray(value); } +export function normalizeCloudConsoleEndpoint(endpoint: string): string { + try { + const url = new URL(endpoint); + if ( + url.hostname === "cloud.appwrite.io" || + url.hostname.endsWith(".cloud.appwrite.io") + ) { + return "https://cloud.appwrite.io/v1"; + } + } catch (_error) { + return endpoint; + } + + return endpoint; +} + function ensureDirectoryForFile(filePath: string): void { const dir = _path.dirname(filePath); if (!fs.existsSync(dir)) { @@ -1201,10 +1217,17 @@ class Global extends Config { sessions.forEach((sessionId) => { const sessionData = (this.data as any)[sessionId]; const email = sessionData[Global.PREFERENCE_EMAIL] ?? ""; - const endpoint = sessionData[Global.PREFERENCE_ENDPOINT] ?? ""; + const endpoint = normalizeCloudConsoleEndpoint( + sessionData[Global.PREFERENCE_ENDPOINT] ?? "", + ); const key = `${email}|${endpoint}`; + const existingSession = sessionMap.get(key); - if (sessionId === current || !sessionMap.has(key)) { + if ( + !existingSession || + sessionId === current || + existingSession.id !== current + ) { sessionMap.set(key, { id: sessionId, endpoint, diff --git a/lib/questions.ts b/lib/questions.ts index 3f7a5183..bea21526 100644 --- a/lib/questions.ts +++ b/lib/questions.ts @@ -822,16 +822,6 @@ export const questionsPullCollection: Question[] = [ ]; export const questionsLogin: Question[] = [ - { - type: "list", - name: "method", - message: "What would you like to do?", - choices: [ - { name: "Login to an account", value: "login" }, - { name: "Switch to an account", value: "select" }, - ], - when: () => globalConfig.getSessions().length >= 2, - }, { type: "input", name: "email", @@ -842,7 +832,6 @@ export const questionsLogin: Question[] = [ } return true; }, - when: (answers: Answers) => answers.method !== "select", }, { type: "password", @@ -855,38 +844,36 @@ export const questionsLogin: Question[] = [ } return true; }, - when: (answers: Answers) => answers.method !== "select", }, +]; + +export const questionsSwitchAccount: Question[] = [ { type: "list", name: "accountId", - message: "Select an account to use", + message: "Select account:", choices() { const sessions = globalConfig.getSessions(); const current = globalConfig.getCurrentSession(); const data: Choice[] = []; - const longestEmail = sessions.reduce((prev: any, current: any) => - prev && (prev.email ?? "").length > (current.email ?? "").length - ? prev - : current, - ).email.length; - sessions.forEach((session: any) => { if (session.email) { data.push({ current: current === session.id, value: session.id, - short: `${session.email} (${session.endpoint})`, - name: `${session.email.padEnd(longestEmail)} ${current === session.id ? chalk.green.bold("current") : " ".repeat(6)} ${session.endpoint}`, + short: session.email, + name: + session.endpoint === DEFAULT_ENDPOINT + ? session.email + : `${session.email} (${session.endpoint})`, }); } }); return data.sort((a, b) => Number(b.current) - Number(a.current)); }, - when: (answers: Answers) => answers.method === "select", }, ]; diff --git a/lib/utils.ts b/lib/utils.ts index 3e5e727d..fd307162 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -317,7 +317,7 @@ const getHomebrewLatestVersion = async ( } }; -const isCloudHostname = (hostname: string): boolean => +export const isCloudHostname = (hostname: string): boolean => hostname === "cloud.appwrite.io" || hostname.endsWith(".cloud.appwrite.io"); export const getConsoleBaseUrl = (endpoint: string): string => { From b6f99211a8cbefc333730c5ef5a8c1f867a51a7c Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 11 May 2026 08:58:00 +0530 Subject: [PATCH 13/13] chore: update Command Line SDK to 21.0.0 --- .github/workflows/publish.yml | 65 ++++++- CHANGELOG.md | 16 +- README.md | 4 +- bun.lock | 34 ++-- .../project/update-canonical-emails.md | 4 - .../update-deny-canonical-email-policy.md | 4 + .../update-deny-disposable-email-policy.md | 4 + .../project/update-deny-free-email-policy.md | 4 + .../project/update-disposable-emails.md | 4 - docs/examples/project/update-free-emails.md | 4 - docs/examples/vcs/list-repository-branches.md | 3 +- install.ps1 | 4 +- install.sh | 2 +- lib/commands/init.ts | 4 +- lib/commands/push.ts | 8 +- lib/commands/services/project.ts | 154 ++++++++--------- lib/commands/services/vcs.ts | 13 +- lib/config.ts | 30 +++- lib/constants.ts | 2 +- package-lock.json | 160 +++++++++--------- package.json | 6 +- scoop/appwrite.config.json | 6 +- 22 files changed, 310 insertions(+), 225 deletions(-) delete mode 100644 docs/examples/project/update-canonical-emails.md create mode 100644 docs/examples/project/update-deny-canonical-email-policy.md create mode 100644 docs/examples/project/update-deny-disposable-email-policy.md create mode 100644 docs/examples/project/update-deny-free-email-policy.md delete mode 100644 docs/examples/project/update-disposable-emails.md delete mode 100644 docs/examples/project/update-free-emails.md diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 53e0f5a5..b5726c32 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,6 +5,7 @@ on: types: [published] permissions: + actions: read id-token: write contents: write @@ -18,6 +19,9 @@ jobs: # upstream fix (oven-sh/bun#29122). CLI_BUN_VERSION: '1.3.11' HOMEBREW_TAP_REPO: appwrite/homebrew-appwrite + WINDOWS_SIGNING_PROJECT_SLUG: ${{ vars.WINDOWS_SIGNING_PROJECT_SLUG || 'sdk-for-cli' }} + WINDOWS_SIGNING_POLICY_SLUG: ${{ vars.WINDOWS_SIGNING_POLICY_SLUG || 'release-signing' }} + WINDOWS_SIGNING_ARTIFACT_CONFIGURATION_SLUG: ${{ vars.WINDOWS_SIGNING_ARTIFACT_CONFIGURATION_SLUG || 'initial' }} steps: - uses: actions/checkout@v6 with: @@ -29,7 +33,7 @@ jobs: - name: Setup binfmt with QEMU run: | sudo apt update - sudo apt install qemu-system binfmt-support qemu-user-static + sudo apt install qemu-system binfmt-support qemu-user-static osslsigncode update-binfmts --display - name: Setup ldid @@ -49,6 +53,65 @@ jobs: bun run windows-x64 bun run windows-arm64 + - name: Upload unsigned Windows binaries + id: upload-windows-unsigned + uses: actions/upload-artifact@v4 + with: + name: windows-unsigned + path: | + build/appwrite-cli-win-x64.exe + build/appwrite-cli-win-arm64.exe + + - name: Submit Windows binaries for signing + uses: signpath/github-action-submit-signing-request@b9d91eadd323de506c0c81cf0c7fe7438f3360fd # v2 + with: + api-token: ${{ secrets.WINDOWS_SIGNING_API_TOKEN }} + organization-id: ${{ vars.WINDOWS_SIGNING_ORGANIZATION_ID }} + project-slug: ${{ env.WINDOWS_SIGNING_PROJECT_SLUG }} + signing-policy-slug: ${{ env.WINDOWS_SIGNING_POLICY_SLUG }} + artifact-configuration-slug: ${{ env.WINDOWS_SIGNING_ARTIFACT_CONFIGURATION_SLUG }} + github-artifact-id: ${{ steps.upload-windows-unsigned.outputs.artifact-id }} + wait-for-completion: true + output-artifact-directory: build-signed + parameters: | + version: ${{ github.event.release.tag_name }} + + - name: Replace unsigned Windows binaries + run: | + set -euo pipefail + + signed_x64="$(find build-signed -type f -name 'appwrite-cli-win-x64.exe' -print -quit)" + signed_arm64="$(find build-signed -type f -name 'appwrite-cli-win-arm64.exe' -print -quit)" + + if [ -z "$signed_x64" ] || [ -z "$signed_arm64" ]; then + echo "Signed Windows binaries were not found in build-signed" + find build-signed -type f -print + exit 1 + fi + + cp "$signed_x64" build/appwrite-cli-win-x64.exe + cp "$signed_arm64" build/appwrite-cli-win-arm64.exe + + - name: Verify Windows signatures + run: | + set -euo pipefail + + verify_signature() { + local file="$1" + local output + + output="$(osslsigncode verify -in "$file" 2>&1)" + echo "$output" + + if ! grep -Fq "Succeeded" <<< "$output"; then + echo "$file signature verification failed" + exit 1 + fi + } + + verify_signature build/appwrite-cli-win-x64.exe + verify_signature build/appwrite-cli-win-arm64.exe + - name: Setup Node.js uses: actions/setup-node@v6 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c4e311f..d59e1916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,18 @@ # Change Log -## 20.2.0 - -* Added: Introduced `bigint` create/update APIs for legacy Databases attributes -* Added: Introduced `bigint` create/update APIs for `TablesDB` columns +## 21.0.0 + +* Breaking: Renamed `project update-canonical-emails`, `update-disposable-emails`, and `update-free-emails` to `update-deny-canonical-email-policy`, `update-deny-disposable-email-policy`, and `update-deny-free-email-policy` +* Breaking: Renamed `proxy update-rule-verification` to `proxy update-rule-status` +* Breaking: Renamed `--provider` to `--provider-id` on `project get-o-auth-2-provider` +* Breaking: Made `--variable-id` required on `functions create-variable` and `sites create-variable` +* Added: Introduced `bigint` create/update commands for legacy Databases attributes +* Added: Introduced `bigint` create/update commands for `TablesDB` columns +* Added: Added `--on-duplicate` flag on `tablesdb upsert-row`, `create-rows`, and `upsert-rows` +* Added: Added `--limit` flag on `vcs list-repository-branches` +* Added: Code-signed Windows release binaries (`appwrite-cli-win-x64.exe` and `appwrite-cli-win-arm64.exe`) via SignPath * Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` +* Updated: Changed default `--duration` on `project create-ephemeral-key` from `1` to `600` seconds ## 20.1.0 diff --git a/README.md b/README.md index 5c0f25ff..f7ba8c51 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using ```sh $ appwrite -v -20.2.0 +21.0.0 ``` ### Install using prebuilt binaries @@ -83,7 +83,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc Once the installation completes, you can verify your install using ``` $ appwrite -v -20.2.0 +21.0.0 ``` ## Getting Started diff --git a/bun.lock b/bun.lock index bd86069f..de17313b 100644 --- a/bun.lock +++ b/bun.lock @@ -5,7 +5,7 @@ "": { "name": "appwrite-cli", "dependencies": { - "@appwrite.io/console": "12.0.0", + "@appwrite.io/console": "12.1.0", "chalk": "4.1.2", "chokidar": "^3.6.0", "cli-progress": "^3.12.0", @@ -51,7 +51,7 @@ "tmp": "0.2.5", }, "packages": { - "@appwrite.io/console": ["@appwrite.io/console@12.0.0", "", { "dependencies": { "json-bigint": "1.0.0" } }, "sha512-lvB4z53DvUh6zPRZP7F2nbhdu5WbdqA+cJO6aCqSjZ9egqETOKOrMl6M7UtmPO6TkxM2CGsDVNf5pYDECletqg=="], + "@appwrite.io/console": ["@appwrite.io/console@12.1.0", "", { "dependencies": { "json-bigint": "1.0.0" } }, "sha512-pfI4UYCxEo8sGfub6UDDsQZxBu3b38x4d+SIQsZifRvKqCW+F7WRStxSQie6phw5dQaw/5SyEMEGhzURtj2MfQ=="], "@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], @@ -273,25 +273,25 @@ "@types/through": ["@types/through@0.0.33", "", { "dependencies": { "@types/node": "*" } }, "sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ=="], - "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.59.1", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.59.1", "@typescript-eslint/type-utils": "8.59.1", "@typescript-eslint/utils": "8.59.1", "@typescript-eslint/visitor-keys": "8.59.1", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.59.1", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-BOziFIfE+6osHO9FoJG4zjoHUcvI7fTNBSpdAwrNH0/TLvzjsk2oo8XSSOT2HhqUyhZPfHv4UOffoJ9oEEQ7Ag=="], + "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.59.2", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.59.2", "@typescript-eslint/type-utils": "8.59.2", "@typescript-eslint/utils": "8.59.2", "@typescript-eslint/visitor-keys": "8.59.2", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.59.2", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-j/bwmkBvHUtPNxzuWe5z6BEk3q54YRyGlBXkSsmfoih7zNrBvl5A9A98anlp/7JbyZcWIJ8KXo/3Tq/DjFLtuQ=="], - "@typescript-eslint/parser": ["@typescript-eslint/parser@8.59.1", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.59.1", "@typescript-eslint/types": "8.59.1", "@typescript-eslint/typescript-estree": "8.59.1", "@typescript-eslint/visitor-keys": "8.59.1", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-HDQH9O/47Dxi1ceDhBXdaldtf/WV9yRYMjbjCuNk3qnaTD564qwv61Y7+gTxwxRKzSrgO5uhtw584igXVuuZkA=="], + "@typescript-eslint/parser": ["@typescript-eslint/parser@8.59.2", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.59.2", "@typescript-eslint/types": "8.59.2", "@typescript-eslint/typescript-estree": "8.59.2", "@typescript-eslint/visitor-keys": "8.59.2", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-plR3pp6D+SSUn1HM7xvSkx12/DhoHInI2YF35KAcVFNZvlC0gtrWqx7Qq1oH2Ssgi0vlFRCTbP+DZc7B9+TtsQ=="], - "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.59.1", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.59.1", "@typescript-eslint/types": "^8.59.1", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-+MuHQlHiEr00Of/IQbE/MmEoi44znZHbR/Pz7Opq4HryUOlRi+/44dro9Ycy8Fyo+/024IWtw8m4JUMCGTYxDg=="], + "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.59.2", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.59.2", "@typescript-eslint/types": "^8.59.2", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-+2hqvEkeyf/0FBor67duF0Ll7Ot8jyKzDQOSrxazF/danillRq2DwR9dLptsXpoZQqxE1UisSmoZewrlPas9Vw=="], - "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.59.1", "", { "dependencies": { "@typescript-eslint/types": "8.59.1", "@typescript-eslint/visitor-keys": "8.59.1" } }, "sha512-LwuHQI4pDOYVKvmH2dkaJo6YZCSgouVgnS/z7yBPKBMvgtBvyLqiLy9Z6b7+m/TRcX1NFYUqZetI5Y+aT4GEfg=="], + "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.59.2", "", { "dependencies": { "@typescript-eslint/types": "8.59.2", "@typescript-eslint/visitor-keys": "8.59.2" } }, "sha512-JzfyEpEtOU89CcFSwyNS3mu4MLvLSXqnmX05+aKBDM+TdR5jzcGOEBwxwGNxrEQ7p/z6kK2WyioCGBf2zZBnvg=="], - "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.59.1", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-/0nEyPbX7gRsk0Uwfe4ALwwgxuA66d/l2mhRDNlAvaj4U3juhUtJNq0DsY8M2AYwwb9rEq2hrC3IcIcEt++iJA=="], + "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.59.2", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-BKK4alN7oi4C/zv4VqHQ+uRU+lTa6JGIZ7s1juw7b3RHo9OfKB+bKX3u0iVZetdsUCBBkSbdWbarJbmN0fTeSw=="], - "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.59.1", "", { "dependencies": { "@typescript-eslint/types": "8.59.1", "@typescript-eslint/typescript-estree": "8.59.1", "@typescript-eslint/utils": "8.59.1", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-klWPBR2ciQHS3f++ug/mVnWKPjBUo7icEL3FAO1lhAR1Z1i5NQYZ1EannMSRYcq5qCv5wNALlXr6fksRHyYl7w=="], + "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.59.2", "", { "dependencies": { "@typescript-eslint/types": "8.59.2", "@typescript-eslint/typescript-estree": "8.59.2", "@typescript-eslint/utils": "8.59.2", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-nhqaj1nmTdVVl/BP5omXNRGO38jn5iosis2vbdmupF2txCf8ylWT8lx+JlvMYYVqzGVKtjojUFoQ3JRWK+mfzQ=="], - "@typescript-eslint/types": ["@typescript-eslint/types@8.59.1", "", {}, "sha512-ZDCjgccSdYPw5Bxh+my4Z0lJU96ZDN7jbBzvmEn0FZx3RtU1C7VWl6NbDx94bwY3V5YsgwRzJPOgeY2Q/nLG8A=="], + "@typescript-eslint/types": ["@typescript-eslint/types@8.59.2", "", {}, "sha512-e82GVOE8Ps3E++Egvb6Y3Dw0S10u8NkQ9KXmtRhCWJJ8kDhOJTvtMAWnFL16kB1583goCWXsr0NieKCZMs2/0Q=="], - "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.59.1", "", { "dependencies": { "@typescript-eslint/project-service": "8.59.1", "@typescript-eslint/tsconfig-utils": "8.59.1", "@typescript-eslint/types": "8.59.1", "@typescript-eslint/visitor-keys": "8.59.1", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-OUd+vJS05sSkOip+BkZ/2NS8RMxrAAJemsC6vU3kmfLyeaJT0TftHkV9mcx2107MmsBVXXexhVu4F0TZXyMl4g=="], + "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.59.2", "", { "dependencies": { "@typescript-eslint/project-service": "8.59.2", "@typescript-eslint/tsconfig-utils": "8.59.2", "@typescript-eslint/types": "8.59.2", "@typescript-eslint/visitor-keys": "8.59.2", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "sha512-o0XPGNwcWw+FIwStOWn+BwBuEmL6QXP0rsvAFg7ET1dey1Nr6Wb1ac8p5HEsK0ygO/6mUxlk+YWQD9xcb/nnXg=="], - "@typescript-eslint/utils": ["@typescript-eslint/utils@8.59.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.59.1", "@typescript-eslint/types": "8.59.1", "@typescript-eslint/typescript-estree": "8.59.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-3pIeoXhCeYH9FSCBI8P3iNwJlGuzPlYKkTlen2O9T1DSeeg8UG8jstq6BLk+Mda0qup7mgk4z4XL4OzRaxZ8LA=="], + "@typescript-eslint/utils": ["@typescript-eslint/utils@8.59.2", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.59.2", "@typescript-eslint/types": "8.59.2", "@typescript-eslint/typescript-estree": "8.59.2" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-Juw3EinkXqjaffxz6roowvV7GZT/kET5vSKKZT6upl5TXdWkLkYmNPXwDDL2Vkt2DPn0nODIS4egC/0AGxKo/Q=="], - "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.59.1", "", { "dependencies": { "@typescript-eslint/types": "8.59.1", "eslint-visitor-keys": "^5.0.0" } }, "sha512-LdDNl6C5iJExcM0Yh0PwAIBb9PrSiCsWamF/JyEZawm3kFDnRoaq3LGE4bpyRao/fWeGKKyw7icx0YxrLFC5Cg=="], + "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.59.2", "", { "dependencies": { "@typescript-eslint/types": "8.59.2", "eslint-visitor-keys": "^5.0.0" } }, "sha512-NwjLUnGy8/Zfx23fl50tRC8rYaYnM52xNRYFAXvmiil9yh1+K6aRVQMnzW6gQB/1DLgWt977lYQn7C+wtgXZiA=="], "@xmldom/xmldom": ["@xmldom/xmldom@0.9.10", "", {}, "sha512-A9gOqLdi6cV4ibazAjcQufGj0B1y/vDqYrcuP6d/6x8P27gRS8643Dj9o1dEKtB6O7fwxb2FgBmJS2mX7gpvdw=="], @@ -341,7 +341,7 @@ "bare-stream": ["bare-stream@2.13.1", "", { "dependencies": { "streamx": "^2.25.0", "teex": "^1.0.1" }, "peerDependencies": { "bare-abort-controller": "*", "bare-buffer": "*", "bare-events": "*" }, "optionalPeers": ["bare-abort-controller", "bare-buffer"] }, "sha512-Vp0cnjYyrEC4whYTymQ+YZi6pBpfiICZO3cfRG8sy67ZNWe951urv1x4eW1BKNngw3U+3fPYb5JQvHbCtxH7Ow=="], - "bare-url": ["bare-url@2.4.2", "", { "dependencies": { "bare-path": "^3.0.0" } }, "sha512-/9a2j4ac6ckpmAHvod/ob7x439OAHst/drc2Clnq+reRYd/ovddwcF4LfoxHyNk5AuGBnPg+HqFjmE/Zpq6v0A=="], + "bare-url": ["bare-url@2.4.3", "", { "dependencies": { "bare-path": "^3.0.0" } }, "sha512-Kccpc7ACfXaxfeInfqKcZtW4pT5YBn1mesc4sCsun6sRwtbJ4h+sNOaksUpYEJUKfN65YWC6Bw2OJEFiKxq8nQ=="], "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], @@ -567,7 +567,7 @@ "is-binary-path": ["is-binary-path@2.1.0", "", { "dependencies": { "binary-extensions": "^2.0.0" } }, "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw=="], - "is-core-module": ["is-core-module@2.16.1", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="], + "is-core-module": ["is-core-module@2.16.2", "", { "dependencies": { "hasown": "^2.0.3" } }, "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA=="], "is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="], @@ -665,7 +665,7 @@ "neo-async": ["neo-async@2.6.2", "", {}, "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="], - "node-abi": ["node-abi@3.90.0", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-pZNQT7UnYlMwMBy5N1lV5X/YLTbZM5ncytN3xL7CHEzhDN8uVe0u55yaPUJICIJjaCW8NrM5BFdqr7HLweStNA=="], + "node-abi": ["node-abi@3.91.0", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-B+S7X/GS3Un6wMICtnsNjQD7oSpVBQrZftHE6GZ1Fe9/k3XOOoqbM5DZZ0GO4x3YiSCQfrM28yj1ppplwgIsfg=="], "node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="], @@ -813,7 +813,7 @@ "tail": ["tail@2.2.6", "", {}, "sha512-IQ6G4wK/t8VBauYiGPLx+d3fA5XjSVagjWV5SIYzvEvglbQjwEcukeYI68JOPpdydjxhZ9sIgzRlSmwSpphHyw=="], - "tar": ["tar@7.5.13", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-tOG/7GyXpFevhXVh8jOPJrmtRpOTsYqUIkVdVooZYJS/z8WhfQUX8RJILmeuJNinGAMSu1veBr4asSHFt5/hng=="], + "tar": ["tar@7.5.14", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-/7sHKgQO3JLP9ESlwTYUUftHUadOURUqq23xs1vjcnp8Vss6k0wCfzulyEtk5g91pjvnuriimGlyG7k6msrzRw=="], "tar-fs": ["tar-fs@3.1.2", "", { "dependencies": { "pump": "^3.0.0", "tar-stream": "^3.1.5" }, "optionalDependencies": { "bare-fs": "^4.0.1", "bare-path": "^3.0.0" } }, "sha512-QGxxTxxyleAdyM3kpFs14ymbYmNFrfY+pHj7Z8FgtbZ7w2//VAgLMac7sT6nRpIHjppXO2AwwEOg0bPFVRcmXw=="], @@ -857,7 +857,7 @@ "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], - "typescript-eslint": ["typescript-eslint@8.59.1", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.59.1", "@typescript-eslint/parser": "8.59.1", "@typescript-eslint/typescript-estree": "8.59.1", "@typescript-eslint/utils": "8.59.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-xqDcFVBmlrltH64lklOVp1wYxgJr6LVdg3NamBgH2OOQDLFdTKfIZXF5PfghrnXQKXZGTQs8tr1vL7fJvq8CTQ=="], + "typescript-eslint": ["typescript-eslint@8.59.2", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.59.2", "@typescript-eslint/parser": "8.59.2", "@typescript-eslint/typescript-estree": "8.59.2", "@typescript-eslint/utils": "8.59.2" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "sha512-pJw051uomb3ZeCzGTpRb8RbEqB5Y4WWet8gl/GcTlU35BSx0PVdZ86/bqkQCyKKuraVQEK7r6kBHQXF+fBhkoQ=="], "uglify-js": ["uglify-js@3.19.3", "", { "bin": { "uglifyjs": "bin/uglifyjs" } }, "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ=="], diff --git a/docs/examples/project/update-canonical-emails.md b/docs/examples/project/update-canonical-emails.md deleted file mode 100644 index 4839b77e..00000000 --- a/docs/examples/project/update-canonical-emails.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite project update-canonical-emails \ - --enabled false -``` diff --git a/docs/examples/project/update-deny-canonical-email-policy.md b/docs/examples/project/update-deny-canonical-email-policy.md new file mode 100644 index 00000000..a70582e4 --- /dev/null +++ b/docs/examples/project/update-deny-canonical-email-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-deny-canonical-email-policy \ + --enabled false +``` diff --git a/docs/examples/project/update-deny-disposable-email-policy.md b/docs/examples/project/update-deny-disposable-email-policy.md new file mode 100644 index 00000000..1764d04d --- /dev/null +++ b/docs/examples/project/update-deny-disposable-email-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-deny-disposable-email-policy \ + --enabled false +``` diff --git a/docs/examples/project/update-deny-free-email-policy.md b/docs/examples/project/update-deny-free-email-policy.md new file mode 100644 index 00000000..c12ac126 --- /dev/null +++ b/docs/examples/project/update-deny-free-email-policy.md @@ -0,0 +1,4 @@ +```bash +appwrite project update-deny-free-email-policy \ + --enabled false +``` diff --git a/docs/examples/project/update-disposable-emails.md b/docs/examples/project/update-disposable-emails.md deleted file mode 100644 index b6b3cae4..00000000 --- a/docs/examples/project/update-disposable-emails.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite project update-disposable-emails \ - --enabled false -``` diff --git a/docs/examples/project/update-free-emails.md b/docs/examples/project/update-free-emails.md deleted file mode 100644 index 0c386adf..00000000 --- a/docs/examples/project/update-free-emails.md +++ /dev/null @@ -1,4 +0,0 @@ -```bash -appwrite project update-free-emails \ - --enabled false -``` diff --git a/docs/examples/vcs/list-repository-branches.md b/docs/examples/vcs/list-repository-branches.md index cfa8d0fa..cb495368 100644 --- a/docs/examples/vcs/list-repository-branches.md +++ b/docs/examples/vcs/list-repository-branches.md @@ -1,5 +1,6 @@ ```bash appwrite vcs list-repository-branches \ --installation-id \ - --provider-repository-id + --provider-repository-id \ + --limit 25 ``` diff --git a/install.ps1 b/install.ps1 index 54ea2a90..748f0c1e 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,8 @@ # You can use "View source" of this page to see the full script. # REPO -$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/21.0.0/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/21.0.0/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 6bd9885a..ce2b248c 100644 --- a/install.sh +++ b/install.sh @@ -120,7 +120,7 @@ verifyMacOSCodeSignature() { downloadBinary() { echo "[2/5] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="20.2.0" + GITHUB_LATEST_VERSION="21.0.0" GITHUB_FILE="appwrite-cli-${OS}-${ARCH}" GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE" diff --git a/lib/commands/init.ts b/lib/commands/init.ts index 43231065..0d7c1989 100644 --- a/lib/commands/init.ts +++ b/lib/commands/init.ts @@ -136,9 +136,7 @@ const printInitProjectNextSteps = (steps: InitProjectNextStep[]): void => { for (const step of steps) { const spacing = " ".repeat(longestCommand - step.command.length + 4); - console.log( - ` ${chalk.cyan(step.command)}${spacing}${step.description}`, - ); + console.log(` ${chalk.cyan(step.command)}${spacing}${step.description}`); } }; diff --git a/lib/commands/push.ts b/lib/commands/push.ts index c2aea61e..c1415f92 100644 --- a/lib/commands/push.ts +++ b/lib/commands/push.ts @@ -153,9 +153,7 @@ function getDeploymentProgressSignature( const status = typeof deployment["status"] === "string" ? deployment["status"] : ""; const buildLogs = - typeof deployment["buildLogs"] === "string" - ? deployment["buildLogs"] - : ""; + typeof deployment["buildLogs"] === "string" ? deployment["buildLogs"] : ""; const updatedAt = typeof deployment["$updatedAt"] === "string" ? deployment["$updatedAt"] @@ -173,9 +171,7 @@ function getDeploymentProgressSignature( }); } -function createDeploymentTimeoutTracker( - deployment: Record, -): { +function createDeploymentTimeoutTracker(deployment: Record): { touch: (deployment: Record) => void; hasTimedOut: () => boolean; } { diff --git a/lib/commands/services/project.ts b/lib/commands/services/project.ts index 74d79a61..1e6336f7 100644 --- a/lib/commands/services/project.ts +++ b/lib/commands/services/project.ts @@ -54,42 +54,6 @@ const projectUpdateAuthMethodCommand = project ); -const projectUpdateCanonicalEmailsCommand = project - .command(`update-canonical-emails`) - .description(`Configure if canonical emails (alias subaddresses and emails with suffixes) are allowed during new users sign-ups in this project.`) - .requiredOption(`--enabled `, `Set whether or not to require canonical email addresses during signup and email updates.`, parseBool) - .action( - actionRunner( - async ({ enabled }) => - parse(await (await getProjectClient()).updateCanonicalEmails(enabled)), - ), - ); - - -const projectUpdateDisposableEmailsCommand = project - .command(`update-disposable-emails`) - .description(`Configure if disposable emails (emails of known temporary domains) are allowed during new users sign-ups in this project.`) - .requiredOption(`--enabled `, `Set whether or not to block disposable email addresses during signup and email updates.`, parseBool) - .action( - actionRunner( - async ({ enabled }) => - parse(await (await getProjectClient()).updateDisposableEmails(enabled)), - ), - ); - - -const projectUpdateFreeEmailsCommand = project - .command(`update-free-emails`) - .description(`Configure if free emails (non-commercial and not a custom domain) are allowed during new users sign-ups in this project.`) - .requiredOption(`--enabled `, `Set whether or not to block free email addresses during signup and email updates.`, parseBool) - .action( - actionRunner( - async ({ enabled }) => - parse(await (await getProjectClient()).updateFreeEmails(enabled)), - ), - ); - - const projectListKeysCommand = project .command(`list-keys`) .description(`Get a list of all API keys from the current project.`) @@ -292,7 +256,7 @@ const projectUpdateOAuth2AmazonCommand = project .command(`update-o-auth-2-amazon`) .description(`Update the project OAuth2 Amazon configuration.`) .option(`--client-id `, `'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2`) - .option(`--client-secret `, `'Client Secret' of Amazon OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -332,7 +296,7 @@ const projectUpdateOAuth2Auth0Command = project .command(`update-o-auth-2-auth-0`) .description(`Update the project OAuth2 Auth0 configuration.`) .option(`--client-id `, `'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq`) - .option(`--client-secret `, `'Client Secret' of Auth0 OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF`) .option(`--endpoint `, `Domain of Auth0 instance. For example: example.us.auth0.com`) .option( `--enabled [value]`, @@ -352,7 +316,7 @@ const projectUpdateOAuth2AuthentikCommand = project .command(`update-o-auth-2-authentik`) .description(`Update the project OAuth2 Authentik configuration.`) .option(`--client-id `, `'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv`) - .option(`--client-secret `, `'Client Secret' of Authentik OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK`) .option(`--endpoint `, `Domain of Authentik instance. For example: example.authentik.com`) .option( `--enabled [value]`, @@ -372,7 +336,7 @@ const projectUpdateOAuth2AutodeskCommand = project .command(`update-o-auth-2-autodesk`) .description(`Update the project OAuth2 Autodesk configuration.`) .option(`--client-id `, `'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7`) - .option(`--client-secret `, `'Client Secret' of Autodesk OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -391,7 +355,7 @@ const projectUpdateOAuth2BitbucketCommand = project .command(`update-o-auth-2-bitbucket`) .description(`Update the project OAuth2 Bitbucket configuration.`) .option(`--key `, `'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc`) - .option(`--secret `, `'Secret' of Bitbucket OAuth2 app. For example: `) + .option(`--secret `, `'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -410,7 +374,7 @@ const projectUpdateOAuth2BitlyCommand = project .command(`update-o-auth-2-bitly`) .description(`Update the project OAuth2 Bitly configuration.`) .option(`--client-id `, `'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b`) - .option(`--client-secret `, `'Client Secret' of Bitly OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -429,7 +393,7 @@ const projectUpdateOAuth2BoxCommand = project .command(`update-o-auth-2-box`) .description(`Update the project OAuth2 Box configuration.`) .option(`--client-id `, `'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y`) - .option(`--client-secret `, `'Client Secret' of Box OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -448,7 +412,7 @@ const projectUpdateOAuth2DailymotionCommand = project .command(`update-o-auth-2-dailymotion`) .description(`Update the project OAuth2 Dailymotion configuration.`) .option(`--api-key `, `'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f`) - .option(`--api-secret `, `'API Secret' of Dailymotion OAuth2 app. For example: `) + .option(`--api-secret `, `'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -467,7 +431,7 @@ const projectUpdateOAuth2DiscordCommand = project .command(`update-o-auth-2-discord`) .description(`Update the project OAuth2 Discord configuration.`) .option(`--client-id `, `'Client ID' of Discord OAuth2 app. For example: 950722000000343754`) - .option(`--client-secret `, `'Client Secret' of Discord OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -486,7 +450,7 @@ const projectUpdateOAuth2DisqusCommand = project .command(`update-o-auth-2-disqus`) .description(`Update the project OAuth2 Disqus configuration.`) .option(`--public-key `, `'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX`) - .option(`--secret-key `, `'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: `) + .option(`--secret-key `, `'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -505,7 +469,7 @@ const projectUpdateOAuth2DropboxCommand = project .command(`update-o-auth-2-dropbox`) .description(`Update the project OAuth2 Dropbox configuration.`) .option(`--app-key `, `'App Key' of Dropbox OAuth2 app. For example: jl000000000009t`) - .option(`--app-secret `, `'App Secret' of Dropbox OAuth2 app. For example: `) + .option(`--app-secret `, `'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -524,7 +488,7 @@ const projectUpdateOAuth2EtsyCommand = project .command(`update-o-auth-2-etsy`) .description(`Update the project OAuth2 Etsy configuration.`) .option(`--key-string `, `'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2`) - .option(`--shared-secret `, `'Shared Secret' of Etsy OAuth2 app. For example: `) + .option(`--shared-secret `, `'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -543,7 +507,7 @@ const projectUpdateOAuth2FacebookCommand = project .command(`update-o-auth-2-facebook`) .description(`Update the project OAuth2 Facebook configuration.`) .option(`--app-id `, `'App ID' of Facebook OAuth2 app. For example: 260600000007694`) - .option(`--app-secret `, `'App Secret' of Facebook OAuth2 app. For example: `) + .option(`--app-secret `, `'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -562,7 +526,7 @@ const projectUpdateOAuth2FigmaCommand = project .command(`update-o-auth-2-figma`) .description(`Update the project OAuth2 Figma configuration.`) .option(`--client-id `, `'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40`) - .option(`--client-secret `, `'Client Secret' of Figma OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -581,7 +545,7 @@ const projectUpdateOAuth2FusionAuthCommand = project .command(`update-o-auth-2-fusion-auth`) .description(`Update the project OAuth2 FusionAuth configuration.`) .option(`--client-id `, `'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097`) - .option(`--client-secret `, `'Client Secret' of FusionAuth OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc`) .option(`--endpoint `, `Domain of FusionAuth instance. For example: example.fusionauth.io`) .option( `--enabled [value]`, @@ -601,7 +565,7 @@ const projectUpdateOAuth2GitHubCommand = project .command(`update-o-auth-2-git-hub`) .description(`Update the project OAuth2 GitHub configuration.`) .option(`--client-id `, `'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006`) - .option(`--client-secret `, `'Client Secret' of GitHub OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -620,7 +584,7 @@ const projectUpdateOAuth2GitlabCommand = project .command(`update-o-auth-2-gitlab`) .description(`Update the project OAuth2 Gitlab configuration.`) .option(`--application-id `, `'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252`) - .option(`--secret `, `'Secret' of Gitlab OAuth2 app. For example: `) + .option(`--secret `, `'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38`) .option(`--endpoint `, `Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com`) .option( `--enabled [value]`, @@ -640,7 +604,7 @@ const projectUpdateOAuth2GoogleCommand = project .command(`update-o-auth-2-google`) .description(`Update the project OAuth2 Google configuration.`) .option(`--client-id `, `'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com`) - .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -659,7 +623,7 @@ const projectUpdateOAuth2KeycloakCommand = project .command(`update-o-auth-2-keycloak`) .description(`Update the project OAuth2 Keycloak configuration.`) .option(`--client-id `, `'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app`) - .option(`--client-secret `, `'Client Secret' of Keycloak OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO`) .option(`--endpoint `, `Domain of Keycloak instance. For example: keycloak.example.com`) .option(`--realm-name `, `Keycloak realm name. For example: appwrite-realm`) .option( @@ -680,7 +644,7 @@ const projectUpdateOAuth2KickCommand = project .command(`update-o-auth-2-kick`) .description(`Update the project OAuth2 Kick configuration.`) .option(`--client-id `, `'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32`) - .option(`--client-secret `, `'Client Secret' of Kick OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -699,7 +663,7 @@ const projectUpdateOAuth2LinkedinCommand = project .command(`update-o-auth-2-linkedin`) .description(`Update the project OAuth2 Linkedin configuration.`) .option(`--client-id `, `'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv`) - .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: `) + .option(`--primary-client-secret `, `'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw==`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -718,7 +682,7 @@ const projectUpdateOAuth2MicrosoftCommand = project .command(`update-o-auth-2-microsoft`) .description(`Update the project OAuth2 Microsoft configuration.`) .option(`--application-id `, `'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444`) - .option(`--application-secret `, `'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: `) + .option(`--application-secret `, `'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u`) .option(`--tenant `, `Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common`) .option( `--enabled [value]`, @@ -738,7 +702,7 @@ const projectUpdateOAuth2NotionCommand = project .command(`update-o-auth-2-notion`) .description(`Update the project OAuth2 Notion configuration.`) .option(`--oauth-client-id `, `'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3`) - .option(`--oauth-client-secret `, `'OAuth Client Secret' of Notion OAuth2 app. For example: `) + .option(`--oauth-client-secret `, `'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -757,7 +721,7 @@ const projectUpdateOAuth2OidcCommand = project .command(`update-o-auth-2-oidc`) .description(`Update the project OAuth2 Oidc configuration.`) .option(`--client-id `, `'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG`) - .option(`--client-secret `, `'Client Secret' of Oidc OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV`) .option(`--well-known-url `, `OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration`) .option(`--authorization-url `, `OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize`) .option(`--token-url `, `OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token`) @@ -780,7 +744,7 @@ const projectUpdateOAuth2OktaCommand = project .command(`update-o-auth-2-okta`) .description(`Update the project OAuth2 Okta configuration.`) .option(`--client-id `, `'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698`) - .option(`--client-secret `, `'Client Secret' of Okta OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV`) .option(`--domain `, `Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/`) .option(`--authorization-server-id `, `Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z`) .option( @@ -801,7 +765,7 @@ const projectUpdateOAuth2PaypalCommand = project .command(`update-o-auth-2-paypal`) .description(`Update the project OAuth2 Paypal configuration.`) .option(`--client-id `, `'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB`) - .option(`--secret-key `, `'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: `) + .option(`--secret-key `, `'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -820,7 +784,7 @@ const projectUpdateOAuth2PaypalSandboxCommand = project .command(`update-o-auth-2-paypal-sandbox`) .description(`Update the project OAuth2 PaypalSandbox configuration.`) .option(`--client-id `, `'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB`) - .option(`--secret-key `, `'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: `) + .option(`--secret-key `, `'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -839,7 +803,7 @@ const projectUpdateOAuth2PodioCommand = project .command(`update-o-auth-2-podio`) .description(`Update the project OAuth2 Podio configuration.`) .option(`--client-id `, `'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app`) - .option(`--client-secret `, `'Client Secret' of Podio OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -858,7 +822,7 @@ const projectUpdateOAuth2SalesforceCommand = project .command(`update-o-auth-2-salesforce`) .description(`Update the project OAuth2 Salesforce configuration.`) .option(`--customer-key `, `'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq`) - .option(`--customer-secret `, `'Consumer Secret' of Salesforce OAuth2 app. For example: `) + .option(`--customer-secret `, `'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -877,7 +841,7 @@ const projectUpdateOAuth2SlackCommand = project .command(`update-o-auth-2-slack`) .description(`Update the project OAuth2 Slack configuration.`) .option(`--client-id `, `'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023`) - .option(`--client-secret `, `'Client Secret' of Slack OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -896,7 +860,7 @@ const projectUpdateOAuth2SpotifyCommand = project .command(`update-o-auth-2-spotify`) .description(`Update the project OAuth2 Spotify configuration.`) .option(`--client-id `, `'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace`) - .option(`--client-secret `, `'Client Secret' of Spotify OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -915,7 +879,7 @@ const projectUpdateOAuth2StripeCommand = project .command(`update-o-auth-2-stripe`) .description(`Update the project OAuth2 Stripe configuration.`) .option(`--client-id `, `'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR`) - .option(`--api-secret-key `, `'API Secret Key' of Stripe OAuth2 app. For example: `) + .option(`--api-secret-key `, `'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -934,7 +898,7 @@ const projectUpdateOAuth2TradeshiftCommand = project .command(`update-o-auth-2-tradeshift`) .description(`Update the project OAuth2 Tradeshift configuration.`) .option(`--oauth-2-client-id `, `'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app`) - .option(`--oauth-2-client-secret `, `'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: `) + .option(`--oauth-2-client-secret `, `'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -953,7 +917,7 @@ const projectUpdateOAuth2TradeshiftSandboxCommand = project .command(`update-o-auth-2-tradeshift-sandbox`) .description(`Update the project OAuth2 Tradeshift Sandbox configuration.`) .option(`--oauth-2-client-id `, `'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app`) - .option(`--oauth-2-client-secret `, `'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: `) + .option(`--oauth-2-client-secret `, `'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -972,7 +936,7 @@ const projectUpdateOAuth2TwitchCommand = project .command(`update-o-auth-2-twitch`) .description(`Update the project OAuth2 Twitch configuration.`) .option(`--client-id `, `'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p`) - .option(`--client-secret `, `'Client Secret' of Twitch OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -991,7 +955,7 @@ const projectUpdateOAuth2WordPressCommand = project .command(`update-o-auth-2-word-press`) .description(`Update the project OAuth2 WordPress configuration.`) .option(`--client-id `, `'Client ID' of WordPress OAuth2 app. For example: 130005`) - .option(`--client-secret `, `'Client Secret' of WordPress OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1010,7 +974,7 @@ const projectUpdateOAuth2XCommand = project .command(`update-o-auth-2x`) .description(`Update the project OAuth2 X configuration.`) .option(`--customer-key `, `'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT`) - .option(`--secret-key `, `'Secret Key' of X OAuth2 app. For example: `) + .option(`--secret-key `, `'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1029,7 +993,7 @@ const projectUpdateOAuth2YahooCommand = project .command(`update-o-auth-2-yahoo`) .description(`Update the project OAuth2 Yahoo configuration.`) .option(`--client-id `, `'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm`) - .option(`--client-secret `, `'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1048,7 +1012,7 @@ const projectUpdateOAuth2YandexCommand = project .command(`update-o-auth-2-yandex`) .description(`Update the project OAuth2 Yandex configuration.`) .option(`--client-id `, `'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c`) - .option(`--client-secret `, `'Client Secret' of Yandex OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1067,7 +1031,7 @@ const projectUpdateOAuth2ZohoCommand = project .command(`update-o-auth-2-zoho`) .description(`Update the project OAuth2 Zoho configuration.`) .option(`--client-id `, `'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B`) - .option(`--client-secret `, `'Client Secret' of Zoho OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1086,7 +1050,7 @@ const projectUpdateOAuth2ZoomCommand = project .command(`update-o-auth-2-zoom`) .description(`Update the project OAuth2 Zoom configuration.`) .option(`--client-id `, `'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ`) - .option(`--client-secret `, `'Client Secret' of Zoom OAuth2 app. For example: `) + .option(`--client-secret `, `'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON`) .option( `--enabled [value]`, `OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.`, @@ -1322,6 +1286,42 @@ const projectListPoliciesCommand = project ); +const projectUpdateDenyCanonicalEmailPolicyCommand = project + .command(`update-deny-canonical-email-policy`) + .description(`Configures if email aliases such as subaddresses and emails with suffixes are denied during new users sign-ups and email updates.`) + .requiredOption(`--enabled `, `Set whether or not to block email aliases during signup and email updates.`, parseBool) + .action( + actionRunner( + async ({ enabled }) => + parse(await (await getProjectClient()).updateDenyCanonicalEmailPolicy(enabled)), + ), + ); + + +const projectUpdateDenyDisposableEmailPolicyCommand = project + .command(`update-deny-disposable-email-policy`) + .description(`Configures if disposable emails from known temporary domains are denied during new users sign-ups and email updates.`) + .requiredOption(`--enabled `, `Set whether or not to block disposable email addresses during signup and email updates.`, parseBool) + .action( + actionRunner( + async ({ enabled }) => + parse(await (await getProjectClient()).updateDenyDisposableEmailPolicy(enabled)), + ), + ); + + +const projectUpdateDenyFreeEmailPolicyCommand = project + .command(`update-deny-free-email-policy`) + .description(`Configures if emails from free providers such as Gmail or Yahoo are denied during new users sign-ups and email updates.`) + .requiredOption(`--enabled `, `Set whether or not to block free email addresses during signup and email updates.`, parseBool) + .action( + actionRunner( + async ({ enabled }) => + parse(await (await getProjectClient()).updateDenyFreeEmailPolicy(enabled)), + ), + ); + + const projectUpdateMembershipPrivacyPolicyCommand = project .command(`update-membership-privacy-policy`) .description(`Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members..`) diff --git a/lib/commands/services/vcs.ts b/lib/commands/services/vcs.ts index de9c173d..8d87aaf6 100644 --- a/lib/commands/services/vcs.ts +++ b/lib/commands/services/vcs.ts @@ -97,11 +97,18 @@ const vcsListRepositoryBranchesCommand = vcs .requiredOption(`--installation-id `, `Installation Id`) .requiredOption(`--provider-repository-id `, `Repository Id`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) - .option(`--queries `, `Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore`) + .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --where, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag queries. Array of query strings generated using the Query class provided by the SDK. Learn more about queries (https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore`) + .option(`--where `, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field collectQueryValue(parseWhereQuery(value), previous)) + .option(`--sort-asc `, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--sort-desc `, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) + .option(`--limit `, `Maximum number of results to return.`, parseInteger) + .option(`--offset `, `Number of results to skip.`, parseInteger) + .option(`--cursor-after `, `Return results after this cursor ID.`) + .option(`--cursor-before `, `Return results before this cursor ID.`) .action( actionRunner( - async ({ installationId, providerRepositoryId, search, queries }) => - parse(await (await getVcsClient()).listRepositoryBranches(installationId, providerRepositoryId, search, queries)), + async ({ installationId, providerRepositoryId, search, queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => + parse(await (await getVcsClient()).listRepositoryBranches(installationId, providerRepositoryId, search, buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }))), ), ); diff --git a/lib/config.ts b/lib/config.ts index 4789c074..fb337bda 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -126,7 +126,10 @@ function ensureDirectoryForFile(filePath: string): void { } } -function assertValidIncludePath(resource: string, includePath: unknown): string { +function assertValidIncludePath( + resource: string, + includePath: unknown, +): string { if (typeof includePath !== "string" || includePath.trim() === "") { throw new Error(`Config include for '${resource}' must be a file path.`); } @@ -149,7 +152,9 @@ function assertValidIncludePath(resource: string, includePath: unknown): string } if (_path.isAbsolute(normalizedPath)) { - throw new Error(`Config include '${resource}' must be a relative file path.`); + throw new Error( + `Config include '${resource}' must be a relative file path.`, + ); } if (/^[a-z][a-z0-9+.-]*:/i.test(normalizedPath)) { @@ -163,7 +168,9 @@ function assertValidIncludePath(resource: string, includePath: unknown): string return normalizedPath; } -function getConfigIncludePaths(data: Record): ConfigIncludePaths { +function getConfigIncludePaths( + data: Record, +): ConfigIncludePaths { const includes = data.includes; if (includes === undefined) { return {}; @@ -200,7 +207,10 @@ function writeJsonFile(filePath: string, data: unknown): void { }); } -function resolveIncludePath(configFilePath: string, includePath: string): string { +function resolveIncludePath( + configFilePath: string, + includePath: string, +): string { return _path.resolve(_path.dirname(configFilePath), includePath); } @@ -274,10 +284,9 @@ export function getLocalConfigResourceDirname( return getLocalConfigResourceDirnames(filePath)[resource]; } -export function getLocalConfigResourceDirnames(filePath: string): Record< - "functions" | "sites", - string -> { +export function getLocalConfigResourceDirnames( + filePath: string, +): Record<"functions" | "sites", string> { const rootData = fs.existsSync(filePath) ? readJsonFile>(filePath) : {}; @@ -722,7 +731,10 @@ class Local extends Config { return _path.dirname(resolveIncludePath(this.path, includePath)); } - resolveResourcePath(resource: ConfigResourceKey, resourcePath: string): string { + resolveResourcePath( + resource: ConfigResourceKey, + resourcePath: string, + ): string { if (_path.isAbsolute(resourcePath)) { return resourcePath; } diff --git a/lib/constants.ts b/lib/constants.ts index 5302c744..6fa5730d 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,7 +1,7 @@ // SDK export const SDK_TITLE = 'Appwrite'; export const SDK_TITLE_LOWER = 'appwrite'; -export const SDK_VERSION = '20.2.0'; +export const SDK_VERSION = '21.0.0'; export const SDK_NAME = 'Command Line'; export const SDK_PLATFORM = 'console'; export const SDK_LANGUAGE = 'cli'; diff --git a/package-lock.json b/package-lock.json index 0aa42480..d4f784a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "appwrite-cli", - "version": "20.2.0", + "version": "21.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "appwrite-cli", - "version": "20.2.0", + "version": "21.0.0", "license": "BSD-3-Clause", "dependencies": { - "@appwrite.io/console": "12.0.0", + "@appwrite.io/console": "12.1.0", "chalk": "4.1.2", "chokidar": "^3.6.0", "cli-progress": "^3.12.0", @@ -52,9 +52,9 @@ } }, "node_modules/@appwrite.io/console": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-12.0.0.tgz", - "integrity": "sha512-lvB4z53DvUh6zPRZP7F2nbhdu5WbdqA+cJO6aCqSjZ9egqETOKOrMl6M7UtmPO6TkxM2CGsDVNf5pYDECletqg==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-12.1.0.tgz", + "integrity": "sha512-pfI4UYCxEo8sGfub6UDDsQZxBu3b38x4d+SIQsZifRvKqCW+F7WRStxSQie6phw5dQaw/5SyEMEGhzURtj2MfQ==", "license": "BSD-3-Clause", "dependencies": { "json-bigint": "1.0.0" @@ -2137,17 +2137,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.1.tgz", - "integrity": "sha512-BOziFIfE+6osHO9FoJG4zjoHUcvI7fTNBSpdAwrNH0/TLvzjsk2oo8XSSOT2HhqUyhZPfHv4UOffoJ9oEEQ7Ag==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.2.tgz", + "integrity": "sha512-j/bwmkBvHUtPNxzuWe5z6BEk3q54YRyGlBXkSsmfoih7zNrBvl5A9A98anlp/7JbyZcWIJ8KXo/3Tq/DjFLtuQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.59.1", - "@typescript-eslint/type-utils": "8.59.1", - "@typescript-eslint/utils": "8.59.1", - "@typescript-eslint/visitor-keys": "8.59.1", + "@typescript-eslint/scope-manager": "8.59.2", + "@typescript-eslint/type-utils": "8.59.2", + "@typescript-eslint/utils": "8.59.2", + "@typescript-eslint/visitor-keys": "8.59.2", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" @@ -2160,22 +2160,22 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.59.1", + "@typescript-eslint/parser": "^8.59.2", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.59.1.tgz", - "integrity": "sha512-HDQH9O/47Dxi1ceDhBXdaldtf/WV9yRYMjbjCuNk3qnaTD564qwv61Y7+gTxwxRKzSrgO5uhtw584igXVuuZkA==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.59.2.tgz", + "integrity": "sha512-plR3pp6D+SSUn1HM7xvSkx12/DhoHInI2YF35KAcVFNZvlC0gtrWqx7Qq1oH2Ssgi0vlFRCTbP+DZc7B9+TtsQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.59.1", - "@typescript-eslint/types": "8.59.1", - "@typescript-eslint/typescript-estree": "8.59.1", - "@typescript-eslint/visitor-keys": "8.59.1", + "@typescript-eslint/scope-manager": "8.59.2", + "@typescript-eslint/types": "8.59.2", + "@typescript-eslint/typescript-estree": "8.59.2", + "@typescript-eslint/visitor-keys": "8.59.2", "debug": "^4.4.3" }, "engines": { @@ -2191,14 +2191,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.1.tgz", - "integrity": "sha512-+MuHQlHiEr00Of/IQbE/MmEoi44znZHbR/Pz7Opq4HryUOlRi+/44dro9Ycy8Fyo+/024IWtw8m4JUMCGTYxDg==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.2.tgz", + "integrity": "sha512-+2hqvEkeyf/0FBor67duF0Ll7Ot8jyKzDQOSrxazF/danillRq2DwR9dLptsXpoZQqxE1UisSmoZewrlPas9Vw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.59.1", - "@typescript-eslint/types": "^8.59.1", + "@typescript-eslint/tsconfig-utils": "^8.59.2", + "@typescript-eslint/types": "^8.59.2", "debug": "^4.4.3" }, "engines": { @@ -2213,14 +2213,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.1.tgz", - "integrity": "sha512-LwuHQI4pDOYVKvmH2dkaJo6YZCSgouVgnS/z7yBPKBMvgtBvyLqiLy9Z6b7+m/TRcX1NFYUqZetI5Y+aT4GEfg==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.2.tgz", + "integrity": "sha512-JzfyEpEtOU89CcFSwyNS3mu4MLvLSXqnmX05+aKBDM+TdR5jzcGOEBwxwGNxrEQ7p/z6kK2WyioCGBf2zZBnvg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.59.1", - "@typescript-eslint/visitor-keys": "8.59.1" + "@typescript-eslint/types": "8.59.2", + "@typescript-eslint/visitor-keys": "8.59.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2231,9 +2231,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.1.tgz", - "integrity": "sha512-/0nEyPbX7gRsk0Uwfe4ALwwgxuA66d/l2mhRDNlAvaj4U3juhUtJNq0DsY8M2AYwwb9rEq2hrC3IcIcEt++iJA==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.2.tgz", + "integrity": "sha512-BKK4alN7oi4C/zv4VqHQ+uRU+lTa6JGIZ7s1juw7b3RHo9OfKB+bKX3u0iVZetdsUCBBkSbdWbarJbmN0fTeSw==", "dev": true, "license": "MIT", "engines": { @@ -2248,15 +2248,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.59.1.tgz", - "integrity": "sha512-klWPBR2ciQHS3f++ug/mVnWKPjBUo7icEL3FAO1lhAR1Z1i5NQYZ1EannMSRYcq5qCv5wNALlXr6fksRHyYl7w==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.59.2.tgz", + "integrity": "sha512-nhqaj1nmTdVVl/BP5omXNRGO38jn5iosis2vbdmupF2txCf8ylWT8lx+JlvMYYVqzGVKtjojUFoQ3JRWK+mfzQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.59.1", - "@typescript-eslint/typescript-estree": "8.59.1", - "@typescript-eslint/utils": "8.59.1", + "@typescript-eslint/types": "8.59.2", + "@typescript-eslint/typescript-estree": "8.59.2", + "@typescript-eslint/utils": "8.59.2", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, @@ -2273,9 +2273,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.1.tgz", - "integrity": "sha512-ZDCjgccSdYPw5Bxh+my4Z0lJU96ZDN7jbBzvmEn0FZx3RtU1C7VWl6NbDx94bwY3V5YsgwRzJPOgeY2Q/nLG8A==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.2.tgz", + "integrity": "sha512-e82GVOE8Ps3E++Egvb6Y3Dw0S10u8NkQ9KXmtRhCWJJ8kDhOJTvtMAWnFL16kB1583goCWXsr0NieKCZMs2/0Q==", "dev": true, "license": "MIT", "engines": { @@ -2287,16 +2287,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.1.tgz", - "integrity": "sha512-OUd+vJS05sSkOip+BkZ/2NS8RMxrAAJemsC6vU3kmfLyeaJT0TftHkV9mcx2107MmsBVXXexhVu4F0TZXyMl4g==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.2.tgz", + "integrity": "sha512-o0XPGNwcWw+FIwStOWn+BwBuEmL6QXP0rsvAFg7ET1dey1Nr6Wb1ac8p5HEsK0ygO/6mUxlk+YWQD9xcb/nnXg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.59.1", - "@typescript-eslint/tsconfig-utils": "8.59.1", - "@typescript-eslint/types": "8.59.1", - "@typescript-eslint/visitor-keys": "8.59.1", + "@typescript-eslint/project-service": "8.59.2", + "@typescript-eslint/tsconfig-utils": "8.59.2", + "@typescript-eslint/types": "8.59.2", + "@typescript-eslint/visitor-keys": "8.59.2", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", @@ -2315,16 +2315,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.1.tgz", - "integrity": "sha512-3pIeoXhCeYH9FSCBI8P3iNwJlGuzPlYKkTlen2O9T1DSeeg8UG8jstq6BLk+Mda0qup7mgk4z4XL4OzRaxZ8LA==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.2.tgz", + "integrity": "sha512-Juw3EinkXqjaffxz6roowvV7GZT/kET5vSKKZT6upl5TXdWkLkYmNPXwDDL2Vkt2DPn0nODIS4egC/0AGxKo/Q==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.59.1", - "@typescript-eslint/types": "8.59.1", - "@typescript-eslint/typescript-estree": "8.59.1" + "@typescript-eslint/scope-manager": "8.59.2", + "@typescript-eslint/types": "8.59.2", + "@typescript-eslint/typescript-estree": "8.59.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2339,13 +2339,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.1.tgz", - "integrity": "sha512-LdDNl6C5iJExcM0Yh0PwAIBb9PrSiCsWamF/JyEZawm3kFDnRoaq3LGE4bpyRao/fWeGKKyw7icx0YxrLFC5Cg==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.2.tgz", + "integrity": "sha512-NwjLUnGy8/Zfx23fl50tRC8rYaYnM52xNRYFAXvmiil9yh1+K6aRVQMnzW6gQB/1DLgWt977lYQn7C+wtgXZiA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.59.1", + "@typescript-eslint/types": "8.59.2", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -2710,9 +2710,9 @@ } }, "node_modules/bare-url": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.4.2.tgz", - "integrity": "sha512-/9a2j4ac6ckpmAHvod/ob7x439OAHst/drc2Clnq+reRYd/ovddwcF4LfoxHyNk5AuGBnPg+HqFjmE/Zpq6v0A==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.4.3.tgz", + "integrity": "sha512-Kccpc7ACfXaxfeInfqKcZtW4pT5YBn1mesc4sCsun6sRwtbJ4h+sNOaksUpYEJUKfN65YWC6Bw2OJEFiKxq8nQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -4649,13 +4649,13 @@ } }, "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", "dev": true, "license": "MIT", "dependencies": { - "hasown": "^2.0.2" + "hasown": "^2.0.3" }, "engines": { "node": ">= 0.4" @@ -5353,9 +5353,9 @@ "license": "MIT" }, "node_modules/node-abi": { - "version": "3.90.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.90.0.tgz", - "integrity": "sha512-pZNQT7UnYlMwMBy5N1lV5X/YLTbZM5ncytN3xL7CHEzhDN8uVe0u55yaPUJICIJjaCW8NrM5BFdqr7HLweStNA==", + "version": "3.91.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.91.0.tgz", + "integrity": "sha512-B+S7X/GS3Un6wMICtnsNjQD7oSpVBQrZftHE6GZ1Fe9/k3XOOoqbM5DZZ0GO4x3YiSCQfrM28yj1ppplwgIsfg==", "dev": true, "license": "MIT", "dependencies": { @@ -6503,9 +6503,9 @@ } }, "node_modules/tar": { - "version": "7.5.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.13.tgz", - "integrity": "sha512-tOG/7GyXpFevhXVh8jOPJrmtRpOTsYqUIkVdVooZYJS/z8WhfQUX8RJILmeuJNinGAMSu1veBr4asSHFt5/hng==", + "version": "7.5.14", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.14.tgz", + "integrity": "sha512-/7sHKgQO3JLP9ESlwTYUUftHUadOURUqq23xs1vjcnp8Vss6k0wCfzulyEtk5g91pjvnuriimGlyG7k6msrzRw==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", @@ -6811,16 +6811,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.59.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.59.1.tgz", - "integrity": "sha512-xqDcFVBmlrltH64lklOVp1wYxgJr6LVdg3NamBgH2OOQDLFdTKfIZXF5PfghrnXQKXZGTQs8tr1vL7fJvq8CTQ==", + "version": "8.59.2", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.59.2.tgz", + "integrity": "sha512-pJw051uomb3ZeCzGTpRb8RbEqB5Y4WWet8gl/GcTlU35BSx0PVdZ86/bqkQCyKKuraVQEK7r6kBHQXF+fBhkoQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.59.1", - "@typescript-eslint/parser": "8.59.1", - "@typescript-eslint/typescript-estree": "8.59.1", - "@typescript-eslint/utils": "8.59.1" + "@typescript-eslint/eslint-plugin": "8.59.2", + "@typescript-eslint/parser": "8.59.2", + "@typescript-eslint/typescript-estree": "8.59.2", + "@typescript-eslint/utils": "8.59.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/package.json b/package.json index c6c3b4c0..36dda01e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "20.2.0", + "version": "21.0.0", "license": "BSD-3-Clause", "main": "dist/index.cjs", "module": "dist/index.js", @@ -48,10 +48,10 @@ "mac-x64": "bun build cli.ts --compile --sourcemap=inline --target=bun-darwin-x64 --outfile build/appwrite-cli-darwin-x64", "mac-arm64": "bun build cli.ts --compile --sourcemap=inline --target=bun-darwin-arm64 --outfile build/appwrite-cli-darwin-arm64", "windows-x64": "bun build cli.ts --compile --sourcemap=inline --target=bun-windows-x64 --outfile build/appwrite-cli-win-x64.exe", - "windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --external:terminal-image --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe" + "windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --external:terminal-image --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs --fallback-to-source -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe" }, "dependencies": { - "@appwrite.io/console": "12.0.0", + "@appwrite.io/console": "12.1.0", "chalk": "4.1.2", "chokidar": "^3.6.0", "cli-progress": "^3.12.0", diff --git a/scoop/appwrite.config.json b/scoop/appwrite.config.json index ba3dab4f..69b3cf94 100644 --- a/scoop/appwrite.config.json +++ b/scoop/appwrite.config.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "20.2.0", + "version": "21.0.0", "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.", "homepage": "https://github.com/appwrite/sdk-for-cli", "license": "BSD-3-Clause", "architecture": { "64bit": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/21.0.0/appwrite-cli-win-x64.exe", "bin": [ [ "appwrite-cli-win-x64.exe", @@ -15,7 +15,7 @@ ] }, "arm64": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/21.0.0/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe",