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
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# Change Log

## 20.2.0-rc.1

* Added: Code-signed Windows release binaries (`appwrite-cli-win-x64.exe` and `appwrite-cli-win-arm64.exe`) via SignPath
## 21.0.0

* Breaking: Renamed `project update-canonical-emails` to `update-deny-canonical-email-policy`
* Breaking: Renamed `project update-disposable-emails` to `update-deny-disposable-email-policy`
* Breaking: Renamed `project update-free-emails` to `update-deny-free-email-policy`
* Breaking: Renamed `proxy update-rule-verification` to `update-rule-status`
* Breaking: Removed `--search` option from `proxy list-rules`
* Breaking: `functions create-variable` and `sites create-variable` now require `--variable-id`
* Added: `databases create-big-int-attribute` and `update-big-int-attribute` commands
* Added: `tablesdb create-big-int-column` and `update-big-int-column` commands
* Added: `--prompt` option on `project update-o-auth-2-google`
* Added: Pagination and filter flags on `vcs list-repository-branches` and `sites list-variables`
* Added: `--on-duplicate` option on `migrations create-appwrite-migration`, `create-csv-import`, and `create-json-import`
* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret`

## 20.1.0

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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)
Expand Down Expand Up @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using

```sh
$ appwrite -v
20.2.0-rc.1
21.0.0
```

### Install using prebuilt binaries
Expand Down Expand Up @@ -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-rc.1
21.0.0
```

## Getting Started
Expand Down
40 changes: 20 additions & 20 deletions bun.lock

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/examples/databases/create-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```bash
appwrite databases create-big-int-attribute \
--database-id <DATABASE_ID> \
--collection-id <COLLECTION_ID> \
--key '' \
--required false
```
8 changes: 8 additions & 0 deletions docs/examples/databases/update-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```bash
appwrite databases update-big-int-attribute \
--database-id <DATABASE_ID> \
--collection-id <COLLECTION_ID> \
--key '' \
--required false \
--default null
```
1 change: 1 addition & 0 deletions docs/examples/functions/create-variable.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
```bash
appwrite functions create-variable \
--function-id <FUNCTION_ID> \
--variable-id <VARIABLE_ID> \
--key <KEY> \
--value <VALUE>
```
3 changes: 2 additions & 1 deletion docs/examples/functions/list-variables.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
```bash
appwrite functions list-variables \
--function-id <FUNCTION_ID>
--function-id <FUNCTION_ID> \
--limit 25
```
3 changes: 1 addition & 2 deletions docs/examples/functions/update-variable.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```bash
appwrite functions update-variable \
--function-id <FUNCTION_ID> \
--variable-id <VARIABLE_ID> \
--key <KEY>
--variable-id <VARIABLE_ID>
```
2 changes: 1 addition & 1 deletion docs/examples/project/create-ephemeral-key.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```bash
appwrite project create-ephemeral-key \
--scopes one two three \
--duration 1
--duration 600
```
2 changes: 1 addition & 1 deletion docs/examples/project/get-o-auth-2-provider.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```bash
appwrite project get-o-auth-2-provider \
--provider <PROVIDER>
--provider-id amazon
```
3 changes: 2 additions & 1 deletion docs/examples/project/list-o-auth-2-providers.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```bash
appwrite project list-o-auth-2-providers
appwrite project list-o-auth-2-providers \
--limit 25
```
4 changes: 0 additions & 4 deletions docs/examples/project/update-canonical-emails.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/examples/project/update-deny-canonical-email-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```bash
appwrite project update-deny-canonical-email-policy \
--enabled false
```
4 changes: 4 additions & 0 deletions docs/examples/project/update-deny-disposable-email-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```bash
appwrite project update-deny-disposable-email-policy \
--enabled false
```
4 changes: 4 additions & 0 deletions docs/examples/project/update-deny-free-email-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```bash
appwrite project update-deny-free-email-policy \
--enabled false
```
4 changes: 0 additions & 4 deletions docs/examples/project/update-disposable-emails.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/examples/project/update-free-emails.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/examples/proxy/update-rule-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```bash
appwrite proxy update-rule-status \
--rule-id <RULE_ID>
```
4 changes: 0 additions & 4 deletions docs/examples/proxy/update-rule-verification.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/examples/sites/create-variable.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
```bash
appwrite sites create-variable \
--site-id <SITE_ID> \
--variable-id <VARIABLE_ID> \
--key <KEY> \
--value <VALUE>
```
3 changes: 2 additions & 1 deletion docs/examples/sites/list-variables.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
```bash
appwrite sites list-variables \
--site-id <SITE_ID>
--site-id <SITE_ID> \
--limit 25
```
3 changes: 1 addition & 2 deletions docs/examples/sites/update-variable.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```bash
appwrite sites update-variable \
--site-id <SITE_ID> \
--variable-id <VARIABLE_ID> \
--key <KEY>
--variable-id <VARIABLE_ID>
```
7 changes: 7 additions & 0 deletions docs/examples/tablesdb/create-big-int-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```bash
appwrite tables-db create-big-int-column \
--database-id <DATABASE_ID> \
--table-id <TABLE_ID> \
--key '' \
--required false
```
8 changes: 8 additions & 0 deletions docs/examples/tablesdb/update-big-int-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```bash
appwrite tables-db update-big-int-column \
--database-id <DATABASE_ID> \
--table-id <TABLE_ID> \
--key '' \
--required false \
--default null
```
3 changes: 2 additions & 1 deletion docs/examples/vcs/list-repository-branches.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
```bash
appwrite vcs list-repository-branches \
--installation-id <INSTALLATION_ID> \
--provider-repository-id <PROVIDER_REPOSITORY_ID>
--provider-repository-id <PROVIDER_REPOSITORY_ID> \
--limit 25
```
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/20.2.0-rc.1/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/20.2.0-rc.1/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"

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

