appwrite-cli 9.0.2 → 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/docs/examples/databases/create-line-attribute.md +5 -0
- package/docs/examples/databases/create-point-attribute.md +5 -0
- package/docs/examples/databases/create-polygon-attribute.md +5 -0
- package/docs/examples/databases/update-line-attribute.md +5 -0
- package/docs/examples/databases/update-point-attribute.md +5 -0
- package/docs/examples/databases/update-polygon-attribute.md +5 -0
- package/docs/examples/tablesdb/create-line-column.md +5 -0
- package/docs/examples/tablesdb/create-point-column.md +5 -0
- package/docs/examples/tablesdb/create-polygon-column.md +5 -0
- package/docs/examples/tablesdb/update-line-column.md +5 -0
- package/docs/examples/tablesdb/update-point-column.md +5 -0
- package/docs/examples/tablesdb/update-polygon-column.md +5 -0
- 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 +336 -0
- package/lib/commands/functions.js +2 -2
- package/lib/commands/generic.js +5 -5
- package/lib/commands/init.js +3 -1
- package/lib/commands/pull.js +24 -12
- package/lib/commands/push.js +27 -9
- package/lib/commands/tables-db.js +338 -2
- package/lib/commands/types.js +54 -15
- package/lib/config.js +57 -33
- package/lib/parser.js +5 -2
- package/lib/questions.js +6 -6
- package/lib/type-generation/languages/csharp.js +170 -0
- package/lib/type-generation/languages/javascript.js +2 -2
- package/lib/type-generation/languages/typescript.js +4 -2
- 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
|
}
|
|
@@ -1178,6 +1178,273 @@ const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,
|
|
|
1178
1178
|
|
|
1179
1179
|
return response;
|
|
1180
1180
|
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* @typedef {Object} DatabasesCreateLineAttributeRequestParams
|
|
1184
|
+
* @property {string} databaseId Database ID.
|
|
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
|
+
* @property {string} key Attribute Key.
|
|
1187
|
+
* @property {boolean} required Is attribute required?
|
|
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
|
+
* @property {boolean} overrideForCli
|
|
1190
|
+
* @property {boolean} parseOutput
|
|
1191
|
+
* @property {libClient | undefined} sdk
|
|
1192
|
+
*/
|
|
1193
|
+
|
|
1194
|
+
/**
|
|
1195
|
+
* @param {DatabasesCreateLineAttributeRequestParams} params
|
|
1196
|
+
*/
|
|
1197
|
+
const databasesCreateLineAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1198
|
+
let client = !sdk ? await sdkForProject() :
|
|
1199
|
+
sdk;
|
|
1200
|
+
let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1201
|
+
let payload = {};
|
|
1202
|
+
if (typeof key !== 'undefined') {
|
|
1203
|
+
payload['key'] = key;
|
|
1204
|
+
}
|
|
1205
|
+
if (typeof required !== 'undefined') {
|
|
1206
|
+
payload['required'] = required;
|
|
1207
|
+
}
|
|
1208
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1209
|
+
if (typeof xdefault !== 'undefined') {
|
|
1210
|
+
payload['default'] = xdefault;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
let response = undefined;
|
|
1214
|
+
|
|
1215
|
+
response = await client.call('post', apiPath, {
|
|
1216
|
+
'content-type': 'application/json',
|
|
1217
|
+
}, payload);
|
|
1218
|
+
|
|
1219
|
+
if (parseOutput) {
|
|
1220
|
+
parse(response)
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
return response;
|
|
1224
|
+
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* @typedef {Object} DatabasesUpdateLineAttributeRequestParams
|
|
1228
|
+
* @property {string} databaseId Database ID.
|
|
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).
|
|
1230
|
+
* @property {string} key Attribute Key.
|
|
1231
|
+
* @property {boolean} required Is attribute required?
|
|
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.
|
|
1233
|
+
* @property {string} newKey New attribute key.
|
|
1234
|
+
* @property {boolean} overrideForCli
|
|
1235
|
+
* @property {boolean} parseOutput
|
|
1236
|
+
* @property {libClient | undefined} sdk
|
|
1237
|
+
*/
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* @param {DatabasesUpdateLineAttributeRequestParams} params
|
|
1241
|
+
*/
|
|
1242
|
+
const databasesUpdateLineAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1243
|
+
let client = !sdk ? await sdkForProject() :
|
|
1244
|
+
sdk;
|
|
1245
|
+
let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1246
|
+
let payload = {};
|
|
1247
|
+
if (typeof required !== 'undefined') {
|
|
1248
|
+
payload['required'] = required;
|
|
1249
|
+
}
|
|
1250
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1251
|
+
if (typeof xdefault !== 'undefined') {
|
|
1252
|
+
payload['default'] = xdefault;
|
|
1253
|
+
}
|
|
1254
|
+
if (typeof newKey !== 'undefined') {
|
|
1255
|
+
payload['newKey'] = newKey;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
let response = undefined;
|
|
1259
|
+
|
|
1260
|
+
response = await client.call('patch', apiPath, {
|
|
1261
|
+
'content-type': 'application/json',
|
|
1262
|
+
}, payload);
|
|
1263
|
+
|
|
1264
|
+
if (parseOutput) {
|
|
1265
|
+
parse(response)
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
return response;
|
|
1269
|
+
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* @typedef {Object} DatabasesCreatePointAttributeRequestParams
|
|
1273
|
+
* @property {string} databaseId Database ID.
|
|
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).
|
|
1275
|
+
* @property {string} key Attribute Key.
|
|
1276
|
+
* @property {boolean} required Is attribute required?
|
|
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.
|
|
1278
|
+
* @property {boolean} overrideForCli
|
|
1279
|
+
* @property {boolean} parseOutput
|
|
1280
|
+
* @property {libClient | undefined} sdk
|
|
1281
|
+
*/
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* @param {DatabasesCreatePointAttributeRequestParams} params
|
|
1285
|
+
*/
|
|
1286
|
+
const databasesCreatePointAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1287
|
+
let client = !sdk ? await sdkForProject() :
|
|
1288
|
+
sdk;
|
|
1289
|
+
let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1290
|
+
let payload = {};
|
|
1291
|
+
if (typeof key !== 'undefined') {
|
|
1292
|
+
payload['key'] = key;
|
|
1293
|
+
}
|
|
1294
|
+
if (typeof required !== 'undefined') {
|
|
1295
|
+
payload['required'] = required;
|
|
1296
|
+
}
|
|
1297
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1298
|
+
if (typeof xdefault !== 'undefined') {
|
|
1299
|
+
payload['default'] = xdefault;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
let response = undefined;
|
|
1303
|
+
|
|
1304
|
+
response = await client.call('post', apiPath, {
|
|
1305
|
+
'content-type': 'application/json',
|
|
1306
|
+
}, payload);
|
|
1307
|
+
|
|
1308
|
+
if (parseOutput) {
|
|
1309
|
+
parse(response)
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
return response;
|
|
1313
|
+
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* @typedef {Object} DatabasesUpdatePointAttributeRequestParams
|
|
1317
|
+
* @property {string} databaseId Database ID.
|
|
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).
|
|
1319
|
+
* @property {string} key Attribute Key.
|
|
1320
|
+
* @property {boolean} required Is attribute required?
|
|
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.
|
|
1322
|
+
* @property {string} newKey New attribute key.
|
|
1323
|
+
* @property {boolean} overrideForCli
|
|
1324
|
+
* @property {boolean} parseOutput
|
|
1325
|
+
* @property {libClient | undefined} sdk
|
|
1326
|
+
*/
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* @param {DatabasesUpdatePointAttributeRequestParams} params
|
|
1330
|
+
*/
|
|
1331
|
+
const databasesUpdatePointAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1332
|
+
let client = !sdk ? await sdkForProject() :
|
|
1333
|
+
sdk;
|
|
1334
|
+
let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1335
|
+
let payload = {};
|
|
1336
|
+
if (typeof required !== 'undefined') {
|
|
1337
|
+
payload['required'] = required;
|
|
1338
|
+
}
|
|
1339
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1340
|
+
if (typeof xdefault !== 'undefined') {
|
|
1341
|
+
payload['default'] = xdefault;
|
|
1342
|
+
}
|
|
1343
|
+
if (typeof newKey !== 'undefined') {
|
|
1344
|
+
payload['newKey'] = newKey;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
let response = undefined;
|
|
1348
|
+
|
|
1349
|
+
response = await client.call('patch', apiPath, {
|
|
1350
|
+
'content-type': 'application/json',
|
|
1351
|
+
}, payload);
|
|
1352
|
+
|
|
1353
|
+
if (parseOutput) {
|
|
1354
|
+
parse(response)
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
return response;
|
|
1358
|
+
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* @typedef {Object} DatabasesCreatePolygonAttributeRequestParams
|
|
1362
|
+
* @property {string} databaseId Database ID.
|
|
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).
|
|
1364
|
+
* @property {string} key Attribute Key.
|
|
1365
|
+
* @property {boolean} required Is attribute required?
|
|
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.
|
|
1367
|
+
* @property {boolean} overrideForCli
|
|
1368
|
+
* @property {boolean} parseOutput
|
|
1369
|
+
* @property {libClient | undefined} sdk
|
|
1370
|
+
*/
|
|
1371
|
+
|
|
1372
|
+
/**
|
|
1373
|
+
* @param {DatabasesCreatePolygonAttributeRequestParams} params
|
|
1374
|
+
*/
|
|
1375
|
+
const databasesCreatePolygonAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1376
|
+
let client = !sdk ? await sdkForProject() :
|
|
1377
|
+
sdk;
|
|
1378
|
+
let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1379
|
+
let payload = {};
|
|
1380
|
+
if (typeof key !== 'undefined') {
|
|
1381
|
+
payload['key'] = key;
|
|
1382
|
+
}
|
|
1383
|
+
if (typeof required !== 'undefined') {
|
|
1384
|
+
payload['required'] = required;
|
|
1385
|
+
}
|
|
1386
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1387
|
+
if (typeof xdefault !== 'undefined') {
|
|
1388
|
+
payload['default'] = xdefault;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
let response = undefined;
|
|
1392
|
+
|
|
1393
|
+
response = await client.call('post', apiPath, {
|
|
1394
|
+
'content-type': 'application/json',
|
|
1395
|
+
}, payload);
|
|
1396
|
+
|
|
1397
|
+
if (parseOutput) {
|
|
1398
|
+
parse(response)
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
return response;
|
|
1402
|
+
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* @typedef {Object} DatabasesUpdatePolygonAttributeRequestParams
|
|
1406
|
+
* @property {string} databaseId Database ID.
|
|
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).
|
|
1408
|
+
* @property {string} key Attribute Key.
|
|
1409
|
+
* @property {boolean} required Is attribute required?
|
|
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.
|
|
1411
|
+
* @property {string} newKey New attribute key.
|
|
1412
|
+
* @property {boolean} overrideForCli
|
|
1413
|
+
* @property {boolean} parseOutput
|
|
1414
|
+
* @property {libClient | undefined} sdk
|
|
1415
|
+
*/
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* @param {DatabasesUpdatePolygonAttributeRequestParams} params
|
|
1419
|
+
*/
|
|
1420
|
+
const databasesUpdatePolygonAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1421
|
+
let client = !sdk ? await sdkForProject() :
|
|
1422
|
+
sdk;
|
|
1423
|
+
let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
1424
|
+
let payload = {};
|
|
1425
|
+
if (typeof required !== 'undefined') {
|
|
1426
|
+
payload['required'] = required;
|
|
1427
|
+
}
|
|
1428
|
+
xdefault = xdefault === true ? [] : xdefault;
|
|
1429
|
+
if (typeof xdefault !== 'undefined') {
|
|
1430
|
+
payload['default'] = xdefault;
|
|
1431
|
+
}
|
|
1432
|
+
if (typeof newKey !== 'undefined') {
|
|
1433
|
+
payload['newKey'] = newKey;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
let response = undefined;
|
|
1437
|
+
|
|
1438
|
+
response = await client.call('patch', apiPath, {
|
|
1439
|
+
'content-type': 'application/json',
|
|
1440
|
+
}, payload);
|
|
1441
|
+
|
|
1442
|
+
if (parseOutput) {
|
|
1443
|
+
parse(response)
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
return response;
|
|
1447
|
+
|
|
1181
1448
|
}
|
|
1182
1449
|
/**
|
|
1183
1450
|
* @typedef {Object} DatabasesCreateRelationshipAttributeRequestParams
|
|
@@ -2583,6 +2850,69 @@ databases
|
|
|
2583
2850
|
.option(`--new-key <new-key>`, `New Attribute Key.`)
|
|
2584
2851
|
.action(actionRunner(databasesUpdateIpAttribute))
|
|
2585
2852
|
|
|
2853
|
+
databases
|
|
2854
|
+
.command(`create-line-attribute`)
|
|
2855
|
+
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-line-column' instead] Create a geometric line attribute.`)
|
|
2856
|
+
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
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).`)
|
|
2858
|
+
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2859
|
+
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
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.`)
|
|
2861
|
+
.action(actionRunner(databasesCreateLineAttribute))
|
|
2862
|
+
|
|
2863
|
+
databases
|
|
2864
|
+
.command(`update-line-attribute`)
|
|
2865
|
+
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-line-column' instead] Update a line attribute. Changing the 'default' value will not update already existing documents.`)
|
|
2866
|
+
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
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).`)
|
|
2868
|
+
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2869
|
+
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
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.`)
|
|
2871
|
+
.option(`--new-key <new-key>`, `New attribute key.`)
|
|
2872
|
+
.action(actionRunner(databasesUpdateLineAttribute))
|
|
2873
|
+
|
|
2874
|
+
databases
|
|
2875
|
+
.command(`create-point-attribute`)
|
|
2876
|
+
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-point-column' instead] Create a geometric point attribute.`)
|
|
2877
|
+
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
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).`)
|
|
2879
|
+
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2880
|
+
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
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.`)
|
|
2882
|
+
.action(actionRunner(databasesCreatePointAttribute))
|
|
2883
|
+
|
|
2884
|
+
databases
|
|
2885
|
+
.command(`update-point-attribute`)
|
|
2886
|
+
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-point-column' instead] Update a point attribute. Changing the 'default' value will not update already existing documents.`)
|
|
2887
|
+
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
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).`)
|
|
2889
|
+
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2890
|
+
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
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.`)
|
|
2892
|
+
.option(`--new-key <new-key>`, `New attribute key.`)
|
|
2893
|
+
.action(actionRunner(databasesUpdatePointAttribute))
|
|
2894
|
+
|
|
2895
|
+
databases
|
|
2896
|
+
.command(`create-polygon-attribute`)
|
|
2897
|
+
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-polygon-column' instead] Create a geometric polygon attribute.`)
|
|
2898
|
+
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
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).`)
|
|
2900
|
+
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2901
|
+
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
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.`)
|
|
2903
|
+
.action(actionRunner(databasesCreatePolygonAttribute))
|
|
2904
|
+
|
|
2905
|
+
databases
|
|
2906
|
+
.command(`update-polygon-attribute`)
|
|
2907
|
+
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-polygon-column' instead] Update a polygon attribute. Changing the 'default' value will not update already existing documents.`)
|
|
2908
|
+
.requiredOption(`--database-id <database-id>`, `Database ID.`)
|
|
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).`)
|
|
2910
|
+
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2911
|
+
.requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
|
|
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.`)
|
|
2913
|
+
.option(`--new-key <new-key>`, `New attribute key.`)
|
|
2914
|
+
.action(actionRunner(databasesUpdatePolygonAttribute))
|
|
2915
|
+
|
|
2586
2916
|
databases
|
|
2587
2917
|
.command(`create-relationship-attribute`)
|
|
2588
2918
|
.description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-relationship-column' instead] Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). `)
|
|
@@ -2885,6 +3215,12 @@ module.exports = {
|
|
|
2885
3215
|
databasesUpdateIntegerAttribute,
|
|
2886
3216
|
databasesCreateIpAttribute,
|
|
2887
3217
|
databasesUpdateIpAttribute,
|
|
3218
|
+
databasesCreateLineAttribute,
|
|
3219
|
+
databasesUpdateLineAttribute,
|
|
3220
|
+
databasesCreatePointAttribute,
|
|
3221
|
+
databasesUpdatePointAttribute,
|
|
3222
|
+
databasesCreatePolygonAttribute,
|
|
3223
|
+
databasesUpdatePolygonAttribute,
|
|
2888
3224
|
databasesCreateRelationshipAttribute,
|
|
2889
3225
|
databasesCreateStringAttribute,
|
|
2890
3226
|
databasesUpdateStringAttribute,
|
|
@@ -1082,7 +1082,7 @@ const functionsListExecutions = async ({functionId,queries,parseOutput = true, o
|
|
|
1082
1082
|
* @property {string} body HTTP body of execution. Default value is empty string.
|
|
1083
1083
|
* @property {boolean} async Execute code in the background. Default value is false.
|
|
1084
1084
|
* @property {string} xpath HTTP path of execution. Path can include query params. Default value is /
|
|
1085
|
-
* @property {ExecutionMethod} method HTTP method of execution. Default value is
|
|
1085
|
+
* @property {ExecutionMethod} method HTTP method of execution. Default value is POST.
|
|
1086
1086
|
* @property {object} headers HTTP headers of execution. Defaults to empty.
|
|
1087
1087
|
* @property {string} scheduledAt Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
|
1088
1088
|
* @property {boolean} overrideForCli
|
|
@@ -1606,7 +1606,7 @@ functions
|
|
|
1606
1606
|
.option(`--body <body>`, `HTTP body of execution. Default value is empty string.`)
|
|
1607
1607
|
.option(`--async [value]`, `Execute code in the background. Default value is false.`, (value) => value === undefined ? true : parseBool(value))
|
|
1608
1608
|
.option(`--xpath <xpath>`, `HTTP path of execution. Path can include query params. Default value is /`)
|
|
1609
|
-
.option(`--method <method>`, `HTTP method of execution. Default value is
|
|
1609
|
+
.option(`--method <method>`, `HTTP method of execution. Default value is POST.`)
|
|
1610
1610
|
.option(`--headers <headers>`, `HTTP headers of execution. Defaults to empty.`)
|
|
1611
1611
|
.option(`--scheduled-at <scheduled-at>`, `Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.`)
|
|
1612
1612
|
.action(actionRunner(functionsCreateExecution))
|
package/lib/commands/generic.js
CHANGED
|
@@ -5,8 +5,8 @@ const { sdkForConsole } = require("../sdks");
|
|
|
5
5
|
const { globalConfig, localConfig } = require("../config");
|
|
6
6
|
const { actionRunner, success, parseBool, commandDescriptions, error, parse, hint, log, drawTable, cliConfig } = require("../parser");
|
|
7
7
|
const ID = require("../id");
|
|
8
|
-
const { questionsLogin, questionsLogout, questionsListFactors,
|
|
9
|
-
const {
|
|
8
|
+
const { questionsLogin, questionsLogout, questionsListFactors, questionsMFAChallenge } = require("../questions");
|
|
9
|
+
const { accountUpdateMFAChallenge, accountCreateMFAChallenge, accountGet, accountCreateEmailPasswordSession, accountDeleteSession } = require("./account");
|
|
10
10
|
|
|
11
11
|
const DEFAULT_ENDPOINT = 'https://cloud.appwrite.io/v1';
|
|
12
12
|
|
|
@@ -71,15 +71,15 @@ const loginCommand = async ({ email, password, endpoint, mfa, code }) => {
|
|
|
71
71
|
if (error.response === 'user_more_factors_required') {
|
|
72
72
|
const { factor } = mfa ? { factor: mfa } : await inquirer.prompt(questionsListFactors);
|
|
73
73
|
|
|
74
|
-
const challenge = await
|
|
74
|
+
const challenge = await accountCreateMFAChallenge({
|
|
75
75
|
factor,
|
|
76
76
|
parseOutput: false,
|
|
77
77
|
sdk: client
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
const { otp } = code ? { otp: code } : await inquirer.prompt(
|
|
80
|
+
const { otp } = code ? { otp: code } : await inquirer.prompt(questionsMFAChallenge);
|
|
81
81
|
|
|
82
|
-
await
|
|
82
|
+
await accountUpdateMFAChallenge({
|
|
83
83
|
challengeId: challenge.$id,
|
|
84
84
|
otp,
|
|
85
85
|
parseOutput: false,
|
package/lib/commands/init.js
CHANGED
|
@@ -124,7 +124,9 @@ const initProject = async ({ organizationId, projectId, projectName } = {}) => {
|
|
|
124
124
|
if(answers.autopull) {
|
|
125
125
|
cliConfig.all = true;
|
|
126
126
|
cliConfig.force = true;
|
|
127
|
-
await pullResources(
|
|
127
|
+
await pullResources({
|
|
128
|
+
skipDeprecated: true
|
|
129
|
+
});
|
|
128
130
|
} else {
|
|
129
131
|
log("You can run 'appwrite pull all' to synchronize all of your existing resources.");
|
|
130
132
|
}
|