@nocobase/server 2.1.0-alpha.21 → 2.1.0-alpha.23

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.
@@ -12,6 +12,7 @@ export interface AuditLog {
12
12
  dataSource: string;
13
13
  resource: string;
14
14
  action: string;
15
+ requestSource?: string;
15
16
  sourceCollection?: string;
16
17
  sourceRecordUK?: string;
17
18
  targetCollection?: string;
@@ -102,6 +103,7 @@ export declare class AuditManager {
102
103
  'x-authenticator': any;
103
104
  'x-locale': any;
104
105
  'x-timezone': any;
106
+ 'x-request-source': any;
105
107
  };
106
108
  };
107
109
  response: {
@@ -41,6 +41,7 @@ __export(audit_manager_exports, {
41
41
  });
42
42
  module.exports = __toCommonJS(audit_manager_exports);
43
43
  var import_stream = __toESM(require("stream"));
44
+ const REQUEST_SOURCE_HEADER = "x-request-source";
44
45
  function isStream(obj) {
45
46
  return obj instanceof import_stream.default.Readable || obj instanceof import_stream.default.Writable || obj instanceof import_stream.default.Duplex || obj instanceof import_stream.default.Transform;
46
47
  }
@@ -201,7 +202,7 @@ const _AuditManager = class _AuditManager {
201
202
  return null;
202
203
  }
203
204
  async getDefaultMetaData(ctx) {
204
- var _a, _b, _c;
205
+ var _a, _b, _c, _d;
205
206
  let body = null;
206
207
  if (ctx.body) {
207
208
  if (!Buffer.isBuffer(ctx.body) && !isStream(ctx.body)) {
@@ -217,7 +218,8 @@ const _AuditManager = class _AuditManager {
217
218
  headers: {
218
219
  "x-authenticator": (_a = ctx.request) == null ? void 0 : _a.headers["x-authenticator"],
219
220
  "x-locale": (_b = ctx.request) == null ? void 0 : _b.headers["x-locale"],
220
- "x-timezone": (_c = ctx.request) == null ? void 0 : _c.headers["x-timezone"]
221
+ "x-timezone": (_c = ctx.request) == null ? void 0 : _c.headers["x-timezone"],
222
+ "x-request-source": (_d = ctx.request) == null ? void 0 : _d.headers[REQUEST_SOURCE_HEADER]
221
223
  }
222
224
  },
223
225
  response: {
@@ -241,6 +243,7 @@ const _AuditManager = class _AuditManager {
241
243
  dataSource: ctx.request.header["x-data-source"] || "main",
242
244
  resource: resourceName,
243
245
  action: ctx.action.actionName,
246
+ requestSource: ctx.request.header[REQUEST_SOURCE_HEADER],
244
247
  userId: (_b = (_a = ctx.state) == null ? void 0 : _a.currentUser) == null ? void 0 : _b.id,
245
248
  roleName: (_c = ctx.state) == null ? void 0 : _c.currentRole,
246
249
  ip: ips.length > 0 ? ips[0] : ctx.request.ip,
@@ -67,10 +67,17 @@ const _PackageUrls = class _PackageUrls {
67
67
  }
68
68
  static async get(packageName, lane = "client") {
69
69
  const cacheKey = this.getCacheKey(packageName, lane);
70
- if (!this.items[cacheKey]) {
71
- this.items[cacheKey] = await this.fetch(packageName, lane);
70
+ const cached = this.items[cacheKey];
71
+ if (cached) {
72
+ return cached;
72
73
  }
73
- return this.items[cacheKey];
74
+ const nextUrl = await this.fetch(packageName, lane);
75
+ if (nextUrl == null ? void 0 : nextUrl.includes("?hash=")) {
76
+ this.items[cacheKey] = nextUrl;
77
+ } else {
78
+ delete this.items[cacheKey];
79
+ }
80
+ return nextUrl;
74
81
  }
75
82
  static async hasClientEntry(packageName, lane) {
76
83
  const pkgPath = import_path.default.resolve(process.env.NODE_MODULES_PATH, packageName);
@@ -302,7 +302,7 @@ const _PluginManager = class _PluginManager {
302
302
  if (options == null ? void 0 : options.forceRecreate) {
303
303
  await import_fs_extra.default.rm(pluginDir, { recursive: true, force: true });
304
304
  }
305
- const { PluginGenerator } = require("@nocobase/cli/src/plugin-generator");
305
+ const { PluginGenerator } = require("@nocobase/cli-v1/src/plugin-generator");
306
306
  const generator = new PluginGenerator({
307
307
  cwd: process.cwd(),
308
308
  args: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "2.1.0-alpha.21",
3
+ "version": "2.1.0-alpha.23",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -10,21 +10,21 @@
10
10
  "@koa/cors": "^5.0.0",
11
11
  "@koa/multer": "^3.1.0",
12
12
  "@koa/router": "^13.1.0",
13
- "@nocobase/acl": "2.1.0-alpha.21",
14
- "@nocobase/actions": "2.1.0-alpha.21",
15
- "@nocobase/ai": "2.1.0-alpha.21",
16
- "@nocobase/auth": "2.1.0-alpha.21",
17
- "@nocobase/cache": "2.1.0-alpha.21",
18
- "@nocobase/data-source-manager": "2.1.0-alpha.21",
19
- "@nocobase/database": "2.1.0-alpha.21",
20
- "@nocobase/evaluators": "2.1.0-alpha.21",
21
- "@nocobase/lock-manager": "2.1.0-alpha.21",
22
- "@nocobase/logger": "2.1.0-alpha.21",
23
- "@nocobase/resourcer": "2.1.0-alpha.21",
24
- "@nocobase/sdk": "2.1.0-alpha.21",
25
- "@nocobase/snowflake-id": "2.1.0-alpha.21",
26
- "@nocobase/telemetry": "2.1.0-alpha.21",
27
- "@nocobase/utils": "2.1.0-alpha.21",
13
+ "@nocobase/acl": "2.1.0-alpha.23",
14
+ "@nocobase/actions": "2.1.0-alpha.23",
15
+ "@nocobase/ai": "2.1.0-alpha.23",
16
+ "@nocobase/auth": "2.1.0-alpha.23",
17
+ "@nocobase/cache": "2.1.0-alpha.23",
18
+ "@nocobase/data-source-manager": "2.1.0-alpha.23",
19
+ "@nocobase/database": "2.1.0-alpha.23",
20
+ "@nocobase/evaluators": "2.1.0-alpha.23",
21
+ "@nocobase/lock-manager": "2.1.0-alpha.23",
22
+ "@nocobase/logger": "2.1.0-alpha.23",
23
+ "@nocobase/resourcer": "2.1.0-alpha.23",
24
+ "@nocobase/sdk": "2.1.0-alpha.23",
25
+ "@nocobase/snowflake-id": "2.1.0-alpha.23",
26
+ "@nocobase/telemetry": "2.1.0-alpha.23",
27
+ "@nocobase/utils": "2.1.0-alpha.23",
28
28
  "@types/decompress": "4.2.7",
29
29
  "@types/ini": "^1.3.31",
30
30
  "@types/koa-send": "^4.1.3",
@@ -61,5 +61,5 @@
61
61
  "@types/serve-handler": "^6.1.1",
62
62
  "@types/ws": "^8.5.5"
63
63
  },
64
- "gitHead": "b4c2b469f321ecaec7863a8ae371a02fe6a35aa2"
64
+ "gitHead": "baa19dafe25e85b680b2fea7451f202831930c1c"
65
65
  }