@effect/platform-node 0.14.0 → 0.15.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/Http/Platform.d.ts +25 -0
- package/Http/Platform.d.ts.map +1 -0
- package/Http/Platform.js +42 -0
- package/Http/Platform.js.map +1 -0
- package/Http/Server.d.ts +3 -3
- package/Http/Server.d.ts.map +1 -1
- package/Http/Server.js.map +1 -1
- package/internal/http/platform.d.ts +2 -0
- package/internal/http/platform.d.ts.map +1 -0
- package/internal/http/platform.js +50 -0
- package/internal/http/platform.js.map +1 -0
- package/internal/http/server.js +32 -7
- package/internal/http/server.js.map +1 -1
- package/internal/runtime.js +1 -1
- package/internal/runtime.js.map +1 -1
- package/mjs/Http/Platform.mjs +16 -0
- package/mjs/Http/Platform.mjs.map +1 -0
- package/mjs/Http/Server.mjs.map +1 -1
- package/mjs/internal/http/platform.mjs +40 -0
- package/mjs/internal/http/platform.mjs.map +1 -0
- package/mjs/internal/http/server.mjs +32 -7
- package/mjs/internal/http/server.mjs.map +1 -1
- package/mjs/internal/runtime.mjs +1 -1
- package/mjs/internal/runtime.mjs.map +1 -1
- package/package.json +7 -6
- package/src/Http/Platform.ts +28 -0
- package/src/Http/Server.ts +5 -5
- package/src/internal/http/platform.ts +43 -0
- package/src/internal/http/server.ts +33 -8
- package/src/internal/runtime.ts +1 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*
|
|
4
|
+
* Also includes exports from [`@effect/platform/Http/Platform`](https://effect-ts.github.io/platform/platform/Http/Platform.ts.html).
|
|
5
|
+
*/
|
|
6
|
+
import type * as Effect from "@effect/io/Effect";
|
|
7
|
+
import type * as Layer from "@effect/io/Layer";
|
|
8
|
+
import type * as FileSystem from "@effect/platform/FileSystem";
|
|
9
|
+
import type * as Etag from "@effect/platform/Http/Etag";
|
|
10
|
+
import type * as Platform from "@effect/platform/Http/Platform";
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
*/
|
|
14
|
+
export * from "@effect/platform/Http/Platform";
|
|
15
|
+
/**
|
|
16
|
+
* @since 1.0.0
|
|
17
|
+
* @category constructors
|
|
18
|
+
*/
|
|
19
|
+
export declare const make: Effect.Effect<FileSystem.FileSystem | Etag.Generator, never, Platform.Platform>;
|
|
20
|
+
/**
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category layers
|
|
23
|
+
*/
|
|
24
|
+
export declare const layer: Layer.Layer<never, never, Platform.Platform>;
|
|
25
|
+
//# sourceMappingURL=Platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Platform.d.ts","sourceRoot":"","sources":["../src/Http/Platform.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,KAAK,KAAK,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,KAAK,UAAU,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,KAAK,IAAI,MAAM,4BAA4B,CAAA;AACvD,OAAO,KAAK,KAAK,QAAQ,MAAM,gCAAgC,CAAA;AAE/D;;GAEG;AACH,cAAc,gCAAgC,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAiB,CAAA;AAElH;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAkB,CAAA"}
|
package/Http/Platform.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
make: true,
|
|
8
|
+
layer: true
|
|
9
|
+
};
|
|
10
|
+
exports.make = exports.layer = void 0;
|
|
11
|
+
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/internal/http/platform"));
|
|
12
|
+
var _Platform = /*#__PURE__*/require("@effect/platform/Http/Platform");
|
|
13
|
+
Object.keys(_Platform).forEach(function (key) {
|
|
14
|
+
if (key === "default" || key === "__esModule") return;
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
16
|
+
if (key in exports && exports[key] === _Platform[key]) return;
|
|
17
|
+
Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _Platform[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
+
/**
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @since 1.0.0
|
|
32
|
+
* @category constructors
|
|
33
|
+
*/
|
|
34
|
+
const make = internal.make;
|
|
35
|
+
/**
|
|
36
|
+
* @since 1.0.0
|
|
37
|
+
* @category layers
|
|
38
|
+
*/
|
|
39
|
+
exports.make = make;
|
|
40
|
+
const layer = internal.layer;
|
|
41
|
+
exports.layer = layer;
|
|
42
|
+
//# sourceMappingURL=Platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Platform.js","names":["internal","_interopRequireWildcard","require","_Platform","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","make","layer"],"sources":["../src/Http/Platform.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;AAOA,IAAAA,QAAA,gBAAAC,uBAAA,eAAAC,OAAA;AAQA,IAAAC,SAAA,gBAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,SAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,SAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,SAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAA8C,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA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@@ import type * as ConfigError from "@effect/io/ConfigError";
|
|
|
11
11
|
import type * as Effect from "@effect/io/Effect";
|
|
12
12
|
import type * as Layer from "@effect/io/Layer";
|
|
13
13
|
import type * as Scope from "@effect/io/Scope";
|
|
14
|
-
import type * as
|
|
14
|
+
import type * as Platform from "@effect/platform/Http/Platform";
|
|
15
15
|
import type * as Server from "@effect/platform/Http/Server";
|
|
16
16
|
import type * as Http from "node:http";
|
|
17
17
|
import type * as Net from "node:net";
|
|
@@ -28,10 +28,10 @@ export declare const make: (evaluate: LazyArg<Http.Server>, options: Net.ListenO
|
|
|
28
28
|
* @since 1.0.0
|
|
29
29
|
* @category layers
|
|
30
30
|
*/
|
|
31
|
-
export declare const layer: (evaluate: LazyArg<Http.Server
|
|
31
|
+
export declare const layer: (evaluate: LazyArg<Http.Server<typeof Http.IncomingMessage, typeof Http.ServerResponse>>, options: Net.ListenOptions) => Layer.Layer<never, never, Server.Server | Platform.Platform>;
|
|
32
32
|
/**
|
|
33
33
|
* @since 1.0.0
|
|
34
34
|
* @category layers
|
|
35
35
|
*/
|
|
36
|
-
export declare const layerConfig: (evaluate: LazyArg<Http.Server
|
|
36
|
+
export declare const layerConfig: (evaluate: LazyArg<Http.Server<typeof Http.IncomingMessage, typeof Http.ServerResponse>>, options: Config.Config.Wrap<Net.ListenOptions>) => Layer.Layer<never, ConfigError.ConfigError, Server.Server | Platform.Platform>;
|
|
37
37
|
//# sourceMappingURL=Server.d.ts.map
|
package/Http/Server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Server.d.ts","sourceRoot":"","sources":["../src/Http/Server.ts"],"names":[],"mappings":";;AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,KAAK,WAAW,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,KAAK,MA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Aa,KACvB,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAkB,CAAA;AAElF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,CACxB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,eAAe,EAAE,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,EACvF,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAC3C,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAwB,CAAA"}
|
package/Http/Server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Server.js","names":["internal","_interopRequireWildcard","require","_Server","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","make","layer","layerConfig"],"sources":["../src/Http/Server.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;AAWA,IAAAA,QAAA,gBAAAC,uBAAA,eAAAC,OAAA;AASA,IAAAC,OAAA,gBAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GA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K,IAAI,GAGuC/B,QAAQ,CAAC+B,IAAI;AAErE;;;;AAAAnB,OAAA,CAAAmB,IAAA,GAAAA,IAAA;AAIO,MAAMC,KAAK,
|
|
1
|
+
{"version":3,"file":"Server.js","names":["internal","_interopRequireWildcard","require","_Server","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","make","layer","layerConfig"],"sources":["../src/Http/Server.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;AAWA,IAAAA,QAAA,gBAAAC,uBAAA,eAAAC,OAAA;AASA,IAAAC,OAAA,gBAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAA4C,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAhB,wBAAAoB,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,G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
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.make = exports.layer = void 0;
|
|
7
|
+
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Layer"));
|
|
8
|
+
var FileSystem = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/FileSystem"));
|
|
9
|
+
var Etag = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/Http/Etag"));
|
|
10
|
+
var Platform = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Http/Platform"));
|
|
11
|
+
var ServerResponse = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Http/ServerResponse"));
|
|
12
|
+
var Mime = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("mime"));
|
|
13
|
+
var Fs = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:fs"));
|
|
14
|
+
var _nodeStream = /*#__PURE__*/require("node:stream");
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
/** @internal */
|
|
18
|
+
const make = /*#__PURE__*/Platform.make({
|
|
19
|
+
fileResponse(path, status, statusText, headers, start, end, contentLength) {
|
|
20
|
+
const stream = Fs.createReadStream(path, {
|
|
21
|
+
start,
|
|
22
|
+
end
|
|
23
|
+
});
|
|
24
|
+
return ServerResponse.raw(stream, {
|
|
25
|
+
headers: {
|
|
26
|
+
...headers,
|
|
27
|
+
"content-type": headers["content-type"] ?? Mime.getType(path) ?? "application/octet-stream",
|
|
28
|
+
"content-length": contentLength.toString()
|
|
29
|
+
},
|
|
30
|
+
status,
|
|
31
|
+
statusText
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
fileWebResponse(file, status, statusText, headers, _options) {
|
|
35
|
+
return ServerResponse.raw(_nodeStream.Readable.fromWeb(file.stream()), {
|
|
36
|
+
headers: {
|
|
37
|
+
...headers,
|
|
38
|
+
"content-type": headers["content-type"] ?? Mime.getType(file.name) ?? "application/octet-stream",
|
|
39
|
+
"content-length": file.size.toString()
|
|
40
|
+
},
|
|
41
|
+
status,
|
|
42
|
+
statusText
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
/** @internal */
|
|
47
|
+
exports.make = make;
|
|
48
|
+
const layer = /*#__PURE__*/Layer.use(Etag.layer)( /*#__PURE__*/Layer.use(FileSystem.layer)( /*#__PURE__*/Layer.effect(Platform.Platform, make)));
|
|
49
|
+
exports.layer = layer;
|
|
50
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","names":["Layer","_interopRequireWildcard","require","FileSystem","Etag","Platform","ServerResponse","Mime","Fs","_nodeStream","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","make","fileResponse","path","status","statusText","headers","start","end","contentLength","stream","createReadStream","raw","getType","toString","fileWebResponse","file","_options","Readable","fromWeb","name","size","exports","layer","use","effect"],"sources":["../../src/internal/http/platform.ts"],"sourcesContent":[null],"mappings":";;;;;;AACA,IAAAA,KAAA,gBAAAC,uBAAA,eAAAC,OAAA;AACA,IAAAC,UAAA,gBAAAF,uBAAA,eAAAC,OAAA;AACA,IAAAE,IAAA,gBAAAH,uBAAA,eAAAC,OAAA;AACA,IAAAG,QAAA,gBAAAJ,uBAAA,eAAAC,OAAA;AACA,IAAAI,cAAA,gBAAAL,uBAAA,eAAAC,OAAA;AACA,IAAAK,IAAA,gBAAAN,uBAAA,eAAAC,OAAA;AACA,IAAAM,EAAA,gBAAAP,uBAAA,eAAAC,OAAA;AACA,IAAAO,WAAA,gBAAAP,OAAA;AAAsC,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAc,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAA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,OAAO,CAAC,cAAc,CAAC,IAAI9B,IAAI,CAACqC,OAAO,CAACG,IAAI,CAACI,IAAI,CAAC,IAAI,0BAA0B;QAChG,gBAAgB,EAAEJ,IAAI,CAACK,IAAI,CAACP,QAAQ;OACrC;MACDV,MAAM;MACNC;KACD,CAAC;EACJ;CACD,CAAC;AAEF;AAAAiB,OAAA,CAAArB,IAAA,GAAAA,IAAA;AACO,MAAMsB,KAAK,gBAGhBtD,KAAK,CAACuD,GAAG,CAACnD,IAAI,CAACkD,KAAK,CAAC,eADrBtD,KAAK,CAACuD,GAAG,CAACpD,UAAU,CAACmD,KAAK,CAAC,eAD3BtD,KAAK,CAACwD,MAAM,CAACnD,QAAQ,CAACA,QAAQ,EAAE2B,IAAI,CAAC,EAGtC;AAAAqB,OAAA,CAAAC,KAAA,GAAAA,KAAA"}
|
package/internal/http/server.js
CHANGED
|
@@ -10,9 +10,9 @@ var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect
|
|
|
10
10
|
var Fiber = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Fiber"));
|
|
11
11
|
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Layer"));
|
|
12
12
|
var Runtime = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Runtime"));
|
|
13
|
-
var internalEtag = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/internal/http/etag"));
|
|
14
13
|
var internalFormData = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/internal/http/formData"));
|
|
15
14
|
var _incomingMessage = /*#__PURE__*/require("@effect/platform-node/internal/http/incomingMessage");
|
|
15
|
+
var internalPlatform = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/internal/http/platform"));
|
|
16
16
|
var NodeSink = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/Sink"));
|
|
17
17
|
var FileSystem = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/FileSystem"));
|
|
18
18
|
var IncomingMessage = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Http/IncomingMessage"));
|
|
@@ -22,6 +22,7 @@ var Error = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/
|
|
|
22
22
|
var ServerRequest = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Http/ServerRequest"));
|
|
23
23
|
var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/Stream"));
|
|
24
24
|
var _nodeStream = /*#__PURE__*/require("node:stream");
|
|
25
|
+
var _promises = /*#__PURE__*/require("node:stream/promises");
|
|
25
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
28
|
/** @internal */
|
|
@@ -141,14 +142,20 @@ class ServerRequestImpl extends _incomingMessage.IncomingMessageImpl {
|
|
|
141
142
|
}
|
|
142
143
|
ServerRequest.TypeId;
|
|
143
144
|
/** @internal */
|
|
144
|
-
const layer = (evaluate, options) => Layer.merge(Layer.scoped(Server.Server, make(evaluate, options)),
|
|
145
|
+
const layer = (evaluate, options) => Layer.merge(Layer.scoped(Server.Server, make(evaluate, options)), internalPlatform.layer);
|
|
145
146
|
/** @internal */
|
|
146
147
|
exports.layer = layer;
|
|
147
|
-
const layerConfig = (evaluate, options) => Layer.merge(Layer.scoped(Server.Server, Effect.flatMap(Effect.config(Config.unwrap(options)), options => make(evaluate, options))),
|
|
148
|
+
const layerConfig = (evaluate, options) => Layer.merge(Layer.scoped(Server.Server, Effect.flatMap(Effect.config(Config.unwrap(options)), options => make(evaluate, options))), internalPlatform.layer);
|
|
148
149
|
exports.layerConfig = layerConfig;
|
|
149
150
|
const handleResponse = (request, response) => Effect.suspend(() => {
|
|
150
151
|
const nodeResponse = request.response;
|
|
151
|
-
|
|
152
|
+
if (request.method === "HEAD") {
|
|
153
|
+
nodeResponse.writeHead(response.status, response.headers);
|
|
154
|
+
nodeResponse.end();
|
|
155
|
+
return Effect.unit;
|
|
156
|
+
}
|
|
157
|
+
const body = response.body;
|
|
158
|
+
switch (body._tag) {
|
|
152
159
|
case "Empty":
|
|
153
160
|
{
|
|
154
161
|
nodeResponse.writeHead(response.status, response.headers);
|
|
@@ -156,15 +163,33 @@ const handleResponse = (request, response) => Effect.suspend(() => {
|
|
|
156
163
|
return Effect.unit;
|
|
157
164
|
}
|
|
158
165
|
case "Raw":
|
|
166
|
+
{
|
|
167
|
+
nodeResponse.writeHead(response.status, response.headers);
|
|
168
|
+
if (typeof body.body === "object" && body.body !== null && "pipe" in body.body && typeof body.body.pipe === "function") {
|
|
169
|
+
return Effect.tryPromise({
|
|
170
|
+
try: signal => (0, _promises.pipeline)(body.body, nodeResponse, {
|
|
171
|
+
signal,
|
|
172
|
+
end: true
|
|
173
|
+
}),
|
|
174
|
+
catch: error => Error.ResponseError({
|
|
175
|
+
request,
|
|
176
|
+
response,
|
|
177
|
+
reason: "Decode",
|
|
178
|
+
error
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
nodeResponse.end(body.body);
|
|
183
|
+
return Effect.unit;
|
|
184
|
+
}
|
|
159
185
|
case "Uint8Array":
|
|
160
186
|
{
|
|
161
187
|
nodeResponse.writeHead(response.status, response.headers);
|
|
162
|
-
nodeResponse.end(
|
|
188
|
+
nodeResponse.end(body.body);
|
|
163
189
|
return Effect.unit;
|
|
164
190
|
}
|
|
165
191
|
case "FormData":
|
|
166
192
|
{
|
|
167
|
-
const body = response.body;
|
|
168
193
|
return Effect.async(resume => {
|
|
169
194
|
const r = new Response(body.formData);
|
|
170
195
|
const headers = {
|
|
@@ -187,7 +212,7 @@ const handleResponse = (request, response) => Effect.suspend(() => {
|
|
|
187
212
|
case "Stream":
|
|
188
213
|
{
|
|
189
214
|
nodeResponse.writeHead(response.status, response.headers);
|
|
190
|
-
return Stream.run(Stream.mapError(
|
|
215
|
+
return Stream.run(Stream.mapError(body.stream, error => Error.ResponseError({
|
|
191
216
|
request,
|
|
192
217
|
response,
|
|
193
218
|
reason: "Decode",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","names":["Option","_interopRequireWildcard","require","Config","Effect","Fiber","Layer","Runtime","internalEtag","internalFormData","_incomingMessage","NodeSink","FileSystem","IncomingMessage","Middleware","Server","Error","ServerRequest","Stream","_nodeStream","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","make","evaluate","options","gen","_","server","serverFiber","addFinalizer","async","resume","close","error","die","unit","zipRight","on","fail","ServeError","scoped","forkScoped","listen","address","_tag","path","hostname","port","serve","httpApp","middleware","handledApp","respond","flatMap","all","runtime","fiberId","runFork","handler","nodeRequest","nodeResponse","fiber","provideService","ServerRequestImpl","writableEnded","interruptAsFork","acquireRelease","sync","off","join","discard","concurrency","pipe","locally","maxBodySize","some","Size","exports","request","tapErrorCause","tap","response","handleResponse","_cause","headersSent","writeHead","end","IncomingMessageImpl","constructor","source","url","headersOverride","RequestError","reason","TypeId","originalUrl","method","headers","formData","formDataEffect","runSync","cached","formDataStream","stream","setUrl","replaceHeaders","toString","toJSON","layer","merge","layerConfig","config","unwrap","suspend","body","status","r","Response","fromEntries","Readable","fromWeb","ResponseError","once","run","mapError","fromWritable"],"sources":["../../src/internal/http/server.ts"],"sourcesContent":[null],"mappings":";;;;;;AACA,IAAAA,MAAA,gBAAAC,uBAAA,eAAAC,OAAA;AACA,IAAAC,MAAA,gBAAAF,uBAAA,eAAAC,OAAA;AACA,IAAAE,MAAA,gBAAAH,uBAAA,eAAAC,OAAA;AACA,IAAAG,KAAA,gBAAAJ,uBAAA,eAAAC,OAAA;AACA,IAAAI,KAAA,gBAAAL,uBAAA,eAAAC,OAAA;AACA,IAAAK,OAAA,gBAAAN,uBAAA,eAAAC,OAAA;AAEA,IAAAM,YAAA,gBAAAP,uBAAA,eAAAC,OAAA;AACA,IAAAO,gBAAA,gBAAAR,uBAAA,eAAAC,OAAA;AACA,IAAAQ,gBAAA,gBAAAR,OAAA;AACA,IAAAS,QAAA,gBAAAV,uBAAA,eAAAC,OAAA;AACA,IAAAU,UAAA,gBAAAX,uBAAA,eAAAC,OAAA;AAGA,IAAAW,eAAA,gBAAAZ,uBAAA,eAAAC,OAAA;AAEA,IAAAY,UAAA,gBAAAb,uBAAA,eAAAC,OAAA;AACA,IAAAa,MAAA,gBAAAd,uBAAA,eAAAC,OAAA;AACA,IAAAc,KAAA,gBAAAf,uBAAA,eAAAC,OAAA;AACA,IAAAe,aAAA,gBAAAhB,uBAAA,eAAAC,OAAA;AAGA,IAAAgB,MAAA,gBAAAjB,uBAAA,eAAAC,OAAA;AAGA,IAAAiB,WAAA,gBAAAjB,OAAA;AAAsC,SAAAkB,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,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MAAM,CAAC6H,GAAG,CACf7H,MAAM,CAAC8H,QAAQ,CACb3C,QAAQ,CAACiC,IAAI,CAACX,MAAM,EACnBtE,KAAK,IACJrC,KAAK,CAAC6H,aAAa,CAAC;UAClB3C,OAAO;UACPG,QAAQ;UACRY,MAAM,EAAE,QAAQ;UAChB5D;SACD,CAAC,CACL,EACD1C,QAAQ,CAACsI,YAAY,CAAC,MAAMjE,YAAY,EAAG3B,KAAK,IAC9CrC,KAAK,CAAC6H,aAAa,CAAC;UAClB3C,OAAO;UACPG,QAAQ;UACRY,MAAM,EAAE,QAAQ;UAChB5D;SACD,CAAC,CAAC,CACN;;;AAGP,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"server.js","names":["Option","_interopRequireWildcard","require","Config","Effect","Fiber","Layer","Runtime","internalFormData","_incomingMessage","internalPlatform","NodeSink","FileSystem","IncomingMessage","Middleware","Server","Error","ServerRequest","Stream","_nodeStream","_promises","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","make","evaluate","options","gen","_","server","serverFiber","addFinalizer","async","resume","close","error","die","unit","zipRight","on","fail","ServeError","scoped","forkScoped","listen","address","_tag","path","hostname","port","serve","httpApp","middleware","handledApp","respond","flatMap","all","runtime","fiberId","runFork","handler","nodeRequest","nodeResponse","fiber","provideService","ServerRequestImpl","writableEnded","interruptAsFork","acquireRelease","sync","off","join","discard","concurrency","pipe","locally","maxBodySize","some","Size","exports","request","tapErrorCause","tap","response","handleResponse","_cause","headersSent","writeHead","end","IncomingMessageImpl","constructor","source","url","headersOverride","RequestError","reason","TypeId","originalUrl","method","headers","formData","formDataEffect","runSync","cached","formDataStream","stream","setUrl","replaceHeaders","toString","toJSON","layer","merge","layerConfig","config","unwrap","suspend","status","body","tryPromise","try","signal","pipeline","catch","ResponseError","r","Response","fromEntries","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CAAC,CAACzB,OAAO;WAChC;UACDrC,YAAY,CAACyB,SAAS,CAACJ,QAAQ,CAACiC,MAAM,EAAEjB,OAAO,CAAC;UAChD4B,oBAAQ,CAACC,OAAO,CAACJ,CAAC,CAACP,IAAW,CAAC,CAC5B3C,IAAI,CAACZ,YAAY,CAAC,CAClBvB,EAAE,CAAC,OAAO,EAAGJ,KAAK,IAAI;YACrBF,MAAM,CAAChD,MAAM,CAACuD,IAAI,CAAC3C,KAAK,CAAC8H,aAAa,CAAC;cACrC3C,OAAO;cACPG,QAAQ;cACRY,MAAM,EAAE,QAAQ;cAChB5D;aACD,CAAC,CAAC,CAAC;UACN,CAAC,CAAC,CACD8F,IAAI,CAAC,QAAQ,EAAE,MAAK;YACnBhG,MAAM,CAAChD,MAAM,CAACoD,IAAI,CAAC;UACrB,CAAC,CAAC;QACN,CAAC,CAAC;;IAEJ,KAAK,QAAQ;MAAE;QACbyB,YAAY,CAACyB,SAAS,CAACJ,QAAQ,CAACiC,MAAM,EAAEjC,QAAQ,CAACgB,OAAO,CAAC;QACzD,OAAOpG,MAAM,CAACmI,GAAG,CACfnI,MAAM,CAACoI,QAAQ,CACbd,IAAI,CAACZ,MAAM,EACVtE,KAAK,IACJtC,KAAK,CAAC8H,aAAa,CAAC;UAClB3C,OAAO;UACPG,QAAQ;UACRY,MAAM,EAAE,QAAQ;UAChB5D;SACD,CAAC,CACL,EACD3C,QAAQ,CAAC4I,YAAY,CAAC,MAAMtE,YAAY,EAAG3B,KAAK,IAC9CtC,KAAK,CAAC8H,aAAa,CAAC;UAClB3C,OAAO;UACPG,QAAQ;UACRY,MAAM,EAAE,QAAQ;UAChB5D;SACD,CAAC,CAAC,CACN;;;AAGP,CAAC,CAAC"}
|
package/internal/runtime.js
CHANGED
|
@@ -12,7 +12,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
12
12
|
/** @internal */
|
|
13
13
|
const runMain = (effect, teardown = _Runtime.defaultTeardown) => {
|
|
14
14
|
const fiber = Effect.runFork(effect);
|
|
15
|
-
fiber.
|
|
15
|
+
fiber.addObserver(exit => teardown(exit, code => {
|
|
16
16
|
Effect.runCallback(interruptAll(fiber.id()), () => {
|
|
17
17
|
process.exit(code);
|
|
18
18
|
});
|
package/internal/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","names":["Effect","_interopRequireWildcard","require","Fiber","_Runtime","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","runMain","effect","teardown","defaultTeardown","fiber","runFork","
|
|
1
|
+
{"version":3,"file":"runtime.js","names":["Effect","_interopRequireWildcard","require","Fiber","_Runtime","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","runMain","effect","teardown","defaultTeardown","fiber","runFork","addObserver","exit","code","runCallback","interruptAll","id","process","onSigint","removeListener","interruptAsFork","once","exports","flatMap","roots","length","unit","interruptAllAs"],"sources":["../src/internal/runtime.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,MAAA,gBAAAC,uBAAA,eAAAC,OAAA;AACA,IAAAC,KAAA,gBAAAF,uBAAA,eAAAC,OAAA;AAEA,IAAAE,QAAA,gBAAAF,OAAA;AAAwE,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA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AC,CACH;EAED,SAASK,QAAQA,CAAA;IACfD,OAAO,CAACE,cAAc,CAAC,QAAQ,EAAED,QAAQ,CAAC;IAC1CD,OAAO,CAACE,cAAc,CAAC,SAAS,EAAED,QAAQ,CAAC;IAC3CxC,MAAM,CAACgC,OAAO,CAACD,KAAK,CAACW,eAAe,CAACX,KAAK,CAACO,EAAE,EAAE,CAAC,CAAC;EACnD;EAEAC,OAAO,CAACI,IAAI,CAAC,QAAQ,EAAEH,QAAQ,CAAC;EAChCD,OAAO,CAACI,IAAI,CAAC,SAAS,EAAEH,QAAQ,CAAC;AACnC,CAAC;AAAAI,OAAA,CAAAjB,OAAA,GAAAA,OAAA;AAED,MAAMU,YAAY,GAAIC,EAAmB,IACvCtC,MAAM,CAAC6C,OAAO,CAAC1C,KAAK,CAAC2C,KAAK,EAAGA,KAAK,IAAI;EACpC,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACtB,OAAO/C,MAAM,CAACgD,IAAI;;EAGpB,OAAO7C,KAAK,CAAC8C,cAAc,CAACH,KAAK,EAAER,EAAE,CAAC;AACxC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as internal from "@effect/platform-node/internal/http/platform";
|
|
2
|
+
/**
|
|
3
|
+
* @since 1.0.0
|
|
4
|
+
*/
|
|
5
|
+
export * from "@effect/platform/Http/Platform";
|
|
6
|
+
/**
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
* @category constructors
|
|
9
|
+
*/
|
|
10
|
+
export const make = internal.make;
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category layers
|
|
14
|
+
*/
|
|
15
|
+
export const layer = internal.layer;
|
|
16
|
+
//# sourceMappingURL=Platform.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Platform.mjs","names":["internal","make","layer"],"sources":["../../src/Http/Platform.ts"],"sourcesContent":[null],"mappings":"AAOA,OAAO,KAAKA,QAAQ,MAAM,8CAA8C;AAKxE;;;AAGA,cAAc,gCAAgC;AAE9C;;;;AAIA,OAAO,MAAMC,IAAI,GAAoFD,QAAQ,CAACC,IAAI;AAElH;;;;AAIA,OAAO,MAAMC,KAAK,GAAiDF,QAAQ,CAACE,KAAK"}
|
package/mjs/Http/Server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Server.mjs","names":["internal","make","layer","layerConfig"],"sources":["../../src/Http/Server.ts"],"sourcesContent":[null],"mappings":"AAWA,OAAO,KAAKA,QAAQ,MAAM,4CAA4C;AAMtE;;;AAGA,cAAc,8BAA8B;AAE5C;;;;AAIA,OAAO,MAAMC,IAAI,GAGuCD,QAAQ,CAACC,IAAI;AAErE;;;;AAIA,OAAO,MAAMC,KAAK,
|
|
1
|
+
{"version":3,"file":"Server.mjs","names":["internal","make","layer","layerConfig"],"sources":["../../src/Http/Server.ts"],"sourcesContent":[null],"mappings":"AAWA,OAAO,KAAKA,QAAQ,MAAM,4CAA4C;AAMtE;;;AAGA,cAAc,8BAA8B;AAE5C;;;;AAIA,OAAO,MAAMC,IAAI,GAGuCD,QAAQ,CAACC,IAAI;AAErE;;;;AAIA,OAAO,MAAMC,KAAK,GAGkDF,QAAQ,CAACE,KAAK;AAElF;;;;AAIA,OAAO,MAAMC,WAAW,GAG8DH,QAAQ,CAACG,WAAW"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as Layer from "@effect/io/Layer";
|
|
2
|
+
import * as FileSystem from "@effect/platform-node/FileSystem";
|
|
3
|
+
import * as Etag from "@effect/platform-node/Http/Etag";
|
|
4
|
+
import * as Platform from "@effect/platform/Http/Platform";
|
|
5
|
+
import * as ServerResponse from "@effect/platform/Http/ServerResponse";
|
|
6
|
+
import * as Mime from "mime";
|
|
7
|
+
import * as Fs from "node:fs";
|
|
8
|
+
import { Readable } from "node:stream";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const make = /*#__PURE__*/Platform.make({
|
|
11
|
+
fileResponse(path, status, statusText, headers, start, end, contentLength) {
|
|
12
|
+
const stream = Fs.createReadStream(path, {
|
|
13
|
+
start,
|
|
14
|
+
end
|
|
15
|
+
});
|
|
16
|
+
return ServerResponse.raw(stream, {
|
|
17
|
+
headers: {
|
|
18
|
+
...headers,
|
|
19
|
+
"content-type": headers["content-type"] ?? Mime.getType(path) ?? "application/octet-stream",
|
|
20
|
+
"content-length": contentLength.toString()
|
|
21
|
+
},
|
|
22
|
+
status,
|
|
23
|
+
statusText
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
fileWebResponse(file, status, statusText, headers, _options) {
|
|
27
|
+
return ServerResponse.raw(Readable.fromWeb(file.stream()), {
|
|
28
|
+
headers: {
|
|
29
|
+
...headers,
|
|
30
|
+
"content-type": headers["content-type"] ?? Mime.getType(file.name) ?? "application/octet-stream",
|
|
31
|
+
"content-length": file.size.toString()
|
|
32
|
+
},
|
|
33
|
+
status,
|
|
34
|
+
statusText
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const layer = /*#__PURE__*/Layer.use(Etag.layer)( /*#__PURE__*/Layer.use(FileSystem.layer)( /*#__PURE__*/Layer.effect(Platform.Platform, make)));
|
|
40
|
+
//# sourceMappingURL=platform.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.mjs","names":["Layer","FileSystem","Etag","Platform","ServerResponse","Mime","Fs","Readable","make","fileResponse","path","status","statusText","headers","start","end","contentLength","stream","createReadStream","raw","getType","toString","fileWebResponse","file","_options","fromWeb","name","size","layer","use","effect"],"sources":["../../../src/internal/http/platform.ts"],"sourcesContent":[null],"mappings":"AACA,OAAO,KAAKA,KAAK,MAAM,kBAAkB;AACzC,OAAO,KAAKC,UAAU,MAAM,kCAAkC;AAC9D,OAAO,KAAKC,IAAI,MAAM,iCAAiC;AACvD,OAAO,KAAKC,QAAQ,MAAM,gCAAgC;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AAC,eADrB5B,KAAK,CAAC6B,GAAG,CAAC5B,UAAU,CAAC2B,KAAK,CAAC,eAD3B5B,KAAK,CAAC8B,MAAM,CAAC3B,QAAQ,CAACA,QAAQ,EAAEK,IAAI,CAAC,EAGtC"}
|
|
@@ -4,9 +4,9 @@ import * as Effect from "@effect/io/Effect";
|
|
|
4
4
|
import * as Fiber from "@effect/io/Fiber";
|
|
5
5
|
import * as Layer from "@effect/io/Layer";
|
|
6
6
|
import * as Runtime from "@effect/io/Runtime";
|
|
7
|
-
import * as internalEtag from "@effect/platform-node/internal/http/etag";
|
|
8
7
|
import * as internalFormData from "@effect/platform-node/internal/http/formData";
|
|
9
8
|
import { IncomingMessageImpl } from "@effect/platform-node/internal/http/incomingMessage";
|
|
9
|
+
import * as internalPlatform from "@effect/platform-node/internal/http/platform";
|
|
10
10
|
import * as NodeSink from "@effect/platform-node/Sink";
|
|
11
11
|
import * as FileSystem from "@effect/platform/FileSystem";
|
|
12
12
|
import * as IncomingMessage from "@effect/platform/Http/IncomingMessage";
|
|
@@ -16,6 +16,7 @@ import * as Error from "@effect/platform/Http/ServerError";
|
|
|
16
16
|
import * as ServerRequest from "@effect/platform/Http/ServerRequest";
|
|
17
17
|
import * as Stream from "@effect/stream/Stream";
|
|
18
18
|
import { Readable } from "node:stream";
|
|
19
|
+
import { pipeline } from "node:stream/promises";
|
|
19
20
|
/** @internal */
|
|
20
21
|
export const make = (evaluate, options) => Effect.gen(function* (_) {
|
|
21
22
|
const server = evaluate();
|
|
@@ -132,12 +133,18 @@ class ServerRequestImpl extends IncomingMessageImpl {
|
|
|
132
133
|
}
|
|
133
134
|
ServerRequest.TypeId;
|
|
134
135
|
/** @internal */
|
|
135
|
-
export const layer = (evaluate, options) => Layer.merge(Layer.scoped(Server.Server, make(evaluate, options)),
|
|
136
|
+
export const layer = (evaluate, options) => Layer.merge(Layer.scoped(Server.Server, make(evaluate, options)), internalPlatform.layer);
|
|
136
137
|
/** @internal */
|
|
137
|
-
export const layerConfig = (evaluate, options) => Layer.merge(Layer.scoped(Server.Server, Effect.flatMap(Effect.config(Config.unwrap(options)), options => make(evaluate, options))),
|
|
138
|
+
export const layerConfig = (evaluate, options) => Layer.merge(Layer.scoped(Server.Server, Effect.flatMap(Effect.config(Config.unwrap(options)), options => make(evaluate, options))), internalPlatform.layer);
|
|
138
139
|
const handleResponse = (request, response) => Effect.suspend(() => {
|
|
139
140
|
const nodeResponse = request.response;
|
|
140
|
-
|
|
141
|
+
if (request.method === "HEAD") {
|
|
142
|
+
nodeResponse.writeHead(response.status, response.headers);
|
|
143
|
+
nodeResponse.end();
|
|
144
|
+
return Effect.unit;
|
|
145
|
+
}
|
|
146
|
+
const body = response.body;
|
|
147
|
+
switch (body._tag) {
|
|
141
148
|
case "Empty":
|
|
142
149
|
{
|
|
143
150
|
nodeResponse.writeHead(response.status, response.headers);
|
|
@@ -145,15 +152,33 @@ const handleResponse = (request, response) => Effect.suspend(() => {
|
|
|
145
152
|
return Effect.unit;
|
|
146
153
|
}
|
|
147
154
|
case "Raw":
|
|
155
|
+
{
|
|
156
|
+
nodeResponse.writeHead(response.status, response.headers);
|
|
157
|
+
if (typeof body.body === "object" && body.body !== null && "pipe" in body.body && typeof body.body.pipe === "function") {
|
|
158
|
+
return Effect.tryPromise({
|
|
159
|
+
try: signal => pipeline(body.body, nodeResponse, {
|
|
160
|
+
signal,
|
|
161
|
+
end: true
|
|
162
|
+
}),
|
|
163
|
+
catch: error => Error.ResponseError({
|
|
164
|
+
request,
|
|
165
|
+
response,
|
|
166
|
+
reason: "Decode",
|
|
167
|
+
error
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
nodeResponse.end(body.body);
|
|
172
|
+
return Effect.unit;
|
|
173
|
+
}
|
|
148
174
|
case "Uint8Array":
|
|
149
175
|
{
|
|
150
176
|
nodeResponse.writeHead(response.status, response.headers);
|
|
151
|
-
nodeResponse.end(
|
|
177
|
+
nodeResponse.end(body.body);
|
|
152
178
|
return Effect.unit;
|
|
153
179
|
}
|
|
154
180
|
case "FormData":
|
|
155
181
|
{
|
|
156
|
-
const body = response.body;
|
|
157
182
|
return Effect.async(resume => {
|
|
158
183
|
const r = new Response(body.formData);
|
|
159
184
|
const headers = {
|
|
@@ -176,7 +201,7 @@ const handleResponse = (request, response) => Effect.suspend(() => {
|
|
|
176
201
|
case "Stream":
|
|
177
202
|
{
|
|
178
203
|
nodeResponse.writeHead(response.status, response.headers);
|
|
179
|
-
return Stream.run(Stream.mapError(
|
|
204
|
+
return Stream.run(Stream.mapError(body.stream, error => Error.ResponseError({
|
|
180
205
|
request,
|
|
181
206
|
response,
|
|
182
207
|
reason: "Decode",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","names":["Option","Config","Effect","Fiber","Layer","Runtime","
|
|
1
|
+
{"version":3,"file":"server.mjs","names":["Option","Config","Effect","Fiber","Layer","Runtime","internalFormData","IncomingMessageImpl","internalPlatform","NodeSink","FileSystem","IncomingMessage","Middleware","Server","Error","ServerRequest","Stream","Readable","pipeline","make","evaluate","options","gen","_","server","serverFiber","addFinalizer","async","resume","close","error","die","unit","zipRight","on","fail","ServeError","scoped","forkScoped","listen","address","_tag","path","hostname","port","serve","httpApp","middleware","handledApp","respond","flatMap","all","runtime","fiberId","runFork","handler","nodeRequest","nodeResponse","fiber","provideService","ServerRequestImpl","writableEnded","interruptAsFork","acquireRelease","sync","off","join","discard","concurrency","pipe","locally","maxBodySize","some","Size","request","tapErrorCause","tap","response","handleResponse","_cause","headersSent","writeHead","end","constructor","source","url","headersOverride","RequestError","reason","TypeId","originalUrl","method","headers","formData","formDataEffect","runSync","cached","formDataStream","stream","setUrl","replaceHeaders","toString","toJSON","layer","merge","layerConfig","config","unwrap","suspend","status","body","tryPromise","try","signal","catch","ResponseError","r","Response","Object","fromEntries","fromWeb","once","run","mapError","fromWritable"],"sources":["../../../src/internal/http/server.ts"],"sourcesContent":[null],"mappings":"AACA,OAAO,KAAKA,M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AC,CAClBvB,EAAE,CAAC,OAAO,EAAGJ,KAAK,IAAI;YACrBF,MAAM,CAAC1B,MAAM,CAACiC,IAAI,CAACrB,KAAK,CAACqG,aAAa,CAAC;cACrCzC,OAAO;cACPG,QAAQ;cACRW,MAAM,EAAE,QAAQ;cAChB1D;aACD,CAAC,CAAC,CAAC;UACN,CAAC,CAAC,CACD2F,IAAI,CAAC,QAAQ,EAAE,MAAK;YACnB7F,MAAM,CAAC1B,MAAM,CAAC8B,IAAI,CAAC;UACrB,CAAC,CAAC;QACN,CAAC,CAAC;;IAEJ,KAAK,QAAQ;MAAE;QACbyB,YAAY,CAACwB,SAAS,CAACJ,QAAQ,CAACgC,MAAM,EAAEhC,QAAQ,CAACe,OAAO,CAAC;QACzD,OAAO5E,MAAM,CAAC0G,GAAG,CACf1G,MAAM,CAAC2G,QAAQ,CACbb,IAAI,CAACZ,MAAM,EACVpE,KAAK,IACJhB,KAAK,CAACqG,aAAa,CAAC;UAClBzC,OAAO;UACPG,QAAQ;UACRW,MAAM,EAAE,QAAQ;UAChB1D;SACD,CAAC,CACL,EACDrB,QAAQ,CAACmH,YAAY,CAAC,MAAMnE,YAAY,EAAG3B,KAAK,IAC9ChB,KAAK,CAACqG,aAAa,CAAC;UAClBzC,OAAO;UACPG,QAAQ;UACRW,MAAM,EAAE,QAAQ;UAChB1D;SACD,CAAC,CAAC,CACN;;;AAGP,CAAC,CAAC"}
|
package/mjs/internal/runtime.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { defaultTeardown } from "@effect/platform/Runtime";
|
|
|
4
4
|
/** @internal */
|
|
5
5
|
export const runMain = (effect, teardown = defaultTeardown) => {
|
|
6
6
|
const fiber = Effect.runFork(effect);
|
|
7
|
-
fiber.
|
|
7
|
+
fiber.addObserver(exit => teardown(exit, code => {
|
|
8
8
|
Effect.runCallback(interruptAll(fiber.id()), () => {
|
|
9
9
|
process.exit(code);
|
|
10
10
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":["Effect","Fiber","defaultTeardown","runMain","effect","teardown","fiber","runFork","
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":["Effect","Fiber","defaultTeardown","runMain","effect","teardown","fiber","runFork","addObserver","exit","code","runCallback","interruptAll","id","process","onSigint","removeListener","interruptAsFork","once","flatMap","roots","length","unit","interruptAllAs"],"sources":["../../src/internal/runtime.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,MAAM,MAAM,mBAAmB;AAC3C,OAAO,KAAKC,KAAK,MAAM,kBAAkB;AAEzC,SAASC,eAAe,QAAsB,0BAA0B;AAExE;AACA,OAAO,MAAMC,OAAO,GAAYA,CAC9BC,MAAkC,EAClCC,QAAQ,GAAGH,eAAe,KACxB;EACF,MAAMI,KAAK,GAAGN,MAAM,CAACO,OAAO,CAACH,MAAM,CAAC;EAEpCE,KAAK,CAACE,WAAW,CAAEC,IAAI,IACrBJ,QAAQ,CAACI,IAAI,EAAGC,IAAI,IAAI;IACtBV,MAAM,CAACW,WAAW,CAACC,YAAY,CAACN,KAAK,CAACO,EAAE,EAAE,CAAC,EAAE,MAAK;MAChDC,OAAO,CAACL,IAAI,CAACC,IAAI,CAAC;IACpB,CAAC,CAAC;EACJ,CAAC,CAAC,CACH;EAED,SAASK,QAAQA,CAAA;IACfD,OAAO,CAACE,cAAc,CAAC,QAAQ,EAAED,QAAQ,CAAC;IAC1CD,OAAO,CAACE,cAAc,CAAC,SAAS,EAAED,QAAQ,CAAC;IAC3Cf,MAAM,CAACO,OAAO,CAACD,KAAK,CAACW,eAAe,CAACX,KAAK,CAACO,EAAE,EAAE,CAAC,CAAC;EACnD;EAEAC,OAAO,CAACI,IAAI,CAAC,QAAQ,EAAEH,QAAQ,CAAC;EAChCD,OAAO,CAACI,IAAI,CAAC,SAAS,EAAEH,QAAQ,CAAC;AACnC,CAAC;AAED,MAAMH,YAAY,GAAIC,EAAmB,IACvCb,MAAM,CAACmB,OAAO,CAAClB,KAAK,CAACmB,KAAK,EAAGA,KAAK,IAAI;EACpC,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACtB,OAAOrB,MAAM,CAACsB,IAAI;;EAGpB,OAAOrB,KAAK,CAACsB,cAAc,CAACH,KAAK,EAAEP,EAAE,CAAC;AACxC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/platform-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Unified interfaces for common platform-specific services",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,12 +25,13 @@
|
|
|
25
25
|
"sideEffects": [],
|
|
26
26
|
"author": "Effect contributors",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"busboy": "^1.6.0"
|
|
28
|
+
"busboy": "^1.6.0",
|
|
29
|
+
"mime": "^3.0.0"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {
|
|
31
|
-
"@effect/data": "^0.18.
|
|
32
|
-
"@effect/io": "^0.
|
|
33
|
-
"@effect/stream": "^0.
|
|
34
|
-
"@effect/platform": "^0.
|
|
32
|
+
"@effect/data": "^0.18.4",
|
|
33
|
+
"@effect/io": "^0.40.0",
|
|
34
|
+
"@effect/stream": "^0.36.0",
|
|
35
|
+
"@effect/platform": "^0.15.0"
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*
|
|
4
|
+
* Also includes exports from [`@effect/platform/Http/Platform`](https://effect-ts.github.io/platform/platform/Http/Platform.ts.html).
|
|
5
|
+
*/
|
|
6
|
+
import type * as Effect from "@effect/io/Effect"
|
|
7
|
+
import type * as Layer from "@effect/io/Layer"
|
|
8
|
+
import * as internal from "@effect/platform-node/internal/http/platform"
|
|
9
|
+
import type * as FileSystem from "@effect/platform/FileSystem"
|
|
10
|
+
import type * as Etag from "@effect/platform/Http/Etag"
|
|
11
|
+
import type * as Platform from "@effect/platform/Http/Platform"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
*/
|
|
16
|
+
export * from "@effect/platform/Http/Platform"
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @since 1.0.0
|
|
20
|
+
* @category constructors
|
|
21
|
+
*/
|
|
22
|
+
export const make: Effect.Effect<FileSystem.FileSystem | Etag.Generator, never, Platform.Platform> = internal.make
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @since 1.0.0
|
|
26
|
+
* @category layers
|
|
27
|
+
*/
|
|
28
|
+
export const layer: Layer.Layer<never, never, Platform.Platform> = internal.layer
|
package/src/Http/Server.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type * as Effect from "@effect/io/Effect"
|
|
|
10
10
|
import type * as Layer from "@effect/io/Layer"
|
|
11
11
|
import type * as Scope from "@effect/io/Scope"
|
|
12
12
|
import * as internal from "@effect/platform-node/internal/http/server"
|
|
13
|
-
import type * as
|
|
13
|
+
import type * as Platform from "@effect/platform/Http/Platform"
|
|
14
14
|
import type * as Server from "@effect/platform/Http/Server"
|
|
15
15
|
import type * as Http from "node:http"
|
|
16
16
|
import type * as Net from "node:net"
|
|
@@ -34,15 +34,15 @@ export const make: (
|
|
|
34
34
|
* @category layers
|
|
35
35
|
*/
|
|
36
36
|
export const layer: (
|
|
37
|
-
evaluate: LazyArg<Http.Server
|
|
37
|
+
evaluate: LazyArg<Http.Server<typeof Http.IncomingMessage, typeof Http.ServerResponse>>,
|
|
38
38
|
options: Net.ListenOptions
|
|
39
|
-
) => Layer.Layer<never, never, Server.Server |
|
|
39
|
+
) => Layer.Layer<never, never, Server.Server | Platform.Platform> = internal.layer
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* @since 1.0.0
|
|
43
43
|
* @category layers
|
|
44
44
|
*/
|
|
45
45
|
export const layerConfig: (
|
|
46
|
-
evaluate: LazyArg<Http.Server
|
|
46
|
+
evaluate: LazyArg<Http.Server<typeof Http.IncomingMessage, typeof Http.ServerResponse>>,
|
|
47
47
|
options: Config.Config.Wrap<Net.ListenOptions>
|
|
48
|
-
) => Layer.Layer<never, ConfigError.ConfigError, Server.Server |
|
|
48
|
+
) => Layer.Layer<never, ConfigError.ConfigError, Server.Server | Platform.Platform> = internal.layerConfig
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { pipe } from "@effect/data/Function"
|
|
2
|
+
import * as Layer from "@effect/io/Layer"
|
|
3
|
+
import * as FileSystem from "@effect/platform-node/FileSystem"
|
|
4
|
+
import * as Etag from "@effect/platform-node/Http/Etag"
|
|
5
|
+
import * as Platform from "@effect/platform/Http/Platform"
|
|
6
|
+
import * as ServerResponse from "@effect/platform/Http/ServerResponse"
|
|
7
|
+
import * as Mime from "mime"
|
|
8
|
+
import * as Fs from "node:fs"
|
|
9
|
+
import { Readable } from "node:stream"
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const make = Platform.make({
|
|
13
|
+
fileResponse(path, status, statusText, headers, start, end, contentLength) {
|
|
14
|
+
const stream = Fs.createReadStream(path, { start, end })
|
|
15
|
+
return ServerResponse.raw(stream, {
|
|
16
|
+
headers: {
|
|
17
|
+
...headers,
|
|
18
|
+
"content-type": headers["content-type"] ?? Mime.getType(path) ?? "application/octet-stream",
|
|
19
|
+
"content-length": contentLength.toString()
|
|
20
|
+
},
|
|
21
|
+
status,
|
|
22
|
+
statusText
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
fileWebResponse(file, status, statusText, headers, _options) {
|
|
26
|
+
return ServerResponse.raw(Readable.fromWeb(file.stream() as any), {
|
|
27
|
+
headers: {
|
|
28
|
+
...headers,
|
|
29
|
+
"content-type": headers["content-type"] ?? Mime.getType(file.name) ?? "application/octet-stream",
|
|
30
|
+
"content-length": file.size.toString()
|
|
31
|
+
},
|
|
32
|
+
status,
|
|
33
|
+
statusText
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const layer = pipe(
|
|
40
|
+
Layer.effect(Platform.Platform, make),
|
|
41
|
+
Layer.use(FileSystem.layer),
|
|
42
|
+
Layer.use(Etag.layer)
|
|
43
|
+
)
|
|
@@ -6,9 +6,9 @@ import * as Fiber from "@effect/io/Fiber"
|
|
|
6
6
|
import * as Layer from "@effect/io/Layer"
|
|
7
7
|
import * as Runtime from "@effect/io/Runtime"
|
|
8
8
|
import type * as Scope from "@effect/io/Scope"
|
|
9
|
-
import * as internalEtag from "@effect/platform-node/internal/http/etag"
|
|
10
9
|
import * as internalFormData from "@effect/platform-node/internal/http/formData"
|
|
11
10
|
import { IncomingMessageImpl } from "@effect/platform-node/internal/http/incomingMessage"
|
|
11
|
+
import * as internalPlatform from "@effect/platform-node/internal/http/platform"
|
|
12
12
|
import * as NodeSink from "@effect/platform-node/Sink"
|
|
13
13
|
import * as FileSystem from "@effect/platform/FileSystem"
|
|
14
14
|
import type * as FormData from "@effect/platform/Http/FormData"
|
|
@@ -25,6 +25,7 @@ import * as Stream from "@effect/stream/Stream"
|
|
|
25
25
|
import type * as Http from "node:http"
|
|
26
26
|
import type * as Net from "node:net"
|
|
27
27
|
import { Readable } from "node:stream"
|
|
28
|
+
import { pipeline } from "node:stream/promises"
|
|
28
29
|
|
|
29
30
|
/** @internal */
|
|
30
31
|
export const make = (
|
|
@@ -224,7 +225,7 @@ export const layer = (
|
|
|
224
225
|
) =>
|
|
225
226
|
Layer.merge(
|
|
226
227
|
Layer.scoped(Server.Server, make(evaluate, options)),
|
|
227
|
-
|
|
228
|
+
internalPlatform.layer
|
|
228
229
|
)
|
|
229
230
|
|
|
230
231
|
/** @internal */
|
|
@@ -240,26 +241,50 @@ export const layerConfig = (
|
|
|
240
241
|
(options) => make(evaluate, options)
|
|
241
242
|
)
|
|
242
243
|
),
|
|
243
|
-
|
|
244
|
+
internalPlatform.layer
|
|
244
245
|
)
|
|
245
246
|
|
|
246
247
|
const handleResponse = (request: ServerRequest.ServerRequest, response: ServerResponse.ServerResponse) =>
|
|
247
248
|
Effect.suspend((): Effect.Effect<never, Error.ResponseError, void> => {
|
|
248
249
|
const nodeResponse = (request as ServerRequestImpl).response
|
|
249
|
-
|
|
250
|
+
if (request.method === "HEAD") {
|
|
251
|
+
nodeResponse.writeHead(response.status, response.headers)
|
|
252
|
+
nodeResponse.end()
|
|
253
|
+
return Effect.unit
|
|
254
|
+
}
|
|
255
|
+
const body = response.body
|
|
256
|
+
switch (body._tag) {
|
|
250
257
|
case "Empty": {
|
|
251
258
|
nodeResponse.writeHead(response.status, response.headers)
|
|
252
259
|
nodeResponse.end()
|
|
253
260
|
return Effect.unit
|
|
254
261
|
}
|
|
255
|
-
case "Raw":
|
|
262
|
+
case "Raw": {
|
|
263
|
+
nodeResponse.writeHead(response.status, response.headers)
|
|
264
|
+
if (
|
|
265
|
+
typeof body.body === "object" && body.body !== null && "pipe" in body.body &&
|
|
266
|
+
typeof body.body.pipe === "function"
|
|
267
|
+
) {
|
|
268
|
+
return Effect.tryPromise({
|
|
269
|
+
try: (signal) => pipeline(body.body as any, nodeResponse, { signal, end: true }),
|
|
270
|
+
catch: (error) =>
|
|
271
|
+
Error.ResponseError({
|
|
272
|
+
request,
|
|
273
|
+
response,
|
|
274
|
+
reason: "Decode",
|
|
275
|
+
error
|
|
276
|
+
})
|
|
277
|
+
})
|
|
278
|
+
}
|
|
279
|
+
nodeResponse.end(body.body)
|
|
280
|
+
return Effect.unit
|
|
281
|
+
}
|
|
256
282
|
case "Uint8Array": {
|
|
257
283
|
nodeResponse.writeHead(response.status, response.headers)
|
|
258
|
-
nodeResponse.end(
|
|
284
|
+
nodeResponse.end(body.body)
|
|
259
285
|
return Effect.unit
|
|
260
286
|
}
|
|
261
287
|
case "FormData": {
|
|
262
|
-
const body = response.body
|
|
263
288
|
return Effect.async<never, Error.ResponseError, void>((resume) => {
|
|
264
289
|
const r = new Response(body.formData)
|
|
265
290
|
const headers = {
|
|
@@ -286,7 +311,7 @@ const handleResponse = (request: ServerRequest.ServerRequest, response: ServerRe
|
|
|
286
311
|
nodeResponse.writeHead(response.status, response.headers)
|
|
287
312
|
return Stream.run(
|
|
288
313
|
Stream.mapError(
|
|
289
|
-
|
|
314
|
+
body.stream,
|
|
290
315
|
(error) =>
|
|
291
316
|
Error.ResponseError({
|
|
292
317
|
request,
|
package/src/internal/runtime.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const runMain: RunMain = <E, A>(
|
|
|
10
10
|
) => {
|
|
11
11
|
const fiber = Effect.runFork(effect)
|
|
12
12
|
|
|
13
|
-
fiber.
|
|
13
|
+
fiber.addObserver((exit) =>
|
|
14
14
|
teardown(exit, (code) => {
|
|
15
15
|
Effect.runCallback(interruptAll(fiber.id()), () => {
|
|
16
16
|
process.exit(code)
|
|
@@ -21,7 +21,6 @@ export const runMain: RunMain = <E, A>(
|
|
|
21
21
|
function onSigint() {
|
|
22
22
|
process.removeListener("SIGINT", onSigint)
|
|
23
23
|
process.removeListener("SIGTERM", onSigint)
|
|
24
|
-
|
|
25
24
|
Effect.runFork(fiber.interruptAsFork(fiber.id()))
|
|
26
25
|
}
|
|
27
26
|
|