appwrite-cli 2.0.2 → 3.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/README.md +11 -6
- package/docs/examples/account/delete-identity.md +2 -0
- package/docs/examples/account/list-identities.md +2 -0
- package/docs/examples/assistant/chat.md +2 -0
- package/docs/examples/databases/create-collection.md +1 -0
- package/docs/examples/databases/create-string-attribute.md +1 -0
- package/docs/examples/databases/create.md +2 -1
- package/docs/examples/databases/list-attributes.md +2 -1
- package/docs/examples/databases/list-indexes.md +2 -1
- package/docs/examples/databases/update.md +2 -1
- package/docs/examples/functions/create-deployment.md +3 -2
- package/docs/examples/functions/create-execution.md +3 -0
- package/docs/examples/functions/create.md +12 -0
- package/docs/examples/functions/download-deployment.md +3 -0
- package/docs/examples/functions/update.md +9 -0
- package/docs/examples/health/get-pub-sub.md +1 -0
- package/docs/examples/health/get-queue.md +1 -0
- package/docs/examples/locale/list-codes.md +1 -0
- package/docs/examples/migrations/create-appwrite-migration.md +5 -0
- package/docs/examples/migrations/create-firebase-migration.md +3 -0
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +3 -0
- package/docs/examples/migrations/create-n-host-migration.md +9 -0
- package/docs/examples/migrations/create-supabase-migration.md +8 -0
- package/docs/examples/migrations/delete-firebase-auth.md +1 -0
- package/docs/examples/migrations/delete.md +2 -0
- package/docs/examples/migrations/get-appwrite-report.md +5 -0
- package/docs/examples/migrations/get-firebase-report-o-auth.md +3 -0
- package/docs/examples/migrations/get-firebase-report.md +3 -0
- package/docs/examples/migrations/get-n-host-report.md +9 -0
- package/docs/examples/migrations/get-supabase-report.md +8 -0
- package/docs/examples/migrations/get.md +2 -0
- package/docs/examples/migrations/list-firebase-projects.md +1 -0
- package/docs/examples/migrations/list.md +3 -0
- package/docs/examples/migrations/retry.md +2 -0
- package/docs/examples/project/create-variable.md +3 -0
- package/docs/examples/project/delete-variable.md +2 -0
- package/docs/examples/project/get-usage.md +2 -0
- package/docs/examples/project/get-variable.md +2 -0
- package/docs/examples/project/list-variables.md +1 -0
- package/docs/examples/project/update-variable.md +4 -0
- package/docs/examples/projects/create.md +1 -1
- package/docs/examples/projects/delete-email-template.md +4 -0
- package/docs/examples/projects/delete-sms-template.md +4 -0
- package/docs/examples/projects/delete.md +1 -2
- package/docs/examples/projects/get-email-template.md +4 -0
- package/docs/examples/projects/get-sms-template.md +4 -0
- package/docs/examples/projects/update-email-template.md +9 -0
- package/docs/examples/projects/update-personal-data-check.md +3 -0
- package/docs/examples/projects/update-service-status-all.md +3 -0
- package/docs/examples/projects/update-sms-template.md +5 -0
- package/docs/examples/projects/update-smtp-configuration.md +11 -0
- package/docs/examples/projects/update-team.md +3 -0
- package/docs/examples/proxy/create-rule.md +4 -0
- package/docs/examples/proxy/delete-rule.md +2 -0
- package/docs/examples/proxy/get-rule.md +2 -0
- package/docs/examples/proxy/list-rules.md +3 -0
- package/docs/examples/proxy/update-rule-verification.md +2 -0
- package/docs/examples/storage/update-file.md +1 -0
- package/docs/examples/teams/{update-membership-roles.md → update-membership.md} +1 -1
- package/docs/examples/users/delete-identity.md +2 -0
- package/docs/examples/users/list-identities.md +3 -0
- package/docs/examples/users/update-labels.md +3 -0
- package/docs/examples/vcs/create-repository-detection.md +4 -0
- package/docs/examples/vcs/create-repository.md +4 -0
- package/docs/examples/vcs/delete-installation.md +2 -0
- package/docs/examples/vcs/get-installation.md +2 -0
- package/docs/examples/vcs/get-repository.md +3 -0
- package/docs/examples/vcs/list-installations.md +3 -0
- package/docs/examples/vcs/list-repositories.md +3 -0
- package/docs/examples/vcs/list-repository-branches.md +3 -0
- package/docs/examples/vcs/update-external-deployments.md +4 -0
- package/index.js +10 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +3 -3
- package/lib/commands/account.js +122 -67
- package/lib/commands/assistant.js +53 -0
- package/lib/commands/avatars.js +21 -21
- package/lib/commands/console.js +2 -2
- package/lib/commands/databases.js +146 -104
- package/lib/commands/functions.js +277 -70
- package/lib/commands/generic.js +1 -0
- package/lib/commands/graphql.js +4 -4
- package/lib/commands/health.js +68 -22
- package/lib/commands/locale.js +37 -14
- package/lib/commands/migrations.js +708 -0
- package/lib/commands/project.js +204 -0
- package/lib/commands/projects.js +459 -196
- package/lib/commands/proxy.js +177 -0
- package/lib/commands/storage.js +47 -40
- package/lib/commands/teams.js +33 -33
- package/lib/commands/users.js +147 -52
- package/lib/commands/vcs.js +305 -0
- package/lib/config.js +1 -2
- package/lib/parser.js +2 -2
- package/package.json +1 -1
- package/scoop/appwrite.json +30 -0
- package/docs/examples/projects/create-domain.md +0 -3
- package/docs/examples/projects/delete-domain.md +0 -3
- package/docs/examples/projects/get-domain.md +0 -3
- package/docs/examples/projects/list-domains.md +0 -2
- package/docs/examples/projects/update-domain-verification.md +0 -3
package/lib/commands/users.js
CHANGED
|
@@ -19,7 +19,7 @@ const usersList = async ({ queries, search, parseOutput = true, sdk = undefined}
|
|
|
19
19
|
/* @param {string} search */
|
|
20
20
|
|
|
21
21
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
22
|
-
let
|
|
22
|
+
let apiPath = '/users';
|
|
23
23
|
let payload = {};
|
|
24
24
|
|
|
25
25
|
/** Query Params */
|
|
@@ -30,7 +30,7 @@ const usersList = async ({ queries, search, parseOutput = true, sdk = undefined}
|
|
|
30
30
|
payload['search'] = search;
|
|
31
31
|
}
|
|
32
32
|
let response = undefined;
|
|
33
|
-
response = await client.call('get',
|
|
33
|
+
response = await client.call('get', apiPath, {
|
|
34
34
|
'content-type': 'application/json',
|
|
35
35
|
}, payload);
|
|
36
36
|
|
|
@@ -49,7 +49,7 @@ const usersCreate = async ({ userId, email, phone, password, name, parseOutput =
|
|
|
49
49
|
/* @param {string} name */
|
|
50
50
|
|
|
51
51
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
52
|
-
let
|
|
52
|
+
let apiPath = '/users';
|
|
53
53
|
let payload = {};
|
|
54
54
|
|
|
55
55
|
/** Body Params */
|
|
@@ -79,7 +79,7 @@ const usersCreate = async ({ userId, email, phone, password, name, parseOutput =
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
let response = undefined;
|
|
82
|
-
response = await client.call('post',
|
|
82
|
+
response = await client.call('post', apiPath, {
|
|
83
83
|
'content-type': 'application/json',
|
|
84
84
|
}, payload);
|
|
85
85
|
|
|
@@ -97,7 +97,7 @@ const usersCreateArgon2User = async ({ userId, email, password, name, parseOutpu
|
|
|
97
97
|
/* @param {string} name */
|
|
98
98
|
|
|
99
99
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
100
|
-
let
|
|
100
|
+
let apiPath = '/users/argon2';
|
|
101
101
|
let payload = {};
|
|
102
102
|
|
|
103
103
|
/** Body Params */
|
|
@@ -122,7 +122,7 @@ const usersCreateArgon2User = async ({ userId, email, password, name, parseOutpu
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
let response = undefined;
|
|
125
|
-
response = await client.call('post',
|
|
125
|
+
response = await client.call('post', apiPath, {
|
|
126
126
|
'content-type': 'application/json',
|
|
127
127
|
}, payload);
|
|
128
128
|
|
|
@@ -140,7 +140,7 @@ const usersCreateBcryptUser = async ({ userId, email, password, name, parseOutpu
|
|
|
140
140
|
/* @param {string} name */
|
|
141
141
|
|
|
142
142
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
143
|
-
let
|
|
143
|
+
let apiPath = '/users/bcrypt';
|
|
144
144
|
let payload = {};
|
|
145
145
|
|
|
146
146
|
/** Body Params */
|
|
@@ -165,7 +165,52 @@ const usersCreateBcryptUser = async ({ userId, email, password, name, parseOutpu
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
let response = undefined;
|
|
168
|
-
response = await client.call('post',
|
|
168
|
+
response = await client.call('post', apiPath, {
|
|
169
|
+
'content-type': 'application/json',
|
|
170
|
+
}, payload);
|
|
171
|
+
|
|
172
|
+
if (parseOutput) {
|
|
173
|
+
parse(response)
|
|
174
|
+
success()
|
|
175
|
+
}
|
|
176
|
+
return response;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const usersListIdentities = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
|
|
180
|
+
/* @param {string} queries */
|
|
181
|
+
/* @param {string} search */
|
|
182
|
+
|
|
183
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
184
|
+
let apiPath = '/users/identities';
|
|
185
|
+
let payload = {};
|
|
186
|
+
|
|
187
|
+
/** Query Params */
|
|
188
|
+
if (typeof queries !== 'undefined') {
|
|
189
|
+
payload['queries'] = queries;
|
|
190
|
+
}
|
|
191
|
+
if (typeof search !== 'undefined') {
|
|
192
|
+
payload['search'] = search;
|
|
193
|
+
}
|
|
194
|
+
let response = undefined;
|
|
195
|
+
response = await client.call('get', apiPath, {
|
|
196
|
+
'content-type': 'application/json',
|
|
197
|
+
}, payload);
|
|
198
|
+
|
|
199
|
+
if (parseOutput) {
|
|
200
|
+
parse(response)
|
|
201
|
+
success()
|
|
202
|
+
}
|
|
203
|
+
return response;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const usersDeleteIdentity = async ({ identityId, parseOutput = true, sdk = undefined}) => {
|
|
207
|
+
/* @param {string} identityId */
|
|
208
|
+
|
|
209
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
210
|
+
let apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId);
|
|
211
|
+
let payload = {};
|
|
212
|
+
let response = undefined;
|
|
213
|
+
response = await client.call('delete', apiPath, {
|
|
169
214
|
'content-type': 'application/json',
|
|
170
215
|
}, payload);
|
|
171
216
|
|
|
@@ -183,7 +228,7 @@ const usersCreateMD5User = async ({ userId, email, password, name, parseOutput =
|
|
|
183
228
|
/* @param {string} name */
|
|
184
229
|
|
|
185
230
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
186
|
-
let
|
|
231
|
+
let apiPath = '/users/md5';
|
|
187
232
|
let payload = {};
|
|
188
233
|
|
|
189
234
|
/** Body Params */
|
|
@@ -208,7 +253,7 @@ const usersCreateMD5User = async ({ userId, email, password, name, parseOutput =
|
|
|
208
253
|
}
|
|
209
254
|
|
|
210
255
|
let response = undefined;
|
|
211
|
-
response = await client.call('post',
|
|
256
|
+
response = await client.call('post', apiPath, {
|
|
212
257
|
'content-type': 'application/json',
|
|
213
258
|
}, payload);
|
|
214
259
|
|
|
@@ -226,7 +271,7 @@ const usersCreatePHPassUser = async ({ userId, email, password, name, parseOutpu
|
|
|
226
271
|
/* @param {string} name */
|
|
227
272
|
|
|
228
273
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
229
|
-
let
|
|
274
|
+
let apiPath = '/users/phpass';
|
|
230
275
|
let payload = {};
|
|
231
276
|
|
|
232
277
|
/** Body Params */
|
|
@@ -251,7 +296,7 @@ const usersCreatePHPassUser = async ({ userId, email, password, name, parseOutpu
|
|
|
251
296
|
}
|
|
252
297
|
|
|
253
298
|
let response = undefined;
|
|
254
|
-
response = await client.call('post',
|
|
299
|
+
response = await client.call('post', apiPath, {
|
|
255
300
|
'content-type': 'application/json',
|
|
256
301
|
}, payload);
|
|
257
302
|
|
|
@@ -274,7 +319,7 @@ const usersCreateScryptUser = async ({ userId, email, password, passwordSalt, pa
|
|
|
274
319
|
/* @param {string} name */
|
|
275
320
|
|
|
276
321
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
277
|
-
let
|
|
322
|
+
let apiPath = '/users/scrypt';
|
|
278
323
|
let payload = {};
|
|
279
324
|
|
|
280
325
|
/** Body Params */
|
|
@@ -324,7 +369,7 @@ const usersCreateScryptUser = async ({ userId, email, password, passwordSalt, pa
|
|
|
324
369
|
}
|
|
325
370
|
|
|
326
371
|
let response = undefined;
|
|
327
|
-
response = await client.call('post',
|
|
372
|
+
response = await client.call('post', apiPath, {
|
|
328
373
|
'content-type': 'application/json',
|
|
329
374
|
}, payload);
|
|
330
375
|
|
|
@@ -345,7 +390,7 @@ const usersCreateScryptModifiedUser = async ({ userId, email, password, password
|
|
|
345
390
|
/* @param {string} name */
|
|
346
391
|
|
|
347
392
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
348
|
-
let
|
|
393
|
+
let apiPath = '/users/scrypt-modified';
|
|
349
394
|
let payload = {};
|
|
350
395
|
|
|
351
396
|
/** Body Params */
|
|
@@ -385,7 +430,7 @@ const usersCreateScryptModifiedUser = async ({ userId, email, password, password
|
|
|
385
430
|
}
|
|
386
431
|
|
|
387
432
|
let response = undefined;
|
|
388
|
-
response = await client.call('post',
|
|
433
|
+
response = await client.call('post', apiPath, {
|
|
389
434
|
'content-type': 'application/json',
|
|
390
435
|
}, payload);
|
|
391
436
|
|
|
@@ -404,7 +449,7 @@ const usersCreateSHAUser = async ({ userId, email, password, passwordVersion, na
|
|
|
404
449
|
/* @param {string} name */
|
|
405
450
|
|
|
406
451
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
407
|
-
let
|
|
452
|
+
let apiPath = '/users/sha';
|
|
408
453
|
let payload = {};
|
|
409
454
|
|
|
410
455
|
/** Body Params */
|
|
@@ -434,7 +479,7 @@ const usersCreateSHAUser = async ({ userId, email, password, passwordVersion, na
|
|
|
434
479
|
}
|
|
435
480
|
|
|
436
481
|
let response = undefined;
|
|
437
|
-
response = await client.call('post',
|
|
482
|
+
response = await client.call('post', apiPath, {
|
|
438
483
|
'content-type': 'application/json',
|
|
439
484
|
}, payload);
|
|
440
485
|
|
|
@@ -450,7 +495,7 @@ const usersGetUsage = async ({ range, provider, parseOutput = true, sdk = undefi
|
|
|
450
495
|
/* @param {string} provider */
|
|
451
496
|
|
|
452
497
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
453
|
-
let
|
|
498
|
+
let apiPath = '/users/usage';
|
|
454
499
|
let payload = {};
|
|
455
500
|
|
|
456
501
|
/** Query Params */
|
|
@@ -461,7 +506,7 @@ const usersGetUsage = async ({ range, provider, parseOutput = true, sdk = undefi
|
|
|
461
506
|
payload['provider'] = provider;
|
|
462
507
|
}
|
|
463
508
|
let response = undefined;
|
|
464
|
-
response = await client.call('get',
|
|
509
|
+
response = await client.call('get', apiPath, {
|
|
465
510
|
'content-type': 'application/json',
|
|
466
511
|
}, payload);
|
|
467
512
|
|
|
@@ -476,10 +521,10 @@ const usersGet = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
|
476
521
|
/* @param {string} userId */
|
|
477
522
|
|
|
478
523
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
479
|
-
let
|
|
524
|
+
let apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
480
525
|
let payload = {};
|
|
481
526
|
let response = undefined;
|
|
482
|
-
response = await client.call('get',
|
|
527
|
+
response = await client.call('get', apiPath, {
|
|
483
528
|
'content-type': 'application/json',
|
|
484
529
|
}, payload);
|
|
485
530
|
|
|
@@ -494,10 +539,10 @@ const usersDelete = async ({ userId, parseOutput = true, sdk = undefined}) => {
|
|
|
494
539
|
/* @param {string} userId */
|
|
495
540
|
|
|
496
541
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
497
|
-
let
|
|
542
|
+
let apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
498
543
|
let payload = {};
|
|
499
544
|
let response = undefined;
|
|
500
|
-
response = await client.call('delete',
|
|
545
|
+
response = await client.call('delete', apiPath, {
|
|
501
546
|
'content-type': 'application/json',
|
|
502
547
|
}, payload);
|
|
503
548
|
|
|
@@ -513,7 +558,7 @@ const usersUpdateEmail = async ({ userId, email, parseOutput = true, sdk = undef
|
|
|
513
558
|
/* @param {string} email */
|
|
514
559
|
|
|
515
560
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
516
|
-
let
|
|
561
|
+
let apiPath = '/users/{userId}/email'.replace('{userId}', userId);
|
|
517
562
|
let payload = {};
|
|
518
563
|
|
|
519
564
|
/** Body Params */
|
|
@@ -523,7 +568,34 @@ const usersUpdateEmail = async ({ userId, email, parseOutput = true, sdk = undef
|
|
|
523
568
|
}
|
|
524
569
|
|
|
525
570
|
let response = undefined;
|
|
526
|
-
response = await client.call('patch',
|
|
571
|
+
response = await client.call('patch', apiPath, {
|
|
572
|
+
'content-type': 'application/json',
|
|
573
|
+
}, payload);
|
|
574
|
+
|
|
575
|
+
if (parseOutput) {
|
|
576
|
+
parse(response)
|
|
577
|
+
success()
|
|
578
|
+
}
|
|
579
|
+
return response;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
const usersUpdateLabels = async ({ userId, labels, parseOutput = true, sdk = undefined}) => {
|
|
583
|
+
/* @param {string} userId */
|
|
584
|
+
/* @param {string[]} labels */
|
|
585
|
+
|
|
586
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
587
|
+
let apiPath = '/users/{userId}/labels'.replace('{userId}', userId);
|
|
588
|
+
let payload = {};
|
|
589
|
+
|
|
590
|
+
/** Body Params */
|
|
591
|
+
labels = labels === true ? [] : labels;
|
|
592
|
+
|
|
593
|
+
if (typeof labels !== 'undefined') {
|
|
594
|
+
payload['labels'] = labels;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
let response = undefined;
|
|
598
|
+
response = await client.call('put', apiPath, {
|
|
527
599
|
'content-type': 'application/json',
|
|
528
600
|
}, payload);
|
|
529
601
|
|
|
@@ -539,7 +611,7 @@ const usersListLogs = async ({ userId, queries, parseOutput = true, sdk = undefi
|
|
|
539
611
|
/* @param {string[]} queries */
|
|
540
612
|
|
|
541
613
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
542
|
-
let
|
|
614
|
+
let apiPath = '/users/{userId}/logs'.replace('{userId}', userId);
|
|
543
615
|
let payload = {};
|
|
544
616
|
|
|
545
617
|
/** Query Params */
|
|
@@ -547,7 +619,7 @@ const usersListLogs = async ({ userId, queries, parseOutput = true, sdk = undefi
|
|
|
547
619
|
payload['queries'] = queries;
|
|
548
620
|
}
|
|
549
621
|
let response = undefined;
|
|
550
|
-
response = await client.call('get',
|
|
622
|
+
response = await client.call('get', apiPath, {
|
|
551
623
|
'content-type': 'application/json',
|
|
552
624
|
}, payload);
|
|
553
625
|
|
|
@@ -562,10 +634,10 @@ const usersListMemberships = async ({ userId, parseOutput = true, sdk = undefine
|
|
|
562
634
|
/* @param {string} userId */
|
|
563
635
|
|
|
564
636
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
565
|
-
let
|
|
637
|
+
let apiPath = '/users/{userId}/memberships'.replace('{userId}', userId);
|
|
566
638
|
let payload = {};
|
|
567
639
|
let response = undefined;
|
|
568
|
-
response = await client.call('get',
|
|
640
|
+
response = await client.call('get', apiPath, {
|
|
569
641
|
'content-type': 'application/json',
|
|
570
642
|
}, payload);
|
|
571
643
|
|
|
@@ -581,7 +653,7 @@ const usersUpdateName = async ({ userId, name, parseOutput = true, sdk = undefin
|
|
|
581
653
|
/* @param {string} name */
|
|
582
654
|
|
|
583
655
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
584
|
-
let
|
|
656
|
+
let apiPath = '/users/{userId}/name'.replace('{userId}', userId);
|
|
585
657
|
let payload = {};
|
|
586
658
|
|
|
587
659
|
/** Body Params */
|
|
@@ -591,7 +663,7 @@ const usersUpdateName = async ({ userId, name, parseOutput = true, sdk = undefin
|
|
|
591
663
|
}
|
|
592
664
|
|
|
593
665
|
let response = undefined;
|
|
594
|
-
response = await client.call('patch',
|
|
666
|
+
response = await client.call('patch', apiPath, {
|
|
595
667
|
'content-type': 'application/json',
|
|
596
668
|
}, payload);
|
|
597
669
|
|
|
@@ -607,7 +679,7 @@ const usersUpdatePassword = async ({ userId, password, parseOutput = true, sdk =
|
|
|
607
679
|
/* @param {string} password */
|
|
608
680
|
|
|
609
681
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
610
|
-
let
|
|
682
|
+
let apiPath = '/users/{userId}/password'.replace('{userId}', userId);
|
|
611
683
|
let payload = {};
|
|
612
684
|
|
|
613
685
|
/** Body Params */
|
|
@@ -617,7 +689,7 @@ const usersUpdatePassword = async ({ userId, password, parseOutput = true, sdk =
|
|
|
617
689
|
}
|
|
618
690
|
|
|
619
691
|
let response = undefined;
|
|
620
|
-
response = await client.call('patch',
|
|
692
|
+
response = await client.call('patch', apiPath, {
|
|
621
693
|
'content-type': 'application/json',
|
|
622
694
|
}, payload);
|
|
623
695
|
|
|
@@ -633,7 +705,7 @@ const usersUpdatePhone = async ({ userId, number, parseOutput = true, sdk = unde
|
|
|
633
705
|
/* @param {string} number */
|
|
634
706
|
|
|
635
707
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
636
|
-
let
|
|
708
|
+
let apiPath = '/users/{userId}/phone'.replace('{userId}', userId);
|
|
637
709
|
let payload = {};
|
|
638
710
|
|
|
639
711
|
/** Body Params */
|
|
@@ -643,7 +715,7 @@ const usersUpdatePhone = async ({ userId, number, parseOutput = true, sdk = unde
|
|
|
643
715
|
}
|
|
644
716
|
|
|
645
717
|
let response = undefined;
|
|
646
|
-
response = await client.call('patch',
|
|
718
|
+
response = await client.call('patch', apiPath, {
|
|
647
719
|
'content-type': 'application/json',
|
|
648
720
|
}, payload);
|
|
649
721
|
|
|
@@ -658,10 +730,10 @@ const usersGetPrefs = async ({ userId, parseOutput = true, sdk = undefined}) =>
|
|
|
658
730
|
/* @param {string} userId */
|
|
659
731
|
|
|
660
732
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
661
|
-
let
|
|
733
|
+
let apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
662
734
|
let payload = {};
|
|
663
735
|
let response = undefined;
|
|
664
|
-
response = await client.call('get',
|
|
736
|
+
response = await client.call('get', apiPath, {
|
|
665
737
|
'content-type': 'application/json',
|
|
666
738
|
}, payload);
|
|
667
739
|
|
|
@@ -677,7 +749,7 @@ const usersUpdatePrefs = async ({ userId, prefs, parseOutput = true, sdk = undef
|
|
|
677
749
|
/* @param {object} prefs */
|
|
678
750
|
|
|
679
751
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
680
|
-
let
|
|
752
|
+
let apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
681
753
|
let payload = {};
|
|
682
754
|
|
|
683
755
|
/** Body Params */
|
|
@@ -686,7 +758,7 @@ const usersUpdatePrefs = async ({ userId, prefs, parseOutput = true, sdk = undef
|
|
|
686
758
|
}
|
|
687
759
|
|
|
688
760
|
let response = undefined;
|
|
689
|
-
response = await client.call('patch',
|
|
761
|
+
response = await client.call('patch', apiPath, {
|
|
690
762
|
'content-type': 'application/json',
|
|
691
763
|
}, payload);
|
|
692
764
|
|
|
@@ -701,10 +773,10 @@ const usersListSessions = async ({ userId, parseOutput = true, sdk = undefined})
|
|
|
701
773
|
/* @param {string} userId */
|
|
702
774
|
|
|
703
775
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
704
|
-
let
|
|
776
|
+
let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
705
777
|
let payload = {};
|
|
706
778
|
let response = undefined;
|
|
707
|
-
response = await client.call('get',
|
|
779
|
+
response = await client.call('get', apiPath, {
|
|
708
780
|
'content-type': 'application/json',
|
|
709
781
|
}, payload);
|
|
710
782
|
|
|
@@ -719,10 +791,10 @@ const usersDeleteSessions = async ({ userId, parseOutput = true, sdk = undefined
|
|
|
719
791
|
/* @param {string} userId */
|
|
720
792
|
|
|
721
793
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
722
|
-
let
|
|
794
|
+
let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
723
795
|
let payload = {};
|
|
724
796
|
let response = undefined;
|
|
725
|
-
response = await client.call('delete',
|
|
797
|
+
response = await client.call('delete', apiPath, {
|
|
726
798
|
'content-type': 'application/json',
|
|
727
799
|
}, payload);
|
|
728
800
|
|
|
@@ -738,10 +810,10 @@ const usersDeleteSession = async ({ userId, sessionId, parseOutput = true, sdk =
|
|
|
738
810
|
/* @param {string} sessionId */
|
|
739
811
|
|
|
740
812
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
741
|
-
let
|
|
813
|
+
let apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);
|
|
742
814
|
let payload = {};
|
|
743
815
|
let response = undefined;
|
|
744
|
-
response = await client.call('delete',
|
|
816
|
+
response = await client.call('delete', apiPath, {
|
|
745
817
|
'content-type': 'application/json',
|
|
746
818
|
}, payload);
|
|
747
819
|
|
|
@@ -757,7 +829,7 @@ const usersUpdateStatus = async ({ userId, status, parseOutput = true, sdk = und
|
|
|
757
829
|
/* @param {boolean} status */
|
|
758
830
|
|
|
759
831
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
760
|
-
let
|
|
832
|
+
let apiPath = '/users/{userId}/status'.replace('{userId}', userId);
|
|
761
833
|
let payload = {};
|
|
762
834
|
|
|
763
835
|
/** Body Params */
|
|
@@ -767,7 +839,7 @@ const usersUpdateStatus = async ({ userId, status, parseOutput = true, sdk = und
|
|
|
767
839
|
}
|
|
768
840
|
|
|
769
841
|
let response = undefined;
|
|
770
|
-
response = await client.call('patch',
|
|
842
|
+
response = await client.call('patch', apiPath, {
|
|
771
843
|
'content-type': 'application/json',
|
|
772
844
|
}, payload);
|
|
773
845
|
|
|
@@ -783,7 +855,7 @@ const usersUpdateEmailVerification = async ({ userId, emailVerification, parseOu
|
|
|
783
855
|
/* @param {boolean} emailVerification */
|
|
784
856
|
|
|
785
857
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
786
|
-
let
|
|
858
|
+
let apiPath = '/users/{userId}/verification'.replace('{userId}', userId);
|
|
787
859
|
let payload = {};
|
|
788
860
|
|
|
789
861
|
/** Body Params */
|
|
@@ -793,7 +865,7 @@ const usersUpdateEmailVerification = async ({ userId, emailVerification, parseOu
|
|
|
793
865
|
}
|
|
794
866
|
|
|
795
867
|
let response = undefined;
|
|
796
|
-
response = await client.call('patch',
|
|
868
|
+
response = await client.call('patch', apiPath, {
|
|
797
869
|
'content-type': 'application/json',
|
|
798
870
|
}, payload);
|
|
799
871
|
|
|
@@ -809,7 +881,7 @@ const usersUpdatePhoneVerification = async ({ userId, phoneVerification, parseOu
|
|
|
809
881
|
/* @param {boolean} phoneVerification */
|
|
810
882
|
|
|
811
883
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
812
|
-
let
|
|
884
|
+
let apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId);
|
|
813
885
|
let payload = {};
|
|
814
886
|
|
|
815
887
|
/** Body Params */
|
|
@@ -819,7 +891,7 @@ const usersUpdatePhoneVerification = async ({ userId, phoneVerification, parseOu
|
|
|
819
891
|
}
|
|
820
892
|
|
|
821
893
|
let response = undefined;
|
|
822
|
-
response = await client.call('patch',
|
|
894
|
+
response = await client.call('patch', apiPath, {
|
|
823
895
|
'content-type': 'application/json',
|
|
824
896
|
}, payload);
|
|
825
897
|
|
|
@@ -866,6 +938,19 @@ users
|
|
|
866
938
|
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
867
939
|
.action(actionRunner(usersCreateBcryptUser))
|
|
868
940
|
|
|
941
|
+
users
|
|
942
|
+
.command(`listIdentities`)
|
|
943
|
+
.description(`Get identities for all users.`)
|
|
944
|
+
.option(`--queries <queries>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry`)
|
|
945
|
+
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
946
|
+
.action(actionRunner(usersListIdentities))
|
|
947
|
+
|
|
948
|
+
users
|
|
949
|
+
.command(`deleteIdentity`)
|
|
950
|
+
.description(`Delete an identity by its unique ID.`)
|
|
951
|
+
.requiredOption(`--identityId <identityId>`, `Identity ID.`)
|
|
952
|
+
.action(actionRunner(usersDeleteIdentity))
|
|
953
|
+
|
|
869
954
|
users
|
|
870
955
|
.command(`createMD5User`)
|
|
871
956
|
.description(`Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](/docs/server/users#usersCreate) endpoint to create users with a plain text password.`)
|
|
@@ -946,6 +1031,13 @@ users
|
|
|
946
1031
|
.requiredOption(`--email <email>`, `User email.`)
|
|
947
1032
|
.action(actionRunner(usersUpdateEmail))
|
|
948
1033
|
|
|
1034
|
+
users
|
|
1035
|
+
.command(`updateLabels`)
|
|
1036
|
+
.description(`Update the user labels by its unique ID. Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](/docs/permissions) for more info.`)
|
|
1037
|
+
.requiredOption(`--userId <userId>`, `User ID.`)
|
|
1038
|
+
.requiredOption(`--labels [labels...]`, `Array of user labels. Replaces the previous labels. Maximum of 5 labels are allowed, each up to 36 alphanumeric characters long.`)
|
|
1039
|
+
.action(actionRunner(usersUpdateLabels))
|
|
1040
|
+
|
|
949
1041
|
users
|
|
950
1042
|
.command(`listLogs`)
|
|
951
1043
|
.description(`Get the user activity logs list by its unique ID.`)
|
|
@@ -1040,6 +1132,8 @@ module.exports = {
|
|
|
1040
1132
|
usersCreate,
|
|
1041
1133
|
usersCreateArgon2User,
|
|
1042
1134
|
usersCreateBcryptUser,
|
|
1135
|
+
usersListIdentities,
|
|
1136
|
+
usersDeleteIdentity,
|
|
1043
1137
|
usersCreateMD5User,
|
|
1044
1138
|
usersCreatePHPassUser,
|
|
1045
1139
|
usersCreateScryptUser,
|
|
@@ -1049,6 +1143,7 @@ module.exports = {
|
|
|
1049
1143
|
usersGet,
|
|
1050
1144
|
usersDelete,
|
|
1051
1145
|
usersUpdateEmail,
|
|
1146
|
+
usersUpdateLabels,
|
|
1052
1147
|
usersListLogs,
|
|
1053
1148
|
usersListMemberships,
|
|
1054
1149
|
usersUpdateName,
|