@cloudbase/js-sdk 3.8.2-beta.0 → 3.8.2-beta.2
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/ai/dist/AI.d.ts +29 -0
- package/ai/dist/bot/index.d.ts +41 -0
- package/ai/dist/bot/types.d.ts +144 -0
- package/ai/dist/errors.d.ts +10 -0
- package/ai/dist/eventsource_parser/index.d.ts +2 -0
- package/ai/dist/eventsource_parser/parse.d.ts +2 -0
- package/ai/dist/eventsource_parser/stream.d.ts +5 -0
- package/ai/dist/eventsource_parser/types.d.ts +16 -0
- package/ai/dist/index.d.ts +42 -1
- package/ai/dist/models/Ark/index.d.ts +10 -0
- package/ai/dist/models/Ark/type.d.ts +71 -0
- package/ai/dist/models/DashScope/index.d.ts +10 -0
- package/ai/dist/models/DashScope/type.d.ts +74 -0
- package/ai/dist/models/DeepSeek/index.d.ts +10 -0
- package/ai/dist/models/Default/index.d.ts +10 -0
- package/ai/dist/models/HunYuan/index.d.ts +10 -0
- package/ai/dist/models/HunYuan/type.d.ts +74 -0
- package/ai/dist/models/HunYuan/util.d.ts +4 -0
- package/ai/dist/models/HunYuanBeta/index.d.ts +10 -0
- package/ai/dist/models/HunYuanExp/index.d.ts +10 -0
- package/ai/dist/models/HunYuanOpen/index.d.ts +10 -0
- package/ai/dist/models/Moonshot/index.d.ts +10 -0
- package/ai/dist/models/Moonshot/type.d.ts +85 -0
- package/ai/dist/models/Yi/index.d.ts +10 -0
- package/ai/dist/models/Yi/type.d.ts +75 -0
- package/ai/dist/models/ZhiPu/index.d.ts +10 -0
- package/ai/dist/models/ZhiPu/type.d.ts +71 -0
- package/ai/dist/models/image-model.d.ts +19 -0
- package/ai/dist/models/index.d.ts +26 -0
- package/ai/dist/models/model.d.ts +40 -0
- package/ai/dist/type.d.ts +192 -0
- package/ai/dist/utils.d.ts +38 -0
- package/apis/dist/callApis.d.ts +20 -0
- package/apis/dist/index.d.ts +5 -1
- package/apis/dist/type.d.ts +14 -0
- package/app/dist/constants/common.d.ts +38 -0
- package/app/dist/index.d.ts +66 -7
- package/app/dist/index.esm.js +1 -1
- package/app/dist/index.js +1 -1
- package/app/dist/index.js.map +1 -1
- package/app/dist/index.node.d.ts +6 -0
- package/app/dist/index.node.esm.js +1 -1
- package/app/dist/index.node.esm.js.map +1 -1
- package/app/dist/index.node.js +1 -1
- package/app/dist/index.node.js.map +1 -1
- package/app/dist/libs/adapter-node/constants.d.ts +33 -0
- package/app/dist/libs/adapter-node/context.d.ts +18 -0
- package/app/dist/libs/adapter-node/index.d.ts +26 -0
- package/app/dist/libs/adapter-node/metadata.d.ts +14 -0
- package/app/dist/libs/adapter-node/optional-require.d.ts +1 -0
- package/app/dist/libs/adapter-node/request.d.ts +44 -0
- package/app/dist/libs/adapter-node/tool.d.ts +2 -0
- package/app/dist/libs/adapter-node/types.d.ts +103 -0
- package/app/dist/libs/adapter-node/utils.d.ts +37 -0
- package/app/dist/libs/adapter-node/wx.d.ts +39 -0
- package/app/dist/libs/adapter.d.ts +3 -0
- package/app/dist/libs/cache.d.ts +6 -0
- package/app/dist/libs/component.d.ts +3 -0
- package/app/dist/libs/lang.d.ts +23 -0
- package/app/dist/libs/request.d.ts +62 -0
- package/auth/dist/adapter.d.ts +2 -0
- package/auth/dist/index.d.ts +271 -2
- package/auth/dist/index.esm.js +1 -1
- package/auth/dist/index.esm.js.map +1 -1
- package/auth/dist/index.js +1 -1
- package/auth/dist/index.js.map +1 -1
- package/auth/dist/type.d.ts +295 -0
- package/auth/dist/utilities.d.ts +7 -0
- package/auth/dist/utils.d.ts +5 -0
- package/auth/dist/v1-compat.d.ts +77 -0
- package/cloudrun/dist/index.d.ts +4 -1
- package/container/dist/constants/index.d.ts +1 -0
- package/container/dist/go_wams_exec.d.ts +2 -0
- package/container/dist/index.d.ts +13 -2
- package/container/dist/utils/index.d.ts +3 -0
- package/container/dist/utils/loader.d.ts +8 -0
- package/container/dist/utils/request.d.ts +12 -0
- package/core.d.ts +84 -81
- package/database/dist/index.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +1 -1
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.esm.js +1 -1
- package/dist/index.node.esm.js.map +1 -1
- package/functions/dist/index.d.ts +2 -2
- package/miniprogram_dist/ai/index.d.ts +1 -1
- package/miniprogram_dist/apis/index.d.ts +1 -1
- package/miniprogram_dist/app/index.d.ts +5 -5
- package/miniprogram_dist/auth/index.d.ts +7 -7
- package/miniprogram_dist/auth/index.js +1 -1
- package/miniprogram_dist/cloudrun/index.d.ts +2 -2
- package/miniprogram_dist/container/index.d.ts +2 -2
- package/miniprogram_dist/database/index.d.ts +1 -1
- package/miniprogram_dist/functions/index.d.ts +1 -1
- package/miniprogram_dist/index.js +1 -1
- package/miniprogram_dist/model/index.d.ts +1 -1
- package/miniprogram_dist/mysql/index.d.ts +1 -1
- package/miniprogram_dist/realtime/index.d.ts +1 -1
- package/miniprogram_dist/storage/index.d.ts +1 -1
- package/model/dist/index.d.ts +5 -1
- package/mysql/dist/index.d.ts +4 -1
- package/oauth/dist/auth/apis.d.ts +143 -0
- package/oauth/dist/auth/auth-error.d.ts +32 -0
- package/oauth/dist/auth/consts.d.ts +165 -0
- package/oauth/dist/auth/models.d.ts +557 -0
- package/oauth/dist/captcha/captcha-dom.d.ts +3 -0
- package/oauth/dist/captcha/captcha.d.ts +42 -0
- package/oauth/dist/index.d.ts +22 -1
- package/oauth/dist/oauth2client/consts.d.ts +20 -0
- package/oauth/dist/oauth2client/interface.d.ts +15 -0
- package/oauth/dist/oauth2client/models.d.ts +75 -0
- package/oauth/dist/oauth2client/oauth2client.d.ts +154 -0
- package/oauth/dist/utils/base64.d.ts +9 -0
- package/oauth/dist/utils/encrypt.d.ts +4 -0
- package/oauth/dist/utils/encryptlong/index.d.ts +546 -0
- package/oauth/dist/utils/function/single-promise.d.ts +10 -0
- package/oauth/dist/utils/index.d.ts +2 -0
- package/oauth/dist/utils/mp.d.ts +2 -0
- package/oauth/dist/utils/urlSearchParams.d.ts +13 -0
- package/oauth/dist/utils/uuid.d.ts +1 -0
- package/package.json +20 -3
- package/realtime/dist/common.d.ts +4 -0
- package/realtime/dist/error.d.ts +36 -0
- package/realtime/dist/index.d.ts +4 -2
- package/realtime/dist/listener.d.ts +14 -0
- package/realtime/dist/message.d.ts +3 -0
- package/realtime/dist/snapshot.d.ts +17 -0
- package/realtime/dist/utils.d.ts +1 -0
- package/realtime/dist/virtual-websocket-client.d.ts +62 -0
- package/realtime/dist/websocket-client.d.ts +78 -0
- package/realtime/dist/ws-event.d.ts +126 -0
- package/storage/dist/cloudbase-storage.d.ts +58 -0
- package/storage/dist/download-builder.d.ts +24 -0
- package/storage/dist/encoding.d.ts +3 -0
- package/storage/dist/http.d.ts +38 -0
- package/storage/dist/index.d.ts +13 -2
- package/storage/dist/node-types.d.ts +6 -0
- package/storage/dist/storage-bucket-api-neo.d.ts +15 -0
- package/storage/dist/storage-file-api-classic.d.ts +80 -0
- package/storage/dist/storage-file-api-neo.d.ts +48 -0
- package/storage/dist/supabase/errors.d.ts +20 -0
- package/storage/dist/supabase/types.d.ts +63 -0
- package/storage/dist/types.d.ts +142 -0
- package/storage/dist/validation.d.ts +2 -0
- package/types/auth.d.ts +1 -1
- package/types/index.d.ts +3 -2
- package/types/package.json +1 -1
- package/utilities/dist/cjs/libs/cache.d.ts +2 -2
- package/utilities/dist/cjs/libs/events.d.ts +1 -1
- package/utilities/dist/cjs/libs/util.d.ts +1 -1
- package/utilities/dist/esm/libs/cache.d.ts +2 -2
- package/utilities/dist/esm/libs/events.d.ts +1 -1
- package/utilities/dist/esm/libs/util.d.ts +1 -1
- package/utilities/package.json +1 -1
package/auth/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,271 @@
|
|
|
1
|
-
import { ICloudbase } from '@cloudbase/types';
|
|
2
|
-
|
|
1
|
+
import type { ICloudbase, ICloudbaseConfig } from '@cloudbase/js-sdk/types';
|
|
2
|
+
import type { ICloudbaseCache } from '@cloudbase/js-sdk/types/cache';
|
|
3
|
+
import type { ICloudbaseRequest } from '@cloudbase/js-sdk/types/request';
|
|
4
|
+
import type { ICloudbaseAuthConfig, IUser, ILoginState } from '@cloudbase/js-sdk/types/auth';
|
|
5
|
+
import type { AuthOptions, Credentials } from '@cloudbase/js-sdk/oauth';
|
|
6
|
+
import { CloudbaseOAuth, AuthError, authModels } from '@cloudbase/js-sdk/oauth';
|
|
7
|
+
import { CloudbaseEventEmitter } from './utilities';
|
|
8
|
+
import { AuthV1Compat, WeixinAuthProvider, CustomAuthProvider, AnonymousAuthProvider } from './v1-compat';
|
|
9
|
+
import { AuthOtpResponse, AuthResponse, CommonRes, DeleteMeReq, GetClaimsRes, GetUserIdentitiesRes, GetUserRes, LinkIdentityReq, LinkIdentityRes, OAuthResponse, OnAuthStateChangeCallback, ReauthenticateRes, ResendParams, ResendRes, ResetPasswordForEmailRes, ResetPasswordForOldReq, SetSessionReq, SignInAnonymouslyCredentials, SignInRes, SignInWithIdTokenReq, SignInWithOAuthCredentials, SignInWithPasswordCredentials, SignInWithPasswordlessCredentials, SignUpRes, UnlinkIdentityReq, UpdateUserWithVerificationRes, UserAttributes, UserResponse, VerifyOAuthReq, VerifyOAuthRes, VerifyOtpParams, GetAccessTokenRes } from './type';
|
|
10
|
+
export type { AuthResponse, AuthTokenResponsePassword, AuthOtpResponse, UserResponse, OAuthResponse, SignInRes, GetUserRes, CommonRes, SignInWithOtpRes, SignInOAuthRes, GetClaimsRes, ResetPasswordForEmailRes, GetUserIdentitiesRes, LinkIdentityRes, ReauthenticateRes, ResendRes, UpdateUserWithVerificationRes, OnAuthStateChangeCallback, SignInWithPasswordCredentials, SignInWithPasswordlessCredentials, SignUpWithPasswordCredentials, SignInWithOAuthCredentials, SignInAnonymouslyCredentials, VerifyOtpParams, ResendParams, UserAttributes, SignInWithPasswordReq, SignInWithIdTokenReq, SignInWithOAuthReq, VerifyOAuthReq, VerifyOtpReq, LinkIdentityReq, UnlinkIdentityReq, UpdateUserReq, SignInWithOtpReq, ResetPasswordForOldReq, ResendReq, SetSessionReq, DeleteMeReq, SignUpRes, GetAccessTokenRes, AuthResult, } from './type';
|
|
11
|
+
interface UserInfo {
|
|
12
|
+
uid?: string;
|
|
13
|
+
gender?: string;
|
|
14
|
+
picture?: string;
|
|
15
|
+
email?: string;
|
|
16
|
+
email_verified?: boolean;
|
|
17
|
+
phone_number?: string;
|
|
18
|
+
username?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
birthdate?: string;
|
|
21
|
+
zoneinfo?: string;
|
|
22
|
+
locale?: string;
|
|
23
|
+
sub?: string;
|
|
24
|
+
created_from?: string;
|
|
25
|
+
}
|
|
26
|
+
interface IUserOptions {
|
|
27
|
+
cache: ICloudbaseCache;
|
|
28
|
+
oauthInstance: CloudbaseOAuth;
|
|
29
|
+
}
|
|
30
|
+
export declare class User implements IUser {
|
|
31
|
+
uid?: string;
|
|
32
|
+
gender?: string;
|
|
33
|
+
picture?: string;
|
|
34
|
+
email?: string;
|
|
35
|
+
emailVerified?: boolean;
|
|
36
|
+
phoneNumber?: string;
|
|
37
|
+
username?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
providers?: {
|
|
40
|
+
id?: string;
|
|
41
|
+
providerUserId?: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
}[];
|
|
44
|
+
birthdate?: string;
|
|
45
|
+
zoneinfo?: string;
|
|
46
|
+
locale?: string;
|
|
47
|
+
sub?: string;
|
|
48
|
+
createdFrom?: string;
|
|
49
|
+
open_id?: string;
|
|
50
|
+
private cache;
|
|
51
|
+
private oauthInstance;
|
|
52
|
+
constructor(options: IUserOptions);
|
|
53
|
+
checkLocalInfo(): Promise<void>;
|
|
54
|
+
checkLocalInfoAsync(): Promise<void>;
|
|
55
|
+
update(userInfo: authModels.UserProfile): Promise<void>;
|
|
56
|
+
updateUserBasicInfo(params: authModels.ModifyUserBasicInfoRequest): Promise<void>;
|
|
57
|
+
updatePassword(newPassword: string, oldPassword: string): Promise<void>;
|
|
58
|
+
updateUsername(username: string): Promise<void>;
|
|
59
|
+
refresh(params?: {
|
|
60
|
+
version?: string;
|
|
61
|
+
query?: any;
|
|
62
|
+
}): Promise<authModels.UserInfo>;
|
|
63
|
+
getLocalUserInfo(key?: string): string | boolean | Record<string, any>;
|
|
64
|
+
setLocalUserInfo(userInfo: any): void;
|
|
65
|
+
private getLocalUserInfoAsync;
|
|
66
|
+
private setUserInfo;
|
|
67
|
+
}
|
|
68
|
+
interface ILoginStateOptions extends IUserOptions {
|
|
69
|
+
envId: string;
|
|
70
|
+
}
|
|
71
|
+
export declare class LoginState implements ILoginState {
|
|
72
|
+
user: User;
|
|
73
|
+
oauthLoginState: any;
|
|
74
|
+
private oauthInstance;
|
|
75
|
+
private cache;
|
|
76
|
+
constructor(options: ILoginStateOptions);
|
|
77
|
+
checkLocalState(): void;
|
|
78
|
+
checkLocalStateAsync(): Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
interface IAuthConfig extends ICloudbaseAuthConfig {
|
|
81
|
+
cache: ICloudbaseCache;
|
|
82
|
+
request?: ICloudbaseRequest;
|
|
83
|
+
eventBus: CloudbaseEventEmitter;
|
|
84
|
+
runtime?: string;
|
|
85
|
+
}
|
|
86
|
+
declare class Auth extends AuthV1Compat {
|
|
87
|
+
readonly config: IAuthConfig;
|
|
88
|
+
oauthInstance: CloudbaseOAuth;
|
|
89
|
+
readonly cache: ICloudbaseCache;
|
|
90
|
+
private listeners;
|
|
91
|
+
private hasListenerSetUp;
|
|
92
|
+
constructor(config: IAuthConfig);
|
|
93
|
+
signInAnonymously(params: SignInAnonymouslyCredentials): Promise<AuthResponse>;
|
|
94
|
+
signUp(params: authModels.SignUpRequest & {
|
|
95
|
+
phone?: string;
|
|
96
|
+
}): Promise<SignUpRes>;
|
|
97
|
+
signOut(params?: authModels.SignoutRequest): Promise<authModels.SignoutResponse & {
|
|
98
|
+
data: Object;
|
|
99
|
+
error: AuthError;
|
|
100
|
+
}>;
|
|
101
|
+
onAuthStateChange(callback: OnAuthStateChangeCallback): {
|
|
102
|
+
data: {
|
|
103
|
+
subscription: {
|
|
104
|
+
id: string;
|
|
105
|
+
callback: OnAuthStateChangeCallback;
|
|
106
|
+
unsubscribe: () => void;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
signInWithPassword(params: SignInWithPasswordCredentials): Promise<AuthResponse>;
|
|
111
|
+
signInWithIdToken(params: SignInWithIdTokenReq): Promise<SignInRes>;
|
|
112
|
+
signInWithOtp(params: SignInWithPasswordlessCredentials): Promise<AuthOtpResponse>;
|
|
113
|
+
verifyOAuth(params?: VerifyOAuthReq): Promise<VerifyOAuthRes>;
|
|
114
|
+
signInWithOAuth(params: SignInWithOAuthCredentials): Promise<OAuthResponse>;
|
|
115
|
+
getClaims(): Promise<GetClaimsRes>;
|
|
116
|
+
resetPasswordForEmail(emailOrPhone: string, options?: {
|
|
117
|
+
redirectTo?: string;
|
|
118
|
+
}): Promise<ResetPasswordForEmailRes>;
|
|
119
|
+
resetPasswordForOld(params: ResetPasswordForOldReq): Promise<SignInRes>;
|
|
120
|
+
verifyOtp(params: VerifyOtpParams): Promise<AuthResponse>;
|
|
121
|
+
getSession(): Promise<SignInRes>;
|
|
122
|
+
refreshSession(refresh_token?: string): Promise<SignInRes>;
|
|
123
|
+
getUser(isRefresh?: boolean): Promise<GetUserRes>;
|
|
124
|
+
refreshUser(): Promise<CommonRes>;
|
|
125
|
+
updateUser(params: UserAttributes): Promise<UserResponse | UpdateUserWithVerificationRes>;
|
|
126
|
+
getUserIdentities(): Promise<GetUserIdentitiesRes>;
|
|
127
|
+
linkIdentity(params: LinkIdentityReq): Promise<LinkIdentityRes>;
|
|
128
|
+
unlinkIdentity(params: UnlinkIdentityReq): Promise<CommonRes>;
|
|
129
|
+
reauthenticate(): Promise<ReauthenticateRes>;
|
|
130
|
+
resend(params: ResendParams): Promise<ResendRes>;
|
|
131
|
+
setSession(params: SetSessionReq): Promise<SignInRes>;
|
|
132
|
+
exchangeCodeForSession(): Promise<void>;
|
|
133
|
+
deleteUser(params: DeleteMeReq): Promise<CommonRes>;
|
|
134
|
+
toDefaultLoginPage(params?: authModels.ToDefaultLoginPage): Promise<CommonRes>;
|
|
135
|
+
signInWithCustomTicket(getTickFn?: authModels.GetCustomSignTicketFn): Promise<SignInRes>;
|
|
136
|
+
signInWithOpenId({ useWxCloud }?: {
|
|
137
|
+
useWxCloud?: boolean;
|
|
138
|
+
}): Promise<SignInRes>;
|
|
139
|
+
signInWithPhoneAuth({ phoneCode, useWxCloud }: {
|
|
140
|
+
phoneCode?: string;
|
|
141
|
+
useWxCloud?: boolean;
|
|
142
|
+
}): Promise<SignInRes>;
|
|
143
|
+
bindPhoneNumber(params: authModels.BindPhoneRequest): Promise<void>;
|
|
144
|
+
unbindProvider(params: authModels.UnbindProviderRequest): Promise<void>;
|
|
145
|
+
bindEmail(params: authModels.BindEmailRequest): Promise<void>;
|
|
146
|
+
verify(params: authModels.VerifyRequest): Promise<authModels.VerifyResponse>;
|
|
147
|
+
getVerification(params: authModels.GetVerificationRequest, options?: {
|
|
148
|
+
withCaptcha: boolean;
|
|
149
|
+
}): Promise<authModels.GetVerificationResponse>;
|
|
150
|
+
get currentUser(): User;
|
|
151
|
+
getCurrentUser(isRefresh?: boolean): Promise<(authModels.UserInfo & Partial<User>) | null>;
|
|
152
|
+
signInAnonymouslyInWx({ useWxCloud, }?: {
|
|
153
|
+
useWxCloud?: boolean;
|
|
154
|
+
}): Promise<LoginState>;
|
|
155
|
+
bindOpenId(): Promise<void>;
|
|
156
|
+
signInWithUnionId(): Promise<LoginState>;
|
|
157
|
+
signInWithSms({ verificationInfo, verificationCode, phoneNum, bindInfo, }: {
|
|
158
|
+
verificationInfo?: {
|
|
159
|
+
verification_id: string;
|
|
160
|
+
is_user: boolean;
|
|
161
|
+
};
|
|
162
|
+
verificationCode?: string;
|
|
163
|
+
phoneNum?: string;
|
|
164
|
+
bindInfo?: any;
|
|
165
|
+
}): Promise<LoginState>;
|
|
166
|
+
signInWithEmail({ verificationInfo, verificationCode, bindInfo, email, }: {
|
|
167
|
+
verificationInfo?: {
|
|
168
|
+
verification_id: string;
|
|
169
|
+
is_user: boolean;
|
|
170
|
+
};
|
|
171
|
+
verificationCode?: string;
|
|
172
|
+
bindInfo?: any;
|
|
173
|
+
email?: string;
|
|
174
|
+
}): Promise<LoginState>;
|
|
175
|
+
setCustomSignFunc(getTickFn: authModels.GetCustomSignTicketFn): void;
|
|
176
|
+
signIn(params: authModels.SignInRequest): Promise<LoginState>;
|
|
177
|
+
setPassword(params: authModels.SetPasswordRequest): Promise<void>;
|
|
178
|
+
isUsernameRegistered(username: string): Promise<boolean>;
|
|
179
|
+
hasLoginState(): LoginState | null;
|
|
180
|
+
getLoginState(): Promise<LoginState | null>;
|
|
181
|
+
getUserInfo(): Promise<(authModels.UserInfo & Partial<User>) | null>;
|
|
182
|
+
getWedaUserInfo(): Promise<any>;
|
|
183
|
+
updateUserBasicInfo(params: authModels.ModifyUserBasicInfoRequest): Promise<void>;
|
|
184
|
+
getAuthHeader(): {};
|
|
185
|
+
bindWithProvider(params: authModels.BindWithProviderRequest): Promise<void>;
|
|
186
|
+
queryUser(queryObj: authModels.QueryUserProfileRequest): Promise<authModels.QueryUserProfileResponse>;
|
|
187
|
+
getAccessToken(): Promise<GetAccessTokenRes>;
|
|
188
|
+
grantProviderToken(params: authModels.GrantProviderTokenRequest): Promise<authModels.GrantProviderTokenResponse>;
|
|
189
|
+
patchProviderToken(params: authModels.PatchProviderTokenRequest): Promise<authModels.PatchProviderTokenResponse>;
|
|
190
|
+
signInWithProvider(params: authModels.SignInWithProviderRequest): Promise<LoginState>;
|
|
191
|
+
signInWithWechat(params?: any): Promise<LoginState>;
|
|
192
|
+
grantToken(params: authModels.GrantTokenRequest): Promise<LoginState>;
|
|
193
|
+
genProviderRedirectUri(params: authModels.GenProviderRedirectUriRequest): Promise<authModels.GenProviderRedirectUriResponse>;
|
|
194
|
+
resetPassword(params: authModels.ResetPasswordRequest): Promise<void>;
|
|
195
|
+
deviceAuthorize(params: authModels.DeviceAuthorizeRequest): Promise<authModels.DeviceAuthorizeResponse>;
|
|
196
|
+
sudo(params: authModels.SudoRequest): Promise<authModels.SudoResponse>;
|
|
197
|
+
deleteMe(params: authModels.WithSudoRequest): Promise<authModels.UserProfile>;
|
|
198
|
+
getProviders(): Promise<authModels.ProvidersResponse>;
|
|
199
|
+
loginScope(): Promise<string>;
|
|
200
|
+
loginGroups(): Promise<string[]>;
|
|
201
|
+
onLoginStateChanged(callback: Function): Promise<void>;
|
|
202
|
+
refreshTokenForce(params: {
|
|
203
|
+
version?: string;
|
|
204
|
+
}): Promise<Credentials>;
|
|
205
|
+
getCredentials(): Promise<Credentials>;
|
|
206
|
+
setCredentials(credentials: Credentials): Promise<void>;
|
|
207
|
+
getProviderSubType(): Promise<authModels.ProviderSubType>;
|
|
208
|
+
createCaptchaData(params: {
|
|
209
|
+
state: string;
|
|
210
|
+
redirect_uri?: string;
|
|
211
|
+
}): Promise<{
|
|
212
|
+
token: string;
|
|
213
|
+
data: string;
|
|
214
|
+
}>;
|
|
215
|
+
verifyCaptchaData(params: {
|
|
216
|
+
token: string;
|
|
217
|
+
key: string;
|
|
218
|
+
}): Promise<{
|
|
219
|
+
captcha_token: string;
|
|
220
|
+
expires_in: number;
|
|
221
|
+
}>;
|
|
222
|
+
getMiniProgramQrCode(params: authModels.GetMiniProgramQrCodeRequest): Promise<authModels.GetMiniProgramQrCodeResponse>;
|
|
223
|
+
getMiniProgramQrCodeStatus(params: authModels.GetMiniProgramQrCodeStatusRequest): Promise<authModels.GetMiniProgramQrCodeStatusResponse>;
|
|
224
|
+
modifyPassword(params: authModels.ModifyUserBasicInfoRequest): Promise<void>;
|
|
225
|
+
modifyPasswordWithoutLogin(params: authModels.ModifyPasswordWithoutLoginRequest): Promise<void>;
|
|
226
|
+
getUserBehaviorLog(params: authModels.GetUserBehaviorLog): Promise<authModels.GetUserBehaviorLogRes>;
|
|
227
|
+
signInWithUsername({ verificationInfo, verificationCode, username: rawUsername, bindInfo, loginType, }: {
|
|
228
|
+
verificationInfo?: authModels.GetVerificationResponse;
|
|
229
|
+
verificationCode?: string;
|
|
230
|
+
username?: string;
|
|
231
|
+
bindInfo?: any;
|
|
232
|
+
loginType?: string;
|
|
233
|
+
}): Promise<LoginState>;
|
|
234
|
+
createLoginState(params?: {
|
|
235
|
+
version?: string;
|
|
236
|
+
query?: any;
|
|
237
|
+
}, options?: {
|
|
238
|
+
asyncRefreshUser?: boolean;
|
|
239
|
+
userInfo?: any;
|
|
240
|
+
}): Promise<LoginState>;
|
|
241
|
+
setAccessKey(): Promise<void>;
|
|
242
|
+
protected formatPhone(phone: string): string;
|
|
243
|
+
private notifyListeners;
|
|
244
|
+
private setupListeners;
|
|
245
|
+
private convertToUser;
|
|
246
|
+
private validateParams;
|
|
247
|
+
private validateAtLeastOne;
|
|
248
|
+
private init;
|
|
249
|
+
}
|
|
250
|
+
type TInitAuthOptions = Pick<ICloudbaseAuthConfig, 'region' | 'persistence' | 'i18n' | 'accessKey' | 'useWxCloud' | 'auth'> & Partial<AuthOptions> & {
|
|
251
|
+
detectSessionInUrl?: boolean;
|
|
252
|
+
};
|
|
253
|
+
export declare function generateAuthInstance(config: TInitAuthOptions & {
|
|
254
|
+
sdkVersion?: string;
|
|
255
|
+
}, options?: {
|
|
256
|
+
clientId: ICloudbaseConfig['clientId'];
|
|
257
|
+
env: ICloudbaseConfig['env'];
|
|
258
|
+
apiOrigin?: string;
|
|
259
|
+
getApiOrigin?: () => string;
|
|
260
|
+
cache?: ICloudbaseCache;
|
|
261
|
+
platform?: ICloudbase['platform'];
|
|
262
|
+
app?: ICloudbase;
|
|
263
|
+
debug?: ICloudbaseAuthConfig['debug'];
|
|
264
|
+
detectSessionInUrl?: ICloudbaseAuthConfig['detectSessionInUrl'];
|
|
265
|
+
}): {
|
|
266
|
+
authInstance: Auth;
|
|
267
|
+
oauthInstance: CloudbaseOAuth;
|
|
268
|
+
};
|
|
269
|
+
export { UserInfo, Auth, WeixinAuthProvider, CustomAuthProvider, AnonymousAuthProvider };
|
|
270
|
+
export { AuthErrorCategory, AuthErrorCode, AuthError } from '@cloudbase/js-sdk/oauth';
|
|
271
|
+
export declare function registerAuth(app: Pick<ICloudbase, 'registerComponent'>): void;
|