react-native-appwrite 0.7.0 → 0.7.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.
package/dist/cjs/sdk.js CHANGED
@@ -99,7 +99,7 @@ class Client {
99
99
  'x-sdk-name': 'React Native',
100
100
  'x-sdk-platform': 'client',
101
101
  'x-sdk-language': 'reactnative',
102
- 'x-sdk-version': '0.7.0',
102
+ 'x-sdk-version': '0.7.1',
103
103
  'X-Appwrite-Response-Format': '1.6.0',
104
104
  };
105
105
  this.realtime = {
@@ -411,6 +411,7 @@ class Client {
411
411
  try {
412
412
  let data = null;
413
413
  const response = yield fetch(url.toString(), options);
414
+ const text = yield response.text();
414
415
  const warnings = response.headers.get('x-appwrite-warning');
415
416
  if (warnings) {
416
417
  warnings.split(';').forEach((warning) => console.warn('Warning: ' + warning));
@@ -420,11 +421,11 @@ class Client {
420
421
  }
421
422
  else {
422
423
  data = {
423
- message: yield response.text()
424
+ message: text
424
425
  };
425
426
  }
426
427
  if (400 <= response.status) {
427
- throw new AppwriteException(data === null || data === void 0 ? void 0 : data.message, response.status, data === null || data === void 0 ? void 0 : data.type, data);
428
+ throw new AppwriteException(data === null || data === void 0 ? void 0 : data.message, response.status, data === null || data === void 0 ? void 0 : data.type, text);
428
429
  }
429
430
  const cookieFallback = response.headers.get('X-Fallback-Cookies');
430
431
  if (typeof window !== 'undefined' && window.localStorage && cookieFallback) {
@@ -448,26 +449,20 @@ class Account extends Service {
448
449
  super(client);
449
450
  }
450
451
  /**
451
- * Get account
452
- *
453
452
  * Get the currently logged in user.
454
453
  *
455
454
  * @throws {AppwriteException}
456
455
  * @returns {Promise}
457
456
  */
458
457
  get() {
459
- return __awaiter(this, void 0, void 0, function* () {
460
- const apiPath = '/account';
461
- const payload = {};
462
- const uri = new URL(this.client.config.endpoint + apiPath);
463
- return yield this.client.call('get', uri, {
464
- 'content-type': 'application/json',
465
- }, payload);
466
- });
458
+ const apiPath = '/account';
459
+ const payload = {};
460
+ const uri = new URL(this.client.config.endpoint + apiPath);
461
+ return this.client.call('get', uri, {
462
+ 'content-type': 'application/json',
463
+ }, payload);
467
464
  }
468
465
  /**
469
- * Create account
470
- *
471
466
  * Use this endpoint to allow a new user to register a new account in your
472
467
  * project. After the user registration completes successfully, you can use
473
468
  * the
@@ -484,39 +479,35 @@ class Account extends Service {
484
479
  * @returns {Promise}
485
480
  */
486
481
  create(userId, email, password, name) {
487
- return __awaiter(this, void 0, void 0, function* () {
488
- if (typeof userId === 'undefined') {
489
- throw new AppwriteException('Missing required parameter: "userId"');
490
- }
491
- if (typeof email === 'undefined') {
492
- throw new AppwriteException('Missing required parameter: "email"');
493
- }
494
- if (typeof password === 'undefined') {
495
- throw new AppwriteException('Missing required parameter: "password"');
496
- }
497
- const apiPath = '/account';
498
- const payload = {};
499
- if (typeof userId !== 'undefined') {
500
- payload['userId'] = userId;
501
- }
502
- if (typeof email !== 'undefined') {
503
- payload['email'] = email;
504
- }
505
- if (typeof password !== 'undefined') {
506
- payload['password'] = password;
507
- }
508
- if (typeof name !== 'undefined') {
509
- payload['name'] = name;
510
- }
511
- const uri = new URL(this.client.config.endpoint + apiPath);
512
- return yield this.client.call('post', uri, {
513
- 'content-type': 'application/json',
514
- }, payload);
515
- });
482
+ if (typeof userId === 'undefined') {
483
+ throw new AppwriteException('Missing required parameter: "userId"');
484
+ }
485
+ if (typeof email === 'undefined') {
486
+ throw new AppwriteException('Missing required parameter: "email"');
487
+ }
488
+ if (typeof password === 'undefined') {
489
+ throw new AppwriteException('Missing required parameter: "password"');
490
+ }
491
+ const apiPath = '/account';
492
+ const payload = {};
493
+ if (typeof userId !== 'undefined') {
494
+ payload['userId'] = userId;
495
+ }
496
+ if (typeof email !== 'undefined') {
497
+ payload['email'] = email;
498
+ }
499
+ if (typeof password !== 'undefined') {
500
+ payload['password'] = password;
501
+ }
502
+ if (typeof name !== 'undefined') {
503
+ payload['name'] = name;
504
+ }
505
+ const uri = new URL(this.client.config.endpoint + apiPath);
506
+ return this.client.call('post', uri, {
507
+ 'content-type': 'application/json',
508
+ }, payload);
516
509
  }
517
510
  /**
518
- * Update email
519
- *
520
511
  * Update currently logged in user account email address. After changing user
521
512
  * address, the user confirmation status will get reset. A new confirmation
522
513
  * email is not sent automatically however you can use the send confirmation
@@ -532,30 +523,26 @@ class Account extends Service {
532
523
  * @returns {Promise}
533
524
  */
534
525
  updateEmail(email, password) {
535
- return __awaiter(this, void 0, void 0, function* () {
536
- if (typeof email === 'undefined') {
537
- throw new AppwriteException('Missing required parameter: "email"');
538
- }
539
- if (typeof password === 'undefined') {
540
- throw new AppwriteException('Missing required parameter: "password"');
541
- }
542
- const apiPath = '/account/email';
543
- const payload = {};
544
- if (typeof email !== 'undefined') {
545
- payload['email'] = email;
546
- }
547
- if (typeof password !== 'undefined') {
548
- payload['password'] = password;
549
- }
550
- const uri = new URL(this.client.config.endpoint + apiPath);
551
- return yield this.client.call('patch', uri, {
552
- 'content-type': 'application/json',
553
- }, payload);
554
- });
526
+ if (typeof email === 'undefined') {
527
+ throw new AppwriteException('Missing required parameter: "email"');
528
+ }
529
+ if (typeof password === 'undefined') {
530
+ throw new AppwriteException('Missing required parameter: "password"');
531
+ }
532
+ const apiPath = '/account/email';
533
+ const payload = {};
534
+ if (typeof email !== 'undefined') {
535
+ payload['email'] = email;
536
+ }
537
+ if (typeof password !== 'undefined') {
538
+ payload['password'] = password;
539
+ }
540
+ const uri = new URL(this.client.config.endpoint + apiPath);
541
+ return this.client.call('patch', uri, {
542
+ 'content-type': 'application/json',
543
+ }, payload);
555
544
  }
556
545
  /**
557
- * List identities
558
- *
559
546
  * Get the list of identities for the currently logged in user.
560
547
  *
561
548
  * @param {string[]} queries
@@ -563,21 +550,17 @@ class Account extends Service {
563
550
  * @returns {Promise}
564
551
  */
565
552
  listIdentities(queries) {
566
- return __awaiter(this, void 0, void 0, function* () {
567
- const apiPath = '/account/identities';
568
- const payload = {};
569
- if (typeof queries !== 'undefined') {
570
- payload['queries'] = queries;
571
- }
572
- const uri = new URL(this.client.config.endpoint + apiPath);
573
- return yield this.client.call('get', uri, {
574
- 'content-type': 'application/json',
575
- }, payload);
576
- });
553
+ const apiPath = '/account/identities';
554
+ const payload = {};
555
+ if (typeof queries !== 'undefined') {
556
+ payload['queries'] = queries;
557
+ }
558
+ const uri = new URL(this.client.config.endpoint + apiPath);
559
+ return this.client.call('get', uri, {
560
+ 'content-type': 'application/json',
561
+ }, payload);
577
562
  }
578
563
  /**
579
- * Delete identity
580
- *
581
564
  * Delete an identity by its unique ID.
582
565
  *
583
566
  * @param {string} identityId
@@ -585,21 +568,17 @@ class Account extends Service {
585
568
  * @returns {Promise}
586
569
  */
587
570
  deleteIdentity(identityId) {
588
- return __awaiter(this, void 0, void 0, function* () {
589
- if (typeof identityId === 'undefined') {
590
- throw new AppwriteException('Missing required parameter: "identityId"');
591
- }
592
- const apiPath = '/account/identities/{identityId}'.replace('{identityId}', identityId);
593
- const payload = {};
594
- const uri = new URL(this.client.config.endpoint + apiPath);
595
- return yield this.client.call('delete', uri, {
596
- 'content-type': 'application/json',
597
- }, payload);
598
- });
571
+ if (typeof identityId === 'undefined') {
572
+ throw new AppwriteException('Missing required parameter: "identityId"');
573
+ }
574
+ const apiPath = '/account/identities/{identityId}'.replace('{identityId}', identityId);
575
+ const payload = {};
576
+ const uri = new URL(this.client.config.endpoint + apiPath);
577
+ return this.client.call('delete', uri, {
578
+ 'content-type': 'application/json',
579
+ }, payload);
599
580
  }
600
581
  /**
601
- * Create JWT
602
- *
603
582
  * Use this endpoint to create a JSON Web Token. You can use the resulting JWT
604
583
  * to authenticate on behalf of the current user when working with the
605
584
  * Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes
@@ -610,18 +589,14 @@ class Account extends Service {
610
589
  * @returns {Promise}
611
590
  */
612
591
  createJWT() {
613
- return __awaiter(this, void 0, void 0, function* () {
614
- const apiPath = '/account/jwts';
615
- const payload = {};
616
- const uri = new URL(this.client.config.endpoint + apiPath);
617
- return yield this.client.call('post', uri, {
618
- 'content-type': 'application/json',
619
- }, payload);
620
- });
592
+ const apiPath = '/account/jwts';
593
+ const payload = {};
594
+ const uri = new URL(this.client.config.endpoint + apiPath);
595
+ return this.client.call('post', uri, {
596
+ 'content-type': 'application/json',
597
+ }, payload);
621
598
  }
622
599
  /**
623
- * List logs
624
- *
625
600
  * Get the list of latest security activity logs for the currently logged in
626
601
  * user. Each log returns user IP address, location and date and time of log.
627
602
  *
@@ -630,21 +605,17 @@ class Account extends Service {
630
605
  * @returns {Promise}
631
606
  */
632
607
  listLogs(queries) {
633
- return __awaiter(this, void 0, void 0, function* () {
634
- const apiPath = '/account/logs';
635
- const payload = {};
636
- if (typeof queries !== 'undefined') {
637
- payload['queries'] = queries;
638
- }
639
- const uri = new URL(this.client.config.endpoint + apiPath);
640
- return yield this.client.call('get', uri, {
641
- 'content-type': 'application/json',
642
- }, payload);
643
- });
608
+ const apiPath = '/account/logs';
609
+ const payload = {};
610
+ if (typeof queries !== 'undefined') {
611
+ payload['queries'] = queries;
612
+ }
613
+ const uri = new URL(this.client.config.endpoint + apiPath);
614
+ return this.client.call('get', uri, {
615
+ 'content-type': 'application/json',
616
+ }, payload);
644
617
  }
645
618
  /**
646
- * Update MFA
647
- *
648
619
  * Enable or disable MFA on an account.
649
620
  *
650
621
  * @param {boolean} mfa
@@ -652,24 +623,20 @@ class Account extends Service {
652
623
  * @returns {Promise}
653
624
  */
654
625
  updateMFA(mfa) {
655
- return __awaiter(this, void 0, void 0, function* () {
656
- if (typeof mfa === 'undefined') {
657
- throw new AppwriteException('Missing required parameter: "mfa"');
658
- }
659
- const apiPath = '/account/mfa';
660
- const payload = {};
661
- if (typeof mfa !== 'undefined') {
662
- payload['mfa'] = mfa;
663
- }
664
- const uri = new URL(this.client.config.endpoint + apiPath);
665
- return yield this.client.call('patch', uri, {
666
- 'content-type': 'application/json',
667
- }, payload);
668
- });
626
+ if (typeof mfa === 'undefined') {
627
+ throw new AppwriteException('Missing required parameter: "mfa"');
628
+ }
629
+ const apiPath = '/account/mfa';
630
+ const payload = {};
631
+ if (typeof mfa !== 'undefined') {
632
+ payload['mfa'] = mfa;
633
+ }
634
+ const uri = new URL(this.client.config.endpoint + apiPath);
635
+ return this.client.call('patch', uri, {
636
+ 'content-type': 'application/json',
637
+ }, payload);
669
638
  }
670
639
  /**
671
- * Create authenticator
672
- *
673
640
  * Add an authenticator app to be used as an MFA factor. Verify the
674
641
  * authenticator using the [verify
675
642
  * authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator)
@@ -680,21 +647,17 @@ class Account extends Service {
680
647
  * @returns {Promise}
681
648
  */
682
649
  createMfaAuthenticator(type) {
683
- return __awaiter(this, void 0, void 0, function* () {
684
- if (typeof type === 'undefined') {
685
- throw new AppwriteException('Missing required parameter: "type"');
686
- }
687
- const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
688
- const payload = {};
689
- const uri = new URL(this.client.config.endpoint + apiPath);
690
- return yield this.client.call('post', uri, {
691
- 'content-type': 'application/json',
692
- }, payload);
693
- });
650
+ if (typeof type === 'undefined') {
651
+ throw new AppwriteException('Missing required parameter: "type"');
652
+ }
653
+ const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
654
+ const payload = {};
655
+ const uri = new URL(this.client.config.endpoint + apiPath);
656
+ return this.client.call('post', uri, {
657
+ 'content-type': 'application/json',
658
+ }, payload);
694
659
  }
695
660
  /**
696
- * Verify authenticator
697
- *
698
661
  * Verify an authenticator app after adding it using the [add
699
662
  * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
700
663
  * method.
@@ -705,27 +668,23 @@ class Account extends Service {
705
668
  * @returns {Promise}
706
669
  */
707
670
  updateMfaAuthenticator(type, otp) {
708
- return __awaiter(this, void 0, void 0, function* () {
709
- if (typeof type === 'undefined') {
710
- throw new AppwriteException('Missing required parameter: "type"');
711
- }
712
- if (typeof otp === 'undefined') {
713
- throw new AppwriteException('Missing required parameter: "otp"');
714
- }
715
- const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
716
- const payload = {};
717
- if (typeof otp !== 'undefined') {
718
- payload['otp'] = otp;
719
- }
720
- const uri = new URL(this.client.config.endpoint + apiPath);
721
- return yield this.client.call('put', uri, {
722
- 'content-type': 'application/json',
723
- }, payload);
724
- });
671
+ if (typeof type === 'undefined') {
672
+ throw new AppwriteException('Missing required parameter: "type"');
673
+ }
674
+ if (typeof otp === 'undefined') {
675
+ throw new AppwriteException('Missing required parameter: "otp"');
676
+ }
677
+ const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
678
+ const payload = {};
679
+ if (typeof otp !== 'undefined') {
680
+ payload['otp'] = otp;
681
+ }
682
+ const uri = new URL(this.client.config.endpoint + apiPath);
683
+ return this.client.call('put', uri, {
684
+ 'content-type': 'application/json',
685
+ }, payload);
725
686
  }
726
687
  /**
727
- * Delete authenticator
728
- *
729
688
  * Delete an authenticator for a user by ID.
730
689
  *
731
690
  * @param {AuthenticatorType} type
@@ -733,21 +692,17 @@ class Account extends Service {
733
692
  * @returns {Promise}
734
693
  */
735
694
  deleteMfaAuthenticator(type) {
736
- return __awaiter(this, void 0, void 0, function* () {
737
- if (typeof type === 'undefined') {
738
- throw new AppwriteException('Missing required parameter: "type"');
739
- }
740
- const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
741
- const payload = {};
742
- const uri = new URL(this.client.config.endpoint + apiPath);
743
- return yield this.client.call('delete', uri, {
744
- 'content-type': 'application/json',
745
- }, payload);
746
- });
695
+ if (typeof type === 'undefined') {
696
+ throw new AppwriteException('Missing required parameter: "type"');
697
+ }
698
+ const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
699
+ const payload = {};
700
+ const uri = new URL(this.client.config.endpoint + apiPath);
701
+ return this.client.call('delete', uri, {
702
+ 'content-type': 'application/json',
703
+ }, payload);
747
704
  }
748
705
  /**
749
- * Create MFA challenge
750
- *
751
706
  * Begin the process of MFA verification after sign-in. Finish the flow with
752
707
  * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
753
708
  * method.
@@ -757,24 +712,20 @@ class Account extends Service {
757
712
  * @returns {Promise}
758
713
  */
759
714
  createMfaChallenge(factor) {
760
- return __awaiter(this, void 0, void 0, function* () {
761
- if (typeof factor === 'undefined') {
762
- throw new AppwriteException('Missing required parameter: "factor"');
763
- }
764
- const apiPath = '/account/mfa/challenge';
765
- const payload = {};
766
- if (typeof factor !== 'undefined') {
767
- payload['factor'] = factor;
768
- }
769
- const uri = new URL(this.client.config.endpoint + apiPath);
770
- return yield this.client.call('post', uri, {
771
- 'content-type': 'application/json',
772
- }, payload);
773
- });
715
+ if (typeof factor === 'undefined') {
716
+ throw new AppwriteException('Missing required parameter: "factor"');
717
+ }
718
+ const apiPath = '/account/mfa/challenge';
719
+ const payload = {};
720
+ if (typeof factor !== 'undefined') {
721
+ payload['factor'] = factor;
722
+ }
723
+ const uri = new URL(this.client.config.endpoint + apiPath);
724
+ return this.client.call('post', uri, {
725
+ 'content-type': 'application/json',
726
+ }, payload);
774
727
  }
775
728
  /**
776
- * Create MFA challenge (confirmation)
777
- *
778
729
  * Complete the MFA challenge by providing the one-time password. Finish the
779
730
  * process of MFA verification by providing the one-time password. To begin
780
731
  * the flow, use
@@ -787,48 +738,40 @@ class Account extends Service {
787
738
  * @returns {Promise}
788
739
  */
789
740
  updateMfaChallenge(challengeId, otp) {
790
- return __awaiter(this, void 0, void 0, function* () {
791
- if (typeof challengeId === 'undefined') {
792
- throw new AppwriteException('Missing required parameter: "challengeId"');
793
- }
794
- if (typeof otp === 'undefined') {
795
- throw new AppwriteException('Missing required parameter: "otp"');
796
- }
797
- const apiPath = '/account/mfa/challenge';
798
- const payload = {};
799
- if (typeof challengeId !== 'undefined') {
800
- payload['challengeId'] = challengeId;
801
- }
802
- if (typeof otp !== 'undefined') {
803
- payload['otp'] = otp;
804
- }
805
- const uri = new URL(this.client.config.endpoint + apiPath);
806
- return yield this.client.call('put', uri, {
807
- 'content-type': 'application/json',
808
- }, payload);
809
- });
741
+ if (typeof challengeId === 'undefined') {
742
+ throw new AppwriteException('Missing required parameter: "challengeId"');
743
+ }
744
+ if (typeof otp === 'undefined') {
745
+ throw new AppwriteException('Missing required parameter: "otp"');
746
+ }
747
+ const apiPath = '/account/mfa/challenge';
748
+ const payload = {};
749
+ if (typeof challengeId !== 'undefined') {
750
+ payload['challengeId'] = challengeId;
751
+ }
752
+ if (typeof otp !== 'undefined') {
753
+ payload['otp'] = otp;
754
+ }
755
+ const uri = new URL(this.client.config.endpoint + apiPath);
756
+ return this.client.call('put', uri, {
757
+ 'content-type': 'application/json',
758
+ }, payload);
810
759
  }
811
760
  /**
812
- * List factors
813
- *
814
761
  * List the factors available on the account to be used as a MFA challange.
815
762
  *
816
763
  * @throws {AppwriteException}
817
764
  * @returns {Promise}
818
765
  */
819
766
  listMfaFactors() {
820
- return __awaiter(this, void 0, void 0, function* () {
821
- const apiPath = '/account/mfa/factors';
822
- const payload = {};
823
- const uri = new URL(this.client.config.endpoint + apiPath);
824
- return yield this.client.call('get', uri, {
825
- 'content-type': 'application/json',
826
- }, payload);
827
- });
767
+ const apiPath = '/account/mfa/factors';
768
+ const payload = {};
769
+ const uri = new URL(this.client.config.endpoint + apiPath);
770
+ return this.client.call('get', uri, {
771
+ 'content-type': 'application/json',
772
+ }, payload);
828
773
  }
829
774
  /**
830
- * Get MFA recovery codes
831
- *
832
775
  * Get recovery codes that can be used as backup for MFA flow. Before getting
833
776
  * codes, they must be generated using
834
777
  * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
@@ -838,18 +781,14 @@ class Account extends Service {
838
781
  * @returns {Promise}
839
782
  */
840
783
  getMfaRecoveryCodes() {
841
- return __awaiter(this, void 0, void 0, function* () {
842
- const apiPath = '/account/mfa/recovery-codes';
843
- const payload = {};
844
- const uri = new URL(this.client.config.endpoint + apiPath);
845
- return yield this.client.call('get', uri, {
846
- 'content-type': 'application/json',
847
- }, payload);
848
- });
784
+ const apiPath = '/account/mfa/recovery-codes';
785
+ const payload = {};
786
+ const uri = new URL(this.client.config.endpoint + apiPath);
787
+ return this.client.call('get', uri, {
788
+ 'content-type': 'application/json',
789
+ }, payload);
849
790
  }
850
791
  /**
851
- * Create MFA recovery codes
852
- *
853
792
  * Generate recovery codes as backup for MFA flow. It's recommended to
854
793
  * generate and show then immediately after user successfully adds their
855
794
  * authehticator. Recovery codes can be used as a MFA verification type in
@@ -860,18 +799,14 @@ class Account extends Service {
860
799
  * @returns {Promise}
861
800
  */
862
801
  createMfaRecoveryCodes() {
863
- return __awaiter(this, void 0, void 0, function* () {
864
- const apiPath = '/account/mfa/recovery-codes';
865
- const payload = {};
866
- const uri = new URL(this.client.config.endpoint + apiPath);
867
- return yield this.client.call('post', uri, {
868
- 'content-type': 'application/json',
869
- }, payload);
870
- });
802
+ const apiPath = '/account/mfa/recovery-codes';
803
+ const payload = {};
804
+ const uri = new URL(this.client.config.endpoint + apiPath);
805
+ return this.client.call('post', uri, {
806
+ 'content-type': 'application/json',
807
+ }, payload);
871
808
  }
872
809
  /**
873
- * Regenerate MFA recovery codes
874
- *
875
810
  * Regenerate recovery codes that can be used as backup for MFA flow. Before
876
811
  * regenerating codes, they must be first generated using
877
812
  * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
@@ -881,18 +816,14 @@ class Account extends Service {
881
816
  * @returns {Promise}
882
817
  */
883
818
  updateMfaRecoveryCodes() {
884
- return __awaiter(this, void 0, void 0, function* () {
885
- const apiPath = '/account/mfa/recovery-codes';
886
- const payload = {};
887
- const uri = new URL(this.client.config.endpoint + apiPath);
888
- return yield this.client.call('patch', uri, {
889
- 'content-type': 'application/json',
890
- }, payload);
891
- });
819
+ const apiPath = '/account/mfa/recovery-codes';
820
+ const payload = {};
821
+ const uri = new URL(this.client.config.endpoint + apiPath);
822
+ return this.client.call('patch', uri, {
823
+ 'content-type': 'application/json',
824
+ }, payload);
892
825
  }
893
826
  /**
894
- * Update name
895
- *
896
827
  * Update currently logged in user account name.
897
828
  *
898
829
  * @param {string} name
@@ -900,24 +831,20 @@ class Account extends Service {
900
831
  * @returns {Promise}
901
832
  */
902
833
  updateName(name) {
903
- return __awaiter(this, void 0, void 0, function* () {
904
- if (typeof name === 'undefined') {
905
- throw new AppwriteException('Missing required parameter: "name"');
906
- }
907
- const apiPath = '/account/name';
908
- const payload = {};
909
- if (typeof name !== 'undefined') {
910
- payload['name'] = name;
911
- }
912
- const uri = new URL(this.client.config.endpoint + apiPath);
913
- return yield this.client.call('patch', uri, {
914
- 'content-type': 'application/json',
915
- }, payload);
916
- });
834
+ if (typeof name === 'undefined') {
835
+ throw new AppwriteException('Missing required parameter: "name"');
836
+ }
837
+ const apiPath = '/account/name';
838
+ const payload = {};
839
+ if (typeof name !== 'undefined') {
840
+ payload['name'] = name;
841
+ }
842
+ const uri = new URL(this.client.config.endpoint + apiPath);
843
+ return this.client.call('patch', uri, {
844
+ 'content-type': 'application/json',
845
+ }, payload);
917
846
  }
918
847
  /**
919
- * Update password
920
- *
921
848
  * Update currently logged in user password. For validation, user is required
922
849
  * to pass in the new password, and the old password. For users created with
923
850
  * OAuth, Team Invites and Magic URL, oldPassword is optional.
@@ -928,27 +855,23 @@ class Account extends Service {
928
855
  * @returns {Promise}
929
856
  */
930
857
  updatePassword(password, oldPassword) {
931
- return __awaiter(this, void 0, void 0, function* () {
932
- if (typeof password === 'undefined') {
933
- throw new AppwriteException('Missing required parameter: "password"');
934
- }
935
- const apiPath = '/account/password';
936
- const payload = {};
937
- if (typeof password !== 'undefined') {
938
- payload['password'] = password;
939
- }
940
- if (typeof oldPassword !== 'undefined') {
941
- payload['oldPassword'] = oldPassword;
942
- }
943
- const uri = new URL(this.client.config.endpoint + apiPath);
944
- return yield this.client.call('patch', uri, {
945
- 'content-type': 'application/json',
946
- }, payload);
947
- });
858
+ if (typeof password === 'undefined') {
859
+ throw new AppwriteException('Missing required parameter: "password"');
860
+ }
861
+ const apiPath = '/account/password';
862
+ const payload = {};
863
+ if (typeof password !== 'undefined') {
864
+ payload['password'] = password;
865
+ }
866
+ if (typeof oldPassword !== 'undefined') {
867
+ payload['oldPassword'] = oldPassword;
868
+ }
869
+ const uri = new URL(this.client.config.endpoint + apiPath);
870
+ return this.client.call('patch', uri, {
871
+ 'content-type': 'application/json',
872
+ }, payload);
948
873
  }
949
874
  /**
950
- * Update phone
951
- *
952
875
  * Update the currently logged in user's phone number. After updating the
953
876
  * phone number, the phone verification status will be reset. A confirmation
954
877
  * SMS is not sent automatically, however you can use the [POST
@@ -961,48 +884,40 @@ class Account extends Service {
961
884
  * @returns {Promise}
962
885
  */
963
886
  updatePhone(phone, password) {
964
- return __awaiter(this, void 0, void 0, function* () {
965
- if (typeof phone === 'undefined') {
966
- throw new AppwriteException('Missing required parameter: "phone"');
967
- }
968
- if (typeof password === 'undefined') {
969
- throw new AppwriteException('Missing required parameter: "password"');
970
- }
971
- const apiPath = '/account/phone';
972
- const payload = {};
973
- if (typeof phone !== 'undefined') {
974
- payload['phone'] = phone;
975
- }
976
- if (typeof password !== 'undefined') {
977
- payload['password'] = password;
978
- }
979
- const uri = new URL(this.client.config.endpoint + apiPath);
980
- return yield this.client.call('patch', uri, {
981
- 'content-type': 'application/json',
982
- }, payload);
983
- });
887
+ if (typeof phone === 'undefined') {
888
+ throw new AppwriteException('Missing required parameter: "phone"');
889
+ }
890
+ if (typeof password === 'undefined') {
891
+ throw new AppwriteException('Missing required parameter: "password"');
892
+ }
893
+ const apiPath = '/account/phone';
894
+ const payload = {};
895
+ if (typeof phone !== 'undefined') {
896
+ payload['phone'] = phone;
897
+ }
898
+ if (typeof password !== 'undefined') {
899
+ payload['password'] = password;
900
+ }
901
+ const uri = new URL(this.client.config.endpoint + apiPath);
902
+ return this.client.call('patch', uri, {
903
+ 'content-type': 'application/json',
904
+ }, payload);
984
905
  }
985
906
  /**
986
- * Get account preferences
987
- *
988
907
  * Get the preferences as a key-value object for the currently logged in user.
989
908
  *
990
909
  * @throws {AppwriteException}
991
910
  * @returns {Promise}
992
911
  */
993
912
  getPrefs() {
994
- return __awaiter(this, void 0, void 0, function* () {
995
- const apiPath = '/account/prefs';
996
- const payload = {};
997
- const uri = new URL(this.client.config.endpoint + apiPath);
998
- return yield this.client.call('get', uri, {
999
- 'content-type': 'application/json',
1000
- }, payload);
1001
- });
913
+ const apiPath = '/account/prefs';
914
+ const payload = {};
915
+ const uri = new URL(this.client.config.endpoint + apiPath);
916
+ return this.client.call('get', uri, {
917
+ 'content-type': 'application/json',
918
+ }, payload);
1002
919
  }
1003
920
  /**
1004
- * Update preferences
1005
- *
1006
921
  * Update currently logged in user account preferences. The object you pass is
1007
922
  * stored as is, and replaces any previous value. The maximum allowed prefs
1008
923
  * size is 64kB and throws error if exceeded.
@@ -1012,24 +927,20 @@ class Account extends Service {
1012
927
  * @returns {Promise}
1013
928
  */
1014
929
  updatePrefs(prefs) {
1015
- return __awaiter(this, void 0, void 0, function* () {
1016
- if (typeof prefs === 'undefined') {
1017
- throw new AppwriteException('Missing required parameter: "prefs"');
1018
- }
1019
- const apiPath = '/account/prefs';
1020
- const payload = {};
1021
- if (typeof prefs !== 'undefined') {
1022
- payload['prefs'] = prefs;
1023
- }
1024
- const uri = new URL(this.client.config.endpoint + apiPath);
1025
- return yield this.client.call('patch', uri, {
1026
- 'content-type': 'application/json',
1027
- }, payload);
1028
- });
930
+ if (typeof prefs === 'undefined') {
931
+ throw new AppwriteException('Missing required parameter: "prefs"');
932
+ }
933
+ const apiPath = '/account/prefs';
934
+ const payload = {};
935
+ if (typeof prefs !== 'undefined') {
936
+ payload['prefs'] = prefs;
937
+ }
938
+ const uri = new URL(this.client.config.endpoint + apiPath);
939
+ return this.client.call('patch', uri, {
940
+ 'content-type': 'application/json',
941
+ }, payload);
1029
942
  }
1030
943
  /**
1031
- * Create password recovery
1032
- *
1033
944
  * Sends the user an email with a temporary secret key for password reset.
1034
945
  * When the user clicks the confirmation link he is redirected back to your
1035
946
  * app password reset URL with the secret key and email address values
@@ -1045,30 +956,26 @@ class Account extends Service {
1045
956
  * @returns {Promise}
1046
957
  */
1047
958
  createRecovery(email, url) {
1048
- return __awaiter(this, void 0, void 0, function* () {
1049
- if (typeof email === 'undefined') {
1050
- throw new AppwriteException('Missing required parameter: "email"');
1051
- }
1052
- if (typeof url === 'undefined') {
1053
- throw new AppwriteException('Missing required parameter: "url"');
1054
- }
1055
- const apiPath = '/account/recovery';
1056
- const payload = {};
1057
- if (typeof email !== 'undefined') {
1058
- payload['email'] = email;
1059
- }
1060
- if (typeof url !== 'undefined') {
1061
- payload['url'] = url;
1062
- }
1063
- const uri = new URL(this.client.config.endpoint + apiPath);
1064
- return yield this.client.call('post', uri, {
1065
- 'content-type': 'application/json',
1066
- }, payload);
1067
- });
959
+ if (typeof email === 'undefined') {
960
+ throw new AppwriteException('Missing required parameter: "email"');
961
+ }
962
+ if (typeof url === 'undefined') {
963
+ throw new AppwriteException('Missing required parameter: "url"');
964
+ }
965
+ const apiPath = '/account/recovery';
966
+ const payload = {};
967
+ if (typeof email !== 'undefined') {
968
+ payload['email'] = email;
969
+ }
970
+ if (typeof url !== 'undefined') {
971
+ payload['url'] = url;
972
+ }
973
+ const uri = new URL(this.client.config.endpoint + apiPath);
974
+ return this.client.call('post', uri, {
975
+ 'content-type': 'application/json',
976
+ }, payload);
1068
977
  }
1069
978
  /**
1070
- * Create password recovery (confirmation)
1071
- *
1072
979
  * Use this endpoint to complete the user account password reset. Both the
1073
980
  * **userId** and **secret** arguments will be passed as query parameters to
1074
981
  * the redirect URL you have provided when sending your request to the [POST
@@ -1087,55 +994,47 @@ class Account extends Service {
1087
994
  * @returns {Promise}
1088
995
  */
1089
996
  updateRecovery(userId, secret, password) {
1090
- return __awaiter(this, void 0, void 0, function* () {
1091
- if (typeof userId === 'undefined') {
1092
- throw new AppwriteException('Missing required parameter: "userId"');
1093
- }
1094
- if (typeof secret === 'undefined') {
1095
- throw new AppwriteException('Missing required parameter: "secret"');
1096
- }
1097
- if (typeof password === 'undefined') {
1098
- throw new AppwriteException('Missing required parameter: "password"');
1099
- }
1100
- const apiPath = '/account/recovery';
1101
- const payload = {};
1102
- if (typeof userId !== 'undefined') {
1103
- payload['userId'] = userId;
1104
- }
1105
- if (typeof secret !== 'undefined') {
1106
- payload['secret'] = secret;
1107
- }
1108
- if (typeof password !== 'undefined') {
1109
- payload['password'] = password;
1110
- }
1111
- const uri = new URL(this.client.config.endpoint + apiPath);
1112
- return yield this.client.call('put', uri, {
1113
- 'content-type': 'application/json',
1114
- }, payload);
1115
- });
997
+ if (typeof userId === 'undefined') {
998
+ throw new AppwriteException('Missing required parameter: "userId"');
999
+ }
1000
+ if (typeof secret === 'undefined') {
1001
+ throw new AppwriteException('Missing required parameter: "secret"');
1002
+ }
1003
+ if (typeof password === 'undefined') {
1004
+ throw new AppwriteException('Missing required parameter: "password"');
1005
+ }
1006
+ const apiPath = '/account/recovery';
1007
+ const payload = {};
1008
+ if (typeof userId !== 'undefined') {
1009
+ payload['userId'] = userId;
1010
+ }
1011
+ if (typeof secret !== 'undefined') {
1012
+ payload['secret'] = secret;
1013
+ }
1014
+ if (typeof password !== 'undefined') {
1015
+ payload['password'] = password;
1016
+ }
1017
+ const uri = new URL(this.client.config.endpoint + apiPath);
1018
+ return this.client.call('put', uri, {
1019
+ 'content-type': 'application/json',
1020
+ }, payload);
1116
1021
  }
1117
1022
  /**
1118
- * List sessions
1119
- *
1120
1023
  * Get the list of active sessions across different devices for the currently
1121
1024
  * logged in user.
1122
1025
  *
1123
1026
  * @throws {AppwriteException}
1124
- * @returns {Promise}
1125
- */
1126
- listSessions() {
1127
- return __awaiter(this, void 0, void 0, function* () {
1128
- const apiPath = '/account/sessions';
1129
- const payload = {};
1130
- const uri = new URL(this.client.config.endpoint + apiPath);
1131
- return yield this.client.call('get', uri, {
1132
- 'content-type': 'application/json',
1133
- }, payload);
1134
- });
1027
+ * @returns {Promise}
1028
+ */
1029
+ listSessions() {
1030
+ const apiPath = '/account/sessions';
1031
+ const payload = {};
1032
+ const uri = new URL(this.client.config.endpoint + apiPath);
1033
+ return this.client.call('get', uri, {
1034
+ 'content-type': 'application/json',
1035
+ }, payload);
1135
1036
  }
1136
1037
  /**
1137
- * Delete sessions
1138
- *
1139
1038
  * Delete all sessions from the user account and remove any sessions cookies
1140
1039
  * from the end client.
1141
1040
  *
@@ -1143,18 +1042,14 @@ class Account extends Service {
1143
1042
  * @returns {Promise}
1144
1043
  */
1145
1044
  deleteSessions() {
1146
- return __awaiter(this, void 0, void 0, function* () {
1147
- const apiPath = '/account/sessions';
1148
- const payload = {};
1149
- const uri = new URL(this.client.config.endpoint + apiPath);
1150
- return yield this.client.call('delete', uri, {
1151
- 'content-type': 'application/json',
1152
- }, payload);
1153
- });
1045
+ const apiPath = '/account/sessions';
1046
+ const payload = {};
1047
+ const uri = new URL(this.client.config.endpoint + apiPath);
1048
+ return this.client.call('delete', uri, {
1049
+ 'content-type': 'application/json',
1050
+ }, payload);
1154
1051
  }
1155
1052
  /**
1156
- * Create anonymous session
1157
- *
1158
1053
  * Use this endpoint to allow a new user to register an anonymous account in
1159
1054
  * your project. This route will also create a new session for the user. To
1160
1055
  * allow the new user to convert an anonymous account to a normal account, you
@@ -1167,18 +1062,14 @@ class Account extends Service {
1167
1062
  * @returns {Promise}
1168
1063
  */
1169
1064
  createAnonymousSession() {
1170
- return __awaiter(this, void 0, void 0, function* () {
1171
- const apiPath = '/account/sessions/anonymous';
1172
- const payload = {};
1173
- const uri = new URL(this.client.config.endpoint + apiPath);
1174
- return yield this.client.call('post', uri, {
1175
- 'content-type': 'application/json',
1176
- }, payload);
1177
- });
1065
+ const apiPath = '/account/sessions/anonymous';
1066
+ const payload = {};
1067
+ const uri = new URL(this.client.config.endpoint + apiPath);
1068
+ return this.client.call('post', uri, {
1069
+ 'content-type': 'application/json',
1070
+ }, payload);
1178
1071
  }
1179
1072
  /**
1180
- * Create email password session
1181
- *
1182
1073
  * Allow the user to login into their account by providing a valid email and
1183
1074
  * password combination. This route will create a new session for the user.
1184
1075
  *
@@ -1192,30 +1083,26 @@ class Account extends Service {
1192
1083
  * @returns {Promise}
1193
1084
  */
1194
1085
  createEmailPasswordSession(email, password) {
1195
- return __awaiter(this, void 0, void 0, function* () {
1196
- if (typeof email === 'undefined') {
1197
- throw new AppwriteException('Missing required parameter: "email"');
1198
- }
1199
- if (typeof password === 'undefined') {
1200
- throw new AppwriteException('Missing required parameter: "password"');
1201
- }
1202
- const apiPath = '/account/sessions/email';
1203
- const payload = {};
1204
- if (typeof email !== 'undefined') {
1205
- payload['email'] = email;
1206
- }
1207
- if (typeof password !== 'undefined') {
1208
- payload['password'] = password;
1209
- }
1210
- const uri = new URL(this.client.config.endpoint + apiPath);
1211
- return yield this.client.call('post', uri, {
1212
- 'content-type': 'application/json',
1213
- }, payload);
1214
- });
1086
+ if (typeof email === 'undefined') {
1087
+ throw new AppwriteException('Missing required parameter: "email"');
1088
+ }
1089
+ if (typeof password === 'undefined') {
1090
+ throw new AppwriteException('Missing required parameter: "password"');
1091
+ }
1092
+ const apiPath = '/account/sessions/email';
1093
+ const payload = {};
1094
+ if (typeof email !== 'undefined') {
1095
+ payload['email'] = email;
1096
+ }
1097
+ if (typeof password !== 'undefined') {
1098
+ payload['password'] = password;
1099
+ }
1100
+ const uri = new URL(this.client.config.endpoint + apiPath);
1101
+ return this.client.call('post', uri, {
1102
+ 'content-type': 'application/json',
1103
+ }, payload);
1215
1104
  }
1216
1105
  /**
1217
- * Update magic URL session
1218
- *
1219
1106
  * Use this endpoint to create a session from token. Provide the **userId**
1220
1107
  * and **secret** parameters from the successful response of authentication
1221
1108
  * flows initiated by token creation. For example, magic URL and phone login.
@@ -1226,30 +1113,26 @@ class Account extends Service {
1226
1113
  * @returns {Promise}
1227
1114
  */
1228
1115
  updateMagicURLSession(userId, secret) {
1229
- return __awaiter(this, void 0, void 0, function* () {
1230
- if (typeof userId === 'undefined') {
1231
- throw new AppwriteException('Missing required parameter: "userId"');
1232
- }
1233
- if (typeof secret === 'undefined') {
1234
- throw new AppwriteException('Missing required parameter: "secret"');
1235
- }
1236
- const apiPath = '/account/sessions/magic-url';
1237
- const payload = {};
1238
- if (typeof userId !== 'undefined') {
1239
- payload['userId'] = userId;
1240
- }
1241
- if (typeof secret !== 'undefined') {
1242
- payload['secret'] = secret;
1243
- }
1244
- const uri = new URL(this.client.config.endpoint + apiPath);
1245
- return yield this.client.call('put', uri, {
1246
- 'content-type': 'application/json',
1247
- }, payload);
1248
- });
1116
+ if (typeof userId === 'undefined') {
1117
+ throw new AppwriteException('Missing required parameter: "userId"');
1118
+ }
1119
+ if (typeof secret === 'undefined') {
1120
+ throw new AppwriteException('Missing required parameter: "secret"');
1121
+ }
1122
+ const apiPath = '/account/sessions/magic-url';
1123
+ const payload = {};
1124
+ if (typeof userId !== 'undefined') {
1125
+ payload['userId'] = userId;
1126
+ }
1127
+ if (typeof secret !== 'undefined') {
1128
+ payload['secret'] = secret;
1129
+ }
1130
+ const uri = new URL(this.client.config.endpoint + apiPath);
1131
+ return this.client.call('put', uri, {
1132
+ 'content-type': 'application/json',
1133
+ }, payload);
1249
1134
  }
1250
1135
  /**
1251
- * Create OAuth2 session
1252
- *
1253
1136
  * Allow the user to login to their account using the OAuth2 provider of their
1254
1137
  * choice. Each OAuth2 provider should be enabled from the Appwrite console
1255
1138
  * first. Use the success and failure arguments to provide a redirect URL's
@@ -1297,8 +1180,6 @@ class Account extends Service {
1297
1180
  return uri;
1298
1181
  }
1299
1182
  /**
1300
- * Update phone session
1301
- *
1302
1183
  * Use this endpoint to create a session from token. Provide the **userId**
1303
1184
  * and **secret** parameters from the successful response of authentication
1304
1185
  * flows initiated by token creation. For example, magic URL and phone login.
@@ -1309,30 +1190,26 @@ class Account extends Service {
1309
1190
  * @returns {Promise}
1310
1191
  */
1311
1192
  updatePhoneSession(userId, secret) {
1312
- return __awaiter(this, void 0, void 0, function* () {
1313
- if (typeof userId === 'undefined') {
1314
- throw new AppwriteException('Missing required parameter: "userId"');
1315
- }
1316
- if (typeof secret === 'undefined') {
1317
- throw new AppwriteException('Missing required parameter: "secret"');
1318
- }
1319
- const apiPath = '/account/sessions/phone';
1320
- const payload = {};
1321
- if (typeof userId !== 'undefined') {
1322
- payload['userId'] = userId;
1323
- }
1324
- if (typeof secret !== 'undefined') {
1325
- payload['secret'] = secret;
1326
- }
1327
- const uri = new URL(this.client.config.endpoint + apiPath);
1328
- return yield this.client.call('put', uri, {
1329
- 'content-type': 'application/json',
1330
- }, payload);
1331
- });
1193
+ if (typeof userId === 'undefined') {
1194
+ throw new AppwriteException('Missing required parameter: "userId"');
1195
+ }
1196
+ if (typeof secret === 'undefined') {
1197
+ throw new AppwriteException('Missing required parameter: "secret"');
1198
+ }
1199
+ const apiPath = '/account/sessions/phone';
1200
+ const payload = {};
1201
+ if (typeof userId !== 'undefined') {
1202
+ payload['userId'] = userId;
1203
+ }
1204
+ if (typeof secret !== 'undefined') {
1205
+ payload['secret'] = secret;
1206
+ }
1207
+ const uri = new URL(this.client.config.endpoint + apiPath);
1208
+ return this.client.call('put', uri, {
1209
+ 'content-type': 'application/json',
1210
+ }, payload);
1332
1211
  }
1333
1212
  /**
1334
- * Create session
1335
- *
1336
1213
  * Use this endpoint to create a session from token. Provide the **userId**
1337
1214
  * and **secret** parameters from the successful response of authentication
1338
1215
  * flows initiated by token creation. For example, magic URL and phone login.
@@ -1343,30 +1220,26 @@ class Account extends Service {
1343
1220
  * @returns {Promise}
1344
1221
  */
1345
1222
  createSession(userId, secret) {
1346
- return __awaiter(this, void 0, void 0, function* () {
1347
- if (typeof userId === 'undefined') {
1348
- throw new AppwriteException('Missing required parameter: "userId"');
1349
- }
1350
- if (typeof secret === 'undefined') {
1351
- throw new AppwriteException('Missing required parameter: "secret"');
1352
- }
1353
- const apiPath = '/account/sessions/token';
1354
- const payload = {};
1355
- if (typeof userId !== 'undefined') {
1356
- payload['userId'] = userId;
1357
- }
1358
- if (typeof secret !== 'undefined') {
1359
- payload['secret'] = secret;
1360
- }
1361
- const uri = new URL(this.client.config.endpoint + apiPath);
1362
- return yield this.client.call('post', uri, {
1363
- 'content-type': 'application/json',
1364
- }, payload);
1365
- });
1223
+ if (typeof userId === 'undefined') {
1224
+ throw new AppwriteException('Missing required parameter: "userId"');
1225
+ }
1226
+ if (typeof secret === 'undefined') {
1227
+ throw new AppwriteException('Missing required parameter: "secret"');
1228
+ }
1229
+ const apiPath = '/account/sessions/token';
1230
+ const payload = {};
1231
+ if (typeof userId !== 'undefined') {
1232
+ payload['userId'] = userId;
1233
+ }
1234
+ if (typeof secret !== 'undefined') {
1235
+ payload['secret'] = secret;
1236
+ }
1237
+ const uri = new URL(this.client.config.endpoint + apiPath);
1238
+ return this.client.call('post', uri, {
1239
+ 'content-type': 'application/json',
1240
+ }, payload);
1366
1241
  }
1367
1242
  /**
1368
- * Get session
1369
- *
1370
1243
  * Use this endpoint to get a logged in user's session using a Session ID.
1371
1244
  * Inputting 'current' will return the current session being used.
1372
1245
  *
@@ -1375,21 +1248,17 @@ class Account extends Service {
1375
1248
  * @returns {Promise}
1376
1249
  */
1377
1250
  getSession(sessionId) {
1378
- return __awaiter(this, void 0, void 0, function* () {
1379
- if (typeof sessionId === 'undefined') {
1380
- throw new AppwriteException('Missing required parameter: "sessionId"');
1381
- }
1382
- const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
1383
- const payload = {};
1384
- const uri = new URL(this.client.config.endpoint + apiPath);
1385
- return yield this.client.call('get', uri, {
1386
- 'content-type': 'application/json',
1387
- }, payload);
1388
- });
1251
+ if (typeof sessionId === 'undefined') {
1252
+ throw new AppwriteException('Missing required parameter: "sessionId"');
1253
+ }
1254
+ const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
1255
+ const payload = {};
1256
+ const uri = new URL(this.client.config.endpoint + apiPath);
1257
+ return this.client.call('get', uri, {
1258
+ 'content-type': 'application/json',
1259
+ }, payload);
1389
1260
  }
1390
1261
  /**
1391
- * Update session
1392
- *
1393
1262
  * Use this endpoint to extend a session's length. Extending a session is
1394
1263
  * useful when session expiry is short. If the session was created using an
1395
1264
  * OAuth provider, this endpoint refreshes the access token from the provider.
@@ -1399,21 +1268,17 @@ class Account extends Service {
1399
1268
  * @returns {Promise}
1400
1269
  */
1401
1270
  updateSession(sessionId) {
1402
- return __awaiter(this, void 0, void 0, function* () {
1403
- if (typeof sessionId === 'undefined') {
1404
- throw new AppwriteException('Missing required parameter: "sessionId"');
1405
- }
1406
- const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
1407
- const payload = {};
1408
- const uri = new URL(this.client.config.endpoint + apiPath);
1409
- return yield this.client.call('patch', uri, {
1410
- 'content-type': 'application/json',
1411
- }, payload);
1412
- });
1271
+ if (typeof sessionId === 'undefined') {
1272
+ throw new AppwriteException('Missing required parameter: "sessionId"');
1273
+ }
1274
+ const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
1275
+ const payload = {};
1276
+ const uri = new URL(this.client.config.endpoint + apiPath);
1277
+ return this.client.call('patch', uri, {
1278
+ 'content-type': 'application/json',
1279
+ }, payload);
1413
1280
  }
1414
1281
  /**
1415
- * Delete session
1416
- *
1417
1282
  * Logout the user. Use 'current' as the session ID to logout on this device,
1418
1283
  * use a session ID to logout on another device. If you're looking to logout
1419
1284
  * the user on all devices, use [Delete
@@ -1425,21 +1290,17 @@ class Account extends Service {
1425
1290
  * @returns {Promise}
1426
1291
  */
1427
1292
  deleteSession(sessionId) {
1428
- return __awaiter(this, void 0, void 0, function* () {
1429
- if (typeof sessionId === 'undefined') {
1430
- throw new AppwriteException('Missing required parameter: "sessionId"');
1431
- }
1432
- const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
1433
- const payload = {};
1434
- const uri = new URL(this.client.config.endpoint + apiPath);
1435
- return yield this.client.call('delete', uri, {
1436
- 'content-type': 'application/json',
1437
- }, payload);
1438
- });
1293
+ if (typeof sessionId === 'undefined') {
1294
+ throw new AppwriteException('Missing required parameter: "sessionId"');
1295
+ }
1296
+ const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
1297
+ const payload = {};
1298
+ const uri = new URL(this.client.config.endpoint + apiPath);
1299
+ return this.client.call('delete', uri, {
1300
+ 'content-type': 'application/json',
1301
+ }, payload);
1439
1302
  }
1440
1303
  /**
1441
- * Update status
1442
- *
1443
1304
  * Block the currently logged in user account. Behind the scene, the user
1444
1305
  * record is not deleted but permanently blocked from any access. To
1445
1306
  * completely delete a user, use the Users API instead.
@@ -1448,18 +1309,14 @@ class Account extends Service {
1448
1309
  * @returns {Promise}
1449
1310
  */
1450
1311
  updateStatus() {
1451
- return __awaiter(this, void 0, void 0, function* () {
1452
- const apiPath = '/account/status';
1453
- const payload = {};
1454
- const uri = new URL(this.client.config.endpoint + apiPath);
1455
- return yield this.client.call('patch', uri, {
1456
- 'content-type': 'application/json',
1457
- }, payload);
1458
- });
1312
+ const apiPath = '/account/status';
1313
+ const payload = {};
1314
+ const uri = new URL(this.client.config.endpoint + apiPath);
1315
+ return this.client.call('patch', uri, {
1316
+ 'content-type': 'application/json',
1317
+ }, payload);
1459
1318
  }
1460
1319
  /**
1461
- * Create push target
1462
- *
1463
1320
  * Use this endpoint to register a device for push notifications. Provide a
1464
1321
  * target ID (custom or generated using ID.unique()), a device identifier
1465
1322
  * (usually a device token), and optionally specify which provider should send
@@ -1473,33 +1330,29 @@ class Account extends Service {
1473
1330
  * @returns {Promise}
1474
1331
  */
1475
1332
  createPushTarget(targetId, identifier, providerId) {
1476
- return __awaiter(this, void 0, void 0, function* () {
1477
- if (typeof targetId === 'undefined') {
1478
- throw new AppwriteException('Missing required parameter: "targetId"');
1479
- }
1480
- if (typeof identifier === 'undefined') {
1481
- throw new AppwriteException('Missing required parameter: "identifier"');
1482
- }
1483
- const apiPath = '/account/targets/push';
1484
- const payload = {};
1485
- if (typeof targetId !== 'undefined') {
1486
- payload['targetId'] = targetId;
1487
- }
1488
- if (typeof identifier !== 'undefined') {
1489
- payload['identifier'] = identifier;
1490
- }
1491
- if (typeof providerId !== 'undefined') {
1492
- payload['providerId'] = providerId;
1493
- }
1494
- const uri = new URL(this.client.config.endpoint + apiPath);
1495
- return yield this.client.call('post', uri, {
1496
- 'content-type': 'application/json',
1497
- }, payload);
1498
- });
1333
+ if (typeof targetId === 'undefined') {
1334
+ throw new AppwriteException('Missing required parameter: "targetId"');
1335
+ }
1336
+ if (typeof identifier === 'undefined') {
1337
+ throw new AppwriteException('Missing required parameter: "identifier"');
1338
+ }
1339
+ const apiPath = '/account/targets/push';
1340
+ const payload = {};
1341
+ if (typeof targetId !== 'undefined') {
1342
+ payload['targetId'] = targetId;
1343
+ }
1344
+ if (typeof identifier !== 'undefined') {
1345
+ payload['identifier'] = identifier;
1346
+ }
1347
+ if (typeof providerId !== 'undefined') {
1348
+ payload['providerId'] = providerId;
1349
+ }
1350
+ const uri = new URL(this.client.config.endpoint + apiPath);
1351
+ return this.client.call('post', uri, {
1352
+ 'content-type': 'application/json',
1353
+ }, payload);
1499
1354
  }
1500
1355
  /**
1501
- * Update push target
1502
- *
1503
1356
  * Update the currently logged in user's push notification target. You can
1504
1357
  * modify the target's identifier (device token) and provider ID (token,
1505
1358
  * email, phone etc.). The target must exist and belong to the current user.
@@ -1512,27 +1365,23 @@ class Account extends Service {
1512
1365
  * @returns {Promise}
1513
1366
  */
1514
1367
  updatePushTarget(targetId, identifier) {
1515
- return __awaiter(this, void 0, void 0, function* () {
1516
- if (typeof targetId === 'undefined') {
1517
- throw new AppwriteException('Missing required parameter: "targetId"');
1518
- }
1519
- if (typeof identifier === 'undefined') {
1520
- throw new AppwriteException('Missing required parameter: "identifier"');
1521
- }
1522
- const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId);
1523
- const payload = {};
1524
- if (typeof identifier !== 'undefined') {
1525
- payload['identifier'] = identifier;
1526
- }
1527
- const uri = new URL(this.client.config.endpoint + apiPath);
1528
- return yield this.client.call('put', uri, {
1529
- 'content-type': 'application/json',
1530
- }, payload);
1531
- });
1368
+ if (typeof targetId === 'undefined') {
1369
+ throw new AppwriteException('Missing required parameter: "targetId"');
1370
+ }
1371
+ if (typeof identifier === 'undefined') {
1372
+ throw new AppwriteException('Missing required parameter: "identifier"');
1373
+ }
1374
+ const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId);
1375
+ const payload = {};
1376
+ if (typeof identifier !== 'undefined') {
1377
+ payload['identifier'] = identifier;
1378
+ }
1379
+ const uri = new URL(this.client.config.endpoint + apiPath);
1380
+ return this.client.call('put', uri, {
1381
+ 'content-type': 'application/json',
1382
+ }, payload);
1532
1383
  }
1533
1384
  /**
1534
- * Delete push target
1535
- *
1536
1385
  * Delete a push notification target for the currently logged in user. After
1537
1386
  * deletion, the device will no longer receive push notifications. The target
1538
1387
  * must exist and belong to the current user.
@@ -1542,21 +1391,17 @@ class Account extends Service {
1542
1391
  * @returns {Promise}
1543
1392
  */
1544
1393
  deletePushTarget(targetId) {
1545
- return __awaiter(this, void 0, void 0, function* () {
1546
- if (typeof targetId === 'undefined') {
1547
- throw new AppwriteException('Missing required parameter: "targetId"');
1548
- }
1549
- const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId);
1550
- const payload = {};
1551
- const uri = new URL(this.client.config.endpoint + apiPath);
1552
- return yield this.client.call('delete', uri, {
1553
- 'content-type': 'application/json',
1554
- }, payload);
1555
- });
1394
+ if (typeof targetId === 'undefined') {
1395
+ throw new AppwriteException('Missing required parameter: "targetId"');
1396
+ }
1397
+ const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId);
1398
+ const payload = {};
1399
+ const uri = new URL(this.client.config.endpoint + apiPath);
1400
+ return this.client.call('delete', uri, {
1401
+ 'content-type': 'application/json',
1402
+ }, payload);
1556
1403
  }
1557
1404
  /**
1558
- * Create email token (OTP)
1559
- *
1560
1405
  * Sends the user an email with a secret key for creating a session. If the
1561
1406
  * provided user ID has not be registered, a new user will be created. Use the
1562
1407
  * returned user ID and secret and submit a request to the [POST
@@ -1575,33 +1420,29 @@ class Account extends Service {
1575
1420
  * @returns {Promise}
1576
1421
  */
1577
1422
  createEmailToken(userId, email, phrase) {
1578
- return __awaiter(this, void 0, void 0, function* () {
1579
- if (typeof userId === 'undefined') {
1580
- throw new AppwriteException('Missing required parameter: "userId"');
1581
- }
1582
- if (typeof email === 'undefined') {
1583
- throw new AppwriteException('Missing required parameter: "email"');
1584
- }
1585
- const apiPath = '/account/tokens/email';
1586
- const payload = {};
1587
- if (typeof userId !== 'undefined') {
1588
- payload['userId'] = userId;
1589
- }
1590
- if (typeof email !== 'undefined') {
1591
- payload['email'] = email;
1592
- }
1593
- if (typeof phrase !== 'undefined') {
1594
- payload['phrase'] = phrase;
1595
- }
1596
- const uri = new URL(this.client.config.endpoint + apiPath);
1597
- return yield this.client.call('post', uri, {
1598
- 'content-type': 'application/json',
1599
- }, payload);
1600
- });
1423
+ if (typeof userId === 'undefined') {
1424
+ throw new AppwriteException('Missing required parameter: "userId"');
1425
+ }
1426
+ if (typeof email === 'undefined') {
1427
+ throw new AppwriteException('Missing required parameter: "email"');
1428
+ }
1429
+ const apiPath = '/account/tokens/email';
1430
+ const payload = {};
1431
+ if (typeof userId !== 'undefined') {
1432
+ payload['userId'] = userId;
1433
+ }
1434
+ if (typeof email !== 'undefined') {
1435
+ payload['email'] = email;
1436
+ }
1437
+ if (typeof phrase !== 'undefined') {
1438
+ payload['phrase'] = phrase;
1439
+ }
1440
+ const uri = new URL(this.client.config.endpoint + apiPath);
1441
+ return this.client.call('post', uri, {
1442
+ 'content-type': 'application/json',
1443
+ }, payload);
1601
1444
  }
1602
1445
  /**
1603
- * Create magic URL token
1604
- *
1605
1446
  * Sends the user an email with a secret key for creating a session. If the
1606
1447
  * provided user ID has not been registered, a new user will be created. When
1607
1448
  * the user clicks the link in the email, the user is redirected back to the
@@ -1625,36 +1466,32 @@ class Account extends Service {
1625
1466
  * @returns {Promise}
1626
1467
  */
1627
1468
  createMagicURLToken(userId, email, url, phrase) {
1628
- return __awaiter(this, void 0, void 0, function* () {
1629
- if (typeof userId === 'undefined') {
1630
- throw new AppwriteException('Missing required parameter: "userId"');
1631
- }
1632
- if (typeof email === 'undefined') {
1633
- throw new AppwriteException('Missing required parameter: "email"');
1634
- }
1635
- const apiPath = '/account/tokens/magic-url';
1636
- const payload = {};
1637
- if (typeof userId !== 'undefined') {
1638
- payload['userId'] = userId;
1639
- }
1640
- if (typeof email !== 'undefined') {
1641
- payload['email'] = email;
1642
- }
1643
- if (typeof url !== 'undefined') {
1644
- payload['url'] = url;
1645
- }
1646
- if (typeof phrase !== 'undefined') {
1647
- payload['phrase'] = phrase;
1648
- }
1649
- const uri = new URL(this.client.config.endpoint + apiPath);
1650
- return yield this.client.call('post', uri, {
1651
- 'content-type': 'application/json',
1652
- }, payload);
1653
- });
1469
+ if (typeof userId === 'undefined') {
1470
+ throw new AppwriteException('Missing required parameter: "userId"');
1471
+ }
1472
+ if (typeof email === 'undefined') {
1473
+ throw new AppwriteException('Missing required parameter: "email"');
1474
+ }
1475
+ const apiPath = '/account/tokens/magic-url';
1476
+ const payload = {};
1477
+ if (typeof userId !== 'undefined') {
1478
+ payload['userId'] = userId;
1479
+ }
1480
+ if (typeof email !== 'undefined') {
1481
+ payload['email'] = email;
1482
+ }
1483
+ if (typeof url !== 'undefined') {
1484
+ payload['url'] = url;
1485
+ }
1486
+ if (typeof phrase !== 'undefined') {
1487
+ payload['phrase'] = phrase;
1488
+ }
1489
+ const uri = new URL(this.client.config.endpoint + apiPath);
1490
+ return this.client.call('post', uri, {
1491
+ 'content-type': 'application/json',
1492
+ }, payload);
1654
1493
  }
1655
1494
  /**
1656
- * Create OAuth2 token
1657
- *
1658
1495
  * Allow the user to login to their account using the OAuth2 provider of their
1659
1496
  * choice. Each OAuth2 provider should be enabled from the Appwrite console
1660
1497
  * first. Use the success and failure arguments to provide a redirect URL's
@@ -1700,8 +1537,6 @@ class Account extends Service {
1700
1537
  return uri;
1701
1538
  }
1702
1539
  /**
1703
- * Create phone token
1704
- *
1705
1540
  * Sends the user an SMS with a secret key for creating a session. If the
1706
1541
  * provided user ID has not be registered, a new user will be created. Use the
1707
1542
  * returned user ID and secret and submit a request to the [POST
@@ -1719,30 +1554,26 @@ class Account extends Service {
1719
1554
  * @returns {Promise}
1720
1555
  */
1721
1556
  createPhoneToken(userId, phone) {
1722
- return __awaiter(this, void 0, void 0, function* () {
1723
- if (typeof userId === 'undefined') {
1724
- throw new AppwriteException('Missing required parameter: "userId"');
1725
- }
1726
- if (typeof phone === 'undefined') {
1727
- throw new AppwriteException('Missing required parameter: "phone"');
1728
- }
1729
- const apiPath = '/account/tokens/phone';
1730
- const payload = {};
1731
- if (typeof userId !== 'undefined') {
1732
- payload['userId'] = userId;
1733
- }
1734
- if (typeof phone !== 'undefined') {
1735
- payload['phone'] = phone;
1736
- }
1737
- const uri = new URL(this.client.config.endpoint + apiPath);
1738
- return yield this.client.call('post', uri, {
1739
- 'content-type': 'application/json',
1740
- }, payload);
1741
- });
1557
+ if (typeof userId === 'undefined') {
1558
+ throw new AppwriteException('Missing required parameter: "userId"');
1559
+ }
1560
+ if (typeof phone === 'undefined') {
1561
+ throw new AppwriteException('Missing required parameter: "phone"');
1562
+ }
1563
+ const apiPath = '/account/tokens/phone';
1564
+ const payload = {};
1565
+ if (typeof userId !== 'undefined') {
1566
+ payload['userId'] = userId;
1567
+ }
1568
+ if (typeof phone !== 'undefined') {
1569
+ payload['phone'] = phone;
1570
+ }
1571
+ const uri = new URL(this.client.config.endpoint + apiPath);
1572
+ return this.client.call('post', uri, {
1573
+ 'content-type': 'application/json',
1574
+ }, payload);
1742
1575
  }
1743
1576
  /**
1744
- * Create email verification
1745
- *
1746
1577
  * Use this endpoint to send a verification message to your user email address
1747
1578
  * to confirm they are the valid owners of that address. Both the **userId**
1748
1579
  * and **secret** arguments will be passed as query parameters to the URL you
@@ -1764,24 +1595,20 @@ class Account extends Service {
1764
1595
  * @returns {Promise}
1765
1596
  */
1766
1597
  createVerification(url) {
1767
- return __awaiter(this, void 0, void 0, function* () {
1768
- if (typeof url === 'undefined') {
1769
- throw new AppwriteException('Missing required parameter: "url"');
1770
- }
1771
- const apiPath = '/account/verification';
1772
- const payload = {};
1773
- if (typeof url !== 'undefined') {
1774
- payload['url'] = url;
1775
- }
1776
- const uri = new URL(this.client.config.endpoint + apiPath);
1777
- return yield this.client.call('post', uri, {
1778
- 'content-type': 'application/json',
1779
- }, payload);
1780
- });
1598
+ if (typeof url === 'undefined') {
1599
+ throw new AppwriteException('Missing required parameter: "url"');
1600
+ }
1601
+ const apiPath = '/account/verification';
1602
+ const payload = {};
1603
+ if (typeof url !== 'undefined') {
1604
+ payload['url'] = url;
1605
+ }
1606
+ const uri = new URL(this.client.config.endpoint + apiPath);
1607
+ return this.client.call('post', uri, {
1608
+ 'content-type': 'application/json',
1609
+ }, payload);
1781
1610
  }
1782
1611
  /**
1783
- * Create email verification (confirmation)
1784
- *
1785
1612
  * Use this endpoint to complete the user email verification process. Use both
1786
1613
  * the **userId** and **secret** parameters that were attached to your app URL
1787
1614
  * to verify the user email ownership. If confirmed this route will return a
@@ -1793,30 +1620,26 @@ class Account extends Service {
1793
1620
  * @returns {Promise}
1794
1621
  */
1795
1622
  updateVerification(userId, secret) {
1796
- return __awaiter(this, void 0, void 0, function* () {
1797
- if (typeof userId === 'undefined') {
1798
- throw new AppwriteException('Missing required parameter: "userId"');
1799
- }
1800
- if (typeof secret === 'undefined') {
1801
- throw new AppwriteException('Missing required parameter: "secret"');
1802
- }
1803
- const apiPath = '/account/verification';
1804
- const payload = {};
1805
- if (typeof userId !== 'undefined') {
1806
- payload['userId'] = userId;
1807
- }
1808
- if (typeof secret !== 'undefined') {
1809
- payload['secret'] = secret;
1810
- }
1811
- const uri = new URL(this.client.config.endpoint + apiPath);
1812
- return yield this.client.call('put', uri, {
1813
- 'content-type': 'application/json',
1814
- }, payload);
1815
- });
1623
+ if (typeof userId === 'undefined') {
1624
+ throw new AppwriteException('Missing required parameter: "userId"');
1625
+ }
1626
+ if (typeof secret === 'undefined') {
1627
+ throw new AppwriteException('Missing required parameter: "secret"');
1628
+ }
1629
+ const apiPath = '/account/verification';
1630
+ const payload = {};
1631
+ if (typeof userId !== 'undefined') {
1632
+ payload['userId'] = userId;
1633
+ }
1634
+ if (typeof secret !== 'undefined') {
1635
+ payload['secret'] = secret;
1636
+ }
1637
+ const uri = new URL(this.client.config.endpoint + apiPath);
1638
+ return this.client.call('put', uri, {
1639
+ 'content-type': 'application/json',
1640
+ }, payload);
1816
1641
  }
1817
1642
  /**
1818
- * Create phone verification
1819
- *
1820
1643
  * Use this endpoint to send a verification SMS to the currently logged in
1821
1644
  * user. This endpoint is meant for use after updating a user's phone number
1822
1645
  * using the
@@ -1830,18 +1653,14 @@ class Account extends Service {
1830
1653
  * @returns {Promise}
1831
1654
  */
1832
1655
  createPhoneVerification() {
1833
- return __awaiter(this, void 0, void 0, function* () {
1834
- const apiPath = '/account/verification/phone';
1835
- const payload = {};
1836
- const uri = new URL(this.client.config.endpoint + apiPath);
1837
- return yield this.client.call('post', uri, {
1838
- 'content-type': 'application/json',
1839
- }, payload);
1840
- });
1656
+ const apiPath = '/account/verification/phone';
1657
+ const payload = {};
1658
+ const uri = new URL(this.client.config.endpoint + apiPath);
1659
+ return this.client.call('post', uri, {
1660
+ 'content-type': 'application/json',
1661
+ }, payload);
1841
1662
  }
1842
1663
  /**
1843
- * Update phone verification (confirmation)
1844
- *
1845
1664
  * Use this endpoint to complete the user phone verification process. Use the
1846
1665
  * **userId** and **secret** that were sent to your user's phone number to
1847
1666
  * verify the user email ownership. If confirmed this route will return a 200
@@ -1853,26 +1672,24 @@ class Account extends Service {
1853
1672
  * @returns {Promise}
1854
1673
  */
1855
1674
  updatePhoneVerification(userId, secret) {
1856
- return __awaiter(this, void 0, void 0, function* () {
1857
- if (typeof userId === 'undefined') {
1858
- throw new AppwriteException('Missing required parameter: "userId"');
1859
- }
1860
- if (typeof secret === 'undefined') {
1861
- throw new AppwriteException('Missing required parameter: "secret"');
1862
- }
1863
- const apiPath = '/account/verification/phone';
1864
- const payload = {};
1865
- if (typeof userId !== 'undefined') {
1866
- payload['userId'] = userId;
1867
- }
1868
- if (typeof secret !== 'undefined') {
1869
- payload['secret'] = secret;
1870
- }
1871
- const uri = new URL(this.client.config.endpoint + apiPath);
1872
- return yield this.client.call('put', uri, {
1873
- 'content-type': 'application/json',
1874
- }, payload);
1875
- });
1675
+ if (typeof userId === 'undefined') {
1676
+ throw new AppwriteException('Missing required parameter: "userId"');
1677
+ }
1678
+ if (typeof secret === 'undefined') {
1679
+ throw new AppwriteException('Missing required parameter: "secret"');
1680
+ }
1681
+ const apiPath = '/account/verification/phone';
1682
+ const payload = {};
1683
+ if (typeof userId !== 'undefined') {
1684
+ payload['userId'] = userId;
1685
+ }
1686
+ if (typeof secret !== 'undefined') {
1687
+ payload['secret'] = secret;
1688
+ }
1689
+ const uri = new URL(this.client.config.endpoint + apiPath);
1690
+ return this.client.call('put', uri, {
1691
+ 'content-type': 'application/json',
1692
+ }, payload);
1876
1693
  }
1877
1694
  }
1878
1695
 
@@ -1881,8 +1698,6 @@ class Avatars extends Service {
1881
1698
  super(client);
1882
1699
  }
1883
1700
  /**
1884
- * Get browser icon
1885
- *
1886
1701
  * You can use this endpoint to show different browser icons to your users.
1887
1702
  * The code argument receives the browser code as it appears in your user [GET
1888
1703
  * /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
@@ -1924,8 +1739,6 @@ class Avatars extends Service {
1924
1739
  return uri;
1925
1740
  }
1926
1741
  /**
1927
- * Get credit card icon
1928
- *
1929
1742
  * The credit card endpoint will return you the icon of the credit card
1930
1743
  * provider you need. Use width, height and quality arguments to change the
1931
1744
  * output settings.
@@ -1966,8 +1779,6 @@ class Avatars extends Service {
1966
1779
  return uri;
1967
1780
  }
1968
1781
  /**
1969
- * Get favicon
1970
- *
1971
1782
  * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
1972
1783
  * website URL.
1973
1784
  *
@@ -1994,8 +1805,6 @@ class Avatars extends Service {
1994
1805
  return uri;
1995
1806
  }
1996
1807
  /**
1997
- * Get country flag
1998
- *
1999
1808
  * You can use this endpoint to show different country flags icons to your
2000
1809
  * users. The code argument receives the 2 letter country code. Use width,
2001
1810
  * height and quality arguments to change the output settings. Country codes
@@ -2037,8 +1846,6 @@ class Avatars extends Service {
2037
1846
  return uri;
2038
1847
  }
2039
1848
  /**
2040
- * Get image from URL
2041
- *
2042
1849
  * Use this endpoint to fetch a remote image URL and crop it to any image size
2043
1850
  * you want. This endpoint is very useful if you need to crop and display
2044
1851
  * remote images in your app or in case you want to make sure a 3rd party
@@ -2080,8 +1887,6 @@ class Avatars extends Service {
2080
1887
  return uri;
2081
1888
  }
2082
1889
  /**
2083
- * Get user initials
2084
- *
2085
1890
  * Use this endpoint to show your user initials avatar icon on your website or
2086
1891
  * app. By default, this route will try to print your logged-in user name or
2087
1892
  * email initials. You can also overwrite the user name if you pass the 'name'
@@ -2129,8 +1934,6 @@ class Avatars extends Service {
2129
1934
  return uri;
2130
1935
  }
2131
1936
  /**
2132
- * Get QR code
2133
- *
2134
1937
  * Converts a given plain text to a QR code image. You can use the query
2135
1938
  * parameters to change the size and style of the resulting image.
2136
1939
  *
@@ -2174,8 +1977,6 @@ class Databases extends Service {
2174
1977
  super(client);
2175
1978
  }
2176
1979
  /**
2177
- * List documents
2178
- *
2179
1980
  * Get a list of all the user's documents in a given collection. You can use
2180
1981
  * the query params to filter your results.
2181
1982
  *
@@ -2186,27 +1987,23 @@ class Databases extends Service {
2186
1987
  * @returns {Promise}
2187
1988
  */
2188
1989
  listDocuments(databaseId, collectionId, queries) {
2189
- return __awaiter(this, void 0, void 0, function* () {
2190
- if (typeof databaseId === 'undefined') {
2191
- throw new AppwriteException('Missing required parameter: "databaseId"');
2192
- }
2193
- if (typeof collectionId === 'undefined') {
2194
- throw new AppwriteException('Missing required parameter: "collectionId"');
2195
- }
2196
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2197
- const payload = {};
2198
- if (typeof queries !== 'undefined') {
2199
- payload['queries'] = queries;
2200
- }
2201
- const uri = new URL(this.client.config.endpoint + apiPath);
2202
- return yield this.client.call('get', uri, {
2203
- 'content-type': 'application/json',
2204
- }, payload);
2205
- });
1990
+ if (typeof databaseId === 'undefined') {
1991
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1992
+ }
1993
+ if (typeof collectionId === 'undefined') {
1994
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1995
+ }
1996
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1997
+ const payload = {};
1998
+ if (typeof queries !== 'undefined') {
1999
+ payload['queries'] = queries;
2000
+ }
2001
+ const uri = new URL(this.client.config.endpoint + apiPath);
2002
+ return this.client.call('get', uri, {
2003
+ 'content-type': 'application/json',
2004
+ }, payload);
2206
2005
  }
2207
2006
  /**
2208
- * Create document
2209
- *
2210
2007
  * Create a new Document. Before using this route, you should create a new
2211
2008
  * collection resource using either a [server
2212
2009
  * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
@@ -2221,39 +2018,35 @@ class Databases extends Service {
2221
2018
  * @returns {Promise}
2222
2019
  */
2223
2020
  createDocument(databaseId, collectionId, documentId, data, permissions) {
2224
- return __awaiter(this, void 0, void 0, function* () {
2225
- if (typeof databaseId === 'undefined') {
2226
- throw new AppwriteException('Missing required parameter: "databaseId"');
2227
- }
2228
- if (typeof collectionId === 'undefined') {
2229
- throw new AppwriteException('Missing required parameter: "collectionId"');
2230
- }
2231
- if (typeof documentId === 'undefined') {
2232
- throw new AppwriteException('Missing required parameter: "documentId"');
2233
- }
2234
- if (typeof data === 'undefined') {
2235
- throw new AppwriteException('Missing required parameter: "data"');
2236
- }
2237
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2238
- const payload = {};
2239
- if (typeof documentId !== 'undefined') {
2240
- payload['documentId'] = documentId;
2241
- }
2242
- if (typeof data !== 'undefined') {
2243
- payload['data'] = data;
2244
- }
2245
- if (typeof permissions !== 'undefined') {
2246
- payload['permissions'] = permissions;
2247
- }
2248
- const uri = new URL(this.client.config.endpoint + apiPath);
2249
- return yield this.client.call('post', uri, {
2250
- 'content-type': 'application/json',
2251
- }, payload);
2252
- });
2021
+ if (typeof databaseId === 'undefined') {
2022
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2023
+ }
2024
+ if (typeof collectionId === 'undefined') {
2025
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2026
+ }
2027
+ if (typeof documentId === 'undefined') {
2028
+ throw new AppwriteException('Missing required parameter: "documentId"');
2029
+ }
2030
+ if (typeof data === 'undefined') {
2031
+ throw new AppwriteException('Missing required parameter: "data"');
2032
+ }
2033
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2034
+ const payload = {};
2035
+ if (typeof documentId !== 'undefined') {
2036
+ payload['documentId'] = documentId;
2037
+ }
2038
+ if (typeof data !== 'undefined') {
2039
+ payload['data'] = data;
2040
+ }
2041
+ if (typeof permissions !== 'undefined') {
2042
+ payload['permissions'] = permissions;
2043
+ }
2044
+ const uri = new URL(this.client.config.endpoint + apiPath);
2045
+ return this.client.call('post', uri, {
2046
+ 'content-type': 'application/json',
2047
+ }, payload);
2253
2048
  }
2254
2049
  /**
2255
- * Get document
2256
- *
2257
2050
  * Get a document by its unique ID. This endpoint response returns a JSON
2258
2051
  * object with the document data.
2259
2052
  *
@@ -2265,30 +2058,26 @@ class Databases extends Service {
2265
2058
  * @returns {Promise}
2266
2059
  */
2267
2060
  getDocument(databaseId, collectionId, documentId, queries) {
2268
- return __awaiter(this, void 0, void 0, function* () {
2269
- if (typeof databaseId === 'undefined') {
2270
- throw new AppwriteException('Missing required parameter: "databaseId"');
2271
- }
2272
- if (typeof collectionId === 'undefined') {
2273
- throw new AppwriteException('Missing required parameter: "collectionId"');
2274
- }
2275
- if (typeof documentId === 'undefined') {
2276
- throw new AppwriteException('Missing required parameter: "documentId"');
2277
- }
2278
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2279
- const payload = {};
2280
- if (typeof queries !== 'undefined') {
2281
- payload['queries'] = queries;
2282
- }
2283
- const uri = new URL(this.client.config.endpoint + apiPath);
2284
- return yield this.client.call('get', uri, {
2285
- 'content-type': 'application/json',
2286
- }, payload);
2287
- });
2061
+ if (typeof databaseId === 'undefined') {
2062
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2063
+ }
2064
+ if (typeof collectionId === 'undefined') {
2065
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2066
+ }
2067
+ if (typeof documentId === 'undefined') {
2068
+ throw new AppwriteException('Missing required parameter: "documentId"');
2069
+ }
2070
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2071
+ const payload = {};
2072
+ if (typeof queries !== 'undefined') {
2073
+ payload['queries'] = queries;
2074
+ }
2075
+ const uri = new URL(this.client.config.endpoint + apiPath);
2076
+ return this.client.call('get', uri, {
2077
+ 'content-type': 'application/json',
2078
+ }, payload);
2288
2079
  }
2289
2080
  /**
2290
- * Update document
2291
- *
2292
2081
  * Update a document by its unique ID. Using the patch method you can pass
2293
2082
  * only specific fields that will get updated.
2294
2083
  *
@@ -2301,33 +2090,29 @@ class Databases extends Service {
2301
2090
  * @returns {Promise}
2302
2091
  */
2303
2092
  updateDocument(databaseId, collectionId, documentId, data, permissions) {
2304
- return __awaiter(this, void 0, void 0, function* () {
2305
- if (typeof databaseId === 'undefined') {
2306
- throw new AppwriteException('Missing required parameter: "databaseId"');
2307
- }
2308
- if (typeof collectionId === 'undefined') {
2309
- throw new AppwriteException('Missing required parameter: "collectionId"');
2310
- }
2311
- if (typeof documentId === 'undefined') {
2312
- throw new AppwriteException('Missing required parameter: "documentId"');
2313
- }
2314
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2315
- const payload = {};
2316
- if (typeof data !== 'undefined') {
2317
- payload['data'] = data;
2318
- }
2319
- if (typeof permissions !== 'undefined') {
2320
- payload['permissions'] = permissions;
2321
- }
2322
- const uri = new URL(this.client.config.endpoint + apiPath);
2323
- return yield this.client.call('patch', uri, {
2324
- 'content-type': 'application/json',
2325
- }, payload);
2326
- });
2093
+ if (typeof databaseId === 'undefined') {
2094
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2095
+ }
2096
+ if (typeof collectionId === 'undefined') {
2097
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2098
+ }
2099
+ if (typeof documentId === 'undefined') {
2100
+ throw new AppwriteException('Missing required parameter: "documentId"');
2101
+ }
2102
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2103
+ const payload = {};
2104
+ if (typeof data !== 'undefined') {
2105
+ payload['data'] = data;
2106
+ }
2107
+ if (typeof permissions !== 'undefined') {
2108
+ payload['permissions'] = permissions;
2109
+ }
2110
+ const uri = new URL(this.client.config.endpoint + apiPath);
2111
+ return this.client.call('patch', uri, {
2112
+ 'content-type': 'application/json',
2113
+ }, payload);
2327
2114
  }
2328
2115
  /**
2329
- * Delete document
2330
- *
2331
2116
  * Delete a document by its unique ID.
2332
2117
  *
2333
2118
  * @param {string} databaseId
@@ -2337,23 +2122,21 @@ class Databases extends Service {
2337
2122
  * @returns {Promise}
2338
2123
  */
2339
2124
  deleteDocument(databaseId, collectionId, documentId) {
2340
- return __awaiter(this, void 0, void 0, function* () {
2341
- if (typeof databaseId === 'undefined') {
2342
- throw new AppwriteException('Missing required parameter: "databaseId"');
2343
- }
2344
- if (typeof collectionId === 'undefined') {
2345
- throw new AppwriteException('Missing required parameter: "collectionId"');
2346
- }
2347
- if (typeof documentId === 'undefined') {
2348
- throw new AppwriteException('Missing required parameter: "documentId"');
2349
- }
2350
- const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2351
- const payload = {};
2352
- const uri = new URL(this.client.config.endpoint + apiPath);
2353
- return yield this.client.call('delete', uri, {
2354
- 'content-type': 'application/json',
2355
- }, payload);
2356
- });
2125
+ if (typeof databaseId === 'undefined') {
2126
+ throw new AppwriteException('Missing required parameter: "databaseId"');
2127
+ }
2128
+ if (typeof collectionId === 'undefined') {
2129
+ throw new AppwriteException('Missing required parameter: "collectionId"');
2130
+ }
2131
+ if (typeof documentId === 'undefined') {
2132
+ throw new AppwriteException('Missing required parameter: "documentId"');
2133
+ }
2134
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2135
+ const payload = {};
2136
+ const uri = new URL(this.client.config.endpoint + apiPath);
2137
+ return this.client.call('delete', uri, {
2138
+ 'content-type': 'application/json',
2139
+ }, payload);
2357
2140
  }
2358
2141
  }
