@effect/platform 0.68.6 → 0.69.1
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/HttpApiMiddleware/package.json +6 -0
- package/README.md +306 -233
- package/dist/cjs/Headers.js +7 -2
- package/dist/cjs/Headers.js.map +1 -1
- package/dist/cjs/HttpApi.js +90 -78
- package/dist/cjs/HttpApi.js.map +1 -1
- package/dist/cjs/HttpApiBuilder.js +245 -255
- package/dist/cjs/HttpApiBuilder.js.map +1 -1
- package/dist/cjs/HttpApiClient.js +64 -59
- package/dist/cjs/HttpApiClient.js.map +1 -1
- package/dist/cjs/HttpApiEndpoint.js +74 -109
- package/dist/cjs/HttpApiEndpoint.js.map +1 -1
- package/dist/cjs/HttpApiError.js +3 -4
- package/dist/cjs/HttpApiError.js.map +1 -1
- package/dist/cjs/HttpApiGroup.js +103 -100
- package/dist/cjs/HttpApiGroup.js.map +1 -1
- package/dist/cjs/HttpApiMiddleware.js +67 -0
- package/dist/cjs/HttpApiMiddleware.js.map +1 -0
- package/dist/cjs/HttpApiSchema.js +33 -7
- package/dist/cjs/HttpApiSchema.js.map +1 -1
- package/dist/cjs/HttpApiSecurity.js +2 -2
- package/dist/cjs/HttpApiSecurity.js.map +1 -1
- package/dist/cjs/HttpApiSwagger.js +3 -1
- package/dist/cjs/HttpApiSwagger.js.map +1 -1
- package/dist/cjs/HttpBody.js.map +1 -1
- package/dist/cjs/HttpIncomingMessage.js +5 -1
- package/dist/cjs/HttpIncomingMessage.js.map +1 -1
- package/dist/cjs/HttpServer.js +12 -1
- package/dist/cjs/HttpServer.js.map +1 -1
- package/dist/cjs/HttpServerRespondable.js +1 -1
- package/dist/cjs/HttpServerRespondable.js.map +1 -1
- package/dist/cjs/OpenApi.js +102 -63
- package/dist/cjs/OpenApi.js.map +1 -1
- package/dist/cjs/OpenApiJsonSchema.js +58 -47
- package/dist/cjs/OpenApiJsonSchema.js.map +1 -1
- package/dist/cjs/Transferable.js +2 -2
- package/dist/cjs/Transferable.js.map +1 -1
- package/dist/cjs/UrlParams.js +5 -1
- package/dist/cjs/UrlParams.js.map +1 -1
- package/dist/cjs/Worker.js.map +1 -1
- package/dist/cjs/WorkerError.js +1 -5
- package/dist/cjs/WorkerError.js.map +1 -1
- package/dist/cjs/WorkerRunner.js.map +1 -1
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/internal/httpBody.js +1 -1
- package/dist/cjs/internal/httpBody.js.map +1 -1
- package/dist/cjs/internal/httpClientRequest.js.map +1 -1
- package/dist/cjs/internal/httpClientResponse.js +1 -1
- package/dist/cjs/internal/httpClientResponse.js.map +1 -1
- package/dist/cjs/internal/httpRouter.js +1 -1
- package/dist/cjs/internal/httpRouter.js.map +1 -1
- package/dist/cjs/internal/httpServer.js +7 -1
- package/dist/cjs/internal/httpServer.js.map +1 -1
- package/dist/cjs/internal/httpServerRequest.js +1 -1
- package/dist/cjs/internal/httpServerRequest.js.map +1 -1
- package/dist/cjs/internal/httpServerResponse.js.map +1 -1
- package/dist/cjs/internal/keyValueStore.js +1 -1
- package/dist/cjs/internal/keyValueStore.js.map +1 -1
- package/dist/cjs/internal/multipart.js +1 -1
- package/dist/cjs/internal/multipart.js.map +1 -1
- package/dist/cjs/internal/worker.js +6 -7
- package/dist/cjs/internal/worker.js.map +1 -1
- package/dist/cjs/internal/workerRunner.js +3 -4
- package/dist/cjs/internal/workerRunner.js.map +1 -1
- package/dist/dts/Headers.d.ts +4 -6
- package/dist/dts/Headers.d.ts.map +1 -1
- package/dist/dts/HttpApi.d.ts +64 -140
- package/dist/dts/HttpApi.d.ts.map +1 -1
- package/dist/dts/HttpApiBuilder.d.ts +86 -167
- package/dist/dts/HttpApiBuilder.d.ts.map +1 -1
- package/dist/dts/HttpApiClient.d.ts +34 -11
- package/dist/dts/HttpApiClient.d.ts.map +1 -1
- package/dist/dts/HttpApiEndpoint.d.ts +119 -273
- package/dist/dts/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/dts/HttpApiError.d.ts +5 -2
- package/dist/dts/HttpApiError.d.ts.map +1 -1
- package/dist/dts/HttpApiGroup.d.ts +96 -194
- package/dist/dts/HttpApiGroup.d.ts.map +1 -1
- package/dist/dts/HttpApiMiddleware.d.ts +228 -0
- package/dist/dts/HttpApiMiddleware.d.ts.map +1 -0
- package/dist/dts/HttpApiSchema.d.ts +6 -2
- package/dist/dts/HttpApiSchema.d.ts.map +1 -1
- package/dist/dts/HttpApiSecurity.d.ts +1 -1
- package/dist/dts/HttpApiSecurity.d.ts.map +1 -1
- package/dist/dts/HttpApiSwagger.d.ts +2 -2
- package/dist/dts/HttpApiSwagger.d.ts.map +1 -1
- package/dist/dts/HttpBody.d.ts +2 -2
- package/dist/dts/HttpBody.d.ts.map +1 -1
- package/dist/dts/HttpClientRequest.d.ts +2 -2
- package/dist/dts/HttpClientRequest.d.ts.map +1 -1
- package/dist/dts/HttpClientResponse.d.ts +3 -3
- package/dist/dts/HttpClientResponse.d.ts.map +1 -1
- package/dist/dts/HttpIncomingMessage.d.ts +3 -3
- package/dist/dts/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/dts/HttpRouter.d.ts +3 -3
- package/dist/dts/HttpRouter.d.ts.map +1 -1
- package/dist/dts/HttpServer.d.ts +15 -0
- package/dist/dts/HttpServer.d.ts.map +1 -1
- package/dist/dts/HttpServerRequest.d.ts +3 -3
- package/dist/dts/HttpServerRequest.d.ts.map +1 -1
- package/dist/dts/HttpServerRespondable.d.ts.map +1 -1
- package/dist/dts/HttpServerResponse.d.ts +2 -2
- package/dist/dts/HttpServerResponse.d.ts.map +1 -1
- package/dist/dts/KeyValueStore.d.ts +2 -2
- package/dist/dts/KeyValueStore.d.ts.map +1 -1
- package/dist/dts/Multipart.d.ts +3 -3
- package/dist/dts/Multipart.d.ts.map +1 -1
- package/dist/dts/OpenApi.d.ts +17 -39
- package/dist/dts/OpenApi.d.ts.map +1 -1
- package/dist/dts/OpenApiJsonSchema.d.ts +10 -5
- package/dist/dts/OpenApiJsonSchema.d.ts.map +1 -1
- package/dist/dts/Transferable.d.ts +4 -1
- package/dist/dts/Transferable.d.ts.map +1 -1
- package/dist/dts/UrlParams.d.ts +3 -6
- package/dist/dts/UrlParams.d.ts.map +1 -1
- package/dist/dts/Worker.d.ts +7 -8
- package/dist/dts/Worker.d.ts.map +1 -1
- package/dist/dts/WorkerError.d.ts +1 -1
- package/dist/dts/WorkerError.d.ts.map +1 -1
- package/dist/dts/WorkerRunner.d.ts +2 -3
- package/dist/dts/WorkerRunner.d.ts.map +1 -1
- package/dist/dts/index.d.ts +4 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/internal/httpRouter.d.ts.map +1 -1
- package/dist/esm/Headers.js +7 -2
- package/dist/esm/Headers.js.map +1 -1
- package/dist/esm/HttpApi.js +88 -77
- package/dist/esm/HttpApi.js.map +1 -1
- package/dist/esm/HttpApiBuilder.js +238 -244
- package/dist/esm/HttpApiBuilder.js.map +1 -1
- package/dist/esm/HttpApiClient.js +64 -59
- package/dist/esm/HttpApiClient.js.map +1 -1
- package/dist/esm/HttpApiEndpoint.js +73 -106
- package/dist/esm/HttpApiEndpoint.js.map +1 -1
- package/dist/esm/HttpApiError.js +3 -4
- package/dist/esm/HttpApiError.js.map +1 -1
- package/dist/esm/HttpApiGroup.js +102 -99
- package/dist/esm/HttpApiGroup.js.map +1 -1
- package/dist/esm/HttpApiMiddleware.js +56 -0
- package/dist/esm/HttpApiMiddleware.js.map +1 -0
- package/dist/esm/HttpApiSchema.js +31 -5
- package/dist/esm/HttpApiSchema.js.map +1 -1
- package/dist/esm/HttpApiSecurity.js +1 -1
- package/dist/esm/HttpApiSecurity.js.map +1 -1
- package/dist/esm/HttpApiSwagger.js +4 -2
- package/dist/esm/HttpApiSwagger.js.map +1 -1
- package/dist/esm/HttpBody.js.map +1 -1
- package/dist/esm/HttpIncomingMessage.js +4 -1
- package/dist/esm/HttpIncomingMessage.js.map +1 -1
- package/dist/esm/HttpServer.js +11 -0
- package/dist/esm/HttpServer.js.map +1 -1
- package/dist/esm/HttpServerRespondable.js +1 -1
- package/dist/esm/HttpServerRespondable.js.map +1 -1
- package/dist/esm/OpenApi.js +97 -59
- package/dist/esm/OpenApi.js.map +1 -1
- package/dist/esm/OpenApiJsonSchema.js +56 -46
- package/dist/esm/OpenApiJsonSchema.js.map +1 -1
- package/dist/esm/Transferable.js +2 -2
- package/dist/esm/Transferable.js.map +1 -1
- package/dist/esm/UrlParams.js +4 -1
- package/dist/esm/UrlParams.js.map +1 -1
- package/dist/esm/Worker.js.map +1 -1
- package/dist/esm/WorkerError.js +1 -4
- package/dist/esm/WorkerError.js.map +1 -1
- package/dist/esm/WorkerRunner.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/httpBody.js +1 -1
- package/dist/esm/internal/httpBody.js.map +1 -1
- package/dist/esm/internal/httpClientRequest.js.map +1 -1
- package/dist/esm/internal/httpClientResponse.js +1 -1
- package/dist/esm/internal/httpClientResponse.js.map +1 -1
- package/dist/esm/internal/httpRouter.js +1 -1
- package/dist/esm/internal/httpRouter.js.map +1 -1
- package/dist/esm/internal/httpServer.js +6 -0
- package/dist/esm/internal/httpServer.js.map +1 -1
- package/dist/esm/internal/httpServerRequest.js +1 -1
- package/dist/esm/internal/httpServerRequest.js.map +1 -1
- package/dist/esm/internal/httpServerResponse.js.map +1 -1
- package/dist/esm/internal/keyValueStore.js +1 -1
- package/dist/esm/internal/keyValueStore.js.map +1 -1
- package/dist/esm/internal/multipart.js +1 -1
- package/dist/esm/internal/multipart.js.map +1 -1
- package/dist/esm/internal/worker.js +6 -7
- package/dist/esm/internal/worker.js.map +1 -1
- package/dist/esm/internal/workerRunner.js +3 -4
- package/dist/esm/internal/workerRunner.js.map +1 -1
- package/package.json +10 -3
- package/src/Headers.ts +12 -4
- package/src/HttpApi.ts +183 -258
- package/src/HttpApiBuilder.ts +534 -481
- package/src/HttpApiClient.ts +163 -112
- package/src/HttpApiEndpoint.ts +443 -564
- package/src/HttpApiError.ts +4 -6
- package/src/HttpApiGroup.ts +277 -325
- package/src/HttpApiMiddleware.ts +317 -0
- package/src/HttpApiSchema.ts +39 -2
- package/src/HttpApiSecurity.ts +1 -1
- package/src/HttpApiSwagger.ts +3 -3
- package/src/HttpBody.ts +2 -2
- package/src/HttpClientRequest.ts +2 -2
- package/src/HttpClientResponse.ts +3 -3
- package/src/HttpIncomingMessage.ts +3 -3
- package/src/HttpRouter.ts +3 -3
- package/src/HttpServer.ts +21 -0
- package/src/HttpServerRequest.ts +3 -3
- package/src/HttpServerRespondable.ts +1 -1
- package/src/HttpServerResponse.ts +2 -2
- package/src/KeyValueStore.ts +2 -2
- package/src/Multipart.ts +3 -3
- package/src/OpenApi.ts +113 -104
- package/src/OpenApiJsonSchema.ts +67 -53
- package/src/Transferable.ts +2 -2
- package/src/UrlParams.ts +3 -3
- package/src/Worker.ts +7 -8
- package/src/WorkerError.ts +1 -1
- package/src/WorkerRunner.ts +2 -3
- package/src/index.ts +5 -0
- package/src/internal/httpBody.ts +2 -2
- package/src/internal/httpClientRequest.ts +2 -2
- package/src/internal/httpClientResponse.ts +3 -3
- package/src/internal/httpRouter.ts +2 -2
- package/src/internal/httpServer.ts +13 -0
- package/src/internal/httpServerRequest.ts +3 -3
- package/src/internal/httpServerResponse.ts +2 -2
- package/src/internal/keyValueStore.ts +1 -1
- package/src/internal/multipart.ts +3 -3
- package/src/internal/worker.ts +6 -7
- package/src/internal/workerRunner.ts +3 -4
package/src/Worker.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import type * as ParseResult from "@effect/schema/ParseResult"
|
|
5
|
-
import type * as Schema from "@effect/schema/Schema"
|
|
6
|
-
import type * as Serializable from "@effect/schema/Serializable"
|
|
7
4
|
import type * as Context from "effect/Context"
|
|
8
5
|
import type * as Deferred from "effect/Deferred"
|
|
9
6
|
import type * as Duration from "effect/Duration"
|
|
10
7
|
import type * as Effect from "effect/Effect"
|
|
11
8
|
import type { LazyArg } from "effect/Function"
|
|
12
9
|
import type * as Layer from "effect/Layer"
|
|
10
|
+
import type * as ParseResult from "effect/ParseResult"
|
|
13
11
|
import type * as Pool from "effect/Pool"
|
|
12
|
+
import type * as Schema from "effect/Schema"
|
|
14
13
|
import type * as Scope from "effect/Scope"
|
|
15
14
|
import type * as Stream from "effect/Stream"
|
|
16
15
|
import * as internal from "./internal/worker.js"
|
|
@@ -260,12 +259,12 @@ export interface SerializedWorker<I extends Schema.TaggedRequest.All> {
|
|
|
260
259
|
readonly id: number
|
|
261
260
|
readonly execute: <Req extends I>(
|
|
262
261
|
message: Req
|
|
263
|
-
) => Req extends
|
|
262
|
+
) => Req extends Schema.WithResult<infer A, infer _I, infer E, infer _EI, infer R>
|
|
264
263
|
? Stream.Stream<A, E | WorkerError | ParseResult.ParseError, R>
|
|
265
264
|
: never
|
|
266
265
|
readonly executeEffect: <Req extends I>(
|
|
267
266
|
message: Req
|
|
268
|
-
) => Req extends
|
|
267
|
+
) => Req extends Schema.WithResult<infer A, infer _I, infer E, infer _EI, infer R>
|
|
269
268
|
? Effect.Effect<A, E | WorkerError | ParseResult.ParseError, R>
|
|
270
269
|
: never
|
|
271
270
|
}
|
|
@@ -295,17 +294,17 @@ export interface SerializedWorkerPool<I extends Schema.TaggedRequest.All> {
|
|
|
295
294
|
readonly backing: Pool.Pool<SerializedWorker<I>, WorkerError>
|
|
296
295
|
readonly broadcast: <Req extends I>(
|
|
297
296
|
message: Req
|
|
298
|
-
) => Req extends
|
|
297
|
+
) => Req extends Schema.WithResult<infer _A, infer _I, infer E, infer _EI, infer R>
|
|
299
298
|
? Effect.Effect<void, E | WorkerError | ParseResult.ParseError, R>
|
|
300
299
|
: never
|
|
301
300
|
readonly execute: <Req extends I>(
|
|
302
301
|
message: Req
|
|
303
|
-
) => Req extends
|
|
302
|
+
) => Req extends Schema.WithResult<infer A, infer _I, infer E, infer _EI, infer R>
|
|
304
303
|
? Stream.Stream<A, E | WorkerError | ParseResult.ParseError, R>
|
|
305
304
|
: never
|
|
306
305
|
readonly executeEffect: <Req extends I>(
|
|
307
306
|
message: Req
|
|
308
|
-
) => Req extends
|
|
307
|
+
) => Req extends Schema.WithResult<infer A, infer _I, infer E, infer _EI, infer R>
|
|
309
308
|
? Effect.Effect<A, E | WorkerError | ParseResult.ParseError, R>
|
|
310
309
|
: never
|
|
311
310
|
}
|
package/src/WorkerError.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import * as Schema from "@effect/schema/Schema"
|
|
5
4
|
import type * as Cause from "effect/Cause"
|
|
6
5
|
import * as Predicate from "effect/Predicate"
|
|
6
|
+
import * as Schema from "effect/Schema"
|
|
7
7
|
import * as internal from "./internal/workerError.js"
|
|
8
8
|
|
|
9
9
|
/**
|
package/src/WorkerRunner.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import type * as Schema from "@effect/schema/Schema"
|
|
5
|
-
import type * as Serializable from "@effect/schema/Serializable"
|
|
6
4
|
import type * as Context from "effect/Context"
|
|
7
5
|
import type * as Effect from "effect/Effect"
|
|
8
6
|
import type * as Layer from "effect/Layer"
|
|
7
|
+
import type * as Schema from "effect/Schema"
|
|
9
8
|
import type * as Scope from "effect/Scope"
|
|
10
9
|
import type * as Stream from "effect/Stream"
|
|
11
10
|
import * as internal from "./internal/workerRunner.js"
|
|
@@ -128,7 +127,7 @@ export declare namespace SerializedRunner {
|
|
|
128
127
|
readonly [K in A["_tag"]]: Extract<
|
|
129
128
|
A,
|
|
130
129
|
{ readonly _tag: K }
|
|
131
|
-
> extends
|
|
130
|
+
> extends Schema.SerializableWithResult<
|
|
132
131
|
infer S,
|
|
133
132
|
infer _SI,
|
|
134
133
|
infer _SR,
|
package/src/index.ts
CHANGED
package/src/internal/httpBody.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ParseOptions } from "@effect/schema/AST"
|
|
2
|
-
import * as Schema from "@effect/schema/Schema"
|
|
3
1
|
import * as Data from "effect/Data"
|
|
4
2
|
import * as Effect from "effect/Effect"
|
|
5
3
|
import { identity } from "effect/Function"
|
|
6
4
|
import * as Inspectable from "effect/Inspectable"
|
|
5
|
+
import * as Schema from "effect/Schema"
|
|
6
|
+
import type { ParseOptions } from "effect/SchemaAST"
|
|
7
7
|
import * as Stream_ from "effect/Stream"
|
|
8
8
|
import type * as PlatformError from "../Error.js"
|
|
9
9
|
import * as FileSystem from "../FileSystem.js"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ParseOptions } from "@effect/schema/AST"
|
|
2
|
-
import type * as Schema from "@effect/schema/Schema"
|
|
3
1
|
import * as Effect from "effect/Effect"
|
|
4
2
|
import { dual } from "effect/Function"
|
|
5
3
|
import * as Inspectable from "effect/Inspectable"
|
|
6
4
|
import * as Option from "effect/Option"
|
|
7
5
|
import { pipeArguments } from "effect/Pipeable"
|
|
8
6
|
import * as Redacted from "effect/Redacted"
|
|
7
|
+
import type * as Schema from "effect/Schema"
|
|
8
|
+
import type { ParseOptions } from "effect/SchemaAST"
|
|
9
9
|
import type * as Stream from "effect/Stream"
|
|
10
10
|
import type * as PlatformError from "../Error.js"
|
|
11
11
|
import type * as FileSystem from "../FileSystem.js"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ParseOptions } from "@effect/schema/AST"
|
|
2
|
-
import type * as ParseResult from "@effect/schema/ParseResult"
|
|
3
|
-
import * as Schema from "@effect/schema/Schema"
|
|
4
1
|
import * as Effect from "effect/Effect"
|
|
5
2
|
import { dual } from "effect/Function"
|
|
6
3
|
import * as Inspectable from "effect/Inspectable"
|
|
7
4
|
import * as Option from "effect/Option"
|
|
5
|
+
import type * as ParseResult from "effect/ParseResult"
|
|
6
|
+
import * as Schema from "effect/Schema"
|
|
7
|
+
import type { ParseOptions } from "effect/SchemaAST"
|
|
8
8
|
import * as Stream from "effect/Stream"
|
|
9
9
|
import type { Unify } from "effect/Unify"
|
|
10
10
|
import * as Cookies from "../Cookies.js"
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { ParseOptions } from "@effect/schema/AST"
|
|
2
|
-
import * as Schema from "@effect/schema/Schema"
|
|
3
1
|
import type * as Cause from "effect/Cause"
|
|
4
2
|
import * as Chunk from "effect/Chunk"
|
|
5
3
|
import * as Context from "effect/Context"
|
|
@@ -12,6 +10,8 @@ import * as Inspectable from "effect/Inspectable"
|
|
|
12
10
|
import * as Layer from "effect/Layer"
|
|
13
11
|
import * as Option from "effect/Option"
|
|
14
12
|
import * as Predicate from "effect/Predicate"
|
|
13
|
+
import * as Schema from "effect/Schema"
|
|
14
|
+
import type { ParseOptions } from "effect/SchemaAST"
|
|
15
15
|
import * as Tracer from "effect/Tracer"
|
|
16
16
|
import type { Mutable } from "effect/Types"
|
|
17
17
|
import * as FindMyWay from "find-my-way-ts"
|
|
@@ -9,6 +9,10 @@ import * as ClientRequest from "../HttpClientRequest.js"
|
|
|
9
9
|
import type * as Middleware from "../HttpMiddleware.js"
|
|
10
10
|
import type * as Server from "../HttpServer.js"
|
|
11
11
|
import type * as ServerRequest from "../HttpServerRequest.js"
|
|
12
|
+
import * as internalEtag from "./etag.js"
|
|
13
|
+
import * as internalFileSystem from "./fileSystem.js"
|
|
14
|
+
import * as internalPlatform from "./httpPlatform.js"
|
|
15
|
+
import * as internalPath from "./path.js"
|
|
12
16
|
|
|
13
17
|
/** @internal */
|
|
14
18
|
export const TypeId: Server.TypeId = Symbol.for("@effect/platform/HttpServer") as Server.TypeId
|
|
@@ -181,3 +185,12 @@ export const makeTestClient = addressWith((address) =>
|
|
|
181
185
|
|
|
182
186
|
/** @internal */
|
|
183
187
|
export const layerTestClient = Layer.effect(Client.HttpClient, makeTestClient)
|
|
188
|
+
|
|
189
|
+
/** @internal */
|
|
190
|
+
export const layerContext = Layer.mergeAll(
|
|
191
|
+
internalPlatform.layer,
|
|
192
|
+
internalPath.layer,
|
|
193
|
+
internalEtag.layerWeak
|
|
194
|
+
).pipe(
|
|
195
|
+
Layer.provideMerge(internalFileSystem.layerNoop({}))
|
|
196
|
+
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ParseOptions } from "@effect/schema/AST"
|
|
2
|
-
import type * as ParseResult from "@effect/schema/ParseResult"
|
|
3
|
-
import * as Schema from "@effect/schema/Schema"
|
|
4
1
|
import * as Channel from "effect/Channel"
|
|
5
2
|
import * as Context from "effect/Context"
|
|
6
3
|
import * as Effect from "effect/Effect"
|
|
7
4
|
import * as Inspectable from "effect/Inspectable"
|
|
8
5
|
import * as Option from "effect/Option"
|
|
6
|
+
import type * as ParseResult from "effect/ParseResult"
|
|
9
7
|
import type { ReadonlyRecord } from "effect/Record"
|
|
8
|
+
import * as Schema from "effect/Schema"
|
|
9
|
+
import type { ParseOptions } from "effect/SchemaAST"
|
|
10
10
|
import type * as Scope from "effect/Scope"
|
|
11
11
|
import * as Stream from "effect/Stream"
|
|
12
12
|
import * as Cookies from "../Cookies.js"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ParseOptions } from "@effect/schema/AST"
|
|
2
|
-
import type * as Schema from "@effect/schema/Schema"
|
|
3
1
|
import * as Context from "effect/Context"
|
|
4
2
|
import * as Effect from "effect/Effect"
|
|
5
3
|
import * as Effectable from "effect/Effectable"
|
|
6
4
|
import { dual } from "effect/Function"
|
|
7
5
|
import * as Inspectable from "effect/Inspectable"
|
|
8
6
|
import * as Runtime from "effect/Runtime"
|
|
7
|
+
import type * as Schema from "effect/Schema"
|
|
8
|
+
import type { ParseOptions } from "effect/SchemaAST"
|
|
9
9
|
import * as Stream from "effect/Stream"
|
|
10
10
|
import * as Cookies from "../Cookies.js"
|
|
11
11
|
import type * as PlatformError from "../Error.js"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as Schema from "@effect/schema/Schema"
|
|
2
1
|
import * as Context from "effect/Context"
|
|
3
2
|
import * as Effect from "effect/Effect"
|
|
4
3
|
import * as Either from "effect/Either"
|
|
@@ -7,6 +6,7 @@ import type { LazyArg } from "effect/Function"
|
|
|
7
6
|
import { dual, identity, pipe } from "effect/Function"
|
|
8
7
|
import * as Layer from "effect/Layer"
|
|
9
8
|
import * as Option from "effect/Option"
|
|
9
|
+
import * as Schema from "effect/Schema"
|
|
10
10
|
import * as PlatformError from "../Error.js"
|
|
11
11
|
import * as FileSystem from "../FileSystem.js"
|
|
12
12
|
import type * as KeyValueStore from "../KeyValueStore.js"
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import type { ParseOptions } from "@effect/schema/AST"
|
|
2
|
-
import type * as ParseResult from "@effect/schema/ParseResult"
|
|
3
|
-
import * as Schema from "@effect/schema/Schema"
|
|
4
1
|
import * as Cause from "effect/Cause"
|
|
5
2
|
import * as Channel from "effect/Channel"
|
|
6
3
|
import * as Chunk from "effect/Chunk"
|
|
@@ -10,8 +7,11 @@ import { dual, flow, pipe } from "effect/Function"
|
|
|
10
7
|
import { globalValue } from "effect/GlobalValue"
|
|
11
8
|
import * as Inspectable from "effect/Inspectable"
|
|
12
9
|
import * as Option from "effect/Option"
|
|
10
|
+
import type * as ParseResult from "effect/ParseResult"
|
|
13
11
|
import * as Predicate from "effect/Predicate"
|
|
14
12
|
import * as Queue from "effect/Queue"
|
|
13
|
+
import * as Schema from "effect/Schema"
|
|
14
|
+
import type { ParseOptions } from "effect/SchemaAST"
|
|
15
15
|
import type * as Scope from "effect/Scope"
|
|
16
16
|
import type * as AsyncInput from "effect/SingleProducerAsyncInput"
|
|
17
17
|
import * as Stream from "effect/Stream"
|
package/src/internal/worker.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as Schema from "@effect/schema/Schema"
|
|
2
|
-
import * as Serializable from "@effect/schema/Serializable"
|
|
3
1
|
import * as Channel from "effect/Channel"
|
|
4
2
|
import * as Context from "effect/Context"
|
|
5
3
|
import * as Deferred from "effect/Deferred"
|
|
@@ -13,6 +11,7 @@ import * as Mailbox from "effect/Mailbox"
|
|
|
13
11
|
import * as Option from "effect/Option"
|
|
14
12
|
import * as Pool from "effect/Pool"
|
|
15
13
|
import * as Schedule from "effect/Schedule"
|
|
14
|
+
import * as Schema from "effect/Schema"
|
|
16
15
|
import * as Scope from "effect/Scope"
|
|
17
16
|
import * as Stream from "effect/Stream"
|
|
18
17
|
import * as Tracer from "effect/Tracer"
|
|
@@ -298,14 +297,14 @@ export const makeSerialized = <
|
|
|
298
297
|
...options as any,
|
|
299
298
|
encode(message) {
|
|
300
299
|
return Effect.mapError(
|
|
301
|
-
|
|
300
|
+
Schema.serialize(message as any),
|
|
302
301
|
(cause) => new WorkerError({ reason: "encode", cause })
|
|
303
302
|
)
|
|
304
303
|
}
|
|
305
304
|
})
|
|
306
305
|
const execute = <Req extends I>(message: Req) => {
|
|
307
|
-
const parseSuccess = Schema.decode(
|
|
308
|
-
const parseFailure = Schema.decode(
|
|
306
|
+
const parseSuccess = Schema.decode(Schema.successSchema(message as any))
|
|
307
|
+
const parseFailure = Schema.decode(Schema.failureSchema(message as any))
|
|
309
308
|
return pipe(
|
|
310
309
|
backing.execute(message),
|
|
311
310
|
Stream.catchAll((error) => Effect.flatMap(parseFailure(error), Effect.fail)),
|
|
@@ -313,8 +312,8 @@ export const makeSerialized = <
|
|
|
313
312
|
)
|
|
314
313
|
}
|
|
315
314
|
const executeEffect = <Req extends I>(message: Req) => {
|
|
316
|
-
const parseSuccess = Schema.decode(
|
|
317
|
-
const parseFailure = Schema.decode(
|
|
315
|
+
const parseSuccess = Schema.decode(Schema.successSchema(message as any))
|
|
316
|
+
const parseFailure = Schema.decode(Schema.failureSchema(message as any))
|
|
318
317
|
return Effect.matchEffect(backing.executeEffect(message), {
|
|
319
318
|
onFailure: (error) => Effect.flatMap(parseFailure(error), Effect.fail),
|
|
320
319
|
onSuccess: parseSuccess
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as Schema from "@effect/schema/Schema"
|
|
2
|
-
import * as Serializable from "@effect/schema/Serializable"
|
|
3
1
|
import * as Cause from "effect/Cause"
|
|
4
2
|
import * as Chunk from "effect/Chunk"
|
|
5
3
|
import * as Context from "effect/Context"
|
|
@@ -9,6 +7,7 @@ import * as Fiber from "effect/Fiber"
|
|
|
9
7
|
import { pipe } from "effect/Function"
|
|
10
8
|
import * as Layer from "effect/Layer"
|
|
11
9
|
import * as Schedule from "effect/Schedule"
|
|
10
|
+
import * as Schema from "effect/Schema"
|
|
12
11
|
import type * as Scope from "effect/Scope"
|
|
13
12
|
import * as Stream from "effect/Stream"
|
|
14
13
|
import * as Transferable from "../Transferable.js"
|
|
@@ -189,13 +188,13 @@ export const makeSerialized = <
|
|
|
189
188
|
},
|
|
190
189
|
encodeError(request, message) {
|
|
191
190
|
return Effect.mapError(
|
|
192
|
-
|
|
191
|
+
Schema.serializeFailure(request as any, message),
|
|
193
192
|
(cause) => new WorkerError({ reason: "encode", cause })
|
|
194
193
|
)
|
|
195
194
|
},
|
|
196
195
|
encodeOutput(request, message) {
|
|
197
196
|
return Effect.catchAllCause(
|
|
198
|
-
|
|
197
|
+
Schema.serializeSuccess(request as any, message),
|
|
199
198
|
(cause) => new WorkerError({ reason: "encode", cause })
|
|
200
199
|
)
|
|
201
200
|
}
|