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

## 12.0.0

* Change `create-deployment-template`'s `version` parameter to `type` and `reference`. eg. usage - `create-deployment-template --type tag --reference 1.0.0`
* Remove `bucket-id` parameter from `create-csv-export` command
* Allow enabling or disabling of image `transformations` in a bucket
* Fix type generation for `point`, `lineString` and `polygon` columns

## 11.1.1

* Fix duplicate `enums` during type generation by prefixing them with table name. For example, `enum MyEnum` will now be generated as `enum MyTableMyEnum` to avoid conflicts.
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.1.1
12.0.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.1.1
12.0.0
```

## Getting Started
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/functions/create-template-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ appwrite functions create-template-deployment \
--repository <REPOSITORY> \
--owner <OWNER> \
--root-directory <ROOT_DIRECTORY> \
--version <VERSION>
--type commit \
--reference <REFERENCE>
1 change: 0 additions & 1 deletion docs/examples/migrations/create-csv-export.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
appwrite migrations create-csv-export \
--resource-id <ID1:ID2> \
--bucket-id <BUCKET_ID> \
--filename <FILENAME>
3 changes: 2 additions & 1 deletion docs/examples/sites/create-template-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ appwrite sites create-template-deployment \
--repository <REPOSITORY> \
--owner <OWNER> \
--root-directory <ROOT_DIRECTORY> \
--version <VERSION>
--type branch \
--reference <REFERENCE>
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.1.1/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/11.1.1/appwrite-cli-win-arm64.exe"
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/12.0.0/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/12.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 @@ -97,7 +97,7 @@ printSuccess() {
downloadBinary() {
echo "[2/4] Downloading executable for $OS ($ARCH) ..."

GITHUB_LATEST_VERSION="11.1.1"
GITHUB_LATEST_VERSION="12.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
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.1.1',
'user-agent' : `AppwriteCLI/11.1.1 (${os.type()} ${os.version()}; ${os.arch()})`,
'x-sdk-version': '12.0.0',
'user-agent' : `AppwriteCLI/12.0.0 (${os.type()} ${os.version()}; ${os.arch()})`,
'X-Appwrite-Response-Format' : '1.8.0',
};
}
Expand Down
17 changes: 11 additions & 6 deletions lib/commands/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,8 @@ const functionsCreateDuplicateDeployment = async ({functionId,deploymentId,build
* @property {string} repository Repository name of the template.
* @property {string} owner The name of the owner of the template.
* @property {string} rootDirectory Path to function code in the template repo.
* @property {string} version Version (tag) for the repo linked to the function template.
* @property {TemplateReferenceType} type Type for the reference provided. Can be commit, branch, or tag
* @property {string} reference Reference value, can be a commit hash, branch name, or release tag
* @property {boolean} activate Automatically activate the deployment when it is finished building.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
Expand All @@ -829,7 +830,7 @@ const functionsCreateDuplicateDeployment = async ({functionId,deploymentId,build
/**
* @param {FunctionsCreateTemplateDeploymentRequestParams} params
*/
const functionsCreateTemplateDeployment = async ({functionId,repository,owner,rootDirectory,version,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
const functionsCreateTemplateDeployment = async ({functionId,repository,owner,rootDirectory,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/functions/{functionId}/deployments/template'.replace('{functionId}', functionId);
Expand All @@ -843,8 +844,11 @@ const functionsCreateTemplateDeployment = async ({functionId,repository,owner,ro
if (typeof rootDirectory !== 'undefined') {
payload['rootDirectory'] = rootDirectory;
}
if (typeof version !== 'undefined') {
payload['version'] = version;
if (typeof type !== 'undefined') {
payload['type'] = type;
}
if (typeof reference !== 'undefined') {
payload['reference'] = reference;
}
if (typeof activate !== 'undefined') {
payload['activate'] = activate;
Expand All @@ -866,7 +870,7 @@ const functionsCreateTemplateDeployment = async ({functionId,repository,owner,ro
/**
* @typedef {Object} FunctionsCreateVcsDeploymentRequestParams
* @property {string} functionId Function ID.
* @property {VCSDeploymentType} type Type of reference passed. Allowed values are: branch, commit
* @property {VCSReferenceType} type Type of reference passed. Allowed values are: branch, commit
* @property {string} reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
* @property {boolean} activate Automatically activate the deployment when it is finished building.
* @property {boolean} overrideForCli
Expand Down Expand Up @@ -1565,7 +1569,8 @@ functions
.requiredOption(`--repository <repository>`, `Repository name of the template.`)
.requiredOption(`--owner <owner>`, `The name of the owner of the template.`)
.requiredOption(`--root-directory <root-directory>`, `Path to function code in the template repo.`)
.requiredOption(`--version <version>`, `Version (tag) for the repo linked to the function template.`)
.requiredOption(`--type <type>`, `Type for the reference provided. Can be commit, branch, or tag`)
.requiredOption(`--reference <reference>`, `Reference value, can be a commit hash, branch name, or release tag`)
.option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
.action(actionRunner(functionsCreateTemplateDeployment))

Expand Down
9 changes: 2 additions & 7 deletions lib/commands/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ const migrationsGetAppwriteReport = async ({resources,endpoint,projectID,key,par
/**
* @typedef {Object} MigrationsCreateCSVExportRequestParams
* @property {string} resourceId Composite ID in the format {databaseId:collectionId}, identifying a collection within a database to export.
* @property {string} bucketId Storage bucket unique ID where the exported CSV will be stored.
* @property {string} filename The name of the file to be created for the export, excluding the .csv extension.
* @property {string[]} columns List of attributes to export. If empty, all attributes will be exported. You can use the &#039;*&#039; wildcard to export all attributes from the collection.
* @property {string[]} queries Array of query strings generated using the Query class provided by the SDK to filter documents to export. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.
Expand All @@ -189,17 +188,14 @@ const migrationsGetAppwriteReport = async ({resources,endpoint,projectID,key,par
/**
* @param {MigrationsCreateCSVExportRequestParams} params
*/
const migrationsCreateCSVExport = async ({resourceId,bucketId,filename,columns,queries,delimiter,enclosure,escape,header,notify,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
const migrationsCreateCSVExport = async ({resourceId,filename,columns,queries,delimiter,enclosure,escape,header,notify,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/migrations/csv/exports';
let payload = {};
if (typeof resourceId !== 'undefined') {
payload['resourceId'] = resourceId;
}
if (typeof bucketId !== 'undefined') {
payload['bucketId'] = bucketId;
}
if (typeof filename !== 'undefined') {
payload['filename'] = filename;
}
Expand Down Expand Up @@ -712,9 +708,8 @@ migrations

migrations
.command(`create-csv-export`)
.description(`Export documents to a CSV file from your Appwrite database. This endpoint allows you to export documents to a CSV file stored in an Appwrite Storage bucket.`)
.description(`Export documents to a CSV file from your Appwrite database. This endpoint allows you to export documents to a CSV file stored in a secure internal bucket. You'll receive an email with a download link when the export is complete.`)
.requiredOption(`--resource-id <resource-id>`, `Composite ID in the format {databaseId:collectionId}, identifying a collection within a database to export.`)
.requiredOption(`--bucket-id <bucket-id>`, `Storage bucket unique ID where the exported CSV will be stored.`)
.requiredOption(`--filename <filename>`, `The name of the file to be created for the export, excluding the .csv extension.`)
.option(`--columns [columns...]`, `List of attributes to export. If empty, all attributes will be exported. You can use the '*' wildcard to export all attributes from the collection.`)
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK to filter documents to export. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.`)
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ projects
.description(`Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.`)
.requiredOption(`--project-id <project-id>`, `Project unique ID.`)
.requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
.requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`)
.option(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`)
.option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`)
.action(actionRunner(projectsCreateKey))

