@cloudbase/types 2.19.1 → 2.19.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ICloudbaseConfig, KV, ICloudbase } from '.'
2
2
 
3
- export type ICloudbaseAuthConfig = Pick<ICloudbaseConfig, 'env' | 'clientId' | 'region' | 'persistence' | 'debug' | '_fromApp' | 'oauthInstance' | 'wxCloud'>;
3
+ export type ICloudbaseAuthConfig = Pick<ICloudbaseConfig, 'env' | 'clientId' | 'region' | 'persistence' | 'debug' | '_fromApp' | 'oauthInstance' | 'wxCloud' | 'i18n'>;
4
4
 
5
5
  export interface IAccessTokenInfo {
6
6
  accessToken: string;
package/functions.d.ts CHANGED
@@ -19,3 +19,4 @@ export interface ICallFunctionResponse {
19
19
  }
20
20
 
21
21
  export type ICallFunction = (options: ICallFunctionOptions, callback?: Function) => Promise<ICallFunctionResponse>
22
+
package/index.d.ts CHANGED
@@ -4,6 +4,11 @@ import { ICloudbaseRequest } from './request'
4
4
  import { ICloudbaseCache } from './cache'
5
5
  import { ICloudbaseAuth } from './auth'
6
6
 
7
+ export enum LANGS {
8
+ ZH = 'zh-CN',
9
+ EN = 'en-US',
10
+ }
11
+
7
12
  export type Persistence = 'local' | 'session' | 'none'
8
13
 
9
14
  export interface KV<T> {
@@ -25,6 +30,12 @@ export interface ICloudbaseConfig {
25
30
  clientId?: string
26
31
  oauthInstance?: any
27
32
  wxCloud?: any
33
+ lang?: LANGS
34
+ i18n?: {
35
+ t: (text: string) => string;
36
+ LANG_HEADER_KEY: string;
37
+ lang: LANGS;
38
+ }
28
39
  }
29
40
  // 可更新的配置字段
30
41
  export type ICloudbaseUpgradedConfig = Pick<ICloudbaseConfig, 'persistence' | 'region' | 'debug'>
@@ -63,3 +74,18 @@ export interface IGenericError<T extends string, P = any> extends Error {
63
74
  payload: P
64
75
  generic: boolean
65
76
  }
77
+
78
+ export interface ICallApiOptions {
79
+ /** api标识 */
80
+ name: string
81
+ /** 请求的path */
82
+ path?: string
83
+ method?: string
84
+ headers?: KV<any>
85
+ data?: KV<any>
86
+ /** 请求体,根据content-type可以是不同类型 */
87
+ body?: KV<any> | string
88
+ /** 自定义配置,可以覆盖其他配置 */
89
+ config?: KV<any>
90
+ token?: string;
91
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/types",
3
- "version": "2.19.1",
3
+ "version": "2.19.3",
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": "61f64bd799ae7ecf290c69402e4cb23d356ac8be"
46
+ "gitHead": "717aeb490c526ffa37eeb71291311257c0a4887b"
47
47
  }
package/request.d.ts CHANGED
@@ -10,7 +10,7 @@ export interface IGetAccessTokenResult {
10
10
  accessTokenExpire: number;
11
11
  }
12
12
 
13
- export type ICloudbaseRequestConfig = Pick<ICloudbaseConfig, 'env' | 'region' | 'timeout' | 'oauthClient' | '_fromApp'>;
13
+ export type ICloudbaseRequestConfig = Pick<ICloudbaseConfig, 'env' | 'region' | 'timeout' | 'oauthClient' | '_fromApp' | 'i18n'>;
14
14
 
15
15
  export interface IAppendedRequestInfo {
16
16
  data: KV<any>;