appwrite-cli 0.17.0 → 0.18.2
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/README.md +4 -4
- package/docs/examples/account/{create-session.md → create-email-session.md} +1 -1
- package/docs/examples/account/create-phone-session.md +3 -0
- package/docs/examples/account/create-phone-verification.md +1 -0
- package/docs/examples/account/update-phone-session.md +3 -0
- package/docs/examples/account/update-phone-verification.md +3 -0
- package/docs/examples/account/update-phone.md +3 -0
- package/docs/examples/{database → databases}/create-boolean-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-collection.md +2 -1
- package/docs/examples/{database → databases}/create-document.md +2 -1
- package/docs/examples/{database → databases}/create-email-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-enum-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-float-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-index.md +2 -1
- package/docs/examples/{database → databases}/create-integer-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-ip-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-string-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-url-attribute.md +2 -1
- package/docs/examples/databases/create.md +3 -0
- package/docs/examples/databases/delete-attribute.md +4 -0
- package/docs/examples/databases/delete-collection.md +3 -0
- package/docs/examples/{database → databases}/delete-document.md +2 -1
- package/docs/examples/databases/delete-index.md +4 -0
- package/docs/examples/databases/delete.md +2 -0
- package/docs/examples/databases/get-attribute.md +4 -0
- package/docs/examples/databases/get-collection-usage.md +4 -0
- package/docs/examples/databases/get-collection.md +3 -0
- package/docs/examples/databases/get-database-usage.md +3 -0
- package/docs/examples/{database → databases}/get-document.md +2 -1
- package/docs/examples/databases/get-index.md +4 -0
- package/docs/examples/databases/get-usage.md +2 -0
- package/docs/examples/databases/get.md +2 -0
- package/docs/examples/databases/list-attributes.md +3 -0
- package/docs/examples/databases/list-collection-logs.md +5 -0
- package/docs/examples/databases/list-collections.md +8 -0
- package/docs/examples/{database → databases}/list-document-logs.md +2 -1
- package/docs/examples/databases/list-documents.md +10 -0
- package/docs/examples/databases/list-indexes.md +3 -0
- package/docs/examples/databases/list-logs.md +4 -0
- package/docs/examples/databases/list.md +7 -0
- package/docs/examples/{database → databases}/update-collection.md +2 -1
- package/docs/examples/{database → databases}/update-document.md +3 -2
- package/docs/examples/databases/update.md +3 -0
- package/docs/examples/projects/create-key.md +2 -1
- package/docs/examples/projects/update-key.md +2 -1
- package/docs/examples/projects/update-webhook-signature.md +3 -0
- package/docs/examples/users/{update-verification.md → update-email-verification.md} +1 -1
- package/docs/examples/users/update-phone-verification.md +3 -0
- package/docs/examples/users/update-phone.md +3 -0
- package/index.js +2 -2
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +3 -3
- package/lib/commands/account.js +202 -31
- package/lib/commands/{database.js → databases.js} +477 -177
- package/lib/commands/deploy.js +1 -1
- package/lib/commands/functions.js +4 -4
- package/lib/commands/projects.js +43 -4
- package/lib/commands/storage.js +3 -3
- package/lib/commands/teams.js +2 -2
- package/lib/commands/users.js +71 -5
- package/lib/questions.js +9 -1
- package/package.json +1 -1
- package/docs/examples/database/delete-attribute.md +0 -3
- package/docs/examples/database/delete-collection.md +0 -2
- package/docs/examples/database/delete-index.md +0 -3
- package/docs/examples/database/get-attribute.md +0 -3
- package/docs/examples/database/get-collection-usage.md +0 -3
- package/docs/examples/database/get-collection.md +0 -2
- package/docs/examples/database/get-index.md +0 -3
- package/docs/examples/database/get-usage.md +0 -2
- package/docs/examples/database/list-attributes.md +0 -2
- package/docs/examples/database/list-collection-logs.md +0 -4
- package/docs/examples/database/list-collections.md +0 -7
- package/docs/examples/database/list-documents.md +0 -9
- package/docs/examples/database/list-indexes.md +0 -2
package/lib/commands/deploy.js
CHANGED
|
@@ -149,7 +149,7 @@ const deployFunction = async () => {
|
|
|
149
149
|
let response = {};
|
|
150
150
|
|
|
151
151
|
let answers = await inquirer.prompt(questionsDeployFunctions)
|
|
152
|
-
let functions = answers.functions
|
|
152
|
+
let functions = answers.functions.map((func) => JSONbig.parse(func))
|
|
153
153
|
|
|
154
154
|
for (let func of functions) {
|
|
155
155
|
log(`Deploying function ${func.name} ( ${func['$id']} )`)
|
|
@@ -264,7 +264,7 @@ const functionsListDeployments = async ({ functionId, search, limit, offset, cur
|
|
|
264
264
|
const functionsCreateDeployment = async ({ functionId, entrypoint, code, activate, parseOutput = true, sdk = undefined, onProgress = () => {}}) => {
|
|
265
265
|
/* @param {string} functionId */
|
|
266
266
|
/* @param {string} entrypoint */
|
|
267
|
-
/* @param {
|
|
267
|
+
/* @param {InputFile} code */
|
|
268
268
|
/* @param {boolean} activate */
|
|
269
269
|
|
|
270
270
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
@@ -576,7 +576,7 @@ functions
|
|
|
576
576
|
.option(`--limit <limit>`, `Maximum number of functions to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
577
577
|
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
578
578
|
.option(`--cursor <cursor>`, `ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
579
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor.`)
|
|
579
|
+
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
580
580
|
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
581
581
|
.action(actionRunner(functionsList))
|
|
582
582
|
|
|
@@ -630,7 +630,7 @@ functions
|
|
|
630
630
|
.option(`--limit <limit>`, `Maximum number of deployments to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
631
631
|
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
632
632
|
.option(`--cursor <cursor>`, `ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
633
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor.`)
|
|
633
|
+
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
634
634
|
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
635
635
|
.action(actionRunner(functionsListDeployments))
|
|
636
636
|
|
|
@@ -680,7 +680,7 @@ functions
|
|
|
680
680
|
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
681
681
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
682
682
|
.option(`--cursor <cursor>`, `ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
683
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor.`)
|
|
683
|
+
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
684
684
|
.action(actionRunner(functionsListExecutions))
|
|
685
685
|
|
|
686
686
|
functions
|
package/lib/commands/projects.js
CHANGED
|
@@ -416,10 +416,11 @@ const projectsListKeys = async ({ projectId, parseOutput = true, sdk = undefined
|
|
|
416
416
|
return response;
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
const projectsCreateKey = async ({ projectId, name, scopes, parseOutput = true, sdk = undefined}) => {
|
|
419
|
+
const projectsCreateKey = async ({ projectId, name, scopes, expire, parseOutput = true, sdk = undefined}) => {
|
|
420
420
|
/* @param {string} projectId */
|
|
421
421
|
/* @param {string} name */
|
|
422
422
|
/* @param {string[]} scopes */
|
|
423
|
+
/* @param {number} expire */
|
|
423
424
|
|
|
424
425
|
let client = !sdk ? await sdkForConsole() : sdk;
|
|
425
426
|
let path = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
|
|
@@ -434,6 +435,10 @@ const projectsCreateKey = async ({ projectId, name, scopes, parseOutput = true,
|
|
|
434
435
|
payload['scopes'] = scopes;
|
|
435
436
|
}
|
|
436
437
|
|
|
438
|
+
if (typeof expire !== 'undefined') {
|
|
439
|
+
payload['expire'] = expire;
|
|
440
|
+
}
|
|
441
|
+
|
|
437
442
|
let response = undefined;
|
|
438
443
|
response = await client.call('post', path, {
|
|
439
444
|
'content-type': 'application/json',
|
|
@@ -465,11 +470,12 @@ const projectsGetKey = async ({ projectId, keyId, parseOutput = true, sdk = unde
|
|
|
465
470
|
return response;
|
|
466
471
|
}
|
|
467
472
|
|
|
468
|
-
const projectsUpdateKey = async ({ projectId, keyId, name, scopes, parseOutput = true, sdk = undefined}) => {
|
|
473
|
+
const projectsUpdateKey = async ({ projectId, keyId, name, scopes, expire, parseOutput = true, sdk = undefined}) => {
|
|
469
474
|
/* @param {string} projectId */
|
|
470
475
|
/* @param {string} keyId */
|
|
471
476
|
/* @param {string} name */
|
|
472
477
|
/* @param {string[]} scopes */
|
|
478
|
+
/* @param {number} expire */
|
|
473
479
|
|
|
474
480
|
let client = !sdk ? await sdkForConsole() : sdk;
|
|
475
481
|
let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
|
|
@@ -484,6 +490,10 @@ const projectsUpdateKey = async ({ projectId, keyId, name, scopes, parseOutput =
|
|
|
484
490
|
payload['scopes'] = scopes;
|
|
485
491
|
}
|
|
486
492
|
|
|
493
|
+
if (typeof expire !== 'undefined') {
|
|
494
|
+
payload['expire'] = expire;
|
|
495
|
+
}
|
|
496
|
+
|
|
487
497
|
let response = undefined;
|
|
488
498
|
response = await client.call('put', path, {
|
|
489
499
|
'content-type': 'application/json',
|
|
@@ -903,6 +913,25 @@ const projectsDeleteWebhook = async ({ projectId, webhookId, parseOutput = true,
|
|
|
903
913
|
return response;
|
|
904
914
|
}
|
|
905
915
|
|
|
916
|
+
const projectsUpdateWebhookSignature = async ({ projectId, webhookId, parseOutput = true, sdk = undefined}) => {
|
|
917
|
+
/* @param {string} projectId */
|
|
918
|
+
/* @param {string} webhookId */
|
|
919
|
+
|
|
920
|
+
let client = !sdk ? await sdkForConsole() : sdk;
|
|
921
|
+
let path = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
|
|
922
|
+
let payload = {};
|
|
923
|
+
let response = undefined;
|
|
924
|
+
response = await client.call('patch', path, {
|
|
925
|
+
'content-type': 'application/json',
|
|
926
|
+
}, payload);
|
|
927
|
+
|
|
928
|
+
if (parseOutput) {
|
|
929
|
+
parse(response)
|
|
930
|
+
success()
|
|
931
|
+
}
|
|
932
|
+
return response;
|
|
933
|
+
}
|
|
934
|
+
|
|
906
935
|
|
|
907
936
|
projects
|
|
908
937
|
.command(`list`)
|
|
@@ -911,7 +940,7 @@ projects
|
|
|
911
940
|
.option(`--limit <limit>`, `Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
912
941
|
.option(`--offset <offset>`, `Results offset. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
913
942
|
.option(`--cursor <cursor>`, `ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
914
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor.`)
|
|
943
|
+
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
915
944
|
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
916
945
|
.action(actionRunner(projectsList))
|
|
917
946
|
|
|
@@ -1022,6 +1051,7 @@ projects
|
|
|
1022
1051
|
.requiredOption(`--projectId <projectId>`, `Project unique ID.`)
|
|
1023
1052
|
.requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
|
|
1024
1053
|
.requiredOption(`--scopes <scopes...>`, `Key scopes list. Maximum of 100 scopes are allowed.`)
|
|
1054
|
+
.option(`--expire <expire>`, `Key expiration time in Unix timestamp. Use 0 for unlimited expiration.`, parseInteger)
|
|
1025
1055
|
.action(actionRunner(projectsCreateKey))
|
|
1026
1056
|
|
|
1027
1057
|
projects
|
|
@@ -1038,6 +1068,7 @@ projects
|
|
|
1038
1068
|
.requiredOption(`--keyId <keyId>`, `Key unique ID.`)
|
|
1039
1069
|
.requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
|
|
1040
1070
|
.requiredOption(`--scopes <scopes...>`, `Key scopes list. Maximum of 100 events are allowed.`)
|
|
1071
|
+
.option(`--expire <expire>`, `Key expiration time in Unix timestamp. Use 0 for unlimited expiration.`, parseInteger)
|
|
1041
1072
|
.action(actionRunner(projectsUpdateKey))
|
|
1042
1073
|
|
|
1043
1074
|
projects
|
|
@@ -1158,6 +1189,13 @@ projects
|
|
|
1158
1189
|
.requiredOption(`--webhookId <webhookId>`, `Webhook unique ID.`)
|
|
1159
1190
|
.action(actionRunner(projectsDeleteWebhook))
|
|
1160
1191
|
|
|
1192
|
+
projects
|
|
1193
|
+
.command(`updateWebhookSignature`)
|
|
1194
|
+
.description(``)
|
|
1195
|
+
.requiredOption(`--projectId <projectId>`, `Project unique ID.`)
|
|
1196
|
+
.requiredOption(`--webhookId <webhookId>`, `Webhook unique ID.`)
|
|
1197
|
+
.action(actionRunner(projectsUpdateWebhookSignature))
|
|
1198
|
+
|
|
1161
1199
|
|
|
1162
1200
|
module.exports = {
|
|
1163
1201
|
projects,
|
|
@@ -1190,5 +1228,6 @@ module.exports = {
|
|
|
1190
1228
|
projectsCreateWebhook,
|
|
1191
1229
|
projectsGetWebhook,
|
|
1192
1230
|
projectsUpdateWebhook,
|
|
1193
|
-
projectsDeleteWebhook
|
|
1231
|
+
projectsDeleteWebhook,
|
|
1232
|
+
projectsUpdateWebhookSignature
|
|
1194
1233
|
};
|
package/lib/commands/storage.js
CHANGED
|
@@ -272,7 +272,7 @@ const storageListFiles = async ({ bucketId, search, limit, offset, cursor, curso
|
|
|
272
272
|
const storageCreateFile = async ({ bucketId, fileId, file, read, write, parseOutput = true, sdk = undefined, onProgress = () => {}}) => {
|
|
273
273
|
/* @param {string} bucketId */
|
|
274
274
|
/* @param {string} fileId */
|
|
275
|
-
/* @param {
|
|
275
|
+
/* @param {InputFile} file */
|
|
276
276
|
/* @param {string[]} read */
|
|
277
277
|
/* @param {string[]} write */
|
|
278
278
|
|
|
@@ -609,7 +609,7 @@ storage
|
|
|
609
609
|
.option(`--limit <limit>`, `Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
610
610
|
.option(`--offset <offset>`, `Results offset. The default value is 0. Use this param to manage pagination.`, parseInteger)
|
|
611
611
|
.option(`--cursor <cursor>`, `ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.`)
|
|
612
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor.`)
|
|
612
|
+
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
613
613
|
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
614
614
|
.action(actionRunner(storageListBuckets))
|
|
615
615
|
|
|
@@ -663,7 +663,7 @@ storage
|
|
|
663
663
|
.option(`--limit <limit>`, `Maximum number of files to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
664
664
|
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
665
665
|
.option(`--cursor <cursor>`, `ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
666
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor.`)
|
|
666
|
+
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
667
667
|
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
668
668
|
.action(actionRunner(storageListFiles))
|
|
669
669
|
|
package/lib/commands/teams.js
CHANGED
|
@@ -365,7 +365,7 @@ teams
|
|
|
365
365
|
.option(`--limit <limit>`, `Maximum number of teams to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
366
366
|
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
367
367
|
.option(`--cursor <cursor>`, `ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
368
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor.`)
|
|
368
|
+
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
369
369
|
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
370
370
|
.action(actionRunner(teamsList))
|
|
371
371
|
|
|
@@ -412,7 +412,7 @@ teams
|
|
|
412
412
|
.option(`--limit <limit>`, `Maximum number of memberships to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
413
413
|
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
414
414
|
.option(`--cursor <cursor>`, `ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
415
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor.`)
|
|
415
|
+
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
416
416
|
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
417
417
|
.action(actionRunner(teamsGetMemberships))
|
|
418
418
|
|
package/lib/commands/users.js
CHANGED
|
@@ -278,6 +278,31 @@ const usersUpdatePassword = async ({ userId, password, parseOutput = true, sdk =
|
|
|
278
278
|
return response;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
+
const usersUpdatePhone = async ({ userId, number, parseOutput = true, sdk = undefined}) => {
|
|
282
|
+
/* @param {string} userId */
|
|
283
|
+
/* @param {string} number */
|
|
284
|
+
|
|
285
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
286
|
+
let path = '/users/{userId}/phone'.replace('{userId}', userId);
|
|
287
|
+
let payload = {};
|
|
288
|
+
|
|
289
|
+
/** Body Params */
|
|
290
|
+
if (typeof number !== 'undefined') {
|
|
291
|
+
payload['number'] = number;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
let response = undefined;
|
|
295
|
+
response = await client.call('patch', path, {
|
|
296
|
+
'content-type': 'application/json',
|
|
297
|
+
}, payload);
|
|
298
|
+
|
|
299
|
+
if (parseOutput) {
|
|
300
|
+
parse(response)
|
|
301
|
+
success()
|
|
302
|
+
}
|
|
303
|
+
return response;
|
|
304
|
+
}
|
|
305
|
+
|
|
281
306
|
const usersGetPrefs = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
282
307
|
/* @param {string} userId */
|
|
283
308
|
|
|
@@ -401,7 +426,7 @@ const usersUpdateStatus = async ({ userId, status, parseOutput = true, sdk = und
|
|
|
401
426
|
return response;
|
|
402
427
|
}
|
|
403
428
|
|
|
404
|
-
const
|
|
429
|
+
const usersUpdateEmailVerification = async ({ userId, emailVerification, parseOutput = true, sdk = undefined}) => {
|
|
405
430
|
/* @param {string} userId */
|
|
406
431
|
/* @param {boolean} emailVerification */
|
|
407
432
|
|
|
@@ -426,6 +451,31 @@ const usersUpdateVerification = async ({ userId, emailVerification, parseOutput
|
|
|
426
451
|
return response;
|
|
427
452
|
}
|
|
428
453
|
|
|
454
|
+
const usersUpdatePhoneVerification = async ({ userId, phoneVerification, parseOutput = true, sdk = undefined}) => {
|
|
455
|
+
/* @param {string} userId */
|
|
456
|
+
/* @param {boolean} phoneVerification */
|
|
457
|
+
|
|
458
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
459
|
+
let path = '/users/{userId}/verification/phone'.replace('{userId}', userId);
|
|
460
|
+
let payload = {};
|
|
461
|
+
|
|
462
|
+
/** Body Params */
|
|
463
|
+
if (typeof phoneVerification !== 'undefined') {
|
|
464
|
+
payload['phoneVerification'] = phoneVerification;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
let response = undefined;
|
|
468
|
+
response = await client.call('patch', path, {
|
|
469
|
+
'content-type': 'application/json',
|
|
470
|
+
}, payload);
|
|
471
|
+
|
|
472
|
+
if (parseOutput) {
|
|
473
|
+
parse(response)
|
|
474
|
+
success()
|
|
475
|
+
}
|
|
476
|
+
return response;
|
|
477
|
+
}
|
|
478
|
+
|
|
429
479
|
|
|
430
480
|
users
|
|
431
481
|
.command(`list`)
|
|
@@ -434,7 +484,7 @@ users
|
|
|
434
484
|
.option(`--limit <limit>`, `Maximum number of users to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
435
485
|
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
436
486
|
.option(`--cursor <cursor>`, `ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
437
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor.`)
|
|
487
|
+
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
438
488
|
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
439
489
|
.action(actionRunner(usersList))
|
|
440
490
|
|
|
@@ -501,6 +551,13 @@ users
|
|
|
501
551
|
.requiredOption(`--password <password>`, `New user password. Must be at least 8 chars.`)
|
|
502
552
|
.action(actionRunner(usersUpdatePassword))
|
|
503
553
|
|
|
554
|
+
users
|
|
555
|
+
.command(`updatePhone`)
|
|
556
|
+
.description(`Update the user phone by its unique ID.`)
|
|
557
|
+
.requiredOption(`--userId <userId>`, `User ID.`)
|
|
558
|
+
.requiredOption(`--number <number>`, `User phone number.`)
|
|
559
|
+
.action(actionRunner(usersUpdatePhone))
|
|
560
|
+
|
|
504
561
|
users
|
|
505
562
|
.command(`getPrefs`)
|
|
506
563
|
.description(`Get the user preferences by its unique ID.`)
|
|
@@ -541,11 +598,18 @@ users
|
|
|
541
598
|
.action(actionRunner(usersUpdateStatus))
|
|
542
599
|
|
|
543
600
|
users
|
|
544
|
-
.command(`
|
|
601
|
+
.command(`updateEmailVerification`)
|
|
545
602
|
.description(`Update the user email verification status by its unique ID.`)
|
|
546
603
|
.requiredOption(`--userId <userId>`, `User ID.`)
|
|
547
604
|
.requiredOption(`--emailVerification <emailVerification>`, `User email verification status.`, parseBool)
|
|
548
|
-
.action(actionRunner(
|
|
605
|
+
.action(actionRunner(usersUpdateEmailVerification))
|
|
606
|
+
|
|
607
|
+
users
|
|
608
|
+
.command(`updatePhoneVerification`)
|
|
609
|
+
.description(`Update the user phone verification status by its unique ID.`)
|
|
610
|
+
.requiredOption(`--userId <userId>`, `User ID.`)
|
|
611
|
+
.requiredOption(`--phoneVerification <phoneVerification>`, `User phone verification status.`, parseBool)
|
|
612
|
+
.action(actionRunner(usersUpdatePhoneVerification))
|
|
549
613
|
|
|
550
614
|
|
|
551
615
|
module.exports = {
|
|
@@ -560,11 +624,13 @@ module.exports = {
|
|
|
560
624
|
usersGetMemberships,
|
|
561
625
|
usersUpdateName,
|
|
562
626
|
usersUpdatePassword,
|
|
627
|
+
usersUpdatePhone,
|
|
563
628
|
usersGetPrefs,
|
|
564
629
|
usersUpdatePrefs,
|
|
565
630
|
usersGetSessions,
|
|
566
631
|
usersDeleteSessions,
|
|
567
632
|
usersDeleteSession,
|
|
568
633
|
usersUpdateStatus,
|
|
569
|
-
|
|
634
|
+
usersUpdateEmailVerification,
|
|
635
|
+
usersUpdatePhoneVerification
|
|
570
636
|
};
|
package/lib/questions.js
CHANGED
|
@@ -55,6 +55,14 @@ const getEntrypoint = (runtime) => {
|
|
|
55
55
|
return 'main.rs';
|
|
56
56
|
case 'swift':
|
|
57
57
|
return 'Sources/swift-5.5/main.swift';
|
|
58
|
+
case 'cpp':
|
|
59
|
+
return 'src/index.cc';
|
|
60
|
+
case 'dotnet':
|
|
61
|
+
return 'src/Index.cs';
|
|
62
|
+
case 'java':
|
|
63
|
+
return 'src/Index.java';
|
|
64
|
+
case 'kotlin':
|
|
65
|
+
return 'src/Index.kt';
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
return undefined;
|
|
@@ -197,7 +205,7 @@ const questionsDeployFunctions = [
|
|
|
197
205
|
let choices = functions.map((func, idx) => {
|
|
198
206
|
return {
|
|
199
207
|
name: `${func.name} (${func['$id']})`,
|
|
200
|
-
value: func
|
|
208
|
+
value: JSONbig.stringify(func)
|
|
201
209
|
}
|
|
202
210
|
})
|
|
203
211
|
return choices;
|
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": "0.
|
|
5
|
+
"version": "0.18.2",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"bin": {
|