2359
2142
 
@@ -2362,8 +2145,6 @@ class Functions extends Service {
2362
2145
  super(client);
2363
2146
  }
2364
2147
  /**
2365
- * List executions
2366
- *
2367
2148
  * Get a list of all the current user function execution logs. You can use the
2368
2149
  * query params to filter your results.
2369
2150
  *
@@ -2374,27 +2155,23 @@ class Functions extends Service {
2374
2155
  * @returns {Promise}
2375
2156
  */
2376
2157
  listExecutions(functionId, queries, search) {
2377
- return __awaiter(this, void 0, void 0, function* () {
2378
- if (typeof functionId === 'undefined') {
2379
- throw new AppwriteException('Missing required parameter: "functionId"');
2380
- }
2381
- const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
2382
- const payload = {};
2383
- if (typeof queries !== 'undefined') {
2384
- payload['queries'] = queries;
2385
- }
2386
- if (typeof search !== 'undefined') {
2387
- payload['search'] = search;
2388
- }
2389
- const uri = new URL(this.client.config.endpoint + apiPath);
2390
- return yield this.client.call('get', uri, {
2391
- 'content-type': 'application/json',
2392
- }, payload);
2393
- });
2158
+ if (typeof functionId === 'undefined') {
2159
+ throw new AppwriteException('Missing required parameter: "functionId"');
2160
+ }
2161
+ const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
2162
+ const payload = {};
2163
+ if (typeof queries !== 'undefined') {
2164
+ payload['queries'] = queries;
2165
+ }
2166
+ if (typeof search !== 'undefined') {
2167
+ payload['search'] = search;
2168
+ }
2169
+ const uri = new URL(this.client.config.endpoint + apiPath);
2170
+ return this.client.call('get', uri, {
2171
+ 'content-type': 'application/json',
2172
+ }, payload);
2394
2173
  }
