appwrite-cli 1.2.1 → 2.0.1

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.
Files changed (57) hide show
  1. package/README.md +4 -4
  2. package/docs/examples/account/create.md +1 -1
  3. package/docs/examples/account/update-password.md +1 -1
  4. package/docs/examples/console/variables.md +1 -0
  5. package/docs/examples/databases/create-relationship-attribute.md +9 -0
  6. package/docs/examples/databases/get-document.md +2 -1
  7. package/docs/examples/databases/update-boolean-attribute.md +6 -0
  8. package/docs/examples/databases/update-datetime-attribute.md +6 -0
  9. package/docs/examples/databases/update-email-attribute.md +6 -0
  10. package/docs/examples/databases/update-enum-attribute.md +7 -0
  11. package/docs/examples/databases/update-float-attribute.md +8 -0
  12. package/docs/examples/databases/update-integer-attribute.md +8 -0
  13. package/docs/examples/databases/update-ip-attribute.md +6 -0
  14. package/docs/examples/databases/update-relationship-attribute.md +5 -0
  15. package/docs/examples/databases/update-string-attribute.md +6 -0
  16. package/docs/examples/databases/update-url-attribute.md +6 -0
  17. package/docs/examples/functions/create.md +1 -1
  18. package/docs/examples/functions/update.md +1 -1
  19. package/docs/examples/projects/update-auth-password-dictionary.md +3 -0
  20. package/docs/examples/projects/update-auth-password-history.md +3 -0
  21. package/docs/examples/teams/create-membership.md +3 -1
  22. package/docs/examples/teams/get-prefs.md +2 -0
  23. package/docs/examples/teams/{update.md → update-name.md} +1 -1
  24. package/docs/examples/teams/update-prefs.md +3 -0
  25. package/docs/examples/users/update-password.md +1 -1
  26. package/index.js +2 -0
  27. package/install.ps1 +2 -2
  28. package/install.sh +1 -1
  29. package/lib/client.js +7 -7
  30. package/lib/commands/account.js +40 -7
  31. package/lib/commands/console.js +44 -0
  32. package/lib/commands/databases.js +727 -103
  33. package/lib/commands/deploy.js +270 -146
  34. package/lib/commands/functions.js +35 -9
  35. package/lib/commands/generic.js +6 -3
  36. package/lib/commands/init.js +215 -179
  37. package/lib/commands/projects.js +139 -5
  38. package/lib/commands/storage.js +39 -11
  39. package/lib/commands/teams.js +102 -16
  40. package/lib/commands/users.js +51 -2
  41. package/lib/config.js +84 -6
  42. package/lib/parser.js +7 -2
  43. package/lib/questions.js +307 -280
  44. package/package.json +1 -1
  45. package/docs/examples/account/get-logs.md +0 -2
  46. package/docs/examples/account/get-sessions.md +0 -1
  47. package/docs/examples/functions/retry-build.md +0 -4
  48. package/docs/examples/locale/get-continents.md +0 -1
  49. package/docs/examples/locale/get-countries-e-u.md +0 -1
  50. package/docs/examples/locale/get-countries-phones.md +0 -1
  51. package/docs/examples/locale/get-countries.md +0 -1
  52. package/docs/examples/locale/get-currencies.md +0 -1
  53. package/docs/examples/locale/get-languages.md +0 -1
  54. package/docs/examples/teams/get-memberships.md +0 -4
  55. package/docs/examples/users/get-logs.md +0 -3
  56. package/docs/examples/users/get-memberships.md +0 -2
  57. package/docs/examples/users/get-sessions.md +0 -2
