@cloudbase/js-sdk
Advanced tools
@@ -18,6 +18,3 @@ "use strict"; | ||
| var SDK_NAME = utilities_1.constants.SDK_NAME, ERRORS = utilities_1.constants.ERRORS; | ||
| var RUNTIME = utilities_1.adapters.RUNTIME; | ||
| var createSign = utilities_1.utils.createSign; | ||
| var COMPONENT_NAME = 'database'; | ||
| var DATA_VERSION = '2020-01-10'; | ||
| function database(dbConfig) { | ||
@@ -33,7 +30,2 @@ if (!this.authInstance) { | ||
| database_1.Db.runtime = runtime; | ||
| if (runtime !== RUNTIME.WEB) { | ||
| database_1.Db.dataVersion = DATA_VERSION; | ||
| database_1.Db.createSign = createSign; | ||
| database_1.Db.appSecretInfo = __assign({ appSign: this.config.appSign }, this.config.appSecret); | ||
| } | ||
| if (!database_1.Db.ws) { | ||
@@ -40,0 +32,0 @@ database_1.Db.ws = null; |
@@ -13,8 +13,5 @@ var __assign = (this && this.__assign) || function () { | ||
| import { Db } from '@cloudbase/database'; | ||
| import { constants, adapters, utils } from '@cloudbase/utilities'; | ||
| import { constants } from '@cloudbase/utilities'; | ||
| var SDK_NAME = constants.SDK_NAME, ERRORS = constants.ERRORS; | ||
| var RUNTIME = adapters.RUNTIME; | ||
| var createSign = utils.createSign; | ||
| var COMPONENT_NAME = 'database'; | ||
| var DATA_VERSION = '2020-01-10'; | ||
| function database(dbConfig) { | ||
@@ -30,7 +27,2 @@ if (!this.authInstance) { | ||
| Db.runtime = runtime; | ||
| if (runtime !== RUNTIME.WEB) { | ||
| Db.dataVersion = DATA_VERSION; | ||
| Db.createSign = createSign; | ||
| Db.appSecretInfo = __assign({ appSign: this.config.appSign }, this.config.appSecret); | ||
| } | ||
| if (!Db.ws) { | ||
@@ -37,0 +29,0 @@ Db.ws = null; |
+64
-13
@@ -79,31 +79,76 @@ type KV<T> = { | ||
| interface ILoginStateInfo { | ||
| isAnonymous?: boolean; | ||
| credential: { | ||
| refreshToken: string; | ||
| accessToken?: string; | ||
| }; | ||
| interface ILoginState { | ||
| credential: ICredential; | ||
| user: IUser; | ||
| isAnonymousAuth: boolean; | ||
| isCustomAuth: boolean; | ||
| isWeixinAuth: boolean; | ||
| isUsernameAuth: boolean; | ||
| loginType: string; | ||
| } | ||
| interface IWeixinAuthProvider { | ||
| signIn():Promise<ILoginStateInfo>; | ||
| signInWithRedirect():void; | ||
| getRedirectResult():Promise<ILoginStateInfo>; | ||
| getRedirectResult(options:{ | ||
| createUser?: boolean; | ||
| syncUserInfo?: boolean | ||
| }):Promise<ILoginState>; | ||
| } | ||
| interface ICustomAuthProvider { | ||
| signIn(ticket:string):Promise<ILoginStateInfo>; | ||
| signIn(ticket:string):Promise<ILoginState>; | ||
| } | ||
| interface IAnonymousAuthProvider { | ||
| signIn():Promise<ILoginStateInfo>; | ||
| linkAndRetrieveDataWithTicket(ticket: string):Promise<ILoginStateInfo>; | ||
| signIn():Promise<ILoginState>; | ||
| linkAndRetrieveDataWithTicket(ticket: string):Promise<ILoginState>; | ||
| } | ||
| /** | ||
| * User Info | ||
| */ | ||
| interface IUserInfo { | ||
| uid?: string; | ||
| loginType?: string; | ||
| openid?: string; | ||
| wxOpenId?: string; | ||
| wxPublicId?: string; | ||
| unionId?: string; | ||
| qqMiniOpenId?: string; | ||
| customUserId?: string; | ||
| nickName?: string; | ||
| gender?: string; | ||
| avatarUrl?: string; | ||
| email?: string; | ||
| hasPassword?: boolean; | ||
| location?: { | ||
| country?: string; | ||
| province?: string; | ||
| city?: string; | ||
| }; | ||
| country?: string; | ||
| province?: string; | ||
| city?: string; | ||
| } | ||
| 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>; | ||
| updatePassword(newPassword: string, oldPassword?: string): Promise<void>; | ||
| updateEmail(newEmail: string): Promise<void>; | ||
| } | ||
| interface App{ | ||
| currentUser: IUser; | ||
| /** | ||
| * getters | ||
| */ | ||
| getLoginState(): Promise<ILoginStateInfo|null>; | ||
| hasLoginState(): Promise<ILoginStateInfo|null>; | ||
| getLoginState(): Promise<ILoginState|null>; | ||
| hasLoginState(): Promise<ILoginState|null>; | ||
| getUserInfo(): Promise<any>; | ||
@@ -133,2 +178,8 @@ getAuthHeader(): Promise<KV<string>>; | ||
| signOut():Promise<void>; | ||
| signInWithEmailAndPassword(email: string, password: string): Promise<ILoginState>; | ||
| signUpWithEmailAndPassword(email:string, password:string): Promise<void>; | ||
| signInWithEmailAndPassword(email: string, password: string): Promise<ILoginState>; | ||
| sendPasswordResetEmail(email: string): Promise<void>; | ||
| signInWithUsernameAndPassword(username: string, password: string): Promise<ILoginState>; | ||
| isUsernameRegistered(username: string): Promise<boolean>; | ||
| } | ||
@@ -135,0 +186,0 @@ } |
+8
-8
| { | ||
| "name": "@cloudbase/js-sdk", | ||
| "version": "1.0.0-beta", | ||
| "version": "1.0.0", | ||
| "description": "cloudbase javascript sdk", | ||
@@ -40,9 +40,9 @@ "main": "dist/index.cjs.js", | ||
| "dependencies": { | ||
| "@cloudbase/app": "^0.1.0-beta.2", | ||
| "@cloudbase/auth": "^0.1.0-beta.5", | ||
| "@cloudbase/app": "^1.0.0", | ||
| "@cloudbase/auth": "^1.0.0", | ||
| "@cloudbase/database": "^0.9.15", | ||
| "@cloudbase/functions": "^1.0.0-beta", | ||
| "@cloudbase/storage": "^1.0.0-beta", | ||
| "@cloudbase/types": "^1.0.0-beta", | ||
| "@cloudbase/utilities": "^1.0.0-beta" | ||
| "@cloudbase/functions": "^1.0.0", | ||
| "@cloudbase/storage": "^1.0.0", | ||
| "@cloudbase/types": "^1.0.0", | ||
| "@cloudbase/utilities": "^1.0.0" | ||
| }, | ||
@@ -76,3 +76,3 @@ "devDependencies": { | ||
| ], | ||
| "gitHead": "e6278f4b432790818359f17274bd74816a35cf4e" | ||
| "gitHead": "3898802234fd2550f6dbe7faa68d0ca3f4cd94f3" | ||
| } |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
23244
4.48%657
5.46%1
-50%+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated