@cloudbase/types 2.0.3-alpha.0 → 2.5.0-beta.0
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/auth.d.ts +2 -2
- package/cache.d.ts +8 -8
- package/component.d.ts +2 -2
- package/database.d.ts +1 -1
- package/events.d.ts +3 -3
- package/functions.d.ts +2 -4
- package/index.d.ts +5 -5
- package/index.js +1 -1
- package/package.json +15 -5
- package/realtime.d.ts +2 -5
- package/request.d.ts +4 -4
- package/storage.d.ts +7 -17
package/auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICloudbaseConfig, KV, ICloudbase } from '.'
|
|
1
|
+
import { ICloudbaseConfig, KV, ICloudbase } from '.'
|
|
2
2
|
|
|
3
3
|
export type ICloudbaseAuthConfig = Pick<ICloudbaseConfig, 'env' | 'region' | 'persistence' | 'debug' | '_fromApp' | 'oauthInstance'>;
|
|
4
4
|
|
|
@@ -82,4 +82,4 @@ type IProvider = new (...args: any[]) => any;
|
|
|
82
82
|
export interface ICloudbaseAuthModule {
|
|
83
83
|
registerAuth: (app: ICloudbase) => void,
|
|
84
84
|
registerProvider: (name: string, provider: IProvider) => void;
|
|
85
|
-
}
|
|
85
|
+
}
|
package/cache.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICloudbasePlatformInfo, KV,ICloudbaseConfig } from
|
|
1
|
+
import { ICloudbasePlatformInfo, KV, ICloudbaseConfig } from '.'
|
|
2
2
|
|
|
3
3
|
export type ICacheConfig = Pick < ICloudbaseConfig, 'debug' | 'persistence' > & {
|
|
4
4
|
platformInfo?: ICloudbasePlatformInfo;
|
|
@@ -7,7 +7,7 @@ export type ICacheConfig = Pick < ICloudbaseConfig, 'debug' | 'persistence' > &
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export interface ICloudbaseCache {
|
|
10
|
-
keys:KV<string>;
|
|
10
|
+
keys: KV<string>;
|
|
11
11
|
mode: 'async' | 'sync';
|
|
12
12
|
|
|
13
13
|
setStore: (key: string, value: any, version?: string) => void;
|
|
@@ -15,12 +15,12 @@ export interface ICloudbaseCache {
|
|
|
15
15
|
|
|
16
16
|
getStore: (key: string, version?: string) => any;
|
|
17
17
|
getStoreAsync: (key: string, version?: string) => Promise<any>;
|
|
18
|
-
|
|
19
|
-
removeStore: (key:string) => void;
|
|
20
|
-
removeStoreAsync: (key:string) => Promise<void>;
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
removeStore: (key: string) => void;
|
|
20
|
+
removeStoreAsync: (key: string) => Promise<void>;
|
|
21
|
+
|
|
22
|
+
updatePersistence?: (persistence: string) => void;
|
|
23
|
+
updatePersistenceAsync?: (persistence: string) => Promise<void>;
|
|
24
24
|
|
|
25
25
|
clear?: () => void;
|
|
26
|
-
}
|
|
26
|
+
}
|
package/component.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICloudbaseEventEmitter } from './events'
|
|
1
|
+
import { ICloudbaseEventEmitter } from './events'
|
|
2
2
|
|
|
3
3
|
export interface ICloudbaseComponent {
|
|
4
4
|
name: string;
|
|
@@ -14,4 +14,4 @@ export interface ICloudbaseComponent {
|
|
|
14
14
|
export interface ICloudbaseHook {
|
|
15
15
|
entity: any;
|
|
16
16
|
target: string;
|
|
17
|
-
}
|
|
17
|
+
}
|
package/database.d.ts
CHANGED
package/events.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ export interface Listeners {
|
|
|
2
2
|
[key: string]: Function[];
|
|
3
3
|
}
|
|
4
4
|
export interface ICloudbaseEvent {
|
|
5
|
-
name:string;
|
|
5
|
+
name: string;
|
|
6
6
|
target: any;
|
|
7
|
-
data:any;
|
|
7
|
+
data: any;
|
|
8
8
|
}
|
|
9
9
|
export interface ICloudbaseEventEmitter {
|
|
10
10
|
on(name: string, listener: Function): this;
|
|
11
11
|
off(name: string, listener: Function): this;
|
|
12
12
|
fire(event: string | ICloudbaseEvent, data?: any): this;
|
|
13
|
-
}
|
|
13
|
+
}
|
package/functions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KV } from
|
|
1
|
+
import { KV } from '.'
|
|
2
2
|
|
|
3
3
|
export interface ICallFunctionOptions {
|
|
4
4
|
name: string;
|
|
@@ -13,6 +13,4 @@ export interface ICallFunctionResponse {
|
|
|
13
13
|
result: any;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export
|
|
17
|
-
(options: ICallFunctionOptions,callback?: Function):Promise<ICallFunctionResponse>;
|
|
18
|
-
}
|
|
16
|
+
export type ICallFunction = (options: ICallFunctionOptions, callback?: Function) => Promise<ICallFunctionResponse>;
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CloudbaseAdapter, SDKAdapterInterface } from '@cloudbase/adapter-interface'
|
|
2
|
-
import { ICloudbaseComponent, ICloudbaseHook } from
|
|
3
|
-
import { ICloudbaseRequest } from
|
|
4
|
-
import { ICloudbaseCache } from
|
|
1
|
+
import { CloudbaseAdapter, SDKAdapterInterface } from '@cloudbase/adapter-interface'
|
|
2
|
+
import { ICloudbaseComponent, ICloudbaseHook } from './component'
|
|
3
|
+
import { ICloudbaseRequest } from './request'
|
|
4
|
+
import { ICloudbaseCache } from './cache'
|
|
5
5
|
import { ICloudbaseAuth } from './auth'
|
|
6
6
|
|
|
7
7
|
export type Persistence = 'local' | 'session' | 'none';
|
|
@@ -69,4 +69,4 @@ export interface IGenericError<T extends string, P = any> extends Error {
|
|
|
69
69
|
type: T
|
|
70
70
|
payload: P
|
|
71
71
|
generic: boolean
|
|
72
|
-
}
|
|
72
|
+
}
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
// 兼容微信小程序npm
|
|
1
|
+
// 兼容微信小程序npm构建方式,勿删
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/types",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.5.0-beta.0",
|
|
4
4
|
"description": "cloudbase javascript sdk types",
|
|
5
5
|
"files": [
|
|
6
6
|
"index.js",
|
|
@@ -38,12 +38,22 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@cloudbase/adapter-interface": "^0.4.0"
|
|
40
40
|
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"lint": "eslint --fix \"./**/*.ts\"",
|
|
43
|
+
"precommit": "lint-staged"
|
|
44
|
+
},
|
|
45
|
+
"lint-staged": {
|
|
46
|
+
"*.ts": [
|
|
47
|
+
"eslint --fix"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
41
50
|
"devDependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"@typescript-eslint/
|
|
51
|
+
"@tencent/eslint-config-tencent": "^1.0.4",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^5.40.0",
|
|
53
|
+
"@typescript-eslint/parser": "^5.40.0",
|
|
44
54
|
"eslint": "^7.7.0",
|
|
45
|
-
"
|
|
55
|
+
"lint-staged": "^13.0.3",
|
|
46
56
|
"typescript": "^4.0.2"
|
|
47
57
|
},
|
|
48
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "916f06a86425cad63ea80dc398f6b55901c88dfb"
|
|
49
59
|
}
|
package/realtime.d.ts
CHANGED
|
@@ -249,7 +249,7 @@ export type IDBNextEventDataReplace =
|
|
|
249
249
|
| IDBNextEventDataReplaceQueueEnqueue
|
|
250
250
|
| IDBNextEventDataReplaceQueueDequeue
|
|
251
251
|
|
|
252
|
-
export type IDBNextEventDataLimit =
|
|
252
|
+
export type IDBNextEventDataLimit =
|
|
253
253
|
| IDBNextEventDataLimitQueueEnqueue
|
|
254
254
|
| IDBNextEventDataLimitQueueDequeue
|
|
255
255
|
|
|
@@ -347,9 +347,6 @@ export interface DBRealtimeListener {
|
|
|
347
347
|
close: () => void
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
export
|
|
351
|
-
// ws: any
|
|
352
|
-
// query: string
|
|
353
|
-
}
|
|
350
|
+
export type IRealtimeListenerConstructorOptions = IWatchOptions
|
|
354
351
|
|
|
355
352
|
export type SnapshotType = 'init'
|
package/request.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IRequestOptions, IUploadRequestOptions, ResponseObject
|
|
3
|
-
} from '@cloudbase/adapter-interface'
|
|
2
|
+
IRequestOptions, IUploadRequestOptions, ResponseObject,
|
|
3
|
+
} from '@cloudbase/adapter-interface'
|
|
4
4
|
|
|
5
|
-
import { ICloudbaseConfig, KV } from '.'
|
|
5
|
+
import { ICloudbaseConfig, KV } from '.'
|
|
6
6
|
|
|
7
7
|
export interface IGetAccessTokenResult {
|
|
8
8
|
accessToken: string;
|
|
@@ -25,4 +25,4 @@ export interface ICloudbaseRequest {
|
|
|
25
25
|
// getAccessToken: () => Promise<IGetAccessTokenResult>;
|
|
26
26
|
request: (action: string, params: KV<any>, options?: KV<any>) => Promise<ResponseObject>;
|
|
27
27
|
send: (action: string, data: KV<any>) => Promise<any>;
|
|
28
|
-
}
|
|
28
|
+
}
|
package/storage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KVstring } from
|
|
1
|
+
import { KVstring } from '.'
|
|
2
2
|
|
|
3
3
|
export interface ICloudbaseUploadFileParams {
|
|
4
4
|
cloudPath: string;
|
|
@@ -20,25 +20,19 @@ export interface ICloudbaseUploadFileResult {
|
|
|
20
20
|
requestId: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export
|
|
24
|
-
(params: ICloudbaseUploadFileParams, callback?: Function): Promise<ICloudbaseUploadFileResult>;
|
|
25
|
-
}
|
|
23
|
+
export type ICloudbaseUploadFile = (params: ICloudbaseUploadFileParams, callback?: Function) => Promise<ICloudbaseUploadFileResult>;
|
|
26
24
|
|
|
27
25
|
export interface ICloudbaseGetUploadMetadataParams {
|
|
28
26
|
cloudPath: string;
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
export
|
|
32
|
-
(params: ICloudbaseGetUploadMetadataParams, callback?: Function): Promise<any>;
|
|
33
|
-
}
|
|
29
|
+
export type ICloudbaseGetUploadMetadata = (params: ICloudbaseGetUploadMetadataParams, callback?: Function) => Promise<any>;
|
|
34
30
|
|
|
35
31
|
export interface ICloudbaseDeleteFileParams {
|
|
36
32
|
fileList: string[];
|
|
37
33
|
}
|
|
38
34
|
|
|
39
|
-
export
|
|
40
|
-
(params: ICloudbaseDeleteFileParams, callback?: Function): Promise<ICloudbaseDeleteFileResult>;
|
|
41
|
-
}
|
|
35
|
+
export type ICloudbaseDeleteFile = (params: ICloudbaseDeleteFileParams, callback?: Function) => Promise<ICloudbaseDeleteFileResult>;
|
|
42
36
|
|
|
43
37
|
export interface ICloudbaseDeleteFileResult {
|
|
44
38
|
code?: string;
|
|
@@ -72,9 +66,7 @@ export interface ICloudbaseGetTempFileURLResult {
|
|
|
72
66
|
requestId?: string;
|
|
73
67
|
}
|
|
74
68
|
|
|
75
|
-
export
|
|
76
|
-
(params: ICloudbaseGetTempFileURLParams, callback?: Function): Promise<ICloudbaseGetTempFileURLResult>;
|
|
77
|
-
}
|
|
69
|
+
export type ICloudbaseGetTempFileURL = (params: ICloudbaseGetTempFileURLParams, callback?: Function) => Promise<ICloudbaseGetTempFileURLResult>;
|
|
78
70
|
|
|
79
71
|
export interface ICloudbaseDownloadFileParams {
|
|
80
72
|
fileID: string;
|
|
@@ -88,9 +80,7 @@ export interface ICloudbaseDownloadFileResult {
|
|
|
88
80
|
requestId?: string;
|
|
89
81
|
}
|
|
90
82
|
|
|
91
|
-
export
|
|
92
|
-
(params: ICloudbaseDownloadFileParams, callback?: Function): Promise<ICloudbaseDownloadFileResult>;
|
|
93
|
-
}
|
|
83
|
+
export type ICloudbaseDownloadFile = (params: ICloudbaseDownloadFileParams, callback?: Function) => Promise<ICloudbaseDownloadFileResult>;
|
|
94
84
|
|
|
95
85
|
export interface ICloudbaseFileMetaData {
|
|
96
86
|
url: string;
|
|
@@ -104,4 +94,4 @@ export interface ICloudbaseFileMetaData {
|
|
|
104
94
|
export interface ICloudbaseFileMetaDataRes {
|
|
105
95
|
data: ICloudbaseFileMetaData;
|
|
106
96
|
requestId: string;
|
|
107
|
-
}
|
|
97
|
+
}
|