2395
2174
  /**
2396
- * Create execution
2397
- *
2398
2175
  * Trigger a function execution. The returned object will return you the
2399
2176
  * current execution status. You can ping the `Get Execution` endpoint to get
2400
2177
  * updates on the current execution status. Once this endpoint is called, your
@@ -2411,39 +2188,35 @@ class Functions extends Service {
2411
2188
  * @returns {Promise}
2412
2189
  */
2413
2190
  createExecution(functionId, body, async, xpath, method, headers, scheduledAt) {
2414
- return __awaiter(this, void 0, void 0, function* () {
2415
- if (typeof functionId === 'undefined') {
2416
- throw new AppwriteException('Missing required parameter: "functionId"');
2417
- }
2418
- const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
2419
- const payload = {};
2420
- if (typeof body !== 'undefined') {
2421
- payload['body'] = body;
2422
- }
2423
- if (typeof async !== 'undefined') {
2424
- payload['async'] = async;
2425
- }
2426
- if (typeof xpath !== 'undefined') {
2427
- payload['path'] = xpath;
2428
- }
2429
- if (typeof method !== 'undefined') {
2430
- payload['method'] = method;
2431
- }
2432
- if (typeof headers !== 'undefined') {
2433
- payload['headers'] = headers;
2434
- }
2435
- if (typeof scheduledAt !== 'undefined') {
2436
- payload['scheduledAt'] = scheduledAt;
2437
- }
2438
- const uri = new URL(this.client.config.endpoint + apiPath);
2439
- return yield this.client.call('post', uri, {
2440
- 'content-type': 'application/json',
2441
- }, payload);
2442
- });
2191
+ if (typeof functionId === 'undefined') {
2192
+ throw new AppwriteException('Missing required parameter: "functionId"');
2193
+ }
2194
+ const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
2195
+ const payload = {};
2196
+ if (typeof body !== 'undefined') {
2197
+ payload['body'] = body;
2198
+ }
2199
+ if (typeof async !== 'undefined') {
2200
+ payload['async'] = async;
2201
+ }
2202
+ if (typeof xpath !== 'undefined') {
2203
+ payload['path'] = xpath;
2204
+ }
2205
+ if (typeof method !== 'undefined') {
2206
+ payload['method'] = method;
2207
+ }
2208
+ if (typeof headers !== 'undefined') {
2209
+ payload['headers'] = headers;
2210
+ }
2211
+ if (typeof scheduledAt !== 'undefined') {
2212
+ payload['scheduledAt'] = scheduledAt;
2213
+ }
2214
+ const uri = new URL(this.client.config.endpoint + apiPath);
2215
+ return this.client.call('post', uri, {
2216
+ 'content-type': 'application/json',
2217
+ }, payload);
2443
2218
  }
