@nocobase/plugin-action-custom-request 1.7.0-beta.20 → 1.7.0-beta.22

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.
@@ -8,21 +8,21 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.7.0-beta.20",
11
+ "@nocobase/client": "1.7.0-beta.22",
12
12
  "react": "18.2.0",
13
13
  "react-i18next": "11.18.6",
14
14
  "@formily/react": "2.3.0",
15
- "@nocobase/logger": "1.7.0-beta.20",
16
- "@nocobase/server": "1.7.0-beta.20",
17
- "@nocobase/test": "1.7.0-beta.20",
15
+ "@nocobase/logger": "1.7.0-beta.22",
16
+ "@nocobase/server": "1.7.0-beta.22",
17
+ "@nocobase/test": "1.7.0-beta.22",
18
18
  "@formily/antd-v5": "1.2.3",
19
19
  "lodash": "4.17.21",
20
- "@nocobase/utils": "1.7.0-beta.20",
20
+ "@nocobase/utils": "1.7.0-beta.22",
21
21
  "antd": "5.24.2",
22
22
  "file-saver": "2.0.5",
23
23
  "@formily/shared": "2.3.2",
24
- "@nocobase/actions": "1.7.0-beta.20",
25
- "@nocobase/evaluators": "1.7.0-beta.20",
24
+ "@nocobase/actions": "1.7.0-beta.22",
25
+ "@nocobase/evaluators": "1.7.0-beta.22",
26
26
  "axios": "1.7.7",
27
- "@nocobase/database": "1.7.0-beta.20"
27
+ "@nocobase/database": "1.7.0-beta.22"
28
28
  };
@@ -43,6 +43,16 @@ module.exports = __toCommonJS(send_exports);
43
43
  var import_utils = require("@nocobase/utils");
44
44
  var import_evaluators = require("@nocobase/evaluators");
45
45
  var import_axios = __toESM(require("axios"));
46
+ function toJSON(value) {
47
+ if (typeof value === "string") {
48
+ try {
49
+ return JSON.parse(value);
50
+ } catch (error) {
51
+ return value;
52
+ }
53
+ }
54
+ return value;
55
+ }
46
56
  const getHeaders = (headers) => {
47
57
  return Object.keys(headers).reduce((hds, key) => {
48
58
  if (key.toLocaleLowerCase().startsWith("x-")) {
@@ -174,7 +184,7 @@ async function send(ctx, next) {
174
184
  ...omitNullAndUndefined(getParsedValue(arrayToObject(headers), variables))
175
185
  },
176
186
  params: getParsedValue(arrayToObject(params), variables),
177
- data: getParsedValue(data, variables)
187
+ data: getParsedValue(toJSON(data), variables)
178
188
  };
179
189
  const requestUrl = import_axios.default.getUri(axiosRequestConfig);
180
190
  this.logger.info(`custom-request:send:${filterByTk} request url ${requestUrl}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-action-custom-request",
3
- "version": "1.7.0-beta.20",
3
+ "version": "1.7.0-beta.22",
4
4
  "main": "dist/server/index.js",
5
5
  "homepage": "https://docs.nocobase.com/handbook/action-custom-request",
6
6
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/action-custom-request",
@@ -22,7 +22,7 @@
22
22
  "@nocobase/server": "1.x",
23
23
  "@nocobase/test": "1.x"
24
24
  },
25
- "gitHead": "178910a2afe33bd4850e2519507d32b631a380fc",
25
+ "gitHead": "22443d65a7ceb31022114a4d0b3ea38b428416b9",
26
26
  "keywords": [
27
27
  "Actions"
28
28
  ]