@noxfly/noxus 2.3.0 → 2.3.1
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/dist/child.js +4 -5
- package/dist/child.mjs +4 -5
- package/dist/main.js +4 -5
- package/dist/main.mjs +4 -5
- package/package.json +4 -4
- package/src/router.ts +4 -5
package/dist/child.js
CHANGED
|
@@ -1104,13 +1104,12 @@ var _Router = class _Router {
|
|
|
1104
1104
|
let isCritical = false;
|
|
1105
1105
|
try {
|
|
1106
1106
|
const payload = this.normalizeBatchPayload(request.body);
|
|
1107
|
-
const
|
|
1108
|
-
for (const [index, item] of payload.requests.entries()) {
|
|
1107
|
+
const batchPromises = payload.requests.map((item, index) => {
|
|
1109
1108
|
const subRequestId = item.requestId ?? `${request.id}:${index}`;
|
|
1110
1109
|
const atomicRequest = new Request(request.event, request.senderId, subRequestId, item.method, item.path, item.body);
|
|
1111
|
-
|
|
1112
|
-
}
|
|
1113
|
-
response.body.responses =
|
|
1110
|
+
return this.handleAtomic(atomicRequest);
|
|
1111
|
+
});
|
|
1112
|
+
response.body.responses = await Promise.all(batchPromises);
|
|
1114
1113
|
} catch (error) {
|
|
1115
1114
|
response.body = void 0;
|
|
1116
1115
|
if (error instanceof ResponseException) {
|
package/dist/child.mjs
CHANGED
|
@@ -1035,13 +1035,12 @@ var _Router = class _Router {
|
|
|
1035
1035
|
let isCritical = false;
|
|
1036
1036
|
try {
|
|
1037
1037
|
const payload = this.normalizeBatchPayload(request.body);
|
|
1038
|
-
const
|
|
1039
|
-
for (const [index, item] of payload.requests.entries()) {
|
|
1038
|
+
const batchPromises = payload.requests.map((item, index) => {
|
|
1040
1039
|
const subRequestId = item.requestId ?? `${request.id}:${index}`;
|
|
1041
1040
|
const atomicRequest = new Request(request.event, request.senderId, subRequestId, item.method, item.path, item.body);
|
|
1042
|
-
|
|
1043
|
-
}
|
|
1044
|
-
response.body.responses =
|
|
1041
|
+
return this.handleAtomic(atomicRequest);
|
|
1042
|
+
});
|
|
1043
|
+
response.body.responses = await Promise.all(batchPromises);
|
|
1045
1044
|
} catch (error) {
|
|
1046
1045
|
response.body = void 0;
|
|
1047
1046
|
if (error instanceof ResponseException) {
|
package/dist/main.js
CHANGED
|
@@ -1285,13 +1285,12 @@ var _Router = class _Router {
|
|
|
1285
1285
|
let isCritical = false;
|
|
1286
1286
|
try {
|
|
1287
1287
|
const payload = this.normalizeBatchPayload(request.body);
|
|
1288
|
-
const
|
|
1289
|
-
for (const [index, item] of payload.requests.entries()) {
|
|
1288
|
+
const batchPromises = payload.requests.map((item, index) => {
|
|
1290
1289
|
const subRequestId = item.requestId ?? `${request.id}:${index}`;
|
|
1291
1290
|
const atomicRequest = new Request(request.event, request.senderId, subRequestId, item.method, item.path, item.body);
|
|
1292
|
-
|
|
1293
|
-
}
|
|
1294
|
-
response.body.responses =
|
|
1291
|
+
return this.handleAtomic(atomicRequest);
|
|
1292
|
+
});
|
|
1293
|
+
response.body.responses = await Promise.all(batchPromises);
|
|
1295
1294
|
} catch (error) {
|
|
1296
1295
|
response.body = void 0;
|
|
1297
1296
|
if (error instanceof ResponseException) {
|
package/dist/main.mjs
CHANGED
|
@@ -1186,13 +1186,12 @@ var _Router = class _Router {
|
|
|
1186
1186
|
let isCritical = false;
|
|
1187
1187
|
try {
|
|
1188
1188
|
const payload = this.normalizeBatchPayload(request.body);
|
|
1189
|
-
const
|
|
1190
|
-
for (const [index, item] of payload.requests.entries()) {
|
|
1189
|
+
const batchPromises = payload.requests.map((item, index) => {
|
|
1191
1190
|
const subRequestId = item.requestId ?? `${request.id}:${index}`;
|
|
1192
1191
|
const atomicRequest = new Request(request.event, request.senderId, subRequestId, item.method, item.path, item.body);
|
|
1193
|
-
|
|
1194
|
-
}
|
|
1195
|
-
response.body.responses =
|
|
1192
|
+
return this.handleAtomic(atomicRequest);
|
|
1193
|
+
});
|
|
1194
|
+
response.body.responses = await Promise.all(batchPromises);
|
|
1196
1195
|
} catch (error) {
|
|
1197
1196
|
response.body = void 0;
|
|
1198
1197
|
if (error instanceof ResponseException) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noxfly/noxus",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"module": "dist/main.mjs",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"require": "./dist/renderer.js"
|
|
13
13
|
},
|
|
14
14
|
"default": {
|
|
15
|
-
"types": "./dist/
|
|
16
|
-
"import": "./dist/
|
|
17
|
-
"require": "./dist/
|
|
15
|
+
"types": "./dist/child.d.ts",
|
|
16
|
+
"import": "./dist/child.mjs",
|
|
17
|
+
"require": "./dist/child.js"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"./renderer": {
|
package/src/router.ts
CHANGED
|
@@ -228,15 +228,14 @@ export class Router {
|
|
|
228
228
|
|
|
229
229
|
try {
|
|
230
230
|
const payload = this.normalizeBatchPayload(request.body);
|
|
231
|
-
const batchResponses: IResponse[] = [];
|
|
232
231
|
|
|
233
|
-
|
|
232
|
+
const batchPromises = payload.requests.map((item, index) => {
|
|
234
233
|
const subRequestId = item.requestId ?? `${request.id}:${index}`;
|
|
235
234
|
const atomicRequest = new Request(request.event, request.senderId, subRequestId, item.method, item.path, item.body);
|
|
236
|
-
|
|
237
|
-
}
|
|
235
|
+
return this.handleAtomic(atomicRequest);
|
|
236
|
+
});
|
|
238
237
|
|
|
239
|
-
response.body!.responses =
|
|
238
|
+
response.body!.responses = await Promise.all(batchPromises);
|
|
240
239
|
}
|
|
241
240
|
catch(error: unknown) {
|
|
242
241
|
response.body = undefined;
|