@fncts/http 0.0.12 → 0.0.13
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/LICENSE +26 -0
- package/_cjs/Body/api.cjs +62 -65
- package/_cjs/Body/api.cjs.map +1 -1
- package/_cjs/Body/definition.cjs +66 -69
- package/_cjs/Body/definition.cjs.map +1 -1
- package/_cjs/Body.cjs +20 -28
- package/_cjs/BodyError.cjs +33 -36
- package/_cjs/BodyError.cjs.map +1 -1
- package/_cjs/Headers.cjs +70 -73
- package/_cjs/Headers.cjs.map +1 -1
- package/_cjs/HttpApp.cjs +102 -94
- package/_cjs/HttpApp.cjs.map +1 -1
- package/_cjs/IncomingMessage/api.cjs +24 -23
- package/_cjs/IncomingMessage/api.cjs.map +1 -1
- package/_cjs/IncomingMessage/definition.cjs +12 -13
- package/_cjs/IncomingMessage/definition.cjs.map +1 -1
- package/_cjs/IncomingMessage.cjs +8 -28
- package/_cjs/Method.cjs +6 -7
- package/_cjs/Method.cjs.map +1 -1
- package/_cjs/Middleware.cjs +11 -12
- package/_cjs/Middleware.cjs.map +1 -1
- package/_cjs/QueryParams.cjs +0 -2
- package/_cjs/RequestError.cjs +17 -18
- package/_cjs/RequestError.cjs.map +1 -1
- package/_cjs/ResponseError.cjs +26 -27
- package/_cjs/ResponseError.cjs.map +1 -1
- package/_cjs/Route/api.cjs +87 -74
- package/_cjs/Route/api.cjs.map +1 -1
- package/_cjs/Route/definition.cjs +28 -26
- package/_cjs/Route/definition.cjs.map +1 -1
- package/_cjs/Route/internal.cjs +33 -34
- package/_cjs/Route/internal.cjs.map +1 -1
- package/_cjs/Route.cjs +23 -28
- package/_cjs/RouteNotFound.cjs +16 -17
- package/_cjs/RouteNotFound.cjs.map +1 -1
- package/_cjs/Router/api.cjs +127 -119
- package/_cjs/Router/api.cjs.map +1 -1
- package/_cjs/Router/definition.cjs +14 -14
- package/_cjs/Router/definition.cjs.map +1 -1
- package/_cjs/Router/internal.cjs +75 -82
- package/_cjs/Router/internal.cjs.map +1 -1
- package/_cjs/Router.cjs +24 -28
- package/_cjs/Server.cjs +38 -34
- package/_cjs/Server.cjs.map +1 -1
- package/_cjs/ServerError.cjs +18 -18
- package/_cjs/ServerError.cjs.map +1 -1
- package/_cjs/ServerRequest/api.cjs +9 -10
- package/_cjs/ServerRequest/api.cjs.map +1 -1
- package/_cjs/ServerRequest/definition.cjs +20 -19
- package/_cjs/ServerRequest/definition.cjs.map +1 -1
- package/_cjs/ServerRequest/internal.cjs +77 -80
- package/_cjs/ServerRequest/internal.cjs.map +1 -1
- package/_cjs/ServerRequest.cjs +7 -28
- package/_cjs/ServerResponse/api.cjs +108 -116
- package/_cjs/ServerResponse/api.cjs.map +1 -1
- package/_cjs/ServerResponse/definition.cjs +36 -41
- package/_cjs/ServerResponse/definition.cjs.map +1 -1
- package/_cjs/ServerResponse.cjs +18 -28
- package/_cjs/Socket.cjs +213 -192
- package/_cjs/Socket.cjs.map +1 -1
- package/_cjs/UrlParams.cjs +23 -27
- package/_cjs/UrlParams.cjs.map +1 -1
- package/_cjs/chunk.cjs +28 -0
- package/_cjs/global.cjs +0 -2
- package/_mjs/Body/api.mjs +54 -56
- package/_mjs/Body/api.mjs.map +1 -1
- package/_mjs/Body/definition.mjs +61 -59
- package/_mjs/Body/definition.mjs.map +1 -1
- package/_mjs/Body.mjs +3 -4
- package/_mjs/BodyError.mjs +30 -28
- package/_mjs/BodyError.mjs.map +1 -1
- package/_mjs/Headers.mjs +61 -63
- package/_mjs/Headers.mjs.map +1 -1
- package/_mjs/HttpApp.mjs +74 -79
- package/_mjs/HttpApp.mjs.map +1 -1
- package/_mjs/IncomingMessage/api.mjs +21 -17
- package/_mjs/IncomingMessage/api.mjs.map +1 -1
- package/_mjs/IncomingMessage/definition.mjs +11 -7
- package/_mjs/IncomingMessage/definition.mjs.map +1 -1
- package/_mjs/IncomingMessage.mjs +3 -4
- package/_mjs/Method.mjs +6 -2
- package/_mjs/Method.mjs.map +1 -1
- package/_mjs/Middleware.mjs +10 -6
- package/_mjs/Middleware.mjs.map +1 -1
- package/_mjs/QueryParams.mjs +0 -2
- package/_mjs/RequestError.mjs +16 -12
- package/_mjs/RequestError.mjs.map +1 -1
- package/_mjs/ResponseError.mjs +25 -21
- package/_mjs/ResponseError.mjs.map +1 -1
- package/_mjs/Route/api.mjs +68 -64
- package/_mjs/Route/api.mjs.map +1 -1
- package/_mjs/Route/definition.mjs +21 -17
- package/_mjs/Route/definition.mjs.map +1 -1
- package/_mjs/Route/internal.mjs +30 -26
- package/_mjs/Route/internal.mjs.map +1 -1
- package/_mjs/Route.mjs +3 -4
- package/_mjs/RouteNotFound.mjs +15 -11
- package/_mjs/RouteNotFound.mjs.map +1 -1
- package/_mjs/Router/api.mjs +105 -107
- package/_mjs/Router/api.mjs.map +1 -1
- package/_mjs/Router/definition.mjs +11 -7
- package/_mjs/Router/definition.mjs.map +1 -1
- package/_mjs/Router/internal.mjs +55 -66
- package/_mjs/Router/internal.mjs.map +1 -1
- package/_mjs/Router.mjs +3 -4
- package/_mjs/Server.mjs +28 -24
- package/_mjs/Server.mjs.map +1 -1
- package/_mjs/ServerError.mjs +14 -10
- package/_mjs/ServerError.mjs.map +1 -1
- package/_mjs/ServerRequest/api.mjs +8 -4
- package/_mjs/ServerRequest/api.mjs.map +1 -1
- package/_mjs/ServerRequest/definition.mjs +15 -11
- package/_mjs/ServerRequest/definition.mjs.map +1 -1
- package/_mjs/ServerRequest/internal.mjs +65 -70
- package/_mjs/ServerRequest/internal.mjs.map +1 -1
- package/_mjs/ServerRequest.mjs +3 -4
- package/_mjs/ServerResponse/api.mjs +97 -106
- package/_mjs/ServerResponse/api.mjs.map +1 -1
- package/_mjs/ServerResponse/definition.mjs +30 -32
- package/_mjs/ServerResponse/definition.mjs.map +1 -1
- package/_mjs/ServerResponse.mjs +3 -4
- package/_mjs/Socket.mjs +152 -156
- package/_mjs/Socket.mjs.map +1 -1
- package/_mjs/UrlParams.mjs +22 -20
- package/_mjs/UrlParams.mjs.map +1 -1
- package/_mjs/global.mjs +0 -2
- package/package.json +10 -6
- package/_cjs/Body.cjs.map +0 -1
- package/_cjs/IncomingMessage.cjs.map +0 -1
- package/_cjs/QueryParams.cjs.map +0 -1
- package/_cjs/Route.cjs.map +0 -1
- package/_cjs/Router.cjs.map +0 -1
- package/_cjs/ServerRequest.cjs.map +0 -1
- package/_cjs/ServerResponse.cjs.map +0 -1
- package/_cjs/global.cjs.map +0 -1
- package/_mjs/Body.mjs.map +0 -1
- package/_mjs/IncomingMessage.mjs.map +0 -1
- package/_mjs/QueryParams.mjs.map +0 -1
- package/_mjs/Route.mjs.map +0 -1
- package/_mjs/Router.mjs.map +0 -1
- package/_mjs/ServerRequest.mjs.map +0 -1
- package/_mjs/ServerResponse.mjs.map +0 -1
- package/_mjs/global.mjs.map +0 -1
package/_mjs/Headers.mjs
CHANGED
|
@@ -1,74 +1,72 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "@fncts/base/collection/immutable/HashMap/api";
|
|
2
1
|
import * as tsplus_module_2 from "@fncts/base/util/predicates";
|
|
2
|
+
import * as tsplus_module_1 from "@fncts/base/collection/immutable/HashMap/api";
|
|
3
3
|
import * as tsplus_module_3 from "@fncts/base/collection/Iterable/api";
|
|
4
|
-
|
|
4
|
+
//#region build/esm/Headers.js
|
|
5
|
+
const HeadersTypeId = Symbol.for("fncts.http.Headers");
|
|
5
6
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
toHeadersInit() {
|
|
42
|
-
return Array.from(this.backing);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
7
|
+
* @tsplus type fncts.http.Headers
|
|
8
|
+
* @tsplus companion fncts.http.HeadersOps
|
|
9
|
+
*/
|
|
10
|
+
var Headers = class Headers {
|
|
11
|
+
backing;
|
|
12
|
+
[HeadersTypeId] = HeadersTypeId;
|
|
13
|
+
constructor(backing) {
|
|
14
|
+
this.backing = backing;
|
|
15
|
+
}
|
|
16
|
+
set(key, value) {
|
|
17
|
+
return new Headers(tsplus_module_1.set(key.toLowerCase(), value)(this.backing));
|
|
18
|
+
}
|
|
19
|
+
remove(key) {
|
|
20
|
+
return new Headers(tsplus_module_1.remove(key.toLowerCase())(this.backing));
|
|
21
|
+
}
|
|
22
|
+
get(key) {
|
|
23
|
+
return tsplus_module_1.get(key.toLowerCase())(this.backing);
|
|
24
|
+
}
|
|
25
|
+
unsafeGet(key) {
|
|
26
|
+
return tsplus_module_1.unsafeGet(key.toLowerCase())(this.backing);
|
|
27
|
+
}
|
|
28
|
+
setAll(input) {
|
|
29
|
+
const backing = tsplus_module_1.beginMutation(this.backing);
|
|
30
|
+
if (Symbol.iterator in input) {
|
|
31
|
+
for (const [k, v] of input) tsplus_module_1.set(k.toLowerCase(), v)(backing);
|
|
32
|
+
return new Headers(tsplus_module_1.endMutation(backing));
|
|
33
|
+
} else {
|
|
34
|
+
for (const k in input) tsplus_module_1.set(k.toLowerCase(), input[k])(backing);
|
|
35
|
+
return new Headers(tsplus_module_1.endMutation(backing));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
toHeadersInit() {
|
|
39
|
+
return Array.from(this.backing);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
45
42
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
* @tsplus static fncts.http.HeadersOps isHeaders
|
|
44
|
+
*/
|
|
45
|
+
function isHeaders(u) {
|
|
46
|
+
return tsplus_module_2.isObject(u) && HeadersTypeId in u;
|
|
50
47
|
}
|
|
51
48
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
* @tsplus static fncts.http.HeadersOps empty
|
|
50
|
+
*/
|
|
51
|
+
const empty = new Headers(tsplus_module_1.empty());
|
|
55
52
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
* @tsplus static fncts.http.HeadersOps fromHeaders
|
|
54
|
+
*/
|
|
55
|
+
function fromHeaders(headers) {
|
|
56
|
+
const backing = tsplus_module_1.beginMutation(tsplus_module_1.empty());
|
|
57
|
+
headers.forEach((value, key) => {
|
|
58
|
+
tsplus_module_1.set(key.toLowerCase(), value)(backing);
|
|
59
|
+
});
|
|
60
|
+
return new Headers(tsplus_module_1.endMutation(backing));
|
|
64
61
|
}
|
|
65
62
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
return new Headers(tsplus_module_1.from(Object.entries(input).map(([k, v]) => [k.toLowerCase(), v])));
|
|
63
|
+
* @tsplus static fncts.http.HeadersOps __call
|
|
64
|
+
*/
|
|
65
|
+
function make(input) {
|
|
66
|
+
if (Symbol.iterator in input) return new Headers(tsplus_module_1.from(tsplus_module_3.map(([k, v]) => [k.toLowerCase(), v])(input)));
|
|
67
|
+
return new Headers(tsplus_module_1.from(Object.entries(input).map(([k, v]) => [k.toLowerCase(), v])));
|
|
73
68
|
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { Headers, HeadersTypeId, empty, fromHeaders, isHeaders, make };
|
|
71
|
+
|
|
74
72
|
//# sourceMappingURL=Headers.mjs.map
|
package/_mjs/Headers.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Headers.mjs","names":["
|
|
1
|
+
{"version":3,"file":"Headers.mjs","names":[],"sources":["../esm/Headers.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/base/collection/immutable/HashMap/api\";\nimport * as tsplus_module_2 from \"@fncts/base/util/predicates\";\nimport * as tsplus_module_3 from \"@fncts/base/collection/Iterable/api\";\nexport const HeadersTypeId = Symbol.for(\"fncts.http.Headers\");\n/**\n * @tsplus type fncts.http.Headers\n * @tsplus companion fncts.http.HeadersOps\n */\nexport class Headers {\n backing;\n [HeadersTypeId] = HeadersTypeId;\n constructor(backing) {\n this.backing = backing;\n }\n set(key, value) {\n return new Headers(tsplus_module_1.set(key.toLowerCase(), value)(this.backing));\n }\n remove(key) {\n return new Headers(tsplus_module_1.remove(key.toLowerCase())(this.backing));\n }\n get(key) {\n return tsplus_module_1.get(key.toLowerCase())(this.backing);\n }\n unsafeGet(key) {\n return tsplus_module_1.unsafeGet(key.toLowerCase())(this.backing);\n }\n setAll(input) {\n const backing = tsplus_module_1.beginMutation(this.backing);\n if (Symbol.iterator in input) {\n for (const [k, v] of input) {\n tsplus_module_1.set(k.toLowerCase(), v)(backing);\n }\n return new Headers(tsplus_module_1.endMutation(backing));\n }\n else {\n for (const k in input) {\n tsplus_module_1.set(k.toLowerCase(), input[k])(backing);\n }\n return new Headers(tsplus_module_1.endMutation(backing));\n }\n }\n toHeadersInit() {\n return Array.from(this.backing);\n }\n}\n/**\n * @tsplus static fncts.http.HeadersOps isHeaders\n */\nexport function isHeaders(u) {\n return tsplus_module_2.isObject(u) && HeadersTypeId in u;\n}\n/**\n * @tsplus static fncts.http.HeadersOps empty\n */\nexport const empty = new Headers(tsplus_module_1.empty());\n/**\n * @tsplus static fncts.http.HeadersOps fromHeaders\n */\nexport function fromHeaders(headers) {\n const backing = tsplus_module_1.beginMutation(tsplus_module_1.empty());\n headers.forEach((value, key) => {\n tsplus_module_1.set(key.toLowerCase(), value)(backing);\n });\n return new Headers(tsplus_module_1.endMutation(backing));\n}\n/**\n * @tsplus static fncts.http.HeadersOps __call\n */\nexport function make(input) {\n if (Symbol.iterator in input) {\n return new Headers(tsplus_module_1.from(tsplus_module_3.map(([k, v]) => [k.toLowerCase(), v])(input)));\n }\n return new Headers(tsplus_module_1.from(Object.entries(input).map(([k, v]) => [k.toLowerCase(), v])));\n}\n//# sourceMappingURL=Headers.js.map"],"mappings":";;;;AAGA,MAAa,gBAAgB,OAAO,IAAI,qBAAqB;;;;;AAK7D,IAAa,UAAb,MAAa,QAAQ;CACjB;CACA,CAAC,iBAAiB;CAClB,YAAY,SAAS;AACjB,OAAK,UAAU;;CAEnB,IAAI,KAAK,OAAO;AACZ,SAAO,IAAI,QAAQ,gBAAgB,IAAI,IAAI,aAAa,EAAE,MAAM,CAAC,KAAK,QAAQ,CAAC;;CAEnF,OAAO,KAAK;AACR,SAAO,IAAI,QAAQ,gBAAgB,OAAO,IAAI,aAAa,CAAC,CAAC,KAAK,QAAQ,CAAC;;CAE/E,IAAI,KAAK;AACL,SAAO,gBAAgB,IAAI,IAAI,aAAa,CAAC,CAAC,KAAK,QAAQ;;CAE/D,UAAU,KAAK;AACX,SAAO,gBAAgB,UAAU,IAAI,aAAa,CAAC,CAAC,KAAK,QAAQ;;CAErE,OAAO,OAAO;EACV,MAAM,UAAU,gBAAgB,cAAc,KAAK,QAAQ;AAC3D,MAAI,OAAO,YAAY,OAAO;AAC1B,QAAK,MAAM,CAAC,GAAG,MAAM,MACjB,iBAAgB,IAAI,EAAE,aAAa,EAAE,EAAE,CAAC,QAAQ;AAEpD,UAAO,IAAI,QAAQ,gBAAgB,YAAY,QAAQ,CAAC;SAEvD;AACD,QAAK,MAAM,KAAK,MACZ,iBAAgB,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC,QAAQ;AAE3D,UAAO,IAAI,QAAQ,gBAAgB,YAAY,QAAQ,CAAC;;;CAGhE,gBAAgB;AACZ,SAAO,MAAM,KAAK,KAAK,QAAQ;;;;;;AAMvC,SAAgB,UAAU,GAAG;AACzB,QAAO,gBAAgB,SAAS,EAAE,IAAI,iBAAiB;;;;;AAK3D,MAAa,QAAQ,IAAI,QAAQ,gBAAgB,OAAO,CAAC;;;;AAIzD,SAAgB,YAAY,SAAS;CACjC,MAAM,UAAU,gBAAgB,cAAc,gBAAgB,OAAO,CAAC;AACtE,SAAQ,SAAS,OAAO,QAAQ;AAC5B,kBAAgB,IAAI,IAAI,aAAa,EAAE,MAAM,CAAC,QAAQ;GACxD;AACF,QAAO,IAAI,QAAQ,gBAAgB,YAAY,QAAQ,CAAC;;;;;AAK5D,SAAgB,KAAK,OAAO;AACxB,KAAI,OAAO,YAAY,MACnB,QAAO,IAAI,QAAQ,gBAAgB,KAAK,gBAAgB,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1G,QAAO,IAAI,QAAQ,gBAAgB,KAAK,OAAO,QAAQ,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC"}
|
package/_mjs/HttpApp.mjs
CHANGED
|
@@ -1,98 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import * as tsplus_module_3 from "@fncts/base/data/Environment/api";
|
|
5
|
-
import * as tsplus_module_4 from "@fncts/io/IO/api";
|
|
6
|
-
import * as tsplus_module_5 from "@fncts/base/data/Maybe/destructors";
|
|
7
|
-
import * as tsplus_module_6 from "@fncts/base/data/Exit/definition";
|
|
1
|
+
import { isServerResponse } from "./ServerResponse/definition.mjs";
|
|
2
|
+
import "./ServerResponse.mjs";
|
|
3
|
+
import { clientAbortFiberId } from "./ServerError.mjs";
|
|
8
4
|
import * as tsplus_module_7 from "@fncts/base/data/Cause/api";
|
|
9
|
-
import * as
|
|
5
|
+
import * as tsplus_module_4 from "@fncts/io/IO/api";
|
|
10
6
|
import * as tsplus_module_9 from "@fncts/base/data/Exit/constructors";
|
|
11
|
-
import * as tsplus_module_10 from "@fncts/io/IO/api/scoped";
|
|
12
7
|
import * as tsplus_module_11 from "@fncts/io/IO/api/interrupt";
|
|
13
8
|
import * as tsplus_module_12 from "@fncts/base/data/Maybe/constructors";
|
|
9
|
+
import * as tsplus_module_17 from "@fncts/io/IO/api/environment";
|
|
10
|
+
import * as tsplus_module_10 from "@fncts/io/IO/api/scoped";
|
|
11
|
+
import { globalValue } from "@fncts/base/data/Global";
|
|
12
|
+
import * as tsplus_module_2 from "@fncts/io/FiberRef/unsafe";
|
|
13
|
+
import * as tsplus_module_1 from "@fncts/http/ServerRequest/definition";
|
|
14
|
+
import * as tsplus_module_3 from "@fncts/base/data/Environment/api";
|
|
14
15
|
import * as tsplus_module_13 from "@fncts/io/FiberRef/operations";
|
|
16
|
+
import * as tsplus_module_8 from "@fncts/base/data/Maybe/definition";
|
|
17
|
+
import { defaultRuntime } from "@fncts/io/IO";
|
|
18
|
+
import * as tsplus_module_5 from "@fncts/base/data/Maybe/destructors";
|
|
19
|
+
import * as tsplus_module_6 from "@fncts/base/data/Exit/definition";
|
|
15
20
|
import * as tsplus_module_14 from "@fncts/http/ServerResponse/api";
|
|
16
21
|
import * as tsplus_module_15 from "@fncts/base/data/Cause/api/prettyPrint";
|
|
17
22
|
import * as tsplus_module_16 from "@fncts/http/ServerRequest/api";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import { clientAbortFiberId } from "./ServerError.mjs";
|
|
23
|
-
import { isServerResponse } from "./ServerResponse.mjs";
|
|
24
|
-
export const HttpApp = {};
|
|
23
|
+
//#region build/esm/HttpApp.js
|
|
24
|
+
const fileName_1 = "(@fncts/http) src/HttpApp.ts";
|
|
25
|
+
const toHandled = toHandled_1;
|
|
26
|
+
const HttpApp = {};
|
|
25
27
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
* @tsplus pipeable fncts.http.HttpApp toHandled
|
|
29
|
+
*/
|
|
28
30
|
function toHandled_1(handleResponse, middleware) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return tsplus_module_11.uninterruptible(tsplus_module_10.scoped(middleware ? middleware(responded) : responded, fileName_1 + ":54:60"), fileName_1 + ":54:67");
|
|
45
|
-
};
|
|
31
|
+
return (self) => {
|
|
32
|
+
const responded = tsplus_module_4.withFiberRuntime((fiber) => {
|
|
33
|
+
const request = tsplus_module_3.unsafeGet(tsplus_module_1.ServerRequestTag)(fiber.getFiberRef(tsplus_module_2.currentEnvironment));
|
|
34
|
+
const handler = fiber.getFiberRef(currentPreResponseHandlers_1);
|
|
35
|
+
const preHandled = tsplus_module_5.match(() => self, (handler) => tsplus_module_4.flatMap((response) => handler(request, response), fileName_1 + ":41:34")(self))(handler);
|
|
36
|
+
return tsplus_module_4.flatMap((exit) => {
|
|
37
|
+
if (tsplus_module_6.isFailure(exit)) {
|
|
38
|
+
const haltMaybe = tsplus_module_7.haltMaybe(exit.cause);
|
|
39
|
+
if (tsplus_module_8.isJust(haltMaybe) && isServerResponse(haltMaybe.value)) exit = tsplus_module_9.succeed(haltMaybe.value, fileName_1 + ":47:32");
|
|
40
|
+
}
|
|
41
|
+
return tsplus_module_4.zipRight(exit, fileName_1 + ":50:47")(handleResponse(request, exit));
|
|
42
|
+
}, fileName_1 + ":43:39")(tsplus_module_4.result(preHandled, fileName_1 + ":43:24"));
|
|
43
|
+
}, fileName_1 + ":36:42");
|
|
44
|
+
return tsplus_module_11.uninterruptible(tsplus_module_10.scoped(middleware ? middleware(responded) : responded, fileName_1 + ":54:60"), fileName_1 + ":54:67");
|
|
45
|
+
};
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const currentPreResponseHandlers_1 =
|
|
51
|
-
|
|
48
|
+
* @tsplus static fncts.http.HttpAppOps currentPreResponseHandlers
|
|
49
|
+
*/
|
|
50
|
+
const currentPreResponseHandlers_1 = globalValue(Symbol.for("fncts.http.HttpApp.currentPreResponseHandlers"), () => tsplus_module_2.unsafeMake(tsplus_module_12.nothing(fileName_1 + ":67:57")));
|
|
51
|
+
const currentPreResponseHandlers = currentPreResponseHandlers_1;
|
|
52
52
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
* @tsplus static fncts.http.HttpAppOps appendPreResponseHandler
|
|
54
|
+
*/
|
|
55
|
+
function appendPreResponseHandler(handler) {
|
|
56
|
+
return tsplus_module_13.update((handlers) => tsplus_module_5.match(() => tsplus_module_12.just(handler, fileName_1 + ":76:17"), (prev) => tsplus_module_12.just((request, response) => tsplus_module_4.flatMap((response) => handler(request, response), fileName_1 + ":77:76")(prev(request, response)), fileName_1 + ":77:21"))(handlers), fileName_1 + ":74:51")(currentPreResponseHandlers_1);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
* @tsplus pipeable fncts.http.HttpApp withPreResponseHandler
|
|
60
|
+
*/
|
|
61
|
+
function withPreResponseHandler(handler) {
|
|
62
|
+
return (self) => tsplus_module_13.locallyWith(currentPreResponseHandlers_1, (handlers) => tsplus_module_5.match(() => tsplus_module_12.just(handler, fileName_1 + ":89:19"), (prev) => tsplus_module_12.just((request, response) => tsplus_module_4.flatMap((response) => handler(request, response), fileName_1 + ":91:70")(prev(request, response)), fileName_1 + ":91:15"))(handlers), fileName_1 + ":87:51")(self);
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const fiber = run(tsplus_module_10.scoped(tsplus_module_4.map(res => tsplus_module_14.toWeb(req.method === "HEAD")(res), fileName_1 + ":118:65")(tsplus_module_17.provideSomeService(req, tsplus_module_1.ServerRequestTag, fileName_1 + ":118:37")(handled)), fileName_1 + ":118:108"), fileName_1 + ":117:42");
|
|
87
|
-
request.signal.addEventListener("abort", () => {
|
|
88
|
-
fiber.interruptAsFork(clientAbortFiberId, fileName_1 + ":123:34");
|
|
89
|
-
}, {
|
|
90
|
-
once: true
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
};
|
|
64
|
+
function toWebHandlerRuntime(runtime) {
|
|
65
|
+
const run = runtime.unsafeRunFiber;
|
|
66
|
+
const resolveSymbol = Symbol();
|
|
67
|
+
const rejectSymbol = Symbol();
|
|
68
|
+
return (self) => {
|
|
69
|
+
const handled = toHandled_1((request, exit) => {
|
|
70
|
+
const webRequest = request.source;
|
|
71
|
+
if (tsplus_module_6.isSuccess(exit)) request[resolveSymbol](tsplus_module_14.toWeb(request.method === "HEAD")(exit.value));
|
|
72
|
+
else if (tsplus_module_7.isInterruptedOnly(exit.cause)) request[resolveSymbol](new Response(null, { status: webRequest.signal.aborted ? 499 : 503 }));
|
|
73
|
+
else request[rejectSymbol](tsplus_module_15.prettyPrint(exit.cause));
|
|
74
|
+
return tsplus_module_4.unit;
|
|
75
|
+
})(self);
|
|
76
|
+
return (request) => new Promise((resolve, reject) => {
|
|
77
|
+
const req = tsplus_module_16.fromWeb(request);
|
|
78
|
+
req[resolveSymbol] = resolve;
|
|
79
|
+
req[rejectSymbol] = reject;
|
|
80
|
+
const fiber = run(tsplus_module_10.scoped(tsplus_module_4.map((res) => tsplus_module_14.toWeb(req.method === "HEAD")(res), fileName_1 + ":118:65")(tsplus_module_17.provideSomeService(req, tsplus_module_1.ServerRequestTag, fileName_1 + ":118:37")(handled)), fileName_1 + ":118:108"), fileName_1 + ":117:42");
|
|
81
|
+
request.signal.addEventListener("abort", () => {
|
|
82
|
+
fiber.interruptAsFork(clientAbortFiberId, fileName_1 + ":123:34");
|
|
83
|
+
}, { once: true });
|
|
84
|
+
});
|
|
85
|
+
};
|
|
94
86
|
}
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
function toWebHandler(self) {
|
|
88
|
+
return toWebHandlerRuntime(defaultRuntime)(self);
|
|
97
89
|
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { HttpApp, appendPreResponseHandler, currentPreResponseHandlers, toHandled, toWebHandler, toWebHandlerRuntime, withPreResponseHandler };
|
|
92
|
+
|
|
98
93
|
//# sourceMappingURL=HttpApp.mjs.map
|
package/_mjs/HttpApp.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpApp.mjs","names":["
|
|
1
|
+
{"version":3,"file":"HttpApp.mjs","names":[],"sources":["../esm/HttpApp.js"],"sourcesContent":["const fileName_1 = \"(@fncts/http) src/HttpApp.ts\";\nimport * as tsplus_module_1 from \"@fncts/http/ServerRequest/definition\";\nimport * as tsplus_module_2 from \"@fncts/io/FiberRef/unsafe\";\nimport * as tsplus_module_3 from \"@fncts/base/data/Environment/api\";\nimport * as tsplus_module_4 from \"@fncts/io/IO/api\";\nimport * as tsplus_module_5 from \"@fncts/base/data/Maybe/destructors\";\nimport * as tsplus_module_6 from \"@fncts/base/data/Exit/definition\";\nimport * as tsplus_module_7 from \"@fncts/base/data/Cause/api\";\nimport * as tsplus_module_8 from \"@fncts/base/data/Maybe/definition\";\nimport * as tsplus_module_9 from \"@fncts/base/data/Exit/constructors\";\nimport * as tsplus_module_10 from \"@fncts/io/IO/api/scoped\";\nimport * as tsplus_module_11 from \"@fncts/io/IO/api/interrupt\";\nimport * as tsplus_module_12 from \"@fncts/base/data/Maybe/constructors\";\nimport * as tsplus_module_13 from \"@fncts/io/FiberRef/operations\";\nimport * as tsplus_module_14 from \"@fncts/http/ServerResponse/api\";\nimport * as tsplus_module_15 from \"@fncts/base/data/Cause/api/prettyPrint\";\nimport * as tsplus_module_16 from \"@fncts/http/ServerRequest/api\";\nimport * as tsplus_module_17 from \"@fncts/io/IO/api/environment\";\nexport const toHandled = toHandled_1;\nimport { globalValue } from \"@fncts/base/data/Global\";\nimport { defaultRuntime } from \"@fncts/io/IO\";\nimport { clientAbortFiberId } from \"./ServerError.js\";\nimport { isServerResponse } from \"./ServerResponse.js\";\nexport const HttpApp = {};\n/**\n * @tsplus pipeable fncts.http.HttpApp toHandled\n */\nfunction toHandled_1(handleResponse, middleware) {\n return (self) => {\n const responded = tsplus_module_4.withFiberRuntime((fiber) => {\n const request = tsplus_module_3.unsafeGet(tsplus_module_1.ServerRequestTag)(fiber.getFiberRef(tsplus_module_2.currentEnvironment));\n const handler = fiber.getFiberRef(currentPreResponseHandlers_1);\n const preHandled = tsplus_module_5.match(() => self, (handler) => tsplus_module_4.flatMap((response) => handler(request, response), fileName_1 + \":41:34\")(self))(handler);\n return tsplus_module_4.flatMap((exit) => {\n if (tsplus_module_6.isFailure(exit)) {\n const haltMaybe = tsplus_module_7.haltMaybe(exit.cause);\n if (tsplus_module_8.isJust(haltMaybe) && isServerResponse(haltMaybe.value)) {\n exit = tsplus_module_9.succeed(haltMaybe.value, fileName_1 + \":47:32\");\n }\n }\n return tsplus_module_4.zipRight(exit, fileName_1 + \":50:47\")(handleResponse(request, exit));\n }, fileName_1 + \":43:39\")(tsplus_module_4.result(preHandled, fileName_1 + \":43:24\"));\n }, fileName_1 + \":36:42\");\n return tsplus_module_11.uninterruptible(tsplus_module_10.scoped((middleware ? middleware(responded) : responded), fileName_1 + \":54:60\"), fileName_1 + \":54:67\");\n };\n}\n/**\n * @tsplus static fncts.http.HttpAppOps currentPreResponseHandlers\n */\nconst currentPreResponseHandlers_1 = globalValue(Symbol.for(\"fncts.http.HttpApp.currentPreResponseHandlers\"), () => tsplus_module_2.unsafeMake(tsplus_module_12.nothing(fileName_1 + \":67:57\")));\nexport const currentPreResponseHandlers = currentPreResponseHandlers_1;\n/**\n * @tsplus static fncts.http.HttpAppOps appendPreResponseHandler\n */\nexport function appendPreResponseHandler(handler) {\n return tsplus_module_13.update((handlers) => tsplus_module_5.match(() => tsplus_module_12.just(handler, fileName_1 + \":76:17\"), (prev) => tsplus_module_12.just((request, response) => tsplus_module_4.flatMap((response) => handler(request, response), fileName_1 + \":77:76\")(prev(request, response)), fileName_1 + \":77:21\"))(handlers), fileName_1 + \":74:51\")(currentPreResponseHandlers_1);\n}\n/**\n * @tsplus pipeable fncts.http.HttpApp withPreResponseHandler\n */\nexport function withPreResponseHandler(handler) {\n return (self) => tsplus_module_13.locallyWith(currentPreResponseHandlers_1, (handlers) => tsplus_module_5.match(() => tsplus_module_12.just(handler, fileName_1 + \":89:19\"), (prev) => tsplus_module_12.just((request, response) => tsplus_module_4.flatMap((response) => handler(request, response), fileName_1 + \":91:70\")(prev(request, response)), fileName_1 + \":91:15\"))(handlers), fileName_1 + \":87:51\")(self);\n}\nexport function toWebHandlerRuntime(runtime) {\n const run = runtime.unsafeRunFiber;\n const resolveSymbol = Symbol();\n const rejectSymbol = Symbol();\n return (self) => {\n const handled = toHandled_1((request, exit) => {\n const webRequest = request.source;\n if (tsplus_module_6.isSuccess(exit)) {\n request[resolveSymbol](tsplus_module_14.toWeb(request.method === \"HEAD\")(exit.value));\n }\n else if (tsplus_module_7.isInterruptedOnly(exit.cause)) {\n request[resolveSymbol](new Response(null, { status: webRequest.signal.aborted ? 499 : 503 }));\n }\n else {\n request[rejectSymbol](tsplus_module_15.prettyPrint(exit.cause));\n }\n return tsplus_module_4.unit;\n })(self);\n return (request) => new Promise((resolve, reject) => {\n const req = tsplus_module_16.fromWeb(request);\n req[resolveSymbol] = resolve;\n req[rejectSymbol] = reject;\n const fiber = run(tsplus_module_10.scoped(tsplus_module_4.map((res) => tsplus_module_14.toWeb(req.method === \"HEAD\")(res), fileName_1 + \":118:65\")(tsplus_module_17.provideSomeService(req, tsplus_module_1.ServerRequestTag, fileName_1 + \":118:37\")(handled)), fileName_1 + \":118:108\"), fileName_1 + \":117:42\");\n request.signal.addEventListener(\"abort\", () => {\n fiber.interruptAsFork(clientAbortFiberId, fileName_1 + \":123:34\");\n }, { once: true });\n });\n };\n}\nexport function toWebHandler(self) {\n return toWebHandlerRuntime(defaultRuntime)(self);\n}\n//# sourceMappingURL=HttpApp.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,aAAa;AAkBnB,MAAa,YAAY;AAKzB,MAAa,UAAU,EAAE;;;;AAIzB,SAAS,YAAY,gBAAgB,YAAY;AAC7C,SAAQ,SAAS;EACb,MAAM,YAAY,gBAAgB,kBAAkB,UAAU;GAC1D,MAAM,UAAU,gBAAgB,UAAU,gBAAgB,iBAAiB,CAAC,MAAM,YAAY,gBAAgB,mBAAmB,CAAC;GAClI,MAAM,UAAU,MAAM,YAAY,6BAA6B;GAC/D,MAAM,aAAa,gBAAgB,YAAY,OAAO,YAAY,gBAAgB,SAAS,aAAa,QAAQ,SAAS,SAAS,EAAE,aAAa,SAAS,CAAC,KAAK,CAAC,CAAC,QAAQ;AAC1K,UAAO,gBAAgB,SAAS,SAAS;AACrC,QAAI,gBAAgB,UAAU,KAAK,EAAE;KACjC,MAAM,YAAY,gBAAgB,UAAU,KAAK,MAAM;AACvD,SAAI,gBAAgB,OAAO,UAAU,IAAI,iBAAiB,UAAU,MAAM,CACtE,QAAO,gBAAgB,QAAQ,UAAU,OAAO,aAAa,SAAS;;AAG9E,WAAO,gBAAgB,SAAS,MAAM,aAAa,SAAS,CAAC,eAAe,SAAS,KAAK,CAAC;MAC5F,aAAa,SAAS,CAAC,gBAAgB,OAAO,YAAY,aAAa,SAAS,CAAC;KACrF,aAAa,SAAS;AACzB,SAAO,iBAAiB,gBAAgB,iBAAiB,OAAQ,aAAa,WAAW,UAAU,GAAG,WAAY,aAAa,SAAS,EAAE,aAAa,SAAS;;;;;;AAMxK,MAAM,+BAA+B,YAAY,OAAO,IAAI,gDAAgD,QAAQ,gBAAgB,WAAW,iBAAiB,QAAQ,aAAa,SAAS,CAAC,CAAC;AAChM,MAAa,6BAA6B;;;;AAI1C,SAAgB,yBAAyB,SAAS;AAC9C,QAAO,iBAAiB,QAAQ,aAAa,gBAAgB,YAAY,iBAAiB,KAAK,SAAS,aAAa,SAAS,GAAG,SAAS,iBAAiB,MAAM,SAAS,aAAa,gBAAgB,SAAS,aAAa,QAAQ,SAAS,SAAS,EAAE,aAAa,SAAS,CAAC,KAAK,SAAS,SAAS,CAAC,EAAE,aAAa,SAAS,CAAC,CAAC,SAAS,EAAE,aAAa,SAAS,CAAC,6BAA6B;;;;;AAKrY,SAAgB,uBAAuB,SAAS;AAC5C,SAAQ,SAAS,iBAAiB,YAAY,+BAA+B,aAAa,gBAAgB,YAAY,iBAAiB,KAAK,SAAS,aAAa,SAAS,GAAG,SAAS,iBAAiB,MAAM,SAAS,aAAa,gBAAgB,SAAS,aAAa,QAAQ,SAAS,SAAS,EAAE,aAAa,SAAS,CAAC,KAAK,SAAS,SAAS,CAAC,EAAE,aAAa,SAAS,CAAC,CAAC,SAAS,EAAE,aAAa,SAAS,CAAC,KAAK;;AAE1Z,SAAgB,oBAAoB,SAAS;CACzC,MAAM,MAAM,QAAQ;CACpB,MAAM,gBAAgB,QAAQ;CAC9B,MAAM,eAAe,QAAQ;AAC7B,SAAQ,SAAS;EACb,MAAM,UAAU,aAAa,SAAS,SAAS;GAC3C,MAAM,aAAa,QAAQ;AAC3B,OAAI,gBAAgB,UAAU,KAAK,CAC/B,SAAQ,eAAe,iBAAiB,MAAM,QAAQ,WAAW,OAAO,CAAC,KAAK,MAAM,CAAC;YAEhF,gBAAgB,kBAAkB,KAAK,MAAM,CAClD,SAAQ,eAAe,IAAI,SAAS,MAAM,EAAE,QAAQ,WAAW,OAAO,UAAU,MAAM,KAAK,CAAC,CAAC;OAG7F,SAAQ,cAAc,iBAAiB,YAAY,KAAK,MAAM,CAAC;AAEnE,UAAO,gBAAgB;IACzB,CAAC,KAAK;AACR,UAAQ,YAAY,IAAI,SAAS,SAAS,WAAW;GACjD,MAAM,MAAM,iBAAiB,QAAQ,QAAQ;AAC7C,OAAI,iBAAiB;AACrB,OAAI,gBAAgB;GACpB,MAAM,QAAQ,IAAI,iBAAiB,OAAO,gBAAgB,KAAK,QAAQ,iBAAiB,MAAM,IAAI,WAAW,OAAO,CAAC,IAAI,EAAE,aAAa,UAAU,CAAC,iBAAiB,mBAAmB,KAAK,gBAAgB,kBAAkB,aAAa,UAAU,CAAC,QAAQ,CAAC,EAAE,aAAa,WAAW,EAAE,aAAa,UAAU;AAClT,WAAQ,OAAO,iBAAiB,eAAe;AAC3C,UAAM,gBAAgB,oBAAoB,aAAa,UAAU;MAClE,EAAE,MAAM,MAAM,CAAC;IACpB;;;AAGV,SAAgB,aAAa,MAAM;AAC/B,QAAO,oBAAoB,eAAe,CAAC,KAAK"}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
const fileName_1 = "(@fncts/http) src/IncomingMessage/api.ts";
|
|
2
|
-
import * as tsplus_module_1 from "@fncts/schema/Parser/api";
|
|
3
1
|
import * as tsplus_module_2 from "@fncts/io/IO/api";
|
|
2
|
+
import * as tsplus_module_1 from "@fncts/schema/Parser/api";
|
|
3
|
+
//#region build/esm/IncomingMessage/api.js
|
|
4
|
+
const fileName_1 = "(@fncts/http) src/IncomingMessage/api.ts";
|
|
4
5
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
* @tsplus pipeable fncts.http.IncomingMessage schemaBodyJson
|
|
7
|
+
*/
|
|
8
|
+
function schemaBodyJson(schema) {
|
|
9
|
+
const decode = tsplus_module_1.decode(schema);
|
|
10
|
+
return (self) => tsplus_module_2.flatMap(decode, fileName_1 + ":8:90")(self.json);
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
* @tsplus pipeable fncts.http.IncomingMessage schemaBodyUrlParams
|
|
14
|
+
*/
|
|
15
|
+
function schemaBodyUrlParams(schema) {
|
|
16
|
+
const decode = tsplus_module_1.decode(schema);
|
|
17
|
+
return (self) => tsplus_module_2.flatMap(decode, fileName_1 + ":16:99")(self.urlParamsBody);
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
* @tsplus pipeable fncts.http.IncomingMessage schemaHeaders
|
|
21
|
+
*/
|
|
22
|
+
function schemaHeaders(schema) {
|
|
23
|
+
const decode = tsplus_module_1.decode(schema);
|
|
24
|
+
return (self) => decode(self.headers);
|
|
24
25
|
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { schemaBodyJson, schemaBodyUrlParams, schemaHeaders };
|
|
28
|
+
|
|
25
29
|
//# sourceMappingURL=api.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.mjs","names":["
|
|
1
|
+
{"version":3,"file":"api.mjs","names":[],"sources":["../../esm/IncomingMessage/api.js"],"sourcesContent":["const fileName_1 = \"(@fncts/http) src/IncomingMessage/api.ts\";\nimport * as tsplus_module_1 from \"@fncts/schema/Parser/api\";\nimport * as tsplus_module_2 from \"@fncts/io/IO/api\";\n/**\n * @tsplus pipeable fncts.http.IncomingMessage schemaBodyJson\n */\nexport function schemaBodyJson(schema) {\n const decode = tsplus_module_1.decode(schema);\n return (self) => tsplus_module_2.flatMap(decode, fileName_1 + \":8:90\")(self.json);\n}\n/**\n * @tsplus pipeable fncts.http.IncomingMessage schemaBodyUrlParams\n */\nexport function schemaBodyUrlParams(schema) {\n const decode = tsplus_module_1.decode(schema);\n return (self) => tsplus_module_2.flatMap(decode, fileName_1 + \":16:99\")(self.urlParamsBody);\n}\n/**\n * @tsplus pipeable fncts.http.IncomingMessage schemaHeaders\n */\nexport function schemaHeaders(schema) {\n const decode = tsplus_module_1.decode(schema);\n return (self) => decode(self.headers);\n}\n//# sourceMappingURL=api.js.map"],"mappings":";;;AAAA,MAAM,aAAa;;;;AAMnB,SAAgB,eAAe,QAAQ;CACnC,MAAM,SAAS,gBAAgB,OAAO,OAAO;AAC7C,SAAQ,SAAS,gBAAgB,QAAQ,QAAQ,aAAa,QAAQ,CAAC,KAAK,KAAK;;;;;AAKrF,SAAgB,oBAAoB,QAAQ;CACxC,MAAM,SAAS,gBAAgB,OAAO,OAAO;AAC7C,SAAQ,SAAS,gBAAgB,QAAQ,QAAQ,aAAa,SAAS,CAAC,KAAK,cAAc;;;;;AAK/F,SAAgB,cAAc,QAAQ;CAClC,MAAM,SAAS,gBAAgB,OAAO,OAAO;AAC7C,SAAQ,SAAS,OAAO,KAAK,QAAQ"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
//#region build/esm/IncomingMessage/definition.js
|
|
2
|
+
const IncomingMessageTypeId = Symbol.for("fncts.http.IncomingMessage");
|
|
2
3
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
4
|
+
* @tsplus type fncts.http.IncomingMessage
|
|
5
|
+
* @tsplus companion fncts.http.IncomingMessageOps
|
|
6
|
+
*/
|
|
7
|
+
var IncomingMessage = class {
|
|
8
|
+
[IncomingMessageTypeId] = IncomingMessageTypeId;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { IncomingMessage, IncomingMessageTypeId };
|
|
12
|
+
|
|
9
13
|
//# sourceMappingURL=definition.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.mjs","names":[
|
|
1
|
+
{"version":3,"file":"definition.mjs","names":[],"sources":["../../esm/IncomingMessage/definition.js"],"sourcesContent":["export const IncomingMessageTypeId = Symbol.for(\"fncts.http.IncomingMessage\");\n/**\n * @tsplus type fncts.http.IncomingMessage\n * @tsplus companion fncts.http.IncomingMessageOps\n */\nexport class IncomingMessage {\n [IncomingMessageTypeId] = IncomingMessageTypeId;\n}\n//# sourceMappingURL=definition.js.map"],"mappings":";AAAA,MAAa,wBAAwB,OAAO,IAAI,6BAA6B;;;;;AAK7E,IAAa,kBAAb,MAA6B;CACzB,CAAC,yBAAyB"}
|
package/_mjs/IncomingMessage.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
//# sourceMappingURL=IncomingMessage.mjs.map
|
|
1
|
+
import { IncomingMessage, IncomingMessageTypeId } from "./IncomingMessage/definition.mjs";
|
|
2
|
+
import { schemaBodyJson, schemaBodyUrlParams, schemaHeaders } from "./IncomingMessage/api.mjs";
|
|
3
|
+
export { IncomingMessage, IncomingMessageTypeId, schemaBodyJson, schemaBodyUrlParams, schemaHeaders };
|
package/_mjs/Method.mjs
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region build/esm/Method.js
|
|
2
|
+
function hasBody(method) {
|
|
3
|
+
return method !== "GET" && method !== "HEAD";
|
|
3
4
|
}
|
|
5
|
+
//#endregion
|
|
6
|
+
export { hasBody };
|
|
7
|
+
|
|
4
8
|
//# sourceMappingURL=Method.mjs.map
|
package/_mjs/Method.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Method.mjs","names":[
|
|
1
|
+
{"version":3,"file":"Method.mjs","names":[],"sources":["../esm/Method.js"],"sourcesContent":["export function hasBody(method) {\n return method !== \"GET\" && method !== \"HEAD\";\n}\n//# sourceMappingURL=Method.js.map"],"mappings":";AAAA,SAAgB,QAAQ,QAAQ;AAC5B,QAAO,WAAW,SAAS,WAAW"}
|
package/_mjs/Middleware.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
//#region build/esm/Middleware.js
|
|
2
|
+
const Middleware = {};
|
|
2
3
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
* @tsplus static fncts.http.MiddlewareOps __call
|
|
5
|
+
* @tsplus static fncts.http.MiddlewareOps make
|
|
6
|
+
*/
|
|
7
|
+
function make(middleware) {
|
|
8
|
+
return middleware;
|
|
8
9
|
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Middleware, make };
|
|
12
|
+
|
|
9
13
|
//# sourceMappingURL=Middleware.mjs.map
|
package/_mjs/Middleware.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Middleware.mjs","names":[
|
|
1
|
+
{"version":3,"file":"Middleware.mjs","names":[],"sources":["../esm/Middleware.js"],"sourcesContent":["export const Middleware = {};\n/**\n * @tsplus static fncts.http.MiddlewareOps __call\n * @tsplus static fncts.http.MiddlewareOps make\n */\nexport function make(middleware) {\n return middleware;\n}\n//# sourceMappingURL=Middleware.js.map"],"mappings":";AAAA,MAAa,aAAa,EAAE;;;;;AAK5B,SAAgB,KAAK,YAAY;AAC7B,QAAO"}
|
package/_mjs/QueryParams.mjs
CHANGED
package/_mjs/RequestError.mjs
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
1
|
+
//#region build/esm/RequestError.js
|
|
2
|
+
const RequestErrorTypeId = Symbol.for("fncts.http.RequestError");
|
|
3
|
+
var RequestError = class {
|
|
4
|
+
request;
|
|
5
|
+
reason;
|
|
6
|
+
error;
|
|
7
|
+
[RequestErrorTypeId] = RequestErrorTypeId;
|
|
8
|
+
constructor(request, reason, error) {
|
|
9
|
+
this.request = request;
|
|
10
|
+
this.reason = reason;
|
|
11
|
+
this.error = error;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { RequestError, RequestErrorTypeId };
|
|
16
|
+
|
|
13
17
|
//# sourceMappingURL=RequestError.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestError.mjs","names":[
|
|
1
|
+
{"version":3,"file":"RequestError.mjs","names":[],"sources":["../esm/RequestError.js"],"sourcesContent":["export const RequestErrorTypeId = Symbol.for(\"fncts.http.RequestError\");\nexport class RequestError {\n request;\n reason;\n error;\n [RequestErrorTypeId] = RequestErrorTypeId;\n constructor(request, reason, error) {\n this.request = request;\n this.reason = reason;\n this.error = error;\n }\n}\n//# sourceMappingURL=RequestError.js.map"],"mappings":";AAAA,MAAa,qBAAqB,OAAO,IAAI,0BAA0B;AACvE,IAAa,eAAb,MAA0B;CACtB;CACA;CACA;CACA,CAAC,sBAAsB;CACvB,YAAY,SAAS,QAAQ,OAAO;AAChC,OAAK,UAAU;AACf,OAAK,SAAS;AACd,OAAK,QAAQ"}
|