@cloudbase/types 3.3.3 → 3.3.5

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.
Files changed (3) hide show
  1. package/auth.d.ts +2 -0
  2. package/index.d.ts +36 -0
  3. package/package.json +2 -2
package/auth.d.ts CHANGED
@@ -86,6 +86,8 @@ export interface ICloudbaseAuth {
86
86
  onAnonymousConverted: (callback: Function) => void
87
87
  onLoginTypeChanged: (callback: Function) => void
88
88
  shouldRefreshAccessToken: (hook: Function) => void
89
+ /** 当前登录用户,未登录时为 null */
90
+ currentUser: IUser | null
89
91
  }
90
92
 
91
93
  type IProvider = new (...args: any[]) => any
package/index.d.ts CHANGED
@@ -3,6 +3,19 @@ import { ICloudbaseComponent, ICloudbaseHook } from './component'
3
3
  import { ICloudbaseRequest } from './request'
4
4
  import { ICloudbaseCache } from './cache'
5
5
  import { ICloudbaseAuth } from './auth'
6
+ import { ICallFunctionOptions, ICallFunctionResponse } from './functions'
7
+ import {
8
+ ICloudbaseUploadFileParams,
9
+ ICloudbaseUploadFileResult,
10
+ ICloudbaseDeleteFileParams,
11
+ ICloudbaseDeleteFileResult,
12
+ ICloudbaseGetTempFileURLParams,
13
+ ICloudbaseGetTempFileURLResult,
14
+ ICloudbaseDownloadFileParams,
15
+ ICloudbaseDownloadFileResult,
16
+ ICloudbaseCopyFileParams,
17
+ ICloudbaseCopyFileResult,
18
+ } from './storage'
6
19
  import { cloudbase } from '../cloudbase/index'
7
20
 
8
21
  export enum LANGS {
@@ -34,6 +47,7 @@ export interface ICredentialsInfo {
34
47
 
35
48
  export interface ICloudbaseConfig {
36
49
  env: string
50
+ intl?: boolean,
37
51
  region?: string
38
52
  timeout?: number
39
53
  persistence?: Persistence
@@ -122,6 +136,28 @@ export interface ICloudbase {
122
136
  PROTOCOL: string
123
137
  }
124
138
  auth?: (options?: { persistence: cloudbase.auth.Persistence }) => cloudbase.auth.App
139
+
140
+ // ---- 云函数 ----
141
+ /** 调用云函数 */
142
+ callFunction?: (options: ICallFunctionOptions, callback?: Function) => Promise<ICallFunctionResponse>
143
+
144
+ // ---- 数据库 ----
145
+ /** 获取数据库实例 */
146
+ database?: (dbConfig?: { instance?: string; database?: string }) => cloudbase.database.App
147
+
148
+ // ---- 云存储 ----
149
+ /** Supabase 风格 Storage 实例 */
150
+ storage?: cloudbase.storage.SupabaseFileAPILikeStorage
151
+ /** 上传文件 */
152
+ uploadFile?: (params: ICloudbaseUploadFileParams, callback?: Function) => Promise<ICloudbaseUploadFileResult>
153
+ /** 下载文件 */
154
+ downloadFile?: (params: ICloudbaseDownloadFileParams, callback?: Function) => Promise<ICloudbaseDownloadFileResult>
155
+ /** 删除云端文件 */
156
+ deleteFile?: (params: ICloudbaseDeleteFileParams, callback?: Function) => Promise<ICloudbaseDeleteFileResult>
157
+ /** 获取文件临时下载链接 */
158
+ getTempFileURL?: (params: ICloudbaseGetTempFileURLParams, callback?: Function) => Promise<ICloudbaseGetTempFileURLResult>
159
+ /** 复制/移动文件 */
160
+ copyFile?: (params: ICloudbaseCopyFileParams, callback?: Function) => Promise<ICloudbaseCopyFileResult>
125
161
  }
126
162
 
127
163
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/types",
3
- "version": "3.3.3",
3
+ "version": "3.3.5",
4
4
  "description": "cloudbase javascript sdk types",
5
5
  "files": [
6
6
  "index.js",
@@ -43,5 +43,5 @@
43
43
  "lint": "eslint --fix \"./**/*.ts\"",
44
44
  "precommit": "npm run lint"
45
45
  },
46
- "gitHead": "9549ddd1a3f3fc6bc07a8853b49bd1d696b0558b"
46
+ "gitHead": "c49e85b029e204845cc7e402aef4ca7af89b7875"
47
47
  }