appwrite-cli 9.1.0 → 10.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/CHANGELOG.md +9 -0
- package/README.md +2 -2
- package/index.js +0 -2
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +2 -2
- package/lib/commands/databases.js +19 -13
- package/lib/commands/pull.js +16 -10
- package/lib/commands/tables-db.js +26 -20
- package/lib/parser.js +5 -2
- package/lib/type-generation/languages/typescript.js +3 -1
- package/package.json +1 -1
- package/scoop/appwrite.config.json +3 -3
- package/docs/examples/avatars/get-browser.md +0 -2
- package/docs/examples/avatars/get-credit-card.md +0 -2
- package/docs/examples/avatars/get-favicon.md +0 -2
- package/docs/examples/avatars/get-flag.md +0 -2
- package/docs/examples/avatars/get-image.md +0 -2
- package/docs/examples/avatars/get-initials.md +0 -1
- package/docs/examples/avatars/get-qr.md +0 -2
- package/lib/commands/avatars.js +0 -484
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 10.0.0
|
|
4
|
+
|
|
5
|
+
* **Breaking:** Removed Avatars CLI command and all related subcommands; corresponding examples deleted
|
|
6
|
+
* **Feat:** Geo defaults now accept coordinate arrays for Databases and Tables DB, with automatic normalization
|
|
7
|
+
* **Feat:** Pull command skips deprecated resources by default and shows clearer totals/messages
|
|
8
|
+
* **Feat:** Updated CLI descriptions: Databases marked legacy; added tables-db, projects, and project
|
|
9
|
+
* Fix TypeScript type generation now quotes invalid property names to produce valid typings
|
|
10
|
+
* Update documentation: Removed Avatars CLI examples and updated help text to reflect new geo defaults and terminology
|
|
11
|
+
|
|
3
12
|
## 8.3.0
|
|
4
13
|
|
|
5
14
|
* **Feat:** Add support for `appwrite.config.json` file
|
package/README.md
CHANGED
|
@@ -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
|
+
10.0.0
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### Install using prebuilt binaries
|
|
@@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
|
|
|
60
60
|
Once the installation completes, you can verify your install using
|
|
61
61
|
```
|
|
62
62
|
$ appwrite -v
|
|
63
|
-
|
|
63
|
+
10.0.0
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## Getting Started
|
package/index.js
CHANGED
|
@@ -20,7 +20,6 @@ const { run } = require("./lib/commands/run");
|
|
|
20
20
|
const { push, deploy } = require("./lib/commands/push");
|
|
21
21
|
const { update } = require("./lib/commands/update");
|
|
22
22
|
const { account } = require("./lib/commands/account");
|
|
23
|
-
const { avatars } = require("./lib/commands/avatars");
|
|
24
23
|
const { console } = require("./lib/commands/console");
|
|
25
24
|
const { databases } = require("./lib/commands/databases");
|
|
26
25
|
const { functions } = require("./lib/commands/functions");
|
|
@@ -124,7 +123,6 @@ program
|
|
|
124
123
|
.addCommand(update)
|
|
125
124
|
.addCommand(logout)
|
|
126
125
|
.addCommand(account)
|
|
127
|
-
.addCommand(avatars)
|
|
128
126
|
.addCommand(console)
|
|
129
127
|
.addCommand(databases)
|
|
130
128
|
.addCommand(functions)
|
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/10.0.0/appwrite-cli-win-x64.exe"
|
|
17
|
+
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/10.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="10.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
|
@@ -16,8 +16,8 @@ class Client {
|
|
|
16
16
|
'x-sdk-name': 'Command Line',
|
|
17
17
|
'x-sdk-platform': 'console',
|
|
18
18
|
'x-sdk-language': 'cli',
|
|
19
|
-
'x-sdk-version': '
|
|
20
|
-
'user-agent' : `AppwriteCLI/
|
|
19
|
+
'x-sdk-version': '10.0.0',
|
|
20
|
+
'user-agent' : `AppwriteCLI/10.0.0 (${os.type()} ${os.version()}; ${os.arch()})`,
|
|
21
21
|
'X-Appwrite-Response-Format' : '1.8.0',
|
|
22
22
|
};
|
|
23
23
|
}
|
|
@@ -1185,7 +1185,7 @@ const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,
|
|
|
1185
1185
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1186
1186
|
* @property {string} key Attribute Key.
|
|
1187
1187
|
* @property {boolean} required Is attribute required?
|
|
1188
|
-
* @property {
|
|
1188
|
+
* @property {any[]} xdefault Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
|
|
1189
1189
|
* @property {boolean} overrideForCli
|
|
1190
1190
|
* @property {boolean} parseOutput
|
|
1191
1191
|
* @property {libClient | undefined} sdk
|
|
@@ -1205,6 +1205,7 @@ const databasesCreateLineAttribute = async ({databaseId,collectionId,key,require
|
|
|
1205
1205
|
if (typeof required !== 'undefined') {
|
|
1206
1206
|
payload['required'] = required;
|
|
1207
1207
|
}
|
|
1208
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1208
1209
|
if (typeof xdefault !== 'undefined') {
|
|
1209
1210
|
payload['default'] = xdefault;
|
|
1210
1211
|
}
|
|
@@ -1228,7 +1229,7 @@ const databasesCreateLineAttribute = async ({databaseId,collectionId,key,require
|
|
|
1228
1229
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
|
|
1229
1230
|
* @property {string} key Attribute Key.
|
|
1230
1231
|
* @property {boolean} required Is attribute required?
|
|
1231
|
-
* @property {
|
|
1232
|
+
* @property {any[]} xdefault Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
|
|
1232
1233
|
* @property {string} newKey New attribute key.
|
|
1233
1234
|
* @property {boolean} overrideForCli
|
|
1234
1235
|
* @property {boolean} parseOutput
|
|
@@ -1246,6 +1247,7 @@ const databasesUpdateLineAttribute = async ({databaseId,collectionId,key,require
|
|
|
1246
1247
|
if (typeof required !== 'undefined') {
|
|
1247
1248
|
payload['required'] = required;
|
|
1248
1249
|
}
|
|
1250
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1249
1251
|
if (typeof xdefault !== 'undefined') {
|
|
1250
1252
|
payload['default'] = xdefault;
|
|
1251
1253
|
}
|
|
@@ -1272,7 +1274,7 @@ const databasesUpdateLineAttribute = async ({databaseId,collectionId,key,require
|
|
|
1272
1274
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1273
1275
|
* @property {string} key Attribute Key.
|
|
1274
1276
|
* @property {boolean} required Is attribute required?
|
|
1275
|
-
* @property {
|
|
1277
|
+
* @property {any[]} xdefault Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
|
|
1276
1278
|
* @property {boolean} overrideForCli
|
|
1277
1279
|
* @property {boolean} parseOutput
|
|
1278
1280
|
* @property {libClient | undefined} sdk
|
|
@@ -1292,6 +1294,7 @@ const databasesCreatePointAttribute = async ({databaseId,collectionId,key,requir
|
|
|
1292
1294
|
if (typeof required !== 'undefined') {
|
|
1293
1295
|
payload['required'] = required;
|
|
1294
1296
|
}
|
|
1297
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1295
1298
|
if (typeof xdefault !== 'undefined') {
|
|
1296
1299
|
payload['default'] = xdefault;
|
|
1297
1300
|
}
|
|
@@ -1315,7 +1318,7 @@ const databasesCreatePointAttribute = async ({databaseId,collectionId,key,requir
|
|
|
1315
1318
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
|
|
1316
1319
|
* @property {string} key Attribute Key.
|
|
1317
1320
|
* @property {boolean} required Is attribute required?
|
|
1318
|
-
* @property {
|
|
1321
|
+
* @property {any[]} xdefault Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
|
|
1319
1322
|
* @property {string} newKey New attribute key.
|
|
1320
1323
|
* @property {boolean} overrideForCli
|
|
1321
1324
|
* @property {boolean} parseOutput
|
|
@@ -1333,6 +1336,7 @@ const databasesUpdatePointAttribute = async ({databaseId,collectionId,key,requir
|
|
|
1333
1336
|
if (typeof required !== 'undefined') {
|
|
1334
1337
|
payload['required'] = required;
|
|
1335
1338
|
}
|
|
1339
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1336
1340
|
if (typeof xdefault !== 'undefined') {
|
|
1337
1341
|
payload['default'] = xdefault;
|
|
1338
1342
|
}
|
|
@@ -1359,7 +1363,7 @@ const databasesUpdatePointAttribute = async ({databaseId,collectionId,key,requir
|
|
|
1359
1363
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1360
1364
|
* @property {string} key Attribute Key.
|
|
1361
1365
|
* @property {boolean} required Is attribute required?
|
|
1362
|
-
* @property {
|
|
1366
|
+
* @property {any[]} xdefault Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
|
|
1363
1367
|
* @property {boolean} overrideForCli
|
|
1364
1368
|
* @property {boolean} parseOutput
|
|
1365
1369
|
* @property {libClient | undefined} sdk
|
|
@@ -1379,6 +1383,7 @@ const databasesCreatePolygonAttribute = async ({databaseId,collectionId,key,requ
|
|
|
1379
1383
|
if (typeof required !== 'undefined') {
|
|
1380
1384
|
payload['required'] = required;
|
|
1381
1385
|
}
|
|
1386
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1382
1387
|
if (typeof xdefault !== 'undefined') {
|
|
1383
1388
|
payload['default'] = xdefault;
|
|
1384
1389
|
}
|
|
@@ -1402,7 +1407,7 @@ const databasesCreatePolygonAttribute = async ({databaseId,collectionId,key,requ
|
|
|
1402
1407
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
|
|
1403
1408
|
* @property {string} key Attribute Key.
|
|
1404
1409
|
* @property {boolean} required Is attribute required?
|
|
1405
|
-
* @property {
|
|
1410
|
+
* @property {any[]} xdefault Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
|
|
1406
1411
|
* @property {string} newKey New attribute key.
|
|
1407
1412
|
* @property {boolean} overrideForCli
|
|
1408
1413
|
* @property {boolean} parseOutput
|
|
@@ -1420,6 +1425,7 @@ const databasesUpdatePolygonAttribute = async ({databaseId,collectionId,key,requ
|
|
|
1420
1425
|
if (typeof required !== 'undefined') {
|
|
1421
1426
|
payload['required'] = required;
|
|
1422
1427
|
}
|
|
1428
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1423
1429
|
if (typeof xdefault !== 'undefined') {
|
|
1424
1430
|
payload['default'] = xdefault;
|
|
1425
1431
|
}
|
|
@@ -2851,7 +2857,7 @@ databases
|
|
|
2851
2857
|
.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).`)
|
|
2852
2858
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2853
2859
|
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2854
|
-
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided,
|
|
2860
|
+
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`)
|
|
2855
2861
|
.action(actionRunner(databasesCreateLineAttribute))
|
|
2856
2862
|
|
|
2857
2863
|
databases
|
|
@@ -2861,18 +2867,18 @@ databases
|
|
|
2861
2867
|
.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#createCollection).`)
|
|
2862
2868
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2863
2869
|
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2864
|
-
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided,
|
|
2870
|
+
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`)
|
|
2865
2871
|
.option(`--new-key <new-key>`, `New attribute key.`)
|
|
2866
2872
|
.action(actionRunner(databasesUpdateLineAttribute))
|
|
2867
2873
|
|
|
2868
2874
|
databases
|
|
2869
2875
|
.command(`create-point-attribute`)
|
|
2870
|
-
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-point-column' instead] Create a geometric
|
|
2876
|
+
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-point-column' instead] Create a geometric point attribute.`)
|
|
2871
2877
|
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
2872
2878
|
.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).`)
|
|
2873
2879
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2874
2880
|
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2875
|
-
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided,
|
|
2881
|
+
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`)
|
|
2876
2882
|
.action(actionRunner(databasesCreatePointAttribute))
|
|
2877
2883
|
|
|
2878
2884
|
databases
|
|
@@ -2882,7 +2888,7 @@ databases
|
|
|
2882
2888
|
.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#createCollection).`)
|
|
2883
2889
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2884
2890
|
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2885
|
-
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided,
|
|
2891
|
+
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`)
|
|
2886
2892
|
.option(`--new-key <new-key>`, `New attribute key.`)
|
|
2887
2893
|
.action(actionRunner(databasesUpdatePointAttribute))
|
|
2888
2894
|
|
|
@@ -2893,7 +2899,7 @@ databases
|
|
|
2893
2899
|
.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).`)
|
|
2894
2900
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2895
2901
|
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2896
|
-
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided,
|
|
2902
|
+
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`)
|
|
2897
2903
|
.action(actionRunner(databasesCreatePolygonAttribute))
|
|
2898
2904
|
|
|
2899
2905
|
databases
|
|
@@ -2903,7 +2909,7 @@ databases
|
|
|
2903
2909
|
.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#createCollection).`)
|
|
2904
2910
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2905
2911
|
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2906
|
-
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided,
|
|
2912
|
+
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`)
|
|
2907
2913
|
.option(`--new-key <new-key>`, `New attribute key.`)
|
|
2908
2914
|
.action(actionRunner(databasesUpdatePolygonAttribute))
|
|
2909
2915
|
|
package/lib/commands/pull.js
CHANGED
|
@@ -295,7 +295,8 @@ const pullSites = async ({ code, withVariables }) => {
|
|
|
295
295
|
const pullCollection = async () => {
|
|
296
296
|
warn("appwrite pull collection has been deprecated. Please consider using 'appwrite pull tables' instead");
|
|
297
297
|
log("Fetching collections ...");
|
|
298
|
-
let
|
|
298
|
+
let totalDatabases = 0;
|
|
299
|
+
let totalCollections = 0;
|
|
299
300
|
|
|
300
301
|
const fetchResponse = await databasesList({
|
|
301
302
|
queries: [JSON.stringify({ method: 'limit', values: [1] })],
|
|
@@ -303,7 +304,7 @@ const pullCollection = async () => {
|
|
|
303
304
|
});
|
|
304
305
|
if (fetchResponse["databases"].length <= 0) {
|
|
305
306
|
log("No collections found.");
|
|
306
|
-
success(`Successfully pulled ${chalk.bold(
|
|
307
|
+
success(`Successfully pulled ${chalk.bold(totalCollections)} collections from ${chalk.bold(totalDatabases)} databases.`);
|
|
307
308
|
return;
|
|
308
309
|
}
|
|
309
310
|
|
|
@@ -323,7 +324,7 @@ const pullCollection = async () => {
|
|
|
323
324
|
parseOutput: false
|
|
324
325
|
});
|
|
325
326
|
|
|
326
|
-
|
|
327
|
+
totalDatabases++;
|
|
327
328
|
log(`Pulling all collections from ${chalk.bold(database['name'])} database ...`);
|
|
328
329
|
|
|
329
330
|
localConfig.addDatabase(database);
|
|
@@ -334,6 +335,7 @@ const pullCollection = async () => {
|
|
|
334
335
|
}, 100, 'collections');
|
|
335
336
|
|
|
336
337
|
for (const collection of collections) {
|
|
338
|
+
totalCollections++;
|
|
337
339
|
localConfig.addCollection({
|
|
338
340
|
...collection,
|
|
339
341
|
'$createdAt': undefined,
|
|
@@ -342,12 +344,13 @@ const pullCollection = async () => {
|
|
|
342
344
|
}
|
|
343
345
|
}
|
|
344
346
|
|
|
345
|
-
success(`Successfully pulled ${chalk.bold(
|
|
347
|
+
success(`Successfully pulled ${chalk.bold(totalCollections)} collections from ${chalk.bold(totalDatabases)} databases.`);
|
|
346
348
|
}
|
|
347
349
|
|
|
348
350
|
const pullTable = async () => {
|
|
349
351
|
log("Fetching tables ...");
|
|
350
|
-
let
|
|
352
|
+
let totalTablesDBs = 0;
|
|
353
|
+
let totalTables = 0;
|
|
351
354
|
|
|
352
355
|
const fetchResponse = await tablesDBList({
|
|
353
356
|
queries: [JSON.stringify({ method: 'limit', values: [1] })],
|
|
@@ -355,7 +358,7 @@ const pullTable = async () => {
|
|
|
355
358
|
});
|
|
356
359
|
if (fetchResponse["databases"].length <= 0) {
|
|
357
360
|
log("No tables found.");
|
|
358
|
-
success(`Successfully pulled ${chalk.bold(
|
|
361
|
+
success(`Successfully pulled ${chalk.bold(totalTables)} tables from ${chalk.bold(totalTablesDBs)} tables databases.`);
|
|
359
362
|
return;
|
|
360
363
|
}
|
|
361
364
|
|
|
@@ -375,7 +378,7 @@ const pullTable = async () => {
|
|
|
375
378
|
parseOutput: false
|
|
376
379
|
});
|
|
377
380
|
|
|
378
|
-
|
|
381
|
+
totalTablesDBs++;
|
|
379
382
|
log(`Pulling all tables from ${chalk.bold(database['name'])} database ...`);
|
|
380
383
|
|
|
381
384
|
localConfig.addTablesDB(database);
|
|
@@ -386,6 +389,7 @@ const pullTable = async () => {
|
|
|
386
389
|
}, 100, 'tables');
|
|
387
390
|
|
|
388
391
|
for (const table of tables) {
|
|
392
|
+
totalTables++;
|
|
389
393
|
localConfig.addTable({
|
|
390
394
|
...table,
|
|
391
395
|
'$createdAt': undefined,
|
|
@@ -394,7 +398,7 @@ const pullTable = async () => {
|
|
|
394
398
|
}
|
|
395
399
|
}
|
|
396
400
|
|
|
397
|
-
success(`Successfully pulled ${chalk.bold(
|
|
401
|
+
success(`Successfully pulled ${chalk.bold(totalTables)} tables from ${chalk.bold(totalTablesDBs)} tables databases.`);
|
|
398
402
|
}
|
|
399
403
|
|
|
400
404
|
const pullBucket = async () => {
|
|
@@ -474,14 +478,16 @@ const pullMessagingTopic = async () => {
|
|
|
474
478
|
|
|
475
479
|
const pull = new Command("pull")
|
|
476
480
|
.description(commandDescriptions['pull'])
|
|
477
|
-
.action(actionRunner(pullResources));
|
|
481
|
+
.action(actionRunner(() => pullResources({ skipDeprecated: true })));
|
|
478
482
|
|
|
479
483
|
pull
|
|
480
484
|
.command("all")
|
|
481
485
|
.description("Pull all resource.")
|
|
482
486
|
.action(actionRunner(() => {
|
|
483
487
|
cliConfig.all = true;
|
|
484
|
-
return pullResources(
|
|
488
|
+
return pullResources({
|
|
489
|
+
skipDeprecated: true
|
|
490
|
+
});
|
|
485
491
|
}));
|
|
486
492
|
|
|
487
493
|
pull
|
|
@@ -1185,7 +1185,7 @@ const tablesDBUpdateIpColumn = async ({databaseId,tableId,key,required,xdefault,
|
|
|
1185
1185
|
* @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
|
|
1186
1186
|
* @property {string} key Column Key.
|
|
1187
1187
|
* @property {boolean} required Is column required?
|
|
1188
|
-
* @property {
|
|
1188
|
+
* @property {any[]} xdefault Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
|
|
1189
1189
|
* @property {boolean} overrideForCli
|
|
1190
1190
|
* @property {boolean} parseOutput
|
|
1191
1191
|
* @property {libClient | undefined} sdk
|
|
@@ -1205,6 +1205,7 @@ const tablesDBCreateLineColumn = async ({databaseId,tableId,key,required,xdefaul
|
|
|
1205
1205
|
if (typeof required !== 'undefined') {
|
|
1206
1206
|
payload['required'] = required;
|
|
1207
1207
|
}
|
|
1208
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1208
1209
|
if (typeof xdefault !== 'undefined') {
|
|
1209
1210
|
payload['default'] = xdefault;
|
|
1210
1211
|
}
|
|
@@ -1228,7 +1229,7 @@ const tablesDBCreateLineColumn = async ({databaseId,tableId,key,required,xdefaul
|
|
|
1228
1229
|
* @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
|
|
1229
1230
|
* @property {string} key Column Key.
|
|
1230
1231
|
* @property {boolean} required Is column required?
|
|
1231
|
-
* @property {
|
|
1232
|
+
* @property {any[]} xdefault Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
|
|
1232
1233
|
* @property {string} newKey New Column Key.
|
|
1233
1234
|
* @property {boolean} overrideForCli
|
|
1234
1235
|
* @property {boolean} parseOutput
|
|
@@ -1246,6 +1247,7 @@ const tablesDBUpdateLineColumn = async ({databaseId,tableId,key,required,xdefaul
|
|
|
1246
1247
|
if (typeof required !== 'undefined') {
|
|
1247
1248
|
payload['required'] = required;
|
|
1248
1249
|
}
|
|
1250
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1249
1251
|
if (typeof xdefault !== 'undefined') {
|
|
1250
1252
|
payload['default'] = xdefault;
|
|
1251
1253
|
}
|
|
@@ -1272,7 +1274,7 @@ const tablesDBUpdateLineColumn = async ({databaseId,tableId,key,required,xdefaul
|
|
|
1272
1274
|
* @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
|
|
1273
1275
|
* @property {string} key Column Key.
|
|
1274
1276
|
* @property {boolean} required Is column required?
|
|
1275
|
-
* @property {
|
|
1277
|
+
* @property {any[]} xdefault Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
|
|
1276
1278
|
* @property {boolean} overrideForCli
|
|
1277
1279
|
* @property {boolean} parseOutput
|
|
1278
1280
|
* @property {libClient | undefined} sdk
|
|
@@ -1292,6 +1294,7 @@ const tablesDBCreatePointColumn = async ({databaseId,tableId,key,required,xdefau
|
|
|
1292
1294
|
if (typeof required !== 'undefined') {
|
|
1293
1295
|
payload['required'] = required;
|
|
1294
1296
|
}
|
|
1297
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1295
1298
|
if (typeof xdefault !== 'undefined') {
|
|
1296
1299
|
payload['default'] = xdefault;
|
|
1297
1300
|
}
|
|
@@ -1315,7 +1318,7 @@ const tablesDBCreatePointColumn = async ({databaseId,tableId,key,required,xdefau
|
|
|
1315
1318
|
* @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
|
|
1316
1319
|
* @property {string} key Column Key.
|
|
1317
1320
|
* @property {boolean} required Is column required?
|
|
1318
|
-
* @property {
|
|
1321
|
+
* @property {any[]} xdefault Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
|
|
1319
1322
|
* @property {string} newKey New Column Key.
|
|
1320
1323
|
* @property {boolean} overrideForCli
|
|
1321
1324
|
* @property {boolean} parseOutput
|
|
@@ -1333,6 +1336,7 @@ const tablesDBUpdatePointColumn = async ({databaseId,tableId,key,required,xdefau
|
|
|
1333
1336
|
if (typeof required !== 'undefined') {
|
|
1334
1337
|
payload['required'] = required;
|
|
1335
1338
|
}
|
|
1339
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1336
1340
|
if (typeof xdefault !== 'undefined') {
|
|
1337
1341
|
payload['default'] = xdefault;
|
|
1338
1342
|
}
|
|
@@ -1359,7 +1363,7 @@ const tablesDBUpdatePointColumn = async ({databaseId,tableId,key,required,xdefau
|
|
|
1359
1363
|
* @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
|
|
1360
1364
|
* @property {string} key Column Key.
|
|
1361
1365
|
* @property {boolean} required Is column required?
|
|
1362
|
-
* @property {
|
|
1366
|
+
* @property {any[]} xdefault Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
|
|
1363
1367
|
* @property {boolean} overrideForCli
|
|
1364
1368
|
* @property {boolean} parseOutput
|
|
1365
1369
|
* @property {libClient | undefined} sdk
|
|
@@ -1379,6 +1383,7 @@ const tablesDBCreatePolygonColumn = async ({databaseId,tableId,key,required,xdef
|
|
|
1379
1383
|
if (typeof required !== 'undefined') {
|
|
1380
1384
|
payload['required'] = required;
|
|
1381
1385
|
}
|
|
1386
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1382
1387
|
if (typeof xdefault !== 'undefined') {
|
|
1383
1388
|
payload['default'] = xdefault;
|
|
1384
1389
|
}
|
|
@@ -1402,7 +1407,7 @@ const tablesDBCreatePolygonColumn = async ({databaseId,tableId,key,required,xdef
|
|
|
1402
1407
|
* @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
|
|
1403
1408
|
* @property {string} key Column Key.
|
|
1404
1409
|
* @property {boolean} required Is column required?
|
|
1405
|
-
* @property {
|
|
1410
|
+
* @property {any[]} xdefault Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
|
|
1406
1411
|
* @property {string} newKey New Column Key.
|
|
1407
1412
|
* @property {boolean} overrideForCli
|
|
1408
1413
|
* @property {boolean} parseOutput
|
|
@@ -1420,6 +1425,7 @@ const tablesDBUpdatePolygonColumn = async ({databaseId,tableId,key,required,xdef
|
|
|
1420
1425
|
if (typeof required !== 'undefined') {
|
|
1421
1426
|
payload['required'] = required;
|
|
1422
1427
|
}
|
|
1428
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1423
1429
|
if (typeof xdefault !== 'undefined') {
|
|
1424
1430
|
payload['default'] = xdefault;
|
|
1425
1431
|
}
|
|
@@ -2075,7 +2081,7 @@ const tablesDBCreateRow = async ({databaseId,tableId,rowId,data,permissions,pars
|
|
|
2075
2081
|
* @typedef {Object} TablesDBCreateRowsRequestParams
|
|
2076
2082
|
* @property {string} databaseId Database ID.
|
|
2077
2083
|
* @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.
|
|
2078
|
-
* @property {object[]} rows Array of
|
|
2084
|
+
* @property {object[]} rows Array of rows data as JSON objects.
|
|
2079
2085
|
* @property {boolean} overrideForCli
|
|
2080
2086
|
* @property {boolean} parseOutput
|
|
2081
2087
|
* @property {libClient | undefined} sdk
|
|
@@ -2829,64 +2835,64 @@ tablesDB
|
|
|
2829
2835
|
|
|
2830
2836
|
tablesDB
|
|
2831
2837
|
.command(`create-line-column`)
|
|
2832
|
-
.description(`Create a geometric line
|
|
2838
|
+
.description(`Create a geometric line column.`)
|
|
2833
2839
|
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
2834
2840
|
.requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
|
|
2835
2841
|
.requiredOption(`--key <key>`, `Column Key.`)
|
|
2836
2842
|
.requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2837
|
-
.option(`--xdefault <xdefault>`, `Default value for column when not provided,
|
|
2843
|
+
.option(`--xdefault <xdefault>`, `Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.`)
|
|
2838
2844
|
.action(actionRunner(tablesDBCreateLineColumn))
|
|
2839
2845
|
|
|
2840
2846
|
tablesDB
|
|
2841
2847
|
.command(`update-line-column`)
|
|
2842
|
-
.description(`Update a line column. Changing the 'default' value will not update already existing
|
|
2848
|
+
.description(`Update a line column. Changing the 'default' value will not update already existing rows.`)
|
|
2843
2849
|
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
2844
2850
|
.requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
|
|
2845
2851
|
.requiredOption(`--key <key>`, `Column Key.`)
|
|
2846
2852
|
.requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2847
|
-
.option(`--xdefault <xdefault>`, `Default value for column when not provided,
|
|
2853
|
+
.option(`--xdefault <xdefault>`, `Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.`)
|
|
2848
2854
|
.option(`--new-key <new-key>`, `New Column Key.`)
|
|
2849
2855
|
.action(actionRunner(tablesDBUpdateLineColumn))
|
|
2850
2856
|
|
|
2851
2857
|
tablesDB
|
|
2852
2858
|
.command(`create-point-column`)
|
|
2853
|
-
.description(`Create a geometric point
|
|
2859
|
+
.description(`Create a geometric point column.`)
|
|
2854
2860
|
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
2855
2861
|
.requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
|
|
2856
2862
|
.requiredOption(`--key <key>`, `Column Key.`)
|
|
2857
2863
|
.requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2858
|
-
.option(`--xdefault <xdefault>`, `Default value for column when not provided,
|
|
2864
|
+
.option(`--xdefault <xdefault>`, `Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.`)
|
|
2859
2865
|
.action(actionRunner(tablesDBCreatePointColumn))
|
|
2860
2866
|
|
|
2861
2867
|
tablesDB
|
|
2862
2868
|
.command(`update-point-column`)
|
|
2863
|
-
.description(`Update a point column. Changing the 'default' value will not update already existing
|
|
2869
|
+
.description(`Update a point column. Changing the 'default' value will not update already existing rows.`)
|
|
2864
2870
|
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
2865
2871
|
.requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
|
|
2866
2872
|
.requiredOption(`--key <key>`, `Column Key.`)
|
|
2867
2873
|
.requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2868
|
-
.option(`--xdefault <xdefault>`, `Default value for column when not provided,
|
|
2874
|
+
.option(`--xdefault <xdefault>`, `Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.`)
|
|
2869
2875
|
.option(`--new-key <new-key>`, `New Column Key.`)
|
|
2870
2876
|
.action(actionRunner(tablesDBUpdatePointColumn))
|
|
2871
2877
|
|
|
2872
2878
|
tablesDB
|
|
2873
2879
|
.command(`create-polygon-column`)
|
|
2874
|
-
.description(`Create a geometric polygon
|
|
2880
|
+
.description(`Create a geometric polygon column.`)
|
|
2875
2881
|
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
2876
2882
|
.requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
|
|
2877
2883
|
.requiredOption(`--key <key>`, `Column Key.`)
|
|
2878
2884
|
.requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2879
|
-
.option(`--xdefault <xdefault>`, `Default value for column when not provided,
|
|
2885
|
+
.option(`--xdefault <xdefault>`, `Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.`)
|
|
2880
2886
|
.action(actionRunner(tablesDBCreatePolygonColumn))
|
|
2881
2887
|
|
|
2882
2888
|
tablesDB
|
|
2883
2889
|
.command(`update-polygon-column`)
|
|
2884
|
-
.description(`Update a polygon column. Changing the 'default' value will not update already existing
|
|
2890
|
+
.description(`Update a polygon column. Changing the 'default' value will not update already existing rows.`)
|
|
2885
2891
|
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
2886
2892
|
.requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
|
|
2887
2893
|
.requiredOption(`--key <key>`, `Column Key.`)
|
|
2888
2894
|
.requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
|
|
2889
|
-
.option(`--xdefault <xdefault>`, `Default value for column when not provided,
|
|
2895
|
+
.option(`--xdefault <xdefault>`, `Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.`)
|
|
2890
2896
|
.option(`--new-key <new-key>`, `New Column Key.`)
|
|
2891
2897
|
.action(actionRunner(tablesDBUpdatePolygonColumn))
|
|
2892
2898
|
|
|
@@ -3047,7 +3053,7 @@ tablesDB
|
|
|
3047
3053
|
.description(`Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console.`)
|
|
3048
3054
|
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
3049
3055
|
.requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.`)
|
|
3050
|
-
.requiredOption(`--rows [rows...]`, `Array of
|
|
3056
|
+
.requiredOption(`--rows [rows...]`, `Array of rows data as JSON objects.`)
|
|
3051
3057
|
.action(actionRunner(tablesDBCreateRows))
|
|
3052
3058
|
|
|
3053
3059
|
tablesDB
|
package/lib/parser.js
CHANGED
|
@@ -122,7 +122,7 @@ const parseError = (err) => {
|
|
|
122
122
|
} catch {
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
const version = '
|
|
125
|
+
const version = '10.0.0';
|
|
126
126
|
const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``;
|
|
127
127
|
const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud()}`;
|
|
128
128
|
|
|
@@ -205,7 +205,8 @@ const commandDescriptions = {
|
|
|
205
205
|
"account": `The account command allows you to authenticate and manage a user account.`,
|
|
206
206
|
"graphql": `The graphql command allows you to query and mutate any resource type on your Appwrite server.`,
|
|
207
207
|
"avatars": `The avatars command aims to help you complete everyday tasks related to your app image, icons, and avatars.`,
|
|
208
|
-
"databases": `The databases command allows you to create structured collections of documents and query and filter lists of documents.`,
|
|
208
|
+
"databases": `(Legacy) The databases command allows you to create structured collections of documents and query and filter lists of documents.`,
|
|
209
|
+
'tables-db': `The tables-db command allows you to create structured tables of columns and query and filter lists of rows.`,
|
|
209
210
|
"init": `The init command provides a convenient wrapper for creating and initializing projects, functions, collections, buckets, teams, and messaging-topics in Appwrite.`,
|
|
210
211
|
"push": `The push command provides a convenient wrapper for pushing your functions, collections, buckets, teams, and messaging-topics.`,
|
|
211
212
|
"run": `The run command allows you to run the project locally to allow easy development and quick debugging.`,
|
|
@@ -218,6 +219,8 @@ const commandDescriptions = {
|
|
|
218
219
|
"teams": `The teams command allows you to group users of your project to enable them to share read and write access to your project resources.`,
|
|
219
220
|
"update": `The update command allows you to update the Appwrite CLI to the latest version.`,
|
|
220
221
|
"users": `The users command allows you to manage your project users.`,
|
|
222
|
+
"projects": `The projects command allows you to manage your projects, add platforms, manage API keys, Dev Keys etc.`,
|
|
223
|
+
"project": `The project command allows you to manage project related resources like usage, variables, etc.`,
|
|
221
224
|
"client": `The client command allows you to configure your CLI`,
|
|
222
225
|
"login": `The login command allows you to authenticate and manage a user account.`,
|
|
223
226
|
"logout": `The logout command allows you to log out of your Appwrite account.`,
|
|
@@ -90,7 +90,9 @@ export enum <%- toPascalCase(attribute.key) %> {
|
|
|
90
90
|
<% for (const [index, collection] of Object.entries(collections)) { -%>
|
|
91
91
|
export type <%- toPascalCase(collection.name) %> = Models.Row & {
|
|
92
92
|
<% for (const attribute of collection.attributes) { -%>
|
|
93
|
-
|
|
93
|
+
<% const propertyName = strict ? toCamelCase(attribute.key) : attribute.key; -%>
|
|
94
|
+
<% const isValidIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(propertyName); -%>
|
|
95
|
+
<% if (isValidIdentifier) { %><%- propertyName %><% } else { %>"<%- propertyName %>"<% } %>: <%- getType(attribute, collections) %>;
|
|
94
96
|
<% } -%>
|
|
95
97
|
}<% if (index < collections.length - 1) { %>
|
|
96
98
|
<% } %>
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "appwrite-cli",
|
|
3
3
|
"homepage": "https://appwrite.io/support",
|
|
4
4
|
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "10.0.0",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"bin": {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.",
|
|
5
5
|
"homepage": "https://github.com/appwrite/sdk-for-cli",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"architecture": {
|
|
8
8
|
"64bit": {
|
|
9
|
-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/
|
|
9
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/10.0.0/appwrite-cli-win-x64.exe",
|
|
10
10
|
"bin": [
|
|
11
11
|
[
|
|
12
12
|
"appwrite-cli-win-x64.exe",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"arm64": {
|
|
18
|
-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/
|
|
18
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/10.0.0/appwrite-cli-win-arm64.exe",
|
|
19
19
|
"bin": [
|
|
20
20
|
[
|
|
21
21
|
"appwrite-cli-win-arm64.exe",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
appwrite avatars get-initials
|
package/lib/commands/avatars.js
DELETED
|
@@ -1,484 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const pathLib = require('path');
|
|
3
|
-
const tar = require("tar");
|
|
4
|
-
const ignore = require("ignore");
|
|
5
|
-
const { promisify } = require('util');
|
|
6
|
-
const libClient = require('../client.js');
|
|
7
|
-
const { getAllFiles, showConsoleLink } = require('../utils.js');
|
|
8
|
-
const { Command } = require('commander');
|
|
9
|
-
const { sdkForProject, sdkForConsole } = require('../sdks')
|
|
10
|
-
const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser')
|
|
11
|
-
const { localConfig, globalConfig } = require("../config");
|
|
12
|
-
const { File } = require('undici');
|
|
13
|
-
const { ReadableStream } = require('stream/web');
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @param {fs.ReadStream} readStream
|
|
17
|
-
* @returns {ReadableStream}
|
|
18
|
-
*/
|
|
19
|
-
function convertReadStreamToReadableStream(readStream) {
|
|
20
|
-
return new ReadableStream({
|
|
21
|
-
start(controller) {
|
|
22
|
-
readStream.on("data", (chunk) => {
|
|
23
|
-
controller.enqueue(chunk);
|
|
24
|
-
});
|
|
25
|
-
readStream.on("end", () => {
|
|
26
|
-
controller.close();
|
|
27
|
-
});
|
|
28
|
-
readStream.on("error", (err) => {
|
|
29
|
-
controller.error(err);
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
cancel() {
|
|
33
|
-
readStream.destroy();
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const avatars = new Command("avatars").description(commandDescriptions['avatars'] ?? '').configureHelp({
|
|
39
|
-
helpWidth: process.stdout.columns || 80
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @typedef {Object} AvatarsGetBrowserRequestParams
|
|
44
|
-
* @property {Browser} code Browser Code.
|
|
45
|
-
* @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
46
|
-
* @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
47
|
-
* @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
48
|
-
* @property {boolean} overrideForCli
|
|
49
|
-
* @property {boolean} parseOutput
|
|
50
|
-
* @property {libClient | undefined} sdk
|
|
51
|
-
* @property {string} destination
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @param {AvatarsGetBrowserRequestParams} params
|
|
56
|
-
*/
|
|
57
|
-
const avatarsGetBrowser = async ({code,width,height,quality,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
58
|
-
let client = !sdk ? await sdkForProject() :
|
|
59
|
-
sdk;
|
|
60
|
-
let apiPath = '/avatars/browsers/{code}'.replace('{code}', code);
|
|
61
|
-
let payload = {};
|
|
62
|
-
if (typeof width !== 'undefined') {
|
|
63
|
-
payload['width'] = width;
|
|
64
|
-
}
|
|
65
|
-
if (typeof height !== 'undefined') {
|
|
66
|
-
payload['height'] = height;
|
|
67
|
-
}
|
|
68
|
-
if (typeof quality !== 'undefined') {
|
|
69
|
-
payload['quality'] = quality;
|
|
70
|
-
}
|
|
71
|
-
if (!overrideForCli) {
|
|
72
|
-
payload['project'] = localConfig.getProject().projectId
|
|
73
|
-
payload['key'] = globalConfig.getKey();
|
|
74
|
-
const queryParams = new URLSearchParams(payload);
|
|
75
|
-
apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
let response = undefined;
|
|
79
|
-
|
|
80
|
-
response = await client.call('get', apiPath, {
|
|
81
|
-
}, payload, 'arraybuffer');
|
|
82
|
-
|
|
83
|
-
if (overrideForCli) {
|
|
84
|
-
response = Buffer.from(response);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
fs.writeFileSync(destination, response);
|
|
88
|
-
if (parseOutput) {
|
|
89
|
-
parse(response)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return response;
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* @typedef {Object} AvatarsGetCreditCardRequestParams
|
|
97
|
-
* @property {CreditCard} code Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
|
98
|
-
* @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
99
|
-
* @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
100
|
-
* @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
101
|
-
* @property {boolean} overrideForCli
|
|
102
|
-
* @property {boolean} parseOutput
|
|
103
|
-
* @property {libClient | undefined} sdk
|
|
104
|
-
* @property {string} destination
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* @param {AvatarsGetCreditCardRequestParams} params
|
|
109
|
-
*/
|
|
110
|
-
const avatarsGetCreditCard = async ({code,width,height,quality,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
111
|
-
let client = !sdk ? await sdkForProject() :
|
|
112
|
-
sdk;
|
|
113
|
-
let apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);
|
|
114
|
-
let payload = {};
|
|
115
|
-
if (typeof width !== 'undefined') {
|
|
116
|
-
payload['width'] = width;
|
|
117
|
-
}
|
|
118
|
-
if (typeof height !== 'undefined') {
|
|
119
|
-
payload['height'] = height;
|
|
120
|
-
}
|
|
121
|
-
if (typeof quality !== 'undefined') {
|
|
122
|
-
payload['quality'] = quality;
|
|
123
|
-
}
|
|
124
|
-
if (!overrideForCli) {
|
|
125
|
-
payload['project'] = localConfig.getProject().projectId
|
|
126
|
-
payload['key'] = globalConfig.getKey();
|
|
127
|
-
const queryParams = new URLSearchParams(payload);
|
|
128
|
-
apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
let response = undefined;
|
|
132
|
-
|
|
133
|
-
response = await client.call('get', apiPath, {
|
|
134
|
-
}, payload, 'arraybuffer');
|
|
135
|
-
|
|
136
|
-
if (overrideForCli) {
|
|
137
|
-
response = Buffer.from(response);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
fs.writeFileSync(destination, response);
|
|
141
|
-
if (parseOutput) {
|
|
142
|
-
parse(response)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return response;
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* @typedef {Object} AvatarsGetFaviconRequestParams
|
|
150
|
-
* @property {string} url Website URL which you want to fetch the favicon from.
|
|
151
|
-
* @property {boolean} overrideForCli
|
|
152
|
-
* @property {boolean} parseOutput
|
|
153
|
-
* @property {libClient | undefined} sdk
|
|
154
|
-
* @property {string} destination
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* @param {AvatarsGetFaviconRequestParams} params
|
|
159
|
-
*/
|
|
160
|
-
const avatarsGetFavicon = async ({url,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
161
|
-
let client = !sdk ? await sdkForProject() :
|
|
162
|
-
sdk;
|
|
163
|
-
let apiPath = '/avatars/favicon';
|
|
164
|
-
let payload = {};
|
|
165
|
-
if (typeof url !== 'undefined') {
|
|
166
|
-
payload['url'] = url;
|
|
167
|
-
}
|
|
168
|
-
if (!overrideForCli) {
|
|
169
|
-
payload['project'] = localConfig.getProject().projectId
|
|
170
|
-
payload['key'] = globalConfig.getKey();
|
|
171
|
-
const queryParams = new URLSearchParams(payload);
|
|
172
|
-
apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
let response = undefined;
|
|
176
|
-
|
|
177
|
-
response = await client.call('get', apiPath, {
|
|
178
|
-
}, payload, 'arraybuffer');
|
|
179
|
-
|
|
180
|
-
if (overrideForCli) {
|
|
181
|
-
response = Buffer.from(response);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
fs.writeFileSync(destination, response);
|
|
185
|
-
if (parseOutput) {
|
|
186
|
-
parse(response)
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return response;
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* @typedef {Object} AvatarsGetFlagRequestParams
|
|
194
|
-
* @property {Flag} code Country Code. ISO Alpha-2 country code format.
|
|
195
|
-
* @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
196
|
-
* @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
197
|
-
* @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
198
|
-
* @property {boolean} overrideForCli
|
|
199
|
-
* @property {boolean} parseOutput
|
|
200
|
-
* @property {libClient | undefined} sdk
|
|
201
|
-
* @property {string} destination
|
|
202
|
-
*/
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* @param {AvatarsGetFlagRequestParams} params
|
|
206
|
-
*/
|
|
207
|
-
const avatarsGetFlag = async ({code,width,height,quality,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
208
|
-
let client = !sdk ? await sdkForProject() :
|
|
209
|
-
sdk;
|
|
210
|
-
let apiPath = '/avatars/flags/{code}'.replace('{code}', code);
|
|
211
|
-
let payload = {};
|
|
212
|
-
if (typeof width !== 'undefined') {
|
|
213
|
-
payload['width'] = width;
|
|
214
|
-
}
|
|
215
|
-
if (typeof height !== 'undefined') {
|
|
216
|
-
payload['height'] = height;
|
|
217
|
-
}
|
|
218
|
-
if (typeof quality !== 'undefined') {
|
|
219
|
-
payload['quality'] = quality;
|
|
220
|
-
}
|
|
221
|
-
if (!overrideForCli) {
|
|
222
|
-
payload['project'] = localConfig.getProject().projectId
|
|
223
|
-
payload['key'] = globalConfig.getKey();
|
|
224
|
-
const queryParams = new URLSearchParams(payload);
|
|
225
|
-
apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
let response = undefined;
|
|
229
|
-
|
|
230
|
-
response = await client.call('get', apiPath, {
|
|
231
|
-
}, payload, 'arraybuffer');
|
|
232
|
-
|
|
233
|
-
if (overrideForCli) {
|
|
234
|
-
response = Buffer.from(response);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
fs.writeFileSync(destination, response);
|
|
238
|
-
if (parseOutput) {
|
|
239
|
-
parse(response)
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return response;
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* @typedef {Object} AvatarsGetImageRequestParams
|
|
247
|
-
* @property {string} url Image URL which you want to crop.
|
|
248
|
-
* @property {number} width Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
|
|
249
|
-
* @property {number} height Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
|
|
250
|
-
* @property {boolean} overrideForCli
|
|
251
|
-
* @property {boolean} parseOutput
|
|
252
|
-
* @property {libClient | undefined} sdk
|
|
253
|
-
* @property {string} destination
|
|
254
|
-
*/
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* @param {AvatarsGetImageRequestParams} params
|
|
258
|
-
*/
|
|
259
|
-
const avatarsGetImage = async ({url,width,height,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
260
|
-
let client = !sdk ? await sdkForProject() :
|
|
261
|
-
sdk;
|
|
262
|
-
let apiPath = '/avatars/image';
|
|
263
|
-
let payload = {};
|
|
264
|
-
if (typeof url !== 'undefined') {
|
|
265
|
-
payload['url'] = url;
|
|
266
|
-
}
|
|
267
|
-
if (typeof width !== 'undefined') {
|
|
268
|
-
payload['width'] = width;
|
|
269
|
-
}
|
|
270
|
-
if (typeof height !== 'undefined') {
|
|
271
|
-
payload['height'] = height;
|
|
272
|
-
}
|
|
273
|
-
if (!overrideForCli) {
|
|
274
|
-
payload['project'] = localConfig.getProject().projectId
|
|
275
|
-
payload['key'] = globalConfig.getKey();
|
|
276
|
-
const queryParams = new URLSearchParams(payload);
|
|
277
|
-
apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
let response = undefined;
|
|
281
|
-
|
|
282
|
-
response = await client.call('get', apiPath, {
|
|
283
|
-
}, payload, 'arraybuffer');
|
|
284
|
-
|
|
285
|
-
if (overrideForCli) {
|
|
286
|
-
response = Buffer.from(response);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
fs.writeFileSync(destination, response);
|
|
290
|
-
if (parseOutput) {
|
|
291
|
-
parse(response)
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return response;
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* @typedef {Object} AvatarsGetInitialsRequestParams
|
|
299
|
-
* @property {string} name Full Name. When empty, current user name or email will be used. Max length: 128 chars.
|
|
300
|
-
* @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
301
|
-
* @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
302
|
-
* @property {string} background Changes background color. By default a random color will be picked and stay will persistent to the given name.
|
|
303
|
-
* @property {boolean} overrideForCli
|
|
304
|
-
* @property {boolean} parseOutput
|
|
305
|
-
* @property {libClient | undefined} sdk
|
|
306
|
-
* @property {string} destination
|
|
307
|
-
*/
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* @param {AvatarsGetInitialsRequestParams} params
|
|
311
|
-
*/
|
|
312
|
-
const avatarsGetInitials = async ({name,width,height,background,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
313
|
-
let client = !sdk ? await sdkForProject() :
|
|
314
|
-
sdk;
|
|
315
|
-
let apiPath = '/avatars/initials';
|
|
316
|
-
let payload = {};
|
|
317
|
-
if (typeof name !== 'undefined') {
|
|
318
|
-
payload['name'] = name;
|
|
319
|
-
}
|
|
320
|
-
if (typeof width !== 'undefined') {
|
|
321
|
-
payload['width'] = width;
|
|
322
|
-
}
|
|
323
|
-
if (typeof height !== 'undefined') {
|
|
324
|
-
payload['height'] = height;
|
|
325
|
-
}
|
|
326
|
-
if (typeof background !== 'undefined') {
|
|
327
|
-
payload['background'] = background;
|
|
328
|
-
}
|
|
329
|
-
if (!overrideForCli) {
|
|
330
|
-
payload['project'] = localConfig.getProject().projectId
|
|
331
|
-
payload['key'] = globalConfig.getKey();
|
|
332
|
-
const queryParams = new URLSearchParams(payload);
|
|
333
|
-
apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
let response = undefined;
|
|
337
|
-
|
|
338
|
-
response = await client.call('get', apiPath, {
|
|
339
|
-
}, payload, 'arraybuffer');
|
|
340
|
-
|
|
341
|
-
if (overrideForCli) {
|
|
342
|
-
response = Buffer.from(response);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
fs.writeFileSync(destination, response);
|
|
346
|
-
if (parseOutput) {
|
|
347
|
-
parse(response)
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
return response;
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* @typedef {Object} AvatarsGetQRRequestParams
|
|
355
|
-
* @property {string} text Plain text to be converted to QR code image.
|
|
356
|
-
* @property {number} size QR code size. Pass an integer between 1 to 1000. Defaults to 400.
|
|
357
|
-
* @property {number} margin Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
|
|
358
|
-
* @property {boolean} download Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
|
|
359
|
-
* @property {boolean} overrideForCli
|
|
360
|
-
* @property {boolean} parseOutput
|
|
361
|
-
* @property {libClient | undefined} sdk
|
|
362
|
-
* @property {string} destination
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* @param {AvatarsGetQRRequestParams} params
|
|
367
|
-
*/
|
|
368
|
-
const avatarsGetQR = async ({text,size,margin,download,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
369
|
-
let client = !sdk ? await sdkForProject() :
|
|
370
|
-
sdk;
|
|
371
|
-
let apiPath = '/avatars/qr';
|
|
372
|
-
let payload = {};
|
|
373
|
-
if (typeof text !== 'undefined') {
|
|
374
|
-
payload['text'] = text;
|
|
375
|
-
}
|
|
376
|
-
if (typeof size !== 'undefined') {
|
|
377
|
-
payload['size'] = size;
|
|
378
|
-
}
|
|
379
|
-
if (typeof margin !== 'undefined') {
|
|
380
|
-
payload['margin'] = margin;
|
|
381
|
-
}
|
|
382
|
-
if (typeof download !== 'undefined') {
|
|
383
|
-
payload['download'] = download;
|
|
384
|
-
}
|
|
385
|
-
if (!overrideForCli) {
|
|
386
|
-
payload['project'] = localConfig.getProject().projectId
|
|
387
|
-
payload['key'] = globalConfig.getKey();
|
|
388
|
-
const queryParams = new URLSearchParams(payload);
|
|
389
|
-
apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
let response = undefined;
|
|
393
|
-
|
|
394
|
-
response = await client.call('get', apiPath, {
|
|
395
|
-
}, payload, 'arraybuffer');
|
|
396
|
-
|
|
397
|
-
if (overrideForCli) {
|
|
398
|
-
response = Buffer.from(response);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
fs.writeFileSync(destination, response);
|
|
402
|
-
if (parseOutput) {
|
|
403
|
-
parse(response)
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
return response;
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
avatars
|
|
410
|
-
.command(`get-browser`)
|
|
411
|
-
.description(`You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.`)
|
|
412
|
-
.requiredOption(`--code <code>`, `Browser Code.`)
|
|
413
|
-
.option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
|
|
414
|
-
.option(`--height <height>`, `Image height. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
|
|
415
|
-
.option(`--quality <quality>`, `Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.`, parseInteger)
|
|
416
|
-
.requiredOption(`--destination <path>`, `output file path.`)
|
|
417
|
-
.action(actionRunner(avatarsGetBrowser))
|
|
418
|
-
|
|
419
|
-
avatars
|
|
420
|
-
.command(`get-credit-card`)
|
|
421
|
-
.description(`The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. `)
|
|
422
|
-
.requiredOption(`--code <code>`, `Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.`)
|
|
423
|
-
.option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
|
|
424
|
-
.option(`--height <height>`, `Image height. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
|
|
425
|
-
.option(`--quality <quality>`, `Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.`, parseInteger)
|
|
426
|
-
.requiredOption(`--destination <path>`, `output file path.`)
|
|
427
|
-
.action(actionRunner(avatarsGetCreditCard))
|
|
428
|
-
|
|
429
|
-
avatars
|
|
430
|
-
.command(`get-favicon`)
|
|
431
|
-
.description(`Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. This endpoint does not follow HTTP redirects.`)
|
|
432
|
-
.requiredOption(`--url <url>`, `Website URL which you want to fetch the favicon from.`)
|
|
433
|
-
.requiredOption(`--destination <path>`, `output file path.`)
|
|
434
|
-
.action(actionRunner(avatarsGetFavicon))
|
|
435
|
-
|
|
436
|
-
avatars
|
|
437
|
-
.command(`get-flag`)
|
|
438
|
-
.description(`You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. `)
|
|
439
|
-
.requiredOption(`--code <code>`, `Country Code. ISO Alpha-2 country code format.`)
|
|
440
|
-
.option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
|
|
441
|
-
.option(`--height <height>`, `Image height. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
|
|
442
|
-
.option(`--quality <quality>`, `Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.`, parseInteger)
|
|
443
|
-
.requiredOption(`--destination <path>`, `output file path.`)
|
|
444
|
-
.action(actionRunner(avatarsGetFlag))
|
|
445
|
-
|
|
446
|
-
avatars
|
|
447
|
-
.command(`get-image`)
|
|
448
|
-
.description(`Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px. This endpoint does not follow HTTP redirects.`)
|
|
449
|
-
.requiredOption(`--url <url>`, `Image URL which you want to crop.`)
|
|
450
|
-
.option(`--width <width>`, `Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.`, parseInteger)
|
|
451
|
-
.option(`--height <height>`, `Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.`, parseInteger)
|
|
452
|
-
.requiredOption(`--destination <path>`, `output file path.`)
|
|
453
|
-
.action(actionRunner(avatarsGetImage))
|
|
454
|
-
|
|
455
|
-
avatars
|
|
456
|
-
.command(`get-initials`)
|
|
457
|
-
.description(`Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. `)
|
|
458
|
-
.option(`--name <name>`, `Full Name. When empty, current user name or email will be used. Max length: 128 chars.`)
|
|
459
|
-
.option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
|
|
460
|
-
.option(`--height <height>`, `Image height. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
|
|
461
|
-
.option(`--background <background>`, `Changes background color. By default a random color will be picked and stay will persistent to the given name.`)
|
|
462
|
-
.requiredOption(`--destination <path>`, `output file path.`)
|
|
463
|
-
.action(actionRunner(avatarsGetInitials))
|
|
464
|
-
|
|
465
|
-
avatars
|
|
466
|
-
.command(`get-qr`)
|
|
467
|
-
.description(`Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. `)
|
|
468
|
-
.requiredOption(`--text <text>`, `Plain text to be converted to QR code image.`)
|
|
469
|
-
.option(`--size <size>`, `QR code size. Pass an integer between 1 to 1000. Defaults to 400.`, parseInteger)
|
|
470
|
-
.option(`--margin <margin>`, `Margin from edge. Pass an integer between 0 to 10. Defaults to 1.`, parseInteger)
|
|
471
|
-
.option(`--download [value]`, `Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.`, (value) => value === undefined ? true : parseBool(value))
|
|
472
|
-
.requiredOption(`--destination <path>`, `output file path.`)
|
|
473
|
-
.action(actionRunner(avatarsGetQR))
|
|
474
|
-
|
|
475
|
-
module.exports = {
|
|
476
|
-
avatars,
|
|
477
|
-
avatarsGetBrowser,
|
|
478
|
-
avatarsGetCreditCard,
|
|
479
|
-
avatarsGetFavicon,
|
|
480
|
-
avatarsGetFlag,
|
|
481
|
-
avatarsGetImage,
|
|
482
|
-
avatarsGetInitials,
|
|
483
|
-
avatarsGetQR
|
|
484
|
-
};
|