appwrite-cli 1.2.1 → 2.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.
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 +37 -9
  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 +6 -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
@@ -50,10 +50,12 @@ const databasesCreate = async ({ databaseId, name, parseOutput = true, sdk = und
50
50
  let payload = {};
51
51
 
52
52
  /** Body Params */
53
+
53
54
  if (typeof databaseId !== 'undefined') {
54
55
  payload['databaseId'] = databaseId;
55
56
  }
56
57
 
58
+
57
59
  if (typeof name !== 'undefined') {
58
60
  payload['name'] = name;
59
61
  }
@@ -120,6 +122,7 @@ const databasesUpdate = async ({ databaseId, name, parseOutput = true, sdk = und
120
122
  let payload = {};
121
123
 
122
124
  /** Body Params */
125
+
123
126
  if (typeof name !== 'undefined') {
124
127
  payload['name'] = name;
125
128
  }
@@ -194,18 +197,23 @@ const databasesCreateCollection = async ({ databaseId, collectionId, name, permi
194
197
  let payload = {};
195
198
 
196
199
  /** Body Params */
200
+
197
201
  if (typeof collectionId !== 'undefined') {
198
202
  payload['collectionId'] = collectionId;
199
203
  }
200
204
 
205
+
201
206
  if (typeof name !== 'undefined') {
202
207
  payload['name'] = name;
203
208
  }
204
209
 
210
+ permissions = permissions === true ? [] : permissions;
211
+
205
212
  if (typeof permissions !== 'undefined') {
206
213
  payload['permissions'] = permissions;
207
214
  }
208
215
 
216
+
209
217
  if (typeof documentSecurity !== 'undefined') {
210
218
  payload['documentSecurity'] = documentSecurity;
211
219
  }
@@ -254,18 +262,23 @@ const databasesUpdateCollection = async ({ databaseId, collectionId, name, permi
254
262
  let payload = {};
255
263
 
256
264
  /** Body Params */
265
+
257
266
  if (typeof name !== 'undefined') {
258
267
  payload['name'] = name;
259
268
  }
260
269
 
270
+ permissions = permissions === true ? [] : permissions;
271
+
261
272
  if (typeof permissions !== 'undefined') {
262
273
  payload['permissions'] = permissions;
263
274
  }
264
275
 
276
+
265
277
  if (typeof documentSecurity !== 'undefined') {
266
278
  payload['documentSecurity'] = documentSecurity;
267
279
  }
268
280
 
281
+
269
282
  if (typeof enabled !== 'undefined') {
270
283
  payload['enabled'] = enabled;
271
284
  }
@@ -333,18 +346,467 @@ const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key,
333
346
  let payload = {};
334
347
 
335
348
  /** Body Params */
349
+
350
+ if (typeof key !== 'undefined') {
351
+ payload['key'] = key;
352
+ }
353
+
354
+
355
+ if (typeof required !== 'undefined') {
356
+ payload['required'] = required;
357
+ }
358
+
359
+
360
+ if (typeof xdefault !== 'undefined') {
361
+ payload['default'] = xdefault;
362
+ }
363
+
364
+
365
+ if (typeof array !== 'undefined') {
366
+ payload['array'] = array;
367
+ }
368
+
369
+ let response = undefined;
370
+ response = await client.call('post', path, {
371
+ 'content-type': 'application/json',
372
+ }, payload);
373
+
374
+ if (parseOutput) {
375
+ parse(response)
376
+ success()
377
+ }
378
+ return response;
379
+ }
380
+
381
+ const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
382
+ /* @param {string} databaseId */
383
+ /* @param {string} collectionId */
384
+ /* @param {string} key */
385
+ /* @param {boolean} required */
386
+ /* @param {boolean} xdefault */
387
+
388
+ let client = !sdk ? await sdkForProject() : sdk;
389
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
390
+ let payload = {};
391
+
392
+ /** Body Params */
393
+
394
+ if (typeof required !== 'undefined') {
395
+ payload['required'] = required;
396
+ }
397
+
398
+
399
+ if (typeof xdefault !== 'undefined') {
400
+ payload['default'] = xdefault;
401
+ }
402
+
403
+ let response = undefined;
404
+ response = await client.call('patch', path, {
405
+ 'content-type': 'application/json',
406
+ }, payload);
407
+
408
+ if (parseOutput) {
409
+ parse(response)
410
+ success()
411
+ }
412
+ return response;
413
+ }
414
+
415
+ const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
416
+ /* @param {string} databaseId */
417
+ /* @param {string} collectionId */
418
+ /* @param {string} key */
419
+ /* @param {boolean} required */
420
+ /* @param {string} xdefault */
421
+ /* @param {boolean} array */
422
+
423
+ let client = !sdk ? await sdkForProject() : sdk;
424
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
425
+ let payload = {};
426
+
427
+ /** Body Params */
428
+
429
+ if (typeof key !== 'undefined') {
430
+ payload['key'] = key;
431
+ }
432
+
433
+
434
+ if (typeof required !== 'undefined') {
435
+ payload['required'] = required;
436
+ }
437
+
438
+
439
+ if (typeof xdefault !== 'undefined') {
440
+ payload['default'] = xdefault;
441
+ }
442
+
443
+
444
+ if (typeof array !== 'undefined') {
445
+ payload['array'] = array;
446
+ }
447
+
448
+ let response = undefined;
449
+ response = await client.call('post', path, {
450
+ 'content-type': 'application/json',
451
+ }, payload);
452
+
453
+ if (parseOutput) {
454
+ parse(response)
455
+ success()
456
+ }
457
+ return response;
458
+ }
459
+
460
+ const databasesUpdateDatetimeAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
461
+ /* @param {string} databaseId */
462
+ /* @param {string} collectionId */
463
+ /* @param {string} key */
464
+ /* @param {boolean} required */
465
+ /* @param {string} xdefault */
466
+
467
+ let client = !sdk ? await sdkForProject() : sdk;
468
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
469
+ let payload = {};
470
+
471
+ /** Body Params */
472
+
473
+ if (typeof required !== 'undefined') {
474
+ payload['required'] = required;
475
+ }
476
+
477
+
478
+ if (typeof xdefault !== 'undefined') {
479
+ payload['default'] = xdefault;
480
+ }
481
+
482
+ let response = undefined;
483
+ response = await client.call('patch', path, {
484
+ 'content-type': 'application/json',
485
+ }, payload);
486
+
487
+ if (parseOutput) {
488
+ parse(response)
489
+ success()
490
+ }
491
+ return response;
492
+ }
493
+
494
+ const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
495
+ /* @param {string} databaseId */
496
+ /* @param {string} collectionId */
497
+ /* @param {string} key */
498
+ /* @param {boolean} required */
499
+ /* @param {string} xdefault */
500
+ /* @param {boolean} array */
501
+
502
+ let client = !sdk ? await sdkForProject() : sdk;
503
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
504
+ let payload = {};
505
+
506
+ /** Body Params */
507
+
508
+ if (typeof key !== 'undefined') {
509
+ payload['key'] = key;
510
+ }
511
+
512
+
513
+ if (typeof required !== 'undefined') {
514
+ payload['required'] = required;
515
+ }
516
+
517
+
518
+ if (typeof xdefault !== 'undefined') {
519
+ payload['default'] = xdefault;
520
+ }
521
+
522
+
523
+ if (typeof array !== 'undefined') {
524
+ payload['array'] = array;
525
+ }
526
+
527
+ let response = undefined;
528
+ response = await client.call('post', path, {
529
+ 'content-type': 'application/json',
530
+ }, payload);
531
+
532
+ if (parseOutput) {
533
+ parse(response)
534
+ success()
535
+ }
536
+ return response;
537
+ }
538
+
539
+ const databasesUpdateEmailAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
540
+ /* @param {string} databaseId */
541
+ /* @param {string} collectionId */
542
+ /* @param {string} key */
543
+ /* @param {boolean} required */
544
+ /* @param {string} xdefault */
545
+
546
+ let client = !sdk ? await sdkForProject() : sdk;
547
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
548
+ let payload = {};
549
+
550
+ /** Body Params */
551
+
552
+ if (typeof required !== 'undefined') {
553
+ payload['required'] = required;
554
+ }
555
+
556
+
557
+ if (typeof xdefault !== 'undefined') {
558
+ payload['default'] = xdefault;
559
+ }
560
+
561
+ let response = undefined;
562
+ response = await client.call('patch', path, {
563
+ 'content-type': 'application/json',
564
+ }, payload);
565
+
566
+ if (parseOutput) {
567
+ parse(response)
568
+ success()
569
+ }
570
+ return response;
571
+ }
572
+
573
+ const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, elements, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
574
+ /* @param {string} databaseId */
575
+ /* @param {string} collectionId */
576
+ /* @param {string} key */
577
+ /* @param {string[]} elements */
578
+ /* @param {boolean} required */
579
+ /* @param {string} xdefault */
580
+ /* @param {boolean} array */
581
+
582
+ let client = !sdk ? await sdkForProject() : sdk;
583
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
584
+ let payload = {};
585
+
586
+ /** Body Params */
587
+
588
+ if (typeof key !== 'undefined') {
589
+ payload['key'] = key;
590
+ }
591
+
592
+ elements = elements === true ? [] : elements;
593
+
594
+ if (typeof elements !== 'undefined') {
595
+ payload['elements'] = elements;
596
+ }
597
+
598
+
599
+ if (typeof required !== 'undefined') {
600
+ payload['required'] = required;
601
+ }
602
+
603
+
604
+ if (typeof xdefault !== 'undefined') {
605
+ payload['default'] = xdefault;
606
+ }
607
+
608
+
609
+ if (typeof array !== 'undefined') {
610
+ payload['array'] = array;
611
+ }
612
+
613
+ let response = undefined;
614
+ response = await client.call('post', path, {
615
+ 'content-type': 'application/json',
616
+ }, payload);
617
+
618
+ if (parseOutput) {
619
+ parse(response)
620
+ success()
621
+ }
622
+ return response;
623
+ }
624
+
625
+ const databasesUpdateEnumAttribute = async ({ databaseId, collectionId, key, elements, required, xdefault, parseOutput = true, sdk = undefined}) => {
626
+ /* @param {string} databaseId */
627
+ /* @param {string} collectionId */
628
+ /* @param {string} key */
629
+ /* @param {string[]} elements */
630
+ /* @param {boolean} required */
631
+ /* @param {string} xdefault */
632
+
633
+ let client = !sdk ? await sdkForProject() : sdk;
634
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
635
+ let payload = {};
636
+
637
+ /** Body Params */
638
+ elements = elements === true ? [] : elements;
639
+
640
+ if (typeof elements !== 'undefined') {
641
+ payload['elements'] = elements;
642
+ }
643
+
644
+
645
+ if (typeof required !== 'undefined') {
646
+ payload['required'] = required;
647
+ }
648
+
649
+
650
+ if (typeof xdefault !== 'undefined') {
651
+ payload['default'] = xdefault;
652
+ }
653
+
654
+ let response = undefined;
655
+ response = await client.call('patch', path, {
656
+ 'content-type': 'application/json',
657
+ }, payload);
658
+
659
+ if (parseOutput) {
660
+ parse(response)
661
+ success()
662
+ }
663
+ return response;
664
+ }
665
+
666
+ const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, array, parseOutput = true, sdk = undefined}) => {
667
+ /* @param {string} databaseId */
668
+ /* @param {string} collectionId */
669
+ /* @param {string} key */
670
+ /* @param {boolean} required */
671
+ /* @param {number} min */
672
+ /* @param {number} max */
673
+ /* @param {number} xdefault */
674
+ /* @param {boolean} array */
675
+
676
+ let client = !sdk ? await sdkForProject() : sdk;
677
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
678
+ let payload = {};
679
+
680
+ /** Body Params */
681
+
336
682
  if (typeof key !== 'undefined') {
337
683
  payload['key'] = key;
338
684
  }
339
685
 
686
+
340
687
  if (typeof required !== 'undefined') {
341
688
  payload['required'] = required;
342
689
  }
343
690
 
691
+
692
+ if (typeof min !== 'undefined') {
693
+ payload['min'] = min;
694
+ }
695
+
696
+
697
+ if (typeof max !== 'undefined') {
698
+ payload['max'] = max;
699
+ }
700
+
701
+
702
+ if (typeof xdefault !== 'undefined') {
703
+ payload['default'] = xdefault;
704
+ }
705
+
706
+
707
+ if (typeof array !== 'undefined') {
708
+ payload['array'] = array;
709
+ }
710
+
711
+ let response = undefined;
712
+ response = await client.call('post', path, {
713
+ 'content-type': 'application/json',
714
+ }, payload);
715
+
716
+ if (parseOutput) {
717
+ parse(response)
718
+ success()
719
+ }
720
+ return response;
721
+ }
722
+
723
+ const databasesUpdateFloatAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, parseOutput = true, sdk = undefined}) => {
724
+ /* @param {string} databaseId */
725
+ /* @param {string} collectionId */
726
+ /* @param {string} key */
727
+ /* @param {boolean} required */
728
+ /* @param {number} min */
729
+ /* @param {number} max */
730
+ /* @param {number} xdefault */
731
+
732
+ let client = !sdk ? await sdkForProject() : sdk;
733
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
734
+ let payload = {};
735
+
736
+ /** Body Params */
737
+
738
+ if (typeof required !== 'undefined') {
739
+ payload['required'] = required;
740
+ }
741
+
742
+
743
+ if (typeof min !== 'undefined') {
744
+ payload['min'] = min;
745
+ }
746
+
747
+
748
+ if (typeof max !== 'undefined') {
749
+ payload['max'] = max;
750
+ }
751
+
752
+
753
+ if (typeof xdefault !== 'undefined') {
754
+ payload['default'] = xdefault;
755
+ }
756
+
757
+ let response = undefined;
758
+ response = await client.call('patch', path, {
759
+ 'content-type': 'application/json',
760
+ }, payload);
761
+
762
+ if (parseOutput) {
763
+ parse(response)
764
+ success()
765
+ }
766
+ return response;
767
+ }
768
+
769
+ const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, array, parseOutput = true, sdk = undefined}) => {
770
+ /* @param {string} databaseId */
771
+ /* @param {string} collectionId */
772
+ /* @param {string} key */
773
+ /* @param {boolean} required */
774
+ /* @param {number} min */
775
+ /* @param {number} max */
776
+ /* @param {number} xdefault */
777
+ /* @param {boolean} array */
778
+
779
+ let client = !sdk ? await sdkForProject() : sdk;
780
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
781
+ let payload = {};
782
+
783
+ /** Body Params */
784
+
785
+ if (typeof key !== 'undefined') {
786
+ payload['key'] = key;
787
+ }
788
+
789
+
790
+ if (typeof required !== 'undefined') {
791
+ payload['required'] = required;
792
+ }
793
+
794
+
795
+ if (typeof min !== 'undefined') {
796
+ payload['min'] = min;
797
+ }
798
+
799
+
800
+ if (typeof max !== 'undefined') {
801
+ payload['max'] = max;
802
+ }
803
+
804
+
344
805
  if (typeof xdefault !== 'undefined') {
345
806
  payload['default'] = xdefault;
346
807
  }
347
808
 
809
+
348
810
  if (typeof array !== 'undefined') {
349
811
  payload['array'] = array;
350
812
  }
@@ -361,37 +823,42 @@ const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key,
361
823
  return response;
362
824
  }
