diff --git a/CHANGELOG.md b/CHANGELOG.md index 36e4fc3f..172822e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Change Log +## 17.0.0 + +* [BREAKING] Changed `$sequence` type from `int` to `string` for rows and documents +* [BREAKING] Removed `--key` required option from `appwrite project update-variable` (now optional) +* [BREAKING] Removed billing/payment commands from `appwrite account`: `list-billing-addresses`, `create-billing-address`, `get-billing-address`, `update-billing-address`, `delete-billing-address`, `get-coupon`, `list-invoices`, `list-payment-methods`, `create-payment-method`, `get-payment-method`, `update-payment-method`, `delete-payment-method`, `update-payment-method-provider`, `update-payment-method-mandate-options` +* [BREAKING] Removed cloud-specific health commands: `get-console-pausing`, `get-queue-billing-project-aggregation`, `get-queue-billing-team-aggregation`, `get-queue-priority-builds`, `get-queue-region-manager`, `get-queue-threats` +* [BREAKING] Removed `appwrite projects update-console-access` command +* Added `--variable-id` required parameter to `appwrite project create-variable` +* Added `--queries` and `--total` optional parameters to `appwrite project list-variables` +* Added new `appwrite users update-impersonator` command +* Added `impersonator` as a filterable attribute in `appwrite users list` +* Updated API version badge to `1.9.0` and compatibility to server version `1.9.x` + ## 16.0.0 * Breaking: Moved webhook commands from `projects` to new `webhooks` service. diff --git a/README.md b/README.md index 8ab0f246..4ec85870 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.8.2-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.0-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.8.x. 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 -16.0.0 +17.0.0 ``` ### Install using prebuilt binaries @@ -60,7 +60,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 -16.0.0 +17.0.0 ``` ## Getting Started diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index e1dc1606..3e0a50b7 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -1,5 +1,6 @@ ```bash appwrite project create-variable \ + --variable-id \ --key \ --value ``` diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 70bed01e..7426d25c 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -1,5 +1,4 @@ ```bash appwrite project update-variable \ - --variable-id \ - --key + --variable-id ``` diff --git a/docs/examples/users/update-impersonator.md b/docs/examples/users/update-impersonator.md new file mode 100644 index 00000000..c052034a --- /dev/null +++ b/docs/examples/users/update-impersonator.md @@ -0,0 +1,5 @@ +```bash +appwrite users update-impersonator \ + --user-id \ + --impersonator false +``` diff --git a/install.ps1 b/install.ps1 index 1febbb27..d5239761 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/16.0.0/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/16.0.0/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/17.0.0/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/17.0.0/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 4556948b..201af610 100644 --- a/install.sh +++ b/install.sh @@ -96,7 +96,7 @@ printSuccess() { downloadBinary() { echo "[2/4] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="16.0.0" + GITHUB_LATEST_VERSION="17.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/push.ts b/lib/commands/push.ts index 88cc79f2..0ed1a0ec 100644 --- a/lib/commands/push.ts +++ b/lib/commands/push.ts @@ -829,18 +829,9 @@ export class Push { const functionsServiceForVars = await getFunctionsService( this.projectClient, ); - const { variables } = await paginate( - async (args: any) => { - return await functionsServiceForVars.listVariables({ - functionId: args.functionId, - }); - }, - { - functionId: func["$id"], - }, - 100, - "variables", - ); + const { variables } = await functionsServiceForVars.listVariables({ + functionId: func["$id"], + }); await Promise.all( variables.map(async (variable: any) => { @@ -1199,18 +1190,9 @@ export class Push { .replaceSpinner(SPINNER_DOTS); const sitesServiceForVars = await getSitesService(this.projectClient); - const { variables } = await paginate( - async (args: any) => { - return await sitesServiceForVars.listVariables({ - siteId: args.siteId, - }); - }, - { - siteId: site["$id"], - }, - 100, - "variables", - ); + const { variables } = await sitesServiceForVars.listVariables({ + siteId: site["$id"], + }); await Promise.all( variables.map(async (variable: any) => { diff --git a/lib/commands/run.ts b/lib/commands/run.ts index bfc566d0..3d655454 100644 --- a/lib/commands/run.ts +++ b/lib/commands/run.ts @@ -12,7 +12,6 @@ import inquirer from "inquirer"; import path from "path"; import { Command } from "commander"; import { localConfig, globalConfig } from "../config.js"; -import { paginate } from "../paginate.js"; import { getFunctionsService } from "../services.js"; import { questionsRunFunctions } from "../questions.js"; import { @@ -177,12 +176,11 @@ const runFunction = async ({ if (withVariables) { try { - const { variables: remoteVariables } = await paginate( - async () => (await getFunctionsService()).listVariables(func["$id"]), - {}, - 100, - "variables", - ); + const { variables: remoteVariables } = await ( + await getFunctionsService() + ).listVariables({ + functionId: func["$id"], + }); remoteVariables.forEach((v) => { allVariables[v.key] = v.value; diff --git a/lib/commands/services/account.ts b/lib/commands/services/account.ts index ce945115..e91e4423 100644 --- a/lib/commands/services/account.ts +++ b/lib/commands/services/account.ts @@ -58,83 +58,6 @@ account ), ); -account - .command(`list-billing-addresses`) - .description(`List all billing addresses for a user.`) - .option(`--queries [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: userId, expired, failed`) - .action( - actionRunner( - async ({ queries }) => - parse(await (await getAccountClient()).listBillingAddresses(queries)), - ), - ); - -account - .command(`create-billing-address`) - .description(`Add a new billing address to a user's account.`) - .requiredOption(`--country `, `Country`) - .requiredOption(`--city `, `City`) - .requiredOption(`--street-address `, `Street address`) - .option(`--address-line-2 `, `Address line 2`) - .option(`--state `, `State or province`) - .option(`--postal-code `, `Postal code`) - .action( - actionRunner( - async ({ country, city, streetAddress, addressLine2, state, postalCode }) => - parse(await (await getAccountClient()).createBillingAddress(country, city, streetAddress, addressLine2, state, postalCode)), - ), - ); - -account - .command(`get-billing-address`) - .description(`Get a specific billing address for a user using it's ID.`) - .requiredOption(`--billing-address-id `, `Unique ID of billing address`) - .action( - actionRunner( - async ({ billingAddressId }) => - parse(await (await getAccountClient()).getBillingAddress(billingAddressId)), - ), - ); - -account - .command(`update-billing-address`) - .description(`Update a specific billing address using it's ID.`) - .requiredOption(`--billing-address-id `, `Unique ID of billing address`) - .requiredOption(`--country `, `Country`) - .requiredOption(`--city `, `City`) - .requiredOption(`--street-address `, `Street address`) - .option(`--address-line-2 `, `Address line 2`) - .option(`--state `, `State or province`) - .option(`--postal-code `, `Postal code`) - .action( - actionRunner( - async ({ billingAddressId, country, city, streetAddress, addressLine2, state, postalCode }) => - parse(await (await getAccountClient()).updateBillingAddress(billingAddressId, country, city, streetAddress, addressLine2, state, postalCode)), - ), - ); - -account - .command(`delete-billing-address`) - .description(`Delete a specific billing address using it's ID.`) - .requiredOption(`--billing-address-id `, `Billing address unique ID`) - .action( - actionRunner( - async ({ billingAddressId }) => - parse(await (await getAccountClient()).deleteBillingAddress(billingAddressId)), - ), - ); - -account - .command(`get-coupon`) - .description(`Get coupon details for an account.`) - .requiredOption(`--coupon-id `, `ID of the coupon`) - .action( - actionRunner( - async ({ couponId }) => - parse(await (await getAccountClient()).getCoupon(couponId)), - ), - ); - account .command(`update-email`) .description(`Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. @@ -177,17 +100,6 @@ account ), ); -account - .command(`list-invoices`) - .description(`List all invoices tied to an account.`) - .option(`--queries [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: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount`) - .action( - actionRunner( - async ({ queries }) => - parse(await (await getAccountClient()).listInvoices(queries)), - ), - ); - account .command(`create-jwt`) .description(`Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.`) @@ -408,87 +320,6 @@ account ), ); -account - .command(`list-payment-methods`) - .description(`List payment methods for this account.`) - .option(`--queries [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: userId, expired, failed`) - .action( - actionRunner( - async ({ queries }) => - parse(await (await getAccountClient()).listPaymentMethods(queries)), - ), - ); - -account - .command(`create-payment-method`) - .description(`Create a new payment method for the current user account.`) - .action( - actionRunner( - async () => parse(await (await getAccountClient()).createPaymentMethod()), - ), - ); - -account - .command(`get-payment-method`) - .description(`Get a specific payment method for the user.`) - .requiredOption(`--payment-method-id `, `Unique ID of payment method`) - .action( - actionRunner( - async ({ paymentMethodId }) => - parse(await (await getAccountClient()).getPaymentMethod(paymentMethodId)), - ), - ); - -account - .command(`update-payment-method`) - .description(`Update a new payment method for the current user account.`) - .requiredOption(`--payment-method-id `, `Unique ID of payment method`) - .requiredOption(`--expiry-month `, `Payment expiry month`, parseInteger) - .requiredOption(`--expiry-year `, `Expiry year`, parseInteger) - .option(`--state `, `State of the payment method country`) - .action( - actionRunner( - async ({ paymentMethodId, expiryMonth, expiryYear, state }) => - parse(await (await getAccountClient()).updatePaymentMethod(paymentMethodId, expiryMonth, expiryYear, state)), - ), - ); - -account - .command(`delete-payment-method`) - .description(`Delete a specific payment method from a user's account.`) - .requiredOption(`--payment-method-id `, `Unique ID of payment method`) - .action( - actionRunner( - async ({ paymentMethodId }) => - parse(await (await getAccountClient()).deletePaymentMethod(paymentMethodId)), - ), - ); - -account - .command(`update-payment-method-provider`) - .description(`Update payment method provider.`) - .requiredOption(`--payment-method-id `, `Unique ID of payment method`) - .requiredOption(`--provider-method-id `, `Payment method ID from the payment provider`) - .requiredOption(`--name `, `Name in the payment method`) - .option(`--state `, `State of the payment method country`) - .action( - actionRunner( - async ({ paymentMethodId, providerMethodId, name, state }) => - parse(await (await getAccountClient()).updatePaymentMethodProvider(paymentMethodId, providerMethodId, name, state)), - ), - ); - -account - .command(`update-payment-method-mandate-options`) - .description(`Update payment method mandate options.`) - .requiredOption(`--payment-method-id `, `Unique ID of payment method`) - .action( - actionRunner( - async ({ paymentMethodId }) => - parse(await (await getAccountClient()).updatePaymentMethodMandateOptions(paymentMethodId)), - ), - ); - account .command(`update-phone`) .description(`Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.`) diff --git a/lib/commands/services/health.ts b/lib/commands/services/health.ts index 794969fc..4ad11cab 100644 --- a/lib/commands/services/health.ts +++ b/lib/commands/services/health.ts @@ -64,19 +64,6 @@ health ), ); -health - .command(`get-console-pausing`) - .description(`Get console pausing health status. Monitors projects approaching the pause threshold to detect potential issues with console access tracking. -`) - .option(`--threshold `, `Percentage threshold of projects approaching pause. When hit (equal or higher), endpoint returns server error. Default value is 10.`, parseInteger) - .option(`--inactivity-days `, `Number of days of inactivity before a project is paused. Should match the plan's projectInactivityDays setting. Default value is 7.`, parseInteger) - .action( - actionRunner( - async ({ threshold, inactivityDays }) => - parse(await (await getHealthClient()).getConsolePausing(threshold, inactivityDays)), - ), - ); - health .command(`get-db`) .description(`Check the Appwrite database servers are up and connection is successful.`) @@ -106,28 +93,6 @@ health ), ); -health - .command(`get-queue-billing-project-aggregation`) - .description(`Get billing project aggregation queue.`) - .option(`--threshold `, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger) - .action( - actionRunner( - async ({ threshold }) => - parse(await (await getHealthClient()).getQueueBillingProjectAggregation(threshold)), - ), - ); - -health - .command(`get-queue-billing-team-aggregation`) - .description(`Get billing team aggregation queue.`) - .option(`--threshold `, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger) - .action( - actionRunner( - async ({ threshold }) => - parse(await (await getHealthClient()).getQueueBillingTeamAggregation(threshold)), - ), - ); - health .command(`get-queue-builds`) .description(`Get the number of builds that are waiting to be processed in the Appwrite internal queue server.`) @@ -139,17 +104,6 @@ health ), ); -health - .command(`get-queue-priority-builds`) - .description(`Get the priority builds queue size.`) - .option(`--threshold `, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500.`, parseInteger) - .action( - actionRunner( - async ({ threshold }) => - parse(await (await getHealthClient()).getQueuePriorityBuilds(threshold)), - ), - ); - health .command(`get-queue-certificates`) .description(`Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.`) @@ -252,17 +206,6 @@ health ), ); -health - .command(`get-queue-region-manager`) - .description(`Get region manager queue.`) - .option(`--threshold `, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100.`, parseInteger) - .action( - actionRunner( - async ({ threshold }) => - parse(await (await getHealthClient()).getQueueRegionManager(threshold)), - ), - ); - health .command(`get-queue-stats-resources`) .description(`Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.`) @@ -285,17 +228,6 @@ health ), ); -health - .command(`get-queue-threats`) - .description(`Get threats queue.`) - .option(`--threshold `, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100.`, parseInteger) - .action( - actionRunner( - async ({ threshold }) => - parse(await (await getHealthClient()).getQueueThreats(threshold)), - ), - ); - health .command(`get-queue-webhooks`) .description(`Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.`) diff --git a/lib/commands/services/project.ts b/lib/commands/services/project.ts index 32ef26e7..9f3cd4c2 100644 --- a/lib/commands/services/project.ts +++ b/lib/commands/services/project.ts @@ -41,16 +41,25 @@ project project .command(`list-variables`) - .description(`Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime.`) + .description(`Get a list of all project environment variables.`) + .option(`--queries [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), + ) .action( actionRunner( - async () => parse(await (await getProjectClient()).listVariables()), + async ({ queries, total }) => + parse(await (await getProjectClient()).listVariables(queries, total)), ), ); project .command(`create-variable`) - .description(`Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.`) + .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(`--key `, `Variable key. Max length: 255 chars.`) .requiredOption(`--value `, `Variable value. Max length: 8192 chars.`) .option( @@ -61,15 +70,15 @@ project ) .action( actionRunner( - async ({ key, value, secret }) => - parse(await (await getProjectClient()).createVariable(key, value, secret)), + async ({ variableId, key, value, secret }) => + parse(await (await getProjectClient()).createVariable(variableId, key, value, secret)), ), ); project .command(`get-variable`) - .description(`Get a project variable by its unique ID.`) - .requiredOption(`--variable-id `, `Variable unique ID.`) + .description(`Get a variable by its unique ID. `) + .requiredOption(`--variable-id `, `Variable ID.`) .action( actionRunner( async ({ variableId }) => @@ -79,9 +88,9 @@ project project .command(`update-variable`) - .description(`Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime.`) - .requiredOption(`--variable-id `, `Variable unique ID.`) - .requiredOption(`--key `, `Variable key. Max length: 255 chars.`) + .description(`Update variable by its unique ID.`) + .requiredOption(`--variable-id `, `Variable ID.`) + .option(`--key `, `Variable key. Max length: 255 chars.`) .option(`--value `, `Variable value. Max length: 8192 chars.`) .option( `--secret [value]`, @@ -98,8 +107,8 @@ project project .command(`delete-variable`) - .description(`Delete a project variable by its unique ID. `) - .requiredOption(`--variable-id `, `Variable unique ID.`) + .description(`Delete a variable by its unique ID. `) + .requiredOption(`--variable-id `, `Variable ID.`) .action( actionRunner( async ({ variableId }) => diff --git a/lib/commands/services/projects.ts b/lib/commands/services/projects.ts index 85e9327b..075742e3 100644 --- a/lib/commands/services/projects.ts +++ b/lib/commands/services/projects.ts @@ -270,18 +270,6 @@ projects ), ); -projects - .command(`update-console-access`) - .description(`Record console access to a project. This endpoint updates the last accessed timestamp for the project to track console activity. -`) - .requiredOption(`--project-id `, `Project ID`) - .action( - actionRunner( - async ({ projectId }) => - parse(await (await getProjectsClient()).updateConsoleAccess(projectId)), - ), - ); - projects .command(`list-dev-keys`) .description(`List all the project\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'`) diff --git a/lib/commands/services/users.ts b/lib/commands/services/users.ts index 86e9046e..00a77a29 100644 --- a/lib/commands/services/users.ts +++ b/lib/commands/services/users.ts @@ -29,7 +29,7 @@ export const users = new Command("users") users .command(`list`) .description(`Get a list of all the project's users. You can use the query params to filter your results.`) - .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels`) + .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option( `--total [value]`, @@ -241,6 +241,19 @@ users ), ); +users + .command(`update-impersonator`) + .description(`Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. +`) + .requiredOption(`--user-id `, `User ID.`) + .requiredOption(`--impersonator `, `Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.`, parseBool) + .action( + actionRunner( + async ({ userId, impersonator }) => + parse(await (await getUsersClient()).updateImpersonator(userId, impersonator)), + ), + ); + users .command(`create-jwt`) .description(`Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.`) diff --git a/lib/constants.ts b/lib/constants.ts index 570abfd7..29f7b604 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 = '16.0.0'; +export const SDK_VERSION = '17.0.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 9cf69640..0e2c1dbd 100644 --- a/lib/questions.ts +++ b/lib/questions.ts @@ -187,15 +187,19 @@ export const questionsInitProject: Question[] = [ const client = await sdkForConsole(true); const { teams } = isCloud() ? await paginate( - async (opts: { sdk?: Client } = {}) => - (await getOrganizationsService(opts.sdk)).list(), + async (args) => + (await getOrganizationsService(args.sdk as Client)).list({ + queries: args.queries as string[], + }), { sdk: client }, 100, "teams", ) : await paginate( - async (opts: { sdk?: Client } = {}) => - (await getTeamsService(opts.sdk)).list(), + async (args) => + (await getTeamsService(args.sdk as Client)).list({ + queries: args.queries as string[], + }), { parseOutput: false, sdk: client }, 100, "teams", @@ -247,7 +251,7 @@ export const questionsInitProject: Question[] = [ ]; const { projects } = await paginate( - async () => (await getProjectsService()).list(queries), + async (args) => (await getProjectsService()).list(args.queries as string[]), { parseOutput: false }, 100, "projects", @@ -342,7 +346,8 @@ export const questionsPullFunctions: Question[] = [ validate: (value: any) => validateRequired("function", value), choices: async () => { const { functions } = await paginate( - async () => (await getFunctionsService()).list(), + async (args) => + (await getFunctionsService()).list(args.queries as string[]), { parseOutput: false }, 100, "functions", @@ -385,7 +390,8 @@ export const questionsPullSites: Question[] = [ validate: (value: any) => validateRequired("site", value), choices: async () => { const { sites } = await paginate( - async () => (await getSitesService()).list(), + async (args) => + (await getSitesService()).list(args.queries as string[]), { parseOutput: false }, 100, "sites", diff --git a/package.json b/package.json index e7cead39..0b81a8e4 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": "16.0.0", + "version": "17.0.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 b48b95bb..d70f4d66 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": "16.0.0", + "version": "17.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/16.0.0/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/17.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/16.0.0/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/17.0.0/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe",