appwrite-cli 1.1.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Formula/appwrite.rb +1 -1
- package/LICENSE.md +2 -2
- package/README.md +4 -4
- package/docs/examples/account/create-phone-session.md +1 -1
- package/docs/examples/account/create.md +1 -1
- package/docs/examples/account/update-password.md +1 -1
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/console/variables.md +1 -0
- package/docs/examples/databases/create-relationship-attribute.md +9 -0
- package/docs/examples/databases/get-document.md +2 -1
- package/docs/examples/databases/update-boolean-attribute.md +6 -0
- package/docs/examples/databases/update-datetime-attribute.md +6 -0
- package/docs/examples/databases/update-email-attribute.md +6 -0
- package/docs/examples/databases/update-enum-attribute.md +7 -0
- package/docs/examples/databases/update-float-attribute.md +8 -0
- package/docs/examples/databases/update-integer-attribute.md +8 -0
- package/docs/examples/databases/update-ip-attribute.md +6 -0
- package/docs/examples/databases/update-relationship-attribute.md +5 -0
- package/docs/examples/databases/update-string-attribute.md +6 -0
- package/docs/examples/databases/update-url-attribute.md +6 -0
- package/docs/examples/functions/{retry-build.md → create-build.md} +1 -1
- package/docs/examples/functions/create.md +1 -1
- package/docs/examples/functions/update.md +1 -1
- package/docs/examples/graphql/mutation.md +2 -0
- package/docs/examples/graphql/query.md +2 -0
- package/docs/examples/projects/create.md +1 -0
- package/docs/examples/projects/update-auth-duration.md +3 -0
- package/docs/examples/projects/update-auth-password-dictionary.md +3 -0
- package/docs/examples/projects/update-auth-password-history.md +3 -0
- package/docs/examples/projects/update-auth-sessions-limit.md +3 -0
- package/docs/examples/projects/update-o-auth2.md +1 -0
- package/docs/examples/teams/create-membership.md +3 -1
- package/docs/examples/teams/get-prefs.md +2 -0
- package/docs/examples/teams/{update.md → update-name.md} +1 -1
- package/docs/examples/teams/update-prefs.md +3 -0
- package/docs/examples/users/update-password.md +1 -1
- package/docs/examples/users/update-phone.md +1 -1
- package/index.js +16 -1
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +7 -7
- package/lib/commands/account.js +46 -11
- package/lib/commands/avatars.js +3 -1
- package/lib/commands/console.js +44 -0
- package/lib/commands/databases.js +735 -109
- package/lib/commands/deploy.js +350 -141
- package/lib/commands/functions.js +44 -16
- package/lib/commands/generic.js +15 -3
- package/lib/commands/graphql.js +85 -0
- package/lib/commands/health.js +3 -1
- package/lib/commands/init.js +224 -162
- package/lib/commands/locale.js +3 -1
- package/lib/commands/projects.js +223 -9
- package/lib/commands/storage.js +43 -13
- package/lib/commands/teams.js +107 -19
- package/lib/commands/users.js +62 -11
- package/lib/config.js +122 -5
- package/lib/parser.js +7 -2
- package/lib/questions.js +311 -257
- package/package.json +1 -1
package/Formula/appwrite.rb
CHANGED
|
@@ -4,7 +4,7 @@ class Appwrite < Formula
|
|
|
4
4
|
desc "CLI is a Node based command-line tool for Appwrite API"
|
|
5
5
|
homepage "https://appwrite.io"
|
|
6
6
|
license "BSD-3-Clause"
|
|
7
|
-
head "https://github.com/appwrite/sdk-for-cli.git", branch: "
|
|
7
|
+
head "https://github.com/appwrite/sdk-for-cli.git", branch: "master"
|
|
8
8
|
|
|
9
9
|
depends_on "node"
|
|
10
10
|
|
package/LICENSE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c)
|
|
1
|
+
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
|
|
2
2
|
All rights reserved.
|
|
3
3
|
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
@@ -7,6 +7,6 @@ Redistribution and use in source and binary forms, with or without modification,
|
|
|
7
7
|
|
|
8
8
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
9
|
|
|
10
|
-
3. Neither the name
|
|
10
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
11
|
|
|
12
12
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Appwrite Command Line SDK
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
5
|
[](https://travis-ci.com/appwrite/sdk-generator)
|
|
6
6
|
[](https://twitter.com/appwrite)
|
|
7
7
|
[](https://appwrite.io/discord)
|
|
8
8
|
|
|
9
|
-
**This SDK is compatible with Appwrite server version 1.
|
|
9
|
+
**This SDK is compatible with Appwrite server version 1.3.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).**
|
|
10
10
|
|
|
11
11
|
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
|
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
31
|
$ appwrite -v
|
|
32
|
-
|
|
32
|
+
2.0.0
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### Install using prebuilt binaries
|
|
@@ -58,7 +58,7 @@ $ iwr -useb https://appwrite.io/cli/install.ps1 | iex
|
|
|
58
58
|
Once the installation completes, you can verify your install using
|
|
59
59
|
```
|
|
60
60
|
$ appwrite -v
|
|
61
|
-
|
|
61
|
+
2.0.0
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Getting Started
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
appwrite console variables
|
package/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/** Required to set max width of the help commands */
|
|
4
|
+
const oldWidth = process.stdout.columns
|
|
5
|
+
process.stdout.columns = 100
|
|
6
|
+
/** ---------------------------------------------- */
|
|
7
|
+
|
|
2
8
|
const program = require("commander");
|
|
3
9
|
const chalk = require("chalk");
|
|
4
10
|
const { version } = require("./package.json");
|
|
@@ -9,8 +15,10 @@ const { init } = require("./lib/commands/init");
|
|
|
9
15
|
const { deploy } = require("./lib/commands/deploy");
|
|
10
16
|
const { account } = require("./lib/commands/account");
|
|
11
17
|
const { avatars } = require("./lib/commands/avatars");
|
|
18
|
+
const { console } = require("./lib/commands/console");
|
|
12
19
|
const { databases } = require("./lib/commands/databases");
|
|
13
20
|
const { functions } = require("./lib/commands/functions");
|
|
21
|
+
const { graphql } = require("./lib/commands/graphql");
|
|
14
22
|
const { health } = require("./lib/commands/health");
|
|
15
23
|
const { locale } = require("./lib/commands/locale");
|
|
16
24
|
const { projects } = require("./lib/commands/projects");
|
|
@@ -20,6 +28,10 @@ const { users } = require("./lib/commands/users");
|
|
|
20
28
|
|
|
21
29
|
program
|
|
22
30
|
.description(commandDescriptions['main'])
|
|
31
|
+
.configureHelp({
|
|
32
|
+
helpWidth: process.stdout.columns || 80,
|
|
33
|
+
sortSubcommands: true
|
|
34
|
+
})
|
|
23
35
|
.version(version, "-v, --version")
|
|
24
36
|
.option("--verbose", "Show complete error log")
|
|
25
37
|
.option("--json", "Output in JSON format")
|
|
@@ -36,8 +48,10 @@ program
|
|
|
36
48
|
.addCommand(logout)
|
|
37
49
|
.addCommand(account)
|
|
38
50
|
.addCommand(avatars)
|
|
51
|
+
.addCommand(console)
|
|
39
52
|
.addCommand(databases)
|
|
40
53
|
.addCommand(functions)
|
|
54
|
+
.addCommand(graphql)
|
|
41
55
|
.addCommand(health)
|
|
42
56
|
.addCommand(locale)
|
|
43
57
|
.addCommand(projects)
|
|
@@ -46,4 +60,5 @@ program
|
|
|
46
60
|
.addCommand(users)
|
|
47
61
|
.addCommand(client)
|
|
48
62
|
.parse(process.argv);
|
|
49
|
-
|
|
63
|
+
|
|
64
|
+
process.stdout.columns = oldWidth;
|
package/install.ps1
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
# You can use "View source" of this page to see the full script.
|
|
14
14
|
|
|
15
15
|
# REPO
|
|
16
|
-
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/
|
|
17
|
-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/
|
|
16
|
+
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/2.0.0/appwrite-cli-win-x64.exe"
|
|
17
|
+
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/2.0.0/appwrite-cli-win-arm64.exe"
|
|
18
18
|
|
|
19
19
|
$APPWRITE_BINARY_NAME = "appwrite.exe"
|
|
20
20
|
|
package/install.sh
CHANGED
|
@@ -97,7 +97,7 @@ printSuccess() {
|
|
|
97
97
|
downloadBinary() {
|
|
98
98
|
echo "[2/4] Downloading executable for $OS ($ARCH) ..."
|
|
99
99
|
|
|
100
|
-
GITHUB_LATEST_VERSION="
|
|
100
|
+
GITHUB_LATEST_VERSION="2.0.0"
|
|
101
101
|
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
|
|
102
102
|
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
|
|
103
103
|
|
package/lib/client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const os = require('os');
|
|
2
|
+
const https = require("https");
|
|
2
3
|
const axios = require("axios");
|
|
3
4
|
const JSONbig = require("json-bigint")({ storeAsString: false });
|
|
4
5
|
const FormData = require("form-data");
|
|
@@ -15,8 +16,8 @@ class Client {
|
|
|
15
16
|
'x-sdk-name': 'Command Line',
|
|
16
17
|
'x-sdk-platform': 'console',
|
|
17
18
|
'x-sdk-language': 'cli',
|
|
18
|
-
'x-sdk-version': '
|
|
19
|
-
'user-agent' : `AppwriteCLI/
|
|
19
|
+
'x-sdk-version': '2.0.0',
|
|
20
|
+
'user-agent' : `AppwriteCLI/2.0.0 (${os.type()} ${os.version()}; ${os.arch()})`,
|
|
20
21
|
'X-Appwrite-Response-Format' : '1.0.0',
|
|
21
22
|
};
|
|
22
23
|
}
|
|
@@ -150,11 +151,6 @@ class Client {
|
|
|
150
151
|
params = {},
|
|
151
152
|
responseType = "json"
|
|
152
153
|
) {
|
|
153
|
-
if (this.selfSigned == true) {
|
|
154
|
-
// Allow self signed requests
|
|
155
|
-
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
154
|
headers = Object.assign({}, this.headers, headers);
|
|
159
155
|
|
|
160
156
|
let contentType = headers["content-type"].toLowerCase();
|
|
@@ -190,6 +186,10 @@ class Client {
|
|
|
190
186
|
transformResponse: [ (data) => data ? JSONbig.parse(data) : data ],
|
|
191
187
|
responseType: responseType,
|
|
192
188
|
};
|
|
189
|
+
if (this.selfSigned == true) {
|
|
190
|
+
// Allow self signed requests
|
|
191
|
+
options.httpsAgent = new https.Agent({ rejectUnauthorized: false });
|
|
192
|
+
}
|
|
193
193
|
try {
|
|
194
194
|
let response = await axios(options);
|
|
195
195
|
if (response.headers["set-cookie"]) {
|