@be-link/request 1.2.1 → 1.3.2

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.
@@ -0,0 +1,36 @@
1
+ export interface INotData<T> {
2
+ apiName: string;
3
+ funcName: string;
4
+ param: T;
5
+ [str: string]: any;
6
+ operateUser?: Record<string, any>;
7
+ }
8
+ export interface IData<T> {
9
+ moduleName: string;
10
+ serviceName: string;
11
+ funcName: string;
12
+ param: T;
13
+ [str: string]: any;
14
+ operateUser?: Record<string, any>;
15
+ }
16
+ export interface ICallFunctionOptions<T> {
17
+ name: string;
18
+ data: IData<T> | INotData<T>;
19
+ query?: Record<string, any>;
20
+ search?: string;
21
+ parse?: boolean;
22
+ }
23
+ export interface ICallFunctionResponse<K> {
24
+ requestId: string;
25
+ data?: {
26
+ response_data?: string;
27
+ };
28
+ result?: {
29
+ msg: string;
30
+ data: K;
31
+ errorCode: number;
32
+ success: boolean;
33
+ };
34
+ }
35
+ declare function callFunction<T, K>(params: ICallFunctionOptions<T>): Promise<K>;
36
+ export default callFunction;
@@ -0,0 +1,4 @@
1
+ export declare enum ENVEnum {
2
+ development = "dev-1gpp53ju3ceb46c7",
3
+ production = "release-7gvojkxi667a3f26"
4
+ }
@@ -0,0 +1,2 @@
1
+ import callFunction from './callFunction';
2
+ export default callFunction;
@@ -0,0 +1,36 @@
1
+ export interface INotData<T> {
2
+ apiName: string;
3
+ funcName: string;
4
+ param: T;
5
+ [str: string]: any;
6
+ operateUser?: Record<string, any>;
7
+ }
8
+ export interface IData<T> {
9
+ moduleName: string;
10
+ serviceName: string;
11
+ funcName: string;
12
+ param: T;
13
+ [str: string]: any;
14
+ operateUser?: Record<string, any>;
15
+ }
16
+ export interface ICallFunctionOptions<T> {
17
+ name: string;
18
+ data: IData<T> | INotData<T>;
19
+ query?: Record<string, any>;
20
+ search?: string;
21
+ parse?: boolean;
22
+ }
23
+ export interface ICallFunctionResponse<K> {
24
+ requestId: string;
25
+ data?: {
26
+ response_data?: string;
27
+ };
28
+ result?: {
29
+ msg: string;
30
+ data: K;
31
+ errorCode: number;
32
+ success: boolean;
33
+ };
34
+ }
35
+ declare function callFunction<T, K>(params: ICallFunctionOptions<T>): Promise<K>;
36
+ export default callFunction;
package/dist/index.d.ts CHANGED
@@ -1,35 +1 @@
1
- export interface INotData<T> {
2
- apiName: string;
3
- funcName: string;
4
- param: T;
5
- [str: string]: any;
6
- operateUser?: Record<string, any>;
7
- }
8
- export interface IData<T> {
9
- moduleName: string;
10
- serviceName: string;
11
- funcName: string;
12
- param: T;
13
- [str: string]: any;
14
- operateUser?: Record<string, any>;
15
- }
16
- export interface ICallFunctionOptions<T> {
17
- name: string;
18
- data: IData<T> | INotData<T>;
19
- query?: Record<string, any>;
20
- search?: string;
21
- parse?: boolean;
22
- }
23
- export interface ICallFunctionResponse<K> {
24
- requestId: string;
25
- data?: {
26
- response_data?: string;
27
- };
28
- result?: {
29
- msg: string;
30
- data: K;
31
- errorCode: number;
32
- success: boolean;
33
- };
34
- }
35
- export declare function callFunction<T, K>(params: ICallFunctionOptions<T>): Promise<K>;
1
+ export { default as callFunction } from './callFunction';
@@ -0,0 +1,2 @@
1
+ import request from './request';
2
+ export default request;
@@ -0,0 +1,12 @@
1
+ import { Method } from 'axios';
2
+ interface IConfig {
3
+ method?: Method;
4
+ data?: any;
5
+ url: string;
6
+ headers?: Record<string, any>;
7
+ params?: Record<string, any>;
8
+ requestInterceptors?: any;
9
+ responseInterceptors?: any;
10
+ }
11
+ declare function request(config: IConfig): Promise<unknown>;
12
+ export default request;
@@ -0,0 +1,12 @@
1
+ import { Method } from 'axios';
2
+ interface IConfig {
3
+ method?: Method;
4
+ data?: any;
5
+ url: string;
6
+ headers?: Record<string, any>;
7
+ params?: Record<string, any>;
8
+ requestInterceptors?: any;
9
+ responseInterceptors?: any;
10
+ }
11
+ declare function request(config: IConfig): Promise<unknown>;
12
+ export default request;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/request",
3
- "version": "1.2.1",
3
+ "version": "1.3.2",
4
4
  "type": "module",
5
5
  "description": "共比邻 request 库",
6
6
  "author": "zhuifeng <yangyiboys@163.com>",
@@ -25,10 +25,11 @@
25
25
  "url": "https://github.com/snowmountain-top/be-link/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@cloudbase/js-sdk": "^1.7.1"
28
+ "@cloudbase/js-sdk": "^1.7.1",
29
+ "axios": "^1.6.7"
29
30
  },
30
31
  "publishConfig": {
31
32
  "access": "public"
32
33
  },
33
- "gitHead": "d8a90dba248ce121a70c862d57e2d0e04319c097"
34
+ "gitHead": "209d6c880424b3faf27175bbc8ed9113e7e79efa"
34
35
  }