@cloudbase/js-sdk 2.22.1 → 2.22.4

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/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { IMySqlClient } from '@cloudbase/mysql';
3
3
  import { authModels } from '@cloudbase/oauth';
4
4
  import { AI } from '@cloudbase/ai';
5
5
  import { CloudbaseAdapter, ResponseObject } from '@cloudbase/adapter-interface'
6
- import { ICloudbaseUpgradedConfig, ICloudbase, Persistence, ICloudbaseApis } from '@cloudbase/types'
6
+ import { ICloudbaseUpgradedConfig, ICloudbase, Persistence } from '@cloudbase/types'
7
7
  import { LANGS } from '@cloudbase/types'
8
8
  import { ICustomReqOpts } from '@cloudbase/types/functions'
9
9
 
@@ -13,6 +13,28 @@ type KV<T> = {
13
13
 
14
14
  type ExcludeOf<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
15
15
 
16
+
17
+ declare type MethodType = 'request' | 'post' | 'get' | 'head' | 'patch' | 'delete' | 'put'
18
+
19
+ interface ICallApiOptions {
20
+ /** 请求的path */
21
+ path?: string
22
+ /**请求方法 */
23
+ method?: MethodType
24
+ /**请求头 */
25
+ headers?: KV<any>
26
+ /** 请求体,根据content-type可以是不同类型 */
27
+ body?: KV<any> | string
28
+ /**可传token,如果没有传值,则默认用当前登录的token */
29
+ token?: string
30
+ }
31
+
32
+ interface ICloudbaseApis {
33
+ [apiName: string]: {
34
+ [method in MethodType]: (callApiOptions: ICallApiOptions, opts?: KV<any>) => Promise<ResponseObject['data']>
35
+ }
36
+ }
37
+
16
38
  /**
17
39
  * module
18
40
  */
@@ -913,7 +935,7 @@ declare namespace cloudbase.auth {
913
935
  *
914
936
  * @return Promise
915
937
  */
916
- signOut(): Promise<void>
938
+ signOut(): Promise<void | { redirect_uri?: string }>
917
939
  /**
918
940
  * 检查用户名是否被绑定过
919
941
  *