@cloudbase/js-sdk 3.8.2-beta.1 → 3.8.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.esm.js.map +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/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/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 +24 -4
- 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;
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import type { authModels, OAUTH_TYPE } from '@cloudbase/js-sdk/oauth';
|
|
2
|
+
import { AuthError, AuthErrorCategory, AuthErrorCode } from '@cloudbase/js-sdk/oauth';
|
|
3
|
+
export { AuthErrorCategory, AuthErrorCode };
|
|
4
|
+
export type AuthResult<D extends object> = {
|
|
5
|
+
data: D;
|
|
6
|
+
error: null;
|
|
7
|
+
} | {
|
|
8
|
+
data: {
|
|
9
|
+
[K in keyof D]: null;
|
|
10
|
+
};
|
|
11
|
+
error: AuthError;
|
|
12
|
+
};
|
|
13
|
+
export interface SignInAnonymouslyCredentials {
|
|
14
|
+
provider_token?: string;
|
|
15
|
+
}
|
|
16
|
+
export type SignInAnonymouslyReq = SignInAnonymouslyCredentials;
|
|
17
|
+
export declare type User = {
|
|
18
|
+
id: any;
|
|
19
|
+
aud: string;
|
|
20
|
+
role: string[];
|
|
21
|
+
email: any;
|
|
22
|
+
email_confirmed_at: string;
|
|
23
|
+
phone: any;
|
|
24
|
+
phone_confirmed_at: string;
|
|
25
|
+
confirmed_at: string;
|
|
26
|
+
last_sign_in_at: string;
|
|
27
|
+
app_metadata: {
|
|
28
|
+
provider: any;
|
|
29
|
+
providers: any[];
|
|
30
|
+
};
|
|
31
|
+
user_metadata: {
|
|
32
|
+
name: any;
|
|
33
|
+
picture: any;
|
|
34
|
+
username: any;
|
|
35
|
+
gender: any;
|
|
36
|
+
locale: any;
|
|
37
|
+
uid: any;
|
|
38
|
+
nickName: any;
|
|
39
|
+
avatarUrl: any;
|
|
40
|
+
location: any;
|
|
41
|
+
hasPassword: any;
|
|
42
|
+
};
|
|
43
|
+
identities: any;
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
is_anonymous: boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare type Session = {
|
|
49
|
+
access_token?: string;
|
|
50
|
+
refresh_token?: string;
|
|
51
|
+
expires_in?: number;
|
|
52
|
+
token_type?: string;
|
|
53
|
+
user: User;
|
|
54
|
+
};
|
|
55
|
+
export type SignInWithPasswordCredentials = PasswordCredentialsBase & {
|
|
56
|
+
is_encrypt?: boolean;
|
|
57
|
+
options?: {
|
|
58
|
+
is_encrypt?: boolean;
|
|
59
|
+
captchaToken?: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export type PasswordCredentialsBase = {
|
|
63
|
+
email: string;
|
|
64
|
+
password: string;
|
|
65
|
+
} | {
|
|
66
|
+
phone: string;
|
|
67
|
+
password: string;
|
|
68
|
+
} | {
|
|
69
|
+
username: string;
|
|
70
|
+
password: string;
|
|
71
|
+
};
|
|
72
|
+
export type SignInWithPasswordReq = SignInWithPasswordCredentials;
|
|
73
|
+
export type CommonRes = AuthResult<{}>;
|
|
74
|
+
export type SignInRes = AuthResult<{
|
|
75
|
+
user?: User | null;
|
|
76
|
+
session?: Session | null;
|
|
77
|
+
}>;
|
|
78
|
+
export type AuthResponse = SignInRes;
|
|
79
|
+
export type AuthTokenResponsePassword = SignInRes;
|
|
80
|
+
export type GetUserRes = AuthResult<{
|
|
81
|
+
user?: User | null;
|
|
82
|
+
}>;
|
|
83
|
+
export type UserResponse = GetUserRes;
|
|
84
|
+
export interface UpdateUserVerifyOtpParams {
|
|
85
|
+
email?: string;
|
|
86
|
+
phone?: string;
|
|
87
|
+
token: string | number;
|
|
88
|
+
}
|
|
89
|
+
declare type UpdateUserVerifyCallback = (params: UpdateUserVerifyOtpParams) => Promise<GetUserRes>;
|
|
90
|
+
export type UpdateUserWithVerificationRes = AuthResult<{
|
|
91
|
+
verifyOtp?: UpdateUserVerifyCallback;
|
|
92
|
+
messageId?: string;
|
|
93
|
+
}>;
|
|
94
|
+
export interface SignInWithIdTokenReq {
|
|
95
|
+
provider?: string;
|
|
96
|
+
token: string;
|
|
97
|
+
}
|
|
98
|
+
export interface SignInWithOAuthCredentials {
|
|
99
|
+
provider: string;
|
|
100
|
+
options?: {
|
|
101
|
+
redirectTo?: string;
|
|
102
|
+
skipBrowserRedirect?: boolean;
|
|
103
|
+
state?: string;
|
|
104
|
+
queryParams?: Record<string, string>;
|
|
105
|
+
type?: (typeof OAUTH_TYPE)[keyof typeof OAUTH_TYPE];
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export type SignInWithOAuthReq = SignInWithOAuthCredentials;
|
|
109
|
+
export type SignInOAuthRes = AuthResult<{
|
|
110
|
+
url?: string | null;
|
|
111
|
+
provider?: string | null;
|
|
112
|
+
scopes?: string;
|
|
113
|
+
}>;
|
|
114
|
+
export type OAuthResponse = SignInOAuthRes;
|
|
115
|
+
export type GetClaimsRes = AuthResult<{
|
|
116
|
+
claims?: {
|
|
117
|
+
iss: string;
|
|
118
|
+
sub: string;
|
|
119
|
+
aud: string;
|
|
120
|
+
exp: number;
|
|
121
|
+
iat: number;
|
|
122
|
+
at_hash: string;
|
|
123
|
+
name: string;
|
|
124
|
+
picture?: string;
|
|
125
|
+
email?: string;
|
|
126
|
+
phone_number?: string;
|
|
127
|
+
scope: string;
|
|
128
|
+
project_id: string;
|
|
129
|
+
provider?: string;
|
|
130
|
+
provider_type?: string;
|
|
131
|
+
groups?: string[];
|
|
132
|
+
meta?: {
|
|
133
|
+
wxOpenId?: string;
|
|
134
|
+
wxUnionId?: string;
|
|
135
|
+
};
|
|
136
|
+
user_id: string;
|
|
137
|
+
roles: string[];
|
|
138
|
+
user_type: string;
|
|
139
|
+
client_type: string;
|
|
140
|
+
is_system_admin: boolean;
|
|
141
|
+
};
|
|
142
|
+
header?: {
|
|
143
|
+
alg: string;
|
|
144
|
+
kid: string;
|
|
145
|
+
};
|
|
146
|
+
signature?: string | null;
|
|
147
|
+
}>;
|
|
148
|
+
export interface UserAttributes extends authModels.ModifyUserBasicInfoRequest {
|
|
149
|
+
email?: string;
|
|
150
|
+
phone?: string;
|
|
151
|
+
username?: string;
|
|
152
|
+
description?: string;
|
|
153
|
+
avatar_url?: string;
|
|
154
|
+
nickname?: string;
|
|
155
|
+
gender?: 'MALE' | 'FEMALE';
|
|
156
|
+
password?: never;
|
|
157
|
+
new_password?: never;
|
|
158
|
+
}
|
|
159
|
+
export type UpdateUserReq = UserAttributes;
|
|
160
|
+
export type GetUserIdentitiesRes = AuthResult<{
|
|
161
|
+
identities?: Array<{
|
|
162
|
+
id: string;
|
|
163
|
+
name: string;
|
|
164
|
+
picture: string;
|
|
165
|
+
}> | null;
|
|
166
|
+
}>;
|
|
167
|
+
export interface LinkIdentityReq {
|
|
168
|
+
provider: string;
|
|
169
|
+
}
|
|
170
|
+
export interface UnlinkIdentityReq {
|
|
171
|
+
provider: string;
|
|
172
|
+
}
|
|
173
|
+
export type LinkIdentityRes = AuthResult<{
|
|
174
|
+
provider?: string | null;
|
|
175
|
+
type?: (typeof OAUTH_TYPE)[keyof typeof OAUTH_TYPE];
|
|
176
|
+
}>;
|
|
177
|
+
export declare type OnAuthStateChangeEvent = 'SIGNED_OUT' | 'SIGNED_IN' | 'INITIAL_SESSION' | 'PASSWORD_RECOVERY' | 'TOKEN_REFRESHED' | 'USER_UPDATED' | 'BIND_IDENTITY';
|
|
178
|
+
export declare type OnAuthStateChangeCallback = (event: OnAuthStateChangeEvent, session: Session, info?: Record<string, any>) => void;
|
|
179
|
+
export type MobileOtpType = 'sms' | 'phone_change' | (string & {});
|
|
180
|
+
export type EmailOtpType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change' | 'email' | (string & {});
|
|
181
|
+
export interface VerifyMobileOtpParams {
|
|
182
|
+
phone: string;
|
|
183
|
+
token: string | number;
|
|
184
|
+
type?: MobileOtpType | EmailOtpType;
|
|
185
|
+
messageId?: string;
|
|
186
|
+
}
|
|
187
|
+
export interface VerifyEmailOtpParams {
|
|
188
|
+
email: string;
|
|
189
|
+
token: string | number;
|
|
190
|
+
type?: MobileOtpType | EmailOtpType;
|
|
191
|
+
messageId?: string;
|
|
192
|
+
}
|
|
193
|
+
export type VerifyOtpParams = VerifyMobileOtpParams | VerifyEmailOtpParams;
|
|
194
|
+
export type VerifyOtpReq = VerifyOtpParams;
|
|
195
|
+
export type SignInWithPasswordlessCredentials = {
|
|
196
|
+
email: string;
|
|
197
|
+
options?: {
|
|
198
|
+
shouldCreateUser?: boolean;
|
|
199
|
+
emailRedirectTo?: string;
|
|
200
|
+
captchaToken?: string;
|
|
201
|
+
};
|
|
202
|
+
} | {
|
|
203
|
+
phone: string;
|
|
204
|
+
options?: {
|
|
205
|
+
shouldCreateUser?: boolean;
|
|
206
|
+
captchaToken?: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
export type SignInWithOtpReq = SignInWithPasswordlessCredentials;
|
|
210
|
+
export interface VerifyOtpCallbackParams {
|
|
211
|
+
token: string | number;
|
|
212
|
+
messageId?: string;
|
|
213
|
+
}
|
|
214
|
+
declare type OtpCallback = (params: VerifyOtpCallbackParams) => Promise<SignInRes>;
|
|
215
|
+
export type SignInWithOtpRes = AuthResult<{
|
|
216
|
+
user?: User | null;
|
|
217
|
+
session?: Session | null;
|
|
218
|
+
verifyOtp?: OtpCallback;
|
|
219
|
+
}>;
|
|
220
|
+
export type AuthOtpResponse = SignInWithOtpRes;
|
|
221
|
+
export type SignUpRes = AuthResult<{
|
|
222
|
+
user?: User;
|
|
223
|
+
session?: Session;
|
|
224
|
+
verifyOtp?: OtpCallback;
|
|
225
|
+
}>;
|
|
226
|
+
export type SignUpWithPasswordCredentials = {
|
|
227
|
+
email: string;
|
|
228
|
+
password?: string;
|
|
229
|
+
options?: {
|
|
230
|
+
data?: Record<string, any>;
|
|
231
|
+
emailRedirectTo?: string;
|
|
232
|
+
captchaToken?: string;
|
|
233
|
+
};
|
|
234
|
+
} | {
|
|
235
|
+
phone: string;
|
|
236
|
+
password?: string;
|
|
237
|
+
options?: {
|
|
238
|
+
data?: Record<string, any>;
|
|
239
|
+
channel?: 'sms' | 'whatsapp';
|
|
240
|
+
captchaToken?: string;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
export interface ResendParamsBase {
|
|
244
|
+
type: 'signup' | 'email_change' | 'phone_change' | 'sms';
|
|
245
|
+
}
|
|
246
|
+
export type ResendParams = {
|
|
247
|
+
type?: 'signup' | 'email_change';
|
|
248
|
+
email: string;
|
|
249
|
+
phone?: never;
|
|
250
|
+
} | {
|
|
251
|
+
type?: 'sms' | 'phone_change';
|
|
252
|
+
phone: string;
|
|
253
|
+
email?: never;
|
|
254
|
+
};
|
|
255
|
+
export type ResendReq = ResendParams;
|
|
256
|
+
export type ResendRes = AuthResult<{
|
|
257
|
+
messageId?: string | null;
|
|
258
|
+
}>;
|
|
259
|
+
export interface GetAccessTokenRes {
|
|
260
|
+
accessToken: string;
|
|
261
|
+
env: string;
|
|
262
|
+
}
|
|
263
|
+
export interface VerifyOAuthReq {
|
|
264
|
+
code?: string;
|
|
265
|
+
state?: string;
|
|
266
|
+
provider?: string;
|
|
267
|
+
}
|
|
268
|
+
export interface UpdateUserAttributes {
|
|
269
|
+
nonce: string;
|
|
270
|
+
password: string;
|
|
271
|
+
}
|
|
272
|
+
export type ResetPasswordForEmailRes = AuthResult<{
|
|
273
|
+
updateUser?: ((attributes: UpdateUserAttributes) => Promise<SignInRes>) | null;
|
|
274
|
+
}>;
|
|
275
|
+
export type ReauthenticateRes = AuthResult<{
|
|
276
|
+
updateUser?: ((attributes: UpdateUserAttributes) => Promise<SignInRes>) | null;
|
|
277
|
+
}>;
|
|
278
|
+
export interface SetSessionReq {
|
|
279
|
+
access_token: string;
|
|
280
|
+
refresh_token: string;
|
|
281
|
+
}
|
|
282
|
+
export interface DeleteMeReq {
|
|
283
|
+
password: string;
|
|
284
|
+
}
|
|
285
|
+
export interface ResetPasswordForOldReq {
|
|
286
|
+
old_password: string;
|
|
287
|
+
new_password: string;
|
|
288
|
+
}
|
|
289
|
+
export type VerifyOAuthRes = AuthResult<{
|
|
290
|
+
user?: User;
|
|
291
|
+
session?: Session;
|
|
292
|
+
redirectUrl?: string;
|
|
293
|
+
provider?: string;
|
|
294
|
+
type?: (typeof OAUTH_TYPE)[keyof typeof OAUTH_TYPE];
|
|
295
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { printWarn, throwError } from '@cloudbase/js-sdk/utilities/dist/cjs/libs/util';
|
|
2
|
+
export { ERRORS, COMMUNITY_SITE_URL } from '@cloudbase/js-sdk/utilities/dist/cjs/constants/index';
|
|
3
|
+
export { catchErrorsDecorator } from '@cloudbase/js-sdk/utilities/dist/cjs/helpers/index';
|
|
4
|
+
export { CloudbaseEventEmitter } from '@cloudbase/js-sdk/utilities/dist/cjs/libs/events';
|
|
5
|
+
export { CloudbaseCache } from '@cloudbase/js-sdk/utilities/dist/cjs/libs/cache';
|
|
6
|
+
export { default as adapterForWxMp } from '@cloudbase/adapter-wx_mp';
|
|
7
|
+
export { useDefaultAdapter } from '@cloudbase/js-sdk/utilities/dist/cjs/adapters/index';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function saveToBrowserSession(key: string, value: Record<string, any>): void;
|
|
2
|
+
export declare function getBrowserSession(key: string): any;
|
|
3
|
+
export declare function removeBrowserSession(key: string): boolean;
|
|
4
|
+
export declare function addUrlSearch(search: Location['search'], hash?: Location['hash']): string;
|
|
5
|
+
export declare function removeUrlParams(params: string[]): void;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { authModels } from '@cloudbase/js-sdk/oauth';
|
|
2
|
+
import type { SignUpRes } from './type';
|
|
3
|
+
export declare class WeixinAuthProvider {
|
|
4
|
+
constructor(_options: {
|
|
5
|
+
authInstance: any;
|
|
6
|
+
appid: string;
|
|
7
|
+
scope: string;
|
|
8
|
+
});
|
|
9
|
+
signInWithRedirect(): void;
|
|
10
|
+
getRedirectResult(_options?: {
|
|
11
|
+
createUser?: boolean;
|
|
12
|
+
syncUserInfo?: boolean;
|
|
13
|
+
}): Promise<any>;
|
|
14
|
+
getLinkRedirectResult(_options?: {
|
|
15
|
+
withUnionId?: boolean;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare class CustomAuthProvider {
|
|
19
|
+
private authInstance;
|
|
20
|
+
constructor(options: {
|
|
21
|
+
authInstance: any;
|
|
22
|
+
});
|
|
23
|
+
signIn(ticket: string): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare class AnonymousAuthProvider {
|
|
26
|
+
private authInstance;
|
|
27
|
+
constructor(options: {
|
|
28
|
+
authInstance: any;
|
|
29
|
+
});
|
|
30
|
+
signIn(): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare abstract class AuthV1Compat {
|
|
33
|
+
abstract readonly config: any;
|
|
34
|
+
weixinAuthProvider(options: {
|
|
35
|
+
appid: string;
|
|
36
|
+
scope: string;
|
|
37
|
+
}): WeixinAuthProvider;
|
|
38
|
+
customAuthProvider(): CustomAuthProvider;
|
|
39
|
+
anonymousAuthProvider(): AnonymousAuthProvider;
|
|
40
|
+
signUpWithEmailAndPassword(email: string, password: string): Promise<SignUpRes>;
|
|
41
|
+
signInWithEmailAndPassword(email: string, password: string): Promise<any>;
|
|
42
|
+
sendPasswordResetEmail(email: string): Promise<void>;
|
|
43
|
+
signInWithUsernameAndPassword(username: string, password: string): Promise<any>;
|
|
44
|
+
sendPhoneCode(phoneNumber: string): Promise<boolean>;
|
|
45
|
+
signUpWithPhoneCode(phoneNumber: string, phoneCode: string, password?: string): Promise<any>;
|
|
46
|
+
signInWithPhoneCodeOrPassword(params: {
|
|
47
|
+
phoneNumber: string;
|
|
48
|
+
phoneCode?: string;
|
|
49
|
+
password?: string;
|
|
50
|
+
}): Promise<any>;
|
|
51
|
+
forceResetPwdByPhoneCode(params: {
|
|
52
|
+
phoneNumber: string;
|
|
53
|
+
phoneCode: string;
|
|
54
|
+
password: string;
|
|
55
|
+
}): Promise<any>;
|
|
56
|
+
shouldRefreshAccessToken(_callback: () => boolean): void;
|
|
57
|
+
onLoginStateExpired(callback: Function): void;
|
|
58
|
+
onAccessTokenRefreshed(callback: Function): void;
|
|
59
|
+
onAnonymousConverted(callback: Function): void;
|
|
60
|
+
onLoginTypeChanged(callback: Function): void;
|
|
61
|
+
abstract signIn(params: authModels.SignInRequest): Promise<any>;
|
|
62
|
+
abstract signUp(params: authModels.SignUpRequest & {
|
|
63
|
+
phone?: string;
|
|
64
|
+
}): Promise<SignUpRes>;
|
|
65
|
+
abstract signInWithCustomTicket(getTickFn?: authModels.GetCustomSignTicketFn): Promise<any>;
|
|
66
|
+
abstract signInAnonymously(params: any): Promise<any>;
|
|
67
|
+
abstract getVerification(params: any, options?: any): Promise<authModels.GetVerificationResponse>;
|
|
68
|
+
abstract resetPassword(params: authModels.ResetPasswordRequest): Promise<void>;
|
|
69
|
+
abstract onLoginStateChanged(callback: Function): Promise<void>;
|
|
70
|
+
abstract onAuthStateChange(callback: any): any;
|
|
71
|
+
abstract createLoginState(params?: any, options?: any): Promise<any>;
|
|
72
|
+
abstract signInWithOAuth(params: any): Promise<any>;
|
|
73
|
+
abstract grantProviderToken(params: authModels.GrantProviderTokenRequest): Promise<authModels.GrantProviderTokenResponse>;
|
|
74
|
+
abstract bindWithProvider(params: authModels.BindWithProviderRequest): Promise<void>;
|
|
75
|
+
protected abstract formatPhone(phone: string): string;
|
|
76
|
+
}
|
|
77
|
+
export declare function applyUserV1Compat(UserClass: any): void;
|
package/cloudrun/dist/index.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { ICloudbase } from '@cloudbase/js-sdk/types';
|
|
2
|
+
import { ICallFunctionOptions, ICustomReqOpts } from '@cloudbase/js-sdk/types/functions';
|
|
3
|
+
export declare function requestContainer(this: any, options: ICallFunctionOptions, customReqOpts?: ICustomReqOpts): Promise<any>;
|
|
4
|
+
export declare function registerCloudrun(app: Pick<ICloudbase, 'registerComponent'>): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const COMPONENT_NAME = "container";
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
import { ICloudbase } from '@cloudbase/types';
|
|
2
|
-
|
|
1
|
+
import { ICloudbase } from '@cloudbase/js-sdk/types';
|
|
2
|
+
import { ICallContainerOptions, IContianerConfig } from '@cloudbase/js-sdk/types/container';
|
|
3
|
+
export declare let t: (str: any) => any;
|
|
4
|
+
export declare class CloudbaseContainers {
|
|
5
|
+
private readonly config;
|
|
6
|
+
private wasm;
|
|
7
|
+
private containerInitPromise;
|
|
8
|
+
private defaultHeaders;
|
|
9
|
+
constructor(config: IContianerConfig);
|
|
10
|
+
callContainer(options: ICallContainerOptions, callback?: Function): Promise<any>;
|
|
11
|
+
initContainer(config: Omit<IContianerConfig, 'wasmUrl' | 'jsUrl'>): Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
export declare function registerContainers(app: Pick<ICloudbase, 'registerComponent'>): void;
|