Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 11.1.0

* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance

## 11.0.0

* Rename `create-csv-migration` to `create-csv-import` command to create a CSV import of a collection/table
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
11.0.0
11.1.0
```

### 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
11.0.0
11.1.0
```

## 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/11.0.0/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/11.0.0/appwrite-cli-win-arm64.exe"
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/11.1.0/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/11.1.0/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="11.0.0"
GITHUB_LATEST_VERSION="11.1.0"
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': '11.0.0',
'user-agent' : `AppwriteCLI/11.0.0 (${os.type()} ${os.version()}; ${os.arch()})`,
'x-sdk-version': '11.1.0',
'user-agent' : `AppwriteCLI/11.1.0 (${os.type()} ${os.version()}; ${os.arch()})`,
'X-Appwrite-Response-Format' : '1.8.0',
};
}
Expand Down
14 changes: 12 additions & 2 deletions lib/commands/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const accountUpdateEmail = async ({email,password,parseOutput = true, overrideFo
/**
* @typedef {Object} AccountListIdentitiesRequestParams
* @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: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
Expand All @@ -193,14 +194,17 @@ const accountUpdateEmail = async ({email,password,parseOutput = true, overrideFo
/**
* @param {AccountListIdentitiesRequestParams} params
*/
const accountListIdentities = async ({queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
const accountListIdentities = async ({queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/account/identities';
let payload = {};
if (typeof queries !== 'undefined') {
payload['queries'] = queries;
}
if (typeof total !== 'undefined') {
payload['total'] = total;
}

let response = undefined;

Expand Down Expand Up @@ -276,6 +280,7 @@ const accountCreateJWT = async ({parseOutput = true, overrideForCli = false, sdk
/**
* @typedef {Object} AccountListLogsRequestParams
* @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). Only supported methods are limit and offset
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
Expand All @@ -284,14 +289,17 @@ const accountCreateJWT = async ({parseOutput = true, overrideForCli = false, sdk
/**
* @param {AccountListLogsRequestParams} params
*/
const accountListLogs = async ({queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
const accountListLogs = async ({queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/account/logs';
let payload = {};
if (typeof queries !== 'undefined') {
payload['queries'] = queries;
}
if (typeof total !== 'undefined') {
payload['total'] = total;
}

let response = undefined;

Expand Down Expand Up @@ -1765,6 +1773,7 @@ account
.command(`list-identities`)
.description(`Get the list of identities for the currently logged in 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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry`)
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
.action(actionRunner(accountListIdentities))

account
Expand All @@ -1782,6 +1791,7 @@ account
.command(`list-logs`)
.description(`Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.`)
.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). 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) => value === undefined ? true : parseBool(value))
.action(actionRunner(accountListLogs))

account
Expand Down
35 changes: 30 additions & 5 deletions lib/commands/databases.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const databases = new Command("databases").description(commandDescriptions['data
* @typedef {Object} DatabasesListRequestParams
* @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
* @property {string} search Search term to filter your list results. Max length: 256 chars.
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
Expand All @@ -51,7 +52,7 @@ const databases = new Command("databases").description(commandDescriptions['data
/**
* @param {DatabasesListRequestParams} params
*/
const databasesList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
const databasesList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/databases';
Expand All @@ -62,6 +63,9 @@ const databasesList = async ({queries,search,parseOutput = true, overrideForCli
if (typeof search !== 'undefined') {
payload['search'] = search;
}
if (typeof total !== 'undefined') {
payload['total'] = total;
}

let response = undefined;

Expand Down Expand Up @@ -467,6 +471,7 @@ const databasesDelete = async ({databaseId,parseOutput = true, overrideForCli =
* @property {string} databaseId Database ID.
* @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, enabled, documentSecurity
* @property {string} search Search term to filter your list results. Max length: 256 chars.
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
Expand All @@ -475,7 +480,7 @@ const databasesDelete = async ({databaseId,parseOutput = true, overrideForCli =
/**
* @param {DatabasesListCollectionsRequestParams} params
*/
const databasesListCollections = async ({databaseId,queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
const databasesListCollections = async ({databaseId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
Expand All @@ -486,6 +491,9 @@ const databasesListCollections = async ({databaseId,queries,search,parseOutput =
if (typeof search !== 'undefined') {
payload['search'] = search;
}
if (typeof total !== 'undefined') {
payload['total'] = total;
}

let response = undefined;

Expand Down Expand Up @@ -672,6 +680,7 @@ const databasesDeleteCollection = async ({databaseId,collectionId,parseOutput =
* @property {string} databaseId Database ID.
* @property {string} collectionId Collection ID.
* @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: key, type, size, required, array, status, error
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
Expand All @@ -680,14 +689,17 @@ const databasesDeleteCollection = async ({databaseId,collectionId,parseOutput =
/**
* @param {DatabasesListAttributesRequestParams} params
*/
const databasesListAttributes = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
const databasesListAttributes = async ({databaseId,collectionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof queries !== 'undefined') {
payload['queries'] = queries;
}
if (typeof total !== 'undefined') {
payload['total'] = total;
}

let response = undefined;

Expand Down Expand Up @@ -2009,6 +2021,7 @@ const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
* @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.
* @property {string} transactionId Transaction ID to read uncommitted changes within the transaction.
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
Expand All @@ -2017,7 +2030,7 @@ const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key
/**
* @param {DatabasesListDocumentsRequestParams} params
*/
const databasesListDocuments = async ({databaseId,collectionId,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
const databasesListDocuments = async ({databaseId,collectionId,queries,transactionId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
Expand All @@ -2028,6 +2041,9 @@ const databasesListDocuments = async ({databaseId,collectionId,queries,transacti
if (typeof transactionId !== 'undefined') {
payload['transactionId'] = transactionId;
}
if (typeof total !== 'undefined') {
payload['total'] = total;
}

let response = undefined;

Expand Down Expand Up @@ -2556,6 +2572,7 @@ const databasesIncrementDocumentAttribute = async ({databaseId,collectionId,docu
* @property {string} databaseId Database ID.
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
* @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: key, type, status, attributes, error
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
Expand All @@ -2564,14 +2581,17 @@ const databasesIncrementDocumentAttribute = async ({databaseId,collectionId,docu
/**
* @param {DatabasesListIndexesRequestParams} params
*/
const databasesListIndexes = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
const databasesListIndexes = async ({databaseId,collectionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof queries !== 'undefined') {
payload['queries'] = queries;
}
if (typeof total !== 'undefined') {
payload['total'] = total;
}

let response = undefined;

Expand Down Expand Up @@ -2845,6 +2865,7 @@ databases
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list' instead] Get a list of all databases from the current Appwrite project. You can use the search parameter 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`)
.option(`--search <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.`, (value) => value === undefined ? true : parseBool(value))
.option(`--console`, `Get the resource console url`)
.action(actionRunner(databasesList))

Expand Down Expand Up @@ -2931,6 +2952,7 @@ databases
.requiredOption(`--database-id <database-id>`, `Database ID.`)
.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, enabled, documentSecurity`)
.option(`--search <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.`, (value) => value === undefined ? true : parseBool(value))
.option(`--console`, `Get the resource console url`)
.action(actionRunner(databasesListCollections))

Expand Down Expand Up @@ -2977,6 +2999,7 @@ databases
.requiredOption(`--database-id <database-id>`, `Database ID.`)
.requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
.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, type, size, required, array, status, error`)
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
.option(`--console`, `Get the resource console url`)
.action(actionRunner(databasesListAttributes))

Expand Down Expand Up @@ -3300,6 +3323,7 @@ databases
.requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
.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.`)
.option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
.option(`--console`, `Get the resource console url`)
.action(actionRunner(databasesListDocuments))

Expand Down Expand Up @@ -3432,6 +3456,7 @@ databases
.requiredOption(`--database-id <database-id>`, `Database ID.`)
.requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
.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, type, status, attributes, error`)
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
.option(`--console`, `Get the resource console url`)
.action(actionRunner(databasesListIndexes))

Expand Down
Loading