@nocobase/server 2.2.0-beta.16 → 2.2.0-beta.17
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/event-queue.js +3 -1
- package/lib/helper.js +4 -2
- package/package.json +17 -17
package/lib/event-queue.js
CHANGED
|
@@ -84,7 +84,9 @@ const _MemoryEventQueueAdapter = class _MemoryEventQueueAdapter {
|
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
const reading = this.reading.get(channel) || [];
|
|
87
|
-
const
|
|
87
|
+
const queue = this.queues.get(channel);
|
|
88
|
+
const concurrency = event.concurrency ?? QUEUE_DEFAULT_CONCURRENCY;
|
|
89
|
+
const count = concurrency <= 0 ? (queue == null ? void 0 : queue.length) || 0 : concurrency - reading.length;
|
|
88
90
|
if (count <= 0) {
|
|
89
91
|
return;
|
|
90
92
|
}
|
package/lib/helper.js
CHANGED
|
@@ -112,7 +112,7 @@ function registerMiddlewares(app, options) {
|
|
|
112
112
|
app.use(
|
|
113
113
|
(0, import_cors.default)({
|
|
114
114
|
credentials: isWhitelistedCorsOrigin,
|
|
115
|
-
exposeHeaders: ["content-disposition"],
|
|
115
|
+
exposeHeaders: ["content-disposition", "x-new-token"],
|
|
116
116
|
origin: resolveCorsOrigin,
|
|
117
117
|
...options.cors
|
|
118
118
|
}),
|
|
@@ -138,6 +138,7 @@ function registerMiddlewares(app, options) {
|
|
|
138
138
|
}
|
|
139
139
|
app.use(/* @__PURE__ */ __name(async function getBearerToken(ctx, next) {
|
|
140
140
|
ctx.getBearerToken = () => {
|
|
141
|
+
var _a2;
|
|
141
142
|
const authorization = ctx.get("Authorization");
|
|
142
143
|
if (authorization) {
|
|
143
144
|
ctx.state.pendingAuthTokenSource = "authorization";
|
|
@@ -147,7 +148,8 @@ function registerMiddlewares(app, options) {
|
|
|
147
148
|
ctx.state.pendingAuthTokenSource = "query";
|
|
148
149
|
return ctx.query.token;
|
|
149
150
|
}
|
|
150
|
-
const
|
|
151
|
+
const canUseAuthCookie = Boolean((_a2 = ctx.state) == null ? void 0 : _a2.fileAccess) && ["GET", "HEAD"].includes(ctx.method);
|
|
152
|
+
const cookieToken = canUseAuthCookie ? ctx.cookies.get((0, import_utils.getAuthCookieName)("authToken", app.name)) : void 0;
|
|
151
153
|
ctx.state.pendingAuthTokenSource = cookieToken ? "cookie" : void 0;
|
|
152
154
|
return cookieToken;
|
|
153
155
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/server",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.17",
|
|
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.2.0-beta.
|
|
14
|
-
"@nocobase/actions": "2.2.0-beta.
|
|
15
|
-
"@nocobase/ai": "2.2.0-beta.
|
|
16
|
-
"@nocobase/auth": "2.2.0-beta.
|
|
17
|
-
"@nocobase/cache": "2.2.0-beta.
|
|
18
|
-
"@nocobase/data-source-manager": "2.2.0-beta.
|
|
19
|
-
"@nocobase/database": "2.2.0-beta.
|
|
20
|
-
"@nocobase/evaluators": "2.2.0-beta.
|
|
21
|
-
"@nocobase/lock-manager": "2.2.0-beta.
|
|
22
|
-
"@nocobase/logger": "2.2.0-beta.
|
|
23
|
-
"@nocobase/resourcer": "2.2.0-beta.
|
|
24
|
-
"@nocobase/sdk": "2.2.0-beta.
|
|
25
|
-
"@nocobase/snowflake-id": "2.2.0-beta.
|
|
26
|
-
"@nocobase/telemetry": "2.2.0-beta.
|
|
27
|
-
"@nocobase/utils": "2.2.0-beta.
|
|
13
|
+
"@nocobase/acl": "2.2.0-beta.17",
|
|
14
|
+
"@nocobase/actions": "2.2.0-beta.17",
|
|
15
|
+
"@nocobase/ai": "2.2.0-beta.17",
|
|
16
|
+
"@nocobase/auth": "2.2.0-beta.17",
|
|
17
|
+
"@nocobase/cache": "2.2.0-beta.17",
|
|
18
|
+
"@nocobase/data-source-manager": "2.2.0-beta.17",
|
|
19
|
+
"@nocobase/database": "2.2.0-beta.17",
|
|
20
|
+
"@nocobase/evaluators": "2.2.0-beta.17",
|
|
21
|
+
"@nocobase/lock-manager": "2.2.0-beta.17",
|
|
22
|
+
"@nocobase/logger": "2.2.0-beta.17",
|
|
23
|
+
"@nocobase/resourcer": "2.2.0-beta.17",
|
|
24
|
+
"@nocobase/sdk": "2.2.0-beta.17",
|
|
25
|
+
"@nocobase/snowflake-id": "2.2.0-beta.17",
|
|
26
|
+
"@nocobase/telemetry": "2.2.0-beta.17",
|
|
27
|
+
"@nocobase/utils": "2.2.0-beta.17",
|
|
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": "d7a69c4f47fe38b17a2ce1408258902cf64f6c83"
|
|
65
65
|
}
|