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/account.js
CHANGED
|
@@ -37,7 +37,7 @@ function convertReadStreamToReadableStream(readStream) {
|
|
|
37
37
|
|
|
38
38
|
const account = new Command("account").description(commandDescriptions['account']).configureHelp({
|
|
39
39
|
helpWidth: process.stdout.columns || 80
|
|
40
|
-
|
|
40
|
+
})
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @typedef {Object} AccountGetRequestParams
|
|
@@ -50,18 +50,15 @@ const account = new Command("account").description(commandDescriptions['account'
|
|
|
50
50
|
*/
|
|
51
51
|
const accountGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
52
52
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
53
|
-
|
|
54
53
|
let apiPath = '/account';
|
|
55
54
|
let payload = {};
|
|
56
55
|
|
|
57
|
-
|
|
58
56
|
let response = undefined;
|
|
59
|
-
|
|
57
|
+
|
|
60
58
|
response = await client.call('get', apiPath, {
|
|
61
59
|
'content-type': 'application/json',
|
|
62
60
|
}, payload);
|
|
63
61
|
|
|
64
|
-
|
|
65
62
|
if (parseOutput) {
|
|
66
63
|
parse(response)
|
|
67
64
|
success()
|
|
@@ -85,7 +82,6 @@ const accountGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
85
82
|
*/
|
|
86
83
|
const accountCreate = async ({ userId, email, password, name, parseOutput = true, sdk = undefined}) => {
|
|
87
84
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
88
|
-
|
|
89
85
|
let apiPath = '/account';
|
|
90
86
|
let payload = {};
|
|
91
87
|
if (typeof userId !== 'undefined') {
|
|
@@ -101,14 +97,12 @@ const accountCreate = async ({ userId, email, password, name, parseOutput = true
|
|
|
101
97
|
payload['name'] = name;
|
|
102
98
|
}
|
|
103
99
|
|
|
104
|
-
|
|
105
100
|
let response = undefined;
|
|
106
|
-
|
|
101
|
+
|
|
107
102
|
response = await client.call('post', apiPath, {
|
|
108
103
|
'content-type': 'application/json',
|
|
109
104
|
}, payload);
|
|
110
105
|
|
|
111
|
-
|
|
112
106
|
if (parseOutput) {
|
|
113
107
|
parse(response)
|
|
114
108
|
success()
|
|
@@ -130,7 +124,6 @@ const accountCreate = async ({ userId, email, password, name, parseOutput = true
|
|
|
130
124
|
*/
|
|
131
125
|
const accountUpdateEmail = async ({ email, password, parseOutput = true, sdk = undefined}) => {
|
|
132
126
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
133
|
-
|
|
134
127
|
let apiPath = '/account/email';
|
|
135
128
|
let payload = {};
|
|
136
129
|
if (typeof email !== 'undefined') {
|
|
@@ -140,14 +133,12 @@ const accountUpdateEmail = async ({ email, password, parseOutput = true, sdk = u
|
|
|
140
133
|
payload['password'] = password;
|
|
141
134
|
}
|
|
142
135
|
|
|
143
|
-
|
|
144
136
|
let response = undefined;
|
|
145
|
-
|
|
137
|
+
|
|
146
138
|
response = await client.call('patch', apiPath, {
|
|
147
139
|
'content-type': 'application/json',
|
|
148
140
|
}, payload);
|
|
149
141
|
|
|
150
|
-
|
|
151
142
|
if (parseOutput) {
|
|
152
143
|
parse(response)
|
|
153
144
|
success()
|
|
@@ -168,21 +159,18 @@ const accountUpdateEmail = async ({ email, password, parseOutput = true, sdk = u
|
|
|
168
159
|
*/
|
|
169
160
|
const accountListIdentities = async ({ queries, parseOutput = true, sdk = undefined}) => {
|
|
170
161
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
171
|
-
|
|
172
162
|
let apiPath = '/account/identities';
|
|
173
163
|
let payload = {};
|
|
174
164
|
if (typeof queries !== 'undefined') {
|
|
175
165
|
payload['queries'] = queries;
|
|
176
166
|
}
|
|
177
167
|
|
|
178
|
-
|
|
179
168
|
let response = undefined;
|
|
180
|
-
|
|
169
|
+
|
|
181
170
|
response = await client.call('get', apiPath, {
|
|
182
171
|
'content-type': 'application/json',
|
|
183
172
|
}, payload);
|
|
184
173
|
|
|
185
|
-
|
|
186
174
|
if (parseOutput) {
|
|
187
175
|
parse(response)
|
|
188
176
|
success()
|
|
@@ -203,18 +191,15 @@ const accountListIdentities = async ({ queries, parseOutput = true, sdk = undefi
|
|
|
203
191
|
*/
|
|
204
192
|
const accountDeleteIdentity = async ({ identityId, parseOutput = true, sdk = undefined}) => {
|
|
205
193
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
206
|
-
|
|
207
194
|
let apiPath = '/account/identities/{identityId}'.replace('{identityId}', identityId);
|
|
208
195
|
let payload = {};
|
|
209
196
|
|
|
210
|
-
|
|
211
197
|
let response = undefined;
|
|
212
|
-
|
|
198
|
+
|
|
213
199
|
response = await client.call('delete', apiPath, {
|
|
214
200
|
'content-type': 'application/json',
|
|
215
201
|
}, payload);
|
|
216
202
|
|
|
217
|
-
|
|
218
203
|
if (parseOutput) {
|
|
219
204
|
parse(response)
|
|
220
205
|
success()
|
|
@@ -234,18 +219,15 @@ const accountDeleteIdentity = async ({ identityId, parseOutput = true, sdk = und
|
|
|
234
219
|
*/
|
|
235
220
|
const accountCreateJWT = async ({ parseOutput = true, sdk = undefined}) => {
|
|
236
221
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
237
|
-
|
|
238
222
|
let apiPath = '/account/jwt';
|
|
239
223
|
let payload = {};
|
|
240
224
|
|
|
241
|
-
|
|
242
225
|
let response = undefined;
|
|
243
|
-
|
|
226
|
+
|
|
244
227
|
response = await client.call('post', apiPath, {
|
|
245
228
|
'content-type': 'application/json',
|
|
246
229
|
}, payload);
|
|
247
230
|
|
|
248
|
-
|
|
249
231
|
if (parseOutput) {
|
|
250
232
|
parse(response)
|
|
251
233
|
success()
|
|
@@ -266,21 +248,18 @@ const accountCreateJWT = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
266
248
|
*/
|
|
267
249
|
const accountListLogs = async ({ queries, parseOutput = true, sdk = undefined}) => {
|
|
268
250
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
269
|
-
|
|
270
251
|
let apiPath = '/account/logs';
|
|
271
252
|
let payload = {};
|
|
272
253
|
if (typeof queries !== 'undefined') {
|
|
273
254
|
payload['queries'] = queries;
|
|
274
255
|
}
|
|
275
256
|
|
|
276
|
-
|
|
277
257
|
let response = undefined;
|
|
278
|
-
|
|
258
|
+
|
|
279
259
|
response = await client.call('get', apiPath, {
|
|
280
260
|
'content-type': 'application/json',
|
|
281
261
|
}, payload);
|
|
282
262
|
|
|
283
|
-
|
|
284
263
|
if (parseOutput) {
|
|
285
264
|
parse(response)
|
|
286
265
|
success()
|
|
@@ -301,21 +280,18 @@ const accountListLogs = async ({ queries, parseOutput = true, sdk = undefined})
|
|
|
301
280
|
*/
|
|
302
281
|
const accountUpdateName = async ({ name, parseOutput = true, sdk = undefined}) => {
|
|
303
282
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
304
|
-
|
|
305
283
|
let apiPath = '/account/name';
|
|
306
284
|
let payload = {};
|
|
307
285
|
if (typeof name !== 'undefined') {
|
|
308
286
|
payload['name'] = name;
|
|
309
287
|
}
|
|
310
288
|
|
|
311
|
-
|
|
312
289
|
let response = undefined;
|
|
313
|
-
|
|
290
|
+
|
|
314
291
|
response = await client.call('patch', apiPath, {
|
|
315
292
|
'content-type': 'application/json',
|
|
316
293
|
}, payload);
|
|
317
294
|
|
|
318
|
-
|
|
319
295
|
if (parseOutput) {
|
|
320
296
|
parse(response)
|
|
321
297
|
success()
|
|
@@ -337,7 +313,6 @@ const accountUpdateName = async ({ name, parseOutput = true, sdk = undefined}) =
|
|
|
337
313
|
*/
|
|
338
314
|
const accountUpdatePassword = async ({ password, oldPassword, parseOutput = true, sdk = undefined}) => {
|
|
339
315
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
340
|
-
|
|
341
316
|
let apiPath = '/account/password';
|
|
342
317
|
let payload = {};
|
|
343
318
|
if (typeof password !== 'undefined') {
|
|
@@ -347,14 +322,12 @@ const accountUpdatePassword = async ({ password, oldPassword, parseOutput = true
|
|
|
347
322
|
payload['oldPassword'] = oldPassword;
|
|
348
323
|
}
|
|
349
324
|
|
|
350
|
-
|
|
351
325
|
let response = undefined;
|
|
352
|
-
|
|
326
|
+
|
|
353
327
|
response = await client.call('patch', apiPath, {
|
|
354
328
|
'content-type': 'application/json',
|
|
355
329
|
}, payload);
|
|
356
330
|
|
|
357
|
-
|
|
358
331
|
if (parseOutput) {
|
|
359
332
|
parse(response)
|
|
360
333
|
success()
|
|
@@ -376,7 +349,6 @@ const accountUpdatePassword = async ({ password, oldPassword, parseOutput = true
|
|
|
376
349
|
*/
|
|
377
350
|
const accountUpdatePhone = async ({ phone, password, parseOutput = true, sdk = undefined}) => {
|
|
378
351
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
379
|
-
|
|
380
352
|
let apiPath = '/account/phone';
|
|
381
353
|
let payload = {};
|
|
382
354
|
if (typeof phone !== 'undefined') {
|
|
@@ -386,14 +358,12 @@ const accountUpdatePhone = async ({ phone, password, parseOutput = true, sdk = u
|
|
|
386
358
|
payload['password'] = password;
|
|
387
359
|
}
|
|
388
360
|
|
|
389
|
-
|
|
390
361
|
let response = undefined;
|
|
391
|
-
|
|
362
|
+
|
|
392
363
|
response = await client.call('patch', apiPath, {
|
|
393
364
|
'content-type': 'application/json',
|
|
394
365
|
}, payload);
|
|
395
366
|
|
|
396
|
-
|
|
397
367
|
if (parseOutput) {
|
|
398
368
|
parse(response)
|
|
399
369
|
success()
|
|
@@ -413,18 +383,15 @@ const accountUpdatePhone = async ({ phone, password, parseOutput = true, sdk = u
|
|
|
413
383
|
*/
|
|
414
384
|
const accountGetPrefs = async ({ parseOutput = true, sdk = undefined}) => {
|
|
415
385
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
416
|
-
|
|
417
386
|
let apiPath = '/account/prefs';
|
|
418
387
|
let payload = {};
|
|
419
388
|
|
|
420
|
-
|
|
421
389
|
let response = undefined;
|
|
422
|
-
|
|
390
|
+
|
|
423
391
|
response = await client.call('get', apiPath, {
|
|
424
392
|
'content-type': 'application/json',
|
|
425
393
|
}, payload);
|
|
426
394
|
|
|
427
|
-
|
|
428
395
|
if (parseOutput) {
|
|
429
396
|
parse(response)
|
|
430
397
|
success()
|
|
@@ -445,21 +412,18 @@ const accountGetPrefs = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
445
412
|
*/
|
|
446
413
|
const accountUpdatePrefs = async ({ prefs, parseOutput = true, sdk = undefined}) => {
|
|
447
414
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
448
|
-
|
|
449
415
|
let apiPath = '/account/prefs';
|
|
450
416
|
let payload = {};
|
|
451
417
|
if (typeof prefs !== 'undefined') {
|
|
452
418
|
payload['prefs'] = JSON.parse(prefs);
|
|
453
419
|
}
|
|
454
420
|
|
|
455
|
-
|
|
456
421
|
let response = undefined;
|
|
457
|
-
|
|
422
|
+
|
|
458
423
|
response = await client.call('patch', apiPath, {
|
|
459
424
|
'content-type': 'application/json',
|
|
460
425
|
}, payload);
|
|
461
426
|
|
|
462
|
-
|
|
463
427
|
if (parseOutput) {
|
|
464
428
|
parse(response)
|
|
465
429
|
success()
|
|
@@ -481,7 +445,6 @@ const accountUpdatePrefs = async ({ prefs, parseOutput = true, sdk = undefined})
|
|
|
481
445
|
*/
|
|
482
446
|
const accountCreateRecovery = async ({ email, url, parseOutput = true, sdk = undefined}) => {
|
|
483
447
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
484
|
-
|
|
485
448
|
let apiPath = '/account/recovery';
|
|
486
449
|
let payload = {};
|
|
487
450
|
if (typeof email !== 'undefined') {
|
|
@@ -491,14 +454,12 @@ const accountCreateRecovery = async ({ email, url, parseOutput = true, sdk = und
|
|
|
491
454
|
payload['url'] = url;
|
|
492
455
|
}
|
|
493
456
|
|
|
494
|
-
|
|
495
457
|
let response = undefined;
|
|
496
|
-
|
|
458
|
+
|
|
497
459
|
response = await client.call('post', apiPath, {
|
|
498
460
|
'content-type': 'application/json',
|
|
499
461
|
}, payload);
|
|
500
462
|
|
|
501
|
-
|
|
502
463
|
if (parseOutput) {
|
|
503
464
|
parse(response)
|
|
504
465
|
success()
|
|
@@ -522,7 +483,6 @@ const accountCreateRecovery = async ({ email, url, parseOutput = true, sdk = und
|
|
|
522
483
|
*/
|
|
523
484
|
const accountUpdateRecovery = async ({ userId, secret, password, passwordAgain, parseOutput = true, sdk = undefined}) => {
|
|
524
485
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
525
|
-
|
|
526
486
|
let apiPath = '/account/recovery';
|
|
527
487
|
let payload = {};
|
|
528
488
|
if (typeof userId !== 'undefined') {
|
|
@@ -538,14 +498,12 @@ const accountUpdateRecovery = async ({ userId, secret, password, passwordAgain,
|
|
|
538
498
|
payload['passwordAgain'] = passwordAgain;
|
|
539
499
|
}
|
|
540
500
|
|
|
541
|
-
|
|
542
501
|
let response = undefined;
|
|
543
|
-
|
|
502
|
+
|
|
544
503
|
response = await client.call('put', apiPath, {
|
|
545
504
|
'content-type': 'application/json',
|
|
546
505
|
}, payload);
|
|
547
506
|
|
|
548
|
-
|
|
549
507
|
if (parseOutput) {
|
|
550
508
|
parse(response)
|
|
551
509
|
success()
|
|
@@ -565,18 +523,15 @@ const accountUpdateRecovery = async ({ userId, secret, password, passwordAgain,
|
|
|
565
523
|
*/
|
|
566
524
|
const accountListSessions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
567
525
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
568
|
-
|
|
569
526
|
let apiPath = '/account/sessions';
|
|
570
527
|
let payload = {};
|
|
571
528
|
|
|
572
|
-
|
|
573
529
|
let response = undefined;
|
|
574
|
-
|
|
530
|
+
|
|
575
531
|
response = await client.call('get', apiPath, {
|
|
576
532
|
'content-type': 'application/json',
|
|
577
533
|
}, payload);
|
|
578
534
|
|
|
579
|
-
|
|
580
535
|
if (parseOutput) {
|
|
581
536
|
parse(response)
|
|
582
537
|
success()
|
|
@@ -596,18 +551,15 @@ const accountListSessions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
596
551
|
*/
|
|
597
552
|
const accountDeleteSessions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
598
553
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
599
|
-
|
|
600
554
|
let apiPath = '/account/sessions';
|
|
601
555
|
let payload = {};
|
|
602
556
|
|
|
603
|
-
|
|
604
557
|
let response = undefined;
|
|
605
|
-
|
|
558
|
+
|
|
606
559
|
response = await client.call('delete', apiPath, {
|
|
607
560
|
'content-type': 'application/json',
|
|
608
561
|
}, payload);
|
|
609
562
|
|
|
610
|
-
|
|
611
563
|
if (parseOutput) {
|
|
612
564
|
parse(response)
|
|
613
565
|
success()
|
|
@@ -627,18 +579,15 @@ const accountDeleteSessions = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
627
579
|
*/
|
|
628
580
|
const accountCreateAnonymousSession = async ({ parseOutput = true, sdk = undefined}) => {
|
|
629
581
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
630
|
-
|
|
631
582
|
let apiPath = '/account/sessions/anonymous';
|
|
632
583
|
let payload = {};
|
|
633
584
|
|
|
634
|
-
|
|
635
585
|
let response = undefined;
|
|
636
|
-
|
|
586
|
+
|
|
637
587
|
response = await client.call('post', apiPath, {
|
|
638
588
|
'content-type': 'application/json',
|
|
639
589
|
}, payload);
|
|
640
590
|
|
|
641
|
-
|
|
642
591
|
if (parseOutput) {
|
|
643
592
|
parse(response)
|
|
644
593
|
success()
|
|
@@ -660,7 +609,6 @@ const accountCreateAnonymousSession = async ({ parseOutput = true, sdk = undefin
|
|
|
660
609
|
*/
|
|
661
610
|
const accountCreateEmailSession = async ({ email, password, parseOutput = true, sdk = undefined}) => {
|
|
662
611
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
663
|
-
|
|
664
612
|
let apiPath = '/account/sessions/email';
|
|
665
613
|
let payload = {};
|
|
666
614
|
if (typeof email !== 'undefined') {
|
|
@@ -670,14 +618,12 @@ const accountCreateEmailSession = async ({ email, password, parseOutput = true,
|
|
|
670
618
|
payload['password'] = password;
|
|
671
619
|
}
|
|
672
620
|
|
|
673
|
-
|
|
674
621
|
let response = undefined;
|
|
675
|
-
|
|
622
|
+
|
|
676
623
|
response = await client.call('post', apiPath, {
|
|
677
624
|
'content-type': 'application/json',
|
|
678
625
|
}, payload);
|
|
679
626
|
|
|
680
|
-
|
|
681
627
|
if (parseOutput) {
|
|
682
628
|
parse(response)
|
|
683
629
|
success()
|
|
@@ -700,7 +646,6 @@ const accountCreateEmailSession = async ({ email, password, parseOutput = true,
|
|
|
700
646
|
*/
|
|
701
647
|
const accountCreateMagicURLSession = async ({ userId, email, url, parseOutput = true, sdk = undefined}) => {
|
|
702
648
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
703
|
-
|
|
704
649
|
let apiPath = '/account/sessions/magic-url';
|
|
705
650
|
let payload = {};
|
|
706
651
|
if (typeof userId !== 'undefined') {
|
|
@@ -713,14 +658,12 @@ const accountCreateMagicURLSession = async ({ userId, email, url, parseOutput =
|
|
|
713
658
|
payload['url'] = url;
|
|
714
659
|
}
|
|
715
660
|
|
|
716
|
-
|
|
717
661
|
let response = undefined;
|
|
718
|
-
|
|
662
|
+
|
|
719
663
|
response = await client.call('post', apiPath, {
|
|
720
664
|
'content-type': 'application/json',
|
|
721
665
|
}, payload);
|
|
722
666
|
|
|
723
|
-
|
|
724
667
|
if (parseOutput) {
|
|
725
668
|
parse(response)
|
|
726
669
|
success()
|
|
@@ -742,7 +685,6 @@ const accountCreateMagicURLSession = async ({ userId, email, url, parseOutput =
|
|
|
742
685
|
*/
|
|
743
686
|
const accountUpdateMagicURLSession = async ({ userId, secret, parseOutput = true, sdk = undefined}) => {
|
|
744
687
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
745
|
-
|
|
746
688
|
let apiPath = '/account/sessions/magic-url';
|
|
747
689
|
let payload = {};
|
|
748
690
|
if (typeof userId !== 'undefined') {
|
|
@@ -752,14 +694,12 @@ const accountUpdateMagicURLSession = async ({ userId, secret, parseOutput = true
|
|
|
752
694
|
payload['secret'] = secret;
|
|
753
695
|
}
|
|
754
696
|
|
|
755
|
-
|
|
756
697
|
let response = undefined;
|
|
757
|
-
|
|
698
|
+
|
|
758
699
|
response = await client.call('put', apiPath, {
|
|
759
700
|
'content-type': 'application/json',
|
|
760
701
|
}, payload);
|
|
761
702
|
|
|
762
|
-
|
|
763
703
|
if (parseOutput) {
|
|
764
704
|
parse(response)
|
|
765
705
|
success()
|
|
@@ -783,7 +723,6 @@ const accountUpdateMagicURLSession = async ({ userId, secret, parseOutput = true
|
|
|
783
723
|
*/
|
|
784
724
|
const accountCreateOAuth2Session = async ({ provider, success, failure, scopes, parseOutput = true, sdk = undefined}) => {
|
|
785
725
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
786
|
-
|
|
787
726
|
let apiPath = '/account/sessions/oauth2/{provider}'.replace('{provider}', provider);
|
|
788
727
|
let payload = {};
|
|
789
728
|
if (typeof success !== 'undefined') {
|
|
@@ -796,14 +735,12 @@ const accountCreateOAuth2Session = async ({ provider, success, failure, scopes,
|
|
|
796
735
|
payload['scopes'] = scopes;
|
|
797
736
|
}
|
|
798
737
|
|
|
799
|
-
|
|
800
738
|
let response = undefined;
|
|
801
|
-
|
|
739
|
+
|
|
802
740
|
response = await client.call('get', apiPath, {
|
|
803
741
|
'content-type': 'application/json',
|
|
804
742
|
}, payload);
|
|
805
743
|
|
|
806
|
-
|
|
807
744
|
if (parseOutput) {
|
|
808
745
|
parse(response)
|
|
809
746
|
success()
|
|
@@ -825,7 +762,6 @@ const accountCreateOAuth2Session = async ({ provider, success, failure, scopes,
|
|
|
825
762
|
*/
|
|
826
763
|
const accountCreatePhoneSession = async ({ userId, phone, parseOutput = true, sdk = undefined}) => {
|
|
827
764
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
828
|
-
|
|
829
765
|
let apiPath = '/account/sessions/phone';
|
|
830
766
|
let payload = {};
|
|
831
767
|
if (typeof userId !== 'undefined') {
|
|
@@ -835,14 +771,12 @@ const accountCreatePhoneSession = async ({ userId, phone, parseOutput = true, sd
|
|
|
835
771
|
payload['phone'] = phone;
|
|
836
772
|
}
|
|
837
773
|
|
|
838
|
-
|
|
839
774
|
let response = undefined;
|
|
840
|
-
|
|
775
|
+
|
|
841
776
|
response = await client.call('post', apiPath, {
|
|
842
777
|
'content-type': 'application/json',
|
|
843
778
|
}, payload);
|
|
844
779
|
|
|
845
|
-
|
|
846
780
|
if (parseOutput) {
|
|
847
781
|
parse(response)
|
|
848
782
|
success()
|
|
@@ -864,7 +798,6 @@ const accountCreatePhoneSession = async ({ userId, phone, parseOutput = true, sd
|
|
|
864
798
|
*/
|
|
865
799
|
const accountUpdatePhoneSession = async ({ userId, secret, parseOutput = true, sdk = undefined}) => {
|
|
866
800
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
867
|
-
|
|
868
801
|
let apiPath = '/account/sessions/phone';
|
|
869
802
|
let payload = {};
|
|
870
803
|
if (typeof userId !== 'undefined') {
|
|
@@ -874,14 +807,12 @@ const accountUpdatePhoneSession = async ({ userId, secret, parseOutput = true, s
|
|
|
874
807
|
payload['secret'] = secret;
|
|
875
808
|
}
|
|
876
809
|
|
|
877
|
-
|
|
878
810
|
let response = undefined;
|
|
879
|
-
|
|
811
|
+
|
|
880
812
|
response = await client.call('put', apiPath, {
|
|
881
813
|
'content-type': 'application/json',
|
|
882
814
|
}, payload);
|
|
883
815
|
|
|
884
|
-
|
|
885
816
|
if (parseOutput) {
|
|
886
817
|
parse(response)
|
|
887
818
|
success()
|
|
@@ -902,18 +833,15 @@ const accountUpdatePhoneSession = async ({ userId, secret, parseOutput = true, s
|
|
|
902
833
|
*/
|
|
903
834
|
const accountGetSession = async ({ sessionId, parseOutput = true, sdk = undefined}) => {
|
|
904
835
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
905
|
-
|
|
906
836
|
let apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
|
|
907
837
|
let payload = {};
|
|
908
838
|
|
|
909
|
-
|
|
910
839
|
let response = undefined;
|
|
911
|
-
|
|
840
|
+
|
|
912
841
|
response = await client.call('get', apiPath, {
|
|
913
842
|
'content-type': 'application/json',
|
|
914
843
|
}, payload);
|
|
915
844
|
|
|
916
|
-
|
|
917
845
|
if (parseOutput) {
|
|
918
846
|
parse(response)
|
|
919
847
|
success()
|
|
@@ -934,18 +862,15 @@ const accountGetSession = async ({ sessionId, parseOutput = true, sdk = undefine
|
|
|
934
862
|
*/
|
|
935
863
|
const accountUpdateSession = async ({ sessionId, parseOutput = true, sdk = undefined}) => {
|
|
936
864
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
937
|
-
|
|
938
865
|
let apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
|
|
939
866
|
let payload = {};
|
|
940
867
|
|
|
941
|
-
|
|
942
868
|
let response = undefined;
|
|
943
|
-
|
|
869
|
+
|
|
944
870
|
response = await client.call('patch', apiPath, {
|
|
945
871
|
'content-type': 'application/json',
|
|
946
872
|
}, payload);
|
|
947
873
|
|
|
948
|
-
|
|
949
874
|
if (parseOutput) {
|
|
950
875
|
parse(response)
|
|
951
876
|
success()
|
|
@@ -966,18 +891,15 @@ const accountUpdateSession = async ({ sessionId, parseOutput = true, sdk = undef
|
|
|
966
891
|
*/
|
|
967
892
|
const accountDeleteSession = async ({ sessionId, parseOutput = true, sdk = undefined}) => {
|
|
968
893
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
969
|
-
|
|
970
894
|
let apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
|
|
971
895
|
let payload = {};
|
|
972
896
|
|
|
973
|
-
|
|
974
897
|
let response = undefined;
|
|
975
|
-
|
|
898
|
+
|
|
976
899
|
response = await client.call('delete', apiPath, {
|
|
977
900
|
'content-type': 'application/json',
|
|
978
901
|
}, payload);
|
|
979
902
|
|
|
980
|
-
|
|
981
903
|
if (parseOutput) {
|
|
982
904
|
parse(response)
|
|
983
905
|
success()
|
|
@@ -997,18 +919,15 @@ const accountDeleteSession = async ({ sessionId, parseOutput = true, sdk = undef
|
|
|
997
919
|
*/
|
|
998
920
|
const accountUpdateStatus = async ({ parseOutput = true, sdk = undefined}) => {
|
|
999
921
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1000
|
-
|
|
1001
922
|
let apiPath = '/account/status';
|
|
1002
923
|
let payload = {};
|
|
1003
924
|
|
|
1004
|
-
|
|
1005
925
|
let response = undefined;
|
|
1006
|
-
|
|
926
|
+
|
|
1007
927
|
response = await client.call('patch', apiPath, {
|
|
1008
928
|
'content-type': 'application/json',
|
|
1009
929
|
}, payload);
|
|
1010
930
|
|
|
1011
|
-
|
|
1012
931
|
if (parseOutput) {
|
|
1013
932
|
parse(response)
|
|
1014
933
|
success()
|
|
@@ -1029,21 +948,18 @@ const accountUpdateStatus = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
1029
948
|
*/
|
|
1030
949
|
const accountCreateVerification = async ({ url, parseOutput = true, sdk = undefined}) => {
|
|
1031
950
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1032
|
-
|
|
1033
951
|
let apiPath = '/account/verification';
|
|
1034
952
|
let payload = {};
|
|
1035
953
|
if (typeof url !== 'undefined') {
|
|
1036
954
|
payload['url'] = url;
|
|
1037
955
|
}
|
|
1038
956
|
|
|
1039
|
-
|
|
1040
957
|
let response = undefined;
|
|
1041
|
-
|
|
958
|
+
|
|
1042
959
|
response = await client.call('post', apiPath, {
|
|
1043
960
|
'content-type': 'application/json',
|
|
1044
961
|
}, payload);
|
|
1045
962
|
|
|
1046
|
-
|
|
1047
963
|
if (parseOutput) {
|
|
1048
964
|
parse(response)
|
|
1049
965
|
success()
|
|
@@ -1065,7 +981,6 @@ const accountCreateVerification = async ({ url, parseOutput = true, sdk = undefi
|
|
|
1065
981
|
*/
|
|
1066
982
|
const accountUpdateVerification = async ({ userId, secret, parseOutput = true, sdk = undefined}) => {
|
|
1067
983
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1068
|
-
|
|
1069
984
|
let apiPath = '/account/verification';
|
|
1070
985
|
let payload = {};
|
|
1071
986
|
if (typeof userId !== 'undefined') {
|
|
@@ -1075,14 +990,12 @@ const accountUpdateVerification = async ({ userId, secret, parseOutput = true, s
|
|
|
1075
990
|
payload['secret'] = secret;
|
|
1076
991
|
}
|
|
1077
992
|
|
|
1078
|
-
|
|
1079
993
|
let response = undefined;
|
|
1080
|
-
|
|
994
|
+
|
|
1081
995
|
response = await client.call('put', apiPath, {
|
|
1082
996
|
'content-type': 'application/json',
|
|
1083
997
|
}, payload);
|
|
1084
998
|
|
|
1085
|
-
|
|
1086
999
|
if (parseOutput) {
|
|
1087
1000
|
parse(response)
|
|
1088
1001
|
success()
|
|
@@ -1102,18 +1015,15 @@ const accountUpdateVerification = async ({ userId, secret, parseOutput = true, s
|
|
|
1102
1015
|
*/
|
|
1103
1016
|
const accountCreatePhoneVerification = async ({ parseOutput = true, sdk = undefined}) => {
|
|
1104
1017
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1105
|
-
|
|
1106
1018
|
let apiPath = '/account/verification/phone';
|
|
1107
1019
|
let payload = {};
|
|
1108
1020
|
|
|
1109
|
-
|
|
1110
1021
|
let response = undefined;
|
|
1111
|
-
|
|
1022
|
+
|
|
1112
1023
|
response = await client.call('post', apiPath, {
|
|
1113
1024
|
'content-type': 'application/json',
|
|
1114
1025
|
}, payload);
|
|
1115
1026
|
|
|
1116
|
-
|
|
1117
1027
|
if (parseOutput) {
|
|
1118
1028
|
parse(response)
|
|
1119
1029
|
success()
|
|
@@ -1135,7 +1045,6 @@ const accountCreatePhoneVerification = async ({ parseOutput = true, sdk = undefi
|
|
|
1135
1045
|
*/
|
|
1136
1046
|
const accountUpdatePhoneVerification = async ({ userId, secret, parseOutput = true, sdk = undefined}) => {
|
|
1137
1047
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
1138
|
-
|
|
1139
1048
|
let apiPath = '/account/verification/phone';
|
|
1140
1049
|
let payload = {};
|
|
1141
1050
|
if (typeof userId !== 'undefined') {
|
|
@@ -1145,14 +1054,12 @@ const accountUpdatePhoneVerification = async ({ userId, secret, parseOutput = tr
|
|
|
1145
1054
|
payload['secret'] = secret;
|
|
1146
1055
|
}
|
|
1147
1056
|
|
|
1148
|
-
|
|
1149
1057
|
let response = undefined;
|
|
1150
|
-
|
|
1058
|
+
|
|
1151
1059
|
response = await client.call('put', apiPath, {
|
|
1152
1060
|
'content-type': 'application/json',
|
|
1153
1061
|
}, payload);
|
|
1154
1062
|
|
|
1155
|
-
|
|
1156
1063
|
if (parseOutput) {
|
|
1157
1064
|
parse(response)
|
|
1158
1065
|
success()
|
|
@@ -1161,7 +1068,6 @@ const accountUpdatePhoneVerification = async ({ userId, secret, parseOutput = tr
|
|
|
1161
1068
|
return response;
|
|
1162
1069
|
}
|
|
1163
1070
|
|
|
1164
|
-
|
|
1165
1071
|
account
|
|
1166
1072
|
.command(`get`)
|
|
1167
1073
|
.description(`Get the currently logged in user.`)
|
|
@@ -1361,38 +1267,37 @@ account
|
|
|
1361
1267
|
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
1362
1268
|
.action(actionRunner(accountUpdatePhoneVerification))
|
|
1363
1269
|
|
|
1364
|
-
|
|
1365
1270
|
module.exports = {
|
|
1366
1271
|
account,
|
|
1367
|
-
accountGet,
|
|
1368
|
-
accountCreate,
|
|
1369
|
-
accountUpdateEmail,
|
|
1370
|
-
accountListIdentities,
|
|
1371
|
-
accountDeleteIdentity,
|
|
1372
|
-
accountCreateJWT,
|
|
1373
|
-
accountListLogs,
|
|
1374
|
-
accountUpdateName,
|
|
1375
|
-
accountUpdatePassword,
|
|
1376
|
-
accountUpdatePhone,
|
|
1377
|
-
accountGetPrefs,
|
|
1378
|
-
accountUpdatePrefs,
|
|
1379
|
-
accountCreateRecovery,
|
|
1380
|
-
accountUpdateRecovery,
|
|
1381
|
-
accountListSessions,
|
|
1382
|
-
accountDeleteSessions,
|
|
1383
|
-
accountCreateAnonymousSession,
|
|
1384
|
-
accountCreateEmailSession,
|
|
1385
|
-
accountCreateMagicURLSession,
|
|
1386
|
-
accountUpdateMagicURLSession,
|
|
1387
|
-
accountCreateOAuth2Session,
|
|
1388
|
-
accountCreatePhoneSession,
|
|
1389
|
-
accountUpdatePhoneSession,
|
|
1390
|
-
accountGetSession,
|
|
1391
|
-
accountUpdateSession,
|
|
1392
|
-
accountDeleteSession,
|
|
1393
|
-
accountUpdateStatus,
|
|
1394
|
-
accountCreateVerification,
|
|
1395
|
-
accountUpdateVerification,
|
|
1396
|
-
accountCreatePhoneVerification,
|
|
1397
|
-
accountUpdatePhoneVerification
|
|
1272
|
+
accountGet,
|
|
1273
|
+
accountCreate,
|
|
1274
|
+
accountUpdateEmail,
|
|
1275
|
+
accountListIdentities,
|
|
1276
|
+
accountDeleteIdentity,
|
|
1277
|
+
accountCreateJWT,
|
|
1278
|
+
accountListLogs,
|
|
1279
|
+
accountUpdateName,
|
|
1280
|
+
accountUpdatePassword,
|
|
1281
|
+
accountUpdatePhone,
|
|
1282
|
+
accountGetPrefs,
|
|
1283
|
+
accountUpdatePrefs,
|
|
1284
|
+
accountCreateRecovery,
|
|
1285
|
+
accountUpdateRecovery,
|
|
1286
|
+
accountListSessions,
|
|
1287
|
+
accountDeleteSessions,
|
|
1288
|
+
accountCreateAnonymousSession,
|
|
1289
|
+
accountCreateEmailSession,
|
|
1290
|
+
accountCreateMagicURLSession,
|
|
1291
|
+
accountUpdateMagicURLSession,
|
|
1292
|
+
accountCreateOAuth2Session,
|
|
1293
|
+
accountCreatePhoneSession,
|
|
1294
|
+
accountUpdatePhoneSession,
|
|
1295
|
+
accountGetSession,
|
|
1296
|
+
accountUpdateSession,
|
|
1297
|
+
accountDeleteSession,
|
|
1298
|
+
accountUpdateStatus,
|
|
1299
|
+
accountCreateVerification,
|
|
1300
|
+
accountUpdateVerification,
|
|
1301
|
+
accountCreatePhoneVerification,
|
|
1302
|
+
accountUpdatePhoneVerification
|
|
1398
1303
|
};
|