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
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses YAML configuration files.
|
|
3
|
+
*
|
|
4
|
+
* This is a focused YAML 1.2 configuration parser. It supports block and flow
|
|
5
|
+
* collections, quoted and block scalars, anchors, and aliases.
|
|
6
|
+
*
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* The behavior is based on `yaml` 2.9.0.
|
|
12
|
+
*
|
|
13
|
+
* Copyright Eemeli Aro <eemeli@gmail.com>
|
|
14
|
+
*
|
|
15
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
16
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
17
|
+
* copyright notice and this permission notice appear in all copies.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
20
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
21
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
22
|
+
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
23
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
24
|
+
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
25
|
+
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
type YamlRecord = Record<string, unknown>
|
|
29
|
+
|
|
30
|
+
type Line = {
|
|
31
|
+
readonly raw: string
|
|
32
|
+
readonly text: string
|
|
33
|
+
readonly indent: number
|
|
34
|
+
readonly number: number
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const hasOwn = Object.prototype.hasOwnProperty
|
|
38
|
+
|
|
39
|
+
const setProperty = (record: YamlRecord, key: string, value: unknown): void => {
|
|
40
|
+
Object.defineProperty(record, key, {
|
|
41
|
+
configurable: true,
|
|
42
|
+
enumerable: true,
|
|
43
|
+
writable: true,
|
|
44
|
+
value
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const stripComment = (input: string): string => {
|
|
49
|
+
let quote: "'" | "\"" | undefined
|
|
50
|
+
let escaped = false
|
|
51
|
+
for (let index = 0; index < input.length; index++) {
|
|
52
|
+
const character = input[index]
|
|
53
|
+
if (quote === "\"") {
|
|
54
|
+
if (escaped) {
|
|
55
|
+
escaped = false
|
|
56
|
+
} else if (character === "\\") {
|
|
57
|
+
escaped = true
|
|
58
|
+
} else if (character === quote) {
|
|
59
|
+
quote = undefined
|
|
60
|
+
}
|
|
61
|
+
} else if (quote === "'") {
|
|
62
|
+
if (character === quote && input[index + 1] === quote) {
|
|
63
|
+
index++
|
|
64
|
+
} else if (character === quote) {
|
|
65
|
+
quote = undefined
|
|
66
|
+
}
|
|
67
|
+
} else if (character === "'" || character === "\"") {
|
|
68
|
+
quote = character
|
|
69
|
+
} else if (character === "#" && (index === 0 || /\s/.test(input[index - 1]))) {
|
|
70
|
+
return input.slice(0, index).trimEnd()
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return input.trimEnd()
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const mappingSeparator = (input: string): number => {
|
|
77
|
+
let quote: "'" | "\"" | undefined
|
|
78
|
+
let escaped = false
|
|
79
|
+
let depth = 0
|
|
80
|
+
for (let index = 0; index < input.length; index++) {
|
|
81
|
+
const character = input[index]
|
|
82
|
+
if (quote === "\"") {
|
|
83
|
+
if (escaped) escaped = false
|
|
84
|
+
else if (character === "\\") escaped = true
|
|
85
|
+
else if (character === quote) quote = undefined
|
|
86
|
+
} else if (quote === "'") {
|
|
87
|
+
if (character === quote && input[index + 1] === quote) index++
|
|
88
|
+
else if (character === quote) quote = undefined
|
|
89
|
+
} else if (character === "'" || character === "\"") {
|
|
90
|
+
quote = character
|
|
91
|
+
} else if (character === "[" || character === "{") {
|
|
92
|
+
depth++
|
|
93
|
+
} else if (character === "]" || character === "}") {
|
|
94
|
+
depth--
|
|
95
|
+
} else if (character === ":" && depth === 0 && (input[index + 1] === undefined || /\s/.test(input[index + 1]))) {
|
|
96
|
+
return index
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return -1
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const parseDoubleQuoted = (input: string): string => {
|
|
103
|
+
if (!input.endsWith("\"") || input.length < 2) {
|
|
104
|
+
throw new SyntaxError("Unterminated double-quoted YAML string")
|
|
105
|
+
}
|
|
106
|
+
let output = ""
|
|
107
|
+
for (let index = 1; index < input.length - 1; index++) {
|
|
108
|
+
const character = input[index]
|
|
109
|
+
if (character !== "\\") {
|
|
110
|
+
output += character
|
|
111
|
+
continue
|
|
112
|
+
}
|
|
113
|
+
const escape = input[++index]
|
|
114
|
+
const escapes: Record<string, string> = {
|
|
115
|
+
"0": "\0",
|
|
116
|
+
a: "\x07",
|
|
117
|
+
b: "\b",
|
|
118
|
+
t: "\t",
|
|
119
|
+
n: "\n",
|
|
120
|
+
v: "\v",
|
|
121
|
+
f: "\f",
|
|
122
|
+
r: "\r",
|
|
123
|
+
e: "\x1b",
|
|
124
|
+
" ": " ",
|
|
125
|
+
"\"": "\"",
|
|
126
|
+
"/": "/",
|
|
127
|
+
"\\": "\\",
|
|
128
|
+
N: "\u0085",
|
|
129
|
+
_: "\u00a0",
|
|
130
|
+
L: "\u2028",
|
|
131
|
+
P: "\u2029"
|
|
132
|
+
}
|
|
133
|
+
if (hasOwn.call(escapes, escape)) {
|
|
134
|
+
output += escapes[escape]
|
|
135
|
+
continue
|
|
136
|
+
}
|
|
137
|
+
if (escape === "x" || escape === "u" || escape === "U") {
|
|
138
|
+
const length = escape === "x" ? 2 : escape === "u" ? 4 : 8
|
|
139
|
+
const hex = input.slice(index + 1, index + 1 + length)
|
|
140
|
+
if (!new RegExp(`^[0-9A-Fa-f]{${length}}$`).test(hex)) {
|
|
141
|
+
throw new SyntaxError("Invalid unicode escape in YAML string")
|
|
142
|
+
}
|
|
143
|
+
output += String.fromCodePoint(Number.parseInt(hex, 16))
|
|
144
|
+
index += length
|
|
145
|
+
continue
|
|
146
|
+
}
|
|
147
|
+
throw new SyntaxError(`Invalid YAML escape '\\${escape}'`)
|
|
148
|
+
}
|
|
149
|
+
return output
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const parseScalar = (input: string): unknown => {
|
|
153
|
+
const value = input.trim()
|
|
154
|
+
if (value.length === 0) return null
|
|
155
|
+
if (value.startsWith("\"") && value.endsWith("\"")) {
|
|
156
|
+
return parseDoubleQuoted(value)
|
|
157
|
+
}
|
|
158
|
+
if (value.startsWith("'") && value.endsWith("'")) {
|
|
159
|
+
return value.slice(1, -1).replace(/''/g, "'");
|
|
160
|
+
}
|
|
161
|
+
if (/^(?:null|~)$/i.test(value)) return null
|
|
162
|
+
if (/^true$/i.test(value)) return true
|
|
163
|
+
if (/^false$/i.test(value)) return false
|
|
164
|
+
if (/^[+-]?\.inf$/i.test(value)) return value[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY
|
|
165
|
+
if (/^\.nan$/i.test(value)) return Number.NaN
|
|
166
|
+
|
|
167
|
+
const normalized = value.replace(/_/g, "")
|
|
168
|
+
if (/^[+-]?0x[0-9a-f]+$/i.test(normalized)) {
|
|
169
|
+
const sign = normalized[0] === "-" ? -1 : 1
|
|
170
|
+
return sign * Number.parseInt(normalized.replace(/^[+-]?0x/i, ""), 16);
|
|
171
|
+
}
|
|
172
|
+
if (/^[+-]?0o[0-7]+$/i.test(normalized)) {
|
|
173
|
+
const sign = normalized[0] === "-" ? -1 : 1
|
|
174
|
+
return sign * Number.parseInt(normalized.replace(/^[+-]?0o/i, ""), 8);
|
|
175
|
+
}
|
|
176
|
+
if (
|
|
177
|
+
/^[+-]?(?:0|[1-9]\d*)$/.test(normalized) ||
|
|
178
|
+
/^[+-]?(?:(?:0|[1-9]\d*)?\.\d+|(?:0|[1-9]\d*)\.?\d*[eE][+-]?\d+)$/.test(normalized)
|
|
179
|
+
) {
|
|
180
|
+
return Number(normalized)
|
|
181
|
+
}
|
|
182
|
+
return value
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const parseKey = (input: string): string => {
|
|
186
|
+
const value = parseScalar(input)
|
|
187
|
+
return value === null || value === undefined ? "" : String(value)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
class FlowParser {
|
|
191
|
+
private readonly input: string
|
|
192
|
+
private readonly anchors: ReadonlyMap<string, unknown>
|
|
193
|
+
private index = 0
|
|
194
|
+
|
|
195
|
+
constructor(input: string, anchors: ReadonlyMap<string, unknown>) {
|
|
196
|
+
this.input = input
|
|
197
|
+
this.anchors = anchors
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
parse(): unknown {
|
|
201
|
+
const value = this.parseValue()
|
|
202
|
+
this.skipWhitespace()
|
|
203
|
+
if (this.index !== this.input.length) {
|
|
204
|
+
this.fail("Unexpected flow collection content")
|
|
205
|
+
}
|
|
206
|
+
return value
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
private parseValue(): unknown {
|
|
210
|
+
this.skipWhitespace()
|
|
211
|
+
const character = this.peek()
|
|
212
|
+
if (character === "[") return this.parseSequence()
|
|
213
|
+
if (character === "{") return this.parseMapping()
|
|
214
|
+
if (character === "\"" || character === "'") return parseScalar(this.readQuoted(character))
|
|
215
|
+
if (character === "*") {
|
|
216
|
+
this.index++
|
|
217
|
+
const name = this.readUntil(/[,\]}\s]/)
|
|
218
|
+
if (!this.anchors.has(name)) this.fail(`Unknown alias '*${name}'`)
|
|
219
|
+
return this.anchors.get(name)
|
|
220
|
+
}
|
|
221
|
+
return parseScalar(this.readUntil(/[,\]}]/).trim());
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
private parseSequence(): Array<unknown> {
|
|
225
|
+
this.expect("[")
|
|
226
|
+
const output: Array<unknown> = []
|
|
227
|
+
this.skipWhitespace()
|
|
228
|
+
if (this.peek() === "]") {
|
|
229
|
+
this.index++
|
|
230
|
+
return output
|
|
231
|
+
}
|
|
232
|
+
while (true) {
|
|
233
|
+
output.push(this.parseValue())
|
|
234
|
+
this.skipWhitespace()
|
|
235
|
+
if (this.peek() === "]") {
|
|
236
|
+
this.index++
|
|
237
|
+
return output
|
|
238
|
+
}
|
|
239
|
+
this.expect(",")
|
|
240
|
+
this.skipWhitespace()
|
|
241
|
+
if (this.peek() === "]") {
|
|
242
|
+
this.index++
|
|
243
|
+
return output
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
private parseMapping(): YamlRecord {
|
|
249
|
+
this.expect("{")
|
|
250
|
+
const output: YamlRecord = {}
|
|
251
|
+
this.skipWhitespace()
|
|
252
|
+
if (this.peek() === "}") {
|
|
253
|
+
this.index++
|
|
254
|
+
return output
|
|
255
|
+
}
|
|
256
|
+
while (true) {
|
|
257
|
+
const key = this.parseKey()
|
|
258
|
+
this.skipWhitespace()
|
|
259
|
+
this.expect(":")
|
|
260
|
+
if (hasOwn.call(output, key)) this.fail(`Duplicate key '${key}'`)
|
|
261
|
+
setProperty(output, key, this.parseValue())
|
|
262
|
+
this.skipWhitespace()
|
|
263
|
+
if (this.peek() === "}") {
|
|
264
|
+
this.index++
|
|
265
|
+
return output
|
|
266
|
+
}
|
|
267
|
+
this.expect(",")
|
|
268
|
+
this.skipWhitespace()
|
|
269
|
+
if (this.peek() === "}") {
|
|
270
|
+
this.index++
|
|
271
|
+
return output
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
private parseKey(): string {
|
|
277
|
+
this.skipWhitespace()
|
|
278
|
+
const character = this.peek()
|
|
279
|
+
if (character === "\"" || character === "'") {
|
|
280
|
+
return parseKey(this.readQuoted(character))
|
|
281
|
+
}
|
|
282
|
+
return this.readUntil(/:/).trim();
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
private readQuoted(quote: string): string {
|
|
286
|
+
const start = this.index++
|
|
287
|
+
let escaped = false
|
|
288
|
+
while (this.index < this.input.length) {
|
|
289
|
+
const character = this.input[this.index++]
|
|
290
|
+
if (quote === "\"" && escaped) escaped = false
|
|
291
|
+
else if (quote === "\"" && character === "\\") escaped = true
|
|
292
|
+
else if (quote === "'" && character === quote && this.input[this.index] === quote) this.index++
|
|
293
|
+
else if (character === quote) return this.input.slice(start, this.index)
|
|
294
|
+
}
|
|
295
|
+
this.fail("Unterminated quoted scalar")
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
private readUntil(stop: RegExp): string {
|
|
299
|
+
const start = this.index
|
|
300
|
+
while (this.index < this.input.length && !stop.test(this.peek())) this.index++
|
|
301
|
+
return this.input.slice(start, this.index)
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
private skipWhitespace(): void {
|
|
305
|
+
while (/\s/.test(this.peek())) this.index++
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
private expect(character: string): void {
|
|
309
|
+
if (this.peek() !== character) this.fail(`Expected '${character}'`)
|
|
310
|
+
this.index++
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
private peek(): string {
|
|
314
|
+
return this.input[this.index] ?? ""
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
private fail(message: string): never {
|
|
318
|
+
throw new SyntaxError(`${message} at flow offset ${this.index}`)
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
class YamlParser {
|
|
323
|
+
private readonly lines: ReadonlyArray<Line>
|
|
324
|
+
private index = 0
|
|
325
|
+
private readonly anchors = new Map<string, unknown>()
|
|
326
|
+
|
|
327
|
+
constructor(lines: ReadonlyArray<Line>) {
|
|
328
|
+
this.lines = lines
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
parse(): unknown {
|
|
332
|
+
this.skipIgnored()
|
|
333
|
+
if (this.index >= this.lines.length) return null
|
|
334
|
+
const value = this.parseNode(this.lines[this.index].indent)
|
|
335
|
+
this.skipIgnored()
|
|
336
|
+
if (this.index < this.lines.length) {
|
|
337
|
+
this.fail(this.lines[this.index], "Unexpected content")
|
|
338
|
+
}
|
|
339
|
+
return value
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
private parseNode(indent: number): unknown {
|
|
343
|
+
this.skipIgnored()
|
|
344
|
+
const line = this.lines[this.index]
|
|
345
|
+
if (line === undefined) return null
|
|
346
|
+
if (line.indent !== indent) this.fail(line, `Expected indentation of ${indent} spaces`)
|
|
347
|
+
if (line.text === "-" || line.text.startsWith("- ")) return this.parseSequence(indent)
|
|
348
|
+
if (mappingSeparator(line.text) !== -1) return this.parseMapping(indent)
|
|
349
|
+
this.index++
|
|
350
|
+
return this.parseInlineValue(line.text)
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
private parseMapping(indent: number): YamlRecord {
|
|
354
|
+
const output: YamlRecord = {}
|
|
355
|
+
while (true) {
|
|
356
|
+
this.skipIgnored()
|
|
357
|
+
const line = this.lines[this.index]
|
|
358
|
+
if (line === undefined || line.indent < indent) return output
|
|
359
|
+
if (line.indent > indent) this.fail(line, `Unexpected indentation of ${line.indent} spaces`)
|
|
360
|
+
const separator = mappingSeparator(line.text)
|
|
361
|
+
if (separator === -1) return output
|
|
362
|
+
this.index++
|
|
363
|
+
this.parseMappingEntry(output, line.text, separator, indent, line)
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
private parseMappingEntry(
|
|
368
|
+
output: YamlRecord,
|
|
369
|
+
text: string,
|
|
370
|
+
separator: number,
|
|
371
|
+
indent: number,
|
|
372
|
+
line: Line
|
|
373
|
+
): void {
|
|
374
|
+
const key = parseKey(text.slice(0, separator).trim())
|
|
375
|
+
const rawValue = text.slice(separator + 1).trim()
|
|
376
|
+
const value = this.parseNodeValue(rawValue, indent)
|
|
377
|
+
if (hasOwn.call(output, key)) this.fail(line, `Duplicate key '${key}'`)
|
|
378
|
+
setProperty(output, key, value)
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
private parseSequence(indent: number): Array<unknown> {
|
|
382
|
+
const output: Array<unknown> = []
|
|
383
|
+
while (true) {
|
|
384
|
+
this.skipIgnored()
|
|
385
|
+
const line = this.lines[this.index]
|
|
386
|
+
if (line === undefined || line.indent < indent) return output
|
|
387
|
+
if (line.indent > indent) this.fail(line, `Unexpected indentation of ${line.indent} spaces`)
|
|
388
|
+
if (line.text !== "-" && !line.text.startsWith("- ")) return output
|
|
389
|
+
this.index++
|
|
390
|
+
const item = line.text.slice(1).trimStart()
|
|
391
|
+
const separator = mappingSeparator(item)
|
|
392
|
+
if (separator === -1) {
|
|
393
|
+
output.push(this.parseNodeValue(item, indent))
|
|
394
|
+
continue
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const mapping: YamlRecord = {}
|
|
398
|
+
this.parseMappingEntry(mapping, item, separator, indent + 2, line)
|
|
399
|
+
while (true) {
|
|
400
|
+
this.skipIgnored()
|
|
401
|
+
const continuation = this.lines[this.index]
|
|
402
|
+
if (continuation === undefined || continuation.indent <= indent) break
|
|
403
|
+
if (continuation.indent !== indent + 2) {
|
|
404
|
+
this.fail(continuation, `Expected indentation of ${indent + 2} spaces`)
|
|
405
|
+
}
|
|
406
|
+
const nextSeparator = mappingSeparator(continuation.text)
|
|
407
|
+
if (nextSeparator === -1) this.fail(continuation, "Expected a mapping entry")
|
|
408
|
+
this.index++
|
|
409
|
+
this.parseMappingEntry(mapping, continuation.text, nextSeparator, indent + 2, continuation)
|
|
410
|
+
}
|
|
411
|
+
output.push(mapping)
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
private parseNodeValue(rawValue: string, parentIndent: number): unknown {
|
|
416
|
+
let value = rawValue
|
|
417
|
+
let anchor: string | undefined
|
|
418
|
+
const anchorMatch = /^&([^\s,[\]{}]+)(?:\s+(.*))?$/.exec(value)
|
|
419
|
+
if (anchorMatch !== null) {
|
|
420
|
+
anchor = anchorMatch[1]
|
|
421
|
+
value = anchorMatch[2] ?? ""
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
let parsed: unknown
|
|
425
|
+
if (value.length === 0) {
|
|
426
|
+
this.skipIgnored()
|
|
427
|
+
const next = this.lines[this.index]
|
|
428
|
+
parsed = next !== undefined && next.indent > parentIndent ? this.parseNode(next.indent) : null
|
|
429
|
+
} else if (/^[|>](?:[1-9]?[+-]?|[+-]?[1-9]?)$/.test(value)) {
|
|
430
|
+
parsed = this.parseBlockScalar(value, parentIndent)
|
|
431
|
+
} else {
|
|
432
|
+
parsed = this.parseInlineValue(value)
|
|
433
|
+
}
|
|
434
|
+
if (anchor !== undefined) this.anchors.set(anchor, parsed)
|
|
435
|
+
return parsed
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
private parseInlineValue(value: string): unknown {
|
|
439
|
+
if (value.startsWith("*")) {
|
|
440
|
+
const name = value.slice(1).trim()
|
|
441
|
+
if (!this.anchors.has(name)) throw new SyntaxError(`Unknown YAML alias '*${name}'`)
|
|
442
|
+
return this.anchors.get(name)
|
|
443
|
+
}
|
|
444
|
+
if (value.startsWith("[") || value.startsWith("{")) {
|
|
445
|
+
return new FlowParser(value, this.anchors).parse()
|
|
446
|
+
}
|
|
447
|
+
return parseScalar(value)
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
private parseBlockScalar(indicator: string, parentIndent: number): string {
|
|
451
|
+
const style = indicator[0]
|
|
452
|
+
const chomp = indicator.includes("-") ? "strip" : indicator.includes("+") ? "keep" : "clip"
|
|
453
|
+
const explicitIndent = Number.parseInt(indicator.replace(/[^1-9]/g, ""), 10)
|
|
454
|
+
const start = this.index
|
|
455
|
+
let end = start
|
|
456
|
+
let contentIndent = Number.isNaN(explicitIndent) ? Number.POSITIVE_INFINITY : parentIndent + explicitIndent
|
|
457
|
+
|
|
458
|
+
while (end < this.lines.length) {
|
|
459
|
+
const line = this.lines[end]
|
|
460
|
+
if (line.raw.trim().length !== 0 && line.indent <= parentIndent) break
|
|
461
|
+
if (line.raw.trim().length !== 0) contentIndent = Math.min(contentIndent, line.indent)
|
|
462
|
+
end++
|
|
463
|
+
}
|
|
464
|
+
if (contentIndent === Number.POSITIVE_INFINITY) contentIndent = parentIndent + 1
|
|
465
|
+
|
|
466
|
+
const content: Array<string> = []
|
|
467
|
+
for (let index = start; index < end; index++) {
|
|
468
|
+
const line = this.lines[index]
|
|
469
|
+
if (line.raw.trim().length === 0) {
|
|
470
|
+
content.push("")
|
|
471
|
+
} else if (line.indent < contentIndent) {
|
|
472
|
+
this.fail(line, `Expected block scalar indentation of ${contentIndent} spaces`)
|
|
473
|
+
} else {
|
|
474
|
+
content.push(line.raw.slice(contentIndent))
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
this.index = end
|
|
478
|
+
|
|
479
|
+
let output = ""
|
|
480
|
+
if (style === "|") {
|
|
481
|
+
output = content.join("\n")
|
|
482
|
+
} else {
|
|
483
|
+
for (let index = 0; index < content.length; index++) {
|
|
484
|
+
output += content[index]
|
|
485
|
+
if (index < content.length - 1) {
|
|
486
|
+
output += content[index].length === 0 || content[index + 1].length === 0 ? "\n" : " "
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
if (chomp === "keep") return `${output}\n`
|
|
491
|
+
output = output.replace(/\n+$/, "")
|
|
492
|
+
return chomp === "strip" ? output : `${output}\n`
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
private skipIgnored(): void {
|
|
496
|
+
while (this.index < this.lines.length) {
|
|
497
|
+
const line = this.lines[this.index]
|
|
498
|
+
if (line.text.length === 0 || line.text.startsWith("%") || line.text === "---") {
|
|
499
|
+
this.index++
|
|
500
|
+
} else if (line.text === "...") {
|
|
501
|
+
this.index++
|
|
502
|
+
while (this.index < this.lines.length && this.lines[this.index].text.length === 0) this.index++
|
|
503
|
+
if (this.index < this.lines.length) {
|
|
504
|
+
this.fail(this.lines[this.index], "Multiple YAML documents are not supported")
|
|
505
|
+
}
|
|
506
|
+
} else {
|
|
507
|
+
return
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
private fail(line: Line, message: string): never {
|
|
513
|
+
throw new SyntaxError(`${message} at line ${line.number}`)
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Parses one YAML document into JavaScript values.
|
|
519
|
+
*
|
|
520
|
+
* The core YAML 1.2 scalar schema is used, so booleans, nulls, and numbers are
|
|
521
|
+
* decoded while date-like values remain strings.
|
|
522
|
+
*
|
|
523
|
+
* @category decoding
|
|
524
|
+
* @since 4.0.0
|
|
525
|
+
*/
|
|
526
|
+
export const parse = (input: string): unknown => {
|
|
527
|
+
const source = input.replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n")
|
|
528
|
+
const lines = source.split("\n").map((raw, index): Line => {
|
|
529
|
+
const indentation = /^( *)/.exec(raw)![1].length
|
|
530
|
+
if (raw.slice(0, indentation + 1).includes("\t")) {
|
|
531
|
+
throw new SyntaxError(`Tabs cannot be used for YAML indentation at line ${index + 1}`)
|
|
532
|
+
}
|
|
533
|
+
return {
|
|
534
|
+
raw,
|
|
535
|
+
text: stripComment(raw.slice(indentation)),
|
|
536
|
+
indent: indentation,
|
|
537
|
+
number: index + 1
|
|
538
|
+
}
|
|
539
|
+
})
|
|
540
|
+
return new YamlParser(lines).parse()
|
|
541
|
+
}
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @since 4.0.0
|
|
9
|
+
*/
|
|
10
|
+
export * as Ini from "./Ini.ts"
|
|
11
|
+
|
|
7
12
|
/**
|
|
8
13
|
* @since 4.0.0
|
|
9
14
|
*/
|
|
@@ -18,3 +23,13 @@ export * as Ndjson from "./Ndjson.ts"
|
|
|
18
23
|
* @since 4.0.0
|
|
19
24
|
*/
|
|
20
25
|
export * as Sse from "./Sse.ts"
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @since 4.0.0
|
|
29
|
+
*/
|
|
30
|
+
export * as Toml from "./Toml.ts"
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @since 4.0.0
|
|
34
|
+
*/
|
|
35
|
+
export * as Yaml from "./Yaml.ts"
|
|
@@ -86,7 +86,7 @@ export class EventJournal extends Context.Service<EventJournal, {
|
|
|
86
86
|
) => Effect.Effect<A, EventJournalError | E, R>
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
* Retrieve the
|
|
89
|
+
* Retrieve the first unused sequence number for a remote source.
|
|
90
90
|
*/
|
|
91
91
|
readonly nextRemoteSequence: (remoteId: RemoteId) => Effect.Effect<number, EventJournalError>
|
|
92
92
|
|
|
@@ -417,8 +417,8 @@ export const makeMemory: Effect.Effect<EventJournal["Service"]> = Effect.gen(fun
|
|
|
417
417
|
for (const remoteEntry of options.entries) {
|
|
418
418
|
if (byId.has(remoteEntry.entry.idString)) {
|
|
419
419
|
duplicateEntries.push(remoteEntry.entry)
|
|
420
|
-
if (remoteEntry.remoteSequence
|
|
421
|
-
remote.sequence = remoteEntry.remoteSequence
|
|
420
|
+
if (remoteEntry.remoteSequence >= remote.sequence) {
|
|
421
|
+
remote.sequence = remoteEntry.remoteSequence + 1
|
|
422
422
|
}
|
|
423
423
|
continue
|
|
424
424
|
}
|
|
@@ -438,7 +438,7 @@ export const makeMemory: Effect.Effect<EventJournal["Service"]> = Effect.gen(fun
|
|
|
438
438
|
if (entry !== undefined && entry.createdAtMillis > entryMillis) {
|
|
439
439
|
continue
|
|
440
440
|
}
|
|
441
|
-
for (let j = i +
|
|
441
|
+
for (let j = i + 1; j < journal.length; j++) {
|
|
442
442
|
const scannedEntry = journal[j]!
|
|
443
443
|
if (scannedEntry.event === originEntry.event && scannedEntry.primaryKey === originEntry.primaryKey) {
|
|
444
444
|
conflicts.push(scannedEntry)
|
|
@@ -451,11 +451,19 @@ export const makeMemory: Effect.Effect<EventJournal["Service"]> = Effect.gen(fun
|
|
|
451
451
|
for (const remoteEntry of uncommittedRemotes) {
|
|
452
452
|
journal.push(remoteEntry.entry)
|
|
453
453
|
byId.set(remoteEntry.entry.idString, remoteEntry.entry)
|
|
454
|
-
|
|
455
|
-
remote
|
|
454
|
+
remotes.forEach((target) => {
|
|
455
|
+
if (target !== remote) {
|
|
456
|
+
target.missing.push(remoteEntry.entry)
|
|
457
|
+
}
|
|
458
|
+
})
|
|
459
|
+
if (remoteEntry.remoteSequence >= remote.sequence) {
|
|
460
|
+
remote.sequence = remoteEntry.remoteSequence + 1
|
|
456
461
|
}
|
|
457
462
|
}
|
|
458
463
|
journal.sort((a, b) => a.createdAtMillis - b.createdAtMillis)
|
|
464
|
+
remotes.forEach((remote) => {
|
|
465
|
+
remote.missing.sort((a, b) => a.createdAtMillis - b.createdAtMillis)
|
|
466
|
+
})
|
|
459
467
|
return {
|
|
460
468
|
duplicateEntries
|
|
461
469
|
}
|
|
@@ -63,7 +63,7 @@ export const StoreId = Schema.String.pipe(Schema.brand(StoreIdTypeId))
|
|
|
63
63
|
* @category protocols
|
|
64
64
|
* @since 4.0.0
|
|
65
65
|
*/
|
|
66
|
-
export class EventLogProtocolError extends Schema.
|
|
66
|
+
export class EventLogProtocolError extends Schema.TaggedError<EventLogProtocolError>(
|
|
67
67
|
"effect/eventlog/EventLogRemote/ProtocolError"
|
|
68
68
|
)("EventLogProtocolError", {
|
|
69
69
|
requestTag: Schema.String,
|
|
@@ -411,7 +411,7 @@ const toConflicts = (
|
|
|
411
411
|
const newHistory = history.slice(i)
|
|
412
412
|
let conflicts: Array<Entry> = []
|
|
413
413
|
for (let j = 0; j < newHistory.length; j++) {
|
|
414
|
-
const scannedEntry =
|
|
414
|
+
const scannedEntry = newHistory[j]!
|
|
415
415
|
if (scannedEntry.event === originEntry.event && scannedEntry.primaryKey === originEntry.primaryKey) {
|
|
416
416
|
conflicts.push(scannedEntry)
|
|
417
417
|
}
|
|
@@ -220,10 +220,12 @@ export const make = (options?: {
|
|
|
220
220
|
primaryKey,
|
|
221
221
|
payload
|
|
222
222
|
}, { disableChecks: true })
|
|
223
|
-
yield*
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
return yield* Effect.uninterruptibleMask((restore) =>
|
|
224
|
+
restore(effect(entry)).pipe(
|
|
225
|
+
Effect.tap(insertEntry(toEntryRow(entry))),
|
|
226
|
+
Effect.tap(PubSub.publish(pubsub, entry))
|
|
227
|
+
)
|
|
228
|
+
)
|
|
227
229
|
},
|
|
228
230
|
withTracerDisabled,
|
|
229
231
|
Effect.mapError((cause) => new EventJournal.EventJournalError({ cause, method: "write" }))
|