Expand All @@ -2340,7 +2340,7 @@ projects
.requiredOption(`--project-id <project-id>`, `Project unique ID.`)
.requiredOption(`--key-id <key-id>`, `Key unique ID.`)
.requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
.requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 events are allowed.`)
.option(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 events are allowed.`)
.option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`)
.action(actionRunner(projectsUpdateKey))

Expand Down
17 changes: 11 additions & 6 deletions lib/commands/sites.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,8 @@ const sitesCreateDuplicateDeployment = async ({siteId,deploymentId,parseOutput =
* @property {string} repository Repository name of the template.
* @property {string} owner The name of the owner of the template.
* @property {string} rootDirectory Path to site code in the template repo.
* @property {string} version Version (tag) for the repo linked to the site template.
* @property {TemplateReferenceType} type Type for the reference provided. Can be commit, branch, or tag
* @property {string} reference Reference value, can be a commit hash, branch name, or release tag
* @property {boolean} activate Automatically activate the deployment when it is finished building.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
Expand All @@ -823,7 +824,7 @@ const sitesCreateDuplicateDeployment = async ({siteId,deploymentId,parseOutput =
/**
* @param {SitesCreateTemplateDeploymentRequestParams} params
*/
const sitesCreateTemplateDeployment = async ({siteId,repository,owner,rootDirectory,version,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
const sitesCreateTemplateDeployment = async ({siteId,repository,owner,rootDirectory,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/sites/{siteId}/deployments/template'.replace('{siteId}', siteId);
Expand All @@ -837,8 +838,11 @@ const sitesCreateTemplateDeployment = async ({siteId,repository,owner,rootDirect
if (typeof rootDirectory !== 'undefined') {
payload['rootDirectory'] = rootDirectory;
}
if (typeof version !== 'undefined') {
payload['version'] = version;
if (typeof type !== 'undefined') {
payload['type'] = type;
}
if (typeof reference !== 'undefined') {
payload['reference'] = reference;
}
if (typeof activate !== 'undefined') {
payload['activate'] = activate;
Expand All @@ -860,7 +864,7 @@ const sitesCreateTemplateDeployment = async ({siteId,repository,owner,rootDirect
/**
* @typedef {Object} SitesCreateVcsDeploymentRequestParams
* @property {string} siteId Site ID.
* @property {VCSDeploymentType} type Type of reference passed. Allowed values are: branch, commit
* @property {VCSReferenceType} type Type of reference passed. Allowed values are: branch, commit
* @property {string} reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
* @property {boolean} activate Automatically activate the deployment when it is finished building.
* @property {boolean} overrideForCli
Expand Down Expand Up @@ -1501,7 +1505,8 @@ sites
.requiredOption(`--repository <repository>`, `Repository name of the template.`)
.requiredOption(`--owner <owner>`, `The name of the owner of the template.`)
.requiredOption(`--root-directory <root-directory>`, `Path to site code in the template repo.`)
.requiredOption(`--version <version>`, `Version (tag) for the repo linked to the site template.`)
.requiredOption(`--type <type>`, `Type for the reference provided. Can be commit, branch, or tag`)
.requiredOption(`--reference <reference>`, `Reference value, can be a commit hash, branch name, or release tag`)
.option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
.action(actionRunner(sitesCreateTemplateDeployment))

Expand Down
Loading