effect 4.0.0-beta.31 → 4.0.0-beta.32
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/Array.d.ts +87 -86
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +47 -40
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +46 -45
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +35 -38
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +39 -32
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +32 -29
- package/dist/BigInt.js.map +1 -1
- package/dist/Chunk.d.ts +58 -57
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +20 -21
- package/dist/Chunk.js.map +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +4 -1
- package/dist/Config.js.map +1 -1
- package/dist/Cron.d.ts +3 -6
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +8 -15
- package/dist/Cron.js.map +1 -1
- package/dist/DateTime.d.ts +16 -15
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +8 -8
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +7 -5
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +7 -5
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +26 -24
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +23 -22
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +3 -4
- package/dist/Effect.js.map +1 -1
- package/dist/Fiber.d.ts +2 -1
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +9 -8
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +8 -7
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +20 -19
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +6 -6
- package/dist/FiberMap.js.map +1 -1
- package/dist/FileSystem.d.ts +17 -16
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +10 -7
- package/dist/FileSystem.js.map +1 -1
- package/dist/Graph.d.ts +64 -64
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +53 -53
- package/dist/Graph.js.map +1 -1
- package/dist/HashMap.d.ts +11 -5
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +3 -1
- package/dist/HashMap.js.map +1 -1
- package/dist/Iterable.d.ts +11 -11
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +12 -12
- package/dist/Iterable.js.map +1 -1
- package/dist/Latch.d.ts +69 -3
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +58 -0
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +84 -0
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +27 -0
- package/dist/Layer.js.map +1 -1
- package/dist/Number.d.ts +74 -18
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +34 -15
- package/dist/Number.js.map +1 -1
- package/dist/Option.d.ts +2 -0
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +183 -0
- package/dist/PartitionedSemaphore.d.ts.map +1 -0
- package/dist/PartitionedSemaphore.js +231 -0
- package/dist/PartitionedSemaphore.js.map +1 -0
- package/dist/PubSub.d.ts +5 -4
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +6 -5
- package/dist/PubSub.js.map +1 -1
- package/dist/Queue.d.ts +3 -3
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +2 -2
- package/dist/Queue.js.map +1 -1
- package/dist/Record.d.ts +40 -40
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +16 -15
- package/dist/Record.js.map +1 -1
- package/dist/Scheduler.d.ts +25 -123
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +20 -123
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +30 -0
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +28 -1
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaGetter.js +6 -4
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +32 -27
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Semaphore.d.ts +149 -53
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +137 -117
- package/dist/Semaphore.js.map +1 -1
- package/dist/ServiceMap.d.ts +26 -0
- package/dist/ServiceMap.d.ts.map +1 -1
- package/dist/ServiceMap.js +36 -21
- package/dist/ServiceMap.js.map +1 -1
- package/dist/Stream.js +1 -1
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +114 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +29 -47
- package/dist/String.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +1 -2
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +81 -115
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Terminal.d.ts +2 -1
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +5 -4
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +2 -1
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +26 -14
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +8 -4
- package/dist/Trie.js.map +1 -1
- package/dist/TxHashMap.d.ts +77 -59
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +25 -19
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxSemaphore.d.ts +162 -2
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +16 -2
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/index.d.ts +88 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -32
- package/dist/index.js.map +1 -1
- package/dist/internal/dateTime.js +9 -9
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +20 -89
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +2 -1
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/option.js +6 -0
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/trie.js +3 -3
- package/dist/internal/trie.js.map +1 -1
- package/dist/unstable/ai/AiError.js +1 -1
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +4 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +2 -2
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +4 -0
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +14 -0
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +13 -0
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +2 -4
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -3
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +3 -2
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +4 -3
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +3 -2
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +3 -3
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +2 -2
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +14 -12
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +4 -4
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +7 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +1 -1
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +71 -67
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js +9 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +8 -3
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +3 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +25 -23
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +3 -2
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +7 -7
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +4 -3
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +3 -2
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +10 -10
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +12 -12
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +2 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -3
- 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 +9 -8
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +2 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +7 -6
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +19 -13
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +5 -4
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +4 -4
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +19 -18
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +9 -10
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +2 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +1 -4
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +5 -4
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +3 -4
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +5 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +3 -2
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +2 -1
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +2 -1
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +4 -3
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +8 -6
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +2 -1
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +2 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +16 -15
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +3 -2
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +2 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +7 -7
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +2 -2
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +2 -1
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +2 -1
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +3 -2
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +14 -10
- 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 +4 -3
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +3 -2
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +27 -15
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +5 -4
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +5 -6
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +4 -2
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +15 -0
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +81 -3
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +2 -2
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +7 -3
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +1 -5
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +4 -2
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -3
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +4 -4
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +3 -2
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +4 -1
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +3 -2
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +2 -1
- 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 +1 -1
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +6 -6
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +2 -1
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +5 -4
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +19 -14
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +112 -105
- package/src/BigDecimal.ts +63 -66
- package/src/BigInt.ts +49 -41
- package/src/Chunk.ts +68 -63
- package/src/Config.ts +4 -1
- package/src/Cron.ts +10 -15
- package/src/DateTime.ts +16 -15
- package/src/Deferred.ts +8 -6
- package/src/Duration.ts +34 -33
- package/src/Effect.ts +3 -4
- package/src/Fiber.ts +2 -1
- package/src/FiberHandle.ts +10 -9
- package/src/FiberMap.ts +22 -22
- package/src/FileSystem.ts +25 -22
- package/src/Graph.ts +105 -105
- package/src/HashMap.ts +11 -5
- package/src/Iterable.ts +13 -13
- package/src/Latch.ts +85 -3
- package/src/Layer.ts +121 -0
- package/src/Number.ts +85 -26
- package/src/Option.ts +2 -0
- package/src/PartitionedSemaphore.ts +414 -0
- package/src/PubSub.ts +7 -6
- package/src/Queue.ts +5 -5
- package/src/Record.ts +52 -47
- package/src/Scheduler.ts +37 -126
- package/src/Schema.ts +49 -1
- package/src/SchemaGetter.ts +4 -4
- package/src/SchemaTransformation.ts +27 -27
- package/src/Semaphore.ts +271 -183
- package/src/ServiceMap.ts +83 -31
- package/src/Stream.ts +1 -1
- package/src/String.ts +122 -69
- package/src/SubscriptionRef.ts +96 -117
- package/src/Terminal.ts +2 -1
- package/src/Tracer.ts +6 -5
- package/src/Trie.ts +26 -14
- package/src/TxHashMap.ts +78 -60
- package/src/TxSemaphore.ts +186 -11
- package/src/index.ts +89 -33
- package/src/internal/dateTime.ts +14 -14
- package/src/internal/effect.ts +29 -121
- package/src/internal/hashMap.ts +4 -3
- package/src/internal/option.ts +7 -0
- package/src/internal/trie.ts +6 -6
- package/src/unstable/ai/AiError.ts +1 -1
- package/src/unstable/ai/AnthropicStructuredOutput.ts +4 -0
- package/src/unstable/ai/Chat.ts +6 -2
- package/src/unstable/ai/OpenAiStructuredOutput.ts +4 -0
- package/src/unstable/ai/Tool.ts +20 -0
- package/src/unstable/cli/Argument.ts +2 -4
- package/src/unstable/cli/CliOutput.ts +7 -5
- package/src/unstable/cli/Command.ts +5 -5
- package/src/unstable/cli/Flag.ts +2 -2
- package/src/unstable/cli/HelpDoc.ts +14 -12
- package/src/unstable/cli/Param.ts +15 -11
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/Prompt.ts +81 -83
- package/src/unstable/cli/internal/completions/CommandDescriptor.ts +3 -2
- package/src/unstable/cli/internal/parser.ts +7 -4
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +35 -30
- package/src/unstable/cluster/Entity.ts +13 -12
- package/src/unstable/cluster/Message.ts +6 -5
- package/src/unstable/cluster/MessageStorage.ts +26 -25
- package/src/unstable/cluster/Reply.ts +7 -4
- package/src/unstable/cluster/RunnerServer.ts +10 -13
- package/src/unstable/cluster/Runners.ts +8 -7
- package/src/unstable/cluster/Sharding.ts +24 -17
- package/src/unstable/cluster/ShardingConfig.ts +6 -6
- package/src/unstable/cluster/SqlMessageStorage.ts +21 -18
- package/src/unstable/cluster/internal/entityManager.ts +27 -21
- package/src/unstable/devtools/DevToolsSchema.ts +3 -2
- package/src/unstable/http/Cookies.ts +7 -8
- package/src/unstable/http/Etag.ts +5 -3
- package/src/unstable/http/Headers.ts +6 -5
- package/src/unstable/http/HttpClient.ts +2 -1
- package/src/unstable/http/HttpClientRequest.ts +11 -9
- package/src/unstable/http/HttpClientResponse.ts +3 -2
- package/src/unstable/http/HttpIncomingMessage.ts +2 -1
- package/src/unstable/http/HttpMiddleware.ts +16 -15
- package/src/unstable/http/HttpPlatform.ts +3 -2
- package/src/unstable/http/HttpRouter.ts +9 -9
- package/src/unstable/http/HttpServer.ts +3 -9
- package/src/unstable/http/HttpServerError.ts +3 -2
- package/src/unstable/http/HttpServerRequest.ts +25 -21
- package/src/unstable/http/HttpServerResponse.ts +5 -4
- package/src/unstable/http/HttpTraceContext.ts +31 -17
- package/src/unstable/http/UrlParams.ts +11 -14
- package/src/unstable/httpapi/HttpApiBuilder.ts +9 -3
- package/src/unstable/httpapi/HttpApiError.ts +67 -12
- package/src/unstable/observability/OtlpExporter.ts +5 -2
- package/src/unstable/observability/OtlpTracer.ts +8 -4
- package/src/unstable/reactivity/Atom.ts +1 -4
- package/src/unstable/reactivity/AtomRegistry.ts +5 -3
- package/src/unstable/rpc/Rpc.ts +4 -3
- package/src/unstable/rpc/RpcClient.ts +10 -9
- package/src/unstable/rpc/RpcSchema.ts +6 -5
- package/src/unstable/rpc/RpcSerialization.ts +4 -1
- package/src/unstable/rpc/RpcServer.ts +3 -3
- package/src/unstable/socket/Socket.ts +2 -1
- package/src/unstable/sql/SqlClient.ts +5 -3
- package/src/unstable/workflow/DurableDeferred.ts +6 -6
- package/src/unstable/workflow/Workflow.ts +1 -1
- package/src/unstable/workflow/WorkflowEngine.ts +29 -20
- package/dist/NullOr.d.ts +0 -149
- package/dist/NullOr.d.ts.map +0 -1
- package/dist/NullOr.js +0 -152
- package/dist/NullOr.js.map +0 -1
- package/src/NullOr.ts +0 -204
|
@@ -203,7 +203,7 @@ export const date = options => {
|
|
|
203
203
|
typed: "",
|
|
204
204
|
cursor: initialCursorPosition,
|
|
205
205
|
value: opts.initial,
|
|
206
|
-
error:
|
|
206
|
+
error: Option.none()
|
|
207
207
|
};
|
|
208
208
|
return custom(initialState, {
|
|
209
209
|
render: handleDateRender(opts),
|
|
@@ -219,18 +219,18 @@ export const file = (options = {}) => {
|
|
|
219
219
|
const opts = {
|
|
220
220
|
type: options.type ?? "file",
|
|
221
221
|
message: options.message ?? `Choose a file`,
|
|
222
|
-
startingPath: options.startingPath,
|
|
222
|
+
startingPath: Option.fromUndefinedOr(options.startingPath),
|
|
223
223
|
maxPerPage: options.maxPerPage ?? 10,
|
|
224
224
|
filter: options.filter ?? (() => Effect.succeed(true))
|
|
225
225
|
};
|
|
226
226
|
const initialState = Effect.gen(function* () {
|
|
227
|
-
const currentPath = yield* resolveCurrentPath(
|
|
227
|
+
const currentPath = yield* resolveCurrentPath(Option.none(), opts);
|
|
228
228
|
const files = yield* getFileList(currentPath, opts);
|
|
229
229
|
const confirm = Confirm.Hide();
|
|
230
230
|
return {
|
|
231
231
|
cursor: 0,
|
|
232
232
|
files,
|
|
233
|
-
path:
|
|
233
|
+
path: Option.none(),
|
|
234
234
|
confirm
|
|
235
235
|
};
|
|
236
236
|
});
|
|
@@ -276,7 +276,7 @@ export const float = options => {
|
|
|
276
276
|
const initialState = {
|
|
277
277
|
cursor: 0,
|
|
278
278
|
value: "",
|
|
279
|
-
error:
|
|
279
|
+
error: Option.none()
|
|
280
280
|
};
|
|
281
281
|
return custom(initialState, {
|
|
282
282
|
render: handleRenderFloat(opts),
|
|
@@ -313,7 +313,7 @@ export const integer = options => {
|
|
|
313
313
|
const initialState = {
|
|
314
314
|
cursor: 0,
|
|
315
315
|
value: "",
|
|
316
|
-
error:
|
|
316
|
+
error: Option.none()
|
|
317
317
|
};
|
|
318
318
|
return custom(initialState, {
|
|
319
319
|
render: handleRenderInteger(opts),
|
|
@@ -443,7 +443,7 @@ export const multiSelect = options => {
|
|
|
443
443
|
const initialState = {
|
|
444
444
|
index: 0,
|
|
445
445
|
selectedIndices: initialSelected,
|
|
446
|
-
error:
|
|
446
|
+
error: Option.none()
|
|
447
447
|
};
|
|
448
448
|
return custom(initialState, {
|
|
449
449
|
render: handleMultiSelectRender(opts),
|
|
@@ -638,7 +638,7 @@ const handleConfirmRender = options => {
|
|
|
638
638
|
const TRUE_VALUE_REGEXP = /^y|t$/;
|
|
639
639
|
const FALSE_VALUE_REGEXP = /^n|f$/;
|
|
640
640
|
const handleConfirmProcess = (input, defaultValue) => {
|
|
641
|
-
const value = input.input
|
|
641
|
+
const value = Option.getOrElse(input.input, () => "");
|
|
642
642
|
if (input.key.name === "enter" || input.key.name === "return") {
|
|
643
643
|
return Effect.succeed(Action.Submit({
|
|
644
644
|
value: defaultValue
|
|
@@ -666,7 +666,7 @@ const handleDateClear = options => {
|
|
|
666
666
|
const promptText = renderDateOutput("?", figures.pointerSmall, parts, options, {
|
|
667
667
|
plain: true
|
|
668
668
|
});
|
|
669
|
-
const errorText = state.error
|
|
669
|
+
const errorText = Option.isSome(state.error) ? Arr.match(state.error.value.split(NEWLINE_REGEXP), {
|
|
670
670
|
onEmpty: () => "",
|
|
671
671
|
onNonEmpty: errorLines => `${figures.pointerSmall} ${errorLines.join("\n")}`
|
|
672
672
|
}) : "";
|
|
@@ -675,8 +675,8 @@ const handleDateClear = options => {
|
|
|
675
675
|
});
|
|
676
676
|
};
|
|
677
677
|
const renderDateError = (state, pointer) => {
|
|
678
|
-
if (state.error
|
|
679
|
-
const errorLines = state.error.split(NEWLINE_REGEXP);
|
|
678
|
+
if (Option.isSome(state.error)) {
|
|
679
|
+
const errorLines = state.error.value.split(NEWLINE_REGEXP);
|
|
680
680
|
if (Arr.isReadonlyArrayNonEmpty(errorLines)) {
|
|
681
681
|
const prefix = Ansi.annotate(pointer, Ansi.red) + " ";
|
|
682
682
|
const lines = Arr.map(errorLines, str => annotateErrorLine(str));
|
|
@@ -733,12 +733,12 @@ const processDown = state => {
|
|
|
733
733
|
};
|
|
734
734
|
const processDateCursorLeft = state => {
|
|
735
735
|
const previous = state.dateParts[state.cursor].previousPart();
|
|
736
|
-
if (previous
|
|
736
|
+
if (Option.isSome(previous)) {
|
|
737
737
|
return Action.NextFrame({
|
|
738
738
|
state: {
|
|
739
739
|
...state,
|
|
740
740
|
typed: "",
|
|
741
|
-
cursor: state.dateParts.indexOf(previous)
|
|
741
|
+
cursor: state.dateParts.indexOf(previous.value)
|
|
742
742
|
}
|
|
743
743
|
});
|
|
744
744
|
}
|
|
@@ -746,12 +746,12 @@ const processDateCursorLeft = state => {
|
|
|
746
746
|
};
|
|
747
747
|
const processDateCursorRight = state => {
|
|
748
748
|
const next = state.dateParts[state.cursor].nextPart();
|
|
749
|
-
if (next
|
|
749
|
+
if (Option.isSome(next)) {
|
|
750
750
|
return Action.NextFrame({
|
|
751
751
|
state: {
|
|
752
752
|
...state,
|
|
753
753
|
typed: "",
|
|
754
|
-
cursor: state.dateParts.indexOf(next)
|
|
754
|
+
cursor: state.dateParts.indexOf(next.value)
|
|
755
755
|
}
|
|
756
756
|
});
|
|
757
757
|
}
|
|
@@ -759,7 +759,10 @@ const processDateCursorRight = state => {
|
|
|
759
759
|
};
|
|
760
760
|
const processDateNext = state => {
|
|
761
761
|
const next = state.dateParts[state.cursor].nextPart();
|
|
762
|
-
const cursor =
|
|
762
|
+
const cursor = Option.match(next, {
|
|
763
|
+
onNone: () => state.dateParts.findIndex(part => !part.isToken()),
|
|
764
|
+
onSome: next => state.dateParts.indexOf(next)
|
|
765
|
+
});
|
|
763
766
|
return Action.NextFrame({
|
|
764
767
|
state: {
|
|
765
768
|
...state,
|
|
@@ -829,7 +832,7 @@ const handleDateProcess = options => {
|
|
|
829
832
|
onFailure: error => Action.NextFrame({
|
|
830
833
|
state: {
|
|
831
834
|
...state,
|
|
832
|
-
error
|
|
835
|
+
error: Option.some(error)
|
|
833
836
|
}
|
|
834
837
|
}),
|
|
835
838
|
onSuccess: value => Action.Submit({
|
|
@@ -839,7 +842,7 @@ const handleDateProcess = options => {
|
|
|
839
842
|
}
|
|
840
843
|
default:
|
|
841
844
|
{
|
|
842
|
-
return Effect.succeed(defaultDateProcessor(input.input
|
|
845
|
+
return Effect.succeed(defaultDateProcessor(Option.getOrElse(input.input, () => ""), state));
|
|
843
846
|
}
|
|
844
847
|
}
|
|
845
848
|
};
|
|
@@ -919,17 +922,18 @@ class DatePart {
|
|
|
919
922
|
* Retrieves the next date part in the list of parts.
|
|
920
923
|
*/
|
|
921
924
|
nextPart() {
|
|
922
|
-
const currentPartIndex = Arr.findFirstIndex(this.parts, part => part === this)
|
|
923
|
-
return
|
|
925
|
+
const currentPartIndex = Option.getOrElse(Arr.findFirstIndex(this.parts, part => part === this), () => 0);
|
|
926
|
+
return Arr.findFirst(this.parts.slice(currentPartIndex + 1), part => !part.isToken());
|
|
924
927
|
}
|
|
925
928
|
/**
|
|
926
929
|
* Retrieves the previous date part in the list of parts.
|
|
927
930
|
*/
|
|
928
931
|
previousPart() {
|
|
929
932
|
const currentPartIndex = Arr.findFirstIndex(this.parts, part => part === this);
|
|
930
|
-
if (currentPartIndex
|
|
931
|
-
return
|
|
933
|
+
if (Option.isSome(currentPartIndex)) {
|
|
934
|
+
return Arr.findLast(this.parts.slice(0, currentPartIndex.value), part => !part.isToken());
|
|
932
935
|
}
|
|
936
|
+
return Option.none();
|
|
933
937
|
}
|
|
934
938
|
toString() {
|
|
935
939
|
return String(this.date);
|
|
@@ -1106,11 +1110,11 @@ const CONFIRM_MESSAGE = "The selected directory contains files. Would you like t
|
|
|
1106
1110
|
const Confirm = /*#__PURE__*/Data.taggedEnum();
|
|
1107
1111
|
const showConfirmation = /*#__PURE__*/Confirm.$is("Show");
|
|
1108
1112
|
const resolveCurrentPath = (path, options) => {
|
|
1109
|
-
if (path
|
|
1110
|
-
return Effect.succeed(path);
|
|
1113
|
+
if (Option.isSome(path)) {
|
|
1114
|
+
return Effect.succeed(path.value);
|
|
1111
1115
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1116
|
+
if (Option.isSome(options.startingPath)) {
|
|
1117
|
+
const startingPath = options.startingPath.value;
|
|
1114
1118
|
return Effect.flatMap(FileSystem.FileSystem.asEffect(), fs =>
|
|
1115
1119
|
// Ensure the user provided starting path exists
|
|
1116
1120
|
Effect.orDie(fs.exists(startingPath)).pipe(Effect.flatMap(exists => exists ? Effect.void : Effect.die(`The provided starting path '${startingPath}' does not exist`)), Effect.as(startingPath)));
|
|
@@ -1288,7 +1292,7 @@ const processSelection = /*#__PURE__*/Effect.fnUntraced(function* (state, option
|
|
|
1288
1292
|
state: {
|
|
1289
1293
|
cursor: 0,
|
|
1290
1294
|
files,
|
|
1291
|
-
path: resolvedPath,
|
|
1295
|
+
path: Option.some(resolvedPath),
|
|
1292
1296
|
confirm: Confirm.Hide()
|
|
1293
1297
|
}
|
|
1294
1298
|
});
|
|
@@ -1329,7 +1333,7 @@ const handleFileProcess = options => {
|
|
|
1329
1333
|
state: {
|
|
1330
1334
|
cursor: 0,
|
|
1331
1335
|
files,
|
|
1332
|
-
path: resolvedPath,
|
|
1336
|
+
path: Option.some(resolvedPath),
|
|
1333
1337
|
confirm: Confirm.Hide()
|
|
1334
1338
|
}
|
|
1335
1339
|
});
|
|
@@ -1358,8 +1362,8 @@ const handleFileProcess = options => {
|
|
|
1358
1362
|
});
|
|
1359
1363
|
};
|
|
1360
1364
|
const renderMultiSelectError = (state, pointer, renderOptions) => {
|
|
1361
|
-
if (state.error
|
|
1362
|
-
return Arr.match(state.error.split(NEWLINE_REGEXP), {
|
|
1365
|
+
if (Option.isSome(state.error)) {
|
|
1366
|
+
return Arr.match(state.error.value.split(NEWLINE_REGEXP), {
|
|
1363
1367
|
onEmpty: () => "",
|
|
1364
1368
|
onNonEmpty: errorLines => {
|
|
1365
1369
|
if (renderOptions?.plain === true) {
|
|
@@ -1516,7 +1520,7 @@ const handleMultiSelectProcess = options => {
|
|
|
1516
1520
|
{
|
|
1517
1521
|
return processMultiSelectCursorUp({
|
|
1518
1522
|
...state,
|
|
1519
|
-
error:
|
|
1523
|
+
error: Option.none()
|
|
1520
1524
|
}, totalChoices);
|
|
1521
1525
|
}
|
|
1522
1526
|
case "j":
|
|
@@ -1525,7 +1529,7 @@ const handleMultiSelectProcess = options => {
|
|
|
1525
1529
|
{
|
|
1526
1530
|
return processMultiSelectCursorDown({
|
|
1527
1531
|
...state,
|
|
1528
|
-
error:
|
|
1532
|
+
error: Option.none()
|
|
1529
1533
|
}, totalChoices);
|
|
1530
1534
|
}
|
|
1531
1535
|
case "space":
|
|
@@ -1540,7 +1544,7 @@ const handleMultiSelectProcess = options => {
|
|
|
1540
1544
|
return Effect.succeed(Action.NextFrame({
|
|
1541
1545
|
state: {
|
|
1542
1546
|
...state,
|
|
1543
|
-
error: `At least ${options.min} are required`
|
|
1547
|
+
error: Option.some(`At least ${options.min} are required`)
|
|
1544
1548
|
}
|
|
1545
1549
|
}));
|
|
1546
1550
|
}
|
|
@@ -1548,7 +1552,7 @@ const handleMultiSelectProcess = options => {
|
|
|
1548
1552
|
return Effect.succeed(Action.NextFrame({
|
|
1549
1553
|
state: {
|
|
1550
1554
|
...state,
|
|
1551
|
-
error: `At most ${options.max} choices are allowed`
|
|
1555
|
+
error: Option.some(`At most ${options.max} choices are allowed`)
|
|
1552
1556
|
}
|
|
1553
1557
|
}));
|
|
1554
1558
|
}
|
|
@@ -1596,12 +1600,12 @@ const renderNumberInput = (state, submitted, renderOptions) => {
|
|
|
1596
1600
|
if (submitted || renderOptions?.plain === true) {
|
|
1597
1601
|
return value;
|
|
1598
1602
|
}
|
|
1599
|
-
const annotation = state.error
|
|
1603
|
+
const annotation = Option.isSome(state.error) ? Ansi.red : Ansi.combine(Ansi.underlined, Ansi.cyanBright);
|
|
1600
1604
|
return Ansi.annotate(value, annotation);
|
|
1601
1605
|
};
|
|
1602
1606
|
const renderNumberError = (state, pointer, renderOptions) => {
|
|
1603
|
-
if (state.error
|
|
1604
|
-
return Arr.match(state.error.split(NEWLINE_REGEXP), {
|
|
1607
|
+
if (Option.isSome(state.error)) {
|
|
1608
|
+
return Arr.match(state.error.value.split(NEWLINE_REGEXP), {
|
|
1605
1609
|
onEmpty: () => "",
|
|
1606
1610
|
onNonEmpty: errorLines => {
|
|
1607
1611
|
if (renderOptions?.plain === true) {
|
|
@@ -1643,7 +1647,7 @@ const processNumberBackspace = state => {
|
|
|
1643
1647
|
state: {
|
|
1644
1648
|
...state,
|
|
1645
1649
|
value,
|
|
1646
|
-
error:
|
|
1650
|
+
error: Option.none()
|
|
1647
1651
|
}
|
|
1648
1652
|
}));
|
|
1649
1653
|
};
|
|
@@ -1652,7 +1656,7 @@ const processNumberClear = state => Effect.succeed(Action.NextFrame({
|
|
|
1652
1656
|
...state,
|
|
1653
1657
|
cursor: 0,
|
|
1654
1658
|
value: "",
|
|
1655
|
-
error:
|
|
1659
|
+
error: Option.none()
|
|
1656
1660
|
}
|
|
1657
1661
|
}));
|
|
1658
1662
|
const defaultIntProcessor = (input, state) => {
|
|
@@ -1661,7 +1665,7 @@ const defaultIntProcessor = (input, state) => {
|
|
|
1661
1665
|
state: {
|
|
1662
1666
|
...state,
|
|
1663
1667
|
value: "-",
|
|
1664
|
-
error:
|
|
1668
|
+
error: Option.none()
|
|
1665
1669
|
}
|
|
1666
1670
|
}));
|
|
1667
1671
|
}
|
|
@@ -1673,7 +1677,7 @@ const defaultIntProcessor = (input, state) => {
|
|
|
1673
1677
|
state: {
|
|
1674
1678
|
...state,
|
|
1675
1679
|
value: `${parsed}`,
|
|
1676
|
-
error:
|
|
1680
|
+
error: Option.none()
|
|
1677
1681
|
}
|
|
1678
1682
|
}));
|
|
1679
1683
|
}
|
|
@@ -1687,7 +1691,7 @@ const defaultFloatProcessor = (input, state) => {
|
|
|
1687
1691
|
state: {
|
|
1688
1692
|
...state,
|
|
1689
1693
|
value: "-",
|
|
1690
|
-
error:
|
|
1694
|
+
error: Option.none()
|
|
1691
1695
|
}
|
|
1692
1696
|
}));
|
|
1693
1697
|
}
|
|
@@ -1699,7 +1703,7 @@ const defaultFloatProcessor = (input, state) => {
|
|
|
1699
1703
|
state: {
|
|
1700
1704
|
...state,
|
|
1701
1705
|
value: input === "." ? `${parsed}.` : `${parsed}`,
|
|
1702
|
-
error:
|
|
1706
|
+
error: Option.none()
|
|
1703
1707
|
}
|
|
1704
1708
|
}));
|
|
1705
1709
|
}
|
|
@@ -1732,7 +1736,7 @@ const handleProcessInteger = options => {
|
|
|
1732
1736
|
state: {
|
|
1733
1737
|
...state,
|
|
1734
1738
|
value: state.value === "" || state.value === "-" ? `${options.incrementBy}` : `${Number.parseInt(state.value) + options.incrementBy}`,
|
|
1735
|
-
error:
|
|
1739
|
+
error: Option.none()
|
|
1736
1740
|
}
|
|
1737
1741
|
}));
|
|
1738
1742
|
}
|
|
@@ -1743,7 +1747,7 @@ const handleProcessInteger = options => {
|
|
|
1743
1747
|
state: {
|
|
1744
1748
|
...state,
|
|
1745
1749
|
value: state.value === "" || state.value === "-" ? `-${options.decrementBy}` : `${Number.parseInt(state.value) - options.decrementBy}`,
|
|
1746
|
-
error:
|
|
1750
|
+
error: Option.none()
|
|
1747
1751
|
}
|
|
1748
1752
|
}));
|
|
1749
1753
|
}
|
|
@@ -1755,7 +1759,7 @@ const handleProcessInteger = options => {
|
|
|
1755
1759
|
return Effect.succeed(Action.NextFrame({
|
|
1756
1760
|
state: {
|
|
1757
1761
|
...state,
|
|
1758
|
-
error: "Must provide an integer value"
|
|
1762
|
+
error: Option.some("Must provide an integer value")
|
|
1759
1763
|
}
|
|
1760
1764
|
}));
|
|
1761
1765
|
} else {
|
|
@@ -1763,7 +1767,7 @@ const handleProcessInteger = options => {
|
|
|
1763
1767
|
onFailure: error => Action.NextFrame({
|
|
1764
1768
|
state: {
|
|
1765
1769
|
...state,
|
|
1766
|
-
error
|
|
1770
|
+
error: Option.some(error)
|
|
1767
1771
|
}
|
|
1768
1772
|
}),
|
|
1769
1773
|
onSuccess: value => Action.Submit({
|
|
@@ -1774,7 +1778,7 @@ const handleProcessInteger = options => {
|
|
|
1774
1778
|
}
|
|
1775
1779
|
default:
|
|
1776
1780
|
{
|
|
1777
|
-
return defaultIntProcessor(input.input
|
|
1781
|
+
return defaultIntProcessor(Option.getOrElse(input.input, () => ""), state);
|
|
1778
1782
|
}
|
|
1779
1783
|
}
|
|
1780
1784
|
};
|
|
@@ -1807,7 +1811,7 @@ const handleProcessFloat = options => {
|
|
|
1807
1811
|
state: {
|
|
1808
1812
|
...state,
|
|
1809
1813
|
value: state.value === "" || state.value === "-" ? `${options.incrementBy}` : `${Number.parseFloat(state.value) + options.incrementBy}`,
|
|
1810
|
-
error:
|
|
1814
|
+
error: Option.none()
|
|
1811
1815
|
}
|
|
1812
1816
|
}));
|
|
1813
1817
|
}
|
|
@@ -1818,7 +1822,7 @@ const handleProcessFloat = options => {
|
|
|
1818
1822
|
state: {
|
|
1819
1823
|
...state,
|
|
1820
1824
|
value: state.value === "" || state.value === "-" ? `-${options.decrementBy}` : `${Number.parseFloat(state.value) - options.decrementBy}`,
|
|
1821
|
-
error:
|
|
1825
|
+
error: Option.none()
|
|
1822
1826
|
}
|
|
1823
1827
|
}));
|
|
1824
1828
|
}
|
|
@@ -1830,7 +1834,7 @@ const handleProcessFloat = options => {
|
|
|
1830
1834
|
return Effect.succeed(Action.NextFrame({
|
|
1831
1835
|
state: {
|
|
1832
1836
|
...state,
|
|
1833
|
-
error: "Must provide a floating point value"
|
|
1837
|
+
error: Option.some("Must provide a floating point value")
|
|
1834
1838
|
}
|
|
1835
1839
|
}));
|
|
1836
1840
|
} else {
|
|
@@ -1838,7 +1842,7 @@ const handleProcessFloat = options => {
|
|
|
1838
1842
|
onFailure: error => Action.NextFrame({
|
|
1839
1843
|
state: {
|
|
1840
1844
|
...state,
|
|
1841
|
-
error
|
|
1845
|
+
error: Option.some(error)
|
|
1842
1846
|
}
|
|
1843
1847
|
}),
|
|
1844
1848
|
onSuccess: value => Action.Submit({
|
|
@@ -1849,7 +1853,7 @@ const handleProcessFloat = options => {
|
|
|
1849
1853
|
}
|
|
1850
1854
|
default:
|
|
1851
1855
|
{
|
|
1852
|
-
return defaultFloatProcessor(input.input
|
|
1856
|
+
return defaultFloatProcessor(Option.getOrElse(input.input, () => ""), state);
|
|
1853
1857
|
}
|
|
1854
1858
|
}
|
|
1855
1859
|
};
|
|
@@ -1888,7 +1892,7 @@ const updateAutoCompleteState = (state, options, query) => {
|
|
|
1888
1892
|
index: filtered[0]
|
|
1889
1893
|
};
|
|
1890
1894
|
};
|
|
1891
|
-
const autoCompleteCursor = state => Arr.findFirstIndex(state.filtered, index => index === state.index)
|
|
1895
|
+
const autoCompleteCursor = state => Option.getOrElse(Arr.findFirstIndex(state.filtered, index => index === state.index), () => 0);
|
|
1892
1896
|
const renderSelectOutput = (leadingSymbol, trailingSymbol, options, renderOptions) => renderPrompt("", options.message, leadingSymbol, trailingSymbol, renderOptions);
|
|
1893
1897
|
const renderAutoCompleteFilter = (state, options, renderOptions) => {
|
|
1894
1898
|
const filterValue = state.query.length === 0 ? renderOptions?.plain === true ? options.filterPlaceholder : Ansi.annotate(options.filterPlaceholder, Ansi.blackBright) : renderOptions?.plain === true ? state.query : Ansi.annotate(state.query, Ansi.combine(Ansi.underlined, Ansi.cyanBright));
|
|
@@ -2204,7 +2208,7 @@ const handleAutoCompleteProcess = options => {
|
|
|
2204
2208
|
}
|
|
2205
2209
|
default:
|
|
2206
2210
|
{
|
|
2207
|
-
return processAutoCompleteInput(input.input
|
|
2211
|
+
return processAutoCompleteInput(Option.getOrElse(input.input, () => ""), state, options);
|
|
2208
2212
|
}
|
|
2209
2213
|
}
|
|
2210
2214
|
};
|
|
@@ -2240,7 +2244,7 @@ const renderTextInput = (nextState, options, submitted, renderOptions) => {
|
|
|
2240
2244
|
}
|
|
2241
2245
|
}
|
|
2242
2246
|
}
|
|
2243
|
-
const annotation = nextState.error
|
|
2247
|
+
const annotation = Option.isSome(nextState.error) ? Ansi.red : submitted ? Ansi.white : nextState.value.length === 0 ? Ansi.blackBright : Ansi.combine(Ansi.underlined, Ansi.cyanBright);
|
|
2244
2248
|
switch (options.type) {
|
|
2245
2249
|
case "hidden":
|
|
2246
2250
|
{
|
|
@@ -2257,8 +2261,8 @@ const renderTextInput = (nextState, options, submitted, renderOptions) => {
|
|
|
2257
2261
|
}
|
|
2258
2262
|
};
|
|
2259
2263
|
const renderTextError = (nextState, pointer, renderOptions) => {
|
|
2260
|
-
if (nextState.error
|
|
2261
|
-
return Arr.match(nextState.error.split(NEWLINE_REGEXP), {
|
|
2264
|
+
if (Option.isSome(nextState.error)) {
|
|
2265
|
+
return Arr.match(nextState.error.value.split(NEWLINE_REGEXP), {
|
|
2262
2266
|
onEmpty: () => "",
|
|
2263
2267
|
onNonEmpty: errorLines => {
|
|
2264
2268
|
if (renderOptions?.plain === true) {
|
|
@@ -2305,7 +2309,7 @@ const processTextBackspace = state => {
|
|
|
2305
2309
|
...state,
|
|
2306
2310
|
cursor,
|
|
2307
2311
|
value,
|
|
2308
|
-
error:
|
|
2312
|
+
error: Option.none()
|
|
2309
2313
|
}
|
|
2310
2314
|
}));
|
|
2311
2315
|
};
|
|
@@ -2314,7 +2318,7 @@ const processTextClear = state => Effect.succeed(Action.NextFrame({
|
|
|
2314
2318
|
...state,
|
|
2315
2319
|
cursor: 0,
|
|
2316
2320
|
value: "",
|
|
2317
|
-
error:
|
|
2321
|
+
error: Option.none()
|
|
2318
2322
|
}
|
|
2319
2323
|
}));
|
|
2320
2324
|
const processTextCursorLeft = state => {
|
|
@@ -2326,7 +2330,7 @@ const processTextCursorLeft = state => {
|
|
|
2326
2330
|
state: {
|
|
2327
2331
|
...state,
|
|
2328
2332
|
cursor,
|
|
2329
|
-
error:
|
|
2333
|
+
error: Option.none()
|
|
2330
2334
|
}
|
|
2331
2335
|
}));
|
|
2332
2336
|
};
|
|
@@ -2339,7 +2343,7 @@ const processTextCursorRight = state => {
|
|
|
2339
2343
|
state: {
|
|
2340
2344
|
...state,
|
|
2341
2345
|
cursor,
|
|
2342
|
-
error:
|
|
2346
|
+
error: Option.none()
|
|
2343
2347
|
}
|
|
2344
2348
|
}));
|
|
2345
2349
|
};
|
|
@@ -2353,7 +2357,7 @@ const processTab = (state, options) => {
|
|
|
2353
2357
|
...state,
|
|
2354
2358
|
value,
|
|
2355
2359
|
cursor: value.length,
|
|
2356
|
-
error:
|
|
2360
|
+
error: Option.none()
|
|
2357
2361
|
}
|
|
2358
2362
|
}));
|
|
2359
2363
|
};
|
|
@@ -2367,7 +2371,7 @@ const defaultTextProcessor = (input, state) => {
|
|
|
2367
2371
|
...state,
|
|
2368
2372
|
cursor,
|
|
2369
2373
|
value,
|
|
2370
|
-
error:
|
|
2374
|
+
error: Option.none()
|
|
2371
2375
|
}
|
|
2372
2376
|
}));
|
|
2373
2377
|
};
|
|
@@ -2409,7 +2413,7 @@ const handleTextProcess = options => {
|
|
|
2409
2413
|
state: {
|
|
2410
2414
|
...state,
|
|
2411
2415
|
value,
|
|
2412
|
-
error
|
|
2416
|
+
error: Option.some(error)
|
|
2413
2417
|
}
|
|
2414
2418
|
}),
|
|
2415
2419
|
onSuccess: value => Action.Submit({
|
|
@@ -2423,7 +2427,7 @@ const handleTextProcess = options => {
|
|
|
2423
2427
|
}
|
|
2424
2428
|
default:
|
|
2425
2429
|
{
|
|
2426
|
-
return defaultTextProcessor(input.input
|
|
2430
|
+
return defaultTextProcessor(Option.getOrElse(input.input, () => ""), state);
|
|
2427
2431
|
}
|
|
2428
2432
|
}
|
|
2429
2433
|
};
|
|
@@ -2443,7 +2447,7 @@ const basePrompt = (options, type) => {
|
|
|
2443
2447
|
const initialState = {
|
|
2444
2448
|
cursor: opts.default.length,
|
|
2445
2449
|
value: opts.default,
|
|
2446
|
-
error:
|
|
2450
|
+
error: Option.none()
|
|
2447
2451
|
};
|
|
2448
2452
|
return custom(initialState, {
|
|
2449
2453
|
render: handleTextRender(opts),
|