363
825
 
364
- const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
826
+ const databasesUpdateIntegerAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, parseOutput = true, sdk = undefined}) => {
365
827
  /* @param {string} databaseId */
366
828
  /* @param {string} collectionId */
367
829
  /* @param {string} key */
368
830
  /* @param {boolean} required */
369
- /* @param {string} xdefault */
370
- /* @param {boolean} array */
831
+ /* @param {number} min */
832
+ /* @param {number} max */
833
+ /* @param {number} xdefault */
371
834
 
372
835
  let client = !sdk ? await sdkForProject() : sdk;
373
- let path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
836
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
374
837
  let payload = {};
375
838
 
376
839
  /** Body Params */
377
- if (typeof key !== 'undefined') {
378
- payload['key'] = key;
379
- }
380
840
 
381
841
  if (typeof required !== 'undefined') {
382
842
  payload['required'] = required;
383
843
  }
384
844
 
385
- if (typeof xdefault !== 'undefined') {
386
- payload['default'] = xdefault;
845
+
846
+ if (typeof min !== 'undefined') {
847
+ payload['min'] = min;
387
848
  }
388
849
 
389
- if (typeof array !== 'undefined') {
390
- payload['array'] = array;
850
+
851
+ if (typeof max !== 'undefined') {
852
+ payload['max'] = max;
853
+ }
854
+
855
+
856
+ if (typeof xdefault !== 'undefined') {
857
+ payload['default'] = xdefault;
391
858
  }
392
859
 
393
860
  let response = undefined;
394
- response = await client.call('post', path, {
861
+ response = await client.call('patch', path, {
395
862
  'content-type': 'application/json',
396
863
  }, payload);
397
864
 
@@ -402,7 +869,7 @@ const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key,
402
869
  return response;
403
870
  }
404
871
 
405
- const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
872
+ const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
406
873
  /* @param {string} databaseId */
407
874
  /* @param {string} collectionId */
408
875
  /* @param {string} key */
@@ -411,22 +878,26 @@ const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, re
411
878
  /* @param {boolean} array */
412
879
 
413
880
  let client = !sdk ? await sdkForProject() : sdk;
414
- let path = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
881
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
415
882
  let payload = {};
416
883
 
417
884
  /** Body Params */
885
+
418
886
  if (typeof key !== 'undefined') {
419
887
  payload['key'] = key;
420
888
  }
421
889
 
890
+
422
891
  if (typeof required !== 'undefined') {
423
892
  payload['required'] = required;
424
893
  }
425
894
 
895
+
426
896
  if (typeof xdefault !== 'undefined') {
427
897
  payload['default'] = xdefault;
428
898
  }
429
899
 
900
+
430
901
  if (typeof array !== 'undefined') {
431
902
  payload['array'] = array;
432
903
  }
@@ -443,42 +914,30 @@ const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, re
443
914
  return response;
444
915
  }
445
916
 
446
- const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, elements, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
917
+ const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
447
918
  /* @param {string} databaseId */
448
919
  /* @param {string} collectionId */
449
920
  /* @param {string} key */
450
- /* @param {string[]} elements */
451
921
  /* @param {boolean} required */
452
922
  /* @param {string} xdefault */
453
- /* @param {boolean} array */
454
923
 
455
924
  let client = !sdk ? await sdkForProject() : sdk;
456
- let path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
925
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
457
926
  let payload = {};
458
927
 
459
928
  /** Body Params */
460
- if (typeof key !== 'undefined') {
461
- payload['key'] = key;
462
- }
463
-
464
- if (typeof elements !== 'undefined') {
465
- payload['elements'] = elements;
466
- }
467
929
 
468
930
  if (typeof required !== 'undefined') {
469
931
  payload['required'] = required;
470
932
  }
471
933
 
934
+
472
935
  if (typeof xdefault !== 'undefined') {
473
936
  payload['default'] = xdefault;
474
937
  }
475
938
 
476
- if (typeof array !== 'undefined') {
477
- payload['array'] = array;
478
- }
479
-
480
939
  let response = undefined;
481
- response = await client.call('post', path, {
940
+ response = await client.call('patch', path, {
482
941
  'content-type': 'application/json',
483
942
  }, payload);
484
943
 
@@ -489,43 +948,49 @@ const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, ele
489
948
  return response;
490
949
  }
491
950
 
492
- const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, array, parseOutput = true, sdk = undefined}) => {
951
+ const databasesCreateRelationshipAttribute = async ({ databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete, parseOutput = true, sdk = undefined}) => {
493
952
  /* @param {string} databaseId */
494
953
  /* @param {string} collectionId */
954
+ /* @param {string} relatedCollectionId */
955
+ /* @param {string} type */
956
+ /* @param {boolean} twoWay */
495
957
  /* @param {string} key */
496
- /* @param {boolean} required */
497
- /* @param {number} min */
498
- /* @param {number} max */
499
- /* @param {number} xdefault */
500
- /* @param {boolean} array */
958
+ /* @param {string} twoWayKey */
959
+ /* @param {string} onDelete */
501
960
 
502
961
  let client = !sdk ? await sdkForProject() : sdk;
503
- let path = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
962
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
504
963
  let payload = {};
505
964
 
506
965
  /** Body Params */
507
- if (typeof key !== 'undefined') {
508
- payload['key'] = key;
966
+
967
+ if (typeof relatedCollectionId !== 'undefined') {
968
+ payload['relatedCollectionId'] = relatedCollectionId;
509
969
  }
510
970
 
511
- if (typeof required !== 'undefined') {
512
- payload['required'] = required;
971
+
972
+ if (typeof type !== 'undefined') {
973
+ payload['type'] = type;
513
974
  }
514
975
 
515
- if (typeof min !== 'undefined') {
516
- payload['min'] = min;
976
+
977
+ if (typeof twoWay !== 'undefined') {
978
+ payload['twoWay'] = twoWay;
517
979
  }
518
980
 
519
- if (typeof max !== 'undefined') {
520
- payload['max'] = max;
981
+
982
+ if (typeof key !== 'undefined') {
983
+ payload['key'] = key;
521
984
  }
522
985
 
523
- if (typeof xdefault !== 'undefined') {
524
- payload['default'] = xdefault;
986
+
987
+ if (typeof twoWayKey !== 'undefined') {
988
+ payload['twoWayKey'] = twoWayKey;
525
989
  }
526
990
 
527
- if (typeof array !== 'undefined') {
528
- payload['array'] = array;
991
+
992
+ if (typeof onDelete !== 'undefined') {
993
+ payload['onDelete'] = onDelete;
529
994
  }
530
995
 
531
996
  let response = undefined;
@@ -540,41 +1005,41 @@ const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, re
540
1005
  return response;
541
1006
  }
542
1007
 
543
- const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, array, parseOutput = true, sdk = undefined}) => {
1008
+ const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, size, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
544
1009
  /* @param {string} databaseId */
545
1010
  /* @param {string} collectionId */
546
1011
  /* @param {string} key */
1012
+ /* @param {number} size */
547
1013
  /* @param {boolean} required */
548
- /* @param {number} min */
549
- /* @param {number} max */
550
- /* @param {number} xdefault */
1014
+ /* @param {string} xdefault */
551
1015
  /* @param {boolean} array */
552
1016
 
553
1017
  let client = !sdk ? await sdkForProject() : sdk;
554
- let path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1018
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
555
1019
  let payload = {};
556
1020
 
557
1021
  /** Body Params */
1022
+
558
1023
  if (typeof key !== 'undefined') {
559
1024
  payload['key'] = key;
560
1025
  }
561
1026
 
562
- if (typeof required !== 'undefined') {
563
- payload['required'] = required;
564
- }
565
1027
 
566
- if (typeof min !== 'undefined') {
567
- payload['min'] = min;
1028
+ if (typeof size !== 'undefined') {
1029
+ payload['size'] = size;
568
1030
  }
569
1031
 
570
- if (typeof max !== 'undefined') {
571
- payload['max'] = max;
1032
+
1033
+ if (typeof required !== 'undefined') {
1034
+ payload['required'] = required;
572
1035
  }
573
1036
 
1037
+
574
1038
  if (typeof xdefault !== 'undefined') {
575
1039
  payload['default'] = xdefault;
576
1040
  }
577
1041
 
1042
+
578
1043
  if (typeof array !== 'undefined') {
579
1044
  payload['array'] = array;
580
1045
  }
@@ -591,37 +1056,30 @@ const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key,
591
1056
  return response;
592
1057
  }
593
1058
 
594
- const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
1059
+ const databasesUpdateStringAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
595
1060
  /* @param {string} databaseId */
596
1061
  /* @param {string} collectionId */
597
1062
  /* @param {string} key */
598
1063
  /* @param {boolean} required */
599
1064
  /* @param {string} xdefault */
600
- /* @param {boolean} array */
601
1065
 
602
1066
  let client = !sdk ? await sdkForProject() : sdk;
603
- let path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1067
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
604
1068
  let payload = {};
605
1069
 
606
1070
  /** Body Params */
607
- if (typeof key !== 'undefined') {
608
- payload['key'] = key;
609
- }
610
1071
 
611
1072
  if (typeof required !== 'undefined') {
612
1073
  payload['required'] = required;
613
1074
  }
614
1075
 
1076
+
615
1077
  if (typeof xdefault !== 'undefined') {
616
1078
  payload['default'] = xdefault;
617
1079
  }
618
1080
 
619
- if (typeof array !== 'undefined') {
620
- payload['array'] = array;
621
- }
622
-
623
1081
  let response = undefined;
624
- response = await client.call('post', path, {
1082
+ response = await client.call('patch', path, {
625
1083
  'content-type': 'application/json',
626
1084
  }, payload);
627
1085
 
@@ -632,36 +1090,35 @@ const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, requi
632
1090
  return response;
633
1091
  }
634
1092
 
635
- const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, size, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
1093
+ const databasesCreateUrlAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
636
1094
  /* @param {string} databaseId */
637
1095
  /* @param {string} collectionId */
638
1096
  /* @param {string} key */
639
- /* @param {number} size */
640
1097
  /* @param {boolean} required */
641
1098
  /* @param {string} xdefault */
642
1099
  /* @param {boolean} array */
643
1100
 
644
1101
  let client = !sdk ? await sdkForProject() : sdk;
645
- let path = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1102
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
646
1103
  let payload = {};
647
1104
 
648
1105
  /** Body Params */
1106
+
649
1107
  if (typeof key !== 'undefined') {
650
1108
  payload['key'] = key;
651
1109
  }
652
1110
 
653
- if (typeof size !== 'undefined') {
654
- payload['size'] = size;
655
- }
656
1111
 
657
1112
  if (typeof required !== 'undefined') {
658
1113
  payload['required'] = required;
659
1114
  }
660
1115
 
1116
+
661
1117
  if (typeof xdefault !== 'undefined') {
662
1118
  payload['default'] = xdefault;
663
1119
  }
664
1120
 
1121
+
665
1122
  if (typeof array !== 'undefined') {
666
1123
  payload['array'] = array;
667
1124
  }
@@ -678,37 +1135,30 @@ const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, s
678
1135
  return response;
679
1136
  }
680
1137
 
681
- const databasesCreateUrlAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
1138
+ const databasesUpdateUrlAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
682
1139
  /* @param {string} databaseId */
683
1140
  /* @param {string} collectionId */
684
1141
  /* @param {string} key */
685
1142
  /* @param {boolean} required */
686
1143
  /* @param {string} xdefault */
687
- /* @param {boolean} array */
688
1144
 
689
1145
  let client = !sdk ? await sdkForProject() : sdk;
690
- let path = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1146
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
691
1147
  let payload = {};
692
1148
 
693
1149
  /** Body Params */
694
- if (typeof key !== 'undefined') {
695
- payload['key'] = key;
696
- }
697
1150
 
698
1151
  if (typeof required !== 'undefined') {
699
1152
  payload['required'] = required;
700
1153
  }
701
1154
 
1155
+
702
1156
  if (typeof xdefault !== 'undefined') {
703
1157
  payload['default'] = xdefault;
704
1158
  }
705
1159
 
706
- if (typeof array !== 'undefined') {
707
- payload['array'] = array;
708
- }
709
-
710
1160
  let response = undefined;
711
- response = await client.call('post', path, {
1161
+ response = await client.call('patch', path, {
712
1162
  'content-type': 'application/json',
713
1163
  }, payload);
714
1164
 
@@ -759,6 +1209,34 @@ const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOu
759
1209
  return response;
760
1210
  }
761
1211
 
1212
+ const databasesUpdateRelationshipAttribute = async ({ databaseId, collectionId, key, onDelete, parseOutput = true, sdk = undefined}) => {
1213
+ /* @param {string} databaseId */
1214
+ /* @param {string} collectionId */
1215
+ /* @param {string} key */
1216
+ /* @param {string} onDelete */
1217
+
1218
+ let client = !sdk ? await sdkForProject() : sdk;
1219
+ let path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1220
+ let payload = {};
1221
+
1222
+ /** Body Params */
1223
+
1224
+ if (typeof onDelete !== 'undefined') {
1225
+ payload['onDelete'] = onDelete;
1226
+ }
1227
+
1228
+ let response = undefined;
1229
+ response = await client.call('patch', path, {
1230
+ 'content-type': 'application/json',
1231
+ }, payload);
1232
+
1233
+ if (parseOutput) {
1234
+ parse(response)
1235
+ success()
1236
+ }
1237
+ return response;
1238
+ }
1239
+
762
1240
  const databasesListDocuments = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
763
1241
  /* @param {string} databaseId */
764
1242
  /* @param {string} collectionId */
@@ -796,6 +1274,7 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
796
1274
  let payload = {};
797
1275
 
798
1276
  /** Body Params */
1277
+
799
1278
  if (typeof documentId !== 'undefined') {
800
1279
  payload['documentId'] = documentId;
801
1280
  }
@@ -804,6 +1283,8 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
804
1283
  payload['data'] = JSON.parse(data);
805
1284
  }
806
1285
 
1286
+ permissions = permissions === true ? [] : permissions;
1287
+
807
1288
  if (typeof permissions !== 'undefined') {
808
1289
  payload['permissions'] = permissions;
809
1290
  }
@@ -820,14 +1301,20 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
820
1301
  return response;
821
1302
  }
822
1303
 
823
- const databasesGetDocument = async ({ databaseId, collectionId, documentId, parseOutput = true, sdk = undefined}) => {
1304
+ const databasesGetDocument = async ({ databaseId, collectionId, documentId, queries, parseOutput = true, sdk = undefined}) => {
824
1305
  /* @param {string} databaseId */
825
1306
  /* @param {string} collectionId */
826
1307
  /* @param {string} documentId */
1308
+ /* @param {string[]} queries */
827
1309
 
828
1310
  let client = !sdk ? await sdkForProject() : sdk;
829
1311
  let path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
830
1312
  let payload = {};
1313
+
1314
+ /** Query Params */
1315
+ if (typeof queries !== 'undefined') {
1316
+ payload['queries'] = queries;
1317
+ }
831
1318
  let response = undefined;
832
1319
  response = await client.call('get', path, {
833
1320
  'content-type': 'application/json',
@@ -856,6 +1343,8 @@ const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, d
856
1343
  payload['data'] = JSON.parse(data);
857
1344
  }
858
1345
 
1346
+ permissions = permissions === true ? [] : permissions;
1347
+
859
1348
  if (typeof permissions !== 'undefined') {
860
1349
  payload['permissions'] = permissions;
861
1350
  }
@@ -950,18 +1439,24 @@ const databasesCreateIndex = async ({ databaseId, collectionId, key, type, attri
950
1439
  let payload = {};
951
1440
 
952
1441
  /** Body Params */
1442
+
953
1443
  if (typeof key !== 'undefined') {
954
1444
  payload['key'] = key;
955
1445
  }
956
1446
 
1447
+
957
1448
  if (typeof type !== 'undefined') {
958
1449
  payload['type'] = type;
959
1450
  }
960
1451
 
1452
+ attributes = attributes === true ? [] : attributes;
1453
+
961
1454
  if (typeof attributes !== 'undefined') {
962
1455
  payload['attributes'] = attributes;
963
1456
  }
964
1457
 
1458
+ orders = orders === true ? [] : orders;
1459
+
965
1460
  if (typeof orders !== 'undefined') {
966
1461
  payload['orders'] = orders;
967
1462
  }
@@ -1120,7 +1615,7 @@ const databasesGetDatabaseUsage = async ({ databaseId, range, parseOutput = true
1120
1615
  databases
1121
1616
  .command(`list`)
1122
1617
  .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
1123
- .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`)
1618
+ .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`)
1124
1619
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1125
1620
  .action(actionRunner(databasesList))
1126
1621
 
@@ -1160,7 +1655,7 @@ databases
1160
1655
  .command(`listCollections`)
1161
1656
  .description(`Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.`)
1162
1657
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1163
- .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, enabled, documentSecurity`)
1658
+ .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, enabled, documentSecurity`)
1164
1659
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1165
1660
  .action(actionRunner(databasesListCollections))
1166
1661
 
@@ -1170,7 +1665,7 @@ databases
1170
1665
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1171
1666
  .requiredOption(`--collectionId <collectionId>`, `Unique 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.`)
1172
1667
  .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
1173
- .option(`--permissions <permissions...>`, `An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](/docs/permissions).`)
1668
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](/docs/permissions).`)
1174
1669
  .option(`--documentSecurity <documentSecurity>`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](/docs/permissions).`, parseBool)
1175
1670
  .action(actionRunner(databasesCreateCollection))
1176
1671
 
@@ -1187,7 +1682,7 @@ databases
1187
1682
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1188
1683
  .requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
1189
1684
  .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
1190
- .option(`--permissions <permissions...>`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).`)
1685
+ .option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).`)
1191
1686
  .option(`--documentSecurity <documentSecurity>`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](/docs/permissions).`, parseBool)
1192
1687
  .option(`--enabled <enabled>`, `Is collection enabled?`, parseBool)
1193
1688
  .action(actionRunner(databasesUpdateCollection))
@@ -1217,6 +1712,16 @@ databases
1217
1712
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
1218
1713
  .action(actionRunner(databasesCreateBooleanAttribute))
1219
1714
 
1715
+ databases
1716
+ .command(`updateBooleanAttribute`)
1717
+ .description(``)
1718
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1719
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1720
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1721
+ .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1722
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseBool)
1723
+ .action(actionRunner(databasesUpdateBooleanAttribute))
1724
+
1220
1725
  databases
1221
1726
  .command(`createDatetimeAttribute`)
1222
1727
  .description(``)
@@ -1228,6 +1733,16 @@ databases
1228
1733
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
1229
1734
  .action(actionRunner(databasesCreateDatetimeAttribute))
1230
1735
 
1736
+ databases
1737
+ .command(`updateDatetimeAttribute`)
1738
+ .description(``)
1739
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1740
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1741
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1742
+ .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1743
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1744
+ .action(actionRunner(databasesUpdateDatetimeAttribute))
1745
+
1231
1746
  databases
1232
1747
  .command(`createEmailAttribute`)
1233
1748
  .description(`Create an email attribute. `)
@@ -1239,18 +1754,39 @@ databases
1239
1754
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
1240
1755
  .action(actionRunner(databasesCreateEmailAttribute))
1241
1756
 
1757
+ databases
1758
+ .command(`updateEmailAttribute`)
1759
+ .description(`Update an email attribute. Changing the 'default' value will not update already existing documents. `)
1760
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1761
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1762
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1763
+ .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1764
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1765
+ .action(actionRunner(databasesUpdateEmailAttribute))
1766
+
1242
1767
  databases
1243
1768
  .command(`createEnumAttribute`)
1244
1769
  .description(``)
1245
1770
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1246
1771
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1247
1772
  .requiredOption(`--key <key>`, `Attribute Key.`)
1248
- .requiredOption(`--elements <elements...>`, `Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.`)
1773
+ .requiredOption(`--elements [elements...]`, `Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.`)
1249
1774
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1250
1775
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1251
1776
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
1252
1777
  .action(actionRunner(databasesCreateEnumAttribute))
1253
1778
 
1779
+ databases
1780
+ .command(`updateEnumAttribute`)
1781
+ .description(`Update an enum attribute. Changing the 'default' value will not update already existing documents. `)
1782
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1783
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1784
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1785
+ .requiredOption(`--elements [elements...]`, `Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.`)
1786
+ .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1787
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1788
+ .action(actionRunner(databasesUpdateEnumAttribute))
1789
+
1254
1790
  databases
1255
1791
  .command(`createFloatAttribute`)
1256
1792
  .description(`Create a float attribute. Optionally, minimum and maximum values can be provided. `)
@@ -1264,6 +1800,18 @@ databases
1264
1800
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
1265
1801
  .action(actionRunner(databasesCreateFloatAttribute))
1266
1802
 
1803
+ databases
1804
+ .command(`updateFloatAttribute`)
1805
+ .description(`Update a float attribute. Changing the 'default' value will not update already existing documents. `)
1806
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1807
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1808
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1809
+ .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1810
+ .requiredOption(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
1811
+ .requiredOption(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
1812
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
1813
+ .action(actionRunner(databasesUpdateFloatAttribute))
1814
+
1267
1815
  databases
1268
1816
  .command(`createIntegerAttribute`)
1269
1817
  .description(`Create an integer attribute. Optionally, minimum and maximum values can be provided. `)
@@ -1277,6 +1825,18 @@ databases
1277
1825
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
1278
1826
  .action(actionRunner(databasesCreateIntegerAttribute))
1279
1827
 
1828
+ databases
1829
+ .command(`updateIntegerAttribute`)
1830
+ .description(`Update an integer attribute. Changing the 'default' value will not update already existing documents. `)
1831
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1832
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1833
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1834
+ .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1835
+ .requiredOption(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
1836
+ .requiredOption(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
1837
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
1838
+ .action(actionRunner(databasesUpdateIntegerAttribute))
1839
+
1280
1840
  databases
1281
1841
  .command(`createIpAttribute`)
1282
1842
  .description(`Create IP address attribute. `)
@@ -1288,6 +1848,29 @@ databases
1288
1848
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
1289
1849
  .action(actionRunner(databasesCreateIpAttribute))
1290
1850
 
1851
+ databases
1852
+ .command(`updateIpAttribute`)
1853
+ .description(`Update an ip attribute. Changing the 'default' value will not update already existing documents. `)
1854
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1855
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1856
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1857
+ .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1858
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1859
+ .action(actionRunner(databasesUpdateIpAttribute))
1860
+
1861
+ databases
1862
+ .command(`createRelationshipAttribute`)
1863
+ .description(`Create relationship attribute. [Learn more about relationship attributes](docs/databases-relationships#relationship-attributes). `)
1864
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1865
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1866
+ .requiredOption(`--relatedCollectionId <relatedCollectionId>`, `Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1867
+ .requiredOption(`--type <type>`, `Relation type`)
1868
+ .option(`--twoWay <twoWay>`, `Is Two Way?`, parseBool)
1869
+ .option(`--key <key>`, `Attribute Key.`)
1870
+ .option(`--twoWayKey <twoWayKey>`, `Two Way Attribute Key.`)
1871
+ .option(`--onDelete <onDelete>`, `Constraints option`)
1872
+ .action(actionRunner(databasesCreateRelationshipAttribute))
1873
+
1291
1874
  databases
1292
1875
  .command(`createStringAttribute`)
1293
1876
  .description(`Create a string attribute. `)
@@ -1300,6 +1883,16 @@ databases
1300
1883
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
1301
1884
  .action(actionRunner(databasesCreateStringAttribute))
1302
1885
 
1886
+ databases
1887
+ .command(`updateStringAttribute`)
1888
+ .description(`Update a string attribute. Changing the 'default' value will not update already existing documents. `)
1889
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1890
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1891
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1892
+ .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1893
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1894
+ .action(actionRunner(databasesUpdateStringAttribute))
1895
+
1303
1896
  databases
1304
1897
  .command(`createUrlAttribute`)
1305
1898
  .description(`Create a URL attribute. `)
@@ -1311,6 +1904,16 @@ databases
1311
1904
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
1312
1905
  .action(actionRunner(databasesCreateUrlAttribute))
1313
1906
 
1907
+ databases
1908
+ .command(`updateUrlAttribute`)
1909
+ .description(`Update an url attribute. Changing the 'default' value will not update already existing documents. `)
1910
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1911
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1912
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1913
+ .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1914
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1915
+ .action(actionRunner(databasesUpdateUrlAttribute))
1916
+
1314
1917
  databases
1315
1918
  .command(`getAttribute`)
1316
1919
  .description(``)
@@ -1327,12 +1930,21 @@ databases
1327
1930
  .requiredOption(`--key <key>`, `Attribute Key.`)
1328
1931
  .action(actionRunner(databasesDeleteAttribute))
1329
1932
 
1933
+ databases
1934
+ .command(`updateRelationshipAttribute`)
1935
+ .description(`Update relationship attribute. [Learn more about relationship attributes](docs/databases-relationships#relationship-attributes). `)
1936
+ .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1937
+ .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1938
+ .requiredOption(`--key <key>`, `Attribute Key.`)
1939
+ .option(`--onDelete <onDelete>`, `Constraints option`)
1940
+ .action(actionRunner(databasesUpdateRelationshipAttribute))
1941
+
1330
1942
  databases
1331
1943
  .command(`listDocuments`)
1332
1944
  .description(`Get a list of all the user's documents in a given collection. You can use the query params to filter your results.`)
1333
1945
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1334
1946
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1335
- .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.`)
1947
+ .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.`)
1336
1948
  .action(actionRunner(databasesListDocuments))
1337
1949
 
1338
1950
  databases
@@ -1342,7 +1954,7 @@ databases
1342
1954
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`)
1343
1955
  .requiredOption(`--documentId <documentId>`, `Document 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.`)
1344
1956
  .requiredOption(`--data <data>`, `Document data as JSON object.`)
1345
- .option(`--permissions <permissions...>`, `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](/docs/permissions).`)
1957
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](/docs/permissions).`)
1346
1958
  .action(actionRunner(databasesCreateDocument))
1347
1959
 
1348
1960
  databases
@@ -1351,6 +1963,7 @@ databases
1351
1963
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1352
1964
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1353
1965
  .requiredOption(`--documentId <documentId>`, `Document ID.`)
1966
+ .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 method allowed is select.`)
1354
1967
  .action(actionRunner(databasesGetDocument))
1355
1968
 
1356
1969
  databases
@@ -1360,7 +1973,7 @@ databases
1360
1973
  .requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
1361
1974
  .requiredOption(`--documentId <documentId>`, `Document ID.`)
1362
1975
  .option(`--data <data>`, `Document data as JSON object. Include only attribute and value pairs to be updated.`)
1363
- .option(`--permissions <permissions...>`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).`)
1976
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).`)
1364
1977
  .action(actionRunner(databasesUpdateDocument))
1365
1978
 
1366
1979
  databases
@@ -1377,7 +1990,7 @@ databases
1377
1990
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1378
1991
  .requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
1379
1992
  .requiredOption(`--documentId <documentId>`, `Document ID.`)
1380
- .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`)
1993
+ .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`)
1381
1994
  .action(actionRunner(databasesListDocumentLogs))
1382
1995
 
1383
1996
  databases
@@ -1394,8 +2007,8 @@ databases
1394
2007
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1395
2008
  .requiredOption(`--key <key>`, `Index Key.`)
1396
2009
  .requiredOption(`--type <type>`, `Index type.`)
1397
- .requiredOption(`--attributes <attributes...>`, `Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.`)
1398
- .option(`--orders <orders...>`, `Array of index orders. Maximum of 100 orders are allowed.`)
2010
+ .requiredOption(`--attributes [attributes...]`, `Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.`)
2011
+ .option(`--orders [orders...]`, `Array of index orders. Maximum of 100 orders are allowed.`)
1399
2012
  .action(actionRunner(databasesCreateIndex))
1400
2013
 
1401
2014
  databases
@@ -1419,7 +2032,7 @@ databases
1419
2032
  .description(`Get the collection activity logs list by its unique ID.`)
1420
2033
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1421
2034
  .requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
1422
- .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`)
2035
+ .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`)
1423
2036
  .action(actionRunner(databasesListCollectionLogs))
1424
2037
 
1425
2038
  databases
@@ -1434,7 +2047,7 @@ databases
1434
2047
  .command(`listLogs`)
1435
2048
  .description(`Get the database activity logs list by its unique ID.`)
1436
2049
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1437
- .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`)
2050
+ .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`)
1438
2051
  .action(actionRunner(databasesListLogs))
1439
2052
 
1440
2053
  databases
@@ -1460,16 +2073,27 @@ module.exports = {
1460
2073
  databasesDeleteCollection,
1461
2074
  databasesListAttributes,
1462
2075
  databasesCreateBooleanAttribute,
2076
+ databasesUpdateBooleanAttribute,
1463
2077
  databasesCreateDatetimeAttribute,
2078
+ databasesUpdateDatetimeAttribute,
1464
2079
  databasesCreateEmailAttribute,
2080
+ databasesUpdateEmailAttribute,
1465
2081
  databasesCreateEnumAttribute,
2082
+ databasesUpdateEnumAttribute,
1466
2083
  databasesCreateFloatAttribute,
2084
+ databasesUpdateFloatAttribute,
1467
2085
  databasesCreateIntegerAttribute,
2086
+ databasesUpdateIntegerAttribute,
1468
2087
  databasesCreateIpAttribute,
2088
+ databasesUpdateIpAttribute,
2089
+ databasesCreateRelationshipAttribute,
1469
2090
  databasesCreateStringAttribute,
2091
+ databasesUpdateStringAttribute,
1470
2092
  databasesCreateUrlAttribute,
2093
+ databasesUpdateUrlAttribute,
1471
2094
  databasesGetAttribute,
1472
2095
  databasesDeleteAttribute,
2096
+ databasesUpdateRelationshipAttribute,
1473
2097
  databasesListDocuments,
1474
2098
  databasesCreateDocument,
1475
2099
  databasesGetDocument,