effect 4.0.0-beta.43 → 4.0.0-beta.44
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.d.ts +12 -43
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +15 -42
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +21 -21
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +89 -10
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +42 -19
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +86 -46
- package/dist/Channel.js.map +1 -1
- package/dist/Clock.d.ts +2 -2
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Config.d.ts +2 -2
- package/dist/ConfigProvider.d.ts +5 -5
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +5 -5
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +2 -2
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +1150 -0
- package/dist/Context.d.ts.map +1 -0
- package/dist/{ServiceMap.js → Context.js} +139 -139
- package/dist/Context.js.map +1 -0
- package/dist/DateTime.d.ts +2 -2
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +2 -2
- package/dist/DateTime.js.map +1 -1
- package/dist/Effect.d.ts +177 -177
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +81 -81
- package/dist/Effect.js.map +1 -1
- package/dist/ErrorReporter.d.ts +3 -3
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +1 -1
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +6 -6
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +4 -4
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Fiber.d.ts +7 -7
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +2 -2
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +4 -4
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +2 -2
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +4 -4
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +2 -2
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +4 -4
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +3 -3
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +3 -3
- package/dist/FileSystem.js.map +1 -1
- package/dist/Layer.d.ts +286 -268
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +133 -134
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +18 -18
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +18 -15
- package/dist/LayerMap.js.map +1 -1
- package/dist/Logger.d.ts +3 -3
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +6 -6
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +18 -21
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Metric.d.ts +19 -19
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +21 -21
- package/dist/Metric.js.map +1 -1
- package/dist/Path.d.ts +2 -2
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +2 -2
- package/dist/Path.js.map +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +4 -4
- package/dist/Pool.js.map +1 -1
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +3 -3
- package/dist/PubSub.js.map +1 -1
- package/dist/Random.d.ts +2 -2
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +0 -23
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +2 -2
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +12 -12
- package/dist/RcMap.js.map +1 -1
- package/dist/Redactable.d.ts +139 -62
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +59 -55
- package/dist/Redactable.js.map +1 -1
- package/dist/References.d.ts +26 -14
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +0 -12
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +5 -5
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +6 -7
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +0 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +3 -3
- package/dist/Resource.js.map +1 -1
- package/dist/Schedule.d.ts +2 -2
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +2 -2
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +4 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +7 -4
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +531 -214
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +304 -103
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +5 -15
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +49 -5
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +64 -5
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +145 -0
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +146 -0
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +2 -2
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +4 -4
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Sink.d.ts +6 -6
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +1 -1
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +2 -2
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +2 -2
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +187 -117
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +133 -57
- package/dist/Stream.js.map +1 -1
- package/dist/Terminal.d.ts +3 -3
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +2 -2
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +16 -16
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +11 -8
- package/dist/Tracer.js.map +1 -1
- package/dist/Unify.d.ts +8 -2
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js.map +1 -1
- package/dist/index.d.ts +81 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -15
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/effect.js +74 -74
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/layer.js +3 -3
- package/dist/internal/layer.js.map +1 -1
- package/dist/internal/random.js +2 -2
- package/dist/internal/random.js.map +1 -1
- package/dist/internal/rcRef.js +9 -9
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/references.js +13 -13
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/request.js +6 -6
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schedule.js +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/representation.js +11 -1
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.d.ts +10 -1
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +21 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +3 -3
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +19 -19
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +2 -1
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +4 -4
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +3 -3
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +6 -6
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +3 -3
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +2 -2
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +2 -2
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +2 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +2 -2
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +54 -54
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +15 -8
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +22 -22
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +25 -25
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +3 -3
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +5 -5
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +6 -9
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +1 -1
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +6 -7
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +2 -2
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +2 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +35 -2
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +2 -2
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +2 -2
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +2 -2
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +16 -16
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +41 -13
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +3 -3
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +10 -10
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +2 -3
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +29 -8
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +8 -1
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +2 -2
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +2 -2
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +14 -14
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +11 -10
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +2 -3
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +2 -2
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +2 -2
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +8 -8
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +30 -2
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +17 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +8 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +5 -5
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +3 -3
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +94 -15
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +7 -7
- package/dist/unstable/cluster/ClusterSchema.d.ts +12 -9
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +9 -9
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +13 -14
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +8 -8
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +12 -12
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +2 -2
- package/dist/unstable/cluster/EntityProxy.js +3 -3
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +4 -4
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +2 -2
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +3 -3
- package/dist/unstable/cluster/HttpRunner.js +2 -2
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +4 -4
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +2 -2
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +7 -4
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +5 -5
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +14 -14
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +8 -8
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +2 -2
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +5 -5
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +2 -2
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +1 -1
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +12 -12
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +3 -3
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +3 -3
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +7 -7
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +35 -49
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +65 -67
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +2 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +21 -21
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +5 -5
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +2 -2
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +15 -14
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -2
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +3 -3
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +2 -2
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +5 -5
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +4 -4
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +2 -2
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +5 -5
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +18 -18
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +2 -2
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -12
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +2 -2
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +3 -3
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +2 -2
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +2 -2
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +2 -2
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +6 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +5 -5
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +5 -2
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +3 -3
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +8 -6
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +6 -6
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +2 -2
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +4 -4
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +6 -6
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +24 -24
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +2 -2
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +2 -2
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +3 -3
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +26 -14
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +2 -2
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +2 -2
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +7 -7
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +29 -29
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +2 -2
- 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 +3 -3
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +3 -3
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +6 -6
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +2 -2
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +6 -6
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +6 -6
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +7 -7
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +9 -9
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +8 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -3
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +20 -20
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +7 -7
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +4 -4
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +8 -8
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +4 -4
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +6 -6
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +5 -5
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +9 -6
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +6 -6
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +15 -15
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +23 -23
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +5 -5
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +1 -1
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +2 -2
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +2 -2
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +4 -33
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +23 -2
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +144 -2
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +1 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +10 -11
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +4 -4
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +3 -3
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +4 -4
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +3 -3
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +6 -6
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +3 -3
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +3 -3
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +2 -2
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -2
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +2 -2
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +36 -36
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +9 -9
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +3 -3
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +2 -2
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +3 -3
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +3 -3
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +2 -2
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +2 -2
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +6 -6
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +11 -11
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -4
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +18 -8
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +27 -18
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
- package/dist/unstable/rpc/RpcGroup.d.ts +7 -7
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +20 -20
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +6 -6
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +5 -5
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +3 -3
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +3 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +2 -2
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +2 -2
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +18 -18
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +2 -2
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +4 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +0 -3
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +2 -5
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +10 -10
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +9 -9
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +5 -2
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +2 -2
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +5 -5
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -7
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +2 -2
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +5 -2
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +12 -12
- package/dist/unstable/sql/SqlModel.d.ts +8 -9
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +9 -35
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +11 -11
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +2 -2
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +2 -2
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +2 -2
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +6 -6
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +3 -3
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +6 -3
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +5 -5
- package/dist/unstable/workers/WorkerRunner.d.ts +2 -2
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +5 -2
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +7 -7
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +7 -7
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +0 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +3 -3
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +7 -7
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +9 -9
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +18 -18
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +3 -3
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +5 -5
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +4 -4
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +1 -1
- package/src/Cache.ts +18 -46
- package/src/Cause.ts +21 -21
- package/src/Channel.ts +120 -79
- package/src/Clock.ts +2 -2
- package/src/Config.ts +2 -2
- package/src/ConfigProvider.ts +5 -5
- package/src/Console.ts +2 -2
- package/src/{ServiceMap.ts → Context.ts} +337 -340
- package/src/DateTime.ts +2 -2
- package/src/Effect.ts +182 -184
- package/src/ErrorReporter.ts +3 -3
- package/src/ExecutionPlan.ts +8 -9
- package/src/Fiber.ts +7 -7
- package/src/FiberHandle.ts +5 -5
- package/src/FiberMap.ts +5 -5
- package/src/FiberSet.ts +5 -5
- package/src/FileSystem.ts +3 -3
- package/src/Layer.ts +333 -307
- package/src/LayerMap.ts +27 -26
- package/src/Logger.ts +3 -3
- package/src/ManagedRuntime.ts +32 -32
- package/src/Metric.ts +58 -58
- package/src/Path.ts +2 -2
- package/src/Pool.ts +5 -5
- package/src/PubSub.ts +3 -3
- package/src/Random.ts +2 -2
- package/src/RcMap.ts +14 -14
- package/src/Redactable.ts +146 -72
- package/src/References.ts +14 -14
- package/src/Request.ts +5 -5
- package/src/RequestResolver.ts +6 -7
- package/src/Resource.ts +4 -4
- package/src/Schedule.ts +2 -2
- package/src/Scheduler.ts +4 -4
- package/src/Schema.ts +837 -397
- package/src/SchemaAST.ts +5 -14
- package/src/SchemaGetter.ts +69 -11
- package/src/SchemaTransformation.ts +166 -0
- package/src/Scope.ts +2 -2
- package/src/ScopedCache.ts +5 -5
- package/src/Sink.ts +9 -9
- package/src/Stdio.ts +2 -2
- package/src/Stream.ts +234 -158
- package/src/Terminal.ts +3 -3
- package/src/Tracer.ts +17 -17
- package/src/Unify.ts +26 -2
- package/src/index.ts +82 -16
- package/src/internal/core.ts +7 -7
- package/src/internal/effect.ts +106 -106
- package/src/internal/layer.ts +7 -7
- package/src/internal/random.ts +2 -2
- package/src/internal/rcRef.ts +10 -10
- package/src/internal/references.ts +13 -13
- package/src/internal/request.ts +8 -8
- package/src/internal/schedule.ts +3 -1
- package/src/internal/schema/representation.ts +8 -1
- package/src/internal/schema/schema.ts +24 -1
- package/src/testing/TestSchema.ts +3 -3
- package/src/unstable/ai/AiError.ts +3 -2
- package/src/unstable/ai/Chat.ts +3 -3
- package/src/unstable/ai/EmbeddingModel.ts +3 -3
- package/src/unstable/ai/IdGenerator.ts +2 -2
- package/src/unstable/ai/LanguageModel.ts +2 -2
- package/src/unstable/ai/McpSchema.ts +11 -9
- package/src/unstable/ai/McpServer.ts +44 -44
- package/src/unstable/ai/Model.ts +8 -8
- package/src/unstable/ai/Prompt.ts +6 -12
- package/src/unstable/ai/Response.ts +6 -8
- package/src/unstable/ai/ResponseIdTracker.ts +2 -4
- package/src/unstable/ai/Telemetry.ts +2 -2
- package/src/unstable/ai/Tokenizer.ts +2 -2
- package/src/unstable/ai/Tool.ts +25 -25
- package/src/unstable/ai/Toolkit.ts +12 -12
- package/src/unstable/cli/Argument.ts +3 -4
- package/src/unstable/cli/CliError.ts +22 -9
- package/src/unstable/cli/CliOutput.ts +2 -2
- package/src/unstable/cli/Command.ts +36 -30
- package/src/unstable/cli/Flag.ts +3 -4
- package/src/unstable/cli/GlobalFlag.ts +3 -3
- package/src/unstable/cli/HelpDoc.ts +8 -8
- package/src/unstable/cli/Param.ts +39 -16
- package/src/unstable/cli/Prompt.ts +13 -6
- package/src/unstable/cli/internal/command.ts +7 -7
- package/src/unstable/cli/internal/parser.ts +130 -21
- package/src/unstable/cluster/ClusterSchema.ts +12 -12
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +14 -15
- package/src/unstable/cluster/Entity.ts +25 -25
- package/src/unstable/cluster/EntityProxy.ts +3 -3
- package/src/unstable/cluster/EntityProxyServer.ts +4 -4
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/HttpRunner.ts +2 -2
- package/src/unstable/cluster/K8sHttpClient.ts +2 -2
- package/src/unstable/cluster/Message.ts +8 -8
- package/src/unstable/cluster/MessageStorage.ts +11 -11
- package/src/unstable/cluster/Reply.ts +7 -7
- package/src/unstable/cluster/RunnerHealth.ts +2 -2
- package/src/unstable/cluster/RunnerServer.ts +1 -1
- package/src/unstable/cluster/RunnerStorage.ts +9 -9
- package/src/unstable/cluster/Runners.ts +7 -7
- package/src/unstable/cluster/ShardId.ts +84 -74
- package/src/unstable/cluster/Sharding.ts +26 -26
- package/src/unstable/cluster/ShardingConfig.ts +5 -5
- package/src/unstable/cluster/Snowflake.ts +2 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
- package/src/unstable/cluster/internal/entityManager.ts +27 -23
- package/src/unstable/cluster/internal/entityReaper.ts +2 -2
- package/src/unstable/cluster/internal/resourceMap.ts +3 -3
- package/src/unstable/devtools/DevToolsClient.ts +5 -5
- package/src/unstable/eventlog/EventJournal.ts +2 -2
- package/src/unstable/eventlog/EventLog.ts +21 -21
- package/src/unstable/eventlog/EventLogEncryption.ts +2 -2
- package/src/unstable/eventlog/EventLogRemote.ts +2 -2
- package/src/unstable/eventlog/EventLogServer.ts +2 -2
- package/src/unstable/http/Etag.ts +2 -2
- package/src/unstable/http/FetchHttpClient.ts +5 -5
- package/src/unstable/http/Headers.ts +4 -4
- package/src/unstable/http/HttpClient.ts +9 -8
- package/src/unstable/http/HttpClientRequest.ts +5 -5
- package/src/unstable/http/HttpEffect.ts +35 -35
- package/src/unstable/http/HttpIncomingMessage.ts +2 -2
- package/src/unstable/http/HttpMiddleware.ts +28 -14
- package/src/unstable/http/HttpPlatform.ts +2 -2
- package/src/unstable/http/HttpRouter.ts +37 -37
- package/src/unstable/http/HttpServer.ts +2 -2
- package/src/unstable/http/HttpServerError.ts +4 -4
- package/src/unstable/http/HttpServerRequest.ts +7 -7
- package/src/unstable/http/HttpServerResponse.ts +8 -8
- package/src/unstable/http/Multipart.ts +8 -8
- package/src/unstable/httpapi/HttpApi.ts +18 -18
- package/src/unstable/httpapi/HttpApiBuilder.ts +20 -20
- package/src/unstable/httpapi/HttpApiClient.ts +4 -4
- package/src/unstable/httpapi/HttpApiEndpoint.ts +14 -14
- package/src/unstable/httpapi/HttpApiGroup.ts +16 -16
- package/src/unstable/httpapi/HttpApiMiddleware.ts +14 -14
- package/src/unstable/httpapi/HttpApiSecurity.ts +13 -13
- package/src/unstable/httpapi/OpenApi.ts +29 -31
- package/src/unstable/observability/OtlpExporter.ts +5 -5
- package/src/unstable/observability/OtlpMetrics.ts +1 -1
- package/src/unstable/observability/OtlpSerialization.ts +2 -2
- package/src/unstable/observability/OtlpTracer.ts +2 -2
- package/src/unstable/observability/PrometheusMetrics.ts +5 -5
- package/src/unstable/persistence/KeyValueStore.ts +226 -3
- package/src/unstable/persistence/PersistedCache.ts +20 -17
- package/src/unstable/persistence/PersistedQueue.ts +3 -3
- package/src/unstable/persistence/Persistence.ts +4 -4
- package/src/unstable/persistence/RateLimiter.ts +3 -3
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcessSpawner.ts +46 -2
- package/src/unstable/reactivity/Atom.ts +79 -79
- package/src/unstable/reactivity/AtomHttpApi.ts +4 -4
- package/src/unstable/reactivity/AtomRegistry.ts +4 -4
- package/src/unstable/reactivity/AtomRpc.ts +4 -4
- package/src/unstable/reactivity/Reactivity.ts +6 -6
- package/src/unstable/rpc/Rpc.ts +17 -17
- package/src/unstable/rpc/RpcClient.ts +44 -30
- package/src/unstable/rpc/RpcGroup.ts +30 -30
- package/src/unstable/rpc/RpcMiddleware.ts +14 -14
- package/src/unstable/rpc/RpcSchema.ts +4 -4
- package/src/unstable/rpc/RpcSerialization.ts +2 -2
- package/src/unstable/rpc/RpcServer.ts +19 -19
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/rpc/Utils.ts +4 -4
- package/src/unstable/socket/Socket.ts +9 -9
- package/src/unstable/socket/SocketServer.ts +2 -2
- package/src/unstable/sql/SqlClient.ts +11 -11
- package/src/unstable/sql/SqlConnection.ts +2 -2
- package/src/unstable/sql/SqlModel.ts +54 -82
- package/src/unstable/sql/SqlResolver.ts +11 -11
- package/src/unstable/sql/Statement.ts +2 -2
- package/src/unstable/workers/Transferable.ts +6 -6
- package/src/unstable/workers/Worker.ts +4 -4
- package/src/unstable/workers/WorkerRunner.ts +2 -2
- package/src/unstable/workflow/Activity.ts +14 -14
- package/src/unstable/workflow/DurableClock.ts +3 -3
- package/src/unstable/workflow/DurableDeferred.ts +8 -8
- package/src/unstable/workflow/Workflow.ts +23 -23
- package/src/unstable/workflow/WorkflowEngine.ts +6 -6
- package/src/unstable/workflow/WorkflowProxyServer.ts +4 -4
- package/dist/ServiceMap.d.ts +0 -1150
- package/dist/ServiceMap.d.ts.map +0 -1
- package/dist/ServiceMap.js.map +0 -1
package/dist/Schema.js
CHANGED
|
@@ -95,7 +95,7 @@ import * as Encoding from "./Encoding.js";
|
|
|
95
95
|
import * as Equal from "./Equal.js";
|
|
96
96
|
import * as Equivalence from "./Equivalence.js";
|
|
97
97
|
import * as Exit_ from "./Exit.js";
|
|
98
|
-
import { format,
|
|
98
|
+
import { format, formatPropertyKey } from "./Formatter.js";
|
|
99
99
|
import { identity } from "./Function.js";
|
|
100
100
|
import * as HashMap_ from "./HashMap.js";
|
|
101
101
|
import * as HashSet_ from "./HashSet.js";
|
|
@@ -105,6 +105,7 @@ import * as InternalArbitrary from "./internal/schema/arbitrary.js";
|
|
|
105
105
|
import * as InternalEquivalence from "./internal/schema/equivalence.js";
|
|
106
106
|
import * as InternalStandard from "./internal/schema/representation.js";
|
|
107
107
|
import * as InternalSchema from "./internal/schema/schema.js";
|
|
108
|
+
import { SchemaError } from "./internal/schema/schema.js";
|
|
108
109
|
import * as InternalToCodec from "./internal/schema/to-codec.js";
|
|
109
110
|
import * as JsonPatch from "./JsonPatch.js";
|
|
110
111
|
import * as JsonSchema from "./JsonSchema.js";
|
|
@@ -329,7 +330,7 @@ export function annotateKey(annotations) {
|
|
|
329
330
|
export function revealCodec(codec) {
|
|
330
331
|
return codec;
|
|
331
332
|
}
|
|
332
|
-
|
|
333
|
+
export {
|
|
333
334
|
/**
|
|
334
335
|
* Error thrown (or returned as the error channel value) when schema decoding
|
|
335
336
|
* or encoding fails.
|
|
@@ -358,21 +359,7 @@ const SchemaErrorTypeId = "~effect/Schema/SchemaError";
|
|
|
358
359
|
*
|
|
359
360
|
* @since 4.0.0
|
|
360
361
|
*/
|
|
361
|
-
|
|
362
|
-
[SchemaErrorTypeId] = SchemaErrorTypeId;
|
|
363
|
-
_tag = "SchemaError";
|
|
364
|
-
name = "SchemaError";
|
|
365
|
-
issue;
|
|
366
|
-
constructor(issue) {
|
|
367
|
-
this.issue = issue;
|
|
368
|
-
}
|
|
369
|
-
get message() {
|
|
370
|
-
return this.issue.toString();
|
|
371
|
-
}
|
|
372
|
-
toString() {
|
|
373
|
-
return `SchemaError(${this.message})`;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
362
|
+
SchemaError };
|
|
376
363
|
/**
|
|
377
364
|
* Returns `true` if `u` is a {@link SchemaError}.
|
|
378
365
|
*
|
|
@@ -393,7 +380,7 @@ export class SchemaError {
|
|
|
393
380
|
* @since 4.0.0
|
|
394
381
|
*/
|
|
395
382
|
export function isSchemaError(u) {
|
|
396
|
-
return Predicate.hasProperty(u, SchemaErrorTypeId);
|
|
383
|
+
return Predicate.hasProperty(u, InternalSchema.SchemaErrorTypeId);
|
|
397
384
|
}
|
|
398
385
|
function makeStandardResult(exit) {
|
|
399
386
|
return Exit_.isSuccess(exit) ? exit.value : {
|
|
@@ -916,6 +903,31 @@ export const encodeSync = Parser.encodeSync;
|
|
|
916
903
|
* @since 4.0.0
|
|
917
904
|
*/
|
|
918
905
|
export const make = InternalSchema.make;
|
|
906
|
+
/**
|
|
907
|
+
* Transforms a schema into a class that can be extended with `extends`. The
|
|
908
|
+
* resulting class inherits the full schema API (e.g. `annotate`) and can define
|
|
909
|
+
* static methods that reference `this`.
|
|
910
|
+
*
|
|
911
|
+
* **Example** (Wrapping a primitive schema)
|
|
912
|
+
*
|
|
913
|
+
* ```ts
|
|
914
|
+
* import { Schema } from "effect"
|
|
915
|
+
*
|
|
916
|
+
* class MyString extends Schema.asClass(Schema.String) {
|
|
917
|
+
* static readonly decodeUnknownSync = Schema.decodeUnknownSync(this)
|
|
918
|
+
* }
|
|
919
|
+
*
|
|
920
|
+
* console.log(MyString.decodeUnknownSync("a"))
|
|
921
|
+
* // "a"
|
|
922
|
+
* ```
|
|
923
|
+
*
|
|
924
|
+
* @since 4.0.0
|
|
925
|
+
*/
|
|
926
|
+
export function asClass(schema) {
|
|
927
|
+
// oxlint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
928
|
+
class Class {}
|
|
929
|
+
return Object.setPrototypeOf(Class, schema);
|
|
930
|
+
}
|
|
919
931
|
/**
|
|
920
932
|
* Tests if a value is a `Schema`.
|
|
921
933
|
*
|
|
@@ -1975,38 +1987,34 @@ export function encode(transformation) {
|
|
|
1975
1987
|
/**
|
|
1976
1988
|
* Attaches a constructor default value to a schema field.
|
|
1977
1989
|
*
|
|
1978
|
-
*
|
|
1979
|
-
*
|
|
1980
|
-
* Return `Option.some(value)` to supply a default, or `Option.none()` to leave the
|
|
1981
|
-
* field required. An `Effect` may be returned for async or service-dependent defaults.
|
|
1982
|
-
*
|
|
1983
|
-
* Constructor defaults are applied only during `makeUnsafe` / `make`, not during
|
|
1984
|
-
* decoding or encoding.
|
|
1990
|
+
* Constructor defaults are applied only during `make*`, not during decoding or
|
|
1991
|
+
* encoding.
|
|
1985
1992
|
*
|
|
1986
1993
|
* **Example** (Optional field with a static default)
|
|
1987
1994
|
*
|
|
1988
1995
|
* ```ts
|
|
1989
|
-
* import {
|
|
1996
|
+
* import { Effect, Schema } from "effect"
|
|
1990
1997
|
*
|
|
1991
1998
|
* const MySchema = Schema.Struct({
|
|
1992
1999
|
* name: Schema.String.pipe(
|
|
1993
2000
|
* Schema.optionalKey,
|
|
1994
|
-
* Schema.withConstructorDefault(
|
|
2001
|
+
* Schema.withConstructorDefault(Effect.succeed("anonymous"))
|
|
1995
2002
|
* )
|
|
1996
2003
|
* })
|
|
1997
2004
|
*
|
|
1998
|
-
* const value = MySchema.
|
|
2005
|
+
* const value = MySchema.make({})
|
|
1999
2006
|
* // value: { name: "anonymous" }
|
|
2000
2007
|
* ```
|
|
2001
2008
|
*
|
|
2002
2009
|
* @since 4.0.0
|
|
2003
2010
|
*/
|
|
2004
|
-
export function withConstructorDefault(
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2011
|
+
export function withConstructorDefault(
|
|
2012
|
+
// `S["~type.make.in"]` instead of `S["Type"]` is intentional here because
|
|
2013
|
+
// it makes easier to define the default value if there are nested defaults
|
|
2014
|
+
defaultValue) {
|
|
2015
|
+
return schema => make(AST.withConstructorDefault(schema.ast, defaultValue), {
|
|
2016
|
+
schema
|
|
2017
|
+
});
|
|
2010
2018
|
}
|
|
2011
2019
|
/**
|
|
2012
2020
|
* **Options**
|
|
@@ -2025,10 +2033,10 @@ export function withConstructorDefault(defaultValue) {
|
|
|
2025
2033
|
* **Example** (Default for a missing struct key)
|
|
2026
2034
|
*
|
|
2027
2035
|
* ```ts
|
|
2028
|
-
* import { Schema } from "effect"
|
|
2036
|
+
* import { Effect, Schema } from "effect"
|
|
2029
2037
|
*
|
|
2030
2038
|
* const MySchema = Schema.Struct({
|
|
2031
|
-
* name: Schema.String.pipe(Schema.withDecodingDefaultKey((
|
|
2039
|
+
* name: Schema.String.pipe(Schema.withDecodingDefaultKey(Effect.succeed("anonymous")))
|
|
2032
2040
|
* })
|
|
2033
2041
|
*
|
|
2034
2042
|
* const result = Schema.decodeUnknownSync(MySchema)({})
|
|
@@ -2067,10 +2075,10 @@ export function withDecodingDefaultKey(defaultValue, options) {
|
|
|
2067
2075
|
* **Example** (Default for an optional field value)
|
|
2068
2076
|
*
|
|
2069
2077
|
* ```ts
|
|
2070
|
-
* import { Schema } from "effect"
|
|
2078
|
+
* import { Effect, Schema } from "effect"
|
|
2071
2079
|
*
|
|
2072
2080
|
* const MySchema = Schema.Struct({
|
|
2073
|
-
* name: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault((
|
|
2081
|
+
* name: Schema.String.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("anonymous")))
|
|
2074
2082
|
* })
|
|
2075
2083
|
*
|
|
2076
2084
|
* const result = Schema.decodeUnknownSync(MySchema)({ name: undefined })
|
|
@@ -2091,7 +2099,7 @@ export function withDecodingDefault(defaultValue, options) {
|
|
|
2091
2099
|
}
|
|
2092
2100
|
/**
|
|
2093
2101
|
* Combines a {@link Literal} schema with {@link withConstructorDefault}, making it ideal
|
|
2094
|
-
* for discriminator fields in tagged unions. When constructing via `
|
|
2102
|
+
* for discriminator fields in tagged unions. When constructing via `make`, the
|
|
2095
2103
|
* `_tag` field can be omitted and will be filled automatically.
|
|
2096
2104
|
*
|
|
2097
2105
|
* **Example** (Discriminated union tag)
|
|
@@ -2101,8 +2109,8 @@ export function withDecodingDefault(defaultValue, options) {
|
|
|
2101
2109
|
*
|
|
2102
2110
|
* const A = Schema.Struct({ _tag: Schema.tag("A"), value: Schema.Number })
|
|
2103
2111
|
*
|
|
2104
|
-
* // _tag is optional in
|
|
2105
|
-
* const a = A.
|
|
2112
|
+
* // _tag is optional in make, auto-filled to "A"
|
|
2113
|
+
* const a = A.make({ value: 42 })
|
|
2106
2114
|
* // a: { _tag: "A", value: 42 }
|
|
2107
2115
|
* ```
|
|
2108
2116
|
*
|
|
@@ -2111,7 +2119,7 @@ export function withDecodingDefault(defaultValue, options) {
|
|
|
2111
2119
|
* @since 4.0.0
|
|
2112
2120
|
*/
|
|
2113
2121
|
export function tag(literal) {
|
|
2114
|
-
return Literal(literal).pipe(withConstructorDefault(
|
|
2122
|
+
return Literal(literal).pipe(withConstructorDefault(Effect.succeed(literal)));
|
|
2115
2123
|
}
|
|
2116
2124
|
/**
|
|
2117
2125
|
* Like {@link tag}, but additionally omits the tag field from the encoded output.
|
|
@@ -2137,7 +2145,7 @@ export function tag(literal) {
|
|
|
2137
2145
|
* @since 4.0.0
|
|
2138
2146
|
*/
|
|
2139
2147
|
export function tagDefaultOmit(literal) {
|
|
2140
|
-
return tag(literal).pipe(withDecodingDefaultKey(()
|
|
2148
|
+
return tag(literal).pipe(withDecodingDefaultKey(Effect.succeed(literal), {
|
|
2141
2149
|
encodingStrategy: "omit"
|
|
2142
2150
|
}));
|
|
2143
2151
|
}
|
|
@@ -2146,7 +2154,7 @@ export function tagDefaultOmit(literal) {
|
|
|
2146
2154
|
* to identify the specific variant of the object, which is especially useful
|
|
2147
2155
|
* when working with union types.
|
|
2148
2156
|
*
|
|
2149
|
-
* When using the `
|
|
2157
|
+
* When using the `make` method, the `_tag` field is optional and will be
|
|
2150
2158
|
* added automatically. However, when decoding or encoding, the `_tag` field
|
|
2151
2159
|
* must be present in the input.
|
|
2152
2160
|
*
|
|
@@ -2300,21 +2308,24 @@ export function TaggedUnion(casesByTag) {
|
|
|
2300
2308
|
});
|
|
2301
2309
|
}
|
|
2302
2310
|
/**
|
|
2303
|
-
* Wraps a schema so that its decoded `Type` becomes a nominally distinct type `Self`.
|
|
2304
|
-
* Useful for creating opaque types that are structurally identical to a base
|
|
2311
|
+
* Wraps a struct schema so that its decoded `Type` becomes a nominally distinct type `Self`.
|
|
2312
|
+
* Useful for creating opaque types that are structurally identical to a base struct
|
|
2305
2313
|
* but type-incompatible with it.
|
|
2306
2314
|
*
|
|
2307
|
-
* **Example** (Opaque
|
|
2315
|
+
* **Example** (Opaque struct)
|
|
2308
2316
|
*
|
|
2309
2317
|
* ```ts
|
|
2310
2318
|
* import { Schema } from "effect"
|
|
2311
2319
|
*
|
|
2312
|
-
*
|
|
2313
|
-
*
|
|
2320
|
+
* class Person extends Schema.Opaque<Person>()(
|
|
2321
|
+
* Schema.Struct({
|
|
2322
|
+
* name: Schema.String
|
|
2323
|
+
* })
|
|
2324
|
+
* ) {}
|
|
2314
2325
|
*
|
|
2315
|
-
* // Decoded value is
|
|
2316
|
-
* const
|
|
2317
|
-
* //
|
|
2326
|
+
* // Decoded value is Person, not { name: string }
|
|
2327
|
+
* const person = Schema.decodeUnknownSync(Person)({ name: "Alice" })
|
|
2328
|
+
* // person: Person
|
|
2318
2329
|
* ```
|
|
2319
2330
|
*
|
|
2320
2331
|
* @since 4.0.0
|
|
@@ -2323,8 +2334,7 @@ export function Opaque() {
|
|
|
2323
2334
|
return schema => {
|
|
2324
2335
|
// oxlint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
2325
2336
|
class Opaque {}
|
|
2326
|
-
Object.setPrototypeOf(Opaque, schema);
|
|
2327
|
-
return Opaque;
|
|
2337
|
+
return Object.setPrototypeOf(Opaque, schema);
|
|
2328
2338
|
};
|
|
2329
2339
|
}
|
|
2330
2340
|
/**
|
|
@@ -4059,19 +4069,18 @@ export function isUnique(annotations) {
|
|
|
4059
4069
|
...annotations
|
|
4060
4070
|
});
|
|
4061
4071
|
}
|
|
4062
|
-
// -----------------------------------------------------------------------------
|
|
4063
|
-
// Built-in Schemas
|
|
4064
|
-
// -----------------------------------------------------------------------------
|
|
4065
4072
|
/**
|
|
4066
4073
|
* A schema for non-empty strings. Validates that a string has at least one
|
|
4067
4074
|
* character.
|
|
4068
4075
|
*
|
|
4076
|
+
* @category String
|
|
4069
4077
|
* @since 4.0.0
|
|
4070
4078
|
*/
|
|
4071
4079
|
export const NonEmptyString = /*#__PURE__*/String.check(/*#__PURE__*/isNonEmpty());
|
|
4072
4080
|
/**
|
|
4073
4081
|
* A schema representing a single character.
|
|
4074
4082
|
*
|
|
4083
|
+
* @category String
|
|
4075
4084
|
* @since 4.0.0
|
|
4076
4085
|
*/
|
|
4077
4086
|
export const Char = /*#__PURE__*/String.check(/*#__PURE__*/isLengthBetween(1, 1));
|
|
@@ -4630,7 +4639,7 @@ export const Defect = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded.pipe(/*#
|
|
|
4630
4639
|
* A schema that represents defects, that also includes stack traces in the
|
|
4631
4640
|
* encoded form.
|
|
4632
4641
|
*
|
|
4633
|
-
* @category
|
|
4642
|
+
* @category Defect
|
|
4634
4643
|
* @since 4.0.0
|
|
4635
4644
|
*/
|
|
4636
4645
|
export const DefectWithStack = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded.pipe(/*#__PURE__*/decodeTo(ErrorWithStack, /*#__PURE__*/Transformation.errorFromErrorJsonEncoded({
|
|
@@ -4990,7 +4999,7 @@ export function Chunk(value) {
|
|
|
4990
4999
|
*
|
|
4991
5000
|
* The default JSON serializer encodes a `RegExp` as `{ source, flags }`.
|
|
4992
5001
|
*
|
|
4993
|
-
* @category
|
|
5002
|
+
* @category RegExp
|
|
4994
5003
|
* @since 4.0.0
|
|
4995
5004
|
*/
|
|
4996
5005
|
export const RegExp = /*#__PURE__*/instanceOf(globalThis.RegExp, {
|
|
@@ -5024,6 +5033,9 @@ export const RegExp = /*#__PURE__*/instanceOf(globalThis.RegExp, {
|
|
|
5024
5033
|
}).map(flags => flags.join(""))).map(([source, flags]) => new globalThis.RegExp(source, flags)),
|
|
5025
5034
|
toEquivalence: () => (a, b) => a.source === b.source && a.flags === b.flags
|
|
5026
5035
|
});
|
|
5036
|
+
const URLString = /*#__PURE__*/String.annotate({
|
|
5037
|
+
expected: "a string that will be decoded as a URL"
|
|
5038
|
+
});
|
|
5027
5039
|
/**
|
|
5028
5040
|
* A schema for JavaScript `URL` objects.
|
|
5029
5041
|
*
|
|
@@ -5043,9 +5055,7 @@ export const URL = /*#__PURE__*/instanceOf(globalThis.URL, {
|
|
|
5043
5055
|
Type: `globalThis.URL`
|
|
5044
5056
|
},
|
|
5045
5057
|
expected: "URL",
|
|
5046
|
-
toCodecJson: () => link()(
|
|
5047
|
-
expected: "a string that will be decoded as a URL"
|
|
5048
|
-
}), Transformation.urlFromString),
|
|
5058
|
+
toCodecJson: () => link()(URLString, Transformation.urlFromString),
|
|
5049
5059
|
toArbitrary: () => fc => fc.webUrl().map(s => new globalThis.URL(s)),
|
|
5050
5060
|
toEquivalence: () => (a, b) => a.toString() === b.toString()
|
|
5051
5061
|
});
|
|
@@ -5061,9 +5071,10 @@ export const URL = /*#__PURE__*/instanceOf(globalThis.URL, {
|
|
|
5061
5071
|
* @category URL
|
|
5062
5072
|
* @since 4.0.0
|
|
5063
5073
|
*/
|
|
5064
|
-
export const URLFromString = /*#__PURE__*/
|
|
5065
|
-
|
|
5066
|
-
|
|
5074
|
+
export const URLFromString = /*#__PURE__*/URLString.pipe(/*#__PURE__*/decodeTo(URL, Transformation.urlFromString));
|
|
5075
|
+
const DateString = /*#__PURE__*/String.annotate({
|
|
5076
|
+
expected: "a string in ISO 8601 format that will be decoded as a Date"
|
|
5077
|
+
});
|
|
5067
5078
|
/**
|
|
5068
5079
|
* A schema for JavaScript `Date` objects.
|
|
5069
5080
|
*
|
|
@@ -5080,7 +5091,7 @@ export const URLFromString = /*#__PURE__*/String.annotate({
|
|
|
5080
5091
|
* // => Date { 2024-01-01T00:00:00.000Z }
|
|
5081
5092
|
* ```
|
|
5082
5093
|
*
|
|
5083
|
-
* @category
|
|
5094
|
+
* @category Date
|
|
5084
5095
|
* @since 4.0.0
|
|
5085
5096
|
*/
|
|
5086
5097
|
export const Date = /*#__PURE__*/instanceOf(globalThis.Date, {
|
|
@@ -5092,20 +5103,29 @@ export const Date = /*#__PURE__*/instanceOf(globalThis.Date, {
|
|
|
5092
5103
|
Type: `globalThis.Date`
|
|
5093
5104
|
},
|
|
5094
5105
|
expected: "Date",
|
|
5095
|
-
toCodecJson: () => link()(
|
|
5096
|
-
expected: "a string in ISO 8601 format that will be decoded as a Date"
|
|
5097
|
-
}), Transformation.transform({
|
|
5098
|
-
decode: s => new globalThis.Date(s),
|
|
5099
|
-
encode: formatDate
|
|
5100
|
-
})),
|
|
5106
|
+
toCodecJson: () => link()(DateString, Transformation.dateFromString),
|
|
5101
5107
|
toArbitrary: () => (fc, ctx) => fc.date(ctx?.constraints?.date)
|
|
5102
5108
|
});
|
|
5109
|
+
/**
|
|
5110
|
+
* A transformation schema that parses an ISO 8601 string into a `Date`.
|
|
5111
|
+
*
|
|
5112
|
+
* Decoding:
|
|
5113
|
+
* - A `string` is decoded as a `Date`.
|
|
5114
|
+
*
|
|
5115
|
+
* Encoding:
|
|
5116
|
+
* - A `Date` is encoded as a `string`.
|
|
5117
|
+
*
|
|
5118
|
+
* @category Date
|
|
5119
|
+
* @since 4.0.0
|
|
5120
|
+
*/
|
|
5121
|
+
export const DateFromString = /*#__PURE__*/DateString.pipe(/*#__PURE__*/decodeTo(Date, Transformation.dateFromString));
|
|
5103
5122
|
/**
|
|
5104
5123
|
* A schema for **valid** JavaScript `Date` objects.
|
|
5105
5124
|
*
|
|
5106
5125
|
* This schema accepts `Date` instances but rejects invalid dates (such as `new
|
|
5107
5126
|
* Date("invalid")`).
|
|
5108
5127
|
*
|
|
5128
|
+
* @category Date
|
|
5109
5129
|
* @since 4.0.0
|
|
5110
5130
|
*/
|
|
5111
5131
|
export const DateValid = /*#__PURE__*/Date.check(/*#__PURE__*/isDateValid());
|
|
@@ -5220,6 +5240,9 @@ export const DurationFromNanos = /*#__PURE__*/BigInt.check(isGreaterThanOrEqualT
|
|
|
5220
5240
|
* @since 4.0.0
|
|
5221
5241
|
*/
|
|
5222
5242
|
export const DurationFromMillis = /*#__PURE__*/Number.check(isGreaterThanOrEqualTo(0)).pipe(/*#__PURE__*/decodeTo(Duration, Transformation.durationFromMillis));
|
|
5243
|
+
const BigDecimalString = /*#__PURE__*/String.annotate({
|
|
5244
|
+
expected: "a string that will be decoded as a BigDecimal"
|
|
5245
|
+
});
|
|
5223
5246
|
/**
|
|
5224
5247
|
* A schema for `BigDecimal` values.
|
|
5225
5248
|
*
|
|
@@ -5227,6 +5250,7 @@ export const DurationFromMillis = /*#__PURE__*/Number.check(isGreaterThanOrEqual
|
|
|
5227
5250
|
*
|
|
5228
5251
|
* - encodes `BigDecimal` as a `string`
|
|
5229
5252
|
*
|
|
5253
|
+
* @category BigDecimal
|
|
5230
5254
|
* @since 4.0.0
|
|
5231
5255
|
*/
|
|
5232
5256
|
export const BigDecimal = /*#__PURE__*/declare(BigDecimal_.isBigDecimal, {
|
|
@@ -5239,9 +5263,7 @@ export const BigDecimal = /*#__PURE__*/declare(BigDecimal_.isBigDecimal, {
|
|
|
5239
5263
|
importDeclaration: `import * as BigDecimal from "effect/BigDecimal"`
|
|
5240
5264
|
},
|
|
5241
5265
|
expected: "BigDecimal",
|
|
5242
|
-
toCodecJson: () => link()(
|
|
5243
|
-
expected: "a string that will be decoded as a BigDecimal"
|
|
5244
|
-
}), Transformation.bigDecimalFromString),
|
|
5266
|
+
toCodecJson: () => link()(BigDecimalString, Transformation.bigDecimalFromString),
|
|
5245
5267
|
toArbitrary: () => fc => fc.tuple(fc.bigInt(), fc.integer({
|
|
5246
5268
|
min: 0,
|
|
5247
5269
|
max: 20
|
|
@@ -5249,6 +5271,19 @@ export const BigDecimal = /*#__PURE__*/declare(BigDecimal_.isBigDecimal, {
|
|
|
5249
5271
|
toFormatter: () => bd => BigDecimal_.format(bd),
|
|
5250
5272
|
toEquivalence: () => BigDecimal_.Equivalence
|
|
5251
5273
|
});
|
|
5274
|
+
/**
|
|
5275
|
+
* A transformation schema that parses a string into a `BigDecimal`.
|
|
5276
|
+
*
|
|
5277
|
+
* Decoding:
|
|
5278
|
+
* - A `string` is decoded as a `BigDecimal`.
|
|
5279
|
+
*
|
|
5280
|
+
* Encoding:
|
|
5281
|
+
* - A `BigDecimal` is encoded as a `string`.
|
|
5282
|
+
*
|
|
5283
|
+
* @category BigDecimal
|
|
5284
|
+
* @since 4.0.0
|
|
5285
|
+
*/
|
|
5286
|
+
export const BigDecimalFromString = /*#__PURE__*/BigDecimalString.pipe(/*#__PURE__*/decodeTo(BigDecimal, Transformation.bigDecimalFromString));
|
|
5252
5287
|
/**
|
|
5253
5288
|
* A transformation schema that decodes a JSON-encoded string into an `unknown` value.
|
|
5254
5289
|
*
|
|
@@ -5269,6 +5304,7 @@ export const BigDecimal = /*#__PURE__*/declare(BigDecimal_.isBigDecimal, {
|
|
|
5269
5304
|
* // => { a: 1, b: 2 }
|
|
5270
5305
|
* ```
|
|
5271
5306
|
*
|
|
5307
|
+
* @category JSON
|
|
5272
5308
|
* @since 4.0.0
|
|
5273
5309
|
*/
|
|
5274
5310
|
export const UnknownFromJsonString = /*#__PURE__*/fromJsonString(Unknown);
|
|
@@ -5333,6 +5369,7 @@ export const UnknownFromJsonString = /*#__PURE__*/fromJsonString(Unknown);
|
|
|
5333
5369
|
* // }
|
|
5334
5370
|
* ```
|
|
5335
5371
|
*
|
|
5372
|
+
* @category JSON
|
|
5336
5373
|
* @since 4.0.0
|
|
5337
5374
|
*/
|
|
5338
5375
|
export function fromJsonString(schema) {
|
|
@@ -5348,7 +5385,7 @@ export function fromJsonString(schema) {
|
|
|
5348
5385
|
* The default JSON serializer encodes a `File` as `{ data, type, name, lastModified }`
|
|
5349
5386
|
* where `data` is base64-encoded.
|
|
5350
5387
|
*
|
|
5351
|
-
* @category
|
|
5388
|
+
* @category File
|
|
5352
5389
|
* @since 4.0.0
|
|
5353
5390
|
*/
|
|
5354
5391
|
export const File = /*#__PURE__*/instanceOf(globalThis.File, {
|
|
@@ -5400,7 +5437,7 @@ export const File = /*#__PURE__*/instanceOf(globalThis.File, {
|
|
|
5400
5437
|
* The default JSON serializer encodes a `FormData` as an array of `[key, entry]`
|
|
5401
5438
|
* pairs where each entry is tagged as `"String"` or `"File"`.
|
|
5402
5439
|
*
|
|
5403
|
-
* @category
|
|
5440
|
+
* @category FormData
|
|
5404
5441
|
* @since 4.0.0
|
|
5405
5442
|
*/
|
|
5406
5443
|
export const FormData = /*#__PURE__*/instanceOf(globalThis.FormData, {
|
|
@@ -5534,7 +5571,7 @@ export function fromFormData(schema) {
|
|
|
5534
5571
|
*
|
|
5535
5572
|
* The default JSON serializer encodes a `URLSearchParams` as a query string.
|
|
5536
5573
|
*
|
|
5537
|
-
* @category
|
|
5574
|
+
* @category URLSearchParams
|
|
5538
5575
|
* @since 4.0.0
|
|
5539
5576
|
*/
|
|
5540
5577
|
export const URLSearchParams = /*#__PURE__*/instanceOf(globalThis.URLSearchParams, {
|
|
@@ -5633,12 +5670,14 @@ export function fromURLSearchParams(schema) {
|
|
|
5633
5670
|
/**
|
|
5634
5671
|
* A schema for finite numbers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
5635
5672
|
*
|
|
5673
|
+
* @category Number
|
|
5636
5674
|
* @since 4.0.0
|
|
5637
5675
|
*/
|
|
5638
5676
|
export const Finite = /*#__PURE__*/Number.check(/*#__PURE__*/isFinite());
|
|
5639
5677
|
/**
|
|
5640
5678
|
* A schema for integers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
5641
5679
|
*
|
|
5680
|
+
* @category Number
|
|
5642
5681
|
* @since 4.0.0
|
|
5643
5682
|
*/
|
|
5644
5683
|
export const Int = /*#__PURE__*/Number.check(/*#__PURE__*/isInt());
|
|
@@ -5651,6 +5690,7 @@ export const Int = /*#__PURE__*/Number.check(/*#__PURE__*/isInt());
|
|
|
5651
5690
|
* Encoding:
|
|
5652
5691
|
* - A number is encoded as a `string`.
|
|
5653
5692
|
*
|
|
5693
|
+
* @category Number
|
|
5654
5694
|
* @since 4.0.0
|
|
5655
5695
|
*/
|
|
5656
5696
|
export const NumberFromString = /*#__PURE__*/String.annotate({
|
|
@@ -5666,14 +5706,29 @@ export const NumberFromString = /*#__PURE__*/String.annotate({
|
|
|
5666
5706
|
* Encoding:
|
|
5667
5707
|
* - A finite number is encoded as a `string`.
|
|
5668
5708
|
*
|
|
5709
|
+
* @category Number
|
|
5669
5710
|
* @since 4.0.0
|
|
5670
5711
|
*/
|
|
5671
5712
|
export const FiniteFromString = /*#__PURE__*/String.annotate({
|
|
5672
5713
|
expected: "a string that will be decoded as a finite number"
|
|
5673
5714
|
}).pipe(/*#__PURE__*/decodeTo(Finite, Transformation.numberFromString));
|
|
5715
|
+
/**
|
|
5716
|
+
* A transformation schema that parses a string into a `bigint`.
|
|
5717
|
+
*
|
|
5718
|
+
* Decoding:
|
|
5719
|
+
* - A `string` is decoded as a `bigint`.
|
|
5720
|
+
*
|
|
5721
|
+
* Encoding:
|
|
5722
|
+
* - A `bigint` is encoded as a `string`.
|
|
5723
|
+
*
|
|
5724
|
+
* @category BigInt
|
|
5725
|
+
* @since 4.0.0
|
|
5726
|
+
*/
|
|
5727
|
+
export const BigIntFromString = /*#__PURE__*/make(AST.bigIntString).pipe(/*#__PURE__*/decodeTo(BigInt, Transformation.bigintFromString));
|
|
5674
5728
|
/**
|
|
5675
5729
|
* A schema for strings that contains no leading or trailing whitespaces.
|
|
5676
5730
|
*
|
|
5731
|
+
* @category String
|
|
5677
5732
|
* @since 4.0.0
|
|
5678
5733
|
*/
|
|
5679
5734
|
export const Trimmed = /*#__PURE__*/String.check(/*#__PURE__*/isTrimmed());
|
|
@@ -5686,19 +5741,100 @@ export const Trimmed = /*#__PURE__*/String.check(/*#__PURE__*/isTrimmed());
|
|
|
5686
5741
|
* Encoding:
|
|
5687
5742
|
* - The trimmed string is encoded as is.
|
|
5688
5743
|
*
|
|
5744
|
+
* @category String
|
|
5689
5745
|
* @since 4.0.0
|
|
5690
5746
|
*/
|
|
5691
5747
|
export const Trim = /*#__PURE__*/String.annotate({
|
|
5692
5748
|
expected: "a string that will be decoded as a trimmed string"
|
|
5693
5749
|
}).pipe(/*#__PURE__*/decodeTo(Trimmed, /*#__PURE__*/Transformation.trim()));
|
|
5750
|
+
/**
|
|
5751
|
+
* Decodes a base64 (RFC4648) encoded string into a UTF-8 string.
|
|
5752
|
+
*
|
|
5753
|
+
* Decoding:
|
|
5754
|
+
* - A **valid** base64 encoded string is decoded as a UTF-8 `string`.
|
|
5755
|
+
*
|
|
5756
|
+
* Encoding:
|
|
5757
|
+
* - A `string` is encoded as a base64-encoded string.
|
|
5758
|
+
*
|
|
5759
|
+
* @category String
|
|
5760
|
+
* @since 4.0.0
|
|
5761
|
+
*/
|
|
5762
|
+
export const StringFromBase64 = /*#__PURE__*/String.annotate({
|
|
5763
|
+
expected: "a base64 encoded string that will be decoded as a UTF-8 string"
|
|
5764
|
+
}).pipe(/*#__PURE__*/decodeTo(String, Transformation.stringFromBase64String));
|
|
5765
|
+
/**
|
|
5766
|
+
* Decodes a base64 (URL) encoded string into a UTF-8 string.
|
|
5767
|
+
*
|
|
5768
|
+
* Decoding:
|
|
5769
|
+
* - A **valid** base64 (URL) encoded string is decoded as a UTF-8 `string`.
|
|
5770
|
+
*
|
|
5771
|
+
* Encoding:
|
|
5772
|
+
* - A `string` is encoded as a base64 (URL) encoded string.
|
|
5773
|
+
*
|
|
5774
|
+
* @category String
|
|
5775
|
+
* @since 4.0.0
|
|
5776
|
+
*/
|
|
5777
|
+
export const StringFromBase64Url = /*#__PURE__*/String.annotate({
|
|
5778
|
+
expected: "a base64 (URL) encoded string that will be decoded as a UTF-8 string"
|
|
5779
|
+
}).pipe(/*#__PURE__*/decodeTo(String, Transformation.stringFromBase64UrlString));
|
|
5780
|
+
/**
|
|
5781
|
+
* Decodes a hex encoded string into a UTF-8 string.
|
|
5782
|
+
*
|
|
5783
|
+
* Decoding:
|
|
5784
|
+
* - A **valid** hex encoded string is decoded as a UTF-8 `string`.
|
|
5785
|
+
*
|
|
5786
|
+
* Encoding:
|
|
5787
|
+
* - A `string` is encoded as a hex string.
|
|
5788
|
+
*
|
|
5789
|
+
* @category String
|
|
5790
|
+
* @since 4.0.0
|
|
5791
|
+
*/
|
|
5792
|
+
export const StringFromHex = /*#__PURE__*/String.annotate({
|
|
5793
|
+
expected: "a hex encoded string that will be decoded as a UTF-8 string"
|
|
5794
|
+
}).pipe(/*#__PURE__*/decodeTo(String, Transformation.stringFromHexString));
|
|
5795
|
+
/**
|
|
5796
|
+
* Decodes a URI component encoded string into a UTF-8 string.
|
|
5797
|
+
* Can be used to store data in a URL.
|
|
5798
|
+
*
|
|
5799
|
+
* Decoding:
|
|
5800
|
+
* - A **valid** URI component encoded string is decoded as a UTF-8 `string`.
|
|
5801
|
+
*
|
|
5802
|
+
* Encoding:
|
|
5803
|
+
* - A `string` is encoded as a URI component encoded string.
|
|
5804
|
+
*
|
|
5805
|
+
* **Example**
|
|
5806
|
+
*
|
|
5807
|
+
* ```ts
|
|
5808
|
+
* import { Schema } from "effect"
|
|
5809
|
+
*
|
|
5810
|
+
* const PaginationSchema = Schema.Struct({
|
|
5811
|
+
* maxItemPerPage: Schema.Number,
|
|
5812
|
+
* page: Schema.Number
|
|
5813
|
+
* })
|
|
5814
|
+
*
|
|
5815
|
+
* const UrlSchema = Schema.StringFromUriComponent.pipe(
|
|
5816
|
+
* Schema.decodeTo(Schema.fromJsonString(PaginationSchema))
|
|
5817
|
+
* )
|
|
5818
|
+
*
|
|
5819
|
+
* console.log(Schema.encodeSync(UrlSchema)({ maxItemPerPage: 10, page: 1 }))
|
|
5820
|
+
* // %7B%22maxItemPerPage%22%3A10%2C%22page%22%3A1%7D
|
|
5821
|
+
* ```
|
|
5822
|
+
*
|
|
5823
|
+
* @category String
|
|
5824
|
+
* @since 4.0.0
|
|
5825
|
+
*/
|
|
5826
|
+
export const StringFromUriComponent = /*#__PURE__*/String.annotate({
|
|
5827
|
+
expected: "a URI component encoded string that will be decoded as a UTF-8 string"
|
|
5828
|
+
}).pipe(/*#__PURE__*/decodeTo(String, Transformation.stringFromUriComponent));
|
|
5694
5829
|
/**
|
|
5695
5830
|
* A union schema for JavaScript property keys: `number | symbol | string`.
|
|
5696
5831
|
*
|
|
5697
|
-
* @category
|
|
5832
|
+
* @category PropertyKey
|
|
5698
5833
|
* @since 4.0.0
|
|
5699
5834
|
*/
|
|
5700
5835
|
export const PropertyKey = /*#__PURE__*/Union([Finite, Symbol, String]);
|
|
5701
5836
|
/**
|
|
5837
|
+
* @category StandardSchema
|
|
5702
5838
|
* @since 4.0.0
|
|
5703
5839
|
*/
|
|
5704
5840
|
export const StandardSchemaV1FailureResult = /*#__PURE__*/Struct({
|
|
@@ -5903,6 +6039,9 @@ export const TimeZoneOffset = /*#__PURE__*/declare(DateTime.isTimeZoneOffset, {
|
|
|
5903
6039
|
toFormatter: () => tz => DateTime.zoneToString(tz),
|
|
5904
6040
|
toEquivalence: () => (a, b) => a.offset === b.offset
|
|
5905
6041
|
});
|
|
6042
|
+
const TimeZoneNamedString = /*#__PURE__*/String.annotate({
|
|
6043
|
+
expected: "an IANA time zone identifier"
|
|
6044
|
+
});
|
|
5906
6045
|
/**
|
|
5907
6046
|
* A schema for `DateTime.TimeZone.Named` values.
|
|
5908
6047
|
*
|
|
@@ -5923,13 +6062,27 @@ export const TimeZoneNamed = /*#__PURE__*/declare(DateTime.isTimeZoneNamed, {
|
|
|
5923
6062
|
importDeclaration: `import * as DateTime from "effect/DateTime"`
|
|
5924
6063
|
},
|
|
5925
6064
|
expected: "DateTime.TimeZone.Named",
|
|
5926
|
-
toCodecJson: () => link()(
|
|
5927
|
-
expected: "an IANA time zone identifier"
|
|
5928
|
-
}), Transformation.timeZoneNamedFromString),
|
|
6065
|
+
toCodecJson: () => link()(TimeZoneNamedString, Transformation.timeZoneNamedFromString),
|
|
5929
6066
|
toArbitrary: () => fc => fc.constantFrom(...["UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney"].map(DateTime.zoneMakeNamedUnsafe)),
|
|
5930
6067
|
toFormatter: () => tz => DateTime.zoneToString(tz),
|
|
5931
6068
|
toEquivalence: () => (a, b) => a.id === b.id
|
|
5932
6069
|
});
|
|
6070
|
+
/**
|
|
6071
|
+
* A transformation schema that parses an IANA time zone identifier string into a `DateTime.TimeZone.Named`.
|
|
6072
|
+
*
|
|
6073
|
+
* Decoding:
|
|
6074
|
+
* - A `string` is decoded as a `DateTime.TimeZone.Named`.
|
|
6075
|
+
*
|
|
6076
|
+
* Encoding:
|
|
6077
|
+
* - A `DateTime.TimeZone.Named` is encoded as a `string`.
|
|
6078
|
+
*
|
|
6079
|
+
* @category DateTime
|
|
6080
|
+
* @since 4.0.0
|
|
6081
|
+
*/
|
|
6082
|
+
export const TimeZoneNamedFromString = /*#__PURE__*/TimeZoneNamedString.pipe(/*#__PURE__*/decodeTo(TimeZoneNamed, Transformation.timeZoneNamedFromString));
|
|
6083
|
+
const TimeZoneString = /*#__PURE__*/String.annotate({
|
|
6084
|
+
expected: "a time zone string (IANA identifier or offset like +03:00)"
|
|
6085
|
+
});
|
|
5933
6086
|
/**
|
|
5934
6087
|
* A schema for `DateTime.TimeZone` values.
|
|
5935
6088
|
*
|
|
@@ -5951,9 +6104,7 @@ export const TimeZone = /*#__PURE__*/declare(DateTime.isTimeZone, {
|
|
|
5951
6104
|
importDeclaration: `import * as DateTime from "effect/DateTime"`
|
|
5952
6105
|
},
|
|
5953
6106
|
expected: "DateTime.TimeZone",
|
|
5954
|
-
toCodecJson: () => link()(
|
|
5955
|
-
expected: "a time zone string (IANA identifier or offset like +03:00)"
|
|
5956
|
-
}), Transformation.timeZoneFromString),
|
|
6107
|
+
toCodecJson: () => link()(TimeZoneString, Transformation.timeZoneFromString),
|
|
5957
6108
|
toArbitrary: () => fc => fc.oneof(fc.integer({
|
|
5958
6109
|
min: -12 * 60 * 60 * 1000,
|
|
5959
6110
|
max: 14 * 60 * 60 * 1000
|
|
@@ -5961,6 +6112,22 @@ export const TimeZone = /*#__PURE__*/declare(DateTime.isTimeZone, {
|
|
|
5961
6112
|
toFormatter: () => tz => DateTime.zoneToString(tz),
|
|
5962
6113
|
toEquivalence: () => (a, b) => DateTime.zoneToString(a) === DateTime.zoneToString(b)
|
|
5963
6114
|
});
|
|
6115
|
+
/**
|
|
6116
|
+
* A transformation schema that parses a time zone string into a `DateTime.TimeZone`.
|
|
6117
|
+
*
|
|
6118
|
+
* Decoding:
|
|
6119
|
+
* - A `string` (IANA identifier or offset like `+03:00`) is decoded as a `DateTime.TimeZone`.
|
|
6120
|
+
*
|
|
6121
|
+
* Encoding:
|
|
6122
|
+
* - A `DateTime.TimeZone` is encoded as a `string`.
|
|
6123
|
+
*
|
|
6124
|
+
* @category DateTime
|
|
6125
|
+
* @since 4.0.0
|
|
6126
|
+
*/
|
|
6127
|
+
export const TimeZoneFromString = /*#__PURE__*/TimeZoneString.pipe(/*#__PURE__*/decodeTo(TimeZone, Transformation.timeZoneFromString));
|
|
6128
|
+
const DateTimeZonedString = /*#__PURE__*/String.annotate({
|
|
6129
|
+
expected: "a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"
|
|
6130
|
+
});
|
|
5964
6131
|
/**
|
|
5965
6132
|
* A schema for `DateTime.Zoned` values.
|
|
5966
6133
|
*
|
|
@@ -5982,9 +6149,7 @@ export const DateTimeZoned = /*#__PURE__*/declare(u => DateTime.isDateTime(u) &&
|
|
|
5982
6149
|
importDeclaration: `import * as DateTime from "effect/DateTime"`
|
|
5983
6150
|
},
|
|
5984
6151
|
expected: "DateTime.Zoned",
|
|
5985
|
-
toCodecJson: () => link()(
|
|
5986
|
-
expected: "a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"
|
|
5987
|
-
}), Transformation.dateTimeZonedFromString),
|
|
6152
|
+
toCodecJson: () => link()(DateTimeZonedString, Transformation.dateTimeZonedFromString),
|
|
5988
6153
|
toArbitrary: () => (fc, ctx) => fc.tuple(fc.date({
|
|
5989
6154
|
noInvalidDate: true,
|
|
5990
6155
|
min: new globalThis.Date(-8640000000000000 + 14 * 60 * 60 * 1000),
|
|
@@ -5996,14 +6161,27 @@ export const DateTimeZoned = /*#__PURE__*/declare(u => DateTime.isDateTime(u) &&
|
|
|
5996
6161
|
toFormatter: () => zoned => DateTime.formatIsoZoned(zoned),
|
|
5997
6162
|
toEquivalence: () => DateTime.Equivalence
|
|
5998
6163
|
});
|
|
6164
|
+
/**
|
|
6165
|
+
* A transformation schema that parses a zoned DateTime string into a `DateTime.Zoned`.
|
|
6166
|
+
*
|
|
6167
|
+
* Decoding:
|
|
6168
|
+
* - A `string` (e.g. `2024-01-01T00:00:00.000+00:00[Europe/London]`) is decoded as a `DateTime.Zoned`.
|
|
6169
|
+
*
|
|
6170
|
+
* Encoding:
|
|
6171
|
+
* - A `DateTime.Zoned` is encoded as a `string`.
|
|
6172
|
+
*
|
|
6173
|
+
* @category DateTime
|
|
6174
|
+
* @since 4.0.0
|
|
6175
|
+
*/
|
|
6176
|
+
export const DateTimeZonedFromString = /*#__PURE__*/DateTimeZonedString.pipe(/*#__PURE__*/decodeTo(DateTimeZoned, Transformation.dateTimeZonedFromString));
|
|
5999
6177
|
const immerable = /*#__PURE__*/globalThis.Symbol.for("immer-draftable");
|
|
6000
|
-
function makeClass(Inherited, identifier, struct, annotations) {
|
|
6178
|
+
function makeClass(Inherited, identifier, struct, annotations, proto) {
|
|
6001
6179
|
const getClassSchema = getClassSchemaFactory(struct, identifier, annotations);
|
|
6002
6180
|
const ClassTypeId = getClassTypeId(identifier); // HMR support
|
|
6003
|
-
|
|
6181
|
+
const out = class extends Inherited {
|
|
6004
6182
|
constructor(...[input, options]) {
|
|
6005
6183
|
const props = input ?? {};
|
|
6006
|
-
const validated = struct.
|
|
6184
|
+
const validated = struct.make(props, options);
|
|
6007
6185
|
super({
|
|
6008
6186
|
...props,
|
|
6009
6187
|
...validated
|
|
@@ -6012,11 +6190,6 @@ function makeClass(Inherited, identifier, struct, annotations) {
|
|
|
6012
6190
|
disableChecks: true
|
|
6013
6191
|
});
|
|
6014
6192
|
}
|
|
6015
|
-
toString() {
|
|
6016
|
-
return `${identifier}(${format({
|
|
6017
|
-
...this
|
|
6018
|
-
})})`;
|
|
6019
|
-
}
|
|
6020
6193
|
static [TypeId] = TypeId;
|
|
6021
6194
|
get [ClassTypeId]() {
|
|
6022
6195
|
return ClassTypeId;
|
|
@@ -6033,9 +6206,12 @@ function makeClass(Inherited, identifier, struct, annotations) {
|
|
|
6033
6206
|
static rebuild(ast) {
|
|
6034
6207
|
return getClassSchema(this).rebuild(ast);
|
|
6035
6208
|
}
|
|
6036
|
-
static
|
|
6209
|
+
static make(input, options) {
|
|
6037
6210
|
return new this(input, options);
|
|
6038
6211
|
}
|
|
6212
|
+
static makeEffect(input, options) {
|
|
6213
|
+
return Effect.mapErrorEager(Parser.makeEffect(getClassSchema(this))(input, options), issue => new SchemaError(issue));
|
|
6214
|
+
}
|
|
6039
6215
|
static makeOption(input, options) {
|
|
6040
6216
|
return Parser.makeOption(getClassSchema(this))(input, options);
|
|
6041
6217
|
}
|
|
@@ -6056,13 +6232,17 @@ function makeClass(Inherited, identifier, struct, annotations) {
|
|
|
6056
6232
|
};
|
|
6057
6233
|
return makeClass(this, identifier, makeStruct(AST.struct(fields, struct.ast.checks, {
|
|
6058
6234
|
identifier
|
|
6059
|
-
}), fields), annotations);
|
|
6235
|
+
}), fields), annotations, proto);
|
|
6060
6236
|
};
|
|
6061
6237
|
}
|
|
6062
6238
|
static mapFields(f, options) {
|
|
6063
6239
|
return struct.mapFields(f, options);
|
|
6064
6240
|
}
|
|
6065
6241
|
};
|
|
6242
|
+
if (proto !== undefined) {
|
|
6243
|
+
Object.assign(out.prototype, proto(identifier));
|
|
6244
|
+
}
|
|
6245
|
+
return out;
|
|
6066
6246
|
}
|
|
6067
6247
|
function getClassTransformation(self) {
|
|
6068
6248
|
return new Transformation.Transformation(Getter.transform(input => new self(input)), Getter.passthrough());
|
|
@@ -6140,7 +6320,13 @@ function isStruct(schema) {
|
|
|
6140
6320
|
*/
|
|
6141
6321
|
export const Class = identifier => (schema, annotations) => {
|
|
6142
6322
|
const struct = isStruct(schema) ? schema : Struct(schema);
|
|
6143
|
-
return makeClass(Data.Class, identifier, struct, annotations
|
|
6323
|
+
return makeClass(Data.Class, identifier, struct, annotations, identifier => ({
|
|
6324
|
+
toString() {
|
|
6325
|
+
return `${identifier}(${format({
|
|
6326
|
+
...this
|
|
6327
|
+
})})`;
|
|
6328
|
+
}
|
|
6329
|
+
}));
|
|
6144
6330
|
};
|
|
6145
6331
|
/**
|
|
6146
6332
|
* Like {@link Class} but automatically adds a `_tag` literal field set to the
|
|
@@ -6202,8 +6388,9 @@ export const TaggedClass = identifier => {
|
|
|
6202
6388
|
*/
|
|
6203
6389
|
export const ErrorClass = identifier => (schema, annotations) => {
|
|
6204
6390
|
const struct = isStruct(schema) ? schema : Struct(schema);
|
|
6205
|
-
const self = makeClass(core.Error, identifier, struct, annotations
|
|
6206
|
-
|
|
6391
|
+
const self = makeClass(core.Error, identifier, struct, annotations, identifier => ({
|
|
6392
|
+
name: identifier
|
|
6393
|
+
}));
|
|
6207
6394
|
return self;
|
|
6208
6395
|
};
|
|
6209
6396
|
/**
|
|
@@ -6867,12 +7054,26 @@ export const MutableJson = /*#__PURE__*/make(AST.MutableJson);
|
|
|
6867
7054
|
// Annotations
|
|
6868
7055
|
// -----------------------------------------------------------------------------
|
|
6869
7056
|
/**
|
|
6870
|
-
*
|
|
7057
|
+
* Resolves the typed annotations from a schema. The term "resolve" (rather
|
|
7058
|
+
* than "get") reflects the lookup strategy: if the schema has checks, the
|
|
7059
|
+
* annotations are taken from the last check; otherwise they are taken from
|
|
7060
|
+
* the base schema instance.
|
|
6871
7061
|
*
|
|
6872
7062
|
* @category Schema Resolvers
|
|
6873
7063
|
* @since 4.0.0
|
|
6874
7064
|
*/
|
|
6875
|
-
export function
|
|
7065
|
+
export function resolveAnnotations(schema) {
|
|
6876
7066
|
return InternalAnnotations.resolve(schema.ast);
|
|
6877
7067
|
}
|
|
7068
|
+
/**
|
|
7069
|
+
* Resolves the context (key-level) annotations from a schema. Context
|
|
7070
|
+
* annotations are those attached via `annotateKey` and live on the AST's
|
|
7071
|
+
* `context` rather than on the schema node itself.
|
|
7072
|
+
*
|
|
7073
|
+
* @category Schema Resolvers
|
|
7074
|
+
* @since 4.0.0
|
|
7075
|
+
*/
|
|
7076
|
+
export function resolveAnnotationsKey(schema) {
|
|
7077
|
+
return schema.ast.context?.annotations;
|
|
7078
|
+
}
|
|
6878
7079
|
//# sourceMappingURL=Schema.js.map
|