Skip to content

Commit 03a1e15

Browse files
authored
Merge pull request #220 from appwrite/dev
feat: Command Line SDK update for version 12.0.0
2 parents 20a6015 + 8f59a27 commit 03a1e15

File tree

17 files changed

+65
-42
lines changed

17 files changed

+65
-42
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 12.0.0
4+
5+
* Change `create-deployment-template`'s `version` parameter to `type` and `reference`. eg. usage - `create-deployment-template --type tag --reference 1.0.0`
6+
* Remove `bucket-id` parameter from `create-csv-export` command
7+
* Allow enabling or disabling of image `transformations` in a bucket
8+
* Fix type generation for `point`, `lineString` and `polygon` columns
9+
310
## 11.1.1
411

512
* 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.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
2929

3030
```sh
3131
$ appwrite -v
32-
11.1.1
32+
12.0.0
3333
```
3434

3535
### Install using prebuilt binaries
@@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
6060
Once the installation completes, you can verify your install using
6161
```
6262
$ appwrite -v
63-
11.1.1
63+
12.0.0
6464
```
6565

6666
## Getting Started

docs/examples/functions/create-template-deployment.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ appwrite functions create-template-deployment \
33
--repository <REPOSITORY> \
44
--owner <OWNER> \
55
--root-directory <ROOT_DIRECTORY> \
6-
--version <VERSION>
6+
--type commit \
7+
--reference <REFERENCE>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
appwrite migrations create-csv-export \
22
--resource-id <ID1:ID2> \
3-
--bucket-id <BUCKET_ID> \
43
--filename <FILENAME>

docs/examples/sites/create-template-deployment.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ appwrite sites create-template-deployment \
33
--repository <REPOSITORY> \
44
--owner <OWNER> \
55
--root-directory <ROOT_DIRECTORY> \
6-
--version <VERSION>
6+
--type branch \
7+
--reference <REFERENCE>

install.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# You can use "View source" of this page to see the full script.
1414

1515
# REPO
16-
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/11.1.1/appwrite-cli-win-x64.exe"
17-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/11.1.1/appwrite-cli-win-arm64.exe"
16+
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/12.0.0/appwrite-cli-win-x64.exe"
17+
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/12.0.0/appwrite-cli-win-arm64.exe"
1818

