@nocobase/server 2.1.0-alpha.21 → 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.
|
@@ -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/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
|
}
|