2444
2219
  /**
2445
- * Get execution
2446
- *
2447
2220
  * Get a function execution log by its unique ID.
2448
2221
  *
2449
2222
  * @param {string} functionId
@@ -2452,20 +2225,18 @@ class Functions extends Service {
2452
2225
  * @returns {Promise}
2453
2226
  */
2454
2227
  getExecution(functionId, executionId) {
2455
- return __awaiter(this, void 0, void 0, function* () {
2456
- if (typeof functionId === 'undefined') {
2457
- throw new AppwriteException('Missing required parameter: "functionId"');
2458
- }
2459
- if (typeof executionId === 'undefined') {
2460
- throw new AppwriteException('Missing required parameter: "executionId"');
2461
- }
2462
- const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
2463
- const payload = {};
2464
- const uri = new URL(this.client.config.endpoint + apiPath);
2465
- return yield this.client.call('get', uri, {
2466
- 'content-type': 'application/json',
2467
- }, payload);
2468
- });
2228
+ if (typeof functionId === 'undefined') {
2229
+ throw new AppwriteException('Missing required parameter: "functionId"');
2230
+ }
2231
+ if (typeof executionId === 'undefined') {
2232
+ throw new AppwriteException('Missing required parameter: "executionId"');
2233
+ }
2234
+ const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
2235
+ const payload = {};
2236
+ const uri = new URL(this.client.config.endpoint + apiPath);
2237
+ return this.client.call('get', uri, {
2238
+ 'content-type': 'application/json',
2239
+ }, payload);
2469
2240
  }
