@nocobase/server 1.4.9 → 1.4.11

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.
@@ -32,12 +32,12 @@ __export(data_template_exports, {
32
32
  module.exports = __toCommonJS(data_template_exports);
33
33
  async function dataTemplate(ctx, next) {
34
34
  const { resourceName, actionName } = ctx.action;
35
- const { isTemplate, fields } = ctx.action.params;
35
+ const { isTemplate, fields, appends } = ctx.action.params;
36
36
  await next();
37
- if (isTemplate && actionName === "get" && fields.length > 0) {
37
+ if (isTemplate && actionName === "get") {
38
38
  ctx.body = traverseJSON(JSON.parse(JSON.stringify(ctx.body)), {
39
- collection: ctx.db.getCollection(resourceName),
40
- include: fields
39
+ collection: ctx.getCurrentRepository().collection,
40
+ include: [...fields || [], ...appends || []]
41
41
  });
42
42
  }
43
43
  }
@@ -101,7 +101,7 @@ const traverseJSON = /* @__PURE__ */ __name((data, options) => {
101
101
  result[key] = data[key];
102
102
  continue;
103
103
  }
104
- if (field.options.primaryKey && excludePk) {
104
+ if (field.options.primaryKey && excludePk && !collection.isMultiFilterTargetKey()) {
105
105
  continue;
106
106
  }
107
107
  if (field.options.isForeignKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "AGPL-3.0",
@@ -10,18 +10,18 @@
10
10
  "@koa/cors": "^3.1.0",
11
11
  "@koa/multer": "^3.0.2",
12
12
  "@koa/router": "^9.4.0",
13
- "@nocobase/acl": "1.4.9",
14
- "@nocobase/actions": "1.4.9",
15
- "@nocobase/auth": "1.4.9",
16
- "@nocobase/cache": "1.4.9",
17
- "@nocobase/data-source-manager": "1.4.9",
18
- "@nocobase/database": "1.4.9",
19
- "@nocobase/evaluators": "1.4.9",
20
- "@nocobase/logger": "1.4.9",
21
- "@nocobase/resourcer": "1.4.9",
22
- "@nocobase/sdk": "1.4.9",
23
- "@nocobase/telemetry": "1.4.9",
24
- "@nocobase/utils": "1.4.9",
13
+ "@nocobase/acl": "1.4.11",
14
+ "@nocobase/actions": "1.4.11",
15
+ "@nocobase/auth": "1.4.11",
16
+ "@nocobase/cache": "1.4.11",
17
+ "@nocobase/data-source-manager": "1.4.11",
18
+ "@nocobase/database": "1.4.11",
19
+ "@nocobase/evaluators": "1.4.11",
20
+ "@nocobase/logger": "1.4.11",
21
+ "@nocobase/resourcer": "1.4.11",
22
+ "@nocobase/sdk": "1.4.11",
23
+ "@nocobase/telemetry": "1.4.11",
24
+ "@nocobase/utils": "1.4.11",
25
25
  "@types/decompress": "4.2.7",
26
26
  "@types/ini": "^1.3.31",
27
27
  "@types/koa-send": "^4.1.3",
@@ -54,5 +54,5 @@
54
54
  "@types/serve-handler": "^6.1.1",
55
55
  "@types/ws": "^8.5.5"
56
56
  },
57
- "gitHead": "1e1bc9152bd72a251f6f68e046be1ee68dda9bd2"
57
+ "gitHead": "275065a7af0069fc43be71b0231d246146854c7e"
58
58
  }