@cloudbase/types
Advanced tools
Comparing version 1.1.3-alpha.0 to 1.2.1-alpha.0
@@ -23,28 +23,30 @@ import { CloudbaseAdapter, SDKAdapterInterface } from '@cloudbase/adapter-interface'; | ||
appSecret?: ICloudbaseAppSecret; | ||
oauthClient?: any | ||
appSign?: string; | ||
debug?:boolean; | ||
debug?: boolean; | ||
} | ||
// 可更新的配置字段 | ||
export type ICloudbaseUpgradedConfig = Pick<ICloudbaseConfig, 'persistence'|'region'|'debug'>; | ||
export type ICloudbaseUpgradedConfig = Pick<ICloudbaseConfig, 'persistence' | 'region' | 'debug'>; | ||
export interface ICloudbaseExtension { | ||
name: string; | ||
invoke(opts:any,app:ICloudbase):Promise<any>; | ||
invoke(opts: any, app: ICloudbase): Promise<any>; | ||
} | ||
export interface ICloudbase{ | ||
config:ICloudbaseConfig; | ||
platform:ICloudbasePlatformInfo; | ||
cache:ICloudbaseCache; | ||
request:ICloudbaseRequest; | ||
localCache:ICloudbaseCache; | ||
init(config: ICloudbaseConfig):ICloudbase; | ||
updateConfig(config: ICloudbaseUpgradedConfig):void; | ||
registerExtension(ext:ICloudbaseExtension):void; | ||
invokeExtension(name:string,opts:any):Promise<any>; | ||
useAdapters(adapters: CloudbaseAdapter|CloudbaseAdapter[]):void; | ||
registerComponent(component:ICloudbaseComponent):void; | ||
registerHook(hook:ICloudbaseHook):void; | ||
registerVersion(version:string):void; | ||
fire?(...args:any[]):void; | ||
export interface ICloudbase { | ||
config: ICloudbaseConfig; | ||
platform: ICloudbasePlatformInfo; | ||
cache: ICloudbaseCache; | ||
request: ICloudbaseRequest; | ||
oauthClient: any; | ||
localCache: ICloudbaseCache; | ||
init(config: ICloudbaseConfig): ICloudbase; | ||
updateConfig(config: ICloudbaseUpgradedConfig): void; | ||
registerExtension(ext: ICloudbaseExtension): void; | ||
invokeExtension(name: string, opts: any): Promise<any>; | ||
useAdapters(adapters: CloudbaseAdapter | CloudbaseAdapter[]): void; | ||
registerComponent(component: ICloudbaseComponent): void; | ||
registerHook(hook: ICloudbaseHook): void; | ||
registerVersion(version: string): void; | ||
fire?(...args: any[]): void; | ||
} | ||
@@ -51,0 +53,0 @@ |
{ | ||
"name": "@cloudbase/types", | ||
"version": "1.1.3-alpha.0", | ||
"version": "1.2.1-alpha.0", | ||
"description": "cloudbase javascript sdk types", | ||
@@ -48,3 +48,3 @@ "files": [ | ||
}, | ||
"gitHead": "c406b2e966b705b12e552cc9a8ef569b732b1118" | ||
"gitHead": "c462902b6702463670d27acb88ebccf93dbd51cd" | ||
} |
@@ -1,4 +0,7 @@ | ||
import { IRequestOptions, ResponseObject, IUploadRequestOptions } from '@cloudbase/adapter-interface'; | ||
import { ICloudbaseConfig,KV } from "."; | ||
import { | ||
IRequestOptions, IUploadRequestOptions, ResponseObject | ||
} from '@cloudbase/adapter-interface'; | ||
import { ICloudbaseConfig, KV } from '.'; | ||
export interface IGetAccessTokenResult { | ||
@@ -9,19 +12,18 @@ accessToken: string; | ||
export type ICloudbaseRequestConfig = Pick<ICloudbaseConfig, 'env'|'region'|'timeout'|'appSecret'|'appSign'>; | ||
export type ICloudbaseRequestConfig = Pick<ICloudbaseConfig, 'env' | 'region' | 'timeout' | 'appSecret' | 'appSign' | 'oauthClient'>; | ||
export type IAppendedRequestInfo = { | ||
export interface IAppendedRequestInfo { | ||
data: KV<any>; | ||
headers: KV<string>; | ||
} | ||
export interface IRequestBeforeHook { | ||
(...args: any[]): IAppendedRequestInfo; | ||
} | ||
export type IRequestBeforeHook = (...args: any[]) => IAppendedRequestInfo; | ||
export interface ICloudbaseRequest { | ||
post(options: IRequestOptions): Promise<ResponseObject>; | ||
upload(options: IUploadRequestOptions): Promise<ResponseObject>; | ||
download(options: IRequestOptions): Promise<ResponseObject>; | ||
refreshAccessToken(): Promise<IGetAccessTokenResult>; | ||
getAccessToken(): Promise<IGetAccessTokenResult>; | ||
request(action: string, params: KV<any>, options?: KV<any>): Promise<ResponseObject>; | ||
send(action: string, data: KV<any>): Promise<any>; | ||
fetch: (urlOrPath: string, init?: RequestInit) => Promise<Response>; | ||
post: (options: IRequestOptions) => Promise<ResponseObject>; | ||
upload: (options: IUploadRequestOptions) => Promise<ResponseObject>; | ||
download: (options: IRequestOptions) => Promise<ResponseObject>; | ||
refreshAccessToken: () => Promise<IGetAccessTokenResult>; | ||
getAccessToken: () => Promise<IGetAccessTokenResult>; | ||
request: (action: string, params: KV<any>, options?: KV<any>) => Promise<ResponseObject>; | ||
send: (action: string, data: KV<any>) => Promise<any>; | ||
} |
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
19920
617