@nocobase/sdk 0.19.0-alpha.9 → 0.20.0-alpha.1
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/lib/APIClient.d.ts +2 -2
- package/lib/APIClient.js +5 -4
- package/package.json +2 -2
package/lib/APIClient.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosRequestHeaders, AxiosResponse } from 'axios';
|
|
2
2
|
export interface ActionParams {
|
|
3
3
|
filterByTk?: any;
|
|
4
4
|
[key: string]: any;
|
|
@@ -79,6 +79,6 @@ export declare class APIClient {
|
|
|
79
79
|
private initStorage;
|
|
80
80
|
interceptors(): void;
|
|
81
81
|
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D> | ResourceActionOptions): Promise<R>;
|
|
82
|
-
resource(name: string, of?: any): IResource;
|
|
82
|
+
resource(name: string, of?: any, headers?: AxiosRequestHeaders): IResource;
|
|
83
83
|
}
|
|
84
84
|
export {};
|
package/lib/APIClient.js
CHANGED
|
@@ -247,13 +247,13 @@ const _APIClient = class _APIClient {
|
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
249
|
request(config) {
|
|
250
|
-
const { resource, resourceOf, action, params } = config;
|
|
250
|
+
const { resource, resourceOf, action, params, headers } = config;
|
|
251
251
|
if (resource) {
|
|
252
|
-
return this.resource(resource, resourceOf)[action](params);
|
|
252
|
+
return this.resource(resource, resourceOf, headers)[action](params);
|
|
253
253
|
}
|
|
254
254
|
return this.axios.request(config);
|
|
255
255
|
}
|
|
256
|
-
resource(name, of) {
|
|
256
|
+
resource(name, of, headers) {
|
|
257
257
|
const target = {};
|
|
258
258
|
const handler = {
|
|
259
259
|
get: (_, actionName) => {
|
|
@@ -283,7 +283,8 @@ const _APIClient = class _APIClient {
|
|
|
283
283
|
}
|
|
284
284
|
return await this.request({
|
|
285
285
|
...config,
|
|
286
|
-
...opts
|
|
286
|
+
...opts,
|
|
287
|
+
headers
|
|
287
288
|
});
|
|
288
289
|
};
|
|
289
290
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0-alpha.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"axios-mock-adapter": "^1.20.0"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "516c0b1470d77ff499f533ae6b57e4c084450ff5"
|
|
15
15
|
}
|