effect 4.0.0-beta.103 → 4.0.0-beta.104
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/dist/Cache.js +1 -1
- package/dist/Cache.js.map +1 -1
- package/dist/Channel.d.ts +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js.map +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +28 -7
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +2 -1
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Context.d.ts +2 -2
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js.map +1 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +13 -5
- package/dist/Crypto.js.map +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +12 -1
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +132 -14
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +38 -0
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +10 -2
- package/dist/Equal.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +73 -0
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +1 -1
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/FiberSet.js +1 -1
- package/dist/FileSystem.d.ts +2 -2
- package/dist/Function.d.ts +4 -3
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +5 -5
- package/dist/Function.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +11 -10
- package/dist/Iterable.js.map +1 -1
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +7 -5
- package/dist/Layer.js.map +1 -1
- package/dist/Schedule.d.ts +8 -8
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +4 -4
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +32 -32
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +23 -18
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +3 -3
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +47 -31
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +35 -53
- package/dist/SchemaParser.js.map +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Sink.d.ts +1 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Stream.d.ts +27 -4
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +27 -2
- package/dist/Stream.js.map +1 -1
- package/dist/SynchronizedRef.js +1 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Terminal.js +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tuple.d.ts +6 -4
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +0 -56
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +8 -8
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/internal/dateTime.js +1 -1
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/executionPlan.js +51 -3
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/hashMap.js +12 -8
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/annotations.js +2 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/toArbitrary.js +1 -1
- package/dist/internal/schema/toArbitrary.js.map +1 -1
- package/dist/internal/trie.js +13 -3
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +11 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +1 -1
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +19 -19
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.js +1 -1
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +4 -2
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +132 -132
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +8 -8
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.js +1 -1
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +15 -3
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +6 -3
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +3 -3
- package/dist/unstable/cli/CliError.js +11 -11
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +9 -9
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +8 -6
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +7 -5
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +15 -11
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +31 -24
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +31 -17
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.js +2 -2
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +2 -2
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +10 -9
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js +69 -9
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js +24 -18
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/completions/fish.js +5 -5
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts.map +1 -1
- package/dist/unstable/cli/internal/help.js +4 -2
- package/dist/unstable/cli/internal/help.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +3 -3
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.js +2 -2
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +7 -7
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +8 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +8 -0
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +12 -0
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +4 -2
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +1 -2
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +7 -6
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +22 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +1 -1
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +2 -2
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +17 -0
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +7 -2
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/encoding/Ini.d.ts +20 -0
- package/dist/unstable/encoding/Ini.d.ts.map +1 -0
- package/dist/unstable/encoding/Ini.js +153 -0
- package/dist/unstable/encoding/Ini.js.map +1 -0
- package/dist/unstable/encoding/Msgpack.d.ts +2 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +21 -7
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +7 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +14 -23
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/Toml.d.ts +19 -0
- package/dist/unstable/encoding/Toml.d.ts.map +1 -0
- package/dist/unstable/encoding/Toml.js +434 -0
- package/dist/unstable/encoding/Toml.js.map +1 -0
- package/dist/unstable/encoding/Yaml.d.ts +19 -0
- package/dist/unstable/encoding/Yaml.d.ts.map +1 -0
- package/dist/unstable/encoding/Yaml.js +461 -0
- package/dist/unstable/encoding/Yaml.js.map +1 -0
- package/dist/unstable/encoding/index.d.ts +12 -0
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +12 -0
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +13 -5
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +1 -4
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/http/FindMyWay/internal/queryString.d.ts +11 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.d.ts.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.js +259 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.js.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/router.d.ts +2 -0
- package/dist/unstable/http/FindMyWay/internal/router.d.ts.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/router.js +665 -0
- package/dist/unstable/http/FindMyWay/internal/router.js.map +1 -0
- package/dist/unstable/http/FindMyWay.d.ts +33 -8
- package/dist/unstable/http/FindMyWay.d.ts.map +1 -1
- package/dist/unstable/http/FindMyWay.js +4 -7
- package/dist/unstable/http/FindMyWay.js.map +1 -1
- package/dist/unstable/http/HttpClientError.js +1 -1
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +2 -14
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +1 -16
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +21 -3
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +7 -6
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +8 -6
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +1 -1
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +9 -2
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/MultipartParser/HeadersParser.d.ts +53 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.js +14 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.js.map +1 -0
- package/dist/unstable/http/MultipartParser/Search.d.ts +11 -0
- package/dist/unstable/http/MultipartParser/Search.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/Search.js +14 -0
- package/dist/unstable/http/MultipartParser/Search.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.d.ts +5 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.js +82 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/headers.d.ts +3 -0
- package/dist/unstable/http/MultipartParser/internal/headers.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/headers.js +194 -0
- package/dist/unstable/http/MultipartParser/internal/headers.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts +8 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.js +226 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/search.d.ts +5 -0
- package/dist/unstable/http/MultipartParser/internal/search.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/search.js +120 -0
- package/dist/unstable/http/MultipartParser/internal/search.js.map +1 -0
- package/dist/unstable/http/MultipartParser.d.ts +98 -0
- package/dist/unstable/http/MultipartParser.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser.js +23 -0
- package/dist/unstable/http/MultipartParser.js.map +1 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +2 -2
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/index.d.ts +1 -1
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +1 -1
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/httpBody.d.ts +2 -0
- package/dist/unstable/http/internal/httpBody.d.ts.map +1 -0
- package/dist/unstable/http/internal/httpBody.js +10 -0
- package/dist/unstable/http/internal/httpBody.js.map +1 -0
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +5 -5
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +68 -15
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +65 -25
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +6 -4
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +73 -16
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +5 -5
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +17 -17
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +219 -0
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +170 -0
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +8 -0
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +45 -18
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +2 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +2 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +2 -2
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +28 -15
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +1 -1
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +9 -9
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +17 -7
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +22 -12
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +15 -42
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.js +1 -1
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +14 -0
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +18 -9
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +2 -2
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +3 -1
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +1 -1
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +5 -5
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +17 -9
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +28 -12
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -3
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlError.js +13 -13
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +8 -6
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +8 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/WorkerError.js +5 -5
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +3 -3
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +2 -8
- package/src/Cache.ts +1 -1
- package/src/Channel.ts +1 -1
- package/src/Config.ts +28 -7
- package/src/ConfigProvider.ts +4 -1
- package/src/Context.ts +5 -5
- package/src/Crypto.ts +17 -8
- package/src/Duration.ts +16 -2
- package/src/Effect.ts +141 -17
- package/src/Equal.ts +10 -2
- package/src/ExecutionPlan.ts +78 -1
- package/src/FiberSet.ts +1 -1
- package/src/FileSystem.ts +2 -2
- package/src/Function.ts +6 -6
- package/src/Iterable.ts +11 -10
- package/src/Layer.ts +7 -5
- package/src/Schedule.ts +13 -13
- package/src/Schema.ts +50 -41
- package/src/SchemaAST.ts +69 -37
- package/src/SchemaParser.ts +75 -69
- package/src/ScopedCache.ts +1 -1
- package/src/Sink.ts +1 -1
- package/src/Stream.ts +77 -10
- package/src/SynchronizedRef.ts +1 -1
- package/src/Terminal.ts +1 -1
- package/src/Tuple.ts +7 -4
- package/src/TxReentrantLock.ts +39 -35
- package/src/internal/dateTime.ts +1 -1
- package/src/internal/executionPlan.ts +105 -10
- package/src/internal/hashMap.ts +20 -14
- package/src/internal/matcher.ts +2 -2
- package/src/internal/schedule.ts +4 -4
- package/src/internal/schema/annotations.ts +3 -0
- package/src/internal/schema/toArbitrary.ts +3 -1
- package/src/internal/trie.ts +12 -2
- package/src/testing/TestClock.ts +13 -1
- package/src/testing/TestSchema.ts +1 -1
- package/src/unstable/ai/AiError.ts +19 -19
- package/src/unstable/ai/Chat.ts +1 -1
- package/src/unstable/ai/LanguageModel.ts +4 -2
- package/src/unstable/ai/McpSchema.ts +17 -16
- package/src/unstable/ai/McpServer.ts +1 -1
- package/src/unstable/ai/Prompt.ts +21 -6
- package/src/unstable/cli/CliError.ts +12 -12
- package/src/unstable/cli/Command.ts +12 -10
- package/src/unstable/cli/Param.ts +41 -19
- package/src/unstable/cli/Primitive.ts +11 -5
- package/src/unstable/cli/Prompt.ts +36 -20
- package/src/unstable/cli/internal/ansi.ts +2 -2
- package/src/unstable/cli/internal/command.ts +15 -10
- package/src/unstable/cli/internal/completions/bash.ts +59 -9
- package/src/unstable/cli/internal/completions/descriptor.ts +14 -20
- package/src/unstable/cli/internal/completions/fish.ts +5 -7
- package/src/unstable/cli/internal/help.ts +4 -2
- package/src/unstable/cli/internal/parser.ts +3 -3
- package/src/unstable/cli/internal/wizard.ts +2 -2
- package/src/unstable/cluster/ClusterError.ts +7 -7
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -1
- package/src/unstable/cluster/MessageStorage.ts +9 -5
- package/src/unstable/cluster/Reply.ts +21 -0
- package/src/unstable/cluster/RunnerServer.ts +4 -10
- package/src/unstable/cluster/RunnerStorage.ts +9 -7
- package/src/unstable/cluster/Sharding.ts +35 -7
- package/src/unstable/cluster/internal/entityManager.ts +1 -1
- package/src/unstable/cluster/internal/resourceMap.ts +5 -2
- package/src/unstable/cluster/internal/resourceRef.ts +27 -5
- package/src/unstable/devtools/DevToolsClient.ts +3 -2
- package/src/unstable/encoding/Ini.ts +174 -0
- package/src/unstable/encoding/Msgpack.ts +47 -28
- package/src/unstable/encoding/Ndjson.ts +9 -1
- package/src/unstable/encoding/Sse.ts +11 -21
- package/src/unstable/encoding/Toml.ts +504 -0
- package/src/unstable/encoding/Yaml.ts +541 -0
- package/src/unstable/encoding/index.ts +15 -0
- package/src/unstable/eventlog/EventJournal.ts +14 -6
- package/src/unstable/eventlog/EventLogMessage.ts +1 -1
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +1 -1
- package/src/unstable/eventlog/SqlEventJournal.ts +6 -4
- package/src/unstable/http/FindMyWay/internal/queryString.ts +420 -0
- package/src/unstable/http/FindMyWay/internal/router.ts +950 -0
- package/src/unstable/http/FindMyWay.ts +65 -6
- package/src/unstable/http/HttpClientError.ts +1 -1
- package/src/unstable/http/HttpClientRequest.ts +2 -14
- package/src/unstable/http/HttpClientResponse.ts +1 -17
- package/src/unstable/http/HttpPlatform.ts +34 -6
- package/src/unstable/http/HttpServerRequest.ts +14 -6
- package/src/unstable/http/HttpServerResponse.ts +9 -7
- package/src/unstable/http/Multipart.ts +9 -2
- package/src/unstable/http/MultipartParser/HeadersParser.ts +68 -0
- package/src/unstable/http/MultipartParser/Search.ts +17 -0
- package/src/unstable/http/MultipartParser/internal/contentType.ts +103 -0
- package/src/unstable/http/MultipartParser/internal/headers.ts +615 -0
- package/src/unstable/http/MultipartParser/internal/multipart.ts +262 -0
- package/src/unstable/http/MultipartParser/internal/search.ts +167 -0
- package/src/unstable/http/MultipartParser.ts +115 -0
- package/src/unstable/http/Template.ts +6 -5
- package/src/unstable/http/index.ts +1 -1
- package/src/unstable/http/internal/httpBody.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +6 -7
- package/src/unstable/httpapi/HttpApiBuilder.ts +119 -21
- package/src/unstable/httpapi/HttpApiClient.ts +104 -41
- package/src/unstable/httpapi/HttpApiEndpoint.ts +117 -29
- package/src/unstable/httpapi/HttpApiError.ts +33 -39
- package/src/unstable/httpapi/HttpApiMiddleware.ts +1 -1
- package/src/unstable/httpapi/HttpApiSchema.ts +353 -0
- package/src/unstable/httpapi/OpenApi.ts +70 -20
- package/src/unstable/observability/OtlpExporter.ts +4 -2
- package/src/unstable/observability/OtlpLogger.ts +3 -1
- package/src/unstable/observability/OtlpMetrics.ts +32 -18
- package/src/unstable/observability/OtlpTracer.ts +1 -1
- package/src/unstable/persistence/PersistedQueue.ts +12 -9
- package/src/unstable/persistence/Persistence.ts +27 -7
- package/src/unstable/persistence/RateLimiter.ts +54 -31
- package/src/unstable/persistence/Redis.ts +1 -1
- package/src/unstable/rpc/RpcClient.ts +38 -12
- package/src/unstable/rpc/RpcClientError.ts +2 -2
- package/src/unstable/rpc/RpcSerialization.ts +1 -1
- package/src/unstable/schema/VariantSchema.ts +36 -18
- package/src/unstable/socket/Socket.ts +24 -14
- package/src/unstable/sql/SqlClient.ts +65 -56
- package/src/unstable/sql/SqlError.ts +13 -13
- package/src/unstable/sql/SqlResolver.ts +8 -6
- package/src/unstable/sql/Statement.ts +13 -8
- package/src/unstable/workers/WorkerError.ts +5 -5
- package/src/unstable/workflow/WorkflowEngine.ts +8 -3
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts +0 -14
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/HeadersParser.js +0 -14
- package/dist/unstable/http/Multipasta/HeadersParser.js.map +0 -1
- package/dist/unstable/http/Multipasta/Node.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Node.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Node.js +0 -14
- package/dist/unstable/http/Multipasta/Node.js.map +0 -1
- package/dist/unstable/http/Multipasta/Search.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Search.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Search.js +0 -14
- package/dist/unstable/http/Multipasta/Search.js.map +0 -1
- package/dist/unstable/http/Multipasta/Web.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Web.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Web.js +0 -14
- package/dist/unstable/http/Multipasta/Web.js.map +0 -1
- package/dist/unstable/http/Multipasta.d.ts +0 -15
- package/dist/unstable/http/Multipasta.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta.js +0 -15
- package/dist/unstable/http/Multipasta.js.map +0 -1
- package/src/unstable/http/Multipasta/HeadersParser.ts +0 -14
- package/src/unstable/http/Multipasta/Node.ts +0 -14
- package/src/unstable/http/Multipasta/Search.ts +0 -14
- package/src/unstable/http/Multipasta/Web.ts +0 -14
- package/src/unstable/http/Multipasta.ts +0 -15
package/src/ExecutionPlan.ts
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* @since 3.16.0
|
|
11
11
|
*/
|
|
12
12
|
import type { NonEmptyReadonlyArray } from "./Array.ts"
|
|
13
|
+
import type * as Cause from "./Cause.ts"
|
|
13
14
|
import * as Context from "./Context.ts"
|
|
15
|
+
import type * as Duration from "./Duration.ts"
|
|
14
16
|
import type * as Effect from "./Effect.ts"
|
|
15
17
|
import { constant } from "./Function.ts"
|
|
16
18
|
import * as effect from "./internal/effect.ts"
|
|
@@ -179,7 +181,7 @@ export const make = <const Steps extends NonEmptyReadonlyArray<make.Step>>(
|
|
|
179
181
|
| (Steps[number]["schedule"] extends Schedule.Schedule<infer _O, infer _I, infer R> ? R : never)
|
|
180
182
|
}> =>
|
|
181
183
|
makeProto(steps.map((options, i) => {
|
|
182
|
-
if (options.attempts && options.attempts < 1) {
|
|
184
|
+
if (options.attempts !== undefined && options.attempts < 1) {
|
|
183
185
|
throw new Error(`ExecutionPlan.make: step[${i}].attempts must be greater than 0`)
|
|
184
186
|
}
|
|
185
187
|
return {
|
|
@@ -372,3 +374,78 @@ export const CurrentMetadata = Context.Reference<Metadata>("effect/ExecutionPlan
|
|
|
372
374
|
stepIndex: 0
|
|
373
375
|
})
|
|
374
376
|
})
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Lifecycle event emitted before an execution-plan attempt runs.
|
|
380
|
+
*
|
|
381
|
+
* **Details**
|
|
382
|
+
*
|
|
383
|
+
* `attempt` is the cumulative 1-based attempt number across all steps and
|
|
384
|
+
* matches `CurrentMetadata.attempt` for the same attempt. `stepAttempt` is the
|
|
385
|
+
* 1-based attempt number within the current step, and `stepIndex` is the
|
|
386
|
+
* 0-based index of the step being attempted.
|
|
387
|
+
*
|
|
388
|
+
* @category models
|
|
389
|
+
* @since 4.0.0
|
|
390
|
+
*/
|
|
391
|
+
export interface AttemptStart {
|
|
392
|
+
readonly _tag: "AttemptStart"
|
|
393
|
+
readonly attempt: number
|
|
394
|
+
readonly stepAttempt: number
|
|
395
|
+
readonly stepIndex: number
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Lifecycle event emitted when an execution-plan attempt succeeds.
|
|
400
|
+
*
|
|
401
|
+
* **Details**
|
|
402
|
+
*
|
|
403
|
+
* A successful attempt completes the plan, so this is always the final event.
|
|
404
|
+
* `duration` is the elapsed time of the attempt.
|
|
405
|
+
*
|
|
406
|
+
* @category models
|
|
407
|
+
* @since 4.0.0
|
|
408
|
+
*/
|
|
409
|
+
export interface AttemptSuccess {
|
|
410
|
+
readonly _tag: "AttemptSuccess"
|
|
411
|
+
readonly attempt: number
|
|
412
|
+
readonly stepAttempt: number
|
|
413
|
+
readonly stepIndex: number
|
|
414
|
+
readonly duration: Duration.Duration
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Lifecycle event emitted when an execution-plan attempt fails.
|
|
419
|
+
*
|
|
420
|
+
* **Details**
|
|
421
|
+
*
|
|
422
|
+
* `cause` holds the full failure cause, so defects and interruption are
|
|
423
|
+
* reported as well as expected errors. Whether the plan retries or fails over
|
|
424
|
+
* afterwards is decided by the step's `attempts`, `while`, and `schedule`; a
|
|
425
|
+
* following `AttemptStart` indicates another attempt was made.
|
|
426
|
+
*
|
|
427
|
+
* @category models
|
|
428
|
+
* @since 4.0.0
|
|
429
|
+
*/
|
|
430
|
+
export interface AttemptFailure<E> {
|
|
431
|
+
readonly _tag: "AttemptFailure"
|
|
432
|
+
readonly attempt: number
|
|
433
|
+
readonly stepAttempt: number
|
|
434
|
+
readonly stepIndex: number
|
|
435
|
+
readonly duration: Duration.Duration
|
|
436
|
+
readonly cause: Cause.Cause<E>
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Union of the lifecycle events emitted while an execution plan runs.
|
|
441
|
+
*
|
|
442
|
+
* **Details**
|
|
443
|
+
*
|
|
444
|
+
* Every `AttemptStart` is followed by exactly one terminal event, either
|
|
445
|
+
* `AttemptSuccess` or `AttemptFailure`. An interrupted attempt emits
|
|
446
|
+
* `AttemptFailure` with the interruption cause.
|
|
447
|
+
*
|
|
448
|
+
* @category models
|
|
449
|
+
* @since 4.0.0
|
|
450
|
+
*/
|
|
451
|
+
export type Event<E> = AttemptStart | AttemptSuccess | AttemptFailure<E>
|
package/src/FiberSet.ts
CHANGED
package/src/FileSystem.ts
CHANGED
|
@@ -1010,7 +1010,7 @@ export const isFile = (u: unknown): u is File => hasProperty(u, FileTypeId)
|
|
|
1010
1010
|
* const file: FileSystem.File = {
|
|
1011
1011
|
* [FileSystem.FileTypeId]: FileSystem.FileTypeId,
|
|
1012
1012
|
* stat: Effect.succeed({ size: FileSystem.Size(5) } as FileSystem.File.Info),
|
|
1013
|
-
* seek: () => Effect.
|
|
1013
|
+
* seek: () => Effect.succeed(FileSystem.Size(0)),
|
|
1014
1014
|
* sync: Effect.void,
|
|
1015
1015
|
* read: (buffer) => Effect.sync(() => {
|
|
1016
1016
|
* buffer.set([1, 2, 3, 4, 5])
|
|
@@ -1040,7 +1040,7 @@ export const isFile = (u: unknown): u is File => hasProperty(u, FileTypeId)
|
|
|
1040
1040
|
export interface File {
|
|
1041
1041
|
readonly [FileTypeId]: typeof FileTypeId
|
|
1042
1042
|
readonly stat: Effect.Effect<File.Info, PlatformError>
|
|
1043
|
-
readonly seek: (offset: SizeInput, from: SeekMode) => Effect.Effect<
|
|
1043
|
+
readonly seek: (offset: SizeInput, from: SeekMode) => Effect.Effect<Size>
|
|
1044
1044
|
readonly sync: Effect.Effect<void, PlatformError>
|
|
1045
1045
|
readonly read: (buffer: Uint8Array) => Effect.Effect<Size, PlatformError>
|
|
1046
1046
|
readonly readAlloc: (size: SizeInput) => Effect.Effect<Option.Option<Uint8Array>, PlatformError>
|
package/src/Function.ts
CHANGED
|
@@ -1493,11 +1493,12 @@ export const SK = <A, B>(_: A, b: B): B => b
|
|
|
1493
1493
|
* **Details**
|
|
1494
1494
|
*
|
|
1495
1495
|
* Each memoized wrapper owns a private `WeakMap` keyed by object identity.
|
|
1496
|
-
* Cached `undefined` results are still returned because the cache is checked
|
|
1497
|
-
* with `WeakMap.has`.
|
|
1498
1496
|
*
|
|
1499
1497
|
* **Gotchas**
|
|
1500
1498
|
*
|
|
1499
|
+
* `undefined` is reserved to represent a cache miss and is therefore not
|
|
1500
|
+
* supported as a return value.
|
|
1501
|
+
*
|
|
1501
1502
|
* Structurally equal objects do not share cache entries. If the same object is
|
|
1502
1503
|
* mutated after its first call, later calls still return the cached result for
|
|
1503
1504
|
* that reference.
|
|
@@ -1505,12 +1506,11 @@ export const SK = <A, B>(_: A, b: B): B => b
|
|
|
1505
1506
|
* @category caching
|
|
1506
1507
|
* @since 4.0.0
|
|
1507
1508
|
*/
|
|
1508
|
-
export function memoize<A extends object, O>(f: (a: A) => O): (ast: A) => O {
|
|
1509
|
+
export function memoize<A extends object, O extends {} | null>(f: (a: A) => O): (ast: A) => O {
|
|
1509
1510
|
const cache = new WeakMap<object, O>()
|
|
1510
1511
|
return (a) => {
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
}
|
|
1512
|
+
const cached = cache.get(a)
|
|
1513
|
+
if (cached !== undefined) return cached
|
|
1514
1514
|
const result = f(a)
|
|
1515
1515
|
cache.set(a, result)
|
|
1516
1516
|
return result
|
package/src/Iterable.ts
CHANGED
|
@@ -3276,19 +3276,20 @@ export const flatten = <A>(self: Iterable<Iterable<A>>): Iterable<A> => ({
|
|
|
3276
3276
|
const outerIterator = self[Symbol.iterator]()
|
|
3277
3277
|
let innerIterator: Iterator<A> | undefined
|
|
3278
3278
|
function next() {
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3279
|
+
while (true) {
|
|
3280
|
+
if (innerIterator === undefined) {
|
|
3281
|
+
const next = outerIterator.next()
|
|
3282
|
+
if (next.done) {
|
|
3283
|
+
return next
|
|
3284
|
+
}
|
|
3285
|
+
innerIterator = next.value[Symbol.iterator]()
|
|
3286
|
+
}
|
|
3287
|
+
const result = innerIterator.next()
|
|
3288
|
+
if (!result.done) {
|
|
3289
|
+
return result
|
|
3283
3290
|
}
|
|
3284
|
-
innerIterator = next.value[Symbol.iterator]()
|
|
3285
|
-
}
|
|
3286
|
-
const result = innerIterator.next()
|
|
3287
|
-
if (result.done) {
|
|
3288
3291
|
innerIterator = undefined
|
|
3289
|
-
return next()
|
|
3290
3292
|
}
|
|
3291
|
-
return result
|
|
3292
3293
|
}
|
|
3293
3294
|
return { next }
|
|
3294
3295
|
}
|
package/src/Layer.ts
CHANGED
|
@@ -447,11 +447,13 @@ class MemoMapImpl implements MemoMap {
|
|
|
447
447
|
scope: Scope.Scope,
|
|
448
448
|
build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<ROut>, E, RIn>
|
|
449
449
|
): Effect<Context.Context<ROut>, E, RIn> {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
450
|
+
return internalEffect.suspend(() => {
|
|
451
|
+
const existing = this.get(layer, scope)
|
|
452
|
+
if (existing) {
|
|
453
|
+
return existing
|
|
454
|
+
}
|
|
455
|
+
return memoMapBuild(this, layer, scope, build)
|
|
456
|
+
})
|
|
455
457
|
}
|
|
456
458
|
}
|
|
457
459
|
|
package/src/Schedule.ts
CHANGED
|
@@ -538,14 +538,14 @@ export const addDelay: {
|
|
|
538
538
|
* ```ts import.meta.vitest
|
|
539
539
|
* import { Schedule } from "effect"
|
|
540
540
|
*
|
|
541
|
-
* const schedule = Schedule.
|
|
541
|
+
* const schedule = Schedule.concat(Schedule.recurs(1), Schedule.recurs(2))
|
|
542
542
|
* Schedule.isSchedule(schedule) // => true
|
|
543
543
|
* ```
|
|
544
544
|
*
|
|
545
545
|
* @category sequencing
|
|
546
546
|
* @since 2.0.0
|
|
547
547
|
*/
|
|
548
|
-
export const
|
|
548
|
+
export const concat: {
|
|
549
549
|
/**
|
|
550
550
|
* Returns a schedule that runs `self` to completion, then runs `other`, and
|
|
551
551
|
* merges their outputs.
|
|
@@ -555,7 +555,7 @@ export const andThen: {
|
|
|
555
555
|
* ```ts import.meta.vitest
|
|
556
556
|
* import { Schedule } from "effect"
|
|
557
557
|
*
|
|
558
|
-
* const schedule = Schedule.
|
|
558
|
+
* const schedule = Schedule.concat(Schedule.recurs(1), Schedule.recurs(2))
|
|
559
559
|
* Schedule.isSchedule(schedule) // => true
|
|
560
560
|
* ```
|
|
561
561
|
*
|
|
@@ -574,7 +574,7 @@ export const andThen: {
|
|
|
574
574
|
* ```ts import.meta.vitest
|
|
575
575
|
* import { Schedule } from "effect"
|
|
576
576
|
*
|
|
577
|
-
* const schedule = Schedule.
|
|
577
|
+
* const schedule = Schedule.concat(Schedule.recurs(1), Schedule.recurs(2))
|
|
578
578
|
* Schedule.isSchedule(schedule) // => true
|
|
579
579
|
* ```
|
|
580
580
|
*
|
|
@@ -589,7 +589,7 @@ export const andThen: {
|
|
|
589
589
|
self: Schedule<Output, Input, Error, Env>,
|
|
590
590
|
other: Schedule<Output2, Input2, Error2, Env2>
|
|
591
591
|
): Schedule<Output | Output2, Input & Input2, Error | Error2, Env | Env2> =>
|
|
592
|
-
map(
|
|
592
|
+
map(concatResult(self, other), ({ output }) => effect.succeed(Result.merge(output))))
|
|
593
593
|
|
|
594
594
|
/**
|
|
595
595
|
* Returns a schedule that runs `self` to completion, then runs `other`, and
|
|
@@ -606,14 +606,14 @@ export const andThen: {
|
|
|
606
606
|
* ```ts import.meta.vitest
|
|
607
607
|
* import { Schedule } from "effect"
|
|
608
608
|
*
|
|
609
|
-
* const schedule = Schedule.
|
|
609
|
+
* const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
|
|
610
610
|
* Schedule.isSchedule(schedule) // => true
|
|
611
611
|
* ```
|
|
612
612
|
*
|
|
613
613
|
* @category sequencing
|
|
614
614
|
* @since 4.0.0
|
|
615
615
|
*/
|
|
616
|
-
export const
|
|
616
|
+
export const concatResult: {
|
|
617
617
|
/**
|
|
618
618
|
* Returns a schedule that runs `self` to completion, then runs `other`, and
|
|
619
619
|
* preserves which schedule produced each output.
|
|
@@ -629,7 +629,7 @@ export const andThenResult: {
|
|
|
629
629
|
* ```ts import.meta.vitest
|
|
630
630
|
* import { Schedule } from "effect"
|
|
631
631
|
*
|
|
632
|
-
* const schedule = Schedule.
|
|
632
|
+
* const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
|
|
633
633
|
* Schedule.isSchedule(schedule) // => true
|
|
634
634
|
* ```
|
|
635
635
|
*
|
|
@@ -654,7 +654,7 @@ export const andThenResult: {
|
|
|
654
654
|
* ```ts import.meta.vitest
|
|
655
655
|
* import { Schedule } from "effect"
|
|
656
656
|
*
|
|
657
|
-
* const schedule = Schedule.
|
|
657
|
+
* const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
|
|
658
658
|
* Schedule.isSchedule(schedule) // => true
|
|
659
659
|
* ```
|
|
660
660
|
*
|
|
@@ -707,7 +707,7 @@ export const andThenResult: {
|
|
|
707
707
|
* ```ts import.meta.vitest
|
|
708
708
|
* import { Schedule } from "effect"
|
|
709
709
|
*
|
|
710
|
-
* const schedule = Schedule.
|
|
710
|
+
* const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
|
|
711
711
|
* Schedule.isSchedule(schedule) // => true
|
|
712
712
|
* ```
|
|
713
713
|
*
|
|
@@ -730,7 +730,7 @@ export const andThenResult: {
|
|
|
730
730
|
* ```ts import.meta.vitest
|
|
731
731
|
* import { Schedule } from "effect"
|
|
732
732
|
*
|
|
733
|
-
* const schedule = Schedule.
|
|
733
|
+
* const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
|
|
734
734
|
* Schedule.isSchedule(schedule) // => true
|
|
735
735
|
* ```
|
|
736
736
|
*
|
|
@@ -753,7 +753,7 @@ export const andThenResult: {
|
|
|
753
753
|
* ```ts import.meta.vitest
|
|
754
754
|
* import { Schedule } from "effect"
|
|
755
755
|
*
|
|
756
|
-
* const schedule = Schedule.
|
|
756
|
+
* const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
|
|
757
757
|
* Schedule.isSchedule(schedule) // => true
|
|
758
758
|
* ```
|
|
759
759
|
*
|
|
@@ -776,7 +776,7 @@ export const andThenResult: {
|
|
|
776
776
|
* ```ts import.meta.vitest
|
|
777
777
|
* import { Schedule } from "effect"
|
|
778
778
|
*
|
|
779
|
-
* const schedule = Schedule.
|
|
779
|
+
* const schedule = Schedule.concatResult(Schedule.recurs(1), Schedule.recurs(2))
|
|
780
780
|
* Schedule.isSchedule(schedule) // => true
|
|
781
781
|
* ```
|
|
782
782
|
*
|
package/src/Schema.ts
CHANGED
|
@@ -10524,17 +10524,17 @@ function causeToFormatter<E>(error: Formatter<E>, defect: Formatter<unknown>) {
|
|
|
10524
10524
|
}
|
|
10525
10525
|
|
|
10526
10526
|
/**
|
|
10527
|
-
* Type-level representation of {@link
|
|
10527
|
+
* Type-level representation of {@link ErrorInstance}.
|
|
10528
10528
|
*
|
|
10529
10529
|
* @category models
|
|
10530
10530
|
* @since 4.0.0
|
|
10531
10531
|
*/
|
|
10532
|
-
export interface
|
|
10533
|
-
readonly "Rebuild":
|
|
10532
|
+
export interface ErrorInstance extends instanceOf<globalThis.Error> {
|
|
10533
|
+
readonly "Rebuild": ErrorInstance
|
|
10534
10534
|
}
|
|
10535
10535
|
|
|
10536
10536
|
/**
|
|
10537
|
-
* Options for {@link
|
|
10537
|
+
* Options for {@link ErrorInstance} and {@link Defect}.
|
|
10538
10538
|
*
|
|
10539
10539
|
* @category options
|
|
10540
10540
|
* @since 4.0.0
|
|
@@ -10597,7 +10597,7 @@ const getErrorOptions = (key: ErrorOptionsKey): NormalizedErrorOptions | undefin
|
|
|
10597
10597
|
}
|
|
10598
10598
|
}
|
|
10599
10599
|
|
|
10600
|
-
const errorSchemaCache: Array<
|
|
10600
|
+
const errorSchemaCache: Array<ErrorInstance | undefined> = []
|
|
10601
10601
|
|
|
10602
10602
|
/**
|
|
10603
10603
|
* Schema for JavaScript `Error` objects.
|
|
@@ -10614,7 +10614,7 @@ const errorSchemaCache: Array<Error | undefined> = []
|
|
|
10614
10614
|
* @category schemas
|
|
10615
10615
|
* @since 4.0.0
|
|
10616
10616
|
*/
|
|
10617
|
-
export function
|
|
10617
|
+
export function ErrorInstance(options?: ErrorOptions): ErrorInstance {
|
|
10618
10618
|
const key = getErrorOptionsKey(options)
|
|
10619
10619
|
const cached = errorSchemaCache[key]
|
|
10620
10620
|
if (cached !== undefined) {
|
|
@@ -10627,7 +10627,9 @@ export function Error(options?: ErrorOptions): Error {
|
|
|
10627
10627
|
payload: normalizedOptions ?? null
|
|
10628
10628
|
},
|
|
10629
10629
|
toCode: () => ({
|
|
10630
|
-
runtime: normalizedOptions !== undefined
|
|
10630
|
+
runtime: normalizedOptions !== undefined
|
|
10631
|
+
? `Schema.ErrorInstance(${format(normalizedOptions)})`
|
|
10632
|
+
: `Schema.ErrorInstance()`,
|
|
10631
10633
|
Type: `globalThis.Error`
|
|
10632
10634
|
}),
|
|
10633
10635
|
expected: "Error",
|
|
@@ -10639,22 +10641,22 @@ export function Error(options?: ErrorOptions): Error {
|
|
|
10639
10641
|
}
|
|
10640
10642
|
|
|
10641
10643
|
/**
|
|
10642
|
-
* Reviver for persisted {@link
|
|
10644
|
+
* Reviver for persisted {@link ErrorInstance} declarations.
|
|
10643
10645
|
*
|
|
10644
10646
|
* **When to use**
|
|
10645
10647
|
*
|
|
10646
|
-
* Use when reconstructing documents that may contain schemas created by {@link
|
|
10648
|
+
* Use when reconstructing documents that may contain schemas created by {@link ErrorInstance}.
|
|
10647
10649
|
*
|
|
10648
|
-
* @see {@link
|
|
10650
|
+
* @see {@link ErrorInstance} for creating the corresponding schema
|
|
10649
10651
|
*
|
|
10650
10652
|
* @category schemas
|
|
10651
10653
|
* @since 4.0.0
|
|
10652
10654
|
*/
|
|
10653
|
-
export const
|
|
10655
|
+
export const ErrorInstanceReviver = InternalSchema.makeDeclarationReviver(
|
|
10654
10656
|
"effect/schema/Error",
|
|
10655
10657
|
ErrorRepresentationPayload,
|
|
10656
10658
|
({ annotations, payload }) => {
|
|
10657
|
-
const schema =
|
|
10659
|
+
const schema = ErrorInstance(payload ?? undefined)
|
|
10658
10660
|
return annotations === undefined ? schema : schema.annotate(annotations)
|
|
10659
10661
|
}
|
|
10660
10662
|
)
|
|
@@ -10708,7 +10710,7 @@ const defectSchemaCache: Array<Defect | undefined> = []
|
|
|
10708
10710
|
* - Values that cannot be represented as JSON fall back to Effect's formatted
|
|
10709
10711
|
* string representation.
|
|
10710
10712
|
*
|
|
10711
|
-
* @see {@link
|
|
10713
|
+
* @see {@link ErrorInstance} for a schema that only accepts JavaScript `Error` values.
|
|
10712
10714
|
* @category schemas
|
|
10713
10715
|
* @since 4.0.0
|
|
10714
10716
|
*/
|
|
@@ -14129,19 +14131,26 @@ function getClassSchemaFactory<S extends Constraint>(
|
|
|
14129
14131
|
if (memo !== undefined) {
|
|
14130
14132
|
return memo
|
|
14131
14133
|
}
|
|
14134
|
+
const ClassTypeId = getClassTypeId(identifier)
|
|
14135
|
+
const isClassValue: Predicate.Predicate<unknown> = (input) =>
|
|
14136
|
+
input instanceof self || Predicate.hasProperty(input, ClassTypeId)
|
|
14132
14137
|
const transformation = getClassTransformation(self)
|
|
14133
14138
|
const to = make<declareConstructor<Self, S["Encoded"], readonly [S]>>(
|
|
14134
14139
|
new SchemaAST.Declaration(
|
|
14135
14140
|
[from.ast],
|
|
14136
14141
|
() => (input, ast) => {
|
|
14137
|
-
return input
|
|
14138
|
-
Predicate.hasProperty(input, getClassTypeId(identifier)) ?
|
|
14142
|
+
return isClassValue(input) ?
|
|
14139
14143
|
Effect.succeed(input) :
|
|
14140
14144
|
Effect.fail(new SchemaIssue.InvalidType(ast))
|
|
14141
14145
|
},
|
|
14142
14146
|
{
|
|
14143
14147
|
identifier,
|
|
14144
|
-
[
|
|
14148
|
+
[InternalAnnotations.CONSTRUCTOR_ANNOTATION_KEY]: (
|
|
14149
|
+
[from]: readonly [SchemaAST.AST]
|
|
14150
|
+
): SchemaAST.ConstructorDescriptor => ({
|
|
14151
|
+
isConstructed: isClassValue,
|
|
14152
|
+
link: new SchemaAST.Link(from, transformation)
|
|
14153
|
+
}),
|
|
14145
14154
|
toCodec: ([from]: readonly [ConstraintCodec<S["Encoded"], S["Encoded"]>]) =>
|
|
14146
14155
|
new SchemaAST.Link(from.ast, transformation),
|
|
14147
14156
|
toArbitrary: ([from]: readonly [Annotations.ToArbitrary.TypeParameter<S["Type"]>]) => () => ({
|
|
@@ -14228,8 +14237,8 @@ type MissingSelfGeneric<Usage extends string> =
|
|
|
14228
14237
|
* ```
|
|
14229
14238
|
*
|
|
14230
14239
|
* @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
|
|
14231
|
-
* @see {@link
|
|
14232
|
-
* @see {@link
|
|
14240
|
+
* @see {@link Error} for defining schema-backed error classes
|
|
14241
|
+
* @see {@link TaggedError} for defining tagged schema-backed error classes
|
|
14233
14242
|
*
|
|
14234
14243
|
* @category constructors
|
|
14235
14244
|
* @since 3.10.0
|
|
@@ -14298,8 +14307,8 @@ export const Class: {
|
|
|
14298
14307
|
* ```
|
|
14299
14308
|
*
|
|
14300
14309
|
* @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
|
|
14301
|
-
* @see {@link
|
|
14302
|
-
* @see {@link
|
|
14310
|
+
* @see {@link Error} for defining schema-backed error classes
|
|
14311
|
+
* @see {@link TaggedError} for defining tagged schema-backed error classes
|
|
14303
14312
|
*
|
|
14304
14313
|
* @category constructors
|
|
14305
14314
|
* @since 3.10.0
|
|
@@ -14368,8 +14377,8 @@ export const Class: {
|
|
|
14368
14377
|
* ```
|
|
14369
14378
|
*
|
|
14370
14379
|
* @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
|
|
14371
|
-
* @see {@link
|
|
14372
|
-
* @see {@link
|
|
14380
|
+
* @see {@link Error} for defining schema-backed error classes
|
|
14381
|
+
* @see {@link TaggedError} for defining tagged schema-backed error classes
|
|
14373
14382
|
*
|
|
14374
14383
|
* @category constructors
|
|
14375
14384
|
* @since 3.10.0
|
|
@@ -14441,8 +14450,8 @@ export const Class: {
|
|
|
14441
14450
|
* ```
|
|
14442
14451
|
*
|
|
14443
14452
|
* @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
|
|
14444
|
-
* @see {@link
|
|
14445
|
-
* @see {@link
|
|
14453
|
+
* @see {@link Error} for defining schema-backed error classes
|
|
14454
|
+
* @see {@link TaggedError} for defining tagged schema-backed error classes
|
|
14446
14455
|
*
|
|
14447
14456
|
* @category constructors
|
|
14448
14457
|
* @since 3.10.0
|
|
@@ -14634,7 +14643,7 @@ export const TaggedClass: {
|
|
|
14634
14643
|
* ```ts import.meta.vitest
|
|
14635
14644
|
* import { Effect, Schema } from "effect"
|
|
14636
14645
|
*
|
|
14637
|
-
* class NotFound extends Schema.
|
|
14646
|
+
* class NotFound extends Schema.Error<NotFound>("NotFound")({
|
|
14638
14647
|
* id: Schema.Number
|
|
14639
14648
|
* }) {}
|
|
14640
14649
|
*
|
|
@@ -14648,7 +14657,7 @@ export const TaggedClass: {
|
|
|
14648
14657
|
* @category constructors
|
|
14649
14658
|
* @since 4.0.0
|
|
14650
14659
|
*/
|
|
14651
|
-
export const
|
|
14660
|
+
export const Error: {
|
|
14652
14661
|
/**
|
|
14653
14662
|
* Creates a schema-backed error class that can be used as a typed,
|
|
14654
14663
|
* yieldable error in Effect programs. Combines {@link Class} validation with
|
|
@@ -14660,7 +14669,7 @@ export const ErrorClass: {
|
|
|
14660
14669
|
* ```ts import.meta.vitest
|
|
14661
14670
|
* import { Effect, Schema } from "effect"
|
|
14662
14671
|
*
|
|
14663
|
-
* class NotFound extends Schema.
|
|
14672
|
+
* class NotFound extends Schema.Error<NotFound>("NotFound")({
|
|
14664
14673
|
* id: Schema.Number
|
|
14665
14674
|
* }) {}
|
|
14666
14675
|
*
|
|
@@ -14686,7 +14695,7 @@ export const ErrorClass: {
|
|
|
14686
14695
|
* ```ts import.meta.vitest
|
|
14687
14696
|
* import { Effect, Schema } from "effect"
|
|
14688
14697
|
*
|
|
14689
|
-
* class NotFound extends Schema.
|
|
14698
|
+
* class NotFound extends Schema.Error<NotFound>("NotFound")({
|
|
14690
14699
|
* id: Schema.Number
|
|
14691
14700
|
* }) {}
|
|
14692
14701
|
*
|
|
@@ -14703,7 +14712,7 @@ export const ErrorClass: {
|
|
|
14703
14712
|
<const Fields extends Struct.Fields>(
|
|
14704
14713
|
fields: Fields,
|
|
14705
14714
|
annotations?: Annotations.Declaration<Self, readonly [Struct<Fields>]>
|
|
14706
|
-
): [Self] extends [never] ? MissingSelfGeneric<"Schema.
|
|
14715
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.Error">
|
|
14707
14716
|
: Class<Self, Struct<Fields>, Cause_.YieldableError & Brand>
|
|
14708
14717
|
/**
|
|
14709
14718
|
* Creates a schema-backed error class that can be used as a typed,
|
|
@@ -14716,7 +14725,7 @@ export const ErrorClass: {
|
|
|
14716
14725
|
* ```ts import.meta.vitest
|
|
14717
14726
|
* import { Effect, Schema } from "effect"
|
|
14718
14727
|
*
|
|
14719
|
-
* class NotFound extends Schema.
|
|
14728
|
+
* class NotFound extends Schema.Error<NotFound>("NotFound")({
|
|
14720
14729
|
* id: Schema.Number
|
|
14721
14730
|
* }) {}
|
|
14722
14731
|
*
|
|
@@ -14730,13 +14739,13 @@ export const ErrorClass: {
|
|
|
14730
14739
|
* @category constructors
|
|
14731
14740
|
* @since 4.0.0
|
|
14732
14741
|
*/
|
|
14733
|
-
<S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.
|
|
14742
|
+
<S extends Struct<Struct.Fields>>(schema: S, annotations?: Annotations.Declaration<Self, readonly [S]>): [Self] extends [never] ? MissingSelfGeneric<"Schema.Error"> : Class<Self, S, Cause_.YieldableError & Brand>
|
|
14734
14743
|
}
|
|
14735
14744
|
} = <Self, Brand = {}>(identifier: string) =>
|
|
14736
14745
|
(
|
|
14737
14746
|
schema: Struct.Fields | Struct<Struct.Fields>,
|
|
14738
14747
|
annotations?: Annotations.Declaration<Self, readonly [Struct<Struct.Fields>]>
|
|
14739
|
-
): [Self] extends [never] ? MissingSelfGeneric<"Schema.
|
|
14748
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.Error">
|
|
14740
14749
|
: Class<Self, Struct<Struct.Fields>, Cause_.YieldableError & Brand> =>
|
|
14741
14750
|
{
|
|
14742
14751
|
const struct = isStruct(schema) ? schema : Struct(schema)
|
|
@@ -14766,7 +14775,7 @@ export const ErrorClass: {
|
|
|
14766
14775
|
* ```ts import.meta.vitest
|
|
14767
14776
|
* import { Effect, Schema } from "effect"
|
|
14768
14777
|
*
|
|
14769
|
-
* class NotFound extends Schema.
|
|
14778
|
+
* class NotFound extends Schema.TaggedError<NotFound>()("NotFound", {
|
|
14770
14779
|
* id: Schema.Number
|
|
14771
14780
|
* }) {}
|
|
14772
14781
|
*
|
|
@@ -14781,7 +14790,7 @@ export const ErrorClass: {
|
|
|
14781
14790
|
* @category constructors
|
|
14782
14791
|
* @since 3.10.0
|
|
14783
14792
|
*/
|
|
14784
|
-
export const
|
|
14793
|
+
export const TaggedError: {
|
|
14785
14794
|
/**
|
|
14786
14795
|
* Defines a schema-backed yieldable error class with an automatically populated
|
|
14787
14796
|
* `_tag` field.
|
|
@@ -14796,7 +14805,7 @@ export const TaggedErrorClass: {
|
|
|
14796
14805
|
* ```ts import.meta.vitest
|
|
14797
14806
|
* import { Effect, Schema } from "effect"
|
|
14798
14807
|
*
|
|
14799
|
-
* class NotFound extends Schema.
|
|
14808
|
+
* class NotFound extends Schema.TaggedError<NotFound>()("NotFound", {
|
|
14800
14809
|
* id: Schema.Number
|
|
14801
14810
|
* }) {}
|
|
14802
14811
|
*
|
|
@@ -14826,7 +14835,7 @@ export const TaggedErrorClass: {
|
|
|
14826
14835
|
* ```ts import.meta.vitest
|
|
14827
14836
|
* import { Effect, Schema } from "effect"
|
|
14828
14837
|
*
|
|
14829
|
-
* class NotFound extends Schema.
|
|
14838
|
+
* class NotFound extends Schema.TaggedError<NotFound>()("NotFound", {
|
|
14830
14839
|
* id: Schema.Number
|
|
14831
14840
|
* }) {}
|
|
14832
14841
|
*
|
|
@@ -14845,7 +14854,7 @@ export const TaggedErrorClass: {
|
|
|
14845
14854
|
tag: Tag,
|
|
14846
14855
|
fields: Fields,
|
|
14847
14856
|
annotations?: Annotations.Declaration<Self, readonly [TaggedStruct<Tag, Fields>]>
|
|
14848
|
-
): [Self] extends [never] ? MissingSelfGeneric<"Schema.
|
|
14857
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedError">
|
|
14849
14858
|
: Class<Self, TaggedStruct<Tag, Fields>, Cause_.YieldableError & Brand>
|
|
14850
14859
|
/**
|
|
14851
14860
|
* Defines a schema-backed yieldable error class with an automatically populated
|
|
@@ -14861,7 +14870,7 @@ export const TaggedErrorClass: {
|
|
|
14861
14870
|
* ```ts import.meta.vitest
|
|
14862
14871
|
* import { Effect, Schema } from "effect"
|
|
14863
14872
|
*
|
|
14864
|
-
* class NotFound extends Schema.
|
|
14873
|
+
* class NotFound extends Schema.TaggedError<NotFound>()("NotFound", {
|
|
14865
14874
|
* id: Schema.Number
|
|
14866
14875
|
* }) {}
|
|
14867
14876
|
*
|
|
@@ -14883,7 +14892,7 @@ export const TaggedErrorClass: {
|
|
|
14883
14892
|
Self,
|
|
14884
14893
|
readonly [Struct<Simplify<{ readonly _tag: tag<Tag> } & S["fields"]>>]
|
|
14885
14894
|
>
|
|
14886
|
-
): [Self] extends [never] ? MissingSelfGeneric<"Schema.
|
|
14895
|
+
): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedError">
|
|
14887
14896
|
: Class<Self, Struct<Simplify<{ readonly _tag: tag<Tag> } & S["fields"]>>, Cause_.YieldableError & Brand>
|
|
14888
14897
|
}
|
|
14889
14898
|
} = (identifier?: string) => {
|
|
@@ -14897,7 +14906,7 @@ export const TaggedErrorClass: {
|
|
|
14897
14906
|
unsafePreserveChecks: true
|
|
14898
14907
|
}) :
|
|
14899
14908
|
TaggedStruct(tagValue, schema)
|
|
14900
|
-
return
|
|
14909
|
+
return Error<any, {}>(identifier ?? tagValue)(
|
|
14901
14910
|
struct,
|
|
14902
14911
|
annotations as Annotations.Declaration<any, readonly [typeof struct]>
|
|
14903
14912
|
)
|
|
@@ -15385,7 +15394,7 @@ const toCodecJsonASTBase = SchemaAST.applyToSelfOrLastLinkEncoding((ast) => {
|
|
|
15385
15394
|
export const toCodecJsonAST = memoize(toCodecJsonASTBase)
|
|
15386
15395
|
|
|
15387
15396
|
function withoutConstructorDefault(context: SchemaAST.Context): SchemaAST.Context {
|
|
15388
|
-
return context.
|
|
15397
|
+
return context.constructorDefault === undefined ?
|
|
15389
15398
|
context :
|
|
15390
15399
|
new SchemaAST.Context(context.isOptional, context.isMutable, undefined, context.annotations)
|
|
15391
15400
|
}
|