@cloudbase/oauth 0.1.1-alpha.10 → 0.1.1-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/index.js +14 -9
- package/dist/app/internal.js +5 -1
- package/dist/app/openuri.js +7 -3
- package/dist/app/request.js +7 -3
- package/dist/app/storage.js +5 -1
- package/dist/auth/consts.d.ts +4 -1
- package/dist/auth/consts.js +14 -8
- package/dist/auth/index.d.ts +17 -1
- package/dist/auth/index.js +90 -49
- package/dist/auth/models.d.ts +19 -0
- package/dist/auth/models.js +2 -1
- package/dist/captcha/index.js +16 -11
- package/dist/function/index.js +14 -9
- package/dist/index.js +18 -9
- package/dist/oauthclient/consts.js +7 -4
- package/dist/oauthclient/index.js +11 -6
- package/dist/oauthclient/interface.js +5 -1
- package/dist/oauthclient/models.js +2 -1
- package/dist/oauthclient/oauthclient.js +27 -21
- package/dist/package.json +1 -1
- package/dist/utils/base64.js +13 -6
- package/dist/utils/mp.js +7 -2
- package/dist/utils/promise.js +5 -1
- package/dist/utils/uuid.js +5 -1
- package/package.json +1 -1
- package/packages/oauth/dist/cjs/auth/apis.d.ts +1 -1
- package/packages/oauth/dist/cjs/auth/apis.js +3 -3
- package/packages/oauth/dist/cjs/auth/consts.d.ts +1 -1
- package/packages/oauth/dist/cjs/auth/consts.js +2 -2
- package/packages/oauth/dist/cjs/utils/mp.js +14 -9
- package/packages/oauth/dist/esm/auth/apis.d.ts +1 -1
- package/packages/oauth/dist/esm/auth/apis.js +3 -3
- package/packages/oauth/dist/esm/auth/consts.d.ts +1 -1
- package/packages/oauth/dist/esm/auth/consts.js +2 -2
- package/packages/oauth/dist/esm/utils/mp.js +14 -9
- package/src/auth/consts.ts +4 -0
- package/src/auth/index.ts +41 -0
- package/src/auth/models.ts +24 -0
- package/tsconfig.json +1 -2
- package/packages/app/dist/cjs/constants/common.d.ts +0 -24
- package/packages/app/dist/cjs/constants/common.js +0 -68
- package/packages/app/dist/cjs/index.d.ts +0 -4
- package/packages/app/dist/cjs/index.js +0 -248
- package/packages/app/dist/cjs/libs/adapter.d.ts +0 -2
- package/packages/app/dist/cjs/libs/adapter.js +0 -5
- package/packages/app/dist/cjs/libs/cache.d.ts +0 -6
- package/packages/app/dist/cjs/libs/cache.js +0 -38
- package/packages/app/dist/cjs/libs/component.d.ts +0 -3
- package/packages/app/dist/cjs/libs/component.js +0 -126
- package/packages/app/dist/cjs/libs/request.d.ts +0 -28
- package/packages/app/dist/cjs/libs/request.js +0 -297
- package/packages/app/dist/esm/constants/common.d.ts +0 -24
- package/packages/app/dist/esm/constants/common.js +0 -57
- package/packages/app/dist/esm/index.d.ts +0 -4
- package/packages/app/dist/esm/index.js +0 -241
- package/packages/app/dist/esm/libs/adapter.d.ts +0 -2
- package/packages/app/dist/esm/libs/adapter.js +0 -2
- package/packages/app/dist/esm/libs/cache.d.ts +0 -6
- package/packages/app/dist/esm/libs/cache.js +0 -32
- package/packages/app/dist/esm/libs/component.d.ts +0 -3
- package/packages/app/dist/esm/libs/component.js +0 -121
- package/packages/app/dist/esm/libs/request.d.ts +0 -28
- package/packages/app/dist/esm/libs/request.js +0 -292
- package/packages/auth/dist/cjs/index.d.ts +0 -114
- package/packages/auth/dist/cjs/index.js +0 -1030
- package/packages/auth/dist/esm/index.d.ts +0 -114
- package/packages/auth/dist/esm/index.js +0 -1026
- package/packages/cloudbase/app/dist/index.esm.js +0 -10
- package/packages/cloudbase/auth/dist/index.esm.js +0 -4
- package/packages/cloudbase/dist/index.cjs.js +0 -31
- package/packages/cloudbase/dist/index.esm.js +0 -26
- package/packages/cloudbase/functions/dist/index.esm.js +0 -4
- package/packages/cloudbase/storage/dist/index.esm.js +0 -4
- package/packages/functions/dist/cjs/index.d.ts +0 -2
- package/packages/functions/dist/cjs/index.js +0 -165
- package/packages/functions/dist/esm/index.d.ts +0 -2
- package/packages/functions/dist/esm/index.js +0 -161
- package/packages/storage/dist/cjs/index.d.ts +0 -2
- package/packages/storage/dist/cjs/index.js +0 -426
- package/packages/storage/dist/esm/index.d.ts +0 -2
- package/packages/storage/dist/esm/index.js +0 -422
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { ICloudbase } from '@cloudbase/types';
|
|
2
|
-
import { ICloudbaseCache } from '@cloudbase/types/cache';
|
|
3
|
-
import { ICloudbaseRequest } from '@cloudbase/types/request';
|
|
4
|
-
import { ICloudbaseAuthConfig, IUser, IUserInfo, ILoginState } from '@cloudbase/types/auth';
|
|
5
|
-
import { authModels, CloudbaseOAuth, Credentials } from '@cloudbase/oauth';
|
|
6
|
-
import { ProviderSubType } from '@cloudbase/oauth/dist/cjs/auth/models';
|
|
7
|
-
interface UserInfo {
|
|
8
|
-
uid?: string;
|
|
9
|
-
gender?: string;
|
|
10
|
-
picture?: string;
|
|
11
|
-
email?: string;
|
|
12
|
-
email_verified?: boolean;
|
|
13
|
-
phone_number?: string;
|
|
14
|
-
username?: string;
|
|
15
|
-
name?: string;
|
|
16
|
-
birthdate?: string;
|
|
17
|
-
zoneinfo?: string;
|
|
18
|
-
locale?: string;
|
|
19
|
-
sub?: string;
|
|
20
|
-
created_from?: string;
|
|
21
|
-
}
|
|
22
|
-
interface IUserOptions {
|
|
23
|
-
cache: ICloudbaseCache;
|
|
24
|
-
oauthInstance: CloudbaseOAuth;
|
|
25
|
-
}
|
|
26
|
-
interface ILoginStateOptions extends IUserOptions {
|
|
27
|
-
envId: string;
|
|
28
|
-
}
|
|
29
|
-
export declare class LoginState implements ILoginState {
|
|
30
|
-
user: IUser;
|
|
31
|
-
oauthLoginState: any;
|
|
32
|
-
private oauthInstance;
|
|
33
|
-
private cache;
|
|
34
|
-
constructor(options: ILoginStateOptions);
|
|
35
|
-
checkLocalState(): void;
|
|
36
|
-
checkLocalStateAsync(): Promise<void>;
|
|
37
|
-
}
|
|
38
|
-
declare class Auth {
|
|
39
|
-
private readonly config;
|
|
40
|
-
private readonly cache;
|
|
41
|
-
private oauthInstance;
|
|
42
|
-
constructor(config: ICloudbaseAuthConfig & {
|
|
43
|
-
cache: ICloudbaseCache;
|
|
44
|
-
request?: ICloudbaseRequest;
|
|
45
|
-
runtime?: string;
|
|
46
|
-
});
|
|
47
|
-
bindPhoneNumber(params: authModels.BindPhoneRequest): Promise<void>;
|
|
48
|
-
unbindProvider(params: authModels.UnbindProviderRequest): Promise<void>;
|
|
49
|
-
bindEmail(params: authModels.BindEmailRequest): Promise<void>;
|
|
50
|
-
verify(params: authModels.VerifyRequest): Promise<authModels.VerifyResponse>;
|
|
51
|
-
getVerification(params: authModels.GetVerificationRequest): Promise<authModels.GetVerificationResponse>;
|
|
52
|
-
get currentUser(): IUser;
|
|
53
|
-
getCurrentUser(): Promise<IUser>;
|
|
54
|
-
signInAnonymously(data?: {
|
|
55
|
-
provider_token?: string;
|
|
56
|
-
}): Promise<LoginState>;
|
|
57
|
-
setCustomSignFunc(getTickFn: authModels.GetCustomSignTicketFn): void;
|
|
58
|
-
signInWithCustomTicket(params?: {
|
|
59
|
-
version?: string;
|
|
60
|
-
}): Promise<LoginState>;
|
|
61
|
-
signIn(params: authModels.SignInRequest): Promise<LoginState>;
|
|
62
|
-
signUp(params: authModels.SignUpRequest): Promise<LoginState>;
|
|
63
|
-
setPassword(params: authModels.SetPasswordRequest): Promise<void>;
|
|
64
|
-
isUsernameRegistered(username: string): Promise<boolean>;
|
|
65
|
-
signOut(): Promise<void>;
|
|
66
|
-
hasLoginState(): LoginState | null;
|
|
67
|
-
getLoginState(): Promise<LoginState>;
|
|
68
|
-
getUserInfo(params?: {
|
|
69
|
-
version?: string;
|
|
70
|
-
}): Promise<IUserInfo>;
|
|
71
|
-
getWedaUserInfo(): Promise<any>;
|
|
72
|
-
getAuthHeader(): {};
|
|
73
|
-
bindWithProvider(params: authModels.BindWithProviderRequest): Promise<void>;
|
|
74
|
-
queryUser(queryObj: authModels.QueryUserProfileRequest): Promise<authModels.QueryUserProfileResponse>;
|
|
75
|
-
getAccessToken(): Promise<{
|
|
76
|
-
accessToken: string;
|
|
77
|
-
env: string;
|
|
78
|
-
}>;
|
|
79
|
-
grantProviderToken(params: authModels.GrantProviderTokenRequest): Promise<authModels.GrantProviderTokenResponse>;
|
|
80
|
-
patchProviderToken(params: authModels.PatchProviderTokenRequest): Promise<authModels.PatchProviderTokenResponse>;
|
|
81
|
-
signInWithProvider(params: authModels.SignInWithProviderRequest): Promise<LoginState>;
|
|
82
|
-
grantToken(params: authModels.GrantTokenRequest): Promise<LoginState>;
|
|
83
|
-
genProviderRedirectUri(params: authModels.GenProviderRedirectUriRequest): Promise<authModels.GenProviderRedirectUriResponse>;
|
|
84
|
-
resetPassword(params: authModels.ResetPasswordRequest): Promise<void>;
|
|
85
|
-
deviceAuthorize(params: authModels.DeviceAuthorizeRequest): Promise<authModels.DeviceAuthorizeResponse>;
|
|
86
|
-
sudo(params: authModels.SudoRequest): Promise<authModels.SudoResponse>;
|
|
87
|
-
deleteMe(params: authModels.WithSudoRequest): Promise<authModels.UserProfile>;
|
|
88
|
-
getProviders(): Promise<authModels.UserProfileProvider>;
|
|
89
|
-
loginScope(): Promise<string>;
|
|
90
|
-
loginGroups(): Promise<string[]>;
|
|
91
|
-
onLoginStateChanged(callback: Function): Promise<void>;
|
|
92
|
-
refreshTokenForce(params: {
|
|
93
|
-
version?: string;
|
|
94
|
-
}): Promise<Credentials>;
|
|
95
|
-
getCredentials(): Promise<Credentials>;
|
|
96
|
-
getProviderSubType(): Promise<ProviderSubType>;
|
|
97
|
-
createCaptchaData(params: {
|
|
98
|
-
state: string;
|
|
99
|
-
redirect_uri?: string;
|
|
100
|
-
}): Promise<{
|
|
101
|
-
captcha_token: string;
|
|
102
|
-
expires_in: number;
|
|
103
|
-
}>;
|
|
104
|
-
varifyCaptchaData(params: {
|
|
105
|
-
token: string;
|
|
106
|
-
key: string;
|
|
107
|
-
}): Promise<{
|
|
108
|
-
captcha_token: string;
|
|
109
|
-
expires_in: number;
|
|
110
|
-
}>;
|
|
111
|
-
private createLoginState;
|
|
112
|
-
}
|
|
113
|
-
export { UserInfo, Auth };
|
|
114
|
-
export declare function registerAuth(app: Pick<ICloudbase, 'registerComponent'>): void;
|