@cloudbase/types
Advanced tools
Comparing version 0.1.0-beta.5 to 0.1.0-beta.6
@@ -9,10 +9,50 @@ import { ICloudbaseConfig, KV } from '.'; | ||
} | ||
export interface ILoginStateInfo { | ||
isAnonymous?: boolean; | ||
credential: { | ||
refreshToken: string; | ||
accessToken?: string; | ||
export interface ICredential { | ||
refreshToken: string; | ||
accessToken?: string; | ||
accessTokenExpire?: string; | ||
} | ||
export interface IAuthProvider { | ||
signInWithRedirect():any; | ||
} | ||
export interface IUserInfo { | ||
uid: string; | ||
loginType: string; | ||
openid: string; | ||
wxOpenId: string; | ||
wxPublicId: string; | ||
unionId: string; | ||
qqMiniOpenId: string; | ||
customUserId: string; | ||
nickName: string; | ||
gender: string; | ||
avatarUrl: string; | ||
location?: { | ||
country?: string; | ||
province?: string; | ||
city?: string; | ||
}; | ||
country?: string; | ||
province?: string; | ||
city?: string; | ||
} | ||
export interface IUser extends IUserInfo{ | ||
checkLocalInfo(): void; | ||
checkLocalInfoAsync(): Promise<void>; | ||
linkWithTicket(ticket:string): Promise<void>; | ||
linkWithRedirect(provider:IAuthProvider):void; | ||
getLinkedUidList(): Promise<{ hasPrimaryUid: boolean, users: IUserInfo[] }>; | ||
setPrimaryUid(uid:string):Promise<void>; | ||
unlink(loginType: 'CUSTOM'| 'WECHAT-OPEN' | 'WECHAT-PUBLIC' | 'WECHAT-UNION'):Promise<void>; | ||
update(userinfo:IUserInfo):Promise<void>; | ||
refresh():Promise<IUserInfo>; | ||
} | ||
export interface ILoginState { | ||
credential: ICredential; | ||
user: IUser; | ||
isAnonymousAuth: boolean; | ||
isCustomAuth: boolean; | ||
isWeixinAuth: boolean; | ||
loginType: string; | ||
} | ||
export interface ICloudbaseAuth { | ||
@@ -25,4 +65,4 @@ config:ICloudbaseConfig; | ||
getAccessToken(): IAccessTokenInfo; | ||
getLoginState(): Promise<ILoginStateInfo|null>; | ||
hasLoginState(): Promise<ILoginStateInfo|null>; | ||
getLoginState(): Promise<ILoginState|null>; | ||
hasLoginState(): Promise<ILoginState|null>; | ||
getUserInfo(): Promise<any>; | ||
@@ -29,0 +69,0 @@ getAuthHeader(): Promise<KV<string>>; |
@@ -13,7 +13,7 @@ import { ICloudbasePlatformInfo, KV,ICloudbaseConfig } from "."; | ||
setStore(key: string, value: string, version?: string):void; | ||
setStoreAsync(key: string, value: string, version?: string):Promise<void>; | ||
setStore(key: string, value: any, version?: string):void; | ||
setStoreAsync(key: string, value: any, version?: string):Promise<void>; | ||
getStore(key: string, version?: string):string; | ||
getStoreAsync(key: string, version?: string):Promise<string>; | ||
getStore(key: string, version?: string):any; | ||
getStoreAsync(key: string, version?: string):Promise<any>; | ||
@@ -20,0 +20,0 @@ removeStore(key:string):void; |
{ | ||
"name": "@cloudbase/types", | ||
"version": "0.1.0-beta.5", | ||
"version": "0.1.0-beta.6", | ||
"description": "cloudbase javascript sdk types", | ||
@@ -5,0 +5,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8991
268