1919
$APPWRITE_BINARY_NAME = "appwrite.exe"
2020

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ printSuccess() {
9797
downloadBinary() {
9898
echo "[2/4] Downloading executable for $OS ($ARCH) ..."
9999

100-
GITHUB_LATEST_VERSION="11.1.1"
100+
GITHUB_LATEST_VERSION="12.0.0"
101101
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
102102
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
103103

lib/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Client {
1616
'x-sdk-name': 'Command Line',
1717
'x-sdk-platform': 'console',
1818
'x-sdk-language': 'cli',
19-
'x-sdk-version': '11.1.1',
20-
'user-agent' : `AppwriteCLI/11.1.1 (${os.type()} ${os.version()}; ${os.arch()})`,
19+
'x-sdk-version': '12.0.0',
20+
'user-agent' : `AppwriteCLI/12.0.0 (${os.type()} ${os.version()}; ${os.arch()})`,
2121
'X-Appwrite-Response-Format' : '1.8.0',
2222
};
2323
}

lib/commands/functions.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,8 @@ const functionsCreateDuplicateDeployment = async ({functionId,deploymentId,build
819819
* @property {string} repository Repository name of the template.
820820
* @property {string} owner The name of the owner of the template.
821821
* @property {string} rootDirectory Path to function code in the template repo.
822-
* @property {string} version Version (tag) for the repo linked to the function template.
822+
* @property {TemplateReferenceType} type Type for the reference provided. Can be commit, branch, or tag
823+
* @property {string} reference Reference value, can be a commit hash, branch name, or release tag
823824
* @property {boolean} activate Automatically activate the deployment when it is finished building.
824825
* @property {boolean} overrideForCli
825826
* @property {boolean} parseOutput
@@ -829,7 +830,7 @@ const functionsCreateDuplicateDeployment = async ({functionId,deploymentId,build
829830
/**
830831
* @param {FunctionsCreateTemplateDeploymentRequestParams} params
831832
*/
832-
const functionsCreateTemplateDeployment = async ({functionId,repository,owner,rootDirectory,version,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
833+
const functionsCreateTemplateDeployment = async ({functionId,repository,owner,rootDirectory,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
833834
let client = !sdk ? await sdkForProject() :
834835
sdk;
835836
let apiPath = '/functions/{functionId}/deployments/template'.replace('{functionId}', functionId);
@@ -843,8 +844,11 @@ const functionsCreateTemplateDeployment = async ({functionId,repository,owner,ro
843844
if (typeof rootDirectory !== 'undefined') {
844845
payload['rootDirectory'] = rootDirectory;
845846
}
846-
if (typeof version !== 'undefined') {
847-
payload['version'] = version;
847+
if (typeof type !== 'undefined') {
848+
payload['type'] = type;
849+
}
850+
if (typeof reference !== 'undefined') {
851+
payload['reference'] = reference;
848852
}
849853
if (typeof activate !== 'undefined') {
850854
payload['activate'] = activate;
@@ -866,7 +870,7 @@ const functionsCreateTemplateDeployment = async ({functionId,repository,owner,ro
866870
/**
867871
* @typedef {Object} FunctionsCreateVcsDeploymentRequestParams
868872
* @property {string} functionId Function ID.
869-
* @property {VCSDeploymentType} type Type of reference passed. Allowed values are: branch, commit
873+
* @property {VCSReferenceType} type Type of reference passed. Allowed values are: branch, commit
870874
* @property {string} reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
871875
* @property {boolean} activate Automatically activate the deployment when it is finished building.
872876
* @property {boolean} overrideForCli
@@ -1565,7 +1569,8 @@ functions
15651569
.requiredOption(`--repository <repository>`, `Repository name of the template.`)
15661570
.requiredOption(`--owner <owner>`, `The name of the owner of the template.`)
15671571
.requiredOption(`--root-directory <root-directory>`, `Path to function code in the template repo.`)
1568-
.requiredOption(`--version <version>`, `Version (tag) for the repo linked to the function template.`)
1572+
.requiredOption(`--type <type>`, `Type for the reference provided. Can be commit, branch, or tag`)
1573+
.requiredOption(`--reference <reference>`, `Reference value, can be a commit hash, branch name, or release tag`)
15691574
.option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
15701575
.action(actionRunner(functionsCreateTemplateDeployment))
15711576

lib/commands/migrations.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ const migrationsGetAppwriteReport = async ({resources,endpoint,projectID,key,par
172172
/**
173173
* @typedef {Object} MigrationsCreateCSVExportRequestParams
174174
* @property {string} resourceId Composite ID in the format {databaseId:collectionId}, identifying a collection within a database to export.
175-
* @property {string} bucketId Storage bucket unique ID where the exported CSV will be stored.
176175
* @property {string} filename The name of the file to be created for the export, excluding the .csv extension.
177176
* @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.
178177
* @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.
@@ -189,17 +188,14 @@ const migrationsGetAppwriteReport = async ({resources,endpoint,projectID,key,par
189188
/**
190189
* @param {MigrationsCreateCSVExportRequestParams} params
191190
*/
192-
const migrationsCreateCSVExport = async ({resourceId,bucketId,filename,columns,queries,delimiter,enclosure,escape,header,notify,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
191+
const migrationsCreateCSVExport = async ({resourceId,filename,columns,queries,delimiter,enclosure,escape,header,notify,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
193192
let client = !sdk ? await sdkForProject() :
194193
sdk;
195194
let apiPath = '/migrations/csv/exports';
196195
let payload = {};
197196
if (typeof resourceId !== 'undefined') {
198197
payload['resourceId'] = resourceId;
199198
}
200-
if (typeof bucketId !== 'undefined') {
201-
payload['bucketId'] = bucketId;
202-
}
203199
if (typeof filename !== 'undefined') {
204200
payload['filename'] = filename;
205201
}
@@ -712,9 +708,8 @@ migrations
712708

713709
migrations
714710
.command(`create-csv-export`)
715-
.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.`)
711+
.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.`)
716712
.requiredOption(`--resource-id <resource-id>`, `Composite ID in the format {databaseId:collectionId}, identifying a collection within a database to export.`)
717-
.requiredOption(`--bucket-id <bucket-id>`, `Storage bucket unique ID where the exported CSV will be stored.`)
718713
.requiredOption(`--filename <filename>`, `The name of the file to be created for the export, excluding the .csv extension.`)
719714
.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.`)
720715
.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.`)

0 commit comments

Comments
 (0)