@effect/platform-deno 4.0.0 → 4.0.2
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/ai-docs/package.json +2 -2
- package/ai-docs/tsconfig.json +2 -1
- package/dist/DenoChildProcessSpawner.d.ts +4 -0
- package/dist/DenoChildProcessSpawner.d.ts.map +1 -1
- package/dist/DenoChildProcessSpawner.js +2 -0
- package/dist/DenoChildProcessSpawner.js.map +1 -1
- package/dist/DenoClusterHttp.d.ts +3 -0
- package/dist/DenoClusterHttp.d.ts.map +1 -1
- package/dist/DenoClusterHttp.js +4 -0
- package/dist/DenoClusterHttp.js.map +1 -1
- package/dist/DenoClusterSocket.d.ts +5 -0
- package/dist/DenoClusterSocket.d.ts.map +1 -1
- package/dist/DenoClusterSocket.js +5 -0
- package/dist/DenoClusterSocket.js.map +1 -1
- package/dist/DenoCrypto.d.ts +3 -0
- package/dist/DenoCrypto.d.ts.map +1 -1
- package/dist/DenoCrypto.js +3 -0
- package/dist/DenoCrypto.js.map +1 -1
- package/dist/DenoFileSystem.d.ts +1 -0
- package/dist/DenoFileSystem.d.ts.map +1 -1
- package/dist/DenoFileSystem.js +2 -0
- package/dist/DenoFileSystem.js.map +1 -1
- package/dist/DenoHttpClient.d.ts +1 -0
- package/dist/DenoHttpClient.d.ts.map +1 -1
- package/dist/DenoHttpClient.js +1 -0
- package/dist/DenoHttpClient.js.map +1 -1
- package/dist/DenoHttpPlatform.d.ts +2 -0
- package/dist/DenoHttpPlatform.d.ts.map +1 -1
- package/dist/DenoHttpPlatform.js +3 -0
- package/dist/DenoHttpPlatform.js.map +1 -1
- package/dist/DenoHttpServer.d.ts +9 -1
- package/dist/DenoHttpServer.d.ts.map +1 -1
- package/dist/DenoHttpServer.js +15 -4
- package/dist/DenoHttpServer.js.map +1 -1
- package/dist/DenoHttpServerRequest.d.ts +2 -0
- package/dist/DenoHttpServerRequest.d.ts.map +1 -1
- package/dist/DenoHttpServerRequest.js +1 -0
- package/dist/DenoHttpServerRequest.js.map +1 -1
- package/dist/DenoKeyValueStore.d.ts +3 -0
- package/dist/DenoKeyValueStore.d.ts.map +1 -1
- package/dist/DenoKeyValueStore.js +3 -0
- package/dist/DenoKeyValueStore.js.map +1 -1
- package/dist/DenoMultipart.d.ts +3 -0
- package/dist/DenoMultipart.d.ts.map +1 -1
- package/dist/DenoMultipart.js +2 -0
- package/dist/DenoMultipart.js.map +1 -1
- package/dist/DenoPath.d.ts +4 -0
- package/dist/DenoPath.d.ts.map +1 -1
- package/dist/DenoPath.js +4 -0
- package/dist/DenoPath.js.map +1 -1
- package/dist/DenoRuntime.d.ts +4 -0
- package/dist/DenoRuntime.d.ts.map +1 -1
- package/dist/DenoRuntime.js +2 -0
- package/dist/DenoRuntime.js.map +1 -1
- package/dist/DenoServices.d.ts +3 -0
- package/dist/DenoServices.d.ts.map +1 -1
- package/dist/DenoServices.js +1 -0
- package/dist/DenoServices.js.map +1 -1
- package/dist/DenoSocket.d.ts +10 -0
- package/dist/DenoSocket.d.ts.map +1 -1
- package/dist/DenoSocket.js +8 -0
- package/dist/DenoSocket.js.map +1 -1
- package/dist/DenoSocketServer.d.ts +1 -0
- package/dist/DenoSocketServer.d.ts.map +1 -1
- package/dist/DenoSocketServer.js +1 -0
- package/dist/DenoSocketServer.js.map +1 -1
- package/dist/DenoStdio.d.ts +1 -0
- package/dist/DenoStdio.d.ts.map +1 -1
- package/dist/DenoStdio.js +2 -0
- package/dist/DenoStdio.js.map +1 -1
- package/dist/DenoTerminal.d.ts +2 -0
- package/dist/DenoTerminal.d.ts.map +1 -1
- package/dist/DenoTerminal.js +3 -0
- package/dist/DenoTerminal.js.map +1 -1
- package/dist/DenoWorker.d.ts +2 -0
- package/dist/DenoWorker.d.ts.map +1 -1
- package/dist/DenoWorker.js +3 -0
- package/dist/DenoWorker.js.map +1 -1
- package/dist/DenoWorkerRunner.d.ts +3 -0
- package/dist/DenoWorkerRunner.d.ts.map +1 -1
- package/dist/DenoWorkerRunner.js +4 -0
- package/dist/DenoWorkerRunner.js.map +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/DenoChildProcessSpawner.ts +4 -0
- package/src/DenoClusterHttp.ts +4 -0
- package/src/DenoClusterSocket.ts +5 -0
- package/src/DenoCrypto.ts +3 -0
- package/src/DenoFileSystem.ts +2 -0
- package/src/DenoHttpClient.ts +1 -0
- package/src/DenoHttpPlatform.ts +3 -0
- package/src/DenoHttpServer.ts +18 -3
- package/src/DenoHttpServerRequest.ts +2 -0
- package/src/DenoKeyValueStore.ts +3 -0
- package/src/DenoMultipart.ts +3 -0
- package/src/DenoPath.ts +4 -0
- package/src/DenoRuntime.ts +4 -0
- package/src/DenoServices.ts +3 -0
- package/src/DenoSocket.ts +10 -0
- package/src/DenoSocketServer.ts +1 -0
- package/src/DenoStdio.ts +2 -0
- package/src/DenoTerminal.ts +3 -0
- package/src/DenoWorker.ts +3 -0
- package/src/DenoWorkerRunner.ts +4 -0
- package/src/index.ts +21 -0
package/dist/index.js
CHANGED
|
@@ -1,52 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @stability unstable
|
|
2
3
|
* @since 4.0.0
|
|
3
4
|
*/
|
|
4
5
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
5
6
|
/**
|
|
7
|
+
* @stability unstable
|
|
6
8
|
* @since 4.0.0
|
|
7
9
|
*/
|
|
8
10
|
export * as DenoChildProcessSpawner from "./DenoChildProcessSpawner.js";
|
|
9
11
|
/**
|
|
12
|
+
* @stability unstable
|
|
10
13
|
* @since 4.0.0
|
|
11
14
|
*/
|
|
12
15
|
export * as DenoClusterHttp from "./DenoClusterHttp.js";
|
|
13
16
|
/**
|
|
17
|
+
* @stability unstable
|
|
14
18
|
* @since 4.0.0
|
|
15
19
|
*/
|
|
16
20
|
export * as DenoClusterSocket from "./DenoClusterSocket.js";
|
|
17
21
|
/**
|
|
22
|
+
* @stability unstable
|
|
18
23
|
* @since 4.0.0
|
|
19
24
|
*/
|
|
20
25
|
export * as DenoCrypto from "./DenoCrypto.js";
|
|
21
26
|
/**
|
|
27
|
+
* @stability unstable
|
|
22
28
|
* @since 4.0.0
|
|
23
29
|
*/
|
|
24
30
|
export * as DenoFileSystem from "./DenoFileSystem.js";
|
|
25
31
|
/**
|
|
32
|
+
* @stability unstable
|
|
26
33
|
* @since 4.0.0
|
|
27
34
|
*/
|
|
28
35
|
export * as DenoHttpClient from "./DenoHttpClient.js";
|
|
29
36
|
/**
|
|
37
|
+
* @stability unstable
|
|
30
38
|
* @since 4.0.0
|
|
31
39
|
*/
|
|
32
40
|
export * as DenoHttpPlatform from "./DenoHttpPlatform.js";
|
|
33
41
|
/**
|
|
42
|
+
* @stability unstable
|
|
34
43
|
* @since 4.0.0
|
|
35
44
|
*/
|
|
36
45
|
export * as DenoHttpServer from "./DenoHttpServer.js";
|
|
37
46
|
/**
|
|
47
|
+
* @stability unstable
|
|
38
48
|
* @since 4.0.0
|
|
39
49
|
*/
|
|
40
50
|
export * as DenoHttpServerRequest from "./DenoHttpServerRequest.js";
|
|
41
51
|
/**
|
|
52
|
+
* @stability unstable
|
|
42
53
|
* @since 4.0.0
|
|
43
54
|
*/
|
|
44
55
|
export * as DenoKeyValueStore from "./DenoKeyValueStore.js";
|
|
45
56
|
/**
|
|
57
|
+
* @stability unstable
|
|
46
58
|
* @since 4.0.0
|
|
47
59
|
*/
|
|
48
60
|
export * as DenoMultipart from "./DenoMultipart.js";
|
|
49
61
|
/**
|
|
62
|
+
* @stability unstable
|
|
50
63
|
* @since 4.0.0
|
|
51
64
|
*/
|
|
52
65
|
export * as DenoPath from "./DenoPath.js";
|
|
@@ -56,34 +69,42 @@ export * as DenoPath from "./DenoPath.js";
|
|
|
56
69
|
*/
|
|
57
70
|
export * as DenoRedis from "./DenoRedis.js";
|
|
58
71
|
/**
|
|
72
|
+
* @stability unstable
|
|
59
73
|
* @since 4.0.0
|
|
60
74
|
*/
|
|
61
75
|
export * as DenoRuntime from "./DenoRuntime.js";
|
|
62
76
|
/**
|
|
77
|
+
* @stability unstable
|
|
63
78
|
* @since 4.0.0
|
|
64
79
|
*/
|
|
65
80
|
export * as DenoServices from "./DenoServices.js";
|
|
66
81
|
/**
|
|
82
|
+
* @stability unstable
|
|
67
83
|
* @since 4.0.0
|
|
68
84
|
*/
|
|
69
85
|
export * as DenoSocket from "./DenoSocket.js";
|
|
70
86
|
/**
|
|
87
|
+
* @stability unstable
|
|
71
88
|
* @since 4.0.0
|
|
72
89
|
*/
|
|
73
90
|
export * as DenoSocketServer from "./DenoSocketServer.js";
|
|
74
91
|
/**
|
|
92
|
+
* @stability unstable
|
|
75
93
|
* @since 4.0.0
|
|
76
94
|
*/
|
|
77
95
|
export * as DenoStdio from "./DenoStdio.js";
|
|
78
96
|
/**
|
|
97
|
+
* @stability unstable
|
|
79
98
|
* @since 4.0.0
|
|
80
99
|
*/
|
|
81
100
|
export * as DenoTerminal from "./DenoTerminal.js";
|
|
82
101
|
/**
|
|
102
|
+
* @stability unstable
|
|
83
103
|
* @since 4.0.0
|
|
84
104
|
*/
|
|
85
105
|
export * as DenoWorker from "./DenoWorker.js";
|
|
86
106
|
/**
|
|
107
|
+
* @stability unstable
|
|
87
108
|
* @since 4.0.0
|
|
88
109
|
*/
|
|
89
110
|
export * as DenoWorkerRunner from "./DenoWorkerRunner.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yDAAyD;AAEzD;;;GAGG;AACH,OAAO,KAAK,uBAAuB,MAAM,8BAA8B,CAAA;AAEvE;;;GAGG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;;GAGG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAE3D;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD;;;GAGG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD;;;GAGG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;;GAGG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD;;;GAGG;AACH,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAA;AAEnE;;;GAGG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAE3D;;;GAGG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;GAGG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;GAGG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;GAGG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;;GAGG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/platform-deno",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Platform specific implementations for the Deno runtime",
|
|
7
7
|
"homepage": "https://effect.website",
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
"@std/media-types": "npm:@jsr/std__media-types@^1.1.0",
|
|
58
58
|
"@std/path": "npm:@jsr/std__path@^1.1.6",
|
|
59
59
|
"@std/streams": "npm:@jsr/std__streams@^1.2.0",
|
|
60
|
-
"@effect/platform-node-shared": "^4.0.
|
|
60
|
+
"@effect/platform-node-shared": "^4.0.2"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"effect": "^4.0.
|
|
63
|
+
"effect": "^4.0.2"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@std/assert": "npm:@jsr/std__assert@^1.0.19",
|
|
67
|
-
"@testcontainers/redis": "^12.
|
|
67
|
+
"@testcontainers/redis": "^12.2.0",
|
|
68
68
|
"@types/deno": "^2.7.0",
|
|
69
|
-
"effect": "^4.0.
|
|
69
|
+
"effect": "^4.0.2"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"codegen": "effect-utils codegen",
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* detached process groups, so killing a handle terminates only its direct child;
|
|
6
6
|
* descendants spawned by that child are left running.
|
|
7
7
|
*
|
|
8
|
+
* @stability unstable
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
10
11
|
import type * as Arr from "effect/Array"
|
|
@@ -393,6 +394,7 @@ const make = Effect.gen(function*() {
|
|
|
393
394
|
/**
|
|
394
395
|
* Layer that provides the Deno child process spawner.
|
|
395
396
|
*
|
|
397
|
+
* @stability unstable
|
|
396
398
|
* @category layers
|
|
397
399
|
* @since 4.0.0
|
|
398
400
|
*/
|
|
@@ -401,6 +403,7 @@ export const layer: Layer.Layer<ChildProcessSpawner, never, Path.Path> = Layer.e
|
|
|
401
403
|
/**
|
|
402
404
|
* Result of flattening a pipeline of commands.
|
|
403
405
|
*
|
|
406
|
+
* @stability unstable
|
|
404
407
|
* @category models
|
|
405
408
|
* @since 4.0.0
|
|
406
409
|
*/
|
|
@@ -412,6 +415,7 @@ export interface FlattenedPipeline {
|
|
|
412
415
|
/**
|
|
413
416
|
* Flattens a command into standard commands and their pipe options.
|
|
414
417
|
*
|
|
418
|
+
* @stability unstable
|
|
415
419
|
* @category transforming
|
|
416
420
|
* @since 4.0.0
|
|
417
421
|
*/
|
package/src/DenoClusterHttp.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* choosing serialization, runner health checks, runner storage, message
|
|
7
7
|
* storage, and optional client-only mode from the supplied options.
|
|
8
8
|
*
|
|
9
|
+
* @stability unstable
|
|
9
10
|
* @since 4.0.0
|
|
10
11
|
*/
|
|
11
12
|
import * as HttpRunner from "effect/cluster/HttpRunner"
|
|
@@ -38,6 +39,7 @@ export {
|
|
|
38
39
|
/**
|
|
39
40
|
* Layer that provides a Kubernetes HTTP client for runner health checks.
|
|
40
41
|
*
|
|
42
|
+
* @stability unstable
|
|
41
43
|
* @category re-exports
|
|
42
44
|
* @since 4.0.0
|
|
43
45
|
*/
|
|
@@ -47,6 +49,7 @@ export {
|
|
|
47
49
|
/**
|
|
48
50
|
* Layer that provides a native Deno HTTP server for cluster runners.
|
|
49
51
|
*
|
|
52
|
+
* @stability unstable
|
|
50
53
|
* @category layers
|
|
51
54
|
* @since 4.0.0
|
|
52
55
|
*/
|
|
@@ -74,6 +77,7 @@ export const layerHttpServer: Layer.Layer<
|
|
|
74
77
|
* Creates Deno cluster layers for HTTP or WebSocket transport, configuring
|
|
75
78
|
* serialization, storage, runner health, and optional client-only mode.
|
|
76
79
|
*
|
|
80
|
+
* @stability unstable
|
|
77
81
|
* @category layers
|
|
78
82
|
* @since 4.0.0
|
|
79
83
|
*/
|
package/src/DenoClusterSocket.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Deno connections have no native idle-timeout option, so peer connections use
|
|
8
8
|
* only the one-second open timeout.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @since 4.0.0
|
|
11
12
|
*/
|
|
12
13
|
import * as K8sHttpClient from "effect/cluster/K8sHttpClient"
|
|
@@ -38,6 +39,7 @@ import * as DenoSocketServer from "./DenoSocketServer.ts"
|
|
|
38
39
|
/**
|
|
39
40
|
* Provides the cluster `RpcClientProtocol` using native Deno TCP sockets.
|
|
40
41
|
*
|
|
42
|
+
* @stability unstable
|
|
41
43
|
* @category layers
|
|
42
44
|
* @since 4.0.0
|
|
43
45
|
*/
|
|
@@ -69,6 +71,7 @@ export const layerClientProtocol: Layer.Layer<
|
|
|
69
71
|
* Provides the socket server used by cluster runners, listening on
|
|
70
72
|
* `ShardingConfig.runnerListenAddress` or `runnerAddress`.
|
|
71
73
|
*
|
|
74
|
+
* @stability unstable
|
|
72
75
|
* @category layers
|
|
73
76
|
* @since 4.0.0
|
|
74
77
|
*/
|
|
@@ -92,6 +95,7 @@ export const layerSocketServer: Layer.Layer<
|
|
|
92
95
|
* Creates Deno socket cluster layers, configuring serialization, storage,
|
|
93
96
|
* runner health, and optional client-only mode.
|
|
94
97
|
*
|
|
98
|
+
* @stability unstable
|
|
95
99
|
* @category layers
|
|
96
100
|
* @since 4.0.0
|
|
97
101
|
*/
|
|
@@ -172,6 +176,7 @@ export const layer = <
|
|
|
172
176
|
* Layer that provides `K8sHttpClient`, using a scoped native Deno HTTP client
|
|
173
177
|
* with the Kubernetes service-account CA certificate when it is available.
|
|
174
178
|
*
|
|
179
|
+
* @stability unstable
|
|
175
180
|
* @category layers
|
|
176
181
|
* @since 4.0.0
|
|
177
182
|
*/
|
package/src/DenoCrypto.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This module uses Deno's global Web Crypto API.
|
|
5
5
|
*
|
|
6
|
+
* @stability unstable
|
|
6
7
|
* @since 4.0.0
|
|
7
8
|
*/
|
|
8
9
|
import * as Context from "effect/Context"
|
|
@@ -14,6 +15,7 @@ import * as PlatformError from "effect/PlatformError"
|
|
|
14
15
|
/**
|
|
15
16
|
* Provides the Web Crypto API used by the Crypto service implementation.
|
|
16
17
|
*
|
|
18
|
+
* @stability unstable
|
|
17
19
|
* @category services
|
|
18
20
|
* @since 4.0.0
|
|
19
21
|
*/
|
|
@@ -24,6 +26,7 @@ export const WebCrypto = Context.Reference<Crypto>("@effect/platform-deno/Crypto
|
|
|
24
26
|
/**
|
|
25
27
|
* A layer that provides Effect's Crypto service using Deno's Web Crypto API.
|
|
26
28
|
*
|
|
29
|
+
* @stability unstable
|
|
27
30
|
* @category layers
|
|
28
31
|
* @since 4.0.0
|
|
29
32
|
*/
|
package/src/DenoFileSystem.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Deno implementation of Effect's `FileSystem` service.
|
|
3
3
|
*
|
|
4
|
+
* @stability unstable
|
|
4
5
|
* @since 4.0.0
|
|
5
6
|
*/
|
|
6
7
|
import { copy as denoCopy, expandGlob, walk } from "@std/fs"
|
|
@@ -510,6 +511,7 @@ const makeFileSystem = Effect.map(Effect.serviceOption(FileSystem.WatchBackend),
|
|
|
510
511
|
/**
|
|
511
512
|
* Provides the `FileSystem` service backed by Deno filesystem APIs.
|
|
512
513
|
*
|
|
514
|
+
* @stability unstable
|
|
513
515
|
* @category layers
|
|
514
516
|
* @since 4.0.0
|
|
515
517
|
*/
|
package/src/DenoHttpClient.ts
CHANGED
package/src/DenoHttpPlatform.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* The provided layer uses strong ETags, unlike the portable `HttpPlatform`
|
|
10
10
|
* layer, which uses weak ETags.
|
|
11
11
|
*
|
|
12
|
+
* @stability unstable
|
|
12
13
|
* @since 4.0.0
|
|
13
14
|
*/
|
|
14
15
|
import * as NodeHttpCompression from "@effect/platform-node-shared/NodeHttpCompression"
|
|
@@ -36,6 +37,7 @@ const compression = NodeHttpCompression.make(Platform.makeCompressionWeb({
|
|
|
36
37
|
* Creates the Deno `HttpPlatform`, serving file responses from resource-backed
|
|
37
38
|
* readable streams and adding content type and content length headers.
|
|
38
39
|
*
|
|
40
|
+
* @stability unstable
|
|
39
41
|
* @category constructors
|
|
40
42
|
* @since 4.0.0
|
|
41
43
|
*/
|
|
@@ -102,6 +104,7 @@ export const make = Platform.make({
|
|
|
102
104
|
* Provides the Deno `HttpPlatform` together with its filesystem and strong ETag
|
|
103
105
|
* services.
|
|
104
106
|
*
|
|
107
|
+
* @stability unstable
|
|
105
108
|
* @category layers
|
|
106
109
|
* @since 4.0.0
|
|
107
110
|
*/
|
package/src/DenoHttpServer.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Native Deno implementation of the Effect `HttpServer`.
|
|
3
3
|
*
|
|
4
|
+
* @stability unstable
|
|
4
5
|
* @since 4.0.0
|
|
5
6
|
*/
|
|
6
7
|
import * as Config from "effect/Config"
|
|
@@ -51,6 +52,7 @@ import * as DenoServices from "./DenoServices.ts"
|
|
|
51
52
|
* WebSocket settings that apply to every upgrade; `protocol` therefore cannot
|
|
52
53
|
* vary per request.
|
|
53
54
|
*
|
|
55
|
+
* @stability unstable
|
|
54
56
|
* @category options
|
|
55
57
|
* @since 4.0.0
|
|
56
58
|
*/
|
|
@@ -61,6 +63,7 @@ export type ServeOptions =
|
|
|
61
63
|
/**
|
|
62
64
|
* Creates a scoped native Deno HTTP server.
|
|
63
65
|
*
|
|
66
|
+
* @stability unstable
|
|
64
67
|
* @category constructors
|
|
65
68
|
* @since 4.0.0
|
|
66
69
|
*/
|
|
@@ -113,7 +116,9 @@ export const make = Effect.fnUntraced(function*(
|
|
|
113
116
|
|
|
114
117
|
const httpEffect = HttpEffect.toHandled(httpApp, (request, response) => {
|
|
115
118
|
const denoRequest = request as DenoServerRequest
|
|
116
|
-
if (denoRequest.
|
|
119
|
+
if (upgradedSources.has(denoRequest.source)) {
|
|
120
|
+
return Effect.as(cancelResponseBody(response.body), upgradedResponse)
|
|
121
|
+
}
|
|
117
122
|
return Effect.flatMap(
|
|
118
123
|
makeResponse(request, response, services, scope),
|
|
119
124
|
(response) => Effect.sync(() => denoRequest.resolve(response))
|
|
@@ -207,6 +212,7 @@ const makeResponse = Effect.fnUntraced(function*(
|
|
|
207
212
|
/**
|
|
208
213
|
* Provides only the native Deno HTTP server.
|
|
209
214
|
*
|
|
215
|
+
* @stability unstable
|
|
210
216
|
* @category layers
|
|
211
217
|
* @since 4.0.0
|
|
212
218
|
*/
|
|
@@ -224,6 +230,7 @@ export const layerServer: (
|
|
|
224
230
|
/**
|
|
225
231
|
* Provides Deno HTTP platform services and the standard Deno service set.
|
|
226
232
|
*
|
|
233
|
+
* @stability unstable
|
|
227
234
|
* @category layers
|
|
228
235
|
* @since 4.0.0
|
|
229
236
|
*/
|
|
@@ -236,6 +243,7 @@ export const layerHttpServices: Layer.Layer<HttpPlatform | Etag.Generator | Deno
|
|
|
236
243
|
/**
|
|
237
244
|
* Provides a native Deno HTTP server together with Deno HTTP services.
|
|
238
245
|
*
|
|
246
|
+
* @stability unstable
|
|
239
247
|
* @category layers
|
|
240
248
|
* @since 4.0.0
|
|
241
249
|
*/
|
|
@@ -251,6 +259,7 @@ export const layer = (
|
|
|
251
259
|
/**
|
|
252
260
|
* Starts a Deno HTTP server on an ephemeral loopback port for tests.
|
|
253
261
|
*
|
|
262
|
+
* @stability unstable
|
|
254
263
|
* @category testing
|
|
255
264
|
* @since 4.0.0
|
|
256
265
|
*/
|
|
@@ -266,6 +275,7 @@ export const layerTest: Layer.Layer<
|
|
|
266
275
|
/**
|
|
267
276
|
* Creates the Deno HTTP server and support-services layer from configurable options.
|
|
268
277
|
*
|
|
278
|
+
* @stability unstable
|
|
269
279
|
* @category layers
|
|
270
280
|
* @since 4.0.0
|
|
271
281
|
*/
|
|
@@ -294,7 +304,6 @@ class DenoServerRequest extends Inspectable.Class implements ServerRequest.HttpS
|
|
|
294
304
|
readonly url: string
|
|
295
305
|
readonly websocketOptions: Deno.UpgradeWebSocketOptions | undefined
|
|
296
306
|
public resolve: (response: Response) => void
|
|
297
|
-
public upgraded = false
|
|
298
307
|
public headersOverride?: Headers.Headers | undefined
|
|
299
308
|
private remoteAddressOverride?: Option.Option<string> | undefined
|
|
300
309
|
|
|
@@ -458,7 +467,7 @@ class DenoServerRequest extends Inspectable.Class implements ServerRequest.HttpS
|
|
|
458
467
|
}),
|
|
459
468
|
(upgrade) => {
|
|
460
469
|
const ws = bufferedWebSocket(upgrade.socket)
|
|
461
|
-
this.
|
|
470
|
+
upgradedSources.add(this.source)
|
|
462
471
|
this.resolve(upgrade.response)
|
|
463
472
|
return Socket.fromWebSocket(
|
|
464
473
|
Effect.acquireRelease(
|
|
@@ -551,6 +560,12 @@ const bufferedWebSocket = (ws: WebSocket): Socket.WebSocketLike => {
|
|
|
551
560
|
}
|
|
552
561
|
}
|
|
553
562
|
|
|
563
|
+
// Reported to middleware in place of the handler's discarded response.
|
|
564
|
+
const upgradedResponse = ServerResponse.empty({ status: 101 })
|
|
565
|
+
|
|
566
|
+
// Keyed by source so request copies from `modify` share the upgrade state.
|
|
567
|
+
const upgradedSources = new WeakSet<Request>()
|
|
568
|
+
|
|
554
569
|
const cancelResponseBody = (body: HttpBody.HttpBody): Effect.Effect<void> => {
|
|
555
570
|
if (body._tag === "Raw" && typeof ReadableStream !== "undefined" && body.body instanceof ReadableStream) {
|
|
556
571
|
const stream = body.body
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* `Deno.serve` always receives a standard `Request`. Connection information is
|
|
6
6
|
* intentionally kept internal to `DenoHttpServer`.
|
|
7
7
|
*
|
|
8
|
+
* @stability unstable
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
10
11
|
import type { HttpServerRequest } from "effect/http/HttpServerRequest"
|
|
@@ -12,6 +13,7 @@ import type { HttpServerRequest } from "effect/http/HttpServerRequest"
|
|
|
12
13
|
/**
|
|
13
14
|
* Returns the underlying web-standard `Request` from an Effect `HttpServerRequest`.
|
|
14
15
|
*
|
|
16
|
+
* @stability unstable
|
|
15
17
|
* @category accessors
|
|
16
18
|
* @since 4.0.0
|
|
17
19
|
*/
|
package/src/DenoKeyValueStore.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Deno-backed `KeyValueStore` layers using Web Storage APIs.
|
|
3
3
|
*
|
|
4
|
+
* @stability unstable
|
|
4
5
|
* @since 4.0.0
|
|
5
6
|
*/
|
|
6
7
|
|
|
@@ -10,6 +11,7 @@ import * as KeyValueStore from "effect/persistence/KeyValueStore"
|
|
|
10
11
|
/**
|
|
11
12
|
* Creates a `KeyValueStore` layer backed by `localStorage`, with values stored between sessions.
|
|
12
13
|
*
|
|
14
|
+
* @stability unstable
|
|
13
15
|
* @category layers
|
|
14
16
|
* @since 4.0.0
|
|
15
17
|
*/
|
|
@@ -20,6 +22,7 @@ export const layerLocalStorage: Layer.Layer<KeyValueStore.KeyValueStore> = KeyVa
|
|
|
20
22
|
/**
|
|
21
23
|
* Creates a `KeyValueStore` layer backed by `sessionStorage`, with values stored only for the current session.
|
|
22
24
|
*
|
|
25
|
+
* @stability unstable
|
|
23
26
|
* @category layers
|
|
24
27
|
* @since 4.0.0
|
|
25
28
|
*/
|
package/src/DenoMultipart.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* temporary files through the current `FileSystem`, `Path`, and `Scope`
|
|
8
8
|
* services.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @since 4.0.0
|
|
11
12
|
*/
|
|
12
13
|
import type * as Effect from "effect/Effect"
|
|
@@ -19,6 +20,7 @@ import * as Stream from "effect/Stream"
|
|
|
19
20
|
/**
|
|
20
21
|
* Parses a web `Request` body as multipart data and returns a stream of multipart parts.
|
|
21
22
|
*
|
|
23
|
+
* @stability unstable
|
|
22
24
|
* @category constructors
|
|
23
25
|
* @since 4.0.0
|
|
24
26
|
*/
|
|
@@ -39,6 +41,7 @@ export const stream = (source: Request): Stream.Stream<Multipart.Part, Multipart
|
|
|
39
41
|
/**
|
|
40
42
|
* Parses and persists multipart data from a web `Request`, requiring file-system, path, and scope services.
|
|
41
43
|
*
|
|
44
|
+
* @stability unstable
|
|
42
45
|
* @category constructors
|
|
43
46
|
* @since 4.0.0
|
|
44
47
|
*/
|
package/src/DenoPath.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* Effect.runSync(program) // => ".txt"
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
+
* @stability unstable
|
|
18
19
|
* @since 4.0.0
|
|
19
20
|
*/
|
|
20
21
|
|
|
@@ -55,6 +56,7 @@ const fileUrlOps = (impl: {
|
|
|
55
56
|
/**
|
|
56
57
|
* A {@linkplain Layer.Layer | layer} that provides POSIX path operations.
|
|
57
58
|
*
|
|
59
|
+
* @stability unstable
|
|
58
60
|
* @category layers
|
|
59
61
|
* @since 4.0.0
|
|
60
62
|
*/
|
|
@@ -70,6 +72,7 @@ export const layerPosix: Layer.Layer<Path.Path> = Layer.succeed(Path.Path)(
|
|
|
70
72
|
/**
|
|
71
73
|
* A {@linkplain Layer.Layer | layer} that provides Windows path operations.
|
|
72
74
|
*
|
|
75
|
+
* @stability unstable
|
|
73
76
|
* @category layers
|
|
74
77
|
* @since 4.0.0
|
|
75
78
|
*/
|
|
@@ -87,6 +90,7 @@ export const layerWin32: Layer.Layer<Path.Path> = Layer.succeed(
|
|
|
87
90
|
/**
|
|
88
91
|
* A {@linkplain Layer.Layer | layer} that provides OS-agnostic path operations.
|
|
89
92
|
*
|
|
93
|
+
* @stability unstable
|
|
90
94
|
* @category layers
|
|
91
95
|
* @since 4.0.0
|
|
92
96
|
*/
|
package/src/DenoRuntime.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Deno helper for running a root Effect program.
|
|
3
3
|
*
|
|
4
|
+
* @stability unstable
|
|
4
5
|
* @since 4.0.0
|
|
5
6
|
*/
|
|
6
7
|
|
|
@@ -10,6 +11,7 @@ import * as Runtime from "effect/Runtime"
|
|
|
10
11
|
/**
|
|
11
12
|
* Run an Effect as the entrypoint to a Deno application.
|
|
12
13
|
*
|
|
14
|
+
* @stability unstable
|
|
13
15
|
* @category running
|
|
14
16
|
* @since 4.0.0
|
|
15
17
|
*/
|
|
@@ -18,6 +20,7 @@ export const runMain: {
|
|
|
18
20
|
/**
|
|
19
21
|
* Run an Effect as the entrypoint to a Deno application.
|
|
20
22
|
*
|
|
23
|
+
* @stability unstable
|
|
21
24
|
* @category running
|
|
22
25
|
* @since 4.0.0
|
|
23
26
|
*/
|
|
@@ -31,6 +34,7 @@ export const runMain: {
|
|
|
31
34
|
/**
|
|
32
35
|
* Run an Effect as the entrypoint to a Deno application.
|
|
33
36
|
*
|
|
37
|
+
* @stability unstable
|
|
34
38
|
* @category running
|
|
35
39
|
* @since 4.0.0
|
|
36
40
|
*/
|
package/src/DenoServices.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* and terminal services. Use the layer when a Deno program wants the standard
|
|
7
7
|
* platform services from one place.
|
|
8
8
|
*
|
|
9
|
+
* @stability unstable
|
|
9
10
|
* @since 4.0.0
|
|
10
11
|
*/
|
|
11
12
|
import type { Crypto } from "effect/Crypto"
|
|
@@ -26,6 +27,7 @@ import * as DenoTerminal from "./DenoTerminal.ts"
|
|
|
26
27
|
* The union of core services provided by the Deno platform layer, including
|
|
27
28
|
* child process spawning, crypto, filesystem, path, stdio, and terminal services.
|
|
28
29
|
*
|
|
30
|
+
* @stability unstable
|
|
29
31
|
* @category models
|
|
30
32
|
* @since 4.0.0
|
|
31
33
|
*/
|
|
@@ -35,6 +37,7 @@ export type DenoServices = ChildProcessSpawner | Crypto | FileSystem | Path | Te
|
|
|
35
37
|
* Provides the default Deno implementations for child process spawning,
|
|
36
38
|
* crypto, filesystem, path, stdio, and terminal services.
|
|
37
39
|
*
|
|
40
|
+
* @stability unstable
|
|
38
41
|
* @category layers
|
|
39
42
|
* @since 4.0.0
|
|
40
43
|
*/
|
package/src/DenoSocket.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* `keepAlive` options have no effect on Unix connections. A `CloseEvent` always
|
|
8
8
|
* closes gracefully because Deno has no equivalent of Node's reset-on-close.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @since 4.0.0
|
|
11
12
|
*/
|
|
12
13
|
import * as Arr from "effect/Array"
|
|
@@ -24,6 +25,7 @@ import * as Socket from "effect/socket/Socket"
|
|
|
24
25
|
/**
|
|
25
26
|
* Options for opening a TCP or Unix connection.
|
|
26
27
|
*
|
|
28
|
+
* @stability unstable
|
|
27
29
|
* @category options
|
|
28
30
|
* @since 4.0.0
|
|
29
31
|
*/
|
|
@@ -35,6 +37,7 @@ export type ConnectOptions = (Deno.ConnectOptions | Deno.UnixConnectOptions) & {
|
|
|
35
37
|
/**
|
|
36
38
|
* Options for opening a TCP or Unix connection.
|
|
37
39
|
*
|
|
40
|
+
* @stability unstable
|
|
38
41
|
* @category options
|
|
39
42
|
* @since 4.0.0
|
|
40
43
|
*/
|
|
@@ -45,6 +48,7 @@ export type TcpOptions = ConnectOptions & {
|
|
|
45
48
|
/**
|
|
46
49
|
* Service tag for the underlying Deno connection.
|
|
47
50
|
*
|
|
51
|
+
* @stability unstable
|
|
48
52
|
* @category services
|
|
49
53
|
* @since 4.0.0
|
|
50
54
|
*/
|
|
@@ -66,6 +70,7 @@ export class Conn extends Context.Service<Conn, Deno.Conn>()(
|
|
|
66
70
|
* `rejectUnauthorized` to `false` disables hostname verification only;
|
|
67
71
|
* certificate-chain validation still applies.
|
|
68
72
|
*
|
|
73
|
+
* @stability unstable
|
|
69
74
|
* @category constructors
|
|
70
75
|
* @since 4.0.0
|
|
71
76
|
*/
|
|
@@ -268,6 +273,7 @@ export const fromConn = <RO>(
|
|
|
268
273
|
* `Deno.connect` promise. The scope finalizer closes a connection that arrives
|
|
269
274
|
* after the timeout.
|
|
270
275
|
*
|
|
276
|
+
* @stability unstable
|
|
271
277
|
* @category constructors
|
|
272
278
|
* @since 4.0.0
|
|
273
279
|
*/
|
|
@@ -329,6 +335,7 @@ export const makeTcp = (options: TcpOptions): Effect.Effect<Socket.Socket> => {
|
|
|
329
335
|
/**
|
|
330
336
|
* Creates a channel over a native Deno TCP or Unix connection.
|
|
331
337
|
*
|
|
338
|
+
* @stability unstable
|
|
332
339
|
* @category constructors
|
|
333
340
|
* @since 4.0.0
|
|
334
341
|
*/
|
|
@@ -345,6 +352,7 @@ export const makeTcpChannel = <IE = never>(
|
|
|
345
352
|
/**
|
|
346
353
|
* Provides a socket by opening a native Deno TCP or Unix connection.
|
|
347
354
|
*
|
|
355
|
+
* @stability unstable
|
|
348
356
|
* @category layers
|
|
349
357
|
* @since 4.0.0
|
|
350
358
|
*/
|
|
@@ -356,6 +364,7 @@ export const layerTcp: (options: ConnectOptions) => Layer.Layer<
|
|
|
356
364
|
/**
|
|
357
365
|
* Creates a socket layer connected to a URL with Deno's global WebSocket.
|
|
358
366
|
*
|
|
367
|
+
* @stability unstable
|
|
359
368
|
* @category layers
|
|
360
369
|
* @since 4.0.0
|
|
361
370
|
*/
|
|
@@ -371,6 +380,7 @@ export const layerWebSocket = (url: string, options?: {
|
|
|
371
380
|
/**
|
|
372
381
|
* Provides the WebSocket constructor backed by `globalThis.WebSocket`.
|
|
373
382
|
*
|
|
383
|
+
* @stability unstable
|
|
374
384
|
* @category layers
|
|
375
385
|
* @since 4.0.0
|
|
376
386
|
*/
|
package/src/DenoSocketServer.ts
CHANGED
package/src/DenoStdio.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* arguments and Web Streams. Standard input remains open, and standard output
|
|
6
6
|
* and error output are not closed unless requested through `endOnDone`.
|
|
7
7
|
*
|
|
8
|
+
* @stability unstable
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
10
11
|
import * as Effect from "effect/Effect"
|
|
@@ -33,6 +34,7 @@ const output = (
|
|
|
33
34
|
* Provides the `Stdio` service backed by `Deno.args`, `Deno.stdin`,
|
|
34
35
|
* `Deno.stdout`, and `Deno.stderr`.
|
|
35
36
|
*
|
|
37
|
+
* @stability unstable
|
|
36
38
|
* @category layers
|
|
37
39
|
* @since 4.0.0
|
|
38
40
|
*/
|