2470
2241
  }
2471
2242
 
@@ -2474,8 +2245,6 @@ class Graphql extends Service {
2474
2245
  super(client);
2475
2246
  }
2476
2247
  /**
2477
- * GraphQL endpoint
2478
- *
2479
2248
  * Execute a GraphQL mutation.
2480
2249
  *
2481
2250
  * @param {object} query
@@ -2483,25 +2252,21 @@ class Graphql extends Service {
2483
2252
  * @returns {Promise}
2484
2253
  */
2485
2254
  query(query) {
2486
- return __awaiter(this, void 0, void 0, function* () {
2487
- if (typeof query === 'undefined') {
2488
- throw new AppwriteException('Missing required parameter: "query"');
2489
- }
2490
- const apiPath = '/graphql';
2491
- const payload = {};
2492
- if (typeof query !== 'undefined') {
2493
- payload['query'] = query;
2494
- }
2495
- const uri = new URL(this.client.config.endpoint + apiPath);
2496
- return yield this.client.call('post', uri, {
2497
- 'x-sdk-graphql': 'true',
2498
- 'content-type': 'application/json',
2499
- }, payload);
2500
- });
2255
+ if (typeof query === 'undefined') {
2256
+ throw new AppwriteException('Missing required parameter: "query"');
2257
+ }
2258
+ const apiPath = '/graphql';
2259
+ const payload = {};
2260
+ if (typeof query !== 'undefined') {
2261
+ payload['query'] = query;
2262
+ }
2263
+ const uri = new URL(this.client.config.endpoint + apiPath);
2264
+ return this.client.call('post', uri, {
2265
+ 'x-sdk-graphql': 'true',
2266
+ 'content-type': 'application/json',
2267
+ }, payload);
2501
2268
  }
