@nocobase/server 2.1.0-alpha.20 → 2.1.0-alpha.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.
- package/lib/audit-manager/index.d.ts +2 -0
- package/lib/audit-manager/index.js +5 -2
- package/lib/gateway/index.js +2 -2
- package/lib/plugin.js +4 -0
- package/package.json +17 -17
|
@@ -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,
|
package/lib/gateway/index.js
CHANGED
|
@@ -345,10 +345,10 @@ const _Gateway = class _Gateway extends import_events.EventEmitter {
|
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
req.url = req.url.substring(APP_PUBLIC_PATH.length
|
|
348
|
+
req.url = req.url.substring(APP_PUBLIC_PATH.length + "storage".length);
|
|
349
349
|
await compress(req, res);
|
|
350
350
|
return (0, import_serve_handler.default)(req, res, {
|
|
351
|
-
public: (0,
|
|
351
|
+
public: (0, import_utils.resolveStorageRoot)(),
|
|
352
352
|
directoryListing: false
|
|
353
353
|
});
|
|
354
354
|
}
|
package/lib/plugin.js
CHANGED
|
@@ -206,6 +206,7 @@ const _Plugin = class _Plugin {
|
|
|
206
206
|
return;
|
|
207
207
|
}
|
|
208
208
|
const toolsLoader = new import_ai.ToolsLoader(this.ai, {
|
|
209
|
+
pluginName: this.getName(),
|
|
209
210
|
scan: {
|
|
210
211
|
basePath,
|
|
211
212
|
pattern: ["**/tools/**/*.ts", "**/tools/**/*.js", "!**/tools/**/*.d.ts", "**/tools/**/*/description.md"]
|
|
@@ -214,6 +215,7 @@ const _Plugin = class _Plugin {
|
|
|
214
215
|
});
|
|
215
216
|
await toolsLoader.load();
|
|
216
217
|
const mcpLoader = new import_ai.MCPLoader(this.ai, {
|
|
218
|
+
pluginName: this.getName(),
|
|
217
219
|
scan: {
|
|
218
220
|
basePath,
|
|
219
221
|
pattern: ["mcp/*.ts", "mcp/*.js", "!mcp/*.d.ts"]
|
|
@@ -222,11 +224,13 @@ const _Plugin = class _Plugin {
|
|
|
222
224
|
});
|
|
223
225
|
await mcpLoader.load();
|
|
224
226
|
const skillsLoader = new import_ai.SkillsLoader(this.ai, {
|
|
227
|
+
pluginName: this.getName(),
|
|
225
228
|
scan: { basePath, pattern: ["**/skills/**/SKILLS.md"] },
|
|
226
229
|
log: this.log
|
|
227
230
|
});
|
|
228
231
|
await skillsLoader.load();
|
|
229
232
|
const employeeLoader = new import_ai.AIEmployeeLoader(this.ai, {
|
|
233
|
+
pluginName: this.getName(),
|
|
230
234
|
scan: {
|
|
231
235
|
basePath,
|
|
232
236
|
pattern: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/server",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.22",
|
|
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.
|
|
14
|
-
"@nocobase/actions": "2.1.0-alpha.
|
|
15
|
-
"@nocobase/ai": "2.1.0-alpha.
|
|
16
|
-
"@nocobase/auth": "2.1.0-alpha.
|
|
17
|
-
"@nocobase/cache": "2.1.0-alpha.
|
|
18
|
-
"@nocobase/data-source-manager": "2.1.0-alpha.
|
|
19
|
-
"@nocobase/database": "2.1.0-alpha.
|
|
20
|
-
"@nocobase/evaluators": "2.1.0-alpha.
|
|
21
|
-
"@nocobase/lock-manager": "2.1.0-alpha.
|
|
22
|
-
"@nocobase/logger": "2.1.0-alpha.
|
|
23
|
-
"@nocobase/resourcer": "2.1.0-alpha.
|
|
24
|
-
"@nocobase/sdk": "2.1.0-alpha.
|
|
25
|
-
"@nocobase/snowflake-id": "2.1.0-alpha.
|
|
26
|
-
"@nocobase/telemetry": "2.1.0-alpha.
|
|
27
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
13
|
+
"@nocobase/acl": "2.1.0-alpha.22",
|
|
14
|
+
"@nocobase/actions": "2.1.0-alpha.22",
|
|
15
|
+
"@nocobase/ai": "2.1.0-alpha.22",
|
|
16
|
+
"@nocobase/auth": "2.1.0-alpha.22",
|
|
17
|
+
"@nocobase/cache": "2.1.0-alpha.22",
|
|
18
|
+
"@nocobase/data-source-manager": "2.1.0-alpha.22",
|
|
19
|
+
"@nocobase/database": "2.1.0-alpha.22",
|
|
20
|
+
"@nocobase/evaluators": "2.1.0-alpha.22",
|
|
21
|
+
"@nocobase/lock-manager": "2.1.0-alpha.22",
|
|
22
|
+
"@nocobase/logger": "2.1.0-alpha.22",
|
|
23
|
+
"@nocobase/resourcer": "2.1.0-alpha.22",
|
|
24
|
+
"@nocobase/sdk": "2.1.0-alpha.22",
|
|
25
|
+
"@nocobase/snowflake-id": "2.1.0-alpha.22",
|
|
26
|
+
"@nocobase/telemetry": "2.1.0-alpha.22",
|
|
27
|
+
"@nocobase/utils": "2.1.0-alpha.22",
|
|
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": "
|
|
64
|
+
"gitHead": "a1ac28a12fd06c1233f2f7b062c90c0c9bb64222"
|
|
65
65
|
}
|