GITHUB_LATEST_VERSION="20.2.0-rc.1"
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"

Expand Down
2 changes: 2 additions & 0 deletions lib/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const AttributeSchema = z
"mediumtext",
"longtext",
"integer",
"bigint",
"double",
"boolean",
"datetime",
Expand Down Expand Up @@ -291,6 +292,7 @@ const ColumnSchema = z
"mediumtext",
"longtext",
"integer",
"bigint",
"double",
"boolean",
"datetime",
Expand Down
7 changes: 7 additions & 0 deletions lib/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ const initProject = async ({
projectId,
projectName,
}: InitProjectOptions = {}): Promise<void> => {
try {
localConfig.useCwdConfig();
} catch (e) {
error(e instanceof Error ? e.message : String(e));
process.exit(1);
}

try {
if (globalConfig.getEndpoint() === "" || globalConfig.getCookie() === "") {
throw new Error(
Expand Down
6 changes: 4 additions & 2 deletions lib/commands/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ import { sdkForProject, sdkForConsole } from "../sdks.js";
import {
ServiceId,
ProtocolId,
MethodId,
AuthMethod,
AppwriteException,
Client,
ImageFormat,
Expand Down Expand Up @@ -1108,7 +1108,7 @@ export class Push {
this.log("Applying auth methods statuses ...");
for (const [method, status] of Object.entries(settings.auth.methods)) {
await projectService.updateAuthMethod({
methodId: method as MethodId,
methodId: method as AuthMethod,
enabled: status,
});
}
Expand Down Expand Up @@ -1552,6 +1552,7 @@ export class Push {
);
await functionsServiceCreate.createVariable({
functionId: func["$id"],
variableId: ID.unique(),
key: variable.key,
value: variable.value,
secret: false,
Expand Down Expand Up @@ -2060,6 +2061,7 @@ export class Push {
);
await sitesServiceCreate.createVariable({
siteId: site["$id"],
variableId: ID.unique(),
key: variable.key,
value: variable.value,
secret: false,
Expand Down
12 changes: 7 additions & 5 deletions lib/commands/services/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Command } from "commander";
import {
buildQueries,
collectQueryValue,
parseWhereQuery,
parseDeprecatedWhereQuery,
parseFilterQuery,
} from "../utils/query.js";
import { sdkForConsole } from "../../sdks.js";
import {
Expand Down Expand Up @@ -85,14 +86,15 @@ This endpoint can also be used to convert an anonymous account to a normal one,
const accountListIdentitiesCommand = account
.command(`list-identities`)
.description(`Get the list of identities for the currently logged in user.`)
.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: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry`)
.option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --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: 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: string | undefined) =>
value === undefined ? true : parseBool(value),
)
.option(`--where <expression>`, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field<value, and field<=value.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseWhereQuery(value), previous))
.option(`--filter <expression>`, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field<value, and field<=value.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseFilterQuery(value), previous))
.option(`--where <expression>`, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous))
.option(`--sort-asc <attribute>`, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous))
.option(`--sort-desc <attribute>`, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous))
.option(`--limit <limit>`, `Maximum number of results to return.`, parseInteger)
Expand All @@ -101,8 +103,8 @@ const accountListIdentitiesCommand = account
.option(`--cursor-before <id>`, `Return results before this cursor ID.`)
.action(
actionRunner(
async ({ queries, total, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) =>
parse(await (await getAccountClient()).listIdentities(buildQueries({ queries, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)),
async ({ queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) =>
parse(await (await getAccountClient()).listIdentities(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)),
),
);

Expand Down
Loading