2502
2269
  /**
2503
- * GraphQL endpoint
2504
- *
2505
2270
  * Execute a GraphQL mutation.
2506
2271
  *
2507
2272
  * @param {object} query
@@ -2509,21 +2274,19 @@ class Graphql extends Service {
2509
2274
  * @returns {Promise}
2510
2275
  */
2511
2276
  mutation(query) {
2512
- return __awaiter(this, void 0, void 0, function* () {
2513
- if (typeof query === 'undefined') {
2514
- throw new AppwriteException('Missing required parameter: "query"');
2515
- }
2516
- const apiPath = '/graphql/mutation';
2517
- const payload = {};
2518
- if (typeof query !== 'undefined') {
2519
- payload['query'] = query;
2520
- }
2521
- const uri = new URL(this.client.config.endpoint + apiPath);
2522
- return yield this.client.call('post', uri, {
2523
- 'x-sdk-graphql': 'true',
2524
- 'content-type': 'application/json',
2525
- }, payload);
2526
- });
2277
+ if (typeof query === 'undefined') {
2278
+ throw new AppwriteException('Missing required parameter: "query"');
2279
+ }
2280
+ const apiPath = '/graphql/mutation';
2281
+ const payload = {};
2282
+ if (typeof query !== 'undefined') {
2283
+ payload['query'] = query;
2284
+ }
2285
+ const uri = new URL(this.client.config.endpoint + apiPath);
2286
+ return this.client.call('post', uri, {
2287
+ 'x-sdk-graphql': 'true',
2288
+ 'content-type': 'application/json',
2289
+ }, payload);
2527
2290
  }
2528
2291
  }
2529
2292
 
@@ -2532,8 +2295,6 @@ class Locale extends Service {
2532
2295
  super(client);
2533
2296
  }
2534
2297
  /**
2535
- * Get user locale
2536
- *
2537
2298
  * Get the current user location based on IP. Returns an object with user
2538
2299
  * country code, country name, continent name, continent code, ip address and
2539
2300
  * suggested currency. You can use the locale header to get the data in a
@@ -2545,18 +2306,14 @@ class Locale extends Service {
2545
2306
  * @returns {Promise}
2546
2307
  */
2547
2308
  get() {
2548
- return __awaiter(this, void 0, void 0, function* () {
2549
- const apiPath = '/locale';
2550
- const payload = {};
2551
- const uri = new URL(this.client.config.endpoint + apiPath);
2552
- return yield this.client.call('get', uri, {
2553
- 'content-type': 'application/json',
2554
- }, payload);
2555
- });
2309
+ const apiPath = '/locale';
2310
+ const payload = {};
2311
+ const uri = new URL(this.client.config.endpoint + apiPath);
2312
+ return this.client.call('get', uri, {
2313
+ 'content-type': 'application/json',
2314
+ }, payload);
2556
2315
  }
2557
2316
  /**
2558
- * List locale codes
2559
- *
2560
2317
  * List of all locale codes in [ISO
2561
2318
  * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
2562
2319
  *
@@ -2564,18 +2321,14 @@ class Locale extends Service {
2564
2321
  * @returns {Promise}
2565
2322
  */
2566
2323
  listCodes() {
2567
- return __awaiter(this, void 0, void 0, function* () {
2568
- const apiPath = '/locale/codes';
2569
- const payload = {};
2570
- const uri = new URL(this.client.config.endpoint + apiPath);
2571
- return yield this.client.call('get', uri, {
2572
- 'content-type': 'application/json',
2573
- }, payload);
2574
- });
2324
+ const apiPath = '/locale/codes';
2325
+ const payload = {};
2326
+ const uri = new URL(this.client.config.endpoint + apiPath);
2327
+ return this.client.call('get', uri, {
2328
+ 'content-type': 'application/json',
2329
+ }, payload);
2575
2330
  }
2576
2331
  /**
2577
- * List continents
2578
- *
2579
2332
  * List of all continents. You can use the locale header to get the data in a
2580
2333
  * supported language.
2581
2334
  *
@@ -2583,18 +2336,14 @@ class Locale extends Service {
2583
2336
  * @returns {Promise}
2584
2337
  */
2585
2338
  listContinents() {
2586
- return __awaiter(this, void 0, void 0, function* () {
2587
- const apiPath = '/locale/continents';
2588
- const payload = {};
2589
- const uri = new URL(this.client.config.endpoint + apiPath);
2590
- return yield this.client.call('get', uri, {
2591
- 'content-type': 'application/json',
2592
- }, payload);
2593
- });
2339
+ const apiPath = '/locale/continents';
2340
+ const payload = {};
2341
+ const uri = new URL(this.client.config.endpoint + apiPath);
2342
+ return this.client.call('get', uri, {
2343
+ 'content-type': 'application/json',
2344
+ }, payload);
2594
2345
  }
2595
2346
  /**
2596
- * List countries
2597
- *
2598
2347
  * List of all countries. You can use the locale header to get the data in a
2599
2348
  * supported language.
2600
2349
  *
@@ -2602,18 +2351,14 @@ class Locale extends Service {
2602
2351
  * @returns {Promise}
2603
2352
  */
2604
2353
  listCountries() {
2605
- return __awaiter(this, void 0, void 0, function* () {
2606
- const apiPath = '/locale/countries';
2607
- const payload = {};
2608
- const uri = new URL(this.client.config.endpoint + apiPath);
2609
- return yield this.client.call('get', uri, {
2610
- 'content-type': 'application/json',
2611
- }, payload);
2612
- });
2354
+ const apiPath = '/locale/countries';
2355
+ const payload = {};
2356
+ const uri = new URL(this.client.config.endpoint + apiPath);
2357
+ return this.client.call('get', uri, {
2358
+ 'content-type': 'application/json',
2359
+ }, payload);
2613
2360
  }
2614
2361
  /**
2615
- * List EU countries
2616
- *
2617
2362
  * List of all countries that are currently members of the EU. You can use the
2618
2363
  * locale header to get the data in a supported language.
2619
2364
  *
@@ -2621,18 +2366,14 @@ class Locale extends Service {
2621
2366
  * @returns {Promise}
2622
2367
  */
2623
2368
  listCountriesEU() {
2624
- return __awaiter(this, void 0, void 0, function* () {
2625
- const apiPath = '/locale/countries/eu';
2626
- const payload = {};
2627
- const uri = new URL(this.client.config.endpoint + apiPath);
2628
- return yield this.client.call('get', uri, {
2629
- 'content-type': 'application/json',
2630
- }, payload);
2631
- });
2369
+ const apiPath = '/locale/countries/eu';
2370
+ const payload = {};
2371
+ const uri = new URL(this.client.config.endpoint + apiPath);
2372
+ return this.client.call('get', uri, {
2373
+ 'content-type': 'application/json',
2374
+ }, payload);
2632
2375
  }
2633
2376
  /**
2634
- * List countries phone codes
2635
- *
2636
2377
  * List of all countries phone codes. You can use the locale header to get the
2637
2378
  * data in a supported language.
2638
2379
  *
@@ -2640,18 +2381,14 @@ class Locale extends Service {
2640
2381
  * @returns {Promise}
2641
2382
  */
2642
2383
  listCountriesPhones() {
2643
- return __awaiter(this, void 0, void 0, function* () {
2644
- const apiPath = '/locale/countries/phones';
2645
- const payload = {};
2646
- const uri = new URL(this.client.config.endpoint + apiPath);
2647
- return yield this.client.call('get', uri, {
2648
- 'content-type': 'application/json',
2649
- }, payload);
2650
- });
2384
+ const apiPath = '/locale/countries/phones';
2385
+ const payload = {};
2386
+ const uri = new URL(this.client.config.endpoint + apiPath);
2387
+ return this.client.call('get', uri, {
2388
+ 'content-type': 'application/json',
2389
+ }, payload);
2651
2390
  }
2652
2391
  /**
2653
- * List currencies
2654
- *
2655
2392
  * List of all currencies, including currency symbol, name, plural, and
2656
2393
  * decimal digits for all major and minor currencies. You can use the locale
2657
2394
  * header to get the data in a supported language.
@@ -2660,18 +2397,14 @@ class Locale extends Service {
2660
2397
  * @returns {Promise}
2661
2398
  */
2662
2399
  listCurrencies() {
2663
- return __awaiter(this, void 0, void 0, function* () {
2664
- const apiPath = '/locale/currencies';
2665
- const payload = {};
2666
- const uri = new URL(this.client.config.endpoint + apiPath);
2667
- return yield this.client.call('get', uri, {
2668
- 'content-type': 'application/json',
2669
- }, payload);
2670
- });
2400
+ const apiPath = '/locale/currencies';
2401
+ const payload = {};
2402
+ const uri = new URL(this.client.config.endpoint + apiPath);
2403
+ return this.client.call('get', uri, {
2404
+ 'content-type': 'application/json',
2405
+ }, payload);
2671
2406
  }
2672
2407
  /**
2673
- * List languages
2674
- *
2675
2408
  * List of all languages classified by ISO 639-1 including 2-letter code, name
2676
2409
  * in English, and name in the respective language.
2677
2410
  *
@@ -2679,14 +2412,12 @@ class Locale extends Service {
2679
2412
  * @returns {Promise}
2680
2413
  */
2681
2414
  listLanguages() {
2682
- return __awaiter(this, void 0, void 0, function* () {
2683
- const apiPath = '/locale/languages';
2684
- const payload = {};
2685
- const uri = new URL(this.client.config.endpoint + apiPath);
2686
- return yield this.client.call('get', uri, {
2687
- 'content-type': 'application/json',
2688
- }, payload);
2689
- });
2415
+ const apiPath = '/locale/languages';
2416
+ const payload = {};
2417
+ const uri = new URL(this.client.config.endpoint + apiPath);
2418
+ return this.client.call('get', uri, {
2419
+ 'content-type': 'application/json',
2420
+ }, payload);
2690
2421
  }
2691
2422
  }
2692
2423
 
@@ -2695,8 +2426,6 @@ class Messaging extends Service {
2695
2426
  super(client);
2696
2427
  }
2697
2428
  /**
2698
- * Create subscriber
2699
- *
2700
2429
  * Create a new subscriber.
2701
2430
  *
2702
2431
  * @param {string} topicId
@@ -2706,33 +2435,29 @@ class Messaging extends Service {
2706
2435
  * @returns {Promise}
2707
2436
  */
2708
2437
  createSubscriber(topicId, subscriberId, targetId) {
2709
- return __awaiter(this, void 0, void 0, function* () {
2710
- if (typeof topicId === 'undefined') {
2711
- throw new AppwriteException('Missing required parameter: "topicId"');
2712
- }
2713
- if (typeof subscriberId === 'undefined') {
2714
- throw new AppwriteException('Missing required parameter: "subscriberId"');
2715
- }
2716
- if (typeof targetId === 'undefined') {
2717
- throw new AppwriteException('Missing required parameter: "targetId"');
2718
- }
2719
- const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
2720
- const payload = {};
2721
- if (typeof subscriberId !== 'undefined') {
2722
- payload['subscriberId'] = subscriberId;
2723
- }
2724
- if (typeof targetId !== 'undefined') {
2725
- payload['targetId'] = targetId;
2726
- }
2727
- const uri = new URL(this.client.config.endpoint + apiPath);
2728
- return yield this.client.call('post', uri, {
2729
- 'content-type': 'application/json',
2730
- }, payload);
2731
- });
2438
+ if (typeof topicId === 'undefined') {
2439
+ throw new AppwriteException('Missing required parameter: "topicId"');
2440
+ }
2441
+ if (typeof subscriberId === 'undefined') {
2442
+ throw new AppwriteException('Missing required parameter: "subscriberId"');
2443
+ }
2444
+ if (typeof targetId === 'undefined') {
2445
+ throw new AppwriteException('Missing required parameter: "targetId"');
2446
+ }
2447
+ const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
2448
+ const payload = {};
2449
+ if (typeof subscriberId !== 'undefined') {
2450
+ payload['subscriberId'] = subscriberId;
2451
+ }
2452
+ if (typeof targetId !== 'undefined') {
2453
+ payload['targetId'] = targetId;
2454
+ }
2455
+ const uri = new URL(this.client.config.endpoint + apiPath);
2456
+ return this.client.call('post', uri, {
2457
+ 'content-type': 'application/json',
2458
+ }, payload);
2732
2459
  }
