better-call 1.0.20 → 1.0.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/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/client.cjs +12 -36
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +30 -32
- package/dist/client.d.ts +30 -32
- package/dist/client.js +10 -11
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +2275 -2991
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +2258 -2956
- package/dist/index.js.map +1 -1
- package/dist/node.cjs +127 -194
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +15 -8
- package/dist/node.d.ts +15 -8
- package/dist/node.js +123 -155
- package/dist/node.js.map +1 -1
- package/dist/router-BPTd8L-P.d.ts +1187 -0
- package/dist/router-IP1pntSS.d.cts +1187 -0
- package/package.json +4 -5
- package/dist/router-BDQGRZdc.d.cts +0 -2816
- package/dist/router-BDQGRZdc.d.ts +0 -2816
package/dist/node.cjs
CHANGED
|
@@ -1,204 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
let set_cookie_parser = require("set-cookie-parser");
|
|
3
|
+
set_cookie_parser = require_chunk.__toESM(set_cookie_parser);
|
|
29
4
|
|
|
30
|
-
|
|
31
|
-
var node_exports = {};
|
|
32
|
-
__export(node_exports, {
|
|
33
|
-
getRequest: () => getRequest,
|
|
34
|
-
setResponse: () => setResponse,
|
|
35
|
-
toNodeHandler: () => toNodeHandler
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(node_exports);
|
|
38
|
-
|
|
39
|
-
// src/adapters/node/request.ts
|
|
40
|
-
var set_cookie_parser = __toESM(require("set-cookie-parser"), 1);
|
|
5
|
+
//#region src/adapters/node/request.ts
|
|
41
6
|
function get_raw_body(req, body_size_limit) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (controller.desiredSize === null || controller.desiredSize <= 0) {
|
|
89
|
-
req.pause();
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
pull() {
|
|
94
|
-
req.resume();
|
|
95
|
-
},
|
|
96
|
-
cancel(reason) {
|
|
97
|
-
cancelled = true;
|
|
98
|
-
req.destroy(reason);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
7
|
+
const h = req.headers;
|
|
8
|
+
if (!h["content-type"]) return null;
|
|
9
|
+
const content_length = Number(h["content-length"]);
|
|
10
|
+
if (req.httpVersionMajor === 1 && isNaN(content_length) && h["transfer-encoding"] == null || content_length === 0) return null;
|
|
11
|
+
let length = content_length;
|
|
12
|
+
if (body_size_limit) {
|
|
13
|
+
if (!length) length = body_size_limit;
|
|
14
|
+
else if (length > body_size_limit) throw Error(`Received content-length of ${length}, but only accept up to ${body_size_limit} bytes.`);
|
|
15
|
+
}
|
|
16
|
+
if (req.destroyed) {
|
|
17
|
+
const readable = new ReadableStream();
|
|
18
|
+
readable.cancel();
|
|
19
|
+
return readable;
|
|
20
|
+
}
|
|
21
|
+
let size = 0;
|
|
22
|
+
let cancelled = false;
|
|
23
|
+
return new ReadableStream({
|
|
24
|
+
start(controller) {
|
|
25
|
+
req.on("error", (error) => {
|
|
26
|
+
cancelled = true;
|
|
27
|
+
controller.error(error);
|
|
28
|
+
});
|
|
29
|
+
req.on("end", () => {
|
|
30
|
+
if (cancelled) return;
|
|
31
|
+
controller.close();
|
|
32
|
+
});
|
|
33
|
+
req.on("data", (chunk) => {
|
|
34
|
+
if (cancelled) return;
|
|
35
|
+
size += chunk.length;
|
|
36
|
+
if (size > length) {
|
|
37
|
+
cancelled = true;
|
|
38
|
+
controller.error(/* @__PURE__ */ new Error(`request body size exceeded ${content_length ? "'content-length'" : "BODY_SIZE_LIMIT"} of ${length}`));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
controller.enqueue(chunk);
|
|
42
|
+
if (controller.desiredSize === null || controller.desiredSize <= 0) req.pause();
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
pull() {
|
|
46
|
+
req.resume();
|
|
47
|
+
},
|
|
48
|
+
cancel(reason) {
|
|
49
|
+
cancelled = true;
|
|
50
|
+
req.destroy(reason);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
101
53
|
}
|
|
102
|
-
function getRequest({
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
} else {
|
|
122
|
-
body = get_raw_body(request, bodySizeLimit);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return new Request(base + fullPath, {
|
|
126
|
-
// @ts-expect-error
|
|
127
|
-
duplex: "half",
|
|
128
|
-
method: request.method,
|
|
129
|
-
body,
|
|
130
|
-
headers: request.headers
|
|
131
|
-
});
|
|
54
|
+
function getRequest({ request, base, bodySizeLimit }) {
|
|
55
|
+
const baseUrl = request?.baseUrl;
|
|
56
|
+
const fullPath = baseUrl ? baseUrl + request.url : request.url;
|
|
57
|
+
const maybeConsumedReq = request;
|
|
58
|
+
let body = void 0;
|
|
59
|
+
const method = request.method;
|
|
60
|
+
if (method !== "GET" && method !== "HEAD") if (maybeConsumedReq.body !== void 0) {
|
|
61
|
+
const bodyContent = typeof maybeConsumedReq.body === "string" ? maybeConsumedReq.body : JSON.stringify(maybeConsumedReq.body);
|
|
62
|
+
body = new ReadableStream({ start(controller) {
|
|
63
|
+
controller.enqueue(new TextEncoder().encode(bodyContent));
|
|
64
|
+
controller.close();
|
|
65
|
+
} });
|
|
66
|
+
} else body = get_raw_body(request, bodySizeLimit);
|
|
67
|
+
return new Request(base + fullPath, {
|
|
68
|
+
duplex: "half",
|
|
69
|
+
method: request.method,
|
|
70
|
+
body,
|
|
71
|
+
headers: request.headers
|
|
72
|
+
});
|
|
132
73
|
}
|
|
133
74
|
async function setResponse(res, response) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
res.end();
|
|
183
|
-
} catch (error) {
|
|
184
|
-
cancel(error instanceof Error ? error : new Error(String(error)));
|
|
185
|
-
}
|
|
186
|
-
}
|
|
75
|
+
for (const [key, value] of response.headers) try {
|
|
76
|
+
res.setHeader(key, key === "set-cookie" ? set_cookie_parser.splitCookiesString(response.headers.get(key)) : value);
|
|
77
|
+
} catch (error) {
|
|
78
|
+
res.getHeaderNames().forEach((name) => res.removeHeader(name));
|
|
79
|
+
res.writeHead(500).end(String(error));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
res.writeHead(response.status);
|
|
83
|
+
if (!response.body) {
|
|
84
|
+
res.end();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (response.body.locked) {
|
|
88
|
+
res.end("Fatal error: Response body is locked. This can happen when the response was already read (for example through 'response.json()' or 'response.text()').");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const reader = response.body.getReader();
|
|
92
|
+
if (res.destroyed) {
|
|
93
|
+
reader.cancel();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const cancel = (error) => {
|
|
97
|
+
res.off("close", cancel);
|
|
98
|
+
res.off("error", cancel);
|
|
99
|
+
reader.cancel(error).catch(() => {});
|
|
100
|
+
if (error) res.destroy(error);
|
|
101
|
+
};
|
|
102
|
+
res.on("close", cancel);
|
|
103
|
+
res.on("error", cancel);
|
|
104
|
+
next();
|
|
105
|
+
async function next() {
|
|
106
|
+
try {
|
|
107
|
+
for (;;) {
|
|
108
|
+
const { done, value } = await reader.read();
|
|
109
|
+
if (done) break;
|
|
110
|
+
if (!res.write(value)) {
|
|
111
|
+
res.once("drain", next);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
res.end();
|
|
116
|
+
} catch (error) {
|
|
117
|
+
cancel(error instanceof Error ? error : new Error(String(error)));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
187
120
|
}
|
|
188
121
|
|
|
189
|
-
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/adapters/node/index.ts
|
|
190
124
|
function toNodeHandler(handler) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
125
|
+
return async (req, res) => {
|
|
126
|
+
return setResponse(res, await handler(getRequest({
|
|
127
|
+
base: `${req.headers["x-forwarded-proto"] || (req.socket.encrypted ? "https" : "http")}://${req.headers[":authority"] || req.headers.host}`,
|
|
128
|
+
request: req
|
|
129
|
+
})));
|
|
130
|
+
};
|
|
197
131
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
});
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
exports.getRequest = getRequest;
|
|
135
|
+
exports.setResponse = setResponse;
|
|
136
|
+
exports.toNodeHandler = toNodeHandler;
|
|
204
137
|
//# sourceMappingURL=node.cjs.map
|
package/dist/node.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/adapters/node/
|
|
1
|
+
{"version":3,"file":"node.cjs","names":[],"sources":["../src/adapters/node/request.ts","../src/adapters/node/index.ts"],"sourcesContent":["import type { IncomingMessage, ServerResponse } from \"node:http\";\nimport * as set_cookie_parser from \"set-cookie-parser\";\n\nfunction get_raw_body(req: IncomingMessage, body_size_limit?: number) {\n\tconst h = req.headers;\n\n\tif (!h[\"content-type\"]) return null;\n\n\tconst content_length = Number(h[\"content-length\"]);\n\n\t// check if no request body\n\tif (\n\t\t(req.httpVersionMajor === 1 && isNaN(content_length) && h[\"transfer-encoding\"] == null) ||\n\t\tcontent_length === 0\n\t) {\n\t\treturn null;\n\t}\n\n\tlet length = content_length;\n\n\tif (body_size_limit) {\n\t\tif (!length) {\n\t\t\tlength = body_size_limit;\n\t\t} else if (length > body_size_limit) {\n\t\t\tthrow Error(\n\t\t\t\t`Received content-length of ${length}, but only accept up to ${body_size_limit} bytes.`,\n\t\t\t);\n\t\t}\n\t}\n\n\tif (req.destroyed) {\n\t\tconst readable = new ReadableStream();\n\t\treadable.cancel();\n\t\treturn readable;\n\t}\n\n\tlet size = 0;\n\tlet cancelled = false;\n\n\treturn new ReadableStream({\n\t\tstart(controller) {\n\t\t\treq.on(\"error\", (error) => {\n\t\t\t\tcancelled = true;\n\t\t\t\tcontroller.error(error);\n\t\t\t});\n\n\t\t\treq.on(\"end\", () => {\n\t\t\t\tif (cancelled) return;\n\t\t\t\tcontroller.close();\n\t\t\t});\n\n\t\t\treq.on(\"data\", (chunk) => {\n\t\t\t\tif (cancelled) return;\n\n\t\t\t\tsize += chunk.length;\n\n\t\t\t\tif (size > length) {\n\t\t\t\t\tcancelled = true;\n\n\t\t\t\t\tcontroller.error(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`request body size exceeded ${\n\t\t\t\t\t\t\t\tcontent_length ? \"'content-length'\" : \"BODY_SIZE_LIMIT\"\n\t\t\t\t\t\t\t} of ${length}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontroller.enqueue(chunk);\n\n\t\t\t\tif (controller.desiredSize === null || controller.desiredSize <= 0) {\n\t\t\t\t\treq.pause();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tpull() {\n\t\t\treq.resume();\n\t\t},\n\n\t\tcancel(reason) {\n\t\t\tcancelled = true;\n\t\t\treq.destroy(reason);\n\t\t},\n\t});\n}\n\nexport function getRequest({\n\trequest,\n\tbase,\n\tbodySizeLimit,\n}: {\n\tbase: string;\n\tbodySizeLimit?: number;\n\trequest: IncomingMessage;\n}) {\n\t// In Express subrouters, `request.url` is relative to the mount path (e.g., '/auth/xxx'),\n\t// and `request.baseUrl` holds the mount path (e.g., '/api').\n\t// Build the full path as baseUrl + url when available to preserve the full route.\n\tconst baseUrl = (request as any)?.baseUrl as string | undefined;\n\tconst fullPath = baseUrl ? baseUrl + request.url : request.url;\n\n\t// Check if body has already been parsed by Express middleware\n\tconst maybeConsumedReq = request as any;\n\tlet body = undefined;\n\n\tconst method = request.method;\n\t// Request with GET/HEAD method cannot have body.\n\tif (method !== \"GET\" && method !== \"HEAD\") {\n\t\t// If body was already parsed by Express body-parser middleware\n\t\tif (maybeConsumedReq.body !== undefined) {\n\t\t\t// Convert parsed body back to a ReadableStream\n\t\t\tconst bodyContent =\n\t\t\t\ttypeof maybeConsumedReq.body === \"string\"\n\t\t\t\t\t? maybeConsumedReq.body\n\t\t\t\t\t: JSON.stringify(maybeConsumedReq.body);\n\n\t\t\tbody = new ReadableStream({\n\t\t\t\tstart(controller) {\n\t\t\t\t\tcontroller.enqueue(new TextEncoder().encode(bodyContent));\n\t\t\t\t\tcontroller.close();\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\t// Otherwise, get the raw body stream\n\t\t\tbody = get_raw_body(request, bodySizeLimit);\n\t\t}\n\t}\n\n\treturn new Request(base + fullPath, {\n\t\t// @ts-expect-error\n\t\tduplex: \"half\",\n\t\tmethod: request.method,\n\t\tbody,\n\t\theaders: request.headers as Record<string, string>,\n\t});\n}\n\nexport async function setResponse(res: ServerResponse, response: Response) {\n\tfor (const [key, value] of response.headers as any) {\n\t\ttry {\n\t\t\tres.setHeader(\n\t\t\t\tkey,\n\t\t\t\tkey === \"set-cookie\"\n\t\t\t\t\t? set_cookie_parser.splitCookiesString(response.headers.get(key) as string)\n\t\t\t\t\t: value,\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tres.getHeaderNames().forEach((name) => res.removeHeader(name));\n\t\t\tres.writeHead(500).end(String(error));\n\t\t\treturn;\n\t\t}\n\t}\n\n\tres.writeHead(response.status);\n\n\tif (!response.body) {\n\t\tres.end();\n\t\treturn;\n\t}\n\n\tif (response.body.locked) {\n\t\tres.end(\n\t\t\t\"Fatal error: Response body is locked. \" +\n\t\t\t\t\"This can happen when the response was already read (for example through 'response.json()' or 'response.text()').\",\n\t\t);\n\t\treturn;\n\t}\n\n\tconst reader = response.body.getReader();\n\n\tif (res.destroyed) {\n\t\treader.cancel();\n\t\treturn;\n\t}\n\n\tconst cancel = (error?: Error) => {\n\t\tres.off(\"close\", cancel);\n\t\tres.off(\"error\", cancel);\n\n\t\t// If the reader has already been interrupted with an error earlier,\n\t\t// then it will appear here, it is useless, but it needs to be catch.\n\t\treader.cancel(error).catch(() => {});\n\t\tif (error) res.destroy(error);\n\t};\n\n\tres.on(\"close\", cancel);\n\tres.on(\"error\", cancel);\n\n\tnext();\n\tasync function next() {\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\tconst { done, value } = await reader.read();\n\n\t\t\t\tif (done) break;\n\n\t\t\t\tif (!res.write(value)) {\n\t\t\t\t\tres.once(\"drain\", next);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tres.end();\n\t\t} catch (error) {\n\t\t\tcancel(error instanceof Error ? error : new Error(String(error)));\n\t\t}\n\t}\n}\n","import type { IncomingMessage, ServerResponse } from \"node:http\";\n\nimport { getRequest, setResponse } from \"./request\";\nimport type { Router } from \"../../router.js\";\n\nexport function toNodeHandler(handler: Router[\"handler\"]) {\n\treturn async (req: IncomingMessage, res: ServerResponse) => {\n\t\tconst protocol =\n\t\t\treq.headers[\"x-forwarded-proto\"] || ((req.socket as any).encrypted ? \"https\" : \"http\");\n\t\tconst base = `${protocol}://${req.headers[\":authority\"] || req.headers.host}`;\n\t\tconst response = await handler(getRequest({ base, request: req }));\n\t\treturn setResponse(res, response);\n\t};\n}\n\nexport { getRequest, setResponse };\n"],"mappings":";;;;;AAGA,SAAS,aAAa,KAAsB,iBAA0B;CACrE,MAAM,IAAI,IAAI;AAEd,KAAI,CAAC,EAAE,gBAAiB,QAAO;CAE/B,MAAM,iBAAiB,OAAO,EAAE,kBAAkB;AAGlD,KACE,IAAI,qBAAqB,KAAK,MAAM,eAAe,IAAI,EAAE,wBAAwB,QAClF,mBAAmB,EAEnB,QAAO;CAGR,IAAI,SAAS;AAEb,KAAI,iBACH;MAAI,CAAC,OACJ,UAAS;WACC,SAAS,gBACnB,OAAM,MACL,8BAA8B,OAAO,0BAA0B,gBAAgB,SAC/E;;AAIH,KAAI,IAAI,WAAW;EAClB,MAAM,WAAW,IAAI,gBAAgB;AACrC,WAAS,QAAQ;AACjB,SAAO;;CAGR,IAAI,OAAO;CACX,IAAI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B,IAAI,QAAQ;GACrB,SAAS;GAAK,CAAC,CAAC,CACjC"}
|
package/dist/node.d.cts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Router } from "./router-IP1pntSS.cjs";
|
|
2
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
//#region src/adapters/node/request.d.ts
|
|
5
|
+
declare function getRequest({
|
|
6
|
+
request,
|
|
7
|
+
base,
|
|
8
|
+
bodySizeLimit
|
|
9
|
+
}: {
|
|
10
|
+
base: string;
|
|
11
|
+
bodySizeLimit?: number;
|
|
12
|
+
request: IncomingMessage;
|
|
8
13
|
}): Request;
|
|
9
14
|
declare function setResponse(res: ServerResponse, response: Response): Promise<void>;
|
|
10
|
-
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/adapters/node/index.d.ts
|
|
11
17
|
declare function toNodeHandler(handler: Router["handler"]): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
12
|
-
|
|
18
|
+
//#endregion
|
|
13
19
|
export { getRequest, setResponse, toNodeHandler };
|
|
20
|
+
//# sourceMappingURL=node.d.cts.map
|
package/dist/node.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Router } from "./router-BPTd8L-P.js";
|
|
2
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
//#region src/adapters/node/request.d.ts
|
|
5
|
+
declare function getRequest({
|
|
6
|
+
request,
|
|
7
|
+
base,
|
|
8
|
+
bodySizeLimit
|
|
9
|
+
}: {
|
|
10
|
+
base: string;
|
|
11
|
+
bodySizeLimit?: number;
|
|
12
|
+
request: IncomingMessage;
|
|
8
13
|
}): Request;
|
|
9
14
|
declare function setResponse(res: ServerResponse, response: Response): Promise<void>;
|
|
10
|
-
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/adapters/node/index.d.ts
|
|
11
17
|
declare function toNodeHandler(handler: Router["handler"]): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
12
|
-
|
|
18
|
+
//#endregion
|
|
13
19
|
export { getRequest, setResponse, toNodeHandler };
|
|
20
|
+
//# sourceMappingURL=node.d.ts.map
|