appwrite-cli 4.2.1 → 4.2.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 +2 -2
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +7 -2
- package/lib/commands/account.js +63 -158
- package/lib/commands/assistant.js +3 -8
- package/lib/commands/avatars.js +29 -45
- package/lib/commands/console.js +3 -8
- package/lib/commands/databases.js +97 -243
- package/lib/commands/functions.js +54 -119
- package/lib/commands/generic.js +0 -1
- package/lib/commands/graphql.js +5 -13
- package/lib/commands/health.js +37 -93
- package/lib/commands/locale.js +17 -43
- package/lib/commands/migrations.js +33 -83
- package/lib/commands/project.js +13 -33
- package/lib/commands/projects.js +81 -203
- package/lib/commands/proxy.js +11 -28
- package/lib/commands/storage.js +36 -81
- package/lib/commands/teams.js +29 -73
- package/lib/commands/users.js +59 -148
- package/lib/commands/vcs.js +19 -48
- package/package.json +1 -1
- package/scoop/appwrite.json +3 -3
package/lib/commands/users.js
CHANGED
|
@@ -37,7 +37,7 @@ function convertReadStreamToReadableStream(readStream) {
|
|
|
37
37
|
|
|
38
38
|
const users = new Command("users").description(commandDescriptions['users']).configureHelp({
|
|
39
39
|
helpWidth: process.stdout.columns || 80
|
|
40
|
-
|
|
40
|
+
})
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @typedef {Object} UsersListRequestParams
|
|
@@ -52,7 +52,6 @@ const users = new Command("users").description(commandDescriptions['users']).con
|
|
|
52
52
|
*/
|
|
53
53
|
const usersList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
|
|
54
54
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
55
|
-
|
|
56
55
|
let apiPath = '/users';
|
|
57
56
|
let payload = {};
|
|
58
57
|
if (typeof queries !== 'undefined') {
|
|
@@ -62,14 +61,12 @@ const usersList = async ({ queries, search, parseOutput = true, sdk = undefined}
|
|
|
62
61
|
payload['search'] = search;
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
|
|
66
64
|
let response = undefined;
|
|
67
|
-
|
|
65
|
+
|
|
68
66
|
response = await client.call('get', apiPath, {
|
|
69
67
|
'content-type': 'application/json',
|
|
70
68
|
}, payload);
|
|
71
69
|
|
|
72
|
-
|
|
73
70
|
if (parseOutput) {
|
|
74
71
|
parse(response)
|
|
75
72
|
success()
|
|
@@ -94,7 +91,6 @@ const usersList = async ({ queries, search, parseOutput = true, sdk = undefined}
|
|
|
94
91
|
*/
|
|
95
92
|
const usersCreate = async ({ userId, email, phone, password, name, parseOutput = true, sdk = undefined}) => {
|
|
96
93
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
97
|
-
|
|
98
94
|
let apiPath = '/users';
|
|
99
95
|
let payload = {};
|
|
100
96
|
if (typeof userId !== 'undefined') {
|
|
@@ -113,14 +109,12 @@ const usersCreate = async ({ userId, email, phone, password, name, parseOutput =
|
|
|
113
109
|
payload['name'] = name;
|
|
114
110
|
}
|
|
115
111
|
|
|
116
|
-
|
|
117
112
|
let response = undefined;
|
|
118
|
-
|
|
113
|
+
|
|
119
114
|
response = await client.call('post', apiPath, {
|
|
120
115
|
'content-type': 'application/json',
|
|
121
116
|
}, payload);
|
|
122
117
|
|
|
123
|
-
|
|
124
118
|
if (parseOutput) {
|
|
125
119
|
parse(response)
|
|
126
120
|
success()
|
|
@@ -144,7 +138,6 @@ const usersCreate = async ({ userId, email, phone, password, name, parseOutput =
|
|
|
144
138
|
*/
|
|
145
139
|
const usersCreateArgon2User = async ({ userId, email, password, name, parseOutput = true, sdk = undefined}) => {
|
|
146
140
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
147
|
-
|
|
148
141
|
let apiPath = '/users/argon2';
|
|
149
142
|
let payload = {};
|
|
150
143
|
if (typeof userId !== 'undefined') {
|
|
@@ -160,14 +153,12 @@ const usersCreateArgon2User = async ({ userId, email, password, name, parseOutpu
|
|
|
160
153
|
payload['name'] = name;
|
|
161
154
|
}
|
|
162
155
|
|
|
163
|
-
|
|
164
156
|
let response = undefined;
|
|
165
|
-
|
|
157
|
+
|
|
166
158
|
response = await client.call('post', apiPath, {
|
|
167
159
|
'content-type': 'application/json',
|
|
168
160
|
}, payload);
|
|
169
161
|
|
|
170
|
-
|
|
171
162
|
if (parseOutput) {
|
|
172
163
|
parse(response)
|
|
173
164
|
success()
|
|
@@ -191,7 +182,6 @@ const usersCreateArgon2User = async ({ userId, email, password, name, parseOutpu
|
|
|
191
182
|
*/
|
|
192
183
|
const usersCreateBcryptUser = async ({ userId, email, password, name, parseOutput = true, sdk = undefined}) => {
|
|
193
184
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
194
|
-
|
|
195
185
|
let apiPath = '/users/bcrypt';
|
|
196
186
|
let payload = {};
|
|
197
187
|
if (typeof userId !== 'undefined') {
|
|
@@ -207,14 +197,12 @@ const usersCreateBcryptUser = async ({ userId, email, password, name, parseOutpu
|
|
|
207
197
|
payload['name'] = name;
|
|
208
198
|
}
|
|
209
199
|
|
|
210
|
-
|
|
211
200
|
let response = undefined;
|
|
212
|
-
|
|
201
|
+
|
|
213
202
|
response = await client.call('post', apiPath, {
|
|
214
203
|
'content-type': 'application/json',
|
|
215
204
|
}, payload);
|
|
216
205
|
|
|
217
|
-
|
|
218
206
|
if (parseOutput) {
|
|
219
207
|
parse(response)
|
|
220
208
|
success()
|
|
@@ -236,7 +224,6 @@ const usersCreateBcryptUser = async ({ userId, email, password, name, parseOutpu
|
|
|
236
224
|
*/
|
|
237
225
|
const usersListIdentities = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
|
|
238
226
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
239
|
-
|
|
240
227
|
let apiPath = '/users/identities';
|
|
241
228
|
let payload = {};
|
|
242
229
|
if (typeof queries !== 'undefined') {
|
|
@@ -246,14 +233,12 @@ const usersListIdentities = async ({ queries, search, parseOutput = true, sdk =
|
|
|
246
233
|
payload['search'] = search;
|
|
247
234
|
}
|
|
248
235
|
|
|
249
|
-
|
|
250
236
|
let response = undefined;
|
|
251
|
-
|
|
237
|
+
|
|
252
238
|
response = await client.call('get', apiPath, {
|
|
253
239
|
'content-type': 'application/json',
|
|
254
240
|
}, payload);
|
|
255
241
|
|
|
256
|
-
|
|
257
242
|
if (parseOutput) {
|
|
258
243
|
parse(response)
|
|
259
244
|
success()
|
|
@@ -274,18 +259,15 @@ const usersListIdentities = async ({ queries, search, parseOutput = true, sdk =
|
|
|
274
259
|
*/
|
|
275
260
|
const usersDeleteIdentity = async ({ identityId, parseOutput = true, sdk = undefined}) => {
|
|
276
261
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
277
|
-
|
|
278
262
|
let apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId);
|
|
279
263
|
let payload = {};
|
|
280
264
|
|
|
281
|
-
|
|
282
265
|
let response = undefined;
|
|
283
|
-
|
|
266
|
+
|
|
284
267
|
response = await client.call('delete', apiPath, {
|
|
285
268
|
'content-type': 'application/json',
|
|
286
269
|
}, payload);
|
|
287
270
|
|
|
288
|
-
|
|
289
271
|
if (parseOutput) {
|
|
290
272
|
parse(response)
|
|
291
273
|
success()
|
|
@@ -309,7 +291,6 @@ const usersDeleteIdentity = async ({ identityId, parseOutput = true, sdk = undef
|
|
|
309
291
|
*/
|
|
310
292
|
const usersCreateMD5User = async ({ userId, email, password, name, parseOutput = true, sdk = undefined}) => {
|
|
311
293
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
312
|
-
|
|
313
294
|
let apiPath = '/users/md5';
|
|
314
295
|
let payload = {};
|
|
315
296
|
if (typeof userId !== 'undefined') {
|
|
@@ -325,14 +306,12 @@ const usersCreateMD5User = async ({ userId, email, password, name, parseOutput =
|
|
|
325
306
|
payload['name'] = name;
|
|
326
307
|
}
|
|
327
308
|
|
|
328
|
-
|
|
329
309
|
let response = undefined;
|
|
330
|
-
|
|
310
|
+
|
|
331
311
|
response = await client.call('post', apiPath, {
|
|
332
312
|
'content-type': 'application/json',
|
|
333
313
|
}, payload);
|
|
334
314
|
|
|
335
|
-
|
|
336
315
|
if (parseOutput) {
|
|
337
316
|
parse(response)
|
|
338
317
|
success()
|
|
@@ -356,7 +335,6 @@ const usersCreateMD5User = async ({ userId, email, password, name, parseOutput =
|
|
|
356
335
|
*/
|
|
357
336
|
const usersCreatePHPassUser = async ({ userId, email, password, name, parseOutput = true, sdk = undefined}) => {
|
|
358
337
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
359
|
-
|
|
360
338
|
let apiPath = '/users/phpass';
|
|
361
339
|
let payload = {};
|
|
362
340
|
if (typeof userId !== 'undefined') {
|
|
@@ -372,14 +350,12 @@ const usersCreatePHPassUser = async ({ userId, email, password, name, parseOutpu
|
|
|
372
350
|
payload['name'] = name;
|
|
373
351
|
}
|
|
374
352
|
|
|
375
|
-
|
|
376
353
|
let response = undefined;
|
|
377
|
-
|
|
354
|
+
|
|
378
355
|
response = await client.call('post', apiPath, {
|
|
379
356
|
'content-type': 'application/json',
|
|
380
357
|
}, payload);
|
|
381
358
|
|
|
382
|
-
|
|
383
359
|
if (parseOutput) {
|
|
384
360
|
parse(response)
|
|
385
361
|
success()
|
|
@@ -408,7 +384,6 @@ const usersCreatePHPassUser = async ({ userId, email, password, name, parseOutpu
|
|
|
408
384
|
*/
|
|
409
385
|
const usersCreateScryptUser = async ({ userId, email, password, passwordSalt, passwordCpu, passwordMemory, passwordParallel, passwordLength, name, parseOutput = true, sdk = undefined}) => {
|
|
410
386
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
411
|
-
|
|
412
387
|
let apiPath = '/users/scrypt';
|
|
413
388
|
let payload = {};
|
|
414
389
|
if (typeof userId !== 'undefined') {
|
|
@@ -439,14 +414,12 @@ const usersCreateScryptUser = async ({ userId, email, password, passwordSalt, pa
|
|
|
439
414
|
payload['name'] = name;
|
|
440
415
|
}
|
|
441
416
|
|
|
442
|
-
|
|
443
417
|
let response = undefined;
|
|
444
|
-
|
|
418
|
+
|
|
445
419
|
response = await client.call('post', apiPath, {
|
|
446
420
|
'content-type': 'application/json',
|
|
447
421
|
}, payload);
|
|
448
422
|
|
|
449
|
-
|
|
450
423
|
if (parseOutput) {
|
|
451
424
|
parse(response)
|
|
452
425
|
success()
|
|
@@ -473,7 +446,6 @@ const usersCreateScryptUser = async ({ userId, email, password, passwordSalt, pa
|
|
|
473
446
|
*/
|
|
474
447
|
const usersCreateScryptModifiedUser = async ({ userId, email, password, passwordSalt, passwordSaltSeparator, passwordSignerKey, name, parseOutput = true, sdk = undefined}) => {
|
|
475
448
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
476
|
-
|
|
477
449
|
let apiPath = '/users/scrypt-modified';
|
|
478
450
|
let payload = {};
|
|
479
451
|
if (typeof userId !== 'undefined') {
|
|
@@ -498,14 +470,12 @@ const usersCreateScryptModifiedUser = async ({ userId, email, password, password
|
|
|
498
470
|
payload['name'] = name;
|
|
499
471
|
}
|
|
500
472
|
|
|
501
|
-
|
|
502
473
|
let response = undefined;
|
|
503
|
-
|
|
474
|
+
|
|
504
475
|
response = await client.call('post', apiPath, {
|
|
505
476
|
'content-type': 'application/json',
|
|
506
477
|
}, payload);
|
|
507
478
|
|
|
508
|
-
|
|
509
479
|
if (parseOutput) {
|
|
510
480
|
parse(response)
|
|
511
481
|
success()
|
|
@@ -530,7 +500,6 @@ const usersCreateScryptModifiedUser = async ({ userId, email, password, password
|
|
|
530
500
|
*/
|
|
531
501
|
const usersCreateSHAUser = async ({ userId, email, password, passwordVersion, name, parseOutput = true, sdk = undefined}) => {
|
|
532
502
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
533
|
-
|
|
534
503
|
let apiPath = '/users/sha';
|
|
535
504
|
let payload = {};
|
|
536
505
|
if (typeof userId !== 'undefined') {
|
|
@@ -549,14 +518,12 @@ const usersCreateSHAUser = async ({ userId, email, password, passwordVersion, na
|
|
|
549
518
|
payload['name'] = name;
|
|
550
519
|
}
|
|
551
520
|
|
|
552
|
-
|
|
553
521
|
let response = undefined;
|
|
554
|
-
|
|
522
|
+
|
|
555
523
|
response = await client.call('post', apiPath, {
|
|
556
524
|
'content-type': 'application/json',
|
|
557
525
|
}, payload);
|
|
558
526
|
|
|
559
|
-
|
|
560
527
|
if (parseOutput) {
|
|
561
528
|
parse(response)
|
|
562
529
|
success()
|
|
@@ -578,7 +545,6 @@ const usersCreateSHAUser = async ({ userId, email, password, passwordVersion, na
|
|
|
578
545
|
*/
|
|
579
546
|
const usersGetUsage = async ({ range, provider, parseOutput = true, sdk = undefined}) => {
|
|
580
547
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
581
|
-
|
|
582
548
|
let apiPath = '/users/usage';
|
|
583
549
|
let payload = {};
|
|
584
550
|
if (typeof range !== 'undefined') {
|
|
@@ -588,14 +554,12 @@ const usersGetUsage = async ({ range, provider, parseOutput = true, sdk = undefi
|
|
|
588
554
|
payload['provider'] = provider;
|
|
589
555
|
}
|
|
590
556
|
|
|
591
|
-
|
|
592
557
|
let response = undefined;
|
|
593
|
-
|
|
558
|
+
|
|
594
559
|
response = await client.call('get', apiPath, {
|
|
595
560
|
'content-type': 'application/json',
|
|
596
561
|
}, payload);
|
|
597
562
|
|
|
598
|
-
|
|
599
563
|
if (parseOutput) {
|
|
600
564
|
parse(response)
|
|
601
565
|
success()
|
|
@@ -616,18 +580,15 @@ const usersGetUsage = async ({ range, provider, parseOutput = true, sdk = undefi
|
|
|
616
580
|
*/
|
|
617
581
|
const usersGet = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
618
582
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
619
|
-
|
|
620
583
|
let apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
621
584
|
let payload = {};
|
|
622
585
|
|
|
623
|
-
|
|
624
586
|
let response = undefined;
|
|
625
|
-
|
|
587
|
+
|
|
626
588
|
response = await client.call('get', apiPath, {
|
|
627
589
|
'content-type': 'application/json',
|
|
628
590
|
}, payload);
|
|
629
591
|
|
|
630
|
-
|
|
631
592
|
if (parseOutput) {
|
|
632
593
|
parse(response)
|
|
633
594
|
success()
|
|
@@ -648,18 +609,15 @@ const usersGet = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
|
648
609
|
*/
|
|
649
610
|
const usersDelete = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
650
611
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
651
|
-
|
|
652
612
|
let apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
653
613
|
let payload = {};
|
|
654
614
|
|
|
655
|
-
|
|
656
615
|
let response = undefined;
|
|
657
|
-
|
|
616
|
+
|
|
658
617
|
response = await client.call('delete', apiPath, {
|
|
659
618
|
'content-type': 'application/json',
|
|
660
619
|
}, payload);
|
|
661
620
|
|
|
662
|
-
|
|
663
621
|
if (parseOutput) {
|
|
664
622
|
parse(response)
|
|
665
623
|
success()
|
|
@@ -681,21 +639,18 @@ const usersDelete = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
|
681
639
|
*/
|
|
682
640
|
const usersUpdateEmail = async ({ userId, email, parseOutput = true, sdk = undefined}) => {
|
|
683
641
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
684
|
-
|
|
685
642
|
let apiPath = '/users/{userId}/email'.replace('{userId}', userId);
|
|
686
643
|
let payload = {};
|
|
687
644
|
if (typeof email !== 'undefined') {
|
|
688
645
|
payload['email'] = email;
|
|
689
646
|
}
|
|
690
647
|
|
|
691
|
-
|
|
692
648
|
let response = undefined;
|
|
693
|
-
|
|
649
|
+
|
|
694
650
|
response = await client.call('patch', apiPath, {
|
|
695
651
|
'content-type': 'application/json',
|
|
696
652
|
}, payload);
|
|
697
653
|
|
|
698
|
-
|
|
699
654
|
if (parseOutput) {
|
|
700
655
|
parse(response)
|
|
701
656
|
success()
|
|
@@ -717,7 +672,6 @@ const usersUpdateEmail = async ({ userId, email, parseOutput = true, sdk = undef
|
|
|
717
672
|
*/
|
|
718
673
|
const usersUpdateLabels = async ({ userId, labels, parseOutput = true, sdk = undefined}) => {
|
|
719
674
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
720
|
-
|
|
721
675
|
let apiPath = '/users/{userId}/labels'.replace('{userId}', userId);
|
|
722
676
|
let payload = {};
|
|
723
677
|
labels = labels === true ? [] : labels;
|
|
@@ -725,14 +679,12 @@ const usersUpdateLabels = async ({ userId, labels, parseOutput = true, sdk = und
|
|
|
725
679
|
payload['labels'] = labels;
|
|
726
680
|
}
|
|
727
681
|
|
|
728
|
-
|
|
729
682
|
let response = undefined;
|
|
730
|
-
|
|
683
|
+
|
|
731
684
|
response = await client.call('put', apiPath, {
|
|
732
685
|
'content-type': 'application/json',
|
|
733
686
|
}, payload);
|
|
734
687
|
|
|
735
|
-
|
|
736
688
|
if (parseOutput) {
|
|
737
689
|
parse(response)
|
|
738
690
|
success()
|
|
@@ -754,21 +706,18 @@ const usersUpdateLabels = async ({ userId, labels, parseOutput = true, sdk = und
|
|
|
754
706
|
*/
|
|
755
707
|
const usersListLogs = async ({ userId, queries, parseOutput = true, sdk = undefined}) => {
|
|
756
708
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
757
|
-
|
|
758
709
|
let apiPath = '/users/{userId}/logs'.replace('{userId}', userId);
|
|
759
710
|
let payload = {};
|
|
760
711
|
if (typeof queries !== 'undefined') {
|
|
761
712
|
payload['queries'] = queries;
|
|
762
713
|
}
|
|
763
714
|
|
|
764
|
-
|
|
765
715
|
let response = undefined;
|
|
766
|
-
|
|
716
|
+
|
|
767
717
|
response = await client.call('get', apiPath, {
|
|
768
718
|
'content-type': 'application/json',
|
|
769
719
|
}, payload);
|
|
770
720
|
|
|
771
|
-
|
|
772
721
|
if (parseOutput) {
|
|
773
722
|
parse(response)
|
|
774
723
|
success()
|
|
@@ -789,18 +738,15 @@ const usersListLogs = async ({ userId, queries, parseOutput = true, sdk = undefi
|
|
|
789
738
|
*/
|
|
790
739
|
const usersListMemberships = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
791
740
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
792
|
-
|
|
793
741
|
let apiPath = '/users/{userId}/memberships'.replace('{userId}', userId);
|
|
794
742
|
let payload = {};
|
|
795
743
|
|
|
796
|
-
|
|
797
744
|
let response = undefined;
|
|
798
|
-
|
|
745
|
+
|
|
799
746
|
response = await client.call('get', apiPath, {
|
|
800
747
|
'content-type': 'application/json',
|
|
801
748
|
}, payload);
|
|
802
749
|
|
|
803
|
-
|
|
804
750
|
if (parseOutput) {
|
|
805
751
|
parse(response)
|
|
806
752
|
success()
|
|
@@ -822,21 +768,18 @@ const usersListMemberships = async ({ userId, parseOutput = true, sdk = undefine
|
|
|
822
768
|
*/
|
|
823
769
|
const usersUpdateName = async ({ userId, name, parseOutput = true, sdk = undefined}) => {
|
|
824
770
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
825
|
-
|
|
826
771
|
let apiPath = '/users/{userId}/name'.replace('{userId}', userId);
|
|
827
772
|
let payload = {};
|
|
828
773
|
if (typeof name !== 'undefined') {
|
|
829
774
|
payload['name'] = name;
|
|
830
775
|
}
|
|
831
776
|
|
|
832
|
-
|
|
833
777
|
let response = undefined;
|
|
834
|
-
|
|
778
|
+
|
|
835
779
|
response = await client.call('patch', apiPath, {
|
|
836
780
|
'content-type': 'application/json',
|
|
837
781
|
}, payload);
|
|
838
782
|
|
|
839
|
-
|
|
840
783
|
if (parseOutput) {
|
|
841
784
|
parse(response)
|
|
842
785
|
success()
|
|
@@ -858,21 +801,18 @@ const usersUpdateName = async ({ userId, name, parseOutput = true, sdk = undefin
|
|
|
858
801
|
*/
|
|
859
802
|
const usersUpdatePassword = async ({ userId, password, parseOutput = true, sdk = undefined}) => {
|
|
860
803
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
861
|
-
|
|
862
804
|
let apiPath = '/users/{userId}/password'.replace('{userId}', userId);
|
|
863
805
|
let payload = {};
|
|
864
806
|
if (typeof password !== 'undefined') {
|
|
865
807
|
payload['password'] = password;
|
|
866
808
|
}
|
|
867
809
|
|
|
868
|
-
|
|
869
810
|
let response = undefined;
|
|
870
|
-
|
|
811
|
+
|
|
871
812
|
response = await client.call('patch', apiPath, {
|
|
872
813
|
'content-type': 'application/json',
|
|
873
814
|
}, payload);
|
|
874
815
|
|
|
875
|
-
|
|
876
816
|
if (parseOutput) {
|
|
877
817
|
parse(response)
|
|
878
818
|
success()
|
|
@@ -894,21 +834,18 @@ const usersUpdatePassword = async ({ userId, password, parseOutput = true, sdk =
|
|
|
894
834
|
*/
|
|
895
835
|
const usersUpdatePhone = async ({ userId, number, parseOutput = true, sdk = undefined}) => {
|
|
896
836
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
897
|
-
|
|
898
837
|
let apiPath = '/users/{userId}/phone'.replace('{userId}', userId);
|
|
899
838
|
let payload = {};
|
|
900
839
|
if (typeof number !== 'undefined') {
|
|
901
840
|
payload['number'] = number;
|
|
902
841
|
}
|
|
903
842
|
|
|
904
|
-
|
|
905
843
|
let response = undefined;
|
|
906
|
-
|
|
844
|
+
|
|
907
845
|
response = await client.call('patch', apiPath, {
|
|
908
846
|
'content-type': 'application/json',
|
|
909
847
|
}, payload);
|
|
910
848
|
|
|
911
|
-
|
|
912
849
|
if (parseOutput) {
|
|
913
850
|
parse(response)
|
|
914
851
|
success()
|
|
@@ -929,18 +866,15 @@ const usersUpdatePhone = async ({ userId, number, parseOutput = true, sdk = unde
|
|
|
929
866
|
*/
|
|
930
867
|
const usersGetPrefs = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
931
868
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
932
|
-
|
|
933
869
|
let apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
934
870
|
let payload = {};
|
|
935
871
|
|
|
936
|
-
|
|
937
872
|
let response = undefined;
|
|
938
|
-
|
|
873
|
+
|
|
939
874
|
response = await client.call('get', apiPath, {
|
|
940
875
|
'content-type': 'application/json',
|
|
941
876
|
}, payload);
|
|
942
877
|
|
|
943
|
-
|
|
944
878
|
if (parseOutput) {
|
|
945
879
|
parse(response)
|
|
946
880
|
success()
|
|
@@ -962,21 +896,18 @@ const usersGetPrefs = async ({ userId, parseOutput = true, sdk = undefined}) =>
|
|
|
962
896
|
*/
|
|
963
897
|
const usersUpdatePrefs = async ({ userId, prefs, parseOutput = true, sdk = undefined}) => {
|
|
964
898
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
965
|
-
|
|
966
899
|
let apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
967
900
|
let payload = {};
|
|
968
901
|
if (typeof prefs !== 'undefined') {
|
|
969
902
|
payload['prefs'] = JSON.parse(prefs);
|
|
970
903
|
}
|
|
971
904
|
|
|
972
|
-
|
|
973
905
|
let response = undefined;
|
|
974
|
-
|
|
906
|
+
|
|
975
907
|
response = await client.call('patch', apiPath, {
|
|
976
908
|
'content-type': 'application/json',
|
|
977
909
|
}, payload);
|
|
978
910
|
|
|
979
|
-
|
|
980
911
|
if (parseOutput) {
|
|
981
912
|
parse(response)
|
|
982
913
|
success()
|
|
@@ -997,18 +928,15 @@ const usersUpdatePrefs = async ({ userId, prefs, parseOutput = true, sdk = undef
|
|
|
997
928
|
*/
|
|
998
929
|
const usersListSessions = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
999
930
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1000
|
-
|
|
1001
931
|
let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1002
932
|
let payload = {};
|
|
1003
933
|
|
|
1004
|
-
|
|
1005
934
|
let response = undefined;
|
|
1006
|
-
|
|
935
|
+
|
|
1007
936
|
response = await client.call('get', apiPath, {
|
|
1008
937
|
'content-type': 'application/json',
|
|
1009
938
|
}, payload);
|
|
1010
939
|
|
|
1011
|
-
|
|
1012
940
|
if (parseOutput) {
|
|
1013
941
|
parse(response)
|
|
1014
942
|
success()
|
|
@@ -1029,18 +957,15 @@ const usersListSessions = async ({ userId, parseOutput = true, sdk = undefined})
|
|
|
1029
957
|
*/
|
|
1030
958
|
const usersDeleteSessions = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
1031
959
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1032
|
-
|
|
1033
960
|
let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1034
961
|
let payload = {};
|
|
1035
962
|
|
|
1036
|
-
|
|
1037
963
|
let response = undefined;
|
|
1038
|
-
|
|
964
|
+
|
|
1039
965
|
response = await client.call('delete', apiPath, {
|
|
1040
966
|
'content-type': 'application/json',
|
|
1041
967
|
}, payload);
|
|
1042
968
|
|
|
1043
|
-
|
|
1044
969
|
if (parseOutput) {
|
|
1045
970
|
parse(response)
|
|
1046
971
|
success()
|
|
@@ -1062,18 +987,15 @@ const usersDeleteSessions = async ({ userId, parseOutput = true, sdk = undefined
|
|
|
1062
987
|
*/
|
|
1063
988
|
const usersDeleteSession = async ({ userId, sessionId, parseOutput = true, sdk = undefined}) => {
|
|
1064
989
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1065
|
-
|
|
1066
990
|
let apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);
|
|
1067
991
|
let payload = {};
|
|
1068
992
|
|
|
1069
|
-
|
|
1070
993
|
let response = undefined;
|
|
1071
|
-
|
|
994
|
+
|
|
1072
995
|
response = await client.call('delete', apiPath, {
|
|
1073
996
|
'content-type': 'application/json',
|
|
1074
997
|
}, payload);
|
|
1075
998
|
|
|
1076
|
-
|
|
1077
999
|
if (parseOutput) {
|
|
1078
1000
|
parse(response)
|
|
1079
1001
|
success()
|
|
@@ -1095,21 +1017,18 @@ const usersDeleteSession = async ({ userId, sessionId, parseOutput = true, sdk =
|
|
|
1095
1017
|
*/
|
|
1096
1018
|
const usersUpdateStatus = async ({ userId, status, parseOutput = true, sdk = undefined}) => {
|
|
1097
1019
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1098
|
-
|
|
1099
1020
|
let apiPath = '/users/{userId}/status'.replace('{userId}', userId);
|
|
1100
1021
|
let payload = {};
|
|
1101
1022
|
if (typeof status !== 'undefined') {
|
|
1102
1023
|
payload['status'] = status;
|
|
1103
1024
|
}
|
|
1104
1025
|
|
|
1105
|
-
|
|
1106
1026
|
let response = undefined;
|
|
1107
|
-
|
|
1027
|
+
|
|
1108
1028
|
response = await client.call('patch', apiPath, {
|
|
1109
1029
|
'content-type': 'application/json',
|
|
1110
1030
|
}, payload);
|
|
1111
1031
|
|
|
1112
|
-
|
|
1113
1032
|
if (parseOutput) {
|
|
1114
1033
|
parse(response)
|
|
1115
1034
|
success()
|
|
@@ -1131,21 +1050,18 @@ const usersUpdateStatus = async ({ userId, status, parseOutput = true, sdk = und
|
|
|
1131
1050
|
*/
|
|
1132
1051
|
const usersUpdateEmailVerification = async ({ userId, emailVerification, parseOutput = true, sdk = undefined}) => {
|
|
1133
1052
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1134
|
-
|
|
1135
1053
|
let apiPath = '/users/{userId}/verification'.replace('{userId}', userId);
|
|
1136
1054
|
let payload = {};
|
|
1137
1055
|
if (typeof emailVerification !== 'undefined') {
|
|
1138
1056
|
payload['emailVerification'] = emailVerification;
|
|
1139
1057
|
}
|
|
1140
1058
|
|
|
1141
|
-
|
|
1142
1059
|
let response = undefined;
|
|
1143
|
-
|
|
1060
|
+
|
|
1144
1061
|
response = await client.call('patch', apiPath, {
|
|
1145
1062
|
'content-type': 'application/json',
|
|
1146
1063
|
}, payload);
|
|
1147
1064
|
|
|
1148
|
-
|
|
1149
1065
|
if (parseOutput) {
|
|
1150
1066
|
parse(response)
|
|
1151
1067
|
success()
|
|
@@ -1167,21 +1083,18 @@ const usersUpdateEmailVerification = async ({ userId, emailVerification, parseOu
|
|
|
1167
1083
|
*/
|
|
1168
1084
|
const usersUpdatePhoneVerification = async ({ userId, phoneVerification, parseOutput = true, sdk = undefined}) => {
|
|
1169
1085
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1170
|
-
|
|
1171
1086
|
let apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId);
|
|
1172
1087
|
let payload = {};
|
|
1173
1088
|
if (typeof phoneVerification !== 'undefined') {
|
|
1174
1089
|
payload['phoneVerification'] = phoneVerification;
|
|
1175
1090
|
}
|
|
1176
1091
|
|
|
1177
|
-
|
|
1178
1092
|
let response = undefined;
|
|
1179
|
-
|
|
1093
|
+
|
|
1180
1094
|
response = await client.call('patch', apiPath, {
|
|
1181
1095
|
'content-type': 'application/json',
|
|
1182
1096
|
}, payload);
|
|
1183
1097
|
|
|
1184
|
-
|
|
1185
1098
|
if (parseOutput) {
|
|
1186
1099
|
parse(response)
|
|
1187
1100
|
success()
|
|
@@ -1190,7 +1103,6 @@ const usersUpdatePhoneVerification = async ({ userId, phoneVerification, parseOu
|
|
|
1190
1103
|
return response;
|
|
1191
1104
|
}
|
|
1192
1105
|
|
|
1193
|
-
|
|
1194
1106
|
users
|
|
1195
1107
|
.command(`list`)
|
|
1196
1108
|
.description(`Get a list of all the project's users. You can use the query params to filter your results.`)
|
|
@@ -1413,36 +1325,35 @@ users
|
|
|
1413
1325
|
.requiredOption(`--phoneVerification <phoneVerification>`, `User phone verification status.`, parseBool)
|
|
1414
1326
|
.action(actionRunner(usersUpdatePhoneVerification))
|
|
1415
1327
|
|
|
1416
|
-
|
|
1417
1328
|
module.exports = {
|
|
1418
1329
|
users,
|
|
1419
|
-
usersList,
|
|
1420
|
-
usersCreate,
|
|
1421
|
-
usersCreateArgon2User,
|
|
1422
|
-
usersCreateBcryptUser,
|
|
1423
|
-
usersListIdentities,
|
|
1424
|
-
usersDeleteIdentity,
|
|
1425
|
-
usersCreateMD5User,
|
|
1426
|
-
usersCreatePHPassUser,
|
|
1427
|
-
usersCreateScryptUser,
|
|
1428
|
-
usersCreateScryptModifiedUser,
|
|
1429
|
-
usersCreateSHAUser,
|
|
1430
|
-
usersGetUsage,
|
|
1431
|
-
usersGet,
|
|
1432
|
-
usersDelete,
|
|
1433
|
-
usersUpdateEmail,
|
|
1434
|
-
usersUpdateLabels,
|
|
1435
|
-
usersListLogs,
|
|
1436
|
-
usersListMemberships,
|
|
1437
|
-
usersUpdateName,
|
|
1438
|
-
usersUpdatePassword,
|
|
1439
|
-
usersUpdatePhone,
|
|
1440
|
-
usersGetPrefs,
|
|
1441
|
-
usersUpdatePrefs,
|
|
1442
|
-
usersListSessions,
|
|
1443
|
-
usersDeleteSessions,
|
|
1444
|
-
usersDeleteSession,
|
|
1445
|
-
usersUpdateStatus,
|
|
1446
|
-
usersUpdateEmailVerification,
|
|
1447
|
-
usersUpdatePhoneVerification
|
|
1330
|
+
usersList,
|
|
1331
|
+
usersCreate,
|
|
1332
|
+
usersCreateArgon2User,
|
|
1333
|
+
usersCreateBcryptUser,
|
|
1334
|
+
usersListIdentities,
|
|
1335
|
+
usersDeleteIdentity,
|
|
1336
|
+
usersCreateMD5User,
|
|
1337
|
+
usersCreatePHPassUser,
|
|
1338
|
+
usersCreateScryptUser,
|
|
1339
|
+
usersCreateScryptModifiedUser,
|
|
1340
|
+
usersCreateSHAUser,
|
|
1341
|
+
usersGetUsage,
|
|
1342
|
+
usersGet,
|
|
1343
|
+
usersDelete,
|
|
1344
|
+
usersUpdateEmail,
|
|
1345
|
+
usersUpdateLabels,
|
|
1346
|
+
usersListLogs,
|
|
1347
|
+
usersListMemberships,
|
|
1348
|
+
usersUpdateName,
|
|
1349
|
+
usersUpdatePassword,
|
|
1350
|
+
usersUpdatePhone,
|
|
1351
|
+
usersGetPrefs,
|
|
1352
|
+
usersUpdatePrefs,
|
|
1353
|
+
usersListSessions,
|
|
1354
|
+
usersDeleteSessions,
|
|
1355
|
+
usersDeleteSession,
|
|
1356
|
+
usersUpdateStatus,
|
|
1357
|
+
usersUpdateEmailVerification,
|
|
1358
|
+
usersUpdatePhoneVerification
|
|
1448
1359
|
};
|