2733
2460
  /**
2734
- * Delete subscriber
2735
- *
2736
2461
  * Delete a subscriber by its unique ID.
2737
2462
  *
2738
2463
  * @param {string} topicId
@@ -2741,20 +2466,18 @@ class Messaging extends Service {
2741
2466
  * @returns {Promise}
2742
2467
  */
2743
2468
  deleteSubscriber(topicId, subscriberId) {
2744
- return __awaiter(this, void 0, void 0, function* () {
2745
- if (typeof topicId === 'undefined') {
2746
- throw new AppwriteException('Missing required parameter: "topicId"');
2747
- }
2748
- if (typeof subscriberId === 'undefined') {
2749
- throw new AppwriteException('Missing required parameter: "subscriberId"');
2750
- }
2751
- const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
2752
- const payload = {};
2753
- const uri = new URL(this.client.config.endpoint + apiPath);
2754
- return yield this.client.call('delete', uri, {
2755
- 'content-type': 'application/json',
2756
- }, payload);
2757
- });
2469
+ if (typeof topicId === 'undefined') {
2470
+ throw new AppwriteException('Missing required parameter: "topicId"');
2471
+ }
2472
+ if (typeof subscriberId === 'undefined') {
2473
+ throw new AppwriteException('Missing required parameter: "subscriberId"');
2474
+ }
2475
+ const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
2476
+ const payload = {};
2477
+ const uri = new URL(this.client.config.endpoint + apiPath);
2478
+ return this.client.call('delete', uri, {
2479
+ 'content-type': 'application/json',
2480
+ }, payload);
2758
2481
  }
2759
2482
  }
2760
2483
 
@@ -2763,8 +2486,6 @@ class Storage extends Service {
2763
2486
  super(client);
2764
2487
  }
2765
2488
  /**
2766
- * List files
2767
- *
2768
2489
  * Get a list of all the user files. You can use the query params to filter
2769
2490
  * your results.
2770
2491
  *
@@ -2775,27 +2496,23 @@ class Storage extends Service {
2775
2496
  * @returns {Promise}
2776
2497
  */
2777
2498
  listFiles(bucketId, queries, search) {
2778
- return __awaiter(this, void 0, void 0, function* () {
2779
- if (typeof bucketId === 'undefined') {
2780
- throw new AppwriteException('Missing required parameter: "bucketId"');
2781
- }
2782
- const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);
2783
- const payload = {};
2784
- if (typeof queries !== 'undefined') {
2785
- payload['queries'] = queries;
2786
- }
2787
- if (typeof search !== 'undefined') {
2788
- payload['search'] = search;
2789
- }
2790
- const uri = new URL(this.client.config.endpoint + apiPath);
2791
- return yield this.client.call('get', uri, {
2792
- 'content-type': 'application/json',
2793
- }, payload);
2794
- });
2499
+ if (typeof bucketId === 'undefined') {
2500
+ throw new AppwriteException('Missing required parameter: "bucketId"');
2501
+ }
2502
+ const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);
2503
+ const payload = {};
2504
+ if (typeof queries !== 'undefined') {
2505
+ payload['queries'] = queries;
2506
+ }
2507
+ if (typeof search !== 'undefined') {
2508
+ payload['search'] = search;
2509
+ }
2510
+ const uri = new URL(this.client.config.endpoint + apiPath);
2511
+ return this.client.call('get', uri, {
2512
+ 'content-type': 'application/json',
2513
+ }, payload);
2795
2514
  }
2796
2515
  /**
2797
- * Create file
2798
- *
2799
2516
  * Create a new file. Before using this route, you should create a new bucket
2800
2517
  * resource using either a [server
2801
2518
  * integration](https://appwrite.io/docs/server/storage#storageCreateBucket)
@@ -2847,7 +2564,7 @@ class Storage extends Service {
2847
2564
  const uri = new URL(this.client.config.endpoint + apiPath);
2848
2565
  const size = file.size;
2849
2566
  if (size <= Service.CHUNK_SIZE) {
2850
- return yield this.client.call('post', uri, {
2567
+ return this.client.call('post', uri, {
2851
2568
  'content-type': 'multipart/form-data',
2852
2569
  }, payload);
2853
2570
  }
@@ -2896,8 +2613,6 @@ class Storage extends Service {
2896
2613
  });
2897
2614
  }
2898
2615
  /**
2899
- * Get file
2900
- *
2901
2616
  * Get a file by its unique ID. This endpoint response returns a JSON object
2902
2617
  * with the file metadata.
2903
2618
  *
@@ -2907,24 +2622,20 @@ class Storage extends Service {
2907
2622
  * @returns {Promise}
2908
2623
  */
2909
2624
  getFile(bucketId, fileId) {
2910
- return __awaiter(this, void 0, void 0, function* () {
2911
- if (typeof bucketId === 'undefined') {
2912
- throw new AppwriteException('Missing required parameter: "bucketId"');
2913
- }
2914
- if (typeof fileId === 'undefined') {
2915
- throw new AppwriteException('Missing required parameter: "fileId"');
2916
- }
2917
- const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2918
- const payload = {};
2919
- const uri = new URL(this.client.config.endpoint + apiPath);
2920
- return yield this.client.call('get', uri, {
2921
- 'content-type': 'application/json',
2922
- }, payload);
2923
- });
2625
+ if (typeof bucketId === 'undefined') {
2626
+ throw new AppwriteException('Missing required parameter: "bucketId"');
2627
+ }
2628
+ if (typeof fileId === 'undefined') {
2629
+ throw new AppwriteException('Missing required parameter: "fileId"');
2630
+ }
2631
+ const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2632
+ const payload = {};
2633
+ const uri = new URL(this.client.config.endpoint + apiPath);
2634
+ return this.client.call('get', uri, {
2635
+ 'content-type': 'application/json',
2636
+ }, payload);
2924
2637
  }
2925
2638
  /**
2926
- * Update file
2927
- *
2928
2639
  * Update a file by its unique ID. Only users with write permissions have
2929
2640
  * access to update this resource.
2930
2641
  *
@@ -2936,30 +2647,26 @@ class Storage extends Service {
2936
2647
  * @returns {Promise}
2937
2648
  */
2938
2649
  updateFile(bucketId, fileId, name, permissions) {
2939
- return __awaiter(this, void 0, void 0, function* () {
2940
- if (typeof bucketId === 'undefined') {
2941
- throw new AppwriteException('Missing required parameter: "bucketId"');
2942
- }
2943
- if (typeof fileId === 'undefined') {
2944
- throw new AppwriteException('Missing required parameter: "fileId"');
2945
- }
2946
- const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2947
- const payload = {};
2948
- if (typeof name !== 'undefined') {
2949
- payload['name'] = name;
2950
- }
2951
- if (typeof permissions !== 'undefined') {
2952
- payload['permissions'] = permissions;
2953
- }
2954
- const uri = new URL(this.client.config.endpoint + apiPath);
2955
- return yield this.client.call('put', uri, {
2956
- 'content-type': 'application/json',
2957
- }, payload);
2958
- });
2650
+ if (typeof bucketId === 'undefined') {
2651
+ throw new AppwriteException('Missing required parameter: "bucketId"');
2652
+ }
2653
+ if (typeof fileId === 'undefined') {
2654
+ throw new AppwriteException('Missing required parameter: "fileId"');
2655
+ }
2656
+ const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2657
+ const payload = {};
2658
+ if (typeof name !== 'undefined') {
2659
+ payload['name'] = name;
2660
+ }
2661
+ if (typeof permissions !== 'undefined') {
2662
+ payload['permissions'] = permissions;
2663
+ }
2664
+ const uri = new URL(this.client.config.endpoint + apiPath);
2665
+ return this.client.call('put', uri, {
2666
+ 'content-type': 'application/json',
2667
+ }, payload);
2959
2668
  }
2960
2669
  /**
2961
- * Delete file
2962
- *
2963
2670
  * Delete a file by its unique ID. Only users with write permissions have
2964
2671
  * access to delete this resource.
2965
2672
  *
@@ -2969,24 +2676,20 @@ class Storage extends Service {
2969
2676
  * @returns {Promise}
2970
2677
  */
2971
2678
  deleteFile(bucketId, fileId) {
2972
- return __awaiter(this, void 0, void 0, function* () {
2973
- if (typeof bucketId === 'undefined') {
2974
- throw new AppwriteException('Missing required parameter: "bucketId"');
2975
- }
2976
- if (typeof fileId === 'undefined') {
2977
- throw new AppwriteException('Missing required parameter: "fileId"');
2978
- }
2979
- const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2980
- const payload = {};
2981
- const uri = new URL(this.client.config.endpoint + apiPath);
2982
- return yield this.client.call('delete', uri, {
2983
- 'content-type': 'application/json',
2984
- }, payload);
2985
- });
2679
+ if (typeof bucketId === 'undefined') {
2680
+ throw new AppwriteException('Missing required parameter: "bucketId"');
2681
+ }
2682
+ if (typeof fileId === 'undefined') {
2683
+ throw new AppwriteException('Missing required parameter: "fileId"');
2684
+ }
2685
+ const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2686
+ const payload = {};
2687
+ const uri = new URL(this.client.config.endpoint + apiPath);
2688
+ return this.client.call('delete', uri, {
2689
+ 'content-type': 'application/json',
2690
+ }, payload);
2986
2691
  }
2987
2692
  /**
2988
- * Get file for download
2989
- *
2990
2693
  * Get a file content by its unique ID. The endpoint response return with a
2991
2694
  * 'Content-Disposition: attachment' header that tells the browser to start
2992
2695
  * downloading the file to user downloads directory.
@@ -3013,8 +2716,6 @@ class Storage extends Service {
3013
2716
  return uri;
3014
2717
  }
3015
2718
  /**
3016
- * Get file preview
3017
- *
3018
2719
  * Get a file preview image. Currently, this method supports preview for image
3019
2720
  * files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
3020
2721
  * and spreadsheets, will return the file icon image. You can also pass query
@@ -3087,8 +2788,6 @@ class Storage extends Service {
3087
2788
  return uri;
3088
2789
  }
3089
2790
  /**
3090
- * Get file for view
3091
- *
3092
2791
  * Get a file content by its unique ID. This endpoint is similar to the
3093
2792
  * download method but returns with no 'Content-Disposition: attachment'
3094
2793
  * header.
@@ -3121,8 +2820,6 @@ class Teams extends Service {
3121
2820
  super(client);
3122
2821
  }
3123
2822
  /**
3124
- * List teams
3125
- *
3126
2823
  * Get a list of all the teams in which the current user is a member. You can
3127
2824
  * use the parameters to filter your results.
3128
2825
  *
@@ -3132,24 +2829,20 @@ class Teams extends Service {
3132
2829
  * @returns {Promise}
3133
2830
  */
3134
2831
  list(queries, search) {
3135
- return __awaiter(this, void 0, void 0, function* () {
3136
- const apiPath = '/teams';
3137
- const payload = {};
3138
- if (typeof queries !== 'undefined') {
3139
- payload['queries'] = queries;
3140
- }
3141
- if (typeof search !== 'undefined') {
3142
- payload['search'] = search;
3143
- }
3144
- const uri = new URL(this.client.config.endpoint + apiPath);
3145
- return yield this.client.call('get', uri, {
3146
- 'content-type': 'application/json',
3147
- }, payload);
3148
- });
2832
+ const apiPath = '/teams';
2833
+ const payload = {};
2834
+ if (typeof queries !== 'undefined') {
2835
+ payload['queries'] = queries;
2836
+ }
2837
+ if (typeof search !== 'undefined') {
2838
+ payload['search'] = search;
2839
+ }
2840
+ const uri = new URL(this.client.config.endpoint + apiPath);
2841
+ return this.client.call('get', uri, {
2842
+ 'content-type': 'application/json',
2843
+ }, payload);
3149
2844
  }
3150
2845
  /**
3151
- * Create team
3152
- *
3153
2846
  * Create a new team. The user who creates the team will automatically be
3154
2847
  * assigned as the owner of the team. Only the users with the owner role can
3155
2848
  * invite new members, add new owners and delete or update the team.
@@ -3161,33 +2854,29 @@ class Teams extends Service {
3161
2854
  * @returns {Promise}
3162
2855
  */
3163
2856
  create(teamId, name, roles) {
3164
- return __awaiter(this, void 0, void 0, function* () {
3165
- if (typeof teamId === 'undefined') {
3166
- throw new AppwriteException('Missing required parameter: "teamId"');
3167
- }
3168
- if (typeof name === 'undefined') {
3169
- throw new AppwriteException('Missing required parameter: "name"');
3170
- }
3171
- const apiPath = '/teams';
3172
- const payload = {};
3173
- if (typeof teamId !== 'undefined') {
3174
- payload['teamId'] = teamId;
3175
- }
3176
- if (typeof name !== 'undefined') {
3177
- payload['name'] = name;
3178
- }
3179
- if (typeof roles !== 'undefined') {
3180
- payload['roles'] = roles;
3181
- }
3182
- const uri = new URL(this.client.config.endpoint + apiPath);
3183
- return yield this.client.call('post', uri, {
3184
- 'content-type': 'application/json',
3185
- }, payload);
3186
- });
2857
+ if (typeof teamId === 'undefined') {
2858
+ throw new AppwriteException('Missing required parameter: "teamId"');
2859
+ }
2860
+ if (typeof name === 'undefined') {
2861
+ throw new AppwriteException('Missing required parameter: "name"');
2862
+ }
2863
+ const apiPath = '/teams';
2864
+ const payload = {};
2865
+ if (typeof teamId !== 'undefined') {
2866
+ payload['teamId'] = teamId;
2867
+ }
2868
+ if (typeof name !== 'undefined') {
2869
+ payload['name'] = name;
2870
+ }
2871
+ if (typeof roles !== 'undefined') {
2872
+ payload['roles'] = roles;
2873
+ }
2874
+ const uri = new URL(this.client.config.endpoint + apiPath);
2875
+ return this.client.call('post', uri, {
2876
+ 'content-type': 'application/json',
2877
+ }, payload);
3187
2878
  }
3188
2879
  /**
3189
- * Get team
3190
- *
3191
2880
  * Get a team by its ID. All team members have read access for this resource.
3192
2881
  *
3193
2882
  * @param {string} teamId
@@ -3195,21 +2884,17 @@ class Teams extends Service {
3195
2884
  * @returns {Promise}
3196
2885
  */
3197
2886
  get(teamId) {
3198
- return __awaiter(this, void 0, void 0, function* () {
3199
- if (typeof teamId === 'undefined') {
3200
- throw new AppwriteException('Missing required parameter: "teamId"');
3201
- }
3202
- const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
3203
- const payload = {};
3204
- const uri = new URL(this.client.config.endpoint + apiPath);
3205
- return yield this.client.call('get', uri, {
3206
- 'content-type': 'application/json',
3207
- }, payload);
3208
- });
2887
+ if (typeof teamId === 'undefined') {
2888
+ throw new AppwriteException('Missing required parameter: "teamId"');
2889
+ }
2890
+ const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
2891
+ const payload = {};
2892
+ const uri = new URL(this.client.config.endpoint + apiPath);
2893
+ return this.client.call('get', uri, {
2894
+ 'content-type': 'application/json',
2895
+ }, payload);
3209
2896
  }
3210
2897
  /**
3211
- * Update name
3212
- *
3213
2898
  * Update the team's name by its unique ID.
3214
2899
  *
3215
2900
  * @param {string} teamId
@@ -3218,27 +2903,23 @@ class Teams extends Service {
3218
2903
  * @returns {Promise}
3219
2904
  */
3220
2905
  updateName(teamId, name) {
3221
- return __awaiter(this, void 0, void 0, function* () {
3222
- if (typeof teamId === 'undefined') {
3223
- throw new AppwriteException('Missing required parameter: "teamId"');
3224
- }
3225
- if (typeof name === 'undefined') {
3226
- throw new AppwriteException('Missing required parameter: "name"');
3227
- }
3228
- const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
3229
- const payload = {};
3230
- if (typeof name !== 'undefined') {
3231
- payload['name'] = name;
3232
- }
3233
- const uri = new URL(this.client.config.endpoint + apiPath);
3234
- return yield this.client.call('put', uri, {
3235
- 'content-type': 'application/json',
3236
- }, payload);
3237
- });
2906
+ if (typeof teamId === 'undefined') {
2907
+ throw new AppwriteException('Missing required parameter: "teamId"');
2908
+ }
2909
+ if (typeof name === 'undefined') {
2910
+ throw new AppwriteException('Missing required parameter: "name"');
2911
+ }
2912
+ const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
2913
+ const payload = {};
2914
+ if (typeof name !== 'undefined') {
2915
+ payload['name'] = name;
2916
+ }
2917
+ const uri = new URL(this.client.config.endpoint + apiPath);
2918
+ return this.client.call('put', uri, {
2919
+ 'content-type': 'application/json',
2920
+ }, payload);
3238
2921
  }
