@effect/platform 0.18.4 → 0.18.5
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/Command/dist/effect-platform-Command.esm.js +12 -200
- package/CommandExecutor/dist/effect-platform-CommandExecutor.esm.js +9 -71
- package/Effectify/dist/effect-platform-Effectify.esm.js +2 -23
- package/Error/dist/effect-platform-Error.esm.js +2 -54
- package/FileSystem/dist/effect-platform-FileSystem.esm.js +10 -177
- package/Http/Body/dist/effect-platform-Http-Body.esm.js +13 -151
- package/Http/Client/dist/effect-platform-Http-Client.esm.js +28 -164
- package/Http/ClientError/dist/effect-platform-Http-ClientError.esm.js +3 -48
- package/Http/ClientRequest/dist/effect-platform-Http-ClientRequest.esm.js +20 -241
- package/Http/ClientResponse/dist/effect-platform-Http-ClientResponse.esm.js +22 -35
- package/Http/Etag/dist/effect-platform-Http-Etag.esm.js +17 -1
- package/Http/FormData/dist/effect-platform-Http-FormData.esm.js +17 -155
- package/Http/Headers/dist/effect-platform-Http-Headers.esm.js +4 -74
- package/Http/IncomingMessage/dist/effect-platform-Http-IncomingMessage.esm.js +6 -1
- package/Http/Middleware/dist/effect-platform-Http-Middleware.esm.js +30 -52
- package/Http/Platform/dist/effect-platform-Http-Platform.esm.js +56 -1
- package/Http/Router/dist/effect-platform-Http-Router.esm.js +25 -224
- package/Http/Server/dist/effect-platform-Http-Server.esm.js +18 -1
- package/Http/ServerError/dist/effect-platform-Http-ServerError.esm.js +2 -70
- package/Http/ServerRequest/dist/effect-platform-Http-ServerRequest.esm.js +20 -65
- package/Http/ServerResponse/dist/effect-platform-Http-ServerResponse.esm.js +21 -126
- package/Http/UrlParams/dist/effect-platform-Http-UrlParams.esm.js +4 -101
- package/HttpClient/dist/effect-platform-HttpClient.esm.js +32 -18
- package/HttpServer/dist/effect-platform-HttpServer.esm.js +36 -24
- package/KeyValueStore/dist/effect-platform-KeyValueStore.esm.js +15 -78
- package/Path/dist/effect-platform-Path.esm.js +8 -33
- package/Runtime/dist/effect-platform-Runtime.esm.js +3 -26
- package/dist/App-687366d8.esm.js +5 -0
- package/dist/Body-ec1353f9.esm.js +170 -0
- package/dist/Client-52ebd74a.esm.js +346 -0
- package/dist/ClientError-98b5da8c.esm.js +55 -0
- package/dist/ClientRequest-fc429335.esm.js +281 -0
- package/dist/ClientResponse-9f276554.esm.js +46 -0
- package/dist/Command-d8ab0c8d.esm.js +403 -0
- package/dist/CommandExecutor-5807b66b.esm.js +80 -0
- package/dist/Effectify-e5a9d266.esm.js +43 -0
- package/dist/Error-3099667c.esm.js +75 -0
- package/dist/FileSystem-7e31dccd.esm.js +271 -0
- package/dist/FormData-f54de878.esm.js +270 -0
- package/dist/Headers-58b56a08.esm.js +85 -0
- package/dist/HttpClient-27710864.esm.js +24 -0
- package/dist/HttpServer-e1d88a1c.esm.js +30 -0
- package/{internal/keyValueStore.esm.js → dist/KeyValueStore-2f9a70bf.esm.js} +102 -15
- package/dist/Middleware-27760041.esm.js +105 -0
- package/{internal/path.esm.js → dist/Path-46f84ba7.esm.js} +40 -4
- package/dist/Router-bf32317a.esm.js +454 -0
- package/dist/Runtime-7265fb98.esm.js +31 -0
- package/dist/ServerError-04ad5b57.esm.js +99 -0
- package/dist/ServerRequest-03161edc.esm.js +125 -0
- package/dist/ServerResponse-675e9456.esm.js +249 -0
- package/dist/UrlParams-1286c728.esm.js +114 -0
- package/{internal/http/body.esm.js → dist/body-20d78ec1.esm.js} +2 -2
- package/{internal/http/clientError.esm.js → dist/clientError-c4e1466c.esm.js} +1 -1
- package/{internal/http/clientRequest.esm.js → dist/clientRequest-1e9e0b0d.esm.js} +4 -4
- package/{internal/http/clientResponse.esm.js → dist/clientResponse-ce25dbf3.esm.js} +5 -5
- package/{internal/commandExecutor.esm.js → dist/commandExecutor-d6457489.esm.js} +1 -1
- package/dist/effect-platform.esm.js +58 -20
- package/package.json +1 -2
- package/internal/command.esm.js +0 -185
- package/internal/effectify.esm.js +0 -18
- package/internal/error.esm.js +0 -17
- package/internal/fileSystem.esm.js +0 -82
- package/internal/http/client.esm.js +0 -157
- package/internal/http/etag.esm.js +0 -19
- package/internal/http/formData.esm.js +0 -95
- package/internal/http/middleware.esm.js +0 -46
- package/internal/http/platform.esm.js +0 -52
- package/internal/http/router.esm.js +0 -199
- package/internal/http/server.esm.js +0 -20
- package/internal/http/serverError.esm.js +0 -23
- package/internal/http/serverRequest.esm.js +0 -50
- package/internal/http/serverResponse.esm.js +0 -105
|
@@ -1,36 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../dist/clientResponse-ce25dbf3.esm.js';
|
|
2
2
|
export { schemaBodyJson, schemaBodyUrlParams, schemaHeaders } from '../../IncomingMessage/dist/effect-platform-Http-IncomingMessage.esm.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @since 1.0.0
|
|
26
|
-
* @category constructors
|
|
27
|
-
*/
|
|
28
|
-
const fromWeb = fromWeb$1;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @since 1.0.0
|
|
32
|
-
* @category schema
|
|
33
|
-
*/
|
|
34
|
-
const schemaJson = schemaJson$1;
|
|
35
|
-
|
|
36
|
-
export { TypeId, fromWeb, schemaJson };
|
|
3
|
+
export { T as TypeId, f as fromWeb, s as schemaJson } from '../../../dist/ClientResponse-9f276554.esm.js';
|
|
4
|
+
import '@effect/schema/Schema';
|
|
5
|
+
import 'effect/Effect';
|
|
6
|
+
import 'effect/Option';
|
|
7
|
+
import 'effect/Stream';
|
|
8
|
+
import '../../../dist/Headers-58b56a08.esm.js';
|
|
9
|
+
import 'effect/Function';
|
|
10
|
+
import 'effect/ReadonlyArray';
|
|
11
|
+
import 'effect/ReadonlyRecord';
|
|
12
|
+
import '../../../dist/UrlParams-1286c728.esm.js';
|
|
13
|
+
import 'effect/Chunk';
|
|
14
|
+
import '../../../dist/clientError-c4e1466c.esm.js';
|
|
15
|
+
import 'effect/Data';
|
|
16
|
+
import '@effect/schema/ParseResult';
|
|
17
|
+
import 'effect/Context';
|
|
18
|
+
import 'effect/FiberRef';
|
|
19
|
+
import 'effect/GlobalValue';
|
|
20
|
+
import '../../../dist/FileSystem-7e31dccd.esm.js';
|
|
21
|
+
import 'effect/Brand';
|
|
22
|
+
import 'effect/Sink';
|
|
23
|
+
import '../../../dist/Error-3099667c.esm.js';
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
|
|
3
|
+
/** @internal */
|
|
4
|
+
const GeneratorTypeId$1 = /*#__PURE__*/Symbol.for("@effect/platform/Http/Etag/Generator");
|
|
5
|
+
|
|
6
|
+
/** @internal */
|
|
7
|
+
const tag = /*#__PURE__*/Context.Tag(GeneratorTypeId$1);
|
|
8
|
+
|
|
9
|
+
/** @internal */
|
|
10
|
+
const toString$1 = self => {
|
|
11
|
+
switch (self._tag) {
|
|
12
|
+
case "Weak":
|
|
13
|
+
return `W/"${self.value}"`;
|
|
14
|
+
case "Strong":
|
|
15
|
+
return `"${self.value}"`;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
2
18
|
|
|
3
19
|
/**
|
|
4
20
|
* @since 1.0.0
|
|
@@ -1,155 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @since 1.0.0
|
|
20
|
-
* @category models
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @since 1.0.0
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @since 1.0.0
|
|
29
|
-
* @category models
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @since 1.0.0
|
|
34
|
-
* @category models
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @since 1.0.0
|
|
39
|
-
* @category type ids
|
|
40
|
-
*/
|
|
41
|
-
const ErrorTypeId = ErrorTypeId$1;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @since 1.0.0
|
|
45
|
-
* @category type ids
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @since 1.0.0
|
|
50
|
-
* @category errors
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @since 1.0.0
|
|
55
|
-
* @category errors
|
|
56
|
-
*/
|
|
57
|
-
const FormDataError = FormDataError$1;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @since 1.0.0
|
|
61
|
-
* @category fiber refs
|
|
62
|
-
*/
|
|
63
|
-
const maxParts = maxParts$1;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @since 1.0.0
|
|
67
|
-
* @category fiber refs
|
|
68
|
-
*/
|
|
69
|
-
const withMaxParts = withMaxParts$1;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @since 1.0.0
|
|
73
|
-
* @category fiber refs
|
|
74
|
-
*/
|
|
75
|
-
const maxFields = maxFields$1;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @since 1.0.0
|
|
79
|
-
* @category fiber refs
|
|
80
|
-
*/
|
|
81
|
-
const withMaxFields = withMaxFields$1;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @since 1.0.0
|
|
85
|
-
* @category fiber refs
|
|
86
|
-
*/
|
|
87
|
-
const maxFieldSize = maxFieldSize$1;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @since 1.0.0
|
|
91
|
-
* @category fiber refs
|
|
92
|
-
*/
|
|
93
|
-
const withMaxFieldSize = withMaxFieldSize$1;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @since 1.0.0
|
|
97
|
-
* @category fiber refs
|
|
98
|
-
*/
|
|
99
|
-
const maxFiles = maxFiles$1;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @since 1.0.0
|
|
103
|
-
* @category fiber refs
|
|
104
|
-
*/
|
|
105
|
-
const withMaxFiles = withMaxFiles$1;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* @since 1.0.0
|
|
109
|
-
* @category fiber refs
|
|
110
|
-
*/
|
|
111
|
-
const maxFileSize = maxFileSize$1;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* @since 1.0.0
|
|
115
|
-
* @category fiber refs
|
|
116
|
-
*/
|
|
117
|
-
const withMaxFileSize = withMaxFileSize$1;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* @since 1.0.0
|
|
121
|
-
* @category fiber refs
|
|
122
|
-
*/
|
|
123
|
-
const fieldMimeTypes = fieldMimeTypes$1;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @since 1.0.0
|
|
127
|
-
* @category fiber refs
|
|
128
|
-
*/
|
|
129
|
-
const withFieldMimeTypes = withFieldMimeTypes$1;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @since 1.0.0
|
|
133
|
-
* @category conversions
|
|
134
|
-
*/
|
|
135
|
-
const toRecord = toRecord$1;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* @since 1.0.0
|
|
139
|
-
* @category schema
|
|
140
|
-
*/
|
|
141
|
-
const filesSchema = filesSchema$1;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* @since 1.0.0
|
|
145
|
-
* @category schema
|
|
146
|
-
*/
|
|
147
|
-
const schemaJson = schemaJson$1;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* @since 1.0.0
|
|
151
|
-
* @category schema
|
|
152
|
-
*/
|
|
153
|
-
const schemaRecord = schemaRecord$1;
|
|
154
|
-
|
|
155
|
-
export { ErrorTypeId, FormDataError, TypeId, fieldMimeTypes, filesSchema, maxFieldSize, maxFields, maxFileSize, maxFiles, maxParts, schemaJson, schemaRecord, toRecord, withFieldMimeTypes, withMaxFieldSize, withMaxFields, withMaxFileSize, withMaxFiles, withMaxParts };
|
|
1
|
+
export { E as ErrorTypeId, b as FormDataError, T as TypeId, k as fieldMimeTypes, n as filesSchema, e as maxFieldSize, c as maxFields, i as maxFileSize, g as maxFiles, m as maxParts, a as schemaJson, s as schemaRecord, t as toRecord, l as withFieldMimeTypes, f as withMaxFieldSize, d as withMaxFields, j as withMaxFileSize, h as withMaxFiles, w as withMaxParts } from '../../../dist/FormData-f54de878.esm.js';
|
|
2
|
+
import '@effect/schema/Schema';
|
|
3
|
+
import 'effect/Chunk';
|
|
4
|
+
import 'effect/Data';
|
|
5
|
+
import 'effect/Effect';
|
|
6
|
+
import 'effect/FiberRef';
|
|
7
|
+
import 'effect/Function';
|
|
8
|
+
import 'effect/GlobalValue';
|
|
9
|
+
import 'effect/Option';
|
|
10
|
+
import 'effect/Predicate';
|
|
11
|
+
import 'effect/ReadonlyArray';
|
|
12
|
+
import '../../../dist/FileSystem-7e31dccd.esm.js';
|
|
13
|
+
import 'effect/Brand';
|
|
14
|
+
import 'effect/Context';
|
|
15
|
+
import 'effect/Sink';
|
|
16
|
+
import 'effect/Stream';
|
|
17
|
+
import '../../../dist/Error-3099667c.esm.js';
|
|
@@ -1,74 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @since 1.0.0
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @since 1.0.0
|
|
11
|
-
* @category models
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @since 1.0.0
|
|
16
|
-
* @category models
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @since 1.0.0
|
|
21
|
-
* @category constructors
|
|
22
|
-
*/
|
|
23
|
-
const empty = /*#__PURE__*/ReadonlyRecord.empty();
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @since 1.0.0
|
|
27
|
-
* @category constructors
|
|
28
|
-
*/
|
|
29
|
-
const fromInput = input => {
|
|
30
|
-
if (input === undefined) {
|
|
31
|
-
return empty;
|
|
32
|
-
} else if (Symbol.iterator in input) {
|
|
33
|
-
return ReadonlyRecord.fromEntries(ReadonlyArray.map(ReadonlyArray.fromIterable(input), ([k, v]) => [k.toLowerCase(), v]));
|
|
34
|
-
}
|
|
35
|
-
return ReadonlyRecord.fromEntries(Object.entries(input).map(([k, v]) => [k.toLowerCase(), v]));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @since 1.0.0
|
|
40
|
-
* @category combinators
|
|
41
|
-
*/
|
|
42
|
-
const has = /*#__PURE__*/dual(2, (self, key) => ReadonlyRecord.has(self, key.toLowerCase()));
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @since 1.0.0
|
|
46
|
-
* @category combinators
|
|
47
|
-
*/
|
|
48
|
-
const get = /*#__PURE__*/dual(2, (self, key) => ReadonlyRecord.get(self, key.toLowerCase()));
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @since 1.0.0
|
|
52
|
-
* @category combinators
|
|
53
|
-
*/
|
|
54
|
-
const set = /*#__PURE__*/dual(3, (self, key, value) => ({
|
|
55
|
-
...self,
|
|
56
|
-
[key.toLowerCase()]: value
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @since 1.0.0
|
|
61
|
-
* @category combinators
|
|
62
|
-
*/
|
|
63
|
-
const setAll = /*#__PURE__*/dual(2, (self, headers) => ({
|
|
64
|
-
...self,
|
|
65
|
-
...fromInput(headers)
|
|
66
|
-
}));
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @since 1.0.0
|
|
70
|
-
* @category combinators
|
|
71
|
-
*/
|
|
72
|
-
const remove = /*#__PURE__*/dual(2, (self, key) => ReadonlyRecord.remove(self, key.toLowerCase()));
|
|
73
|
-
|
|
74
|
-
export { empty, fromInput, get, has, remove, set, setAll };
|
|
1
|
+
import 'effect/Function';
|
|
2
|
+
import 'effect/ReadonlyArray';
|
|
3
|
+
import 'effect/ReadonlyRecord';
|
|
4
|
+
export { e as empty, f as fromInput, g as get, h as has, r as remove, s as set, a as setAll } from '../../../dist/Headers-58b56a08.esm.js';
|
|
@@ -6,7 +6,12 @@ import * as FiberRef from 'effect/FiberRef';
|
|
|
6
6
|
import { flow, dual } from 'effect/Function';
|
|
7
7
|
import * as Global from 'effect/GlobalValue';
|
|
8
8
|
import * as Option from 'effect/Option';
|
|
9
|
-
import { Size } from '
|
|
9
|
+
import { S as Size } from '../../../dist/FileSystem-7e31dccd.esm.js';
|
|
10
|
+
import 'effect/Brand';
|
|
11
|
+
import 'effect/Sink';
|
|
12
|
+
import 'effect/Stream';
|
|
13
|
+
import '../../../dist/Error-3099667c.esm.js';
|
|
14
|
+
import 'effect/Data';
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* @since 1.0.0
|
|
@@ -1,52 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*/
|
|
32
|
-
const logger = logger$1;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @since 1.0.0
|
|
36
|
-
* @category constructors
|
|
37
|
-
*/
|
|
38
|
-
const tracer = tracer$1;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @since 1.0.0
|
|
42
|
-
* @category constructors
|
|
43
|
-
*/
|
|
44
|
-
const loggerTracer = loggerTracer$1;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @since 1.0.0
|
|
48
|
-
* @category constructors
|
|
49
|
-
*/
|
|
50
|
-
const xForwardedHeaders = xForwardedHeaders$1;
|
|
51
|
-
|
|
52
|
-
export { b3Response, logger, loggerTracer, make, tracer, xForwardedHeaders };
|
|
1
|
+
export { b as b3Response, l as logger, a as loggerTracer, m as make, t as tracer, x as xForwardedHeaders } from '../../../dist/Middleware-27760041.esm.js';
|
|
2
|
+
import 'effect/Effect';
|
|
3
|
+
import 'effect/Function';
|
|
4
|
+
import '../../../dist/Headers-58b56a08.esm.js';
|
|
5
|
+
import 'effect/ReadonlyArray';
|
|
6
|
+
import 'effect/ReadonlyRecord';
|
|
7
|
+
import '../../IncomingMessage/dist/effect-platform-Http-IncomingMessage.esm.js';
|
|
8
|
+
import '@effect/schema/ParseResult';
|
|
9
|
+
import '@effect/schema/Schema';
|
|
10
|
+
import 'effect/Context';
|
|
11
|
+
import 'effect/FiberRef';
|
|
12
|
+
import 'effect/GlobalValue';
|
|
13
|
+
import 'effect/Option';
|
|
14
|
+
import '../../../dist/FileSystem-7e31dccd.esm.js';
|
|
15
|
+
import 'effect/Brand';
|
|
16
|
+
import 'effect/Sink';
|
|
17
|
+
import 'effect/Stream';
|
|
18
|
+
import '../../../dist/Error-3099667c.esm.js';
|
|
19
|
+
import 'effect/Data';
|
|
20
|
+
import '../../../dist/ServerRequest-03161edc.esm.js';
|
|
21
|
+
import '../../../dist/FormData-f54de878.esm.js';
|
|
22
|
+
import 'effect/Chunk';
|
|
23
|
+
import 'effect/Predicate';
|
|
24
|
+
import '../../../dist/ServerError-04ad5b57.esm.js';
|
|
25
|
+
import '../../../dist/ServerResponse-675e9456.esm.js';
|
|
26
|
+
import 'effect/Pipeable';
|
|
27
|
+
import '../../Platform/dist/effect-platform-Http-Platform.esm.js';
|
|
28
|
+
import '../../Etag/dist/effect-platform-Http-Etag.esm.js';
|
|
29
|
+
import '../../../dist/UrlParams-1286c728.esm.js';
|
|
30
|
+
import '../../../dist/body-20d78ec1.esm.js';
|
|
@@ -1,4 +1,59 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import { pipe } from 'effect/Function';
|
|
4
|
+
import { a as FileSystem } from '../../../dist/FileSystem-7e31dccd.esm.js';
|
|
5
|
+
import { Generator, toString } from '../../Etag/dist/effect-platform-Http-Etag.esm.js';
|
|
6
|
+
import 'effect/Brand';
|
|
7
|
+
import 'effect/Option';
|
|
8
|
+
import 'effect/Sink';
|
|
9
|
+
import 'effect/Stream';
|
|
10
|
+
import '../../../dist/Error-3099667c.esm.js';
|
|
11
|
+
import 'effect/Data';
|
|
12
|
+
|
|
13
|
+
/** @internal */
|
|
14
|
+
const TypeId$1 = /*#__PURE__*/Symbol.for("@effect/platform/Http/Platform");
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
const tag = /*#__PURE__*/Context.Tag(TypeId$1);
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
const make$1 = impl => Effect.gen(function* (_) {
|
|
21
|
+
const fs = yield* _(FileSystem);
|
|
22
|
+
const etagGen = yield* _(Generator);
|
|
23
|
+
return tag.of({
|
|
24
|
+
[TypeId$1]: TypeId$1,
|
|
25
|
+
fileResponse(path, options) {
|
|
26
|
+
return pipe(Effect.bindTo(fs.stat(path), "info"), Effect.bind("etag", ({
|
|
27
|
+
info
|
|
28
|
+
}) => etagGen.fromFileInfo(info)), Effect.map(({
|
|
29
|
+
etag,
|
|
30
|
+
info
|
|
31
|
+
}) => {
|
|
32
|
+
const start = Number(options?.offset ?? 0);
|
|
33
|
+
const end = options?.bytesToRead !== undefined ? start + Number(options.bytesToRead) : undefined;
|
|
34
|
+
const headers = {
|
|
35
|
+
...(options?.headers ?? {}),
|
|
36
|
+
etag: toString(etag)
|
|
37
|
+
};
|
|
38
|
+
if (info.mtime._tag === "Some") {
|
|
39
|
+
headers["last-modified"] = info.mtime.value.toUTCString();
|
|
40
|
+
}
|
|
41
|
+
const contentLength = end !== undefined ? end - start : Number(info.size) - start;
|
|
42
|
+
return impl.fileResponse(path, options?.status ?? 200, options?.statusText, headers, start, end, contentLength);
|
|
43
|
+
}));
|
|
44
|
+
},
|
|
45
|
+
fileWebResponse(file, options) {
|
|
46
|
+
return Effect.map(etagGen.fromFileWeb(file), etag => {
|
|
47
|
+
const headers = {
|
|
48
|
+
...(options?.headers ?? {}),
|
|
49
|
+
etag: toString(etag),
|
|
50
|
+
"last-modified": new Date(file.lastModified).toUTCString()
|
|
51
|
+
};
|
|
52
|
+
return impl.fileWebResponse(file, options?.status ?? 200, options?.statusText, headers, options);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
2
57
|
|
|
3
58
|
/**
|
|
4
59
|
* @since 1.0.0
|