Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: regenerate sdks #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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 binfmt-support qemu-user-static
update-binfmts --display
- name: Setup ldid
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using

```sh
$ appwrite -v
6.2.0
6.2.1
```

### Install using prebuilt binaries
Expand Down Expand Up @@ -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
6.2.0
6.2.1
```

## Getting Started
Expand Down
4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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/6.2.0/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.0/appwrite-cli-win-arm64.exe"
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.1/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.1/appwrite-cli-win-arm64.exe"

$APPWRITE_BINARY_NAME = "appwrite.exe"

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ printSuccess() {
downloadBinary() {
echo "[2/4] Downloading executable for $OS ($ARCH) ..."

GITHUB_LATEST_VERSION="6.2.0"
GITHUB_LATEST_VERSION="6.2.1"
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"

Expand Down
4 changes: 2 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Client {
'x-sdk-name': 'Command Line',
'x-sdk-platform': 'console',
'x-sdk-language': 'cli',
'x-sdk-version': '6.2.0',
'user-agent' : `AppwriteCLI/6.2.0 (${os.type()} ${os.version()}; ${os.arch()})`,
'x-sdk-version': '6.2.1',
'user-agent' : `AppwriteCLI/6.2.1 (${os.type()} ${os.version()}; ${os.arch()})`,
'X-Appwrite-Response-Format' : '1.6.0',
};
}
Expand Down
6 changes: 3 additions & 3 deletions lib/commands/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -1954,22 +1954,22 @@ account

account
.command(`create-push-target`)
.description(``)
.description(`Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.`)
.requiredOption(`--target-id <target-id>`, `Target 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(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
.option(`--provider-id <provider-id>`, `Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.`)
.action(actionRunner(accountCreatePushTarget))

account
.command(`update-push-target`)
.description(``)
.description(`Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.`)
.requiredOption(`--target-id <target-id>`, `Target ID.`)
.requiredOption(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
.action(actionRunner(accountUpdatePushTarget))

account
.command(`delete-push-target`)
.description(``)
.description(`Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.`)
.requiredOption(`--target-id <target-id>`, `Target ID.`)
.action(actionRunner(accountDeletePushTarget))

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const assistantChat = async ({prompt,parseOutput = true, overrideForCli = false,

assistant
.command(`chat`)
.description(``)
.description(`Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. `)
.requiredOption(`--prompt <prompt>`, `Prompt. A string containing questions asked to the AI assistant.`)
.action(actionRunner(assistantChat))

Expand Down
6 changes: 3 additions & 3 deletions lib/commands/databases.js
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,7 @@ databases

databases
.command(`get-usage`)
.description(``)
.description(`Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`)
.option(`--range <range>`, `'Date range.`)
.action(actionRunner(databasesGetUsage))

Expand Down Expand Up @@ -2558,7 +2558,7 @@ databases

databases
.command(`get-collection-usage`)
.description(``)
.description(`Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`)
.requiredOption(`--database-id <database-id>`, `Database ID.`)
.requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
.option(`--range <range>`, `Date range.`)
Expand All @@ -2573,7 +2573,7 @@ databases

databases
.command(`get-database-usage`)
.description(``)
.description(`Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`)
.requiredOption(`--database-id <database-id>`, `Database ID.`)
.option(`--range <range>`, `'Date range.`)
.option(`--console`, `Get the resource console url`)
Expand Down
8 changes: 4 additions & 4 deletions lib/commands/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ functions

functions
.command(`get-usage`)
.description(``)
.description(`Get usage metrics and statistics for a for all functions. View statistics including total functions, deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.`)
.option(`--range <range>`, `Date range.`)
.action(actionRunner(functionsGetUsage))

Expand Down Expand Up @@ -1503,15 +1503,15 @@ functions

functions
.command(`create-build`)
.description(``)
.description(`Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.`)
.requiredOption(`--function-id <function-id>`, `Function ID.`)
.requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
.option(`--build-id <build-id>`, `Build unique ID.`)
.action(actionRunner(functionsCreateBuild))

functions
.command(`update-deployment-build`)
.description(``)
.description(`Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.`)
.requiredOption(`--function-id <function-id>`, `Function ID.`)
.requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
.action(actionRunner(functionsUpdateDeploymentBuild))
Expand Down Expand Up @@ -1563,7 +1563,7 @@ functions

functions
.command(`get-function-usage`)
.description(``)
.description(`Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.`)
.requiredOption(`--function-id <function-id>`, `Function ID.`)
.option(`--range <range>`, `Date range.`)
.option(`--console`, `Get the resource console url`)
Expand Down
6 changes: 3 additions & 3 deletions lib/commands/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,7 @@ messaging

messaging
.command(`update-email`)
.description(`Update an email message by its unique ID. `)
.description(`Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. `)
.requiredOption(`--message-id <message-id>`, `Message ID.`)
.option(`--topics [topics...]`, `List of Topic IDs.`)
.option(`--users [users...]`, `List of User IDs.`)
Expand Down Expand Up @@ -2500,7 +2500,7 @@ messaging

messaging
.command(`update-push`)
.description(`Update a push notification by its unique ID. `)
.description(`Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. `)
.requiredOption(`--message-id <message-id>`, `Message ID.`)
.option(`--topics [topics...]`, `List of Topic IDs.`)
.option(`--users [users...]`, `List of User IDs.`)
Expand Down Expand Up @@ -2536,7 +2536,7 @@ messaging

messaging
.command(`update-sms`)
.description(`Update an email message by its unique ID. `)
.description(`Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. `)
.requiredOption(`--message-id <message-id>`, `Message ID.`)
.option(`--topics [topics...]`, `List of Topic IDs.`)
.option(`--users [users...]`, `List of User IDs.`)
Expand Down
24 changes: 12 additions & 12 deletions lib/commands/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,14 +584,14 @@ const migrationsDelete = async ({migrationId,parseOutput = true, overrideForCli

migrations
.command(`list`)
.description(``)
.description(`List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.`)
.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: status, stage, source, destination, resources, statusCounters, resourceData, errors`)
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
.action(actionRunner(migrationsList))

migrations
.command(`create-appwrite-migration`)
.description(``)
.description(`Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. `)
.requiredOption(`--resources [resources...]`, `List of resources to migrate`)
.requiredOption(`--endpoint <endpoint>`, `Source's Appwrite Endpoint`)
.requiredOption(`--project-id <project-id>`, `Source's Project ID`)
Expand All @@ -600,7 +600,7 @@ migrations

migrations
.command(`get-appwrite-report`)
.description(``)
.description(`Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.`)
.requiredOption(`--resources [resources...]`, `List of resources to migrate`)
.requiredOption(`--endpoint <endpoint>`, `Source's Appwrite Endpoint`)
.requiredOption(`--project-id <project-id>`, `Source's Project ID`)
Expand All @@ -609,21 +609,21 @@ migrations

migrations
.command(`create-firebase-migration`)
.description(``)
.description(`Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. `)
.requiredOption(`--resources [resources...]`, `List of resources to migrate`)
.requiredOption(`--service-account <service-account>`, `JSON of the Firebase service account credentials`)
.action(actionRunner(migrationsCreateFirebaseMigration))

migrations
.command(`get-firebase-report`)
.description(``)
.description(`Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.`)
.requiredOption(`--resources [resources...]`, `List of resources to migrate`)
.requiredOption(`--service-account <service-account>`, `JSON of the Firebase service account credentials`)
.action(actionRunner(migrationsGetFirebaseReport))

migrations
.command(`create-n-host-migration`)
.description(``)
.description(`Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. `)
.requiredOption(`--resources [resources...]`, `List of resources to migrate`)
.requiredOption(`--subdomain <subdomain>`, `Source's Subdomain`)
.requiredOption(`--region <region>`, `Source's Region`)
Expand All @@ -636,7 +636,7 @@ migrations

migrations
.command(`get-n-host-report`)
.description(``)
.description(`Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. `)
.requiredOption(`--resources [resources...]`, `List of resources to migrate.`)
.requiredOption(`--subdomain <subdomain>`, `Source's Subdomain.`)
.requiredOption(`--region <region>`, `Source's Region.`)
Expand All @@ -649,7 +649,7 @@ migrations

migrations
.command(`create-supabase-migration`)
.description(``)
.description(`Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. `)
.requiredOption(`--resources [resources...]`, `List of resources to migrate`)
.requiredOption(`--endpoint <endpoint>`, `Source's Supabase Endpoint`)
.requiredOption(`--api-key <api-key>`, `Source's API Key`)
Expand All @@ -661,7 +661,7 @@ migrations

migrations
.command(`get-supabase-report`)
.description(``)
.description(`Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. `)
.requiredOption(`--resources [resources...]`, `List of resources to migrate`)
.requiredOption(`--endpoint <endpoint>`, `Source's Supabase Endpoint.`)
.requiredOption(`--api-key <api-key>`, `Source's API Key.`)
Expand All @@ -673,19 +673,19 @@ migrations

migrations
.command(`get`)
.description(``)
.description(`Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. `)
.requiredOption(`--migration-id <migration-id>`, `Migration unique ID.`)
.action(actionRunner(migrationsGet))

migrations
.command(`retry`)
.description(``)
.description(`Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.`)
.requiredOption(`--migration-id <migration-id>`, `Migration unique ID.`)
.action(actionRunner(migrationsRetry))

migrations
.command(`delete`)
.description(``)
.description(`Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. `)
.requiredOption(`--migration-id <migration-id>`, `Migration ID.`)
.action(actionRunner(migrationsDelete))

Expand Down
48 changes: 48 additions & 0 deletions lib/commands/organizations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const { sdkForProject } = require('../sdks')
const { parse } = require('../parser')
const { showConsoleLink } = require('../utils.js');

/**
* @typedef {Object} OrganizationsListRequestParams
* @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
* @property {string} search Search term to filter your list results. Max length: 256 chars.
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
*/

/**
* @param {OrganizationsListRequestParams} params
*/
const organizationsList = async ({queries, search, parseOutput = true, sdk = undefined, console}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/organizations';
let payload = {};
if (typeof queries !== 'undefined') {
payload['queries'] = queries;
}
if (typeof search !== 'undefined') {
payload['search'] = search;
}

let response = undefined;

response = await client.call('get', apiPath, {
'content-type': 'application/json',
}, payload);

if (parseOutput) {
if(console) {
showConsoleLink('organizations', 'list');
} else {
parse(response)
}
}

return response;

}

module.exports = {
organizationsList
}
2 changes: 1 addition & 1 deletion lib/commands/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const projectDeleteVariable = async ({variableId,parseOutput = true, overrideFor

project
.command(`get-usage`)
.description(``)
.description(`Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.`)
.requiredOption(`--start-date <start-date>`, `Starting date for the usage`)
.requiredOption(`--end-date <end-date>`, `End date for the usage`)
.option(`--period <period>`, `Period used`)
Expand Down
Loading