@nocobase/sdk 1.2.14-alpha → 1.3.0-alpha.20240710141659

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.
@@ -128,6 +128,6 @@ export declare class APIClient {
128
128
  private initStorage;
129
129
  interceptors(): void;
130
130
  request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D> | ResourceActionOptions): Promise<R>;
131
- resource(name: string, of?: any, headers?: AxiosRequestHeaders): IResource;
131
+ resource(name: string, of?: any, headers?: AxiosRequestHeaders, cancel?: boolean): IResource;
132
132
  }
133
133
  export {};
package/lib/APIClient.js CHANGED
@@ -319,10 +319,13 @@ const _APIClient = class _APIClient {
319
319
  }
320
320
  return this.axios.request(config);
321
321
  }
322
- resource(name, of, headers) {
322
+ resource(name, of, headers, cancel) {
323
323
  const target = {};
324
324
  const handler = {
325
325
  get: (_, actionName) => {
326
+ if (cancel) {
327
+ return;
328
+ }
326
329
  let url = name.split(".").join(`/${encodeURIComponent(of) || "_"}/`);
327
330
  url += `:${actionName}`;
328
331
  const config = { url };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/sdk",
3
- "version": "1.2.14-alpha",
3
+ "version": "1.3.0-alpha.20240710141659",
4
4
  "license": "AGPL-3.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": "717c71eee8cec8d230f1856759d97d6a843f8be6"
14
+ "gitHead": "cb8b234443034da0dfa57dd5d6cca1f3b3db6f08"
15
15
  }