@effect/platform 0.11.5 → 0.12.0
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/FileSystem.d.ts +16 -9
- package/FileSystem.d.ts.map +1 -1
- package/FileSystem.js.map +1 -1
- package/Http/App.d.ts +18 -0
- package/Http/App.d.ts.map +1 -0
- package/Http/App.js +6 -0
- package/Http/App.js.map +1 -0
- package/Http/Body.d.ts +37 -14
- package/Http/Body.d.ts.map +1 -1
- package/Http/Body.js +17 -5
- package/Http/Body.js.map +1 -1
- package/Http/Client.d.ts +2 -2
- package/Http/Client.d.ts.map +1 -1
- package/Http/Client.js +3 -3
- package/Http/Client.js.map +1 -1
- package/Http/ClientRequest.d.ts +44 -1
- package/Http/ClientRequest.d.ts.map +1 -1
- package/Http/ClientRequest.js +21 -3
- package/Http/ClientRequest.js.map +1 -1
- package/Http/ClientResponse.d.ts +13 -1
- package/Http/ClientResponse.d.ts.map +1 -1
- package/Http/ClientResponse.js +14 -2
- package/Http/ClientResponse.js.map +1 -1
- package/Http/FormData.d.ts +97 -4
- package/Http/FormData.d.ts.map +1 -1
- package/Http/FormData.js +77 -2
- package/Http/FormData.js.map +1 -1
- package/Http/Headers.d.ts +29 -3
- package/Http/Headers.d.ts.map +1 -1
- package/Http/Headers.js +13 -1
- package/Http/Headers.js.map +1 -1
- package/Http/IncomingMessage.d.ts +26 -5
- package/Http/IncomingMessage.d.ts.map +1 -1
- package/Http/IncomingMessage.js +38 -3
- package/Http/IncomingMessage.js.map +1 -1
- package/Http/Middleware.d.ts +56 -0
- package/Http/Middleware.d.ts.map +1 -0
- package/Http/Middleware.js +46 -0
- package/Http/Middleware.js.map +1 -0
- package/Http/Router.d.ts +221 -0
- package/Http/Router.d.ts.map +1 -0
- package/Http/Router.js +148 -0
- package/Http/Router.js.map +1 -0
- package/Http/Server.d.ts +85 -0
- package/Http/Server.d.ts.map +1 -0
- package/Http/Server.js +34 -0
- package/Http/Server.js.map +1 -0
- package/Http/ServerError.d.ts +96 -0
- package/Http/ServerError.d.ts.map +1 -0
- package/Http/ServerError.js +40 -0
- package/Http/ServerError.js.map +1 -0
- package/Http/ServerRequest.d.ts +82 -0
- package/Http/ServerRequest.d.ts.map +1 -0
- package/Http/ServerRequest.js +66 -0
- package/Http/ServerRequest.js.map +1 -0
- package/Http/ServerResponse.d.ts +168 -0
- package/Http/ServerResponse.d.ts.map +1 -0
- package/Http/ServerResponse.js +116 -0
- package/Http/ServerResponse.js.map +1 -0
- package/Http/UrlParams.d.ts +20 -5
- package/Http/UrlParams.d.ts.map +1 -1
- package/Http/UrlParams.js.map +1 -1
- package/HttpServer.d.ts +44 -0
- package/HttpServer.d.ts.map +1 -0
- package/HttpServer.js +29 -0
- package/HttpServer.js.map +1 -0
- package/internal/fileSystem.js +15 -11
- package/internal/fileSystem.js.map +1 -1
- package/internal/http/body.js +28 -28
- package/internal/http/body.js.map +1 -1
- package/internal/http/client.d.ts.map +1 -1
- package/internal/http/client.js +32 -26
- package/internal/http/client.js.map +1 -1
- package/internal/http/clientRequest.js +22 -6
- package/internal/http/clientRequest.js.map +1 -1
- package/internal/http/clientResponse.js +15 -12
- package/internal/http/clientResponse.js.map +1 -1
- package/internal/http/formData.d.ts +8 -0
- package/internal/http/formData.d.ts.map +1 -0
- package/internal/http/formData.js +88 -0
- package/internal/http/formData.js.map +1 -0
- package/internal/http/middleware.d.ts +2 -0
- package/internal/http/middleware.d.ts.map +1 -0
- package/internal/http/middleware.js +43 -0
- package/internal/http/middleware.js.map +1 -0
- package/internal/http/router.d.ts +2 -0
- package/internal/http/router.d.ts.map +1 -0
- package/internal/http/router.js +187 -0
- package/internal/http/router.js.map +1 -0
- package/internal/http/server.d.ts +2 -0
- package/internal/http/server.d.ts.map +1 -0
- package/internal/http/server.js +30 -0
- package/internal/http/server.js.map +1 -0
- package/internal/http/serverError.d.ts +2 -0
- package/internal/http/serverError.d.ts.map +1 -0
- package/internal/http/serverError.js +30 -0
- package/internal/http/serverError.js.map +1 -0
- package/internal/http/serverRequest.d.ts +2 -0
- package/internal/http/serverRequest.d.ts.map +1 -0
- package/internal/http/serverRequest.js +57 -0
- package/internal/http/serverRequest.js.map +1 -0
- package/internal/http/serverResponse.d.ts +2 -0
- package/internal/http/serverResponse.d.ts.map +1 -0
- package/internal/http/serverResponse.js +109 -0
- package/internal/http/serverResponse.js.map +1 -0
- package/mjs/FileSystem.mjs.map +1 -1
- package/mjs/Http/App.mjs +2 -0
- package/mjs/Http/App.mjs.map +1 -0
- package/mjs/Http/Body.mjs +12 -2
- package/mjs/Http/Body.mjs.map +1 -1
- package/mjs/Http/Client.mjs +1 -1
- package/mjs/Http/Client.mjs.map +1 -1
- package/mjs/Http/ClientRequest.mjs +16 -1
- package/mjs/Http/ClientRequest.mjs.map +1 -1
- package/mjs/Http/ClientResponse.mjs +11 -1
- package/mjs/Http/ClientResponse.mjs.map +1 -1
- package/mjs/Http/FormData.mjs +62 -1
- package/mjs/Http/FormData.mjs.map +1 -1
- package/mjs/Http/Headers.mjs +10 -0
- package/mjs/Http/Headers.mjs.map +1 -1
- package/mjs/Http/IncomingMessage.mjs +32 -1
- package/mjs/Http/IncomingMessage.mjs.map +1 -1
- package/mjs/Http/Middleware.mjs +32 -0
- package/mjs/Http/Middleware.mjs.map +1 -0
- package/mjs/Http/Router.mjs +117 -0
- package/mjs/Http/Router.mjs.map +1 -0
- package/mjs/Http/Server.mjs +22 -0
- package/mjs/Http/Server.mjs.map +1 -0
- package/mjs/Http/ServerError.mjs +27 -0
- package/mjs/Http/ServerError.mjs.map +1 -0
- package/mjs/Http/ServerRequest.mjs +48 -0
- package/mjs/Http/ServerRequest.mjs.map +1 -0
- package/mjs/Http/ServerResponse.mjs +90 -0
- package/mjs/Http/ServerResponse.mjs.map +1 -0
- package/mjs/Http/UrlParams.mjs.map +1 -1
- package/mjs/HttpServer.mjs +24 -0
- package/mjs/HttpServer.mjs.map +1 -0
- package/mjs/internal/fileSystem.mjs +15 -11
- package/mjs/internal/fileSystem.mjs.map +1 -1
- package/mjs/internal/http/body.mjs +23 -25
- package/mjs/internal/http/body.mjs.map +1 -1
- package/mjs/internal/http/client.mjs +30 -24
- package/mjs/internal/http/client.mjs.map +1 -1
- package/mjs/internal/http/clientRequest.mjs +16 -4
- package/mjs/internal/http/clientRequest.mjs.map +1 -1
- package/mjs/internal/http/clientResponse.mjs +15 -12
- package/mjs/internal/http/clientResponse.mjs.map +1 -1
- package/mjs/internal/http/formData.mjs +67 -0
- package/mjs/internal/http/formData.mjs.map +1 -0
- package/mjs/internal/http/middleware.mjs +29 -0
- package/mjs/internal/http/middleware.mjs.map +1 -0
- package/mjs/internal/http/router.mjs +155 -0
- package/mjs/internal/http/router.mjs.map +1 -0
- package/mjs/internal/http/server.mjs +17 -0
- package/mjs/internal/http/server.mjs.map +1 -0
- package/mjs/internal/http/serverError.mjs +17 -0
- package/mjs/internal/http/serverError.mjs.map +1 -0
- package/mjs/internal/http/serverRequest.mjs +41 -0
- package/mjs/internal/http/serverRequest.mjs.map +1 -0
- package/mjs/internal/http/serverResponse.mjs +82 -0
- package/mjs/internal/http/serverResponse.mjs.map +1 -0
- package/package.json +2 -1
- package/src/FileSystem.ts +20 -25
- package/src/Http/App.ts +19 -0
- package/src/Http/Body.ts +41 -14
- package/src/Http/Client.ts +6 -3
- package/src/Http/ClientRequest.ts +52 -2
- package/src/Http/ClientResponse.ts +13 -1
- package/src/Http/FormData.ts +121 -5
- package/src/Http/Headers.ts +37 -3
- package/src/Http/IncomingMessage.ts +46 -3
- package/src/Http/Middleware.ts +69 -0
- package/src/Http/Router.ts +342 -0
- package/src/Http/Server.ts +134 -0
- package/src/Http/ServerError.ts +111 -0
- package/src/Http/ServerRequest.ts +120 -0
- package/src/Http/ServerResponse.ts +202 -0
- package/src/Http/UrlParams.ts +20 -5
- package/src/HttpServer.ts +44 -0
- package/src/internal/fileSystem.ts +10 -7
- package/src/internal/http/body.ts +65 -39
- package/src/internal/http/client.ts +45 -36
- package/src/internal/http/clientRequest.ts +64 -4
- package/src/internal/http/clientResponse.ts +21 -13
- package/src/internal/http/formData.ts +140 -0
- package/src/internal/http/middleware.ts +72 -0
- package/src/internal/http/router.ts +298 -0
- package/src/internal/http/server.ts +80 -0
- package/src/internal/http/serverError.ts +26 -0
- package/src/internal/http/serverRequest.ts +71 -0
- package/src/internal/http/serverResponse.ts +255 -0
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
+
import { dual } from "@effect/data/Function";
|
|
5
|
+
import * as Global from "@effect/data/Global";
|
|
6
|
+
import * as Option from "@effect/data/Option";
|
|
4
7
|
import * as Effect from "@effect/io/Effect";
|
|
8
|
+
import * as FiberRef from "@effect/io/FiberRef";
|
|
9
|
+
import * as FileSystem from "@effect/platform/FileSystem";
|
|
5
10
|
import * as Schema from "@effect/schema/Schema";
|
|
6
11
|
/**
|
|
7
12
|
* @since 1.0.0
|
|
@@ -12,8 +17,34 @@ export const TypeId = /*#__PURE__*/Symbol.for("@effect/platform/Http/IncomingMes
|
|
|
12
17
|
* @since 1.0.0
|
|
13
18
|
* @category schema
|
|
14
19
|
*/
|
|
15
|
-
export const
|
|
20
|
+
export const schemaBodyJson = schema => {
|
|
16
21
|
const parse = Schema.parse(schema);
|
|
17
22
|
return self => Effect.flatMap(self.json, parse);
|
|
18
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* @since 1.0.0
|
|
26
|
+
* @category schema
|
|
27
|
+
*/
|
|
28
|
+
export const schemaBodyUrlParams = schema => {
|
|
29
|
+
const parse = Schema.parse(schema);
|
|
30
|
+
return self => Effect.flatMap(self.urlParams, _ => parse(Object.fromEntries(_)));
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @category schema
|
|
35
|
+
*/
|
|
36
|
+
export const schemaHeaders = schema => {
|
|
37
|
+
const parse = Schema.parse(schema);
|
|
38
|
+
return self => parse(Object.fromEntries(self.headers));
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
* @category fiber refs
|
|
43
|
+
*/
|
|
44
|
+
export const maxBodySize = /*#__PURE__*/Global.globalValue("@effect/platform/Http/ImcomingMessage/maxBodySize", () => FiberRef.unsafeMake(Option.none()));
|
|
45
|
+
/**
|
|
46
|
+
* @since 1.0.0
|
|
47
|
+
* @category fiber refs
|
|
48
|
+
*/
|
|
49
|
+
export const withMaxBodySize = /*#__PURE__*/dual(2, (effect, size) => Effect.locally(effect, maxBodySize, Option.map(size, FileSystem.Size)));
|
|
19
50
|
//# sourceMappingURL=IncomingMessage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncomingMessage.mjs","names":["Effect","Schema","TypeId","Symbol","for","
|
|
1
|
+
{"version":3,"file":"IncomingMessage.mjs","names":["dual","Global","Option","Effect","FiberRef","FileSystem","Schema","TypeId","Symbol","for","schemaBodyJson","schema","parse","self","flatMap","json","schemaBodyUrlParams","urlParams","_","Object","fromEntries","schemaHeaders","headers","maxBodySize","globalValue","unsafeMake","none","withMaxBodySize","effect","size","locally","map","Size"],"sources":["../../src/Http/IncomingMessage.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,SAASA,IAAI,QAAQ,uBAAuB;AAC5C,OAAO,KAAKC,MAAM,MAAM,qBAAqB;AAC7C,OAAO,KAAKC,MAAM,MAAM,qBAAqB;AAC7C,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAC3C,OAAO,KAAKC,QAAQ,MAAM,qBAAqB;AAC/C,OAAO,KAAKC,UAAU,MAAM,6BAA6B;AAIzD,OAAO,KAAKC,MAAM,MAAM,uBAAuB;AAG/C;;;;AAIA,OAAO,MAAMC,MAAM,gBAAGC,MAAM,CAACC,GAAG,CAAC,uCAAuC,CAAC;AAsBzE;;;;AAIA,OAAO,MAAMC,cAAc,GAAUC,MAA2B,IAAI;EAClE,MAAMC,KAAK,GAAGN,MAAM,CAACM,KAAK,CAACD,MAAM,CAAC;EAClC,OAAWE,IAAwB,IACjCV,MAAM,CAACW,OAAO,CAACD,IAAI,CAACE,IAAI,EAAEH,KAAK,CAAC;AACpC,CAAC;AAED;;;;AAIA,OAAO,MAAMI,mBAAmB,GAAmDL,MAA2B,IAAI;EAChH,MAAMC,KAAK,GAAGN,MAAM,CAACM,KAAK,CAACD,MAAM,CAAC;EAClC,OAAWE,IAAwB,IACjCV,MAAM,CAACW,OAAO,CAACD,IAAI,CAACI,SAAS,EAAGC,CAAC,IAAKN,KAAK,CAACO,MAAM,CAACC,WAAW,CAACF,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AAED;;;;AAIA,OAAO,MAAMG,aAAa,GAAmDV,MAA2B,IAAI;EAC1G,MAAMC,KAAK,GAAGN,MAAM,CAACM,KAAK,CAACD,MAAM,CAAC;EAClC,OAAWE,IAAwB,IACjCD,KAAK,CAACO,MAAM,CAACC,WAAW,CAACP,IAAI,CAACS,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED;;;;AAIA,OAAO,MAAMC,WAAW,gBAAsDtB,MAAM,CAACuB,WAAW,CAC9F,mDAAmD,EACnD,MAAMpB,QAAQ,CAACqB,UAAU,CAACvB,MAAM,CAACwB,IAAI,EAAmB,CAAC,CAC1D;AAED;;;;AAIA,OAAO,MAAMC,eAAe,gBAAG3B,IAAI,CAGjC,CAAC,EAAE,CAAC4B,MAAM,EAAEC,IAAI,KAAK1B,MAAM,CAAC2B,OAAO,CAACF,MAAM,EAAEL,WAAW,EAAErB,MAAM,CAAC6B,GAAG,CAACF,IAAI,EAAExB,UAAU,CAAC2B,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as internal from "@effect/platform/internal/http/middleware";
|
|
2
|
+
/**
|
|
3
|
+
* @since 1.0.0
|
|
4
|
+
* @category constructors
|
|
5
|
+
*/
|
|
6
|
+
export const make = internal.make;
|
|
7
|
+
/**
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category combinators
|
|
10
|
+
*/
|
|
11
|
+
export const compose = internal.compose;
|
|
12
|
+
/**
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
* @category constructors
|
|
15
|
+
*/
|
|
16
|
+
export const logger = internal.logger;
|
|
17
|
+
/**
|
|
18
|
+
* @since 1.0.0
|
|
19
|
+
* @category constructors
|
|
20
|
+
*/
|
|
21
|
+
export const tracer = internal.tracer;
|
|
22
|
+
/**
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
* @category constructors
|
|
25
|
+
*/
|
|
26
|
+
export const loggerTracer = internal.loggerTracer;
|
|
27
|
+
/**
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
* @category constructors
|
|
30
|
+
*/
|
|
31
|
+
export const xForwardedHeaders = internal.xForwardedHeaders;
|
|
32
|
+
//# sourceMappingURL=Middleware.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Middleware.mjs","names":["internal","make","compose","logger","tracer","loggerTracer","xForwardedHeaders"],"sources":["../../src/Http/Middleware.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,QAAQ,MAAM,2CAA2C;AAsBrE;;;;AAIA,OAAO,MAAMC,IAAI,GAA+CD,QAAQ,CAACC,IAAI;AAE7E;;;;AAIA,OAAO,MAAMC,OAAO,GAQhBF,QAAQ,CAACE,OAAO;AAEpB;;;;AAIA,OAAO,MAAMC,MAAM,GAA4DH,QAAQ,CAACG,MAAM;AAE9F;;;;AAIA,OAAO,MAAMC,MAAM,GAA4DJ,QAAQ,CAACI,MAAM;AAE9F;;;;AAIA,OAAO,MAAMC,YAAY,GAA4DL,QAAQ,CAACK,YAAY;AAE1G;;;;AAIA,OAAO,MAAMC,iBAAiB,GAA4DN,QAAQ,CAACM,iBAAiB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as internal from "@effect/platform/internal/http/router";
|
|
2
|
+
/**
|
|
3
|
+
* @since 1.0.0
|
|
4
|
+
* @category type ids
|
|
5
|
+
*/
|
|
6
|
+
export const TypeId = internal.TypeId;
|
|
7
|
+
/**
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category type ids
|
|
10
|
+
*/
|
|
11
|
+
export const RouteTypeId = internal.RouteTypeId;
|
|
12
|
+
/**
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
* @category type ids
|
|
15
|
+
*/
|
|
16
|
+
export const RouteContextTypeId = internal.RouteContextTypeId;
|
|
17
|
+
/**
|
|
18
|
+
* @since 1.0.0
|
|
19
|
+
* @category route context
|
|
20
|
+
*/
|
|
21
|
+
export const RouteContext = internal.RouteContext;
|
|
22
|
+
/**
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
* @category route context
|
|
25
|
+
*/
|
|
26
|
+
export const params = internal.params;
|
|
27
|
+
/**
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
* @category route context
|
|
30
|
+
*/
|
|
31
|
+
export const searchParams = internal.searchParams;
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @category route context
|
|
35
|
+
*/
|
|
36
|
+
export const schemaParams = internal.schemaParams;
|
|
37
|
+
/**
|
|
38
|
+
* @since 1.0.0
|
|
39
|
+
* @category constructors
|
|
40
|
+
*/
|
|
41
|
+
export const empty = internal.empty;
|
|
42
|
+
/**
|
|
43
|
+
* @since 1.0.0
|
|
44
|
+
* @category constructors
|
|
45
|
+
*/
|
|
46
|
+
export const fromIterable = internal.fromIterable;
|
|
47
|
+
/**
|
|
48
|
+
* @since 1.0.0
|
|
49
|
+
* @category constructors
|
|
50
|
+
*/
|
|
51
|
+
export const makeRoute = internal.makeRoute;
|
|
52
|
+
/**
|
|
53
|
+
* @since 1.0.0
|
|
54
|
+
* @category combinators
|
|
55
|
+
*/
|
|
56
|
+
export const prefixAll = internal.prefixAll;
|
|
57
|
+
/**
|
|
58
|
+
* @since 1.0.0
|
|
59
|
+
* @category combinators
|
|
60
|
+
*/
|
|
61
|
+
export const concat = internal.concat;
|
|
62
|
+
/**
|
|
63
|
+
* @since 1.0.0
|
|
64
|
+
* @category routing
|
|
65
|
+
*/
|
|
66
|
+
export const mount = internal.mount;
|
|
67
|
+
/**
|
|
68
|
+
* @since 1.0.0
|
|
69
|
+
* @category routing
|
|
70
|
+
*/
|
|
71
|
+
export const mountApp = internal.mountApp;
|
|
72
|
+
/**
|
|
73
|
+
* @since 1.0.0
|
|
74
|
+
* @category routing
|
|
75
|
+
*/
|
|
76
|
+
export const route = internal.route;
|
|
77
|
+
/**
|
|
78
|
+
* @since 1.0.0
|
|
79
|
+
* @category routing
|
|
80
|
+
*/
|
|
81
|
+
export const all = internal.all;
|
|
82
|
+
/**
|
|
83
|
+
* @since 1.0.0
|
|
84
|
+
* @category routing
|
|
85
|
+
*/
|
|
86
|
+
export const get = internal.get;
|
|
87
|
+
/**
|
|
88
|
+
* @since 1.0.0
|
|
89
|
+
* @category routing
|
|
90
|
+
*/
|
|
91
|
+
export const post = internal.post;
|
|
92
|
+
/**
|
|
93
|
+
* @since 1.0.0
|
|
94
|
+
* @category routing
|
|
95
|
+
*/
|
|
96
|
+
export const patch = internal.patch;
|
|
97
|
+
/**
|
|
98
|
+
* @since 1.0.0
|
|
99
|
+
* @category routing
|
|
100
|
+
*/
|
|
101
|
+
export const put = internal.put;
|
|
102
|
+
/**
|
|
103
|
+
* @since 1.0.0
|
|
104
|
+
* @category routing
|
|
105
|
+
*/
|
|
106
|
+
export const del = internal.del;
|
|
107
|
+
/**
|
|
108
|
+
* @since 1.0.0
|
|
109
|
+
* @category routing
|
|
110
|
+
*/
|
|
111
|
+
export const head = internal.head;
|
|
112
|
+
/**
|
|
113
|
+
* @since 1.0.0
|
|
114
|
+
* @category routing
|
|
115
|
+
*/
|
|
116
|
+
export const options = internal.options;
|
|
117
|
+
//# sourceMappingURL=Router.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Router.mjs","names":["internal","TypeId","RouteTypeId","RouteContextTypeId","RouteContext","params","searchParams","schemaParams","empty","fromIterable","makeRoute","prefixAll","concat","mount","mountApp","route","all","get","post","patch","put","del","head","options"],"sources":["../../src/Http/Router.ts"],"sourcesContent":[null],"mappings":"AAWA,OAAO,KAAKA,QAAQ,MAAM,uCAAuC;AAIjE;;;;AAIA,OAAO,MAAMC,MAAM,GAAkBD,QAAQ,CAACC,MAAM;AAkBpD;;;;AAIA,OAAO,MAAMC,WAAW,GAAkBF,QAAQ,CAACE,WAAW;AAkC9D;;;;AAIA,OAAO,MAAMC,kBAAkB,GAAkBH,QAAQ,CAACG,kBAAkB;AAkB5E;;;;AAIA,OAAO,MAAMC,YAAY,GAA4CJ,QAAQ,CAACI,YAAY;AAE1F;;;;AAIA,OAAO,MAAMC,MAAM,GAIfL,QAAQ,CAACK,MAAM;AAEnB;;;;AAIA,OAAO,MAAMC,YAAY,GAIrBN,QAAQ,CAACM,YAAY;AAEzB;;;;AAIA,OAAO,MAAMC,YAAY,GAEqCP,QAAQ,CAACO,YAAY;AAEnF;;;;AAIA,OAAO,MAAMC,KAAK,GAAyBR,QAAQ,CAACQ,KAAK;AAEzD;;;;AAIA,OAAO,MAAMC,YAAY,GAELT,QAAQ,CAACS,YAAY;AAEzC;;;;AAIA,OAAO,MAAMC,SAAS,GAIHV,QAAQ,CAACU,SAAS;AAErC;;;;AAIA,OAAO,MAAMC,SAAS,GAGlBX,QAAQ,CAACW,SAAS;AAEtB;;;;AAIA,OAAO,MAAMC,MAAM,GAQfZ,QAAQ,CAACY,MAAM;AAEnB;;;;AAIA,OAAO,MAAMC,KAAK,GASdb,QAAQ,CAACa,KAAK;AAElB;;;;AAIA,OAAO,MAAMC,QAAQ,GASjBd,QAAQ,CAACc,QAAQ;AAErB;;;;AAIA,OAAO,MAAMC,KAAK,GASdf,QAAQ,CAACe,KAAK;AAElB;;;;AAIA,OAAO,MAAMC,GAAG,GASZhB,QAAQ,CAACgB,GAAG;AAEhB;;;;AAIA,OAAO,MAAMC,GAAG,GASZjB,QAAQ,CAACiB,GAAG;AAEhB;;;;AAIA,OAAO,MAAMC,IAAI,GASblB,QAAQ,CAACkB,IAAI;AAEjB;;;;AAIA,OAAO,MAAMC,KAAK,GASdnB,QAAQ,CAACmB,KAAK;AAElB;;;;AAIA,OAAO,MAAMC,GAAG,GASZpB,QAAQ,CAACoB,GAAG;AAEhB;;;;AAIA,OAAO,MAAMC,GAAG,GASZrB,QAAQ,CAACqB,GAAG;AAEhB;;;;AAIA,OAAO,MAAMC,IAAI,GASbtB,QAAQ,CAACsB,IAAI;AAEjB;;;;AAIA,OAAO,MAAMC,OAAO,GAShBvB,QAAQ,CAACuB,OAAO"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as internal from "@effect/platform/internal/http/server";
|
|
2
|
+
/**
|
|
3
|
+
* @since 1.0.0
|
|
4
|
+
* @category type ids
|
|
5
|
+
*/
|
|
6
|
+
export const TypeId = internal.TypeId;
|
|
7
|
+
/**
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category constructors
|
|
10
|
+
*/
|
|
11
|
+
export const Server = internal.serverTag;
|
|
12
|
+
/**
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
* @category constructors
|
|
15
|
+
*/
|
|
16
|
+
export const make = internal.make;
|
|
17
|
+
/**
|
|
18
|
+
* @since 1.0.0
|
|
19
|
+
* @category accessors
|
|
20
|
+
*/
|
|
21
|
+
export const serve = internal.serve;
|
|
22
|
+
//# sourceMappingURL=Server.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Server.mjs","names":["internal","TypeId","Server","serverTag","make","serve"],"sources":["../../src/Http/Server.ts"],"sourcesContent":[null],"mappings":"AAUA,OAAO,KAAKA,QAAQ,MAAM,uCAAuC;AAEjE;;;;AAIA,OAAO,MAAMC,MAAM,GAAkBD,QAAQ,CAACC,MAAM;AAiEpD;;;;AAIA,OAAO,MAAMC,MAAM,GAAgCF,QAAQ,CAACG,SAAS;AAErE;;;;AAIA,OAAO,MAAMC,IAAI,GAQHJ,QAAQ,CAACI,IAAI;AAE3B;;;;AAIA,OAAO,MAAMC,KAAK,GA4BdL,QAAQ,CAACK,KAAK"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as internal from "@effect/platform/internal/http/serverError";
|
|
2
|
+
/**
|
|
3
|
+
* @since 1.0.0
|
|
4
|
+
* @category type id
|
|
5
|
+
*/
|
|
6
|
+
export const TypeId = internal.TypeId;
|
|
7
|
+
/**
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category error
|
|
10
|
+
*/
|
|
11
|
+
export const RequestError = internal.requestError;
|
|
12
|
+
/**
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
* @category error
|
|
15
|
+
*/
|
|
16
|
+
export const RouteNotFound = internal.routeNotFound;
|
|
17
|
+
/**
|
|
18
|
+
* @since 1.0.0
|
|
19
|
+
* @category error
|
|
20
|
+
*/
|
|
21
|
+
export const ResponseError = internal.responseError;
|
|
22
|
+
/**
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
* @category error
|
|
25
|
+
*/
|
|
26
|
+
export const ServeError = internal.serveError;
|
|
27
|
+
//# sourceMappingURL=ServerError.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerError.mjs","names":["internal","TypeId","RequestError","requestError","RouteNotFound","routeNotFound","ResponseError","responseError","ServeError","serveError"],"sources":["../../src/Http/ServerError.ts"],"sourcesContent":[null],"mappings":"AAMA,OAAO,KAAKA,QAAQ,MAAM,4CAA4C;AAEtE;;;;AAIA,OAAO,MAAMC,MAAM,GAAkBD,QAAQ,CAACC,MAAM;AA4CpD;;;;AAIA,OAAO,MAAMC,YAAY,GAA0EF,QAAQ,CAACG,YAAY;AAWxH;;;;AAIA,OAAO,MAAMC,aAAa,GACxBJ,QAAQ,CAACK,aAAa;AAcxB;;;;AAIA,OAAO,MAAMC,aAAa,GACxBN,QAAQ,CAACO,aAAa;AAWxB;;;;AAIA,OAAO,MAAMC,UAAU,GAAsER,QAAQ,CAACS,UAAU"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as internal from "@effect/platform/internal/http/serverRequest";
|
|
2
|
+
export {
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
* @category fiber refs
|
|
6
|
+
*/
|
|
7
|
+
maxBodySize } from "@effect/platform/Http/IncomingMessage";
|
|
8
|
+
/**
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category type ids
|
|
11
|
+
*/
|
|
12
|
+
export const TypeId = internal.TypeId;
|
|
13
|
+
/**
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
* @category context
|
|
16
|
+
*/
|
|
17
|
+
export const ServerRequest = internal.serverRequestTag;
|
|
18
|
+
/**
|
|
19
|
+
* @since 1.0.0
|
|
20
|
+
* @category accessors
|
|
21
|
+
*/
|
|
22
|
+
export const formDataRecord = internal.formDataRecord;
|
|
23
|
+
/**
|
|
24
|
+
* @since 1.0.0
|
|
25
|
+
* @category schema
|
|
26
|
+
*/
|
|
27
|
+
export const schemaHeaders = internal.schemaHeaders;
|
|
28
|
+
/**
|
|
29
|
+
* @since 1.0.0
|
|
30
|
+
* @category schema
|
|
31
|
+
*/
|
|
32
|
+
export const schemaBodyJson = internal.schemaBodyJson;
|
|
33
|
+
/**
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
* @category schema
|
|
36
|
+
*/
|
|
37
|
+
export const schemaBodyUrlParams = internal.schemaBodyUrlParams;
|
|
38
|
+
/**
|
|
39
|
+
* @since 1.0.0
|
|
40
|
+
* @category schema
|
|
41
|
+
*/
|
|
42
|
+
export const schemaFormData = internal.schemaFormData;
|
|
43
|
+
/**
|
|
44
|
+
* @since 1.0.0
|
|
45
|
+
* @category schema
|
|
46
|
+
*/
|
|
47
|
+
export const schemaFormDataJson = internal.schemaFormDataJson;
|
|
48
|
+
//# sourceMappingURL=ServerRequest.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerRequest.mjs","names":["internal","maxBodySize","TypeId","ServerRequest","serverRequestTag","formDataRecord","schemaHeaders","schemaBodyJson","schemaBodyUrlParams","schemaFormData","schemaFormDataJson"],"sources":["../../src/Http/ServerRequest.ts"],"sourcesContent":[null],"mappings":"AAYA,OAAO,KAAKA,QAAQ,MAAM,8CAA8C;AAMxE;AACE;;;;AAIAC,WAAW,QACN,uCAAuC;AAE9C;;;;AAIA,OAAO,MAAMC,MAAM,GAAkBF,QAAQ,CAACE,MAAM;AAyBpD;;;;AAIA,OAAO,MAAMC,aAAa,GAA8CH,QAAQ,CAACI,gBAAgB;AAEjG;;;;AAIA,OAAO,MAAMC,cAAc,GAIvBL,QAAQ,CAACK,cAAc;AAE3B;;;;AAIA,OAAO,MAAMC,aAAa,GAEqCN,QAAQ,CAACM,aAAa;AAErF;;;;AAIA,OAAO,MAAMC,cAAc,GAEyDP,QAAQ,CAACO,cAAc;AAE3G;;;;AAIA,OAAO,MAAMC,mBAAmB,GAEoDR,QAAQ,CAACQ,mBAAmB;AAEhH;;;;AAIA,OAAO,MAAMC,cAAc,GAMvBT,QAAQ,CAACS,cAAc;AAE3B;;;;AAIA,OAAO,MAAMC,kBAAkB,GAQ3BV,QAAQ,CAACU,kBAAkB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as internal from "@effect/platform/internal/http/serverResponse";
|
|
2
|
+
/**
|
|
3
|
+
* @since 1.0.0
|
|
4
|
+
* @category type ids
|
|
5
|
+
*/
|
|
6
|
+
export const TypeId = /*#__PURE__*/Symbol.for("@effect/platform/Http/ServerResponse");
|
|
7
|
+
/**
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
*/
|
|
10
|
+
export const isServerResponse = internal.isServerResponse;
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
*/
|
|
14
|
+
export const toNonEffectBody = internal.toNonEffectBody;
|
|
15
|
+
/**
|
|
16
|
+
* @since 1.0.0
|
|
17
|
+
* @category constructors
|
|
18
|
+
*/
|
|
19
|
+
export const empty = internal.empty;
|
|
20
|
+
/**
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category constructors
|
|
23
|
+
*/
|
|
24
|
+
export const uint8Array = internal.uint8Array;
|
|
25
|
+
/**
|
|
26
|
+
* @since 1.0.0
|
|
27
|
+
* @category constructors
|
|
28
|
+
*/
|
|
29
|
+
export const text = internal.text;
|
|
30
|
+
/**
|
|
31
|
+
* @since 1.0.0
|
|
32
|
+
* @category constructors
|
|
33
|
+
*/
|
|
34
|
+
export const json = internal.json;
|
|
35
|
+
/**
|
|
36
|
+
* @since 1.0.0
|
|
37
|
+
* @category constructors
|
|
38
|
+
*/
|
|
39
|
+
export const schemaJson = internal.schemaJson;
|
|
40
|
+
/**
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
* @category constructors
|
|
43
|
+
*/
|
|
44
|
+
export const unsafeJson = internal.unsafeJson;
|
|
45
|
+
/**
|
|
46
|
+
* @since 1.0.0
|
|
47
|
+
* @category constructors
|
|
48
|
+
*/
|
|
49
|
+
export const urlParams = internal.urlParams;
|
|
50
|
+
/**
|
|
51
|
+
* @since 1.0.0
|
|
52
|
+
* @category constructors
|
|
53
|
+
*/
|
|
54
|
+
export const effect = internal.effect;
|
|
55
|
+
/**
|
|
56
|
+
* @since 1.0.0
|
|
57
|
+
* @category constructors
|
|
58
|
+
*/
|
|
59
|
+
export const raw = internal.raw;
|
|
60
|
+
/**
|
|
61
|
+
* @since 1.0.0
|
|
62
|
+
* @category constructors
|
|
63
|
+
*/
|
|
64
|
+
export const formData = internal.formData;
|
|
65
|
+
/**
|
|
66
|
+
* @since 1.0.0
|
|
67
|
+
* @category constructors
|
|
68
|
+
*/
|
|
69
|
+
export const stream = internal.stream;
|
|
70
|
+
/**
|
|
71
|
+
* @since 1.0.0
|
|
72
|
+
* @category constructors
|
|
73
|
+
*/
|
|
74
|
+
export const file = internal.file;
|
|
75
|
+
/**
|
|
76
|
+
* @since 1.0.0
|
|
77
|
+
* @category combinators
|
|
78
|
+
*/
|
|
79
|
+
export const setHeader = internal.setHeader;
|
|
80
|
+
/**
|
|
81
|
+
* @since 1.0.0
|
|
82
|
+
* @category combinators
|
|
83
|
+
*/
|
|
84
|
+
export const setHeaders = internal.setHeaders;
|
|
85
|
+
/**
|
|
86
|
+
* @since 1.0.0
|
|
87
|
+
* @category combinators
|
|
88
|
+
*/
|
|
89
|
+
export const setBody = internal.setBody;
|
|
90
|
+
//# sourceMappingURL=ServerResponse.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerResponse.mjs","names":["internal","TypeId","Symbol","for","isServerResponse","toNonEffectBody","empty","uint8Array","text","json","schemaJson","unsafeJson","urlParams","effect","raw","formData","stream","file","setHeader","setHeaders","setBody"],"sources":["../../src/Http/ServerResponse.ts"],"sourcesContent":[null],"mappings":"AAYA,OAAO,KAAKA,QAAQ,MAAM,+CAA+C;AAIzE;;;;AAIA,OAAO,MAAMC,MAAM,gBAAGC,MAAM,CAACC,GAAG,CAAC,sCAAsC,CAAC;AA8DxE;;;AAGA,OAAO,MAAMC,gBAAgB,GAAwCJ,QAAQ,CAACI,gBAAgB;AAE9F;;;AAGA,OAAO,MAAMC,eAAe,GAG1BL,QAAQ,CAACK,eAAe;AAE1B;;;;AAIA,OAAO,MAAMC,KAAK,GAAsDN,QAAQ,CAACM,KAAK;AAEtF;;;;AAIA,OAAO,MAAMC,UAAU,GAA4EP,QAAQ,CAACO,UAAU;AAEtH;;;;AAIA,OAAO,MAAMC,IAAI,GAAwER,QAAQ,CAACQ,IAAI;AAEtG;;;;AAIA,OAAO,MAAMC,IAAI,GAAqET,QAAQ,CAACS,IAAI;AAEnG;;;;AAIA,OAAO,MAAMC,UAAU,GAE2CV,QAAQ,CAACU,UAAU;AAErF;;;;AAIA,OAAO,MAAMC,UAAU,GAAqEX,QAAQ,CAACW,UAAU;AAE/G;;;;AAIA,OAAO,MAAMC,SAAS,GAA6EZ,QAAQ,CAACY,SAAS;AAErH;;;;AAIA,OAAO,MAAMC,MAAM,GAGGb,QAAQ,CAACa,MAAM;AAErC;;;;AAIA,OAAO,MAAMC,GAAG,GAAyDd,QAAQ,CAACc,GAAG;AAErF;;;;AAIA,OAAO,MAAMC,QAAQ,GAAsEf,QAAQ,CAACe,QAAQ;AAE5G;;;;AAIA,OAAO,MAAMC,MAAM,GACjBhB,QAAQ,CAACgB,MAAM;AAEjB;;;;AAIA,OAAO,MAAMC,IAAI,GAGwEjB,QAAQ,CAACiB,IAAI;AAEtG;;;;AAIA,OAAO,MAAMC,SAAS,GAGlBlB,QAAQ,CAACkB,SAAS;AAEtB;;;;AAIA,OAAO,MAAMC,UAAU,GAGnBnB,QAAQ,CAACmB,UAAU;AAEvB;;;;AAIA,OAAO,MAAMC,OAAO,GAGhBpB,QAAQ,CAACoB,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlParams.mjs","names":["Chunk","dual","Effect","fromInput","input","isChunk","Symbol","iterator","fromIterable","Object","entries","empty","set","self","key","value","append","filter","k","setAll","toSet","keys","toReadonlyArray","map","appendAll","includes","remove","toString","URLSearchParams","makeUrl","url","params","onError","try","urlInstance","URL","baseUrl","forEach","undefined","searchParams","catch","globalThis","location","origin","pathname"],"sources":["../../src/Http/UrlParams.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,KAAK,MAAM,oBAAoB;AAC3C,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAc3C;;;;AAIA,OAAO,MAAMC,SAAS,GAAIC,KAAY,IAAe;EACnD,IAAIJ,KAAK,CAACK,OAAO,CAACD,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK;GACb,MAAM,IAAIE,MAAM,CAACC,QAAQ,IAAIH,KAAK,EAAE;IACnC,OAAOJ,KAAK,CAACQ,YAAY,CAACJ,KAAK,CAAc;;EAE/C,OAAOJ,KAAK,CAACQ,YAAY,CAACC,MAAM,CAACC,OAAO,CAACN,KAAK,CAAC,CAAC;AAClD,CAAC;AAED;;;;AAIA,OAAO,MAAMO,KAAK,gBAAcX,KAAK,CAACW,KAAK,EAAE;AAE7C;;;;AAIA,OAAO,MAAMC,GAAG,
|
|
1
|
+
{"version":3,"file":"UrlParams.mjs","names":["Chunk","dual","Effect","fromInput","input","isChunk","Symbol","iterator","fromIterable","Object","entries","empty","set","self","key","value","append","filter","k","setAll","toSet","keys","toReadonlyArray","map","appendAll","includes","remove","toString","URLSearchParams","makeUrl","url","params","onError","try","urlInstance","URL","baseUrl","forEach","undefined","searchParams","catch","globalThis","location","origin","pathname"],"sources":["../../src/Http/UrlParams.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,KAAK,MAAM,oBAAoB;AAC3C,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAc3C;;;;AAIA,OAAO,MAAMC,SAAS,GAAIC,KAAY,IAAe;EACnD,IAAIJ,KAAK,CAACK,OAAO,CAACD,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK;GACb,MAAM,IAAIE,MAAM,CAACC,QAAQ,IAAIH,KAAK,EAAE;IACnC,OAAOJ,KAAK,CAACQ,YAAY,CAACJ,KAAK,CAAc;;EAE/C,OAAOJ,KAAK,CAACQ,YAAY,CAACC,MAAM,CAACC,OAAO,CAACN,KAAK,CAAC,CAAC;AAClD,CAAC;AAED;;;;AAIA,OAAO,MAAMO,KAAK,gBAAcX,KAAK,CAACW,KAAK,EAAE;AAE7C;;;;AAIA,OAAO,MAAMC,GAAG,gBAGZX,IAAI,CAGN,CAAC,EAAE,CAACY,IAAI,EAAEC,GAAG,EAAEC,KAAK,KACpBf,KAAK,CAACgB,MAAM,CACVhB,KAAK,CAACiB,MAAM,CAACJ,IAAI,EAAE,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K,CAACsB,eAAe,CAACT,IAAI,CAAQ,CAAC,CAACc,QAAQ,EAAE;AAEvH;;;;AAIA,OAAO,MAAME,OAAO,GAAGA,CAAIC,GAAW,EAAEC,MAAiB,EAAEC,OAA0B,KACnF9B,MAAM,CAAC+B,GAAG,CAAC;EACTA,GAAG,EAAEA,CAAA,KAAK;IACR,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAACL,GAAG,EAAEM,OAAO,EAAE,CAAC;IAC3CpC,KAAK,CAACqC,OAAO,CAACN,MAAM,EAAE,CAAC,CAACjB,GAAG,EAAEC,KAAK,CAAC,KAAI;MACrC,IAAIA,KAAK,KAAKuB,SAAS,EAAE;QACvBJ,WAAW,CAACK,YAAY,CAACvB,MAAM,CAACF,GAAG,EAAEC,KAAK,CAAC;;IAE/C,CAAC,CAAC;IACF,OAAOmB,WAAW;EACpB,CAAC;EACDM,KAAK,EAAER;CACR,CAAC;AAEJ,MAAMI,OAAO,GAAGA,CAAA,KAAyB;EACvC,IAAI,UAAU,IAAIK,UAAU,EAAE;IAC5B,OAAOC,QAAQ,CAACC,MAAM,GAAGD,QAAQ,CAACE,QAAQ;;EAE5C,OAAON,SAAS;AAClB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import * as app_1 from "@effect/platform/Http/App";
|
|
5
|
+
export { app_1 as app };
|
|
6
|
+
import * as middleware_1 from "@effect/platform/Http/Middleware";
|
|
7
|
+
export { middleware_1 as middleware };
|
|
8
|
+
import * as request_1 from "@effect/platform/Http/ServerRequest";
|
|
9
|
+
export { request_1 as request };
|
|
10
|
+
import * as response_1 from "@effect/platform/Http/ServerResponse";
|
|
11
|
+
export { response_1 as response };
|
|
12
|
+
import * as error_1 from "@effect/platform/Http/ServerError";
|
|
13
|
+
export { error_1 as error };
|
|
14
|
+
import * as body_1 from "@effect/platform/Http/Body";
|
|
15
|
+
export { body_1 as body };
|
|
16
|
+
import * as formData_1 from "@effect/platform/Http/FormData";
|
|
17
|
+
export { formData_1 as formData };
|
|
18
|
+
import * as headers_1 from "@effect/platform/Http/Headers";
|
|
19
|
+
export { headers_1 as headers };
|
|
20
|
+
import * as router_1 from "@effect/platform/Http/Router";
|
|
21
|
+
export { router_1 as router };
|
|
22
|
+
import * as urlParams_1 from "@effect/platform/Http/UrlParams";
|
|
23
|
+
export { urlParams_1 as urlParams };
|
|
24
|
+
//# sourceMappingURL=HttpServer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpServer.mjs","names":["app","middleware","request","response","error","body","formData","headers","router","urlParams"],"sources":["../src/HttpServer.ts"],"sourcesContent":[null],"mappings":"AAAA;;;uBAOqB,2BAA2B;kBAApCA,GAAG;8BAIa,kCAAkC;yBAAlDC,UAAU;2BAIG,qCAAqC;sBAAlDC,OAAO;4BAIO,sCAAsC;uBAApDC,QAAQ;yBAIG,mCAAmC;oBAA9CC,KAAK;wBAIK,4BAA4B;mBAAtCC,IAAI;4BAIU,gCAAgC;uBAA9CC,QAAQ;2BAIK,+BAA+B;sBAA5CC,OAAO;0BAIK,8BAA8B;qBAA1CC,MAAM;6BAIS,iCAAiC;wBAAhDC,SAAS"}
|
|
@@ -42,15 +42,19 @@ export const make = impl => {
|
|
|
42
42
|
/** @internal */
|
|
43
43
|
const stream = (file, {
|
|
44
44
|
bufferSize = 4,
|
|
45
|
-
bytesToRead,
|
|
46
|
-
chunkSize = Size(64 * 1024)
|
|
47
|
-
} = {}) =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
bytesToRead: bytesToRead_,
|
|
46
|
+
chunkSize: chunkSize_ = Size(64 * 1024)
|
|
47
|
+
} = {}) => {
|
|
48
|
+
const bytesToRead = bytesToRead_ !== undefined ? Size(bytesToRead_) : undefined;
|
|
49
|
+
const chunkSize = Size(chunkSize_);
|
|
50
|
+
return Stream.bufferChunks(Stream.unfoldEffect(BigInt(0), totalBytesRead => {
|
|
51
|
+
if (bytesToRead !== undefined && bytesToRead <= totalBytesRead) {
|
|
52
|
+
return Effect.succeed(Option.none());
|
|
53
|
+
}
|
|
54
|
+
const toRead = bytesToRead !== undefined && bytesToRead - totalBytesRead < chunkSize ? bytesToRead - totalBytesRead : chunkSize;
|
|
55
|
+
return Effect.map(file.readAlloc(toRead), Option.map(buf => [buf, Size(totalBytesRead + BigInt(buf.length))]));
|
|
56
|
+
}), {
|
|
57
|
+
capacity: bufferSize
|
|
58
|
+
});
|
|
59
|
+
};
|
|
56
60
|
//# sourceMappingURL=fileSystem.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileSystem.mjs","names":["Tag","identity","Option","Effect","Error","Sink","Stream","tag","Size","bytes","BigInt","make","impl","of","exists","path","catchTag","e","reason","succeed","fail","as","access","readFileString","encoding","tryMap","readFile","try","_","TextDecoder","decode","catch","BadArgument","module","method","message","stream","options","unwrapScoped","map","file","offset","tap","seek","open","flag","sink","forEach","writeAll","writeFileString","data","flatMap","TextEncoder","encode","writeFile","bufferSize","bytesToRead","chunkSize","bufferChunks","unfoldEffect","totalBytesRead","
|
|
1
|
+
{"version":3,"file":"fileSystem.mjs","names":["Tag","identity","Option","Effect","Error","Sink","Stream","tag","Size","bytes","BigInt","make","impl","of","exists","path","catchTag","e","reason","succeed","fail","as","access","readFileString","encoding","tryMap","readFile","try","_","TextDecoder","decode","catch","BadArgument","module","method","message","stream","options","unwrapScoped","map","file","offset","tap","seek","open","flag","sink","forEach","writeAll","writeFileString","data","flatMap","TextEncoder","encode","writeFile","bufferSize","bytesToRead","bytesToRead_","chunkSize","chunkSize_","undefined","bufferChunks","unfoldEffect","totalBytesRead","none","toRead","readAlloc","buf","length","capacity"],"sources":["../../src/internal/fileSystem.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAG,QAAQ,sBA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AU,EAAE;EAC1Be,UAAU,GAAG,CAAC;EACdC,WAAW,EAAEC,YAAY;EACzBC,SAAS,EAAEC,UAAU,GAAGnD,IAAI,CAAC,EAAE,GAAG,IAAI;AAAC,IACtB,EAAE,KAAI;EACvB,MAAMgD,WAAW,GAAGC,YAAY,KAAKG,SAAS,GAAGpD,IAAI,CAACiD,YAAY,CAAC,GAAGG,SAAS;EAC/E,MAAMF,SAAS,GAAGlD,IAAI,CAACmD,UAAU,CAAC;EAClC,OAAOrD,MAAM,CAACuD,YAAY,CACxBvD,MAAM,CAACwD,YAAY,CAACpD,MAAM,CAAC,CAAC,CAAC,EAAGqD,cAAc,IAAI;IAChD,IAAIP,WAAW,KAAKI,SAAS,IAAIJ,WAAW,IAAIO,cAAc,EAAE;MAC9D,OAAO5D,MAAM,CAACgB,OAAO,CAACjB,MAAM,CAAC8D,IAAI,EAAE,CAAC;;IAGtC,MAAMC,MAAM,GAAGT,WAAW,KAAKI,SAAS,IAAKJ,WAAW,GAAGO,cAAc,GAAIL,SAAS,GAClFF,WAAW,GAAGO,cAAc,GAC5BL,SAAS;IAEb,OAAOvD,MAAM,CAACoC,GAAG,CACfC,IAAI,CAAC0B,SAAS,CAACD,MAAM,CAAC,EACtB/D,MAAM,CAACqC,GAAG,CAAE4B,GAAG,IAAK,CAACA,GAAG,EAAE3D,IAAI,CAACuD,cAAc,GAAGrD,MAAM,CAACyD,GAAG,CAACC,MAAM,CAAC,CAAC,CAAU,CAAC,CAC/E;EACH,CAAC,CAAC,EACF;IAAEC,QAAQ,EAAEd;EAAU,CAAE,CACzB;AACH,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
var _a, _b, _c, _d, _e, _f;
|
|
2
1
|
import * as Effect from "@effect/io/Effect";
|
|
2
|
+
import * as FileSystem from "@effect/platform/FileSystem";
|
|
3
3
|
import * as Schema from "@effect/schema/Schema";
|
|
4
4
|
/** @internal */
|
|
5
5
|
export const TypeId = /*#__PURE__*/Symbol.for("@effect/platform/Http/Body");
|
|
6
6
|
class EmptyImpl {
|
|
7
7
|
constructor() {
|
|
8
|
-
this[_a] = TypeId;
|
|
9
8
|
this._tag = "Empty";
|
|
9
|
+
this[TypeId] = TypeId;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
_a = TypeId;
|
|
13
12
|
/** @internal */
|
|
14
13
|
export const empty = /*#__PURE__*/new EmptyImpl();
|
|
15
14
|
class RawImpl {
|
|
@@ -17,55 +16,55 @@ class RawImpl {
|
|
|
17
16
|
this.body = body;
|
|
18
17
|
this.contentType = contentType;
|
|
19
18
|
this.contentLength = contentLength;
|
|
20
|
-
this[_b] = TypeId;
|
|
21
19
|
this._tag = "Raw";
|
|
20
|
+
this[TypeId] = TypeId;
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
|
-
_b = TypeId;
|
|
25
23
|
/** @internal */
|
|
26
24
|
export const raw = (body, contentType, contentLength) => new RawImpl(body, contentType, contentLength);
|
|
27
|
-
class
|
|
25
|
+
class Uint8ArrayImpl {
|
|
28
26
|
constructor(body, contentType) {
|
|
29
27
|
this.body = body;
|
|
30
28
|
this.contentType = contentType;
|
|
31
|
-
this
|
|
32
|
-
this
|
|
29
|
+
this._tag = "Uint8Array";
|
|
30
|
+
this[TypeId] = TypeId;
|
|
33
31
|
}
|
|
34
32
|
get contentLength() {
|
|
35
33
|
return this.body.length;
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
|
-
_c = TypeId;
|
|
39
36
|
/** @internal */
|
|
40
|
-
export const
|
|
37
|
+
export const uint8Array = (body, contentType) => new Uint8ArrayImpl(body, contentType ?? "application/octet-stream");
|
|
41
38
|
/** @internal */
|
|
42
|
-
export const text = (body, contentType) =>
|
|
43
|
-
class
|
|
44
|
-
constructor(
|
|
45
|
-
this.
|
|
39
|
+
export const text = (body, contentType) => uint8Array(new TextEncoder().encode(body), contentType ?? "text/plain");
|
|
40
|
+
class EffectBodyImpl {
|
|
41
|
+
constructor(effect, contentType) {
|
|
42
|
+
this.effect = effect;
|
|
46
43
|
this.contentType = contentType;
|
|
47
|
-
this
|
|
48
|
-
this
|
|
44
|
+
this._tag = "Effect";
|
|
45
|
+
this[TypeId] = TypeId;
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
|
-
_d = TypeId;
|
|
52
48
|
/** @internal */
|
|
53
|
-
export const
|
|
49
|
+
export const effect = body => new EffectBodyImpl(body);
|
|
54
50
|
/** @internal */
|
|
55
|
-
export const
|
|
51
|
+
export const unsafeJson = body => uint8Array(new TextEncoder().encode(JSON.stringify(body)), "application/json");
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const json = body => effect(Effect.try(() => unsafeJson(body)));
|
|
56
54
|
/** @internal */
|
|
57
55
|
export const jsonSchema = schema => {
|
|
58
56
|
const encode = Schema.encode(schema);
|
|
59
|
-
return body =>
|
|
57
|
+
return body => effect(Effect.flatMap(encode(body), json => Effect.try(() => unsafeJson(json))));
|
|
60
58
|
};
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const file = (path, options) => Effect.flatMap(FileSystem.FileSystem, fs => Effect.map(fs.stat(path), stat => stream(fs.stream(path, options), options?.contentType, Number(stat.size))));
|
|
61
61
|
class FormDataImpl {
|
|
62
62
|
constructor(formData) {
|
|
63
63
|
this.formData = formData;
|
|
64
|
-
this[_e] = TypeId;
|
|
65
64
|
this._tag = "FormData";
|
|
65
|
+
this[TypeId] = TypeId;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
_e = TypeId;
|
|
69
68
|
/** @internal */
|
|
70
69
|
export const formData = body => new FormDataImpl(body);
|
|
71
70
|
class StreamImpl {
|
|
@@ -73,11 +72,10 @@ class StreamImpl {
|
|
|
73
72
|
this.stream = stream;
|
|
74
73
|
this.contentType = contentType;
|
|
75
74
|
this.contentLength = contentLength;
|
|
76
|
-
this[_f] = TypeId;
|
|
77
75
|
this._tag = "Stream";
|
|
76
|
+
this[TypeId] = TypeId;
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
|
-
_f = TypeId;
|
|
81
79
|
/** @internal */
|
|
82
|
-
export const stream = (body, contentType, contentLength) => new StreamImpl(body, contentType, contentLength);
|
|
80
|
+
export const stream = (body, contentType, contentLength) => new StreamImpl(body, contentType ?? "application/octet-stream", contentLength);
|
|
83
81
|
//# sourceMappingURL=body.mjs.map
|