3239
2922
  /**
3240
- * Delete team
3241
- *
3242
2923
  * Delete a team using its ID. Only team members with the owner role can
3243
2924
  * delete the team.
3244
2925
  *
@@ -3247,21 +2928,17 @@ class Teams extends Service {
3247
2928
  * @returns {Promise}
3248
2929
  */
3249
2930
  delete(teamId) {
3250
- return __awaiter(this, void 0, void 0, function* () {
3251
- if (typeof teamId === 'undefined') {
3252
- throw new AppwriteException('Missing required parameter: "teamId"');
3253
- }
3254
- const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
3255
- const payload = {};
3256
- const uri = new URL(this.client.config.endpoint + apiPath);
3257
- return yield this.client.call('delete', uri, {
3258
- 'content-type': 'application/json',
3259
- }, payload);
3260
- });
2931
+ if (typeof teamId === 'undefined') {
2932
+ throw new AppwriteException('Missing required parameter: "teamId"');
2933
+ }
2934
+ const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
2935
+ const payload = {};
2936
+ const uri = new URL(this.client.config.endpoint + apiPath);
2937
+ return this.client.call('delete', uri, {
2938
+ 'content-type': 'application/json',
2939
+ }, payload);
3261
2940
  }
3262
2941
  /**
3263
- * List team memberships
3264
- *
3265
2942
  * Use this endpoint to list a team's members using the team's ID. All team
3266
2943
  * members have read access to this endpoint. Hide sensitive attributes from
3267
2944
  * the response by toggling membership privacy in the Console.
@@ -3273,27 +2950,23 @@ class Teams extends Service {
3273
2950
  * @returns {Promise}
3274
2951
  */
3275
2952
  listMemberships(teamId, queries, search) {
3276
- return __awaiter(this, void 0, void 0, function* () {
3277
- if (typeof teamId === 'undefined') {
3278
- throw new AppwriteException('Missing required parameter: "teamId"');
3279
- }
3280
- const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
3281
- const payload = {};
3282
- if (typeof queries !== 'undefined') {
3283
- payload['queries'] = queries;
3284
- }
3285
- if (typeof search !== 'undefined') {
3286
- payload['search'] = search;
3287
- }
3288
- const uri = new URL(this.client.config.endpoint + apiPath);
3289
- return yield this.client.call('get', uri, {
3290
- 'content-type': 'application/json',
3291
- }, payload);
3292
- });
2953
+ if (typeof teamId === 'undefined') {
2954
+ throw new AppwriteException('Missing required parameter: "teamId"');
2955
+ }
2956
+ const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
2957
+ const payload = {};
2958
+ if (typeof queries !== 'undefined') {
2959
+ payload['queries'] = queries;
2960
+ }
2961
+ if (typeof search !== 'undefined') {
2962
+ payload['search'] = search;
2963
+ }
2964
+ const uri = new URL(this.client.config.endpoint + apiPath);
2965
+ return this.client.call('get', uri, {
2966
+ 'content-type': 'application/json',
2967
+ }, payload);
3293
2968
  }
3294
2969
  /**
3295
- * Create team membership
3296
- *
3297
2970
  * Invite a new member to join your team. Provide an ID for existing users, or
3298
2971
  * invite unregistered users using an email or phone number. If initiated from
3299
2972
  * a Client SDK, Appwrite will send an email or sms with a link to join the
@@ -3327,42 +3000,38 @@ class Teams extends Service {
3327
3000
  * @returns {Promise}
3328
3001
  */
3329
3002
  createMembership(teamId, roles, email, userId, phone, url, name) {
3330
- return __awaiter(this, void 0, void 0, function* () {
3331
- if (typeof teamId === 'undefined') {
3332
- throw new AppwriteException('Missing required parameter: "teamId"');
3333
- }
3334
- if (typeof roles === 'undefined') {
3335
- throw new AppwriteException('Missing required parameter: "roles"');
3336
- }
3337
- const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
3338
- const payload = {};
3339
- if (typeof email !== 'undefined') {
3340
- payload['email'] = email;
3341
- }
3342
- if (typeof userId !== 'undefined') {
3343
- payload['userId'] = userId;
3344
- }
3345
- if (typeof phone !== 'undefined') {
3346
- payload['phone'] = phone;
3347
- }
3348
- if (typeof roles !== 'undefined') {
3349
- payload['roles'] = roles;
3350
- }
3351
- if (typeof url !== 'undefined') {
3352
- payload['url'] = url;
3353
- }
3354
- if (typeof name !== 'undefined') {
3355
- payload['name'] = name;
3356
- }
3357
- const uri = new URL(this.client.config.endpoint + apiPath);
3358
- return yield this.client.call('post', uri, {
3359
- 'content-type': 'application/json',
3360
- }, payload);
3361
- });
3003
+ if (typeof teamId === 'undefined') {
3004
+ throw new AppwriteException('Missing required parameter: "teamId"');
3005
+ }
3006
+ if (typeof roles === 'undefined') {
3007
+ throw new AppwriteException('Missing required parameter: "roles"');
3008
+ }
3009
+ const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
3010
+ const payload = {};
3011
+ if (typeof email !== 'undefined') {
3012
+ payload['email'] = email;
3013
+ }
3014
+ if (typeof userId !== 'undefined') {
3015
+ payload['userId'] = userId;
3016
+ }
3017
+ if (typeof phone !== 'undefined') {
3018
+ payload['phone'] = phone;
3019
+ }
3020
+ if (typeof roles !== 'undefined') {
3021
+ payload['roles'] = roles;
3022
+ }
3023
+ if (typeof url !== 'undefined') {
3024
+ payload['url'] = url;
3025
+ }
3026
+ if (typeof name !== 'undefined') {
3027
+ payload['name'] = name;
3028
+ }
3029
+ const uri = new URL(this.client.config.endpoint + apiPath);
3030
+ return this.client.call('post', uri, {
3031
+ 'content-type': 'application/json',
3032
+ }, payload);
3362
3033
  }
3363
3034
  /**
3364
- * Get team membership
3365
- *
3366
3035
  * Get a team member by the membership unique id. All team members have read
3367
3036
  * access for this resource. Hide sensitive attributes from the response by
3368
3037
  * toggling membership privacy in the Console.
@@ -3373,24 +3042,20 @@ class Teams extends Service {
3373
3042
  * @returns {Promise}
3374
3043
  */
3375
3044
  getMembership(teamId, membershipId) {
3376
- return __awaiter(this, void 0, void 0, function* () {
3377
- if (typeof teamId === 'undefined') {
3378
- throw new AppwriteException('Missing required parameter: "teamId"');
3379
- }
3380
- if (typeof membershipId === 'undefined') {
3381
- throw new AppwriteException('Missing required parameter: "membershipId"');
3382
- }
3383
- const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
3384
- const payload = {};
3385
- const uri = new URL(this.client.config.endpoint + apiPath);
3386
- return yield this.client.call('get', uri, {
3387
- 'content-type': 'application/json',
3388
- }, payload);
3389
- });
3045
+ if (typeof teamId === 'undefined') {
3046
+ throw new AppwriteException('Missing required parameter: "teamId"');
3047
+ }
3048
+ if (typeof membershipId === 'undefined') {
3049
+ throw new AppwriteException('Missing required parameter: "membershipId"');
3050
+ }
3051
+ const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
3052
+ const payload = {};
3053
+ const uri = new URL(this.client.config.endpoint + apiPath);
3054
+ return this.client.call('get', uri, {
3055
+ 'content-type': 'application/json',
3056
+ }, payload);
3390
3057
  }
3391
3058
  /**
3392
- * Update membership
3393
- *
3394
3059
  * Modify the roles of a team member. Only team members with the owner role
3395
3060
  * have access to this endpoint. Learn more about [roles and
3396
3061
  * permissions](https://appwrite.io/docs/permissions).
@@ -3403,30 +3068,26 @@ class Teams extends Service {
3403
3068
  * @returns {Promise}
3404
3069
  */
3405
3070
  updateMembership(teamId, membershipId, roles) {
3406
- return __awaiter(this, void 0, void 0, function* () {
3407
- if (typeof teamId === 'undefined') {
3408
- throw new AppwriteException('Missing required parameter: "teamId"');
3409
- }
3410
- if (typeof membershipId === 'undefined') {
3411
- throw new AppwriteException('Missing required parameter: "membershipId"');
3412
- }
3413
- if (typeof roles === 'undefined') {
3414
- throw new AppwriteException('Missing required parameter: "roles"');
3415
- }
3416
- const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
3417
- const payload = {};
3418
- if (typeof roles !== 'undefined') {
3419
- payload['roles'] = roles;
3420
- }
3421
- const uri = new URL(this.client.config.endpoint + apiPath);
3422
- return yield this.client.call('patch', uri, {
3423
- 'content-type': 'application/json',
3424
- }, payload);
3425
- });
3071
+ if (typeof teamId === 'undefined') {
3072
+ throw new AppwriteException('Missing required parameter: "teamId"');
3073
+ }
3074
+ if (typeof membershipId === 'undefined') {
3075
+ throw new AppwriteException('Missing required parameter: "membershipId"');
3076
+ }
3077
+ if (typeof roles === 'undefined') {
3078
+ throw new AppwriteException('Missing required parameter: "roles"');
3079
+ }
3080
+ const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
3081
+ const payload = {};
3082
+ if (typeof roles !== 'undefined') {
3083
+ payload['roles'] = roles;
3084
+ }
3085
+ const uri = new URL(this.client.config.endpoint + apiPath);
3086
+ return this.client.call('patch', uri, {
3087
+ 'content-type': 'application/json',
3088
+ }, payload);
3426
3089
  }
3427
3090
  /**
3428
- * Delete team membership
3429
- *
3430
3091
  * This endpoint allows a user to leave a team or for a team owner to delete
3431
3092
  * the membership of any other team member. You can also use this endpoint to
3432
3093
  * delete a user membership even if it is not accepted.
@@ -3437,24 +3098,20 @@ class Teams extends Service {
3437
3098
  * @returns {Promise}
3438
3099
  */
3439
3100
  deleteMembership(teamId, membershipId) {
3440
- return __awaiter(this, void 0, void 0, function* () {
3441
- if (typeof teamId === 'undefined') {
3442
- throw new AppwriteException('Missing required parameter: "teamId"');
3443
- }
3444
- if (typeof membershipId === 'undefined') {
3445
- throw new AppwriteException('Missing required parameter: "membershipId"');
3446
- }
3447
- const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
3448
- const payload = {};
3449
- const uri = new URL(this.client.config.endpoint + apiPath);
3450
- return yield this.client.call('delete', uri, {
3451
- 'content-type': 'application/json',
3452
- }, payload);
3453
- });
3101
+ if (typeof teamId === 'undefined') {
3102
+ throw new AppwriteException('Missing required parameter: "teamId"');
3103
+ }
3104
+ if (typeof membershipId === 'undefined') {
3105
+ throw new AppwriteException('Missing required parameter: "membershipId"');
3106
+ }
3107
+ const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
3108
+ const payload = {};
3109
+ const uri = new URL(this.client.config.endpoint + apiPath);
3110
+ return this.client.call('delete', uri, {
3111
+ 'content-type': 'application/json',
3112
+ }, payload);
3454
3113
  }
3455
3114
  /**
3456
- * Update team membership status
3457
- *
3458
3115
  * Use this endpoint to allow a user to accept an invitation to join a team
3459
3116
  * after being redirected back to your app from the invitation email received
3460
3117
  * by the user.
@@ -3471,36 +3128,32 @@ class Teams extends Service {
3471
3128
  * @returns {Promise}
3472
3129
  */
3473
3130
  updateMembershipStatus(teamId, membershipId, userId, secret) {
3474
- return __awaiter(this, void 0, void 0, function* () {
3475
- if (typeof teamId === 'undefined') {
3476
- throw new AppwriteException('Missing required parameter: "teamId"');
3477
- }
3478
- if (typeof membershipId === 'undefined') {
3479
- throw new AppwriteException('Missing required parameter: "membershipId"');
3480
- }
3481
- if (typeof userId === 'undefined') {
3482
- throw new AppwriteException('Missing required parameter: "userId"');
3483
- }
3484
- if (typeof secret === 'undefined') {
3485
- throw new AppwriteException('Missing required parameter: "secret"');
3486
- }
3487
- const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
3488
- const payload = {};
3489
- if (typeof userId !== 'undefined') {
3490
- payload['userId'] = userId;
3491
- }
3492
- if (typeof secret !== 'undefined') {
3493
- payload['secret'] = secret;
3494
- }
3495
- const uri = new URL(this.client.config.endpoint + apiPath);
3496
- return yield this.client.call('patch', uri, {
3497
- 'content-type': 'application/json',
3498
- }, payload);
3499
- });
3131
+ if (typeof teamId === 'undefined') {
3132
+ throw new AppwriteException('Missing required parameter: "teamId"');
3133
+ }
3134
+ if (typeof membershipId === 'undefined') {
3135
+ throw new AppwriteException('Missing required parameter: "membershipId"');
3136
+ }
3137
+ if (typeof userId === 'undefined') {
3138
+ throw new AppwriteException('Missing required parameter: "userId"');
3139
+ }
3140
+ if (typeof secret === 'undefined') {
3141
+ throw new AppwriteException('Missing required parameter: "secret"');
3142
+ }
3143
+ const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
3144
+ const payload = {};
3145
+ if (typeof userId !== 'undefined') {
3146
+ payload['userId'] = userId;
3147
+ }
3148
+ if (typeof secret !== 'undefined') {
3149
+ payload['secret'] = secret;
3150
+ }
3151
+ const uri = new URL(this.client.config.endpoint + apiPath);
3152
+ return this.client.call('patch', uri, {
3153
+ 'content-type': 'application/json',
3154
+ }, payload);
3500
3155
  }
3501
3156
  /**
3502
- * Get team preferences
3503
- *
3504
3157
  * Get the team's shared preferences by its unique ID. If a preference doesn't
3505
3158
  * need to be shared by all team members, prefer storing them in [user
3506
3159
  * preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
@@ -3510,21 +3163,17 @@ class Teams extends Service {
3510
3163
  * @returns {Promise}
3511
3164
  */
3512
3165
  getPrefs(teamId) {
3513
- return __awaiter(this, void 0, void 0, function* () {
3514
- if (typeof teamId === 'undefined') {
3515
- throw new AppwriteException('Missing required parameter: "teamId"');
3516
- }
3517
- const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
3518
- const payload = {};
3519
- const uri = new URL(this.client.config.endpoint + apiPath);
3520
- return yield this.client.call('get', uri, {
3521
- 'content-type': 'application/json',
3522
- }, payload);
3523
- });
3166
+ if (typeof teamId === 'undefined') {
3167
+ throw new AppwriteException('Missing required parameter: "teamId"');
3168
+ }
3169
+ const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
3170
+ const payload = {};
3171
+ const uri = new URL(this.client.config.endpoint + apiPath);
3172
+ return this.client.call('get', uri, {
3173
+ 'content-type': 'application/json',
3174
+ }, payload);
3524
3175
  }
3525
3176
  /**
3526
- * Update preferences
3527
- *
3528
3177
  * Update the team's preferences by its unique ID. The object you pass is
3529
3178
  * stored as is and replaces any previous value. The maximum allowed prefs
3530
3179
  * size is 64kB and throws an error if exceeded.
@@ -3535,23 +3184,21 @@ class Teams extends Service {
3535
3184
  * @returns {Promise}
3536
3185
  */
3537
3186
  updatePrefs(teamId, prefs) {
3538
- return __awaiter(this, void 0, void 0, function* () {
3539
- if (typeof teamId === 'undefined') {
3540
- throw new AppwriteException('Missing required parameter: "teamId"');
3541
- }
3542
- if (typeof prefs === 'undefined') {
3543
- throw new AppwriteException('Missing required parameter: "prefs"');
3544
- }
3545
- const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
3546
- const payload = {};
3547
- if (typeof prefs !== 'undefined') {
3548
- payload['prefs'] = prefs;
3549
- }
3550
- const uri = new URL(this.client.config.endpoint + apiPath);
3551
- return yield this.client.call('put', uri, {
3552
- 'content-type': 'application/json',
3553
- }, payload);
3554
- });
3187
+ if (typeof teamId === 'undefined') {
3188
+ throw new AppwriteException('Missing required parameter: "teamId"');
3189
+ }
3190
+ if (typeof prefs === 'undefined') {
3191
+ throw new AppwriteException('Missing required parameter: "prefs"');
3192
+ }
3193
+ const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
3194
+ const payload = {};
3195
+ if (typeof prefs !== 'undefined') {
3196
+ payload['prefs'] = prefs;
3197
+ }
3198
+ const uri = new URL(this.client.config.endpoint + apiPath);
3199
+ return this.client.call('put', uri, {
3200
+ 'content-type': 'application/json',
3201
+ }, payload);
3555
3202
  }
3556
3203
  }
3557
3204