@appwrite.io/console 0.6.0-rc.14 → 0.6.0-rc.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/sdk.js +222 -69
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +223 -70
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +222 -69
- package/docs/examples/account/{add-authenticator.md → create-mfa-authenticator.md} +1 -1
- package/docs/examples/account/{create-challenge.md → create-mfa-challenge.md} +2 -2
- package/docs/examples/account/create-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/{verify-authenticator.md → delete-mfa-authenticator.md} +1 -1
- package/docs/examples/account/get-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/{list-factors.md → list-mfa-factors.md} +1 -1
- package/docs/examples/account/{delete-authenticator.md → update-mfa-authenticator.md} +1 -1
- package/docs/examples/account/{update-challenge.md → update-mfa-challenge.md} +1 -1
- package/docs/examples/account/update-mfa-recovery-codes.md +11 -0
- package/docs/examples/users/create-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/{delete-authenticator.md → delete-mfa-authenticator.md} +3 -3
- package/docs/examples/users/get-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/{list-factors.md → list-mfa-factors.md} +1 -1
- package/docs/examples/users/update-mfa-recovery-codes.md +13 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/authentication-factor.ts +3 -2
- package/src/enums/type.ts +3 -0
- package/src/index.ts +2 -1
- package/src/models.ts +13 -8
- package/src/services/account.ts +132 -60
- package/src/services/users.ts +88 -10
- package/types/enums/authentication-factor.d.ts +3 -2
- package/types/enums/type.d.ts +3 -0
- package/types/index.d.ts +2 -1
- package/types/models.d.ts +13 -8
- package/types/services/account.d.ts +71 -26
- package/types/services/users.d.ts +45 -6
package/dist/iife/sdk.js
CHANGED
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
'x-sdk-name': 'Console',
|
|
116
116
|
'x-sdk-platform': 'console',
|
|
117
117
|
'x-sdk-language': 'web',
|
|
118
|
-
'x-sdk-version': '0.6.0-rc.
|
|
118
|
+
'x-sdk-version': '0.6.0-rc.16',
|
|
119
119
|
'X-Appwrite-Response-Format': '1.5.0',
|
|
120
120
|
};
|
|
121
121
|
this.realtime = {
|
|
@@ -690,15 +690,103 @@
|
|
|
690
690
|
}, payload);
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
|
+
/**
|
|
694
|
+
* Add Authenticator
|
|
695
|
+
*
|
|
696
|
+
* Add an authenticator app to be used as an MFA factor. Verify the
|
|
697
|
+
* authenticator using the [verify
|
|
698
|
+
* authenticator](/docs/references/cloud/client-web/account#verifyAuthenticator)
|
|
699
|
+
* method.
|
|
700
|
+
*
|
|
701
|
+
* @param {AuthenticatorType} type
|
|
702
|
+
* @throws {AppwriteException}
|
|
703
|
+
* @returns {Promise}
|
|
704
|
+
*/
|
|
705
|
+
createMfaAuthenticator(type) {
|
|
706
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
707
|
+
if (typeof type === 'undefined') {
|
|
708
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
709
|
+
}
|
|
710
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
711
|
+
const payload = {};
|
|
712
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
713
|
+
return yield this.client.call('post', uri, {
|
|
714
|
+
'content-type': 'application/json',
|
|
715
|
+
}, payload);
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Verify Authenticator
|
|
720
|
+
*
|
|
721
|
+
* Verify an authenticator app after adding it using the [add
|
|
722
|
+
* authenticator](/docs/references/cloud/client-web/account#addAuthenticator)
|
|
723
|
+
* method.
|
|
724
|
+
*
|
|
725
|
+
* @param {AuthenticatorType} type
|
|
726
|
+
* @param {string} otp
|
|
727
|
+
* @throws {AppwriteException}
|
|
728
|
+
* @returns {Promise}
|
|
729
|
+
*/
|
|
730
|
+
updateMfaAuthenticator(type, otp) {
|
|
731
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
732
|
+
if (typeof type === 'undefined') {
|
|
733
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
734
|
+
}
|
|
735
|
+
if (typeof otp === 'undefined') {
|
|
736
|
+
throw new AppwriteException('Missing required parameter: "otp"');
|
|
737
|
+
}
|
|
738
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
739
|
+
const payload = {};
|
|
740
|
+
if (typeof otp !== 'undefined') {
|
|
741
|
+
payload['otp'] = otp;
|
|
742
|
+
}
|
|
743
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
744
|
+
return yield this.client.call('put', uri, {
|
|
745
|
+
'content-type': 'application/json',
|
|
746
|
+
}, payload);
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Delete Authenticator
|
|
751
|
+
*
|
|
752
|
+
* Delete an authenticator for a user by ID.
|
|
753
|
+
*
|
|
754
|
+
* @param {AuthenticatorType} type
|
|
755
|
+
* @param {string} otp
|
|
756
|
+
* @throws {AppwriteException}
|
|
757
|
+
* @returns {Promise}
|
|
758
|
+
*/
|
|
759
|
+
deleteMfaAuthenticator(type, otp) {
|
|
760
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
761
|
+
if (typeof type === 'undefined') {
|
|
762
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
763
|
+
}
|
|
764
|
+
if (typeof otp === 'undefined') {
|
|
765
|
+
throw new AppwriteException('Missing required parameter: "otp"');
|
|
766
|
+
}
|
|
767
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
768
|
+
const payload = {};
|
|
769
|
+
if (typeof otp !== 'undefined') {
|
|
770
|
+
payload['otp'] = otp;
|
|
771
|
+
}
|
|
772
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
773
|
+
return yield this.client.call('delete', uri, {
|
|
774
|
+
'content-type': 'application/json',
|
|
775
|
+
}, payload);
|
|
776
|
+
});
|
|
777
|
+
}
|
|
693
778
|
/**
|
|
694
779
|
* Create 2FA Challenge
|
|
695
780
|
*
|
|
781
|
+
* Begin the process of MFA verification after sign-in. Finish the flow with
|
|
782
|
+
* [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
|
783
|
+
* method.
|
|
696
784
|
*
|
|
697
785
|
* @param {AuthenticationFactor} factor
|
|
698
786
|
* @throws {AppwriteException}
|
|
699
787
|
* @returns {Promise}
|
|
700
788
|
*/
|
|
701
|
-
|
|
789
|
+
createMfaChallenge(factor) {
|
|
702
790
|
return __awaiter(this, void 0, void 0, function* () {
|
|
703
791
|
if (typeof factor === 'undefined') {
|
|
704
792
|
throw new AppwriteException('Missing required parameter: "factor"');
|
|
@@ -717,14 +805,18 @@
|
|
|
717
805
|
/**
|
|
718
806
|
* Create MFA Challenge (confirmation)
|
|
719
807
|
*
|
|
720
|
-
* Complete the MFA challenge by providing the one-time password.
|
|
808
|
+
* Complete the MFA challenge by providing the one-time password. Finish the
|
|
809
|
+
* process of MFA verification by providing the one-time password. To begin
|
|
810
|
+
* the flow, use
|
|
811
|
+
* [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
|
|
812
|
+
* method.
|
|
721
813
|
*
|
|
722
814
|
* @param {string} challengeId
|
|
723
815
|
* @param {string} otp
|
|
724
816
|
* @throws {AppwriteException}
|
|
725
817
|
* @returns {Promise}
|
|
726
818
|
*/
|
|
727
|
-
|
|
819
|
+
updateMfaChallenge(challengeId, otp) {
|
|
728
820
|
return __awaiter(this, void 0, void 0, function* () {
|
|
729
821
|
if (typeof challengeId === 'undefined') {
|
|
730
822
|
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
@@ -754,7 +846,7 @@
|
|
|
754
846
|
* @throws {AppwriteException}
|
|
755
847
|
* @returns {Promise}
|
|
756
848
|
*/
|
|
757
|
-
|
|
849
|
+
listMfaFactors() {
|
|
758
850
|
return __awaiter(this, void 0, void 0, function* () {
|
|
759
851
|
const apiPath = '/account/mfa/factors';
|
|
760
852
|
const payload = {};
|
|
@@ -765,86 +857,65 @@
|
|
|
765
857
|
});
|
|
766
858
|
}
|
|
767
859
|
/**
|
|
768
|
-
*
|
|
860
|
+
* Get MFA Recovery Codes
|
|
769
861
|
*
|
|
770
|
-
*
|
|
771
|
-
*
|
|
772
|
-
*
|
|
773
|
-
* method.
|
|
862
|
+
* Get recovery codes that can be used as backup for MFA flow. Before getting
|
|
863
|
+
* codes, they must be generated using
|
|
864
|
+
* [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
|
|
865
|
+
* method. An OTP challenge is required to read recovery codes.
|
|
774
866
|
*
|
|
775
|
-
* @param {AuthenticatorType} type
|
|
776
867
|
* @throws {AppwriteException}
|
|
777
868
|
* @returns {Promise}
|
|
778
869
|
*/
|
|
779
|
-
|
|
870
|
+
getMfaRecoveryCodes() {
|
|
780
871
|
return __awaiter(this, void 0, void 0, function* () {
|
|
781
|
-
|
|
782
|
-
throw new AppwriteException('Missing required parameter: "type"');
|
|
783
|
-
}
|
|
784
|
-
const apiPath = '/account/mfa/{type}'.replace('{type}', type);
|
|
872
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
785
873
|
const payload = {};
|
|
786
874
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
787
|
-
return yield this.client.call('
|
|
875
|
+
return yield this.client.call('get', uri, {
|
|
788
876
|
'content-type': 'application/json',
|
|
789
877
|
}, payload);
|
|
790
878
|
});
|
|
791
879
|
}
|
|
792
880
|
/**
|
|
793
|
-
*
|
|
881
|
+
* Create MFA Recovery Codes
|
|
794
882
|
*
|
|
795
|
-
*
|
|
796
|
-
*
|
|
883
|
+
* Generate recovery codes as backup for MFA flow. It's recommended to
|
|
884
|
+
* generate and show then immediately after user successfully adds their
|
|
885
|
+
* authehticator. Recovery codes can be used as a MFA verification type in
|
|
886
|
+
* [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
|
|
797
887
|
* method.
|
|
798
888
|
*
|
|
799
|
-
* @param {AuthenticatorType} type
|
|
800
|
-
* @param {string} otp
|
|
801
889
|
* @throws {AppwriteException}
|
|
802
890
|
* @returns {Promise}
|
|
803
891
|
*/
|
|
804
|
-
|
|
892
|
+
createMfaRecoveryCodes() {
|
|
805
893
|
return __awaiter(this, void 0, void 0, function* () {
|
|
806
|
-
|
|
807
|
-
throw new AppwriteException('Missing required parameter: "type"');
|
|
808
|
-
}
|
|
809
|
-
if (typeof otp === 'undefined') {
|
|
810
|
-
throw new AppwriteException('Missing required parameter: "otp"');
|
|
811
|
-
}
|
|
812
|
-
const apiPath = '/account/mfa/{type}'.replace('{type}', type);
|
|
894
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
813
895
|
const payload = {};
|
|
814
|
-
if (typeof otp !== 'undefined') {
|
|
815
|
-
payload['otp'] = otp;
|
|
816
|
-
}
|
|
817
896
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
818
|
-
return yield this.client.call('
|
|
897
|
+
return yield this.client.call('post', uri, {
|
|
819
898
|
'content-type': 'application/json',
|
|
820
899
|
}, payload);
|
|
821
900
|
});
|
|
822
901
|
}
|
|
823
902
|
/**
|
|
824
|
-
*
|
|
903
|
+
* Regenerate MFA Recovery Codes
|
|
825
904
|
*
|
|
826
|
-
*
|
|
905
|
+
* Regenerate recovery codes that can be used as backup for MFA flow. Before
|
|
906
|
+
* regenerating codes, they must be first generated using
|
|
907
|
+
* [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
|
|
908
|
+
* method. An OTP challenge is required to regenreate recovery codes.
|
|
827
909
|
*
|
|
828
|
-
* @param {AuthenticatorType} type
|
|
829
|
-
* @param {string} otp
|
|
830
910
|
* @throws {AppwriteException}
|
|
831
911
|
* @returns {Promise}
|
|
832
912
|
*/
|
|
833
|
-
|
|
913
|
+
updateMfaRecoveryCodes() {
|
|
834
914
|
return __awaiter(this, void 0, void 0, function* () {
|
|
835
|
-
|
|
836
|
-
throw new AppwriteException('Missing required parameter: "type"');
|
|
837
|
-
}
|
|
838
|
-
if (typeof otp === 'undefined') {
|
|
839
|
-
throw new AppwriteException('Missing required parameter: "otp"');
|
|
840
|
-
}
|
|
841
|
-
const apiPath = '/account/mfa/{type}'.replace('{type}', type);
|
|
915
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
842
916
|
const payload = {};
|
|
843
|
-
if (typeof otp !== 'undefined') {
|
|
844
|
-
payload['otp'] = otp;
|
|
845
|
-
}
|
|
846
917
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
847
|
-
return yield this.client.call('
|
|
918
|
+
return yield this.client.call('patch', uri, {
|
|
848
919
|
'content-type': 'application/json',
|
|
849
920
|
}, payload);
|
|
850
921
|
});
|
|
@@ -1352,10 +1423,11 @@
|
|
|
1352
1423
|
});
|
|
1353
1424
|
}
|
|
1354
1425
|
/**
|
|
1355
|
-
* Update
|
|
1426
|
+
* Update session
|
|
1356
1427
|
*
|
|
1357
|
-
*
|
|
1358
|
-
* useful when session
|
|
1428
|
+
* Use this endpoint to extend a session's length. Extending a session is
|
|
1429
|
+
* useful when session expiry is short. If the session was created using an
|
|
1430
|
+
* OAuth provider, this endpoint refreshes the access token from the provider.
|
|
1359
1431
|
*
|
|
1360
1432
|
* @param {string} sessionId
|
|
1361
1433
|
* @throws {AppwriteException}
|
|
@@ -11675,6 +11747,32 @@
|
|
|
11675
11747
|
}, payload);
|
|
11676
11748
|
});
|
|
11677
11749
|
}
|
|
11750
|
+
/**
|
|
11751
|
+
* Delete Authenticator
|
|
11752
|
+
*
|
|
11753
|
+
* Delete an authenticator app.
|
|
11754
|
+
*
|
|
11755
|
+
* @param {string} userId
|
|
11756
|
+
* @param {Type} type
|
|
11757
|
+
* @throws {AppwriteException}
|
|
11758
|
+
* @returns {Promise}
|
|
11759
|
+
*/
|
|
11760
|
+
deleteMfaAuthenticator(userId, type) {
|
|
11761
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11762
|
+
if (typeof userId === 'undefined') {
|
|
11763
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
11764
|
+
}
|
|
11765
|
+
if (typeof type === 'undefined') {
|
|
11766
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
11767
|
+
}
|
|
11768
|
+
const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type);
|
|
11769
|
+
const payload = {};
|
|
11770
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11771
|
+
return yield this.client.call('delete', uri, {
|
|
11772
|
+
'content-type': 'application/json',
|
|
11773
|
+
}, payload);
|
|
11774
|
+
});
|
|
11775
|
+
}
|
|
11678
11776
|
/**
|
|
11679
11777
|
* List Factors
|
|
11680
11778
|
*
|
|
@@ -11684,7 +11782,7 @@
|
|
|
11684
11782
|
* @throws {AppwriteException}
|
|
11685
11783
|
* @returns {Promise}
|
|
11686
11784
|
*/
|
|
11687
|
-
|
|
11785
|
+
listMfaFactors(userId) {
|
|
11688
11786
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11689
11787
|
if (typeof userId === 'undefined') {
|
|
11690
11788
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -11698,27 +11796,76 @@
|
|
|
11698
11796
|
});
|
|
11699
11797
|
}
|
|
11700
11798
|
/**
|
|
11701
|
-
*
|
|
11799
|
+
* Get MFA Recovery Codes
|
|
11702
11800
|
*
|
|
11703
|
-
*
|
|
11801
|
+
* Get recovery codes that can be used as backup for MFA flow by User ID.
|
|
11802
|
+
* Before getting codes, they must be generated using
|
|
11803
|
+
* [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
|
|
11804
|
+
* method.
|
|
11704
11805
|
*
|
|
11705
11806
|
* @param {string} userId
|
|
11706
|
-
* @param {AuthenticatorType} type
|
|
11707
11807
|
* @throws {AppwriteException}
|
|
11708
11808
|
* @returns {Promise}
|
|
11709
11809
|
*/
|
|
11710
|
-
|
|
11810
|
+
getMfaRecoveryCodes(userId) {
|
|
11711
11811
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11712
11812
|
if (typeof userId === 'undefined') {
|
|
11713
11813
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
11714
11814
|
}
|
|
11715
|
-
|
|
11716
|
-
|
|
11815
|
+
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
11816
|
+
const payload = {};
|
|
11817
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11818
|
+
return yield this.client.call('get', uri, {
|
|
11819
|
+
'content-type': 'application/json',
|
|
11820
|
+
}, payload);
|
|
11821
|
+
});
|
|
11822
|
+
}
|
|
11823
|
+
/**
|
|
11824
|
+
* Regenerate MFA Recovery Codes
|
|
11825
|
+
*
|
|
11826
|
+
* Regenerate recovery codes that can be used as backup for MFA flow by User
|
|
11827
|
+
* ID. Before regenerating codes, they must be first generated using
|
|
11828
|
+
* [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
|
|
11829
|
+
* method.
|
|
11830
|
+
*
|
|
11831
|
+
* @param {string} userId
|
|
11832
|
+
* @throws {AppwriteException}
|
|
11833
|
+
* @returns {Promise}
|
|
11834
|
+
*/
|
|
11835
|
+
updateMfaRecoveryCodes(userId) {
|
|
11836
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11837
|
+
if (typeof userId === 'undefined') {
|
|
11838
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
11717
11839
|
}
|
|
11718
|
-
const apiPath = '/users/{userId}/mfa/
|
|
11840
|
+
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
11719
11841
|
const payload = {};
|
|
11720
11842
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11721
|
-
return yield this.client.call('
|
|
11843
|
+
return yield this.client.call('put', uri, {
|
|
11844
|
+
'content-type': 'application/json',
|
|
11845
|
+
}, payload);
|
|
11846
|
+
});
|
|
11847
|
+
}
|
|
11848
|
+
/**
|
|
11849
|
+
* Create MFA Recovery Codes
|
|
11850
|
+
*
|
|
11851
|
+
* Generate recovery codes used as backup for MFA flow for User ID. Recovery
|
|
11852
|
+
* codes can be used as a MFA verification type in
|
|
11853
|
+
* [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
|
|
11854
|
+
* method by client SDK.
|
|
11855
|
+
*
|
|
11856
|
+
* @param {string} userId
|
|
11857
|
+
* @throws {AppwriteException}
|
|
11858
|
+
* @returns {Promise}
|
|
11859
|
+
*/
|
|
11860
|
+
createMfaRecoveryCodes(userId) {
|
|
11861
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11862
|
+
if (typeof userId === 'undefined') {
|
|
11863
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
11864
|
+
}
|
|
11865
|
+
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
11866
|
+
const payload = {};
|
|
11867
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11868
|
+
return yield this.client.call('patch', uri, {
|
|
11722
11869
|
'content-type': 'application/json',
|
|
11723
11870
|
}, payload);
|
|
11724
11871
|
});
|
|
@@ -12616,18 +12763,19 @@
|
|
|
12616
12763
|
}
|
|
12617
12764
|
}
|
|
12618
12765
|
|
|
12619
|
-
exports.AuthenticationFactor = void 0;
|
|
12620
|
-
(function (AuthenticationFactor) {
|
|
12621
|
-
AuthenticationFactor["Totp"] = "totp";
|
|
12622
|
-
AuthenticationFactor["Phone"] = "phone";
|
|
12623
|
-
AuthenticationFactor["Email"] = "email";
|
|
12624
|
-
})(exports.AuthenticationFactor || (exports.AuthenticationFactor = {}));
|
|
12625
|
-
|
|
12626
12766
|
exports.AuthenticatorType = void 0;
|
|
12627
12767
|
(function (AuthenticatorType) {
|
|
12628
12768
|
AuthenticatorType["Totp"] = "totp";
|
|
12629
12769
|
})(exports.AuthenticatorType || (exports.AuthenticatorType = {}));
|
|
12630
12770
|
|
|
12771
|
+
exports.AuthenticationFactor = void 0;
|
|
12772
|
+
(function (AuthenticationFactor) {
|
|
12773
|
+
AuthenticationFactor["Email"] = "email";
|
|
12774
|
+
AuthenticationFactor["Phone"] = "phone";
|
|
12775
|
+
AuthenticationFactor["Totp"] = "totp";
|
|
12776
|
+
AuthenticationFactor["Recoverycode"] = "recoverycode";
|
|
12777
|
+
})(exports.AuthenticationFactor || (exports.AuthenticationFactor = {}));
|
|
12778
|
+
|
|
12631
12779
|
exports.OAuthProvider = void 0;
|
|
12632
12780
|
(function (OAuthProvider) {
|
|
12633
12781
|
OAuthProvider["Amazon"] = "amazon";
|
|
@@ -13427,6 +13575,11 @@
|
|
|
13427
13575
|
UserUsageRange["NinetyDays"] = "90d";
|
|
13428
13576
|
})(exports.UserUsageRange || (exports.UserUsageRange = {}));
|
|
13429
13577
|
|
|
13578
|
+
exports.Type = void 0;
|
|
13579
|
+
(function (Type) {
|
|
13580
|
+
Type["Totp"] = "totp";
|
|
13581
|
+
})(exports.Type || (exports.Type = {}));
|
|
13582
|
+
|
|
13430
13583
|
exports.MessagingProviderType = void 0;
|
|
13431
13584
|
(function (MessagingProviderType) {
|
|
13432
13585
|
MessagingProviderType["Email"] = "email";
|
|
@@ -6,8 +6,8 @@ const client = new Client()
|
|
|
6
6
|
|
|
7
7
|
const account = new Account(client);
|
|
8
8
|
|
|
9
|
-
const result = await account.
|
|
10
|
-
AuthenticationFactor.
|
|
9
|
+
const result = await account.createMfaChallenge(
|
|
10
|
+
AuthenticationFactor.Email // factor
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
console.log(response);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new Account(client);
|
|
8
|
+
|
|
9
|
+
const result = await account.createMfaRecoveryCodes();
|
|
10
|
+
|
|
11
|
+
console.log(response);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new Account(client);
|
|
8
|
+
|
|
9
|
+
const result = await account.getMfaRecoveryCodes();
|
|
10
|
+
|
|
11
|
+
console.log(response);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const account = new Account(client);
|
|
8
|
+
|
|
9
|
+
const result = await account.updateMfaRecoveryCodes();
|
|
10
|
+
|
|
11
|
+
console.log(response);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Client, Users } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const users = new Users(client);
|
|
8
|
+
|
|
9
|
+
const result = await users.createMfaRecoveryCodes(
|
|
10
|
+
'<USER_ID>' // userId
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
console.log(response);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, Users,
|
|
1
|
+
import { Client, Users, } from "@appwrite.io/console";
|
|
2
2
|
|
|
3
3
|
const client = new Client()
|
|
4
4
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
@@ -6,9 +6,9 @@ const client = new Client()
|
|
|
6
6
|
|
|
7
7
|
const users = new Users(client);
|
|
8
8
|
|
|
9
|
-
const result = await users.
|
|
9
|
+
const result = await users.deleteMfaAuthenticator(
|
|
10
10
|
'<USER_ID>', // userId
|
|
11
|
-
|
|
11
|
+
.Totp // type
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
console.log(response);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Client, Users } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const users = new Users(client);
|
|
8
|
+
|
|
9
|
+
const result = await users.getMfaRecoveryCodes(
|
|
10
|
+
'<USER_ID>' // userId
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
console.log(response);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Client, Users } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client()
|
|
4
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
5
|
+
.setProject('5df5acd0d48c2'); // Your project ID
|
|
6
|
+
|
|
7
|
+
const users = new Users(client);
|
|
8
|
+
|
|
9
|
+
const result = await users.updateMfaRecoveryCodes(
|
|
10
|
+
'<USER_ID>' // userId
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
console.log(response);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@appwrite.io/console",
|
|
3
3
|
"homepage": "https://appwrite.io/support",
|
|
4
4
|
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
|
|
5
|
-
"version": "0.6.0-rc.
|
|
5
|
+
"version": "0.6.0-rc.16",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
package/src/client.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -22,8 +22,8 @@ export type { QueryTypes, QueryTypesList } from './query';
|
|
|
22
22
|
export { Permission } from './permission';
|
|
23
23
|
export { Role } from './role';
|
|
24
24
|
export { ID } from './id';
|
|
25
|
-
export { AuthenticationFactor } from './enums/authentication-factor';
|
|
26
25
|
export { AuthenticatorType } from './enums/authenticator-type';
|
|
26
|
+
export { AuthenticationFactor } from './enums/authentication-factor';
|
|
27
27
|
export { OAuthProvider } from './enums/o-auth-provider';
|
|
28
28
|
export { Browser } from './enums/browser';
|
|
29
29
|
export { CreditCard } from './enums/credit-card';
|
|
@@ -54,4 +54,5 @@ export { ImageFormat } from './enums/image-format';
|
|
|
54
54
|
export { StorageUsageRange } from './enums/storage-usage-range';
|
|
55
55
|
export { PasswordHash } from './enums/password-hash';
|
|
56
56
|
export { UserUsageRange } from './enums/user-usage-range';
|
|
57
|
+
export { Type } from './enums/type';
|
|
57
58
|
export { MessagingProviderType } from './enums/messaging-provider-type';
|