Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@cloudbase/types

Package Overview
Dependencies
Maintainers
13
Versions
310
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudbase/types - npm Package Compare versions

Comparing version
2.23.4-alpha.0
to
2.24.0
+70
-55
auth.d.ts
import { ICloudbaseConfig, KV, ICloudbase } from '.'
import { UserInfo } from '@cloudbase/oauth'
export type ICloudbaseAuthConfig = Pick<ICloudbaseConfig, 'env' | 'clientId' | 'region' | 'persistence' | 'debug' | '_fromApp' | 'oauthInstance' | 'wxCloud' | 'i18n' | 'accessKey' | 'useWxCloud'>;
export type ICloudbaseAuthConfig = Pick<
ICloudbaseConfig,
| 'env'
| 'clientId'
| 'region'
| 'persistence'
| 'debug'
| '_fromApp'
| 'oauthInstance'
| 'wxCloud'
| 'i18n'
| 'accessKey'
| 'useWxCloud'
> &
ICloudbaseConfig['auth']
export interface IAccessTokenInfo {
accessToken: string;
env: string;
accessToken: string
env: string
}
export interface ICredential {
// refreshToken: string;
accessToken?: string;
accessTokenExpire?: string;
accessToken?: string
accessTokenExpire?: string
}
export interface IAuthProvider {
signInWithRedirect: () => any;
signInWithRedirect: () => any
}
export interface IUserInfo {
uid?: string;
loginType?: string;
openid?: string;
wxOpenId?: string;
wxPublicId?: string;
unionId?: string;
qqMiniOpenId?: string;
customUserId?: string;
name?: string;
gender?: string;
email?: string;
username?: string;
hasPassword?: boolean;
uid?: string
loginType?: string
openid?: string
wxOpenId?: string
wxPublicId?: string
unionId?: string
qqMiniOpenId?: string
customUserId?: string
name?: string
gender?: string
email?: string
username?: string
hasPassword?: boolean
location?: {
country?: string;
province?: string;
city?: string;
};
country?: string;
province?: string;
city?: string;
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: (params?: {version?: string;}) => Promise<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: (params?: { version?: string }) => Promise<IUserInfo>
}
export interface ILoginState {
user: IUser;
user: IUser
}
export interface ICloudbaseAuth {
config: ICloudbaseConfig;
loginType: string;
weixinAuthProvider: any;
anonymousAuthProvider: any;
customAuthProvider: any;
getAccessToken: () => IAccessTokenInfo;
getLoginState: () => Promise<ILoginState | null>;
hasLoginState: () => Promise<ILoginState | null>;
getUserInfo: () => Promise<any>;
getAuthHeader: () => Promise<KV<string>>;
onLoginStateChanged: (callback: Function) => void;
onLoginStateExpired: (callback: Function) => void;
onAccessTokenRefreshed: (callback: Function) => void;
onAnonymousConverted: (callback: Function) => void;
onLoginTypeChanged: (callback: Function) => void;
shouldRefreshAccessToken: (hook: Function) => void;
config: ICloudbaseConfig
loginType: string
weixinAuthProvider: any
anonymousAuthProvider: any
customAuthProvider: any
getAccessToken: () => IAccessTokenInfo
getLoginState: () => Promise<ILoginState | null>
hasLoginState: () => Promise<ILoginState | null>
getUserInfo: () => Promise<UserInfo & IUser>
getAuthHeader: () => Promise<KV<string>>
onLoginStateChanged: (callback: Function) => void
onLoginStateExpired: (callback: Function) => void
onAccessTokenRefreshed: (callback: Function) => void
onAnonymousConverted: (callback: Function) => void
onLoginTypeChanged: (callback: Function) => void
shouldRefreshAccessToken: (hook: Function) => void
}
type IProvider = new (...args: any[]) => any;
type IProvider = new (...args: any[]) => any
export interface ICloudbaseAuthModule {
registerAuth: (app: ICloudbase) => void,
registerProvider: (name: string, provider: IProvider) => void;
registerAuth: (app: ICloudbase) => void
registerProvider: (name: string, provider: IProvider) => void
}

@@ -1,2 +0,2 @@

import { CloudbaseAdapter, SDKAdapterInterface } from '@cloudbase/adapter-interface'
import { CloudbaseAdapter, SDKAdapterInterface, ResponseObject } from '@cloudbase/adapter-interface'
import { ICloudbaseComponent, ICloudbaseHook } from './component'

@@ -44,2 +44,5 @@ import { ICloudbaseRequest } from './request'

useWxCloud?: boolean // 是否使用微信云开发链路
auth?: {
detectSessionInUrl?: boolean
}
}

@@ -82,5 +85,5 @@ // 可更新的配置字段

getEndPointWithKey?: (key: EndPointKey) => {
BASE_URL: string;
PROTOCOL: string;
},
BASE_URL: string
PROTOCOL: string
}
auth?: (options?: { persistence: cloudbase.auth.Persistence }) => cloudbase.auth.App

@@ -87,0 +90,0 @@ }

{
"name": "@cloudbase/types",
"version": "2.23.4-alpha.0",
"version": "2.24.0",
"description": "cloudbase javascript sdk types",

@@ -46,3 +46,3 @@ "files": [

},
"gitHead": "d21a4c1277c5d78c4fe949f569cf97c749e6c94d"
"gitHead": "7dac230344ecae3eec15358b2f85d782fde51839"
}

@@ -8,3 +8,3 @@ import { KVstring } from '.'

method?: 'post' | 'put';
headers?: KVstring[];
headers?: KVstring;
onUploadProgress?: Function;

@@ -19,3 +19,3 @@ // 文件内容 Buffer 或 文件可读流, node端使用

filePath: string;
headers?: KVstring[];
headers?: KVstring;
onUploadProgress?: Function;

@@ -22,0 +22,0 @@ }