@aeriajs/node-http 0.0.168 → 0.0.169
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/driver.js +7 -7
- package/dist/driver.mjs +7 -7
- package/package.json +3 -3
package/dist/driver.js
CHANGED
|
@@ -6,9 +6,9 @@ const types_1 = require("@aeriajs/types");
|
|
|
6
6
|
const common_1 = require("@aeriajs/common");
|
|
7
7
|
const http = require("node:http");
|
|
8
8
|
const node_url_1 = require("node:url");
|
|
9
|
-
const getBody = async (
|
|
9
|
+
const getBody = async (request) => {
|
|
10
10
|
const bodyParts = [];
|
|
11
|
-
for await (const chunk of
|
|
11
|
+
for await (const chunk of request) {
|
|
12
12
|
bodyParts.push(chunk);
|
|
13
13
|
}
|
|
14
14
|
return Buffer.concat(bodyParts).toString();
|
|
@@ -79,17 +79,17 @@ const abstractResponse = (response, options) => {
|
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
81
|
exports.abstractResponse = abstractResponse;
|
|
82
|
-
const abstractTransaction = async (
|
|
83
|
-
const req = await (0, exports.abstractRequest)(
|
|
84
|
-
const res = (0, exports.abstractResponse)(
|
|
82
|
+
const abstractTransaction = async (request, response, options) => {
|
|
83
|
+
const req = await (0, exports.abstractRequest)(request);
|
|
84
|
+
const res = (0, exports.abstractResponse)(response, options);
|
|
85
85
|
return {
|
|
86
86
|
req,
|
|
87
87
|
res,
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
const registerServer = (options, cb) => {
|
|
91
|
-
const server = http.createServer(async (
|
|
92
|
-
const { req, res, } = await abstractTransaction(
|
|
91
|
+
const server = http.createServer(async (request, response) => {
|
|
92
|
+
const { req, res, } = await abstractTransaction(request, response, options);
|
|
93
93
|
cb(req, res);
|
|
94
94
|
});
|
|
95
95
|
return {
|
package/dist/driver.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import { ERROR_SYMBOL_DESCRIPTION } from "@aeriajs/types";
|
|
|
4
4
|
import { isEndpointError } from "@aeriajs/common";
|
|
5
5
|
import * as http from "node:http";
|
|
6
6
|
import { parse as parseUrl } from "node:url";
|
|
7
|
-
const getBody = async (
|
|
7
|
+
const getBody = async (request) => {
|
|
8
8
|
const bodyParts = [];
|
|
9
|
-
for await (const chunk of
|
|
9
|
+
for await (const chunk of request) {
|
|
10
10
|
bodyParts.push(chunk);
|
|
11
11
|
}
|
|
12
12
|
return Buffer.concat(bodyParts).toString();
|
|
@@ -68,20 +68,20 @@ export const abstractResponse = (response, options) => {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
|
-
const abstractTransaction = async (
|
|
72
|
-
const req = await abstractRequest(
|
|
73
|
-
const res = abstractResponse(
|
|
71
|
+
const abstractTransaction = async (request, response, options) => {
|
|
72
|
+
const req = await abstractRequest(request);
|
|
73
|
+
const res = abstractResponse(response, options);
|
|
74
74
|
return {
|
|
75
75
|
req,
|
|
76
76
|
res
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
export const registerServer = (options, cb) => {
|
|
80
|
-
const server = http.createServer(async (
|
|
80
|
+
const server = http.createServer(async (request, response) => {
|
|
81
81
|
const {
|
|
82
82
|
req,
|
|
83
83
|
res
|
|
84
|
-
} = await abstractTransaction(
|
|
84
|
+
} = await abstractTransaction(request, response, options);
|
|
85
85
|
cb(req, res);
|
|
86
86
|
});
|
|
87
87
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/node-http",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.169",
|
|
4
4
|
"description": "## Installation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@aeriajs/http": "link:../http"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@aeriajs/common": "^0.0.
|
|
30
|
-
"@aeriajs/http": "^0.0.
|
|
29
|
+
"@aeriajs/common": "^0.0.140",
|
|
30
|
+
"@aeriajs/http": "^0.0.169"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"test": "echo skipping",
|