@cloudbase/js-sdk 2.24.4 → 2.24.6
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/index.d.ts +395 -53
- package/miniprogram_dist/app.js +1 -1
- package/miniprogram_dist/auth.js +1 -1
- package/miniprogram_dist/cloudrun.js +1 -1
- package/miniprogram_dist/functions.js +1 -1
- package/miniprogram_dist/index.js +1 -1
- package/package.json +15 -15
package/index.d.ts
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
import { OrmClient, OrmRawQueryClient } from '@cloudbase/model';
|
|
2
2
|
import { IMySqlClient } from '@cloudbase/mysql';
|
|
3
3
|
import { authModels } from '@cloudbase/oauth';
|
|
4
|
+
import type {
|
|
5
|
+
SignInRes,
|
|
6
|
+
GetUserRes,
|
|
7
|
+
CommonRes,
|
|
8
|
+
SignInWithOtpRes,
|
|
9
|
+
SignInOAuthRes,
|
|
10
|
+
GetClaimsRes,
|
|
11
|
+
ResetPasswordForEmailRes,
|
|
12
|
+
GetUserIdentitiesRes,
|
|
13
|
+
LinkIdentityRes,
|
|
14
|
+
ReauthenticateRes,
|
|
15
|
+
ResendRes,
|
|
16
|
+
UpdateUserWithVerificationRes,
|
|
17
|
+
OnAuthStateChangeCallback,
|
|
18
|
+
SignInWithPasswordReq,
|
|
19
|
+
SignInWithIdTokenReq,
|
|
20
|
+
SignInWithOAuthReq,
|
|
21
|
+
VerifyOAuthReq,
|
|
22
|
+
VerifyOtpReq,
|
|
23
|
+
LinkIdentityReq,
|
|
24
|
+
UnlinkIdentityReq,
|
|
25
|
+
UpdateUserReq,
|
|
26
|
+
SignInWithOtpReq,
|
|
27
|
+
ResetPasswordForOldReq,
|
|
28
|
+
ResendReq,
|
|
29
|
+
SetSessionReq,
|
|
30
|
+
DeleteMeReq,
|
|
31
|
+
SignUpRes
|
|
32
|
+
} from '@cloudbase/auth';
|
|
4
33
|
import { AI } from '@cloudbase/ai';
|
|
5
34
|
import { CloudbaseAdapter, ResponseObject } from '@cloudbase/adapter-interface'
|
|
6
35
|
import { ICloudbaseUpgradedConfig, ICloudbase, Persistence } from '@cloudbase/types'
|
|
@@ -260,7 +289,7 @@ declare namespace cloudbase.app {
|
|
|
260
289
|
*
|
|
261
290
|
* @return {!cloudbase.auth.App} Auth实例
|
|
262
291
|
*/
|
|
263
|
-
auth(options?: { persistence: cloudbase.auth.Persistence })
|
|
292
|
+
auth: ((options?: { persistence: cloudbase.auth.Persistence }) => cloudbase.auth.App) & cloudbase.auth.App
|
|
264
293
|
/**
|
|
265
294
|
* 调用云函数
|
|
266
295
|
*
|
|
@@ -690,7 +719,7 @@ declare namespace cloudbase.auth {
|
|
|
690
719
|
/**
|
|
691
720
|
* 获取当前登录的用户信息-同步操作
|
|
692
721
|
*
|
|
693
|
-
* {@link https://docs.cloudbase.net/api-reference/
|
|
722
|
+
* {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authhasloginstate}
|
|
694
723
|
*
|
|
695
724
|
* @example
|
|
696
725
|
* ```javascript
|
|
@@ -704,7 +733,7 @@ declare namespace cloudbase.auth {
|
|
|
704
733
|
*/
|
|
705
734
|
currentUser: IUser | null
|
|
706
735
|
/**
|
|
707
|
-
* 获取当前登录的用户信息-异步操作,文档 {@link https://docs.cloudbase.net/api-reference/
|
|
736
|
+
* 获取当前登录的用户信息-异步操作,文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authgetcurrentuser}
|
|
708
737
|
*
|
|
709
738
|
* @example
|
|
710
739
|
* ```javascript
|
|
@@ -722,7 +751,7 @@ declare namespace cloudbase.auth {
|
|
|
722
751
|
/**
|
|
723
752
|
* 绑定手机号码
|
|
724
753
|
*
|
|
725
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
754
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authbindphonenumber}
|
|
726
755
|
*
|
|
727
756
|
* @param params
|
|
728
757
|
*/
|
|
@@ -730,7 +759,7 @@ declare namespace cloudbase.auth {
|
|
|
730
759
|
/**
|
|
731
760
|
* 绑定邮箱
|
|
732
761
|
*
|
|
733
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
762
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authbindemail}
|
|
734
763
|
*
|
|
735
764
|
* @param params
|
|
736
765
|
*/
|
|
@@ -738,7 +767,7 @@ declare namespace cloudbase.auth {
|
|
|
738
767
|
/**
|
|
739
768
|
* 解除三方绑定
|
|
740
769
|
*
|
|
741
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
770
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authunbindprovider}
|
|
742
771
|
*
|
|
743
772
|
* @param params
|
|
744
773
|
*/
|
|
@@ -747,7 +776,7 @@ declare namespace cloudbase.auth {
|
|
|
747
776
|
/**
|
|
748
777
|
* 验证码验证
|
|
749
778
|
*
|
|
750
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
779
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authverify}
|
|
751
780
|
*
|
|
752
781
|
* @param params
|
|
753
782
|
*/
|
|
@@ -755,63 +784,105 @@ declare namespace cloudbase.auth {
|
|
|
755
784
|
/**
|
|
756
785
|
* 获取验证码
|
|
757
786
|
*
|
|
758
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
787
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authgetverification}
|
|
759
788
|
*
|
|
760
789
|
* @param params
|
|
790
|
+
* @param options
|
|
761
791
|
*/
|
|
762
|
-
getVerification(params: authModels.GetVerificationRequest): Promise<authModels.GetVerificationResponse>
|
|
792
|
+
getVerification(params: authModels.GetVerificationRequest, options?: { withCaptcha: boolean }): Promise<authModels.GetVerificationResponse>
|
|
763
793
|
/**
|
|
764
794
|
* 匿名登录
|
|
765
795
|
*
|
|
766
796
|
*
|
|
767
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
797
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authsigninanonymously}
|
|
768
798
|
*
|
|
769
799
|
*/
|
|
770
|
-
signInAnonymously(data?: { provider_token?: string }): Promise<
|
|
800
|
+
signInAnonymously(data?: { provider_token?: string }): Promise<SignInRes>
|
|
771
801
|
/**
|
|
772
|
-
*
|
|
802
|
+
* 小程序匿名登录
|
|
773
803
|
*
|
|
774
|
-
*
|
|
804
|
+
* @param params
|
|
805
|
+
*/
|
|
806
|
+
signInAnonymouslyInWx(params?: { useWxCloud?: boolean }): Promise<ILoginState>
|
|
807
|
+
/**
|
|
808
|
+
* 小程序绑定OpenID
|
|
775
809
|
*
|
|
810
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authbindopenid}
|
|
776
811
|
*
|
|
777
|
-
* @param getTickFn
|
|
778
812
|
*/
|
|
779
|
-
|
|
813
|
+
bindOpenId(): Promise<void>
|
|
780
814
|
/**
|
|
781
|
-
*
|
|
815
|
+
* 小程序unionId静默登录
|
|
816
|
+
*
|
|
817
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authsigninwithunionid}
|
|
782
818
|
*
|
|
783
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#authsigninwithcustomticket}
|
|
784
819
|
*/
|
|
785
|
-
|
|
820
|
+
signInWithUnionId(): Promise<ILoginState>
|
|
786
821
|
/**
|
|
787
|
-
*
|
|
822
|
+
* 短信验证码登录
|
|
823
|
+
*
|
|
824
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authsigninwithsms}
|
|
788
825
|
*
|
|
789
|
-
*
|
|
826
|
+
* @param params
|
|
790
827
|
*/
|
|
791
|
-
|
|
828
|
+
signInWithSms(params: {
|
|
829
|
+
verificationInfo?: { verification_id: string; is_user: boolean }
|
|
830
|
+
verificationCode?: string
|
|
831
|
+
phoneNum?: string
|
|
832
|
+
bindInfo?: any
|
|
833
|
+
}): Promise<ILoginState>
|
|
792
834
|
/**
|
|
793
|
-
*
|
|
835
|
+
* 邮箱验证码登录
|
|
794
836
|
*
|
|
795
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
837
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authsigninwithemail}
|
|
838
|
+
*
|
|
839
|
+
* @param params
|
|
796
840
|
*/
|
|
797
|
-
|
|
841
|
+
signInWithEmail(params: {
|
|
842
|
+
verificationInfo?: { verification_id: string; is_user: boolean }
|
|
843
|
+
verificationCode?: string
|
|
844
|
+
email?: string
|
|
845
|
+
bindInfo?: any
|
|
846
|
+
}): Promise<ILoginState>
|
|
847
|
+
/**
|
|
848
|
+
* 设置获取自定义登录 ticket 的函数
|
|
849
|
+
*
|
|
850
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authsetcustomsignfunc}
|
|
851
|
+
*
|
|
852
|
+
*
|
|
853
|
+
* @param getTickFn
|
|
854
|
+
*/
|
|
855
|
+
setCustomSignFunc(getTickFn: authModels.GetCustomSignTicketFn): void
|
|
798
856
|
/**
|
|
799
857
|
* 设置密码(已登录状态下,更新用户密码)
|
|
800
858
|
*
|
|
801
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
859
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authsetpassword}
|
|
802
860
|
*
|
|
803
861
|
*/
|
|
804
862
|
setPassword(params: authModels.SetPasswordRequest): Promise<void>
|
|
805
863
|
/**
|
|
806
864
|
* 获取用户信息
|
|
807
865
|
*
|
|
808
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
866
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authgetuserinfo}
|
|
809
867
|
*/
|
|
810
868
|
getUserInfo(): Promise<IUserInfo>
|
|
869
|
+
/**
|
|
870
|
+
* 获取微搭插件用户信息
|
|
871
|
+
*
|
|
872
|
+
*/
|
|
873
|
+
getWedaUserInfo(): Promise<any>
|
|
874
|
+
/**
|
|
875
|
+
* 更新用户基本信息
|
|
876
|
+
*
|
|
877
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authupdateuserbasicinfo}
|
|
878
|
+
*
|
|
879
|
+
* @param params
|
|
880
|
+
*/
|
|
881
|
+
updateUserBasicInfo(params: authModels.ModifyUserBasicInfoRequest): Promise<void>
|
|
811
882
|
/**
|
|
812
883
|
* 获取本地登录态-同步操作
|
|
813
884
|
*
|
|
814
|
-
* {@link https://docs.cloudbase.net/api-reference/
|
|
885
|
+
* {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authhasloginstate}
|
|
815
886
|
*
|
|
816
887
|
* @example
|
|
817
888
|
* ```javascript
|
|
@@ -827,7 +898,7 @@ declare namespace cloudbase.auth {
|
|
|
827
898
|
/**
|
|
828
899
|
* 获取本地登录态-异步操作
|
|
829
900
|
*
|
|
830
|
-
* {@link https://docs.cloudbase.net/api-reference/
|
|
901
|
+
* {@link https://docs.cloudbase.net/api-reference/webv2/authentication.html#auth-getloginstate}
|
|
831
902
|
*
|
|
832
903
|
* @example
|
|
833
904
|
* ```javascript
|
|
@@ -849,40 +920,44 @@ declare namespace cloudbase.auth {
|
|
|
849
920
|
/**
|
|
850
921
|
* 为已有账户绑定第三方账户
|
|
851
922
|
*
|
|
852
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
923
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authbindwithprovider}
|
|
853
924
|
*/
|
|
854
925
|
bindWithProvider(params: authModels.BindWithProviderRequest): Promise<void>
|
|
855
926
|
/**
|
|
856
927
|
* 查询用户(自定义登录场景和匿名登录场景,不支持使用该接口查询用户信息)
|
|
857
928
|
*
|
|
858
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
929
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authqueryuser}
|
|
859
930
|
*
|
|
860
931
|
*/
|
|
861
932
|
queryUser(queryObj: authModels.QueryUserProfileRequest): Promise<authModels.QueryUserProfileResponse>
|
|
862
933
|
/**
|
|
863
934
|
* 获取当前登录用户的访问凭证
|
|
864
935
|
*
|
|
865
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
936
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authgetaccesstoken}
|
|
866
937
|
*/
|
|
867
938
|
getAccessToken(): Promise<{ accessToken: string; env: string }>
|
|
868
939
|
/**
|
|
869
940
|
* 提供第三方平台登录 token
|
|
870
941
|
*
|
|
871
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
942
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authgrantprovidertoken}
|
|
872
943
|
*/
|
|
873
944
|
grantProviderToken(params: authModels.GrantProviderTokenRequest): Promise<authModels.GrantProviderTokenResponse>
|
|
874
945
|
patchProviderToken(params: authModels.PatchProviderTokenRequest): Promise<authModels.PatchProviderTokenResponse>
|
|
875
946
|
/**
|
|
876
947
|
* 第三方平台登录
|
|
877
948
|
*
|
|
878
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
949
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authsigninwithprovider}
|
|
879
950
|
*/
|
|
880
951
|
signInWithProvider(params: authModels.SignInWithProviderRequest): Promise<ILoginState>
|
|
952
|
+
/**
|
|
953
|
+
* 微信登录
|
|
954
|
+
*/
|
|
955
|
+
signInWithWechat(params?: any): Promise<ILoginState>
|
|
881
956
|
grantToken(params: authModels.GrantTokenRequest): Promise<ILoginState>
|
|
882
957
|
/**
|
|
883
958
|
* 生成第三方平台授权 Uri (如微信二维码扫码授权网页)
|
|
884
959
|
*
|
|
885
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
960
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authgenproviderredirecturi}
|
|
886
961
|
*/
|
|
887
962
|
genProviderRedirectUri(
|
|
888
963
|
params: authModels.GenProviderRedirectUriRequest,
|
|
@@ -890,57 +965,100 @@ declare namespace cloudbase.auth {
|
|
|
890
965
|
/**
|
|
891
966
|
* 重置密码(用户忘记密码无法登录时,可使用该接口强制设置密码)
|
|
892
967
|
*
|
|
893
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
968
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authresetpassword}
|
|
894
969
|
*/
|
|
895
970
|
resetPassword(params: authModels.ResetPasswordRequest): Promise<void>
|
|
896
971
|
deviceAuthorize(params: authModels.DeviceAuthorizeRequest): Promise<authModels.DeviceAuthorizeResponse>
|
|
897
972
|
/**
|
|
898
973
|
* 通过 sudo 接口获取高级操作权限,如修改用户密码,修改手机号,邮箱等操作
|
|
899
974
|
*
|
|
900
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
975
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authsudo}
|
|
901
976
|
*/
|
|
902
977
|
sudo(params: authModels.SudoRequest): Promise<authModels.SudoResponse>
|
|
903
978
|
/**
|
|
904
979
|
* 删除用户
|
|
905
980
|
*
|
|
906
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
981
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authdeleteme}
|
|
907
982
|
*/
|
|
908
983
|
deleteMe(params: authModels.WithSudoRequest): Promise<authModels.UserProfile>
|
|
909
984
|
/**
|
|
910
985
|
* 获取第三方绑定列表
|
|
911
986
|
*
|
|
912
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
987
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authgetproviders}
|
|
913
988
|
*/
|
|
914
989
|
getProviders(): Promise<authModels.UserProfileProvider>
|
|
915
990
|
/**
|
|
916
991
|
* 用于查询用户是否为匿名登录状态
|
|
917
992
|
*
|
|
918
|
-
* 文档 {@link https://docs.cloudbase.net/api-reference/
|
|
993
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authloginscope}
|
|
919
994
|
*/
|
|
920
995
|
loginScope(): Promise<string>
|
|
921
996
|
loginGroups(): Promise<string[]>
|
|
922
997
|
onLoginStateChanged(callback: Function)
|
|
923
|
-
createLoginState(): Promise<ILoginState>
|
|
998
|
+
createLoginState(params?: { version?: string; query?: any }, options?: { asyncRefreshUser?: boolean; userInfo?: any }): Promise<ILoginState>
|
|
924
999
|
/**
|
|
925
|
-
*
|
|
1000
|
+
* 强制刷新token
|
|
926
1001
|
*
|
|
927
|
-
*
|
|
1002
|
+
* @param params
|
|
1003
|
+
*/
|
|
1004
|
+
refreshTokenForce(params: { version?: string }): Promise<authModels.Credentials>
|
|
1005
|
+
/**
|
|
1006
|
+
* 获取身份信息
|
|
928
1007
|
*
|
|
929
|
-
* @
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
*
|
|
934
|
-
* app.auth().signOut().then(()=>{});
|
|
935
|
-
* ```
|
|
1008
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authgetcredentials}
|
|
1009
|
+
*/
|
|
1010
|
+
getCredentials(): Promise<authModels.Credentials>
|
|
1011
|
+
/**
|
|
1012
|
+
* 写入身份信息
|
|
936
1013
|
*
|
|
937
|
-
* @
|
|
1014
|
+
* @param credentials
|
|
1015
|
+
*/
|
|
1016
|
+
setCredentials(credentials: authModels.Credentials): Promise<void>
|
|
1017
|
+
/**
|
|
1018
|
+
* 获取身份源类型
|
|
1019
|
+
*
|
|
1020
|
+
*/
|
|
1021
|
+
getProviderSubType(): Promise<authModels.ProviderSubType>
|
|
1022
|
+
/**
|
|
1023
|
+
* 创建验证码数据
|
|
1024
|
+
*
|
|
1025
|
+
* @param params
|
|
938
1026
|
*/
|
|
939
|
-
|
|
1027
|
+
createCaptchaData(params: { state: string; redirect_uri?: string }): Promise<any>
|
|
1028
|
+
/**
|
|
1029
|
+
* 验证验证码数据
|
|
1030
|
+
*
|
|
1031
|
+
* @param params
|
|
1032
|
+
*/
|
|
1033
|
+
verifyCaptchaData(params: { token: string; key: string }): Promise<any>
|
|
1034
|
+
/**
|
|
1035
|
+
* 修改密码
|
|
1036
|
+
*
|
|
1037
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authmodifypassword}
|
|
1038
|
+
*
|
|
1039
|
+
* @param params
|
|
1040
|
+
*/
|
|
1041
|
+
modifyPassword(params: authModels.ModifyUserBasicInfoRequest): Promise<void>
|
|
1042
|
+
/**
|
|
1043
|
+
* 未登录状态修改密码
|
|
1044
|
+
*
|
|
1045
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authmodifypasswordwithoutlogin}
|
|
1046
|
+
*
|
|
1047
|
+
* @param params
|
|
1048
|
+
*/
|
|
1049
|
+
modifyPasswordWithoutLogin(params: authModels.ModifyPasswordWithoutLoginRequest): Promise<void>
|
|
1050
|
+
/**
|
|
1051
|
+
* 获取用户行为日志
|
|
1052
|
+
*
|
|
1053
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authgetuserbehaviorlog}
|
|
1054
|
+
*
|
|
1055
|
+
* @param params
|
|
1056
|
+
*/
|
|
1057
|
+
getUserBehaviorLog(params: authModels.GetUserBehaviorLog): Promise<authModels.GetUserBehaviorLogRes>
|
|
940
1058
|
/**
|
|
941
1059
|
* 检查用户名是否被绑定过
|
|
942
1060
|
*
|
|
943
|
-
* {@link https://docs.cloudbase.net/api-reference/
|
|
1061
|
+
* {@link https://docs.cloudbase.net/api-reference/webv2/authentication.html#authisusernameregistered}
|
|
944
1062
|
*
|
|
945
1063
|
* @example
|
|
946
1064
|
* ```javascript
|
|
@@ -963,7 +1081,231 @@ declare namespace cloudbase.auth {
|
|
|
963
1081
|
getMiniProgramQrCodeStatus(
|
|
964
1082
|
params: authModels.GetMiniProgramQrCodeStatusRequest,
|
|
965
1083
|
): Promise<authModels.GetMiniProgramQrCodeStatusResponse>
|
|
966
|
-
|
|
1084
|
+
/**
|
|
1085
|
+
* 跳转到默认登录页
|
|
1086
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authtodefaultloginpage}
|
|
1087
|
+
* @param params
|
|
1088
|
+
*/
|
|
1089
|
+
toDefaultLoginPage(params?: authModels.ToDefaultLoginPage): Promise<CommonRes>
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* 退出登录
|
|
1094
|
+
*
|
|
1095
|
+
* {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signout}
|
|
1096
|
+
*
|
|
1097
|
+
* @example
|
|
1098
|
+
* ```javascript
|
|
1099
|
+
* const app = cloudbase.init({
|
|
1100
|
+
* env: "xxxx-yyy"
|
|
1101
|
+
* });
|
|
1102
|
+
* app.auth.signOut().then(()=>{});
|
|
1103
|
+
* ```
|
|
1104
|
+
*
|
|
1105
|
+
* @return Promise
|
|
1106
|
+
*/
|
|
1107
|
+
signOut(params?: authModels.SignoutRequest): Promise<void | authModels.SignoutReponse>
|
|
1108
|
+
/**
|
|
1109
|
+
* 使用自定义登录 ticket 登录
|
|
1110
|
+
*
|
|
1111
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signinwithcustomticket}
|
|
1112
|
+
*
|
|
1113
|
+
* @param getTickFn
|
|
1114
|
+
*/
|
|
1115
|
+
signInWithCustomTicket(getTickFn?: authModels.GetCustomSignTicketFn): Promise<ILoginState>
|
|
1116
|
+
/**
|
|
1117
|
+
* 用户登录,目前支持手机号,邮箱,用户名密码登录
|
|
1118
|
+
*
|
|
1119
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signin}
|
|
1120
|
+
*/
|
|
1121
|
+
signIn(params: authModels.SignInRequest): Promise<ILoginState>
|
|
1122
|
+
/**
|
|
1123
|
+
* 用户注册,目前支持手机号验证码注册,邮箱验证码注册
|
|
1124
|
+
*
|
|
1125
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signup}
|
|
1126
|
+
*/
|
|
1127
|
+
signUp(params: authModels.SignUpRequest): Promise<SignUpRes>
|
|
1128
|
+
/**
|
|
1129
|
+
* 监听认证状态变化
|
|
1130
|
+
*
|
|
1131
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#onauthstatechange}
|
|
1132
|
+
*
|
|
1133
|
+
* @param callback
|
|
1134
|
+
*/
|
|
1135
|
+
onAuthStateChange(callback: OnAuthStateChangeCallback): { data: { subscription: { id: string; callback: Function; unsubscribe: () => void } } }
|
|
1136
|
+
/**
|
|
1137
|
+
* 使用用户名和密码登录
|
|
1138
|
+
*
|
|
1139
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signinwithpassword}
|
|
1140
|
+
*
|
|
1141
|
+
* @param params
|
|
1142
|
+
*/
|
|
1143
|
+
signInWithPassword(params: SignInWithPasswordReq): Promise<SignInRes>
|
|
1144
|
+
/**
|
|
1145
|
+
* 使用第三方平台 ID Token 登录
|
|
1146
|
+
*
|
|
1147
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signinwithidtoken}
|
|
1148
|
+
*
|
|
1149
|
+
* @param params
|
|
1150
|
+
*/
|
|
1151
|
+
signInWithIdToken(params: SignInWithIdTokenReq): Promise<SignInRes>
|
|
1152
|
+
/**
|
|
1153
|
+
* 使用一次性密码(OTP)登录
|
|
1154
|
+
*
|
|
1155
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signinwithotp}
|
|
1156
|
+
*
|
|
1157
|
+
* @param params
|
|
1158
|
+
*/
|
|
1159
|
+
signInWithOtp(params: SignInWithOtpReq): Promise<SignInWithOtpRes>
|
|
1160
|
+
/**
|
|
1161
|
+
* 校验第三方平台授权登录回调
|
|
1162
|
+
*
|
|
1163
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#verifyoauth}
|
|
1164
|
+
*
|
|
1165
|
+
* @param params
|
|
1166
|
+
*/
|
|
1167
|
+
verifyOAuth(params?: VerifyOAuthReq): Promise<SignInRes>
|
|
1168
|
+
/**
|
|
1169
|
+
* 生成第三方平台授权 Uri
|
|
1170
|
+
*
|
|
1171
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signinwithoauth}
|
|
1172
|
+
*
|
|
1173
|
+
* @param params
|
|
1174
|
+
*/
|
|
1175
|
+
signInWithOAuth(params: SignInWithOAuthReq): Promise<SignInOAuthRes>
|
|
1176
|
+
/**
|
|
1177
|
+
* 获取当前访问令牌中的声明信息
|
|
1178
|
+
*
|
|
1179
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#getclaims}
|
|
1180
|
+
*/
|
|
1181
|
+
getClaims(): Promise<GetClaimsRes>
|
|
1182
|
+
/**
|
|
1183
|
+
* 通过邮箱重置密码
|
|
1184
|
+
*
|
|
1185
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#resetpasswordforemail}
|
|
1186
|
+
*
|
|
1187
|
+
* @param emailOrPhone
|
|
1188
|
+
* @param options
|
|
1189
|
+
*/
|
|
1190
|
+
resetPasswordForEmail(emailOrPhone: string, options?: { redirectTo?: string }): Promise<ResetPasswordForEmailRes>
|
|
1191
|
+
/**
|
|
1192
|
+
* 通过旧密码重置密码
|
|
1193
|
+
*
|
|
1194
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#resetpasswordforold}
|
|
1195
|
+
*
|
|
1196
|
+
* @param params
|
|
1197
|
+
*/
|
|
1198
|
+
resetPasswordForOld(params: ResetPasswordForOldReq): Promise<SignInRes>
|
|
1199
|
+
/**
|
|
1200
|
+
* 验证一次性密码(OTP)
|
|
1201
|
+
*
|
|
1202
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#verifyotp}
|
|
1203
|
+
*
|
|
1204
|
+
* @param params
|
|
1205
|
+
*/
|
|
1206
|
+
verifyOtp(params: VerifyOtpReq): Promise<SignInRes>
|
|
1207
|
+
/**
|
|
1208
|
+
* 获取当前会话
|
|
1209
|
+
*
|
|
1210
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#getsession}
|
|
1211
|
+
*/
|
|
1212
|
+
getSession(): Promise<SignInRes>
|
|
1213
|
+
/**
|
|
1214
|
+
* 刷新会话
|
|
1215
|
+
*
|
|
1216
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#refreshsession}
|
|
1217
|
+
*
|
|
1218
|
+
* @param refresh_token
|
|
1219
|
+
*/
|
|
1220
|
+
refreshSession(refresh_token?: string): Promise<SignInRes>
|
|
1221
|
+
/**
|
|
1222
|
+
* 获取当前用户详细信息
|
|
1223
|
+
*
|
|
1224
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#getuser}
|
|
1225
|
+
*/
|
|
1226
|
+
getUser(): Promise<GetUserRes>
|
|
1227
|
+
/**
|
|
1228
|
+
* 刷新用户信息
|
|
1229
|
+
*
|
|
1230
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#refreshuser}
|
|
1231
|
+
*/
|
|
1232
|
+
refreshUser(): Promise<CommonRes>
|
|
1233
|
+
/**
|
|
1234
|
+
* 更新用户信息
|
|
1235
|
+
*
|
|
1236
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#updateuser}
|
|
1237
|
+
*
|
|
1238
|
+
* @param params
|
|
1239
|
+
*/
|
|
1240
|
+
updateUser(params: UpdateUserReq): Promise<GetUserRes | UpdateUserWithVerificationRes>
|
|
1241
|
+
/**
|
|
1242
|
+
* 获取已绑定的身份源
|
|
1243
|
+
*
|
|
1244
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#getuseridentities}
|
|
1245
|
+
*/
|
|
1246
|
+
getUserIdentities(): Promise<GetUserIdentitiesRes>
|
|
1247
|
+
/**
|
|
1248
|
+
* 绑定身份源到当前用户
|
|
1249
|
+
*
|
|
1250
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#linkidentity}
|
|
1251
|
+
*
|
|
1252
|
+
* @param params
|
|
1253
|
+
*/
|
|
1254
|
+
linkIdentity(params: LinkIdentityReq): Promise<LinkIdentityRes>
|
|
1255
|
+
/**
|
|
1256
|
+
* 解绑身份源
|
|
1257
|
+
*
|
|
1258
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#unlinkidentity}
|
|
1259
|
+
*
|
|
1260
|
+
* @param params
|
|
1261
|
+
*/
|
|
1262
|
+
unlinkIdentity(params: UnlinkIdentityReq): Promise<CommonRes>
|
|
1263
|
+
/**
|
|
1264
|
+
* 重新认证
|
|
1265
|
+
*
|
|
1266
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#reauthenticate}
|
|
1267
|
+
*/
|
|
1268
|
+
reauthenticate(): Promise<ReauthenticateRes>
|
|
1269
|
+
/**
|
|
1270
|
+
* 重新发送验证码
|
|
1271
|
+
*
|
|
1272
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#resend}
|
|
1273
|
+
*
|
|
1274
|
+
* @param params
|
|
1275
|
+
*/
|
|
1276
|
+
resend(params: ResendReq): Promise<ResendRes>
|
|
1277
|
+
/**
|
|
1278
|
+
* 使用 access_token 和 refresh_token 设置会话
|
|
1279
|
+
*
|
|
1280
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#setsession}
|
|
1281
|
+
*
|
|
1282
|
+
* @param params
|
|
1283
|
+
*/
|
|
1284
|
+
setSession(params: SetSessionReq): Promise<SignInRes>
|
|
1285
|
+
/**
|
|
1286
|
+
* 删除当前用户
|
|
1287
|
+
*
|
|
1288
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#deleteuser}
|
|
1289
|
+
*
|
|
1290
|
+
* @param params
|
|
1291
|
+
*/
|
|
1292
|
+
deleteUser(params: DeleteMeReq): Promise<CommonRes>
|
|
1293
|
+
/**
|
|
1294
|
+
* 小程序 openId 静默登录
|
|
1295
|
+
*
|
|
1296
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signinwithopenid}
|
|
1297
|
+
*
|
|
1298
|
+
* @param params
|
|
1299
|
+
*/
|
|
1300
|
+
signInWithOpenId(params?: { useWxCloud?: boolean }): Promise<SignInRes>
|
|
1301
|
+
/**
|
|
1302
|
+
* 小程序手机号授权登录
|
|
1303
|
+
*
|
|
1304
|
+
* 文档 {@link https://docs.cloudbase.net/api-reference/webv3/authentication#signinwithphoneauth}
|
|
1305
|
+
*
|
|
1306
|
+
* @param params
|
|
1307
|
+
*/
|
|
1308
|
+
signInWithPhoneAuth(params: { phoneCode: string }): Promise<SignInRes>
|
|
967
1309
|
}
|
|
968
1310
|
}
|
|
969
1311
|
/**
|