@@ -51,14 +51,18 @@ const teamsCreate = async ({ teamId, name, roles, parseOutput = true, sdk = unde
51
51
  let payload = {};
52
52
 
53
53
  /** Body Params */
54
+
54
55
  if (typeof teamId !== 'undefined') {
55
56
  payload['teamId'] = teamId;
56
57
  }
57
58
 
59
+
58
60
  if (typeof name !== 'undefined') {
59
61
  payload['name'] = name;
60
62
  }
61
63
 
64
+ roles = roles === true ? [] : roles;
65
+
62
66
  if (typeof roles !== 'undefined') {
63
67
  payload['roles'] = roles;
64
68
  }
@@ -93,7 +97,7 @@ const teamsGet = async ({ teamId, parseOutput = true, sdk = undefined}) => {
93
97
  return response;
94
98
  }
95
99
 
96
- const teamsUpdate = async ({ teamId, name, parseOutput = true, sdk = undefined}) => {
100
+ const teamsUpdateName = async ({ teamId, name, parseOutput = true, sdk = undefined}) => {
97
101
  /* @param {string} teamId */
98
102
  /* @param {string} name */
99
103
 
@@ -102,6 +106,7 @@ const teamsUpdate = async ({ teamId, name, parseOutput = true, sdk = undefined})
102
106
  let payload = {};
103
107
 
104
108
  /** Body Params */
109
+
105
110
  if (typeof name !== 'undefined') {
106
111
  payload['name'] = name;
107
112
  }
@@ -188,11 +193,13 @@ const teamsListMemberships = async ({ teamId, queries, search, parseOutput = tru
188
193
  return response;
189
194
  }
190
195
 
191
- const teamsCreateMembership = async ({ teamId, email, roles, url, name, parseOutput = true, sdk = undefined}) => {
196
+ const teamsCreateMembership = async ({ teamId, roles, url, email, userId, phone, name, parseOutput = true, sdk = undefined}) => {
192
197
  /* @param {string} teamId */
193
- /* @param {string} email */
194
198
  /* @param {string[]} roles */
195
199
  /* @param {string} url */
200
+ /* @param {string} email */
201
+ /* @param {string} userId */
202
+ /* @param {string} phone */
196
203
  /* @param {string} name */
197
204
 
198
205
  let client = !sdk ? await sdkForProject() : sdk;
@@ -200,18 +207,33 @@ const teamsCreateMembership = async ({ teamId, email, roles, url, name, parseOut
200
207
  let payload = {};
201
208
 
202
209
  /** Body Params */
210
+
203
211
  if (typeof email !== 'undefined') {
204
212
  payload['email'] = email;
205
213
  }
206
214
 
215
+
216
+ if (typeof userId !== 'undefined') {
217
+ payload['userId'] = userId;
218
+ }
219
+
220
+
221
+ if (typeof phone !== 'undefined') {
222
+ payload['phone'] = phone;
223
+ }
224
+
225
+ roles = roles === true ? [] : roles;
226
+
207
227
  if (typeof roles !== 'undefined') {
208
228
  payload['roles'] = roles;
209
229
  }
210
230
 
231
+
211
232
  if (typeof url !== 'undefined') {
212
233
  payload['url'] = url;
213
234
  }
214
235
 
236
+
215
237
  if (typeof name !== 'undefined') {
216
238
  payload['name'] = name;
217
239
  }
@@ -257,6 +279,8 @@ const teamsUpdateMembershipRoles = async ({ teamId, membershipId, roles, parseOu
257
279
  let payload = {};
258
280
 
259
281
  /** Body Params */
282
+ roles = roles === true ? [] : roles;
283
+
260
284
  if (typeof roles !== 'undefined') {
261
285
  payload['roles'] = roles;
262
286
  }
@@ -303,10 +327,12 @@ const teamsUpdateMembershipStatus = async ({ teamId, membershipId, userId, secre
303
327
  let payload = {};
304
328
 
305
329
  /** Body Params */
330
+
306
331
  if (typeof userId !== 'undefined') {
307
332
  payload['userId'] = userId;
308
333
  }
309
334
 
335
+
310
336
  if (typeof secret !== 'undefined') {
311
337
  payload['secret'] = secret;
312
338
  }
@@ -323,11 +349,54 @@ const teamsUpdateMembershipStatus = async ({ teamId, membershipId, userId, secre
323
349
  return response;
324
350
  }
325
351
 
352
+ const teamsGetPrefs = async ({ teamId, parseOutput = true, sdk = undefined}) => {
353
+ /* @param {string} teamId */
354
+
355
+ let client = !sdk ? await sdkForProject() : sdk;
356
+ let path = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
357
+ let payload = {};
358
+ let response = undefined;
359
+ response = await client.call('get', path, {
360
+ 'content-type': 'application/json',
361
+ }, payload);
362
+
363
+ if (parseOutput) {
364
+ parse(response)
365
+ success()
366
+ }
367
+ return response;
368
+ }
369
+
370
+ const teamsUpdatePrefs = async ({ teamId, prefs, parseOutput = true, sdk = undefined}) => {
371
+ /* @param {string} teamId */
372
+ /* @param {object} prefs */
373
+
374
+ let client = !sdk ? await sdkForProject() : sdk;
375
+ let path = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
376
+ let payload = {};
377
+
378
+ /** Body Params */
379
+ if (typeof prefs !== 'undefined') {
380
+ payload['prefs'] = JSON.parse(prefs);
381
+ }
382
+
383
+ let response = undefined;
384
+ response = await client.call('put', path, {
385
+ 'content-type': 'application/json',
386
+ }, payload);
387
+
388
+ if (parseOutput) {
389
+ parse(response)
390
+ success()
391
+ }
392
+ return response;
393
+ }
394
+
326
395
 
327
396
  teams
328
397
  .command(`list`)
329
398
  .description(`Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.`)
330
- .option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total`)
399
+ .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: name, total`)
331
400
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
332
401
  .action(actionRunner(teamsList))
333
402
 
@@ -336,7 +405,7 @@ teams
336
405
  .description(`Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.`)
337
406
  .requiredOption(`--teamId <teamId>`, `Team ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
338
407
  .requiredOption(`--name <name>`, `Team name. Max length: 128 chars.`)
339
- .option(`--roles <roles...>`, `Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.`)
408
+ .option(`--roles [roles...]`, `Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.`)
340
409
  .action(actionRunner(teamsCreate))
341
410
 
342
411
  teams
@@ -346,11 +415,11 @@ teams
346
415
  .action(actionRunner(teamsGet))
347
416
 
348
417
  teams
349
- .command(`update`)
350
- .description(`Update a team using its ID. Only members with the owner role can update the team.`)
418
+ .command(`updateName`)
419
+ .description(`Update the team's name by its unique ID.`)
351
420
  .requiredOption(`--teamId <teamId>`, `Team ID.`)
352
421
  .requiredOption(`--name <name>`, `New team name. Max length: 128 chars.`)
353
- .action(actionRunner(teamsUpdate))
422
+ .action(actionRunner(teamsUpdateName))
354
423
 
355
424
  teams
356
425
  .command(`delete`)
@@ -362,24 +431,26 @@ teams
362
431
  .command(`listLogs`)
363
432
  .description(`Get the team activity logs list by its unique ID.`)
364
433
  .requiredOption(`--teamId <teamId>`, `Team ID.`)
365
- .option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset`)
434
+ .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). Only supported methods are limit and offset`)
366
435
  .action(actionRunner(teamsListLogs))
367
436
 
368
437
  teams
369
438
  .command(`listMemberships`)
370
439
  .description(`Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.`)
371
440
  .requiredOption(`--teamId <teamId>`, `Team ID.`)
372
- .option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm`)
441
+ .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, teamId, invited, joined, confirm`)
373
442
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
374
443
  .action(actionRunner(teamsListMemberships))
375
444
 
376
445
  teams
377
446
  .command(`createMembership`)
378
- .description(`Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team. Use the 'url' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team. Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when adding your platforms in the console interface.`)
447
+ .description(`Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. Use the 'url' parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team. Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. `)
379
448
  .requiredOption(`--teamId <teamId>`, `Team ID.`)
380
- .requiredOption(`--email <email>`, `Email of the new team member.`)
381
- .requiredOption(`--roles <roles...>`, `Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.`)
449
+ .requiredOption(`--roles [roles...]`, `Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.`)
382
450
  .requiredOption(`--url <url>`, `URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`)
451
+ .option(`--email <email>`, `Email of the new team member.`)
452
+ .option(`--userId <userId>`, `ID of the user to be added to a team.`)
453
+ .option(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
383
454
  .option(`--name <name>`, `Name of the new team member. Max length: 128 chars.`)
384
455
  .action(actionRunner(teamsCreateMembership))
385
456
 
@@ -395,7 +466,7 @@ teams
395
466
  .description(`Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](/docs/permissions).`)
396
467
  .requiredOption(`--teamId <teamId>`, `Team ID.`)
397
468
  .requiredOption(`--membershipId <membershipId>`, `Membership ID.`)
398
- .requiredOption(`--roles <roles...>`, `An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.`)
469
+ .requiredOption(`--roles [roles...]`, `An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.`)
399
470
  .action(actionRunner(teamsUpdateMembershipRoles))
400
471
 
401
472
  teams
@@ -414,13 +485,26 @@ teams
414
485
  .requiredOption(`--secret <secret>`, `Secret key.`)
415
486
  .action(actionRunner(teamsUpdateMembershipStatus))
416
487
 
488
+ teams
489
+ .command(`getPrefs`)
490
+ .description(`Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](/docs/client/account#accountGetPrefs).`)
491
+ .requiredOption(`--teamId <teamId>`, `Team ID.`)
492
+ .action(actionRunner(teamsGetPrefs))
493
+
494
+ teams
495
+ .command(`updatePrefs`)
496
+ .description(`Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.`)
497
+ .requiredOption(`--teamId <teamId>`, `Team ID.`)
498
+ .requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
499
+ .action(actionRunner(teamsUpdatePrefs))
500
+
417
501
 
418
502
  module.exports = {
419
503
  teams,
420
504
  teamsList,
421
505
  teamsCreate,
422
506
  teamsGet,
423
- teamsUpdate,
507
+ teamsUpdateName,
424
508
  teamsDelete,
425
509
  teamsListLogs,
426
510
  teamsListMemberships,
@@ -428,5 +512,7 @@ module.exports = {
428
512
  teamsGetMembership,
429
513
  teamsUpdateMembershipRoles,
430
514
  teamsDeleteMembership,
431
- teamsUpdateMembershipStatus
515
+ teamsUpdateMembershipStatus,
516
+ teamsGetPrefs,
517
+ teamsUpdatePrefs
432
518
  };
@@ -53,22 +53,27 @@ const usersCreate = async ({ userId, email, phone, password, name, parseOutput =
53
53
  let payload = {};
54
54
 
55
55
  /** Body Params */
56
+
56
57
  if (typeof userId !== 'undefined') {
57
58
  payload['userId'] = userId;
58
59
  }
59
60
 
61
+
60
62
  if (typeof email !== 'undefined') {
61
63
  payload['email'] = email;
62
64
  }
63
65
 
66
+
64
67
  if (typeof phone !== 'undefined') {
65
68
  payload['phone'] = phone;
66
69
  }
67
70
 
71
+
68
72
  if (typeof password !== 'undefined') {
69
73
  payload['password'] = password;
70
74
  }
71
75
 
76
+
72
77
  if (typeof name !== 'undefined') {
73
78
  payload['name'] = name;
74
79
  }
@@ -96,18 +101,22 @@ const usersCreateArgon2User = async ({ userId, email, password, name, parseOutpu
96
101
  let payload = {};
97
102
 
98
103
  /** Body Params */
104
+
99
105
  if (typeof userId !== 'undefined') {
100
106
  payload['userId'] = userId;
101
107
  }
102
108
 
109
+
103
110
  if (typeof email !== 'undefined') {
104
111
  payload['email'] = email;
105
112
  }
106
113
 
114
+
107
115
  if (typeof password !== 'undefined') {
108
116
  payload['password'] = password;
109
117
  }
110
118
 
119
+
111
120
  if (typeof name !== 'undefined') {
112
121
  payload['name'] = name;
113
122
  }
@@ -135,18 +144,22 @@ const usersCreateBcryptUser = async ({ userId, email, password, name, parseOutpu
135
144
  let payload = {};
136
145
 
137
146
  /** Body Params */
147
+
138
148
  if (typeof userId !== 'undefined') {
139
149
  payload['userId'] = userId;
140
150
  }
141
151
 
152
+
142
153
  if (typeof email !== 'undefined') {
143
154
  payload['email'] = email;
144
155
  }
145
156
 
157
+
146
158
  if (typeof password !== 'undefined') {
147
159
  payload['password'] = password;
148
160
  }
149
161
 
162
+
150
163
  if (typeof name !== 'undefined') {
151
164
  payload['name'] = name;
152
165
  }
@@ -174,18 +187,22 @@ const usersCreateMD5User = async ({ userId, email, password, name, parseOutput =
174
187
  let payload = {};
175
188
 
176
189
  /** Body Params */
190
+
177
191
  if (typeof userId !== 'undefined') {
178
192
  payload['userId'] = userId;
179
193
  }
180
194
 
195
+
181
196
  if (typeof email !== 'undefined') {
182
197
  payload['email'] = email;
183
198
  }
184
199
 
200
+
185
201
  if (typeof password !== 'undefined') {
186
202
  payload['password'] = password;
187
203
  }
188
204
 
205
+
189
206
  if (typeof name !== 'undefined') {
190
207
  payload['name'] = name;
191
208
  }
@@ -213,18 +230,22 @@ const usersCreatePHPassUser = async ({ userId, email, password, name, parseOutpu
213
230
  let payload = {};
214
231
 
215
232
  /** Body Params */
233
+
216
234
  if (typeof userId !== 'undefined') {
217
235
  payload['userId'] = userId;
218
236
  }
219
237
 
238
+
220
239
  if (typeof email !== 'undefined') {
221
240
  payload['email'] = email;
222
241
  }
223
242
 
243
+
224
244
  if (typeof password !== 'undefined') {
225
245
  payload['password'] = password;
226
246
  }
227
247
 
248
+
228
249
  if (typeof name !== 'undefined') {
229
250
  payload['name'] = name;
230
251
  }
@@ -257,38 +278,47 @@ const usersCreateScryptUser = async ({ userId, email, password, passwordSalt, pa
257
278
  let payload = {};
258
279
 
259
280
  /** Body Params */
281
+
260
282
  if (typeof userId !== 'undefined') {
261
283
  payload['userId'] = userId;
262
284
  }
263
285
 
286
+
264
287
  if (typeof email !== 'undefined') {
265
288
  payload['email'] = email;
266
289
  }
267
290
 
291
+
268
292
  if (typeof password !== 'undefined') {
269
293
  payload['password'] = password;
270
294
  }
271
295
 
296
+
272
297
  if (typeof passwordSalt !== 'undefined') {
273
298
  payload['passwordSalt'] = passwordSalt;
274
299
  }
275
300
 
301
+
276
302
  if (typeof passwordCpu !== 'undefined') {
277
303
  payload['passwordCpu'] = passwordCpu;
278
304
  }
279
305
 
306
+
280
307
  if (typeof passwordMemory !== 'undefined') {
281
308
  payload['passwordMemory'] = passwordMemory;
282
309
  }
283
310
 
311
+
284
312
  if (typeof passwordParallel !== 'undefined') {
285
313
  payload['passwordParallel'] = passwordParallel;
286
314
  }
287
315
 
316
+
288
317
  if (typeof passwordLength !== 'undefined') {
289
318
  payload['passwordLength'] = passwordLength;
290
319
  }
291
320
 
321
+
292
322
  if (typeof name !== 'undefined') {
293
323
  payload['name'] = name;
294
324
  }
@@ -319,30 +349,37 @@ const usersCreateScryptModifiedUser = async ({ userId, email, password, password
319
349
  let payload = {};
320
350
 
321
351
  /** Body Params */
352
+
322
353
  if (typeof userId !== 'undefined') {
323
354
  payload['userId'] = userId;
324
355
  }
325
356
 
357
+
326
358
  if (typeof email !== 'undefined') {
327
359
  payload['email'] = email;
328
360
  }
329
361
 
362
+
330
363
  if (typeof password !== 'undefined') {
331
364
  payload['password'] = password;
332
365
  }
333
366
 
367
+
334
368
  if (typeof passwordSalt !== 'undefined') {
335
369
  payload['passwordSalt'] = passwordSalt;
336
370
  }
337
371
 
372
+
338
373
  if (typeof passwordSaltSeparator !== 'undefined') {
339
374
  payload['passwordSaltSeparator'] = passwordSaltSeparator;
340
375
  }
341
376
 
377
+
342
378
  if (typeof passwordSignerKey !== 'undefined') {
343
379
  payload['passwordSignerKey'] = passwordSignerKey;
344
380
  }
345
381
 
382
+
346
383
  if (typeof name !== 'undefined') {
347
384
  payload['name'] = name;
348
385
  }
@@ -371,22 +408,27 @@ const usersCreateSHAUser = async ({ userId, email, password, passwordVersion, na
371
408
  let payload = {};
372
409
 
373
410
  /** Body Params */
411
+
374
412
  if (typeof userId !== 'undefined') {
375
413
  payload['userId'] = userId;
376
414
  }
377
415
 
416
+
378
417
  if (typeof email !== 'undefined') {
379
418
  payload['email'] = email;
380
419
  }
381
420
 
421
+
382
422
  if (typeof password !== 'undefined') {
383
423
  payload['password'] = password;
384
424
  }
385
425
 
426
+
386
427
  if (typeof passwordVersion !== 'undefined') {
387
428
  payload['passwordVersion'] = passwordVersion;
388
429
  }
389
430
 
431
+
390
432
  if (typeof name !== 'undefined') {
391
433
  payload['name'] = name;
392
434
  }
@@ -475,6 +517,7 @@ const usersUpdateEmail = async ({ userId, email, parseOutput = true, sdk = undef
475
517
  let payload = {};
476
518
 
477
519
  /** Body Params */
520
+
478
521
  if (typeof email !== 'undefined') {
479
522
  payload['email'] = email;
480
523
  }
@@ -542,6 +585,7 @@ const usersUpdateName = async ({ userId, name, parseOutput = true, sdk = undefin
542
585
  let payload = {};
543
586
 
544
587
  /** Body Params */
588
+
545
589
  if (typeof name !== 'undefined') {
546
590
  payload['name'] = name;
547
591
  }
@@ -567,6 +611,7 @@ const usersUpdatePassword = async ({ userId, password, parseOutput = true, sdk =
567
611
  let payload = {};
568
612
 
569
613
  /** Body Params */
614
+
570
615
  if (typeof password !== 'undefined') {
571
616
  payload['password'] = password;
572
617
  }
@@ -592,6 +637,7 @@ const usersUpdatePhone = async ({ userId, number, parseOutput = true, sdk = unde
592
637
  let payload = {};
593
638
 
594
639
  /** Body Params */
640
+
595
641
  if (typeof number !== 'undefined') {
596
642
  payload['number'] = number;
597
643
  }
@@ -715,6 +761,7 @@ const usersUpdateStatus = async ({ userId, status, parseOutput = true, sdk = und
715
761
  let payload = {};
716
762
 
717
763
  /** Body Params */
764
+
718
765
  if (typeof status !== 'undefined') {
719
766
  payload['status'] = status;
720
767
  }
@@ -740,6 +787,7 @@ const usersUpdateEmailVerification = async ({ userId, emailVerification, parseOu
740
787
  let payload = {};
741
788
 
742
789
  /** Body Params */
790
+
743
791
  if (typeof emailVerification !== 'undefined') {
744
792
  payload['emailVerification'] = emailVerification;
745
793
  }
@@ -765,6 +813,7 @@ const usersUpdatePhoneVerification = async ({ userId, phoneVerification, parseOu
765
813
  let payload = {};
766
814
 
767
815
  /** Body Params */
816
+
768
817
  if (typeof phoneVerification !== 'undefined') {
769
818
  payload['phoneVerification'] = phoneVerification;
770
819
  }
@@ -785,7 +834,7 @@ const usersUpdatePhoneVerification = async ({ userId, phoneVerification, parseOu
785
834
  users
786
835
  .command(`list`)
787
836
  .description(`Get a list of all the project's users. You can use the query params to filter your results.`)
788
- .option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification`)
837
+ .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: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification`)
789
838
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
790
839
  .action(actionRunner(usersList))
791
840
 
@@ -901,7 +950,7 @@ users
901
950
  .command(`listLogs`)
902
951
  .description(`Get the user activity logs list by its unique ID.`)
903
952
  .requiredOption(`--userId <userId>`, `User ID.`)
904
- .option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset`)
953
+ .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). Only supported methods are limit and offset`)
905
954
  .action(actionRunner(usersListLogs))
906
955
 
907
956
  users