effect 4.0.0-beta.2 → 4.0.0-beta.20
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 +127 -299
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +102 -62
- package/dist/Array.js.map +1 -1
- package/dist/Cache.d.ts +2 -2
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +6 -5
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +1 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Channel.d.ts +116 -30
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +82 -37
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +54 -247
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +36 -67
- package/dist/Chunk.js.map +1 -1
- package/dist/Combiner.d.ts +280 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +198 -7
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +165 -9
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +62 -7
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/Cron.d.ts +1 -1
- package/dist/Data.d.ts +534 -365
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +132 -79
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +23 -161
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +6 -51
- package/dist/DateTime.js.map +1 -1
- package/dist/Duration.d.ts +12 -12
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +12 -12
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +733 -687
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +233 -250
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +194 -0
- package/dist/Encoding.d.ts.map +1 -0
- package/dist/Encoding.js +352 -0
- package/dist/Encoding.js.map +1 -0
- package/dist/Equal.d.ts +276 -109
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +124 -48
- package/dist/Equal.js.map +1 -1
- package/dist/ErrorReporter.d.ts +376 -0
- package/dist/ErrorReporter.d.ts.map +1 -0
- package/dist/ErrorReporter.js +246 -0
- package/dist/ErrorReporter.js.map +1 -0
- package/dist/Fiber.d.ts +2 -2
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FileSystem.d.ts +1 -1
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +5 -5
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +30 -34
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +15 -13
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +131 -47
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +229 -51
- package/dist/Formatter.js.map +1 -1
- package/dist/Graph.d.ts +1 -1
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +5 -8
- package/dist/Graph.js.map +1 -1
- package/dist/HashMap.d.ts +15 -14
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +4 -4
- package/dist/HashMap.js.map +1 -1
- package/dist/Iterable.d.ts +40 -39
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +94 -22
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonSchema.d.ts +299 -10
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +323 -4
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +109 -0
- package/dist/Latch.d.ts.map +1 -0
- package/dist/Latch.js +72 -0
- package/dist/Latch.js.map +1 -0
- package/dist/Layer.d.ts +9 -9
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +4 -4
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LogLevel.d.ts +32 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +28 -100
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +29 -95
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +2 -3
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +1 -1
- package/dist/ManagedRuntime.js +1 -1
- package/dist/Metric.d.ts +2 -2
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +1 -1
- package/dist/Metric.js.map +1 -1
- package/dist/Optic.d.ts +947 -18
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +454 -5
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +22 -15
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +14 -7
- package/dist/Option.js.map +1 -1
- package/dist/Pipeable.d.ts +17 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +19 -1
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +10 -9
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +2 -2
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +6 -4
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +7 -5
- package/dist/Pool.js.map +1 -1
- package/dist/PubSub.d.ts +3 -2
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +3 -2
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +1 -1
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +0 -1
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +35 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +46 -12
- 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 +1 -1
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +1 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/Record.d.ts +24 -120
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +21 -41
- package/dist/Record.js.map +1 -1
- package/dist/Reducer.d.ts +166 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +135 -1
- package/dist/Reducer.js.map +1 -1
- package/dist/References.d.ts +3 -3
- package/dist/References.d.ts.map +1 -1
- package/dist/Request.d.ts +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +2 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +6 -26
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +0 -20
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Result.d.ts +12 -0
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +12 -0
- package/dist/Result.js.map +1 -1
- package/dist/Schedule.d.ts +47 -20
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +91 -34
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +266 -50
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +426 -74
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +3 -2
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +2 -2
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +12 -14
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaParser.d.ts +5 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +10 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +44 -43
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +43 -24
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +107 -3
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +159 -4
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.d.ts +2 -2
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts +211 -0
- package/dist/Semaphore.d.ts.map +1 -0
- package/dist/{PartitionedSemaphore.js → Semaphore.js} +97 -13
- package/dist/Semaphore.js.map +1 -0
- package/dist/ServiceMap.d.ts +39 -30
- package/dist/ServiceMap.d.ts.map +1 -1
- package/dist/ServiceMap.js +3 -3
- package/dist/ServiceMap.js.map +1 -1
- package/dist/Sink.d.ts +13 -13
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +53 -6
- package/dist/Sink.js.map +1 -1
- package/dist/Stream.d.ts +235 -423
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +123 -76
- package/dist/Stream.js.map +1 -1
- package/dist/Struct.d.ts +16 -0
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +22 -0
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +2 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +2 -1
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +2 -1
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +2 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Trie.d.ts +18 -17
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +5 -5
- package/dist/Trie.js.map +1 -1
- package/dist/TxChunk.d.ts +37 -37
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +3 -3
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +328 -0
- package/dist/TxDeferred.d.ts.map +1 -0
- package/dist/TxDeferred.js +196 -0
- package/dist/TxDeferred.js.map +1 -0
- package/dist/TxHashMap.d.ts +84 -83
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +24 -24
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +35 -35
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +14 -14
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +609 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -0
- package/dist/TxPriorityQueue.js +415 -0
- package/dist/TxPriorityQueue.js.map +1 -0
- package/dist/TxPubSub.d.ts +585 -0
- package/dist/TxPubSub.d.ts.map +1 -0
- package/dist/TxPubSub.js +521 -0
- package/dist/TxPubSub.js.map +1 -0
- package/dist/TxQueue.d.ts +32 -32
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +26 -26
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +523 -0
- package/dist/TxReentrantLock.d.ts.map +1 -0
- package/dist/TxReentrantLock.js +504 -0
- package/dist/TxReentrantLock.js.map +1 -0
- package/dist/TxRef.d.ts +34 -34
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +21 -14
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +8 -8
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +7 -7
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +508 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -0
- package/dist/TxSubscriptionRef.js +293 -0
- package/dist/TxSubscriptionRef.js.map +1 -0
- package/dist/Types.d.ts +84 -6
- package/dist/Types.d.ts.map +1 -1
- package/dist/index.d.ts +591 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +591 -20
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js +11 -3
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +3 -11
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +225 -99
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +5 -4
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/random.d.ts +2 -0
- package/dist/internal/random.d.ts.map +1 -0
- package/dist/internal/random.js +13 -0
- package/dist/internal/random.js.map +1 -0
- package/dist/internal/rcRef.js +3 -2
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/request.js +2 -2
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/annotations.js +2 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -0
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/trie.js +5 -4
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/TestClock.d.ts +7 -6
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +6 -4
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +8 -8
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +128 -48
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +11 -12
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +3 -3
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +4 -3
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +4 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +86 -14
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +163 -87
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +49 -12
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +1 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +33 -6
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +25 -7
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +22 -6
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +20 -20
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Response.d.ts +26 -26
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +1 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +19 -3
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +14 -9
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +1 -1
- package/dist/unstable/ai/index.js +1 -1
- package/dist/unstable/cli/CliError.d.ts +5 -5
- package/dist/unstable/cli/CliOutput.js +59 -6
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +276 -19
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +234 -36
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +125 -0
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -0
- package/dist/unstable/cli/GlobalFlag.js +118 -0
- package/dist/unstable/cli/GlobalFlag.js.map +1 -0
- package/dist/unstable/cli/HelpDoc.d.ts +70 -2
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/index.d.ts +4 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +4 -0
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +17 -8
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +32 -23
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js +7 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts +33 -0
- package/dist/unstable/cli/internal/help.d.ts.map +1 -0
- package/dist/unstable/cli/internal/help.js +107 -0
- package/dist/unstable/cli/internal/help.js.map +1 -0
- package/dist/unstable/cli/internal/parser.js +29 -36
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +4 -3
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +7 -6
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.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/Envelope.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +4 -4
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +10 -10
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +2 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +6 -6
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +4 -3
- package/dist/unstable/cluster/Runners.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 +9 -7
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +21 -21
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +20 -20
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +5 -4
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -1
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +2 -1
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +36 -36
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +1 -1
- package/dist/unstable/encoding/Sse.d.ts +4 -4
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +2 -2
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +2 -1
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +6 -6
- package/dist/unstable/http/Cookies.d.ts +3 -3
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +2 -2
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +27 -10
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +17 -2
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +28 -1
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +37 -13
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +4 -4
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +7 -7
- package/dist/unstable/http/HttpClientRequest.d.ts +27 -11
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +15 -3
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +3 -8
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +42 -56
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -4
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +3 -3
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -6
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +8 -17
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +20 -33
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +37 -44
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +5 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +2 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +3 -1
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +3 -3
- package/dist/unstable/http/UrlParams.d.ts +14 -6
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +1 -1
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
- package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js +10 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
- package/dist/unstable/httpapi/HttpApi.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +11 -5
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +23 -12
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +7 -2
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +3 -3
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +31 -44
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +15 -24
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +11 -0
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +29 -9
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -4
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +6 -0
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +32 -21
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +12 -12
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +1 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +7 -4
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +6 -6
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +6 -5
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +2 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +12 -12
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +12 -11
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +2 -2
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +3 -3
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +1 -1
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +5 -128
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +1 -65
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -7
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +21 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +10 -10
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +16 -13
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +8 -8
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +3 -3
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +6 -0
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +24 -7
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +1 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +39 -0
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -0
- package/dist/unstable/reactivity/Hydration.js +76 -0
- package/dist/unstable/reactivity/Hydration.js.map +1 -0
- package/dist/unstable/reactivity/index.d.ts +4 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +4 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +4 -4
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +5 -26
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +6 -13
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +2 -2
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +3 -3
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +13 -0
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +14 -0
- 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 +34 -9
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +0 -7
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +15 -15
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +2 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +1 -1
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +3 -3
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +3 -3
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +4 -4
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +6 -5
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +3 -3
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +14 -14
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +9 -3
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +3 -3
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +16 -5
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +17 -7
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.js +0 -1
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +2 -1
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +3 -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.js +2 -2
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +3 -3
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +8 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +133 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +2 -2
- package/src/Array.ts +190 -342
- package/src/Cache.ts +9 -8
- package/src/Cause.ts +1 -1
- package/src/Channel.ts +554 -138
- package/src/Chunk.ts +81 -268
- package/src/Combiner.ts +280 -13
- package/src/Config.ts +183 -21
- package/src/Data.ts +538 -374
- package/src/DateTime.ts +24 -164
- package/src/Duration.ts +15 -15
- package/src/Effect.ts +909 -817
- package/src/Encoding.ts +879 -0
- package/src/Equal.ts +278 -111
- package/src/ErrorReporter.ts +459 -0
- package/src/Fiber.ts +9 -2
- package/src/FileSystem.ts +7 -8
- package/src/Filter.ts +48 -58
- package/src/Formatter.ts +253 -51
- package/src/Graph.ts +24 -11
- package/src/HashMap.ts +15 -14
- package/src/Iterable.ts +105 -50
- package/src/JsonSchema.ts +383 -10
- package/src/Latch.ts +112 -0
- package/src/Layer.ts +11 -15
- package/src/LayerMap.ts +5 -5
- package/src/LogLevel.ts +37 -0
- package/src/Logger.ts +33 -100
- package/src/ManagedRuntime.ts +1 -1
- package/src/Metric.ts +4 -4
- package/src/Optic.ts +948 -19
- package/src/Option.ts +30 -20
- package/src/Pipeable.ts +32 -1
- package/src/PlatformError.ts +5 -5
- package/src/Pool.ts +13 -11
- package/src/PubSub.ts +10 -9
- package/src/Pull.ts +1 -1
- package/src/Queue.ts +0 -1
- package/src/Random.ts +51 -14
- package/src/RcMap.ts +5 -5
- package/src/RcRef.ts +1 -1
- package/src/Record.ts +43 -152
- package/src/Reducer.ts +166 -7
- package/src/References.ts +4 -4
- package/src/Request.ts +3 -2
- package/src/RequestResolver.ts +9 -29
- package/src/Result.ts +13 -0
- package/src/Schedule.ts +315 -160
- package/src/Schema.ts +661 -116
- package/src/SchemaAST.ts +3 -2
- package/src/SchemaGetter.ts +12 -14
- package/src/SchemaParser.ts +11 -0
- package/src/SchemaRepresentation.ts +43 -24
- package/src/SchemaTransformation.ts +189 -4
- package/src/ScopedCache.ts +3 -3
- package/src/Semaphore.ts +356 -0
- package/src/ServiceMap.ts +47 -38
- package/src/Sink.ts +78 -26
- package/src/Stream.ts +565 -600
- package/src/Struct.ts +26 -0
- package/src/SubscriptionRef.ts +3 -2
- package/src/SynchronizedRef.ts +3 -2
- package/src/Trie.ts +18 -17
- package/src/TxChunk.ts +72 -53
- package/src/TxDeferred.ts +394 -0
- package/src/TxHashMap.ts +332 -285
- package/src/TxHashSet.ts +111 -116
- package/src/TxPriorityQueue.ts +767 -0
- package/src/TxPubSub.ts +789 -0
- package/src/TxQueue.ts +241 -251
- package/src/TxReentrantLock.ts +753 -0
- package/src/TxRef.ts +50 -38
- package/src/TxSemaphore.ts +29 -32
- package/src/TxSubscriptionRef.ts +639 -0
- package/src/Types.ts +78 -2
- package/src/index.ts +600 -21
- package/src/internal/core.ts +12 -5
- package/src/internal/dateTime.ts +9 -30
- package/src/internal/effect.ts +660 -265
- package/src/internal/hashMap.ts +9 -7
- package/src/internal/random.ts +20 -0
- package/src/internal/rcRef.ts +4 -3
- package/src/internal/request.ts +2 -2
- package/src/internal/schema/annotations.ts +2 -0
- package/src/internal/schema/schema.ts +1 -0
- package/src/internal/trie.ts +16 -9
- package/src/testing/TestClock.ts +13 -11
- package/src/testing/TestSchema.ts +10 -10
- package/src/unstable/ai/AiError.ts +97 -44
- package/src/unstable/ai/Chat.ts +12 -11
- package/src/unstable/ai/LanguageModel.ts +129 -25
- package/src/unstable/ai/McpSchema.ts +59 -13
- package/src/unstable/ai/McpServer.ts +46 -8
- package/src/unstable/ai/Model.ts +40 -9
- package/src/unstable/ai/Prompt.ts +37 -37
- package/src/unstable/ai/Response.ts +25 -25
- package/src/unstable/ai/Tool.ts +19 -13
- package/src/unstable/ai/index.ts +1 -1
- package/src/unstable/cli/CliOutput.ts +75 -6
- package/src/unstable/cli/Command.ts +501 -60
- package/src/unstable/cli/GlobalFlag.ts +243 -0
- package/src/unstable/cli/HelpDoc.ts +80 -2
- package/src/unstable/cli/index.ts +5 -0
- package/src/unstable/cli/internal/command.ts +50 -34
- package/src/unstable/cli/internal/completions/CommandDescriptor.ts +7 -2
- package/src/unstable/cli/internal/help.ts +146 -0
- package/src/unstable/cli/internal/parser.ts +33 -54
- package/src/unstable/cluster/ClusterCron.ts +2 -2
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +5 -4
- package/src/unstable/cluster/Entity.ts +11 -10
- package/src/unstable/cluster/EntityResource.ts +4 -4
- package/src/unstable/cluster/Envelope.ts +1 -1
- package/src/unstable/cluster/K8sHttpClient.ts +5 -5
- package/src/unstable/cluster/MessageStorage.ts +3 -5
- package/src/unstable/cluster/Runners.ts +6 -5
- package/src/unstable/cluster/Sharding.ts +12 -10
- package/src/unstable/cluster/ShardingConfig.ts +30 -31
- package/src/unstable/cluster/SqlRunnerStorage.ts +1 -1
- package/src/unstable/cluster/internal/entityManager.ts +9 -8
- package/src/unstable/cluster/internal/entityReaper.ts +2 -1
- package/src/unstable/cluster/internal/resourceRef.ts +2 -1
- package/src/unstable/encoding/Sse.ts +3 -5
- package/src/unstable/eventlog/EventLog.ts +2 -1
- package/src/unstable/http/Cookies.ts +3 -3
- package/src/unstable/http/Headers.ts +28 -13
- package/src/unstable/http/HttpBody.ts +42 -1
- package/src/unstable/http/HttpClient.ts +58 -23
- package/src/unstable/http/HttpClientRequest.ts +38 -13
- package/src/unstable/http/HttpEffect.ts +46 -68
- package/src/unstable/http/HttpMethod.ts +16 -4
- package/src/unstable/http/HttpMiddleware.ts +9 -24
- package/src/unstable/http/HttpServerError.ts +42 -45
- package/src/unstable/http/HttpServerRespondable.ts +6 -6
- package/src/unstable/http/HttpServerResponse.ts +4 -2
- package/src/unstable/http/Multipart.ts +2 -2
- package/src/unstable/http/UrlParams.ts +20 -5
- package/src/unstable/http/internal/preResponseHandler.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +5 -5
- package/src/unstable/httpapi/HttpApiBuilder.ts +77 -21
- package/src/unstable/httpapi/HttpApiClient.ts +14 -6
- package/src/unstable/httpapi/HttpApiEndpoint.ts +67 -83
- package/src/unstable/httpapi/HttpApiError.ts +30 -9
- package/src/unstable/httpapi/HttpApiGroup.ts +6 -6
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -4
- package/src/unstable/httpapi/HttpApiScalar.ts +6 -0
- package/src/unstable/httpapi/HttpApiSecurity.ts +3 -3
- package/src/unstable/httpapi/OpenApi.ts +41 -23
- package/src/unstable/observability/Otlp.ts +12 -12
- package/src/unstable/observability/OtlpExporter.ts +3 -3
- package/src/unstable/observability/OtlpLogger.ts +13 -9
- package/src/unstable/observability/OtlpMetrics.ts +4 -4
- package/src/unstable/observability/OtlpTracer.ts +4 -4
- package/src/unstable/persistence/KeyValueStore.ts +6 -6
- package/src/unstable/persistence/Persistable.ts +2 -2
- package/src/unstable/persistence/PersistedCache.ts +20 -9
- package/src/unstable/persistence/PersistedQueue.ts +25 -24
- package/src/unstable/persistence/Persistence.ts +3 -3
- package/src/unstable/persistence/RateLimiter.ts +4 -4
- package/src/unstable/process/ChildProcess.ts +6 -208
- package/src/unstable/process/ChildProcessSpawner.ts +75 -14
- package/src/unstable/reactivity/Atom.ts +27 -25
- package/src/unstable/reactivity/AtomHttpApi.ts +21 -20
- package/src/unstable/reactivity/AtomRegistry.ts +31 -7
- package/src/unstable/reactivity/AtomRpc.ts +3 -3
- package/src/unstable/reactivity/Hydration.ts +112 -0
- package/src/unstable/reactivity/index.ts +5 -0
- package/src/unstable/rpc/Rpc.ts +6 -6
- package/src/unstable/rpc/RpcClient.ts +12 -54
- package/src/unstable/rpc/RpcGroup.ts +4 -4
- package/src/unstable/rpc/RpcMiddleware.ts +3 -3
- package/src/unstable/rpc/RpcSchema.ts +17 -0
- package/src/unstable/rpc/RpcSerialization.ts +44 -9
- package/src/unstable/rpc/RpcServer.ts +21 -30
- package/src/unstable/rpc/Utils.ts +2 -1
- package/src/unstable/schema/VariantSchema.ts +6 -6
- package/src/unstable/socket/Socket.ts +16 -17
- package/src/unstable/sql/SqlClient.ts +1 -1
- package/src/unstable/sql/SqlError.ts +11 -9
- package/src/unstable/sql/SqlModel.ts +5 -5
- package/src/unstable/sql/SqlSchema.ts +41 -25
- package/src/unstable/sql/Statement.ts +0 -1
- package/src/unstable/workers/Worker.ts +2 -1
- package/src/unstable/workflow/DurableClock.ts +8 -8
- package/src/unstable/workflow/DurableDeferred.ts +2 -2
- package/src/unstable/workflow/Workflow.ts +1 -1
- package/src/unstable/workflow/WorkflowEngine.ts +181 -2
- package/dist/PartitionedSemaphore.d.ts +0 -52
- package/dist/PartitionedSemaphore.d.ts.map +0 -1
- package/dist/PartitionedSemaphore.js.map +0 -1
- package/dist/encoding/Base64.d.ts +0 -67
- package/dist/encoding/Base64.d.ts.map +0 -1
- package/dist/encoding/Base64.js +0 -146
- package/dist/encoding/Base64.js.map +0 -1
- package/dist/encoding/Base64Url.d.ts +0 -60
- package/dist/encoding/Base64Url.d.ts.map +0 -1
- package/dist/encoding/Base64Url.js +0 -89
- package/dist/encoding/Base64Url.js.map +0 -1
- package/dist/encoding/EncodingError.d.ts +0 -31
- package/dist/encoding/EncodingError.d.ts.map +0 -1
- package/dist/encoding/EncodingError.js +0 -22
- package/dist/encoding/EncodingError.js.map +0 -1
- package/dist/encoding/Hex.d.ts +0 -61
- package/dist/encoding/Hex.d.ts.map +0 -1
- package/dist/encoding/Hex.js +0 -115
- package/dist/encoding/Hex.js.map +0 -1
- package/dist/encoding/index.d.ts +0 -26
- package/dist/encoding/index.d.ts.map +0 -1
- package/dist/encoding/index.js +0 -27
- package/dist/encoding/index.js.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.d.ts +0 -7
- package/dist/unstable/cli/internal/builtInFlags.d.ts.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.js +0 -44
- package/dist/unstable/cli/internal/builtInFlags.js.map +0 -1
- package/src/PartitionedSemaphore.ts +0 -182
- package/src/encoding/Base64.ts +0 -366
- package/src/encoding/Base64Url.ts +0 -104
- package/src/encoding/EncodingError.ts +0 -35
- package/src/encoding/Hex.ts +0 -390
- package/src/encoding/index.ts +0 -31
- package/src/unstable/cli/internal/builtInFlags.ts +0 -78
package/src/Schema.ts
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
/** @effect-diagnostics schemaStructWithTag:skip-file */
|
|
5
6
|
import type { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec"
|
|
6
7
|
import * as Arr from "./Array.ts"
|
|
8
|
+
import * as BigDecimal_ from "./BigDecimal.ts"
|
|
7
9
|
import type * as Brand from "./Brand.ts"
|
|
8
10
|
import * as Cause_ from "./Cause.ts"
|
|
9
11
|
import type * as Combiner from "./Combiner.ts"
|
|
@@ -12,13 +14,15 @@ import * as DateTime from "./DateTime.ts"
|
|
|
12
14
|
import type { Differ } from "./Differ.ts"
|
|
13
15
|
import * as Duration_ from "./Duration.ts"
|
|
14
16
|
import * as Effect from "./Effect.ts"
|
|
15
|
-
import * as
|
|
17
|
+
import * as Encoding from "./Encoding.ts"
|
|
16
18
|
import * as Equal from "./Equal.ts"
|
|
17
19
|
import * as Equivalence from "./Equivalence.ts"
|
|
18
20
|
import * as Exit_ from "./Exit.ts"
|
|
19
21
|
import type { Formatter } from "./Formatter.ts"
|
|
20
22
|
import { format, formatDate, formatPropertyKey } from "./Formatter.ts"
|
|
21
23
|
import { identity } from "./Function.ts"
|
|
24
|
+
import * as HashMap_ from "./HashMap.ts"
|
|
25
|
+
import * as HashSet_ from "./HashSet.ts"
|
|
22
26
|
import * as core from "./internal/core.ts"
|
|
23
27
|
import * as InternalAnnotations from "./internal/schema/annotations.ts"
|
|
24
28
|
import * as InternalArbitrary from "./internal/schema/arbitrary.ts"
|
|
@@ -149,6 +153,7 @@ export interface Bottom<
|
|
|
149
153
|
* @throws {Error} The issue is contained in the error cause.
|
|
150
154
|
*/
|
|
151
155
|
makeUnsafe(input: this["~type.make.in"], options?: MakeOptions): this["Type"]
|
|
156
|
+
makeOption(input: this["~type.make.in"], options?: MakeOptions): Option_.Option<this["Type"]>
|
|
152
157
|
}
|
|
153
158
|
|
|
154
159
|
/**
|
|
@@ -321,7 +326,7 @@ export declare namespace Schema {
|
|
|
321
326
|
/**
|
|
322
327
|
* @since 4.0.0
|
|
323
328
|
*/
|
|
324
|
-
export type Type<S extends Top
|
|
329
|
+
export type Type<S> = S extends Top ? S["Type"] : never
|
|
325
330
|
}
|
|
326
331
|
|
|
327
332
|
/**
|
|
@@ -349,15 +354,15 @@ export declare namespace Codec {
|
|
|
349
354
|
/**
|
|
350
355
|
* @since 4.0.0
|
|
351
356
|
*/
|
|
352
|
-
export type Encoded<S extends Top
|
|
357
|
+
export type Encoded<S> = S extends Top ? S["Encoded"] : never
|
|
353
358
|
/**
|
|
354
359
|
* @since 4.0.0
|
|
355
360
|
*/
|
|
356
|
-
export type DecodingServices<S extends Top
|
|
361
|
+
export type DecodingServices<S> = S extends Top ? S["DecodingServices"] : never
|
|
357
362
|
/**
|
|
358
363
|
* @since 4.0.0
|
|
359
364
|
*/
|
|
360
|
-
export type EncodingServices<S extends Top
|
|
365
|
+
export type EncodingServices<S> = S extends Top ? S["EncodingServices"] : never
|
|
361
366
|
/**
|
|
362
367
|
* @since 4.0.0
|
|
363
368
|
*/
|
|
@@ -1631,6 +1636,27 @@ export interface Struct<Fields extends Struct.Fields> extends
|
|
|
1631
1636
|
>
|
|
1632
1637
|
{
|
|
1633
1638
|
readonly "~rebuild.out": this
|
|
1639
|
+
/**
|
|
1640
|
+
* The field definitions of this struct. Spread them into a new struct to
|
|
1641
|
+
* reuse fields across schemas.
|
|
1642
|
+
*
|
|
1643
|
+
* **Example** (Reusing fields across structs)
|
|
1644
|
+
*
|
|
1645
|
+
* ```ts
|
|
1646
|
+
* import { Schema } from "effect"
|
|
1647
|
+
*
|
|
1648
|
+
* const Timestamped = Schema.Struct({
|
|
1649
|
+
* createdAt: Schema.Date,
|
|
1650
|
+
* updatedAt: Schema.Date
|
|
1651
|
+
* })
|
|
1652
|
+
*
|
|
1653
|
+
* const User = Schema.Struct({
|
|
1654
|
+
* ...Timestamped.fields,
|
|
1655
|
+
* name: Schema.String,
|
|
1656
|
+
* email: Schema.String
|
|
1657
|
+
* })
|
|
1658
|
+
* ```
|
|
1659
|
+
*/
|
|
1634
1660
|
readonly fields: Fields
|
|
1635
1661
|
/**
|
|
1636
1662
|
* Returns a new struct with the fields modified by the provided function.
|
|
@@ -1713,7 +1739,7 @@ export function fieldsAssign<const NewFields extends Struct.Fields>(fields: NewF
|
|
|
1713
1739
|
* @since 4.0.0
|
|
1714
1740
|
*/
|
|
1715
1741
|
export function encodeKeys<
|
|
1716
|
-
S extends Struct
|
|
1742
|
+
S extends Top & { readonly fields: Struct.Fields },
|
|
1717
1743
|
const M extends { readonly [K in keyof S["fields"]]?: PropertyKey }
|
|
1718
1744
|
>(mapping: M) {
|
|
1719
1745
|
return function(
|
|
@@ -1731,11 +1757,12 @@ export function encodeKeys<
|
|
|
1731
1757
|
const fields: any = {}
|
|
1732
1758
|
const reverseMapping: any = {}
|
|
1733
1759
|
for (const k in self.fields) {
|
|
1760
|
+
const encoded = toEncoded(self.fields[k])
|
|
1734
1761
|
if (Object.hasOwn(mapping, k)) {
|
|
1735
|
-
fields[mapping[k]!] =
|
|
1762
|
+
fields[mapping[k]!] = encoded
|
|
1736
1763
|
reverseMapping[mapping[k]!] = k
|
|
1737
1764
|
} else {
|
|
1738
|
-
fields[k] =
|
|
1765
|
+
fields[k] = encoded
|
|
1739
1766
|
}
|
|
1740
1767
|
}
|
|
1741
1768
|
return Struct(fields).pipe(decodeTo(
|
|
@@ -1801,11 +1828,6 @@ export declare namespace Record {
|
|
|
1801
1828
|
readonly "Iso": PropertyKey
|
|
1802
1829
|
}
|
|
1803
1830
|
|
|
1804
|
-
/**
|
|
1805
|
-
* @since 4.0.0
|
|
1806
|
-
*/
|
|
1807
|
-
export type Record = Record$<Record.Key, Top>
|
|
1808
|
-
|
|
1809
1831
|
/**
|
|
1810
1832
|
* @since 4.0.0
|
|
1811
1833
|
*/
|
|
@@ -1864,14 +1886,14 @@ export declare namespace Record {
|
|
|
1864
1886
|
/**
|
|
1865
1887
|
* @since 4.0.0
|
|
1866
1888
|
*/
|
|
1867
|
-
export interface Record
|
|
1889
|
+
export interface $Record<Key extends Record.Key, Value extends Top> extends
|
|
1868
1890
|
Bottom<
|
|
1869
1891
|
Record.Type<Key, Value>,
|
|
1870
1892
|
Record.Encoded<Key, Value>,
|
|
1871
1893
|
Record.DecodingServices<Key, Value>,
|
|
1872
1894
|
Record.EncodingServices<Key, Value>,
|
|
1873
1895
|
AST.Objects,
|
|
1874
|
-
Record
|
|
1896
|
+
$Record<Key, Value>,
|
|
1875
1897
|
Simplify<Record.MakeIn<Key, Value>>,
|
|
1876
1898
|
Record.Iso<Key, Value>
|
|
1877
1899
|
>
|
|
@@ -1893,7 +1915,7 @@ export function Record<Key extends Record.Key, Value extends Top>(
|
|
|
1893
1915
|
readonly encode?: Combiner.Combiner<readonly [Key["Encoded"], Value["Encoded"]]> | undefined
|
|
1894
1916
|
}
|
|
1895
1917
|
}
|
|
1896
|
-
): Record
|
|
1918
|
+
): $Record<Key, Value> {
|
|
1897
1919
|
const keyValueCombiner = options?.keyValueCombiner?.decode || options?.keyValueCombiner?.encode
|
|
1898
1920
|
? new AST.KeyValueCombiner(options.keyValueCombiner.decode, options.keyValueCombiner.encode)
|
|
1899
1921
|
: undefined
|
|
@@ -1912,7 +1934,7 @@ export declare namespace StructWithRest {
|
|
|
1912
1934
|
/**
|
|
1913
1935
|
* @since 4.0.0
|
|
1914
1936
|
*/
|
|
1915
|
-
export type Records = ReadonlyArray<Record.
|
|
1937
|
+
export type Records = ReadonlyArray<$Record<Record.Key, Top>>
|
|
1916
1938
|
|
|
1917
1939
|
type MergeTuple<T extends ReadonlyArray<unknown>> = T extends readonly [infer Head, ...infer Tail] ?
|
|
1918
1940
|
Head & MergeTuple<Tail>
|
|
@@ -2244,14 +2266,14 @@ export function TupleWithRest<S extends Tuple<Tuple.Elements>, const Rest extend
|
|
|
2244
2266
|
/**
|
|
2245
2267
|
* @since 4.0.0
|
|
2246
2268
|
*/
|
|
2247
|
-
export interface Array
|
|
2269
|
+
export interface $Array<S extends Top> extends
|
|
2248
2270
|
Bottom<
|
|
2249
2271
|
ReadonlyArray<S["Type"]>,
|
|
2250
2272
|
ReadonlyArray<S["Encoded"]>,
|
|
2251
2273
|
S["DecodingServices"],
|
|
2252
2274
|
S["EncodingServices"],
|
|
2253
2275
|
AST.Arrays,
|
|
2254
|
-
Array
|
|
2276
|
+
$Array<S>,
|
|
2255
2277
|
ReadonlyArray<S["~type.make"]>,
|
|
2256
2278
|
ReadonlyArray<S["Iso"]>
|
|
2257
2279
|
>
|
|
@@ -2261,8 +2283,8 @@ export interface Array$<S extends Top> extends
|
|
|
2261
2283
|
}
|
|
2262
2284
|
|
|
2263
2285
|
interface ArrayLambda extends Lambda {
|
|
2264
|
-
<S extends Top>(self: S): Array
|
|
2265
|
-
readonly "~lambda.out": this["~lambda.in"] extends Top ? Array
|
|
2286
|
+
<S extends Top>(self: S): $Array<S>
|
|
2287
|
+
readonly "~lambda.out": this["~lambda.in"] extends Top ? $Array<this["~lambda.in"]> : never
|
|
2266
2288
|
}
|
|
2267
2289
|
|
|
2268
2290
|
/**
|
|
@@ -2306,7 +2328,7 @@ export const NonEmptyArray = Struct_.lambda<NonEmptyArrayLambda>((schema) =>
|
|
|
2306
2328
|
/**
|
|
2307
2329
|
* @since 4.0.0
|
|
2308
2330
|
*/
|
|
2309
|
-
export interface UniqueArray<S extends Top> extends Array
|
|
2331
|
+
export interface UniqueArray<S extends Top> extends $Array<S> {}
|
|
2310
2332
|
|
|
2311
2333
|
/**
|
|
2312
2334
|
* Returns a new array schema that ensures all elements are unique.
|
|
@@ -3309,12 +3331,12 @@ export interface TaggedUnion<Cases extends Record<string, Top>> extends
|
|
|
3309
3331
|
readonly guards: { [K in keyof Cases]: (u: unknown) => u is Cases[K]["Type"] }
|
|
3310
3332
|
readonly match: {
|
|
3311
3333
|
<Output>(
|
|
3312
|
-
value: Cases[keyof Cases]["Type"],
|
|
3313
3334
|
cases: { [K in keyof Cases]: (value: Cases[K]["Type"]) => Output }
|
|
3314
|
-
): Output
|
|
3335
|
+
): (value: Cases[keyof Cases]["Type"]) => Output
|
|
3315
3336
|
<Output>(
|
|
3337
|
+
value: Cases[keyof Cases]["Type"],
|
|
3316
3338
|
cases: { [K in keyof Cases]: (value: Cases[K]["Type"]) => Output }
|
|
3317
|
-
):
|
|
3339
|
+
): Output
|
|
3318
3340
|
}
|
|
3319
3341
|
}
|
|
3320
3342
|
|
|
@@ -4755,6 +4777,63 @@ export const isBetweenBigInt = makeIsBetween({
|
|
|
4755
4777
|
})
|
|
4756
4778
|
})
|
|
4757
4779
|
|
|
4780
|
+
/**
|
|
4781
|
+
* Validates that a BigDecimal is greater than the specified value (exclusive).
|
|
4782
|
+
*
|
|
4783
|
+
* @category BigDecimal checks
|
|
4784
|
+
* @since 4.0.0
|
|
4785
|
+
*/
|
|
4786
|
+
export const isGreaterThanBigDecimal = makeIsGreaterThan({
|
|
4787
|
+
order: BigDecimal_.Order,
|
|
4788
|
+
formatter: (bd) => BigDecimal_.format(bd)
|
|
4789
|
+
})
|
|
4790
|
+
|
|
4791
|
+
/**
|
|
4792
|
+
* Validates that a BigDecimal is greater than or equal to the specified value
|
|
4793
|
+
* (inclusive).
|
|
4794
|
+
*
|
|
4795
|
+
* @category BigDecimal checks
|
|
4796
|
+
* @since 4.0.0
|
|
4797
|
+
*/
|
|
4798
|
+
export const isGreaterThanOrEqualToBigDecimal = makeIsGreaterThanOrEqualTo({
|
|
4799
|
+
order: BigDecimal_.Order,
|
|
4800
|
+
formatter: (bd) => BigDecimal_.format(bd)
|
|
4801
|
+
})
|
|
4802
|
+
|
|
4803
|
+
/**
|
|
4804
|
+
* Validates that a BigDecimal is less than the specified value (exclusive).
|
|
4805
|
+
*
|
|
4806
|
+
* @category BigDecimal checks
|
|
4807
|
+
* @since 4.0.0
|
|
4808
|
+
*/
|
|
4809
|
+
export const isLessThanBigDecimal = makeIsLessThan({
|
|
4810
|
+
order: BigDecimal_.Order,
|
|
4811
|
+
formatter: (bd) => BigDecimal_.format(bd)
|
|
4812
|
+
})
|
|
4813
|
+
|
|
4814
|
+
/**
|
|
4815
|
+
* Validates that a BigDecimal is less than or equal to the specified value
|
|
4816
|
+
* (inclusive).
|
|
4817
|
+
*
|
|
4818
|
+
* @category BigDecimal checks
|
|
4819
|
+
* @since 4.0.0
|
|
4820
|
+
*/
|
|
4821
|
+
export const isLessThanOrEqualToBigDecimal = makeIsLessThanOrEqualTo({
|
|
4822
|
+
order: BigDecimal_.Order,
|
|
4823
|
+
formatter: (bd) => BigDecimal_.format(bd)
|
|
4824
|
+
})
|
|
4825
|
+
|
|
4826
|
+
/**
|
|
4827
|
+
* Validates that a BigDecimal is within a specified range.
|
|
4828
|
+
*
|
|
4829
|
+
* @category BigDecimal checks
|
|
4830
|
+
* @since 4.0.0
|
|
4831
|
+
*/
|
|
4832
|
+
export const isBetweenBigDecimal = makeIsBetween({
|
|
4833
|
+
order: BigDecimal_.Order,
|
|
4834
|
+
formatter: (bd) => BigDecimal_.format(bd)
|
|
4835
|
+
})
|
|
4836
|
+
|
|
4758
4837
|
/**
|
|
4759
4838
|
* Validates that a value has at least the specified length. Works with strings
|
|
4760
4839
|
* and arrays.
|
|
@@ -5363,6 +5442,63 @@ export function OptionFromNullOr<S extends Top>(schema: S): OptionFromNullOr<S>
|
|
|
5363
5442
|
))
|
|
5364
5443
|
}
|
|
5365
5444
|
|
|
5445
|
+
/**
|
|
5446
|
+
* @since 4.0.0
|
|
5447
|
+
*/
|
|
5448
|
+
export interface OptionFromUndefinedOr<S extends Top> extends decodeTo<Option<toType<S>>, UndefinedOr<S>> {}
|
|
5449
|
+
|
|
5450
|
+
/**
|
|
5451
|
+
* Decodes an undefined-or value `T` to a required `Option<T>` value.
|
|
5452
|
+
*
|
|
5453
|
+
* Decoding:
|
|
5454
|
+
* - `undefined` is decoded as `None`
|
|
5455
|
+
* - other values are decoded as `Some`
|
|
5456
|
+
*
|
|
5457
|
+
* Encoding:
|
|
5458
|
+
* - `None` is encoded as `undefined`
|
|
5459
|
+
* - `Some` is encoded as the value
|
|
5460
|
+
*
|
|
5461
|
+
* @category Option
|
|
5462
|
+
* @since 4.0.0
|
|
5463
|
+
*/
|
|
5464
|
+
export function OptionFromUndefinedOr<S extends Top>(schema: S): OptionFromUndefinedOr<S> {
|
|
5465
|
+
return UndefinedOr(schema).pipe(decodeTo(
|
|
5466
|
+
Option(toType(schema)),
|
|
5467
|
+
Transformation.optionFromUndefinedOr()
|
|
5468
|
+
))
|
|
5469
|
+
}
|
|
5470
|
+
|
|
5471
|
+
/**
|
|
5472
|
+
* @since 4.0.0
|
|
5473
|
+
*/
|
|
5474
|
+
export interface OptionFromNullishOr<S extends Top> extends decodeTo<Option<toType<S>>, NullishOr<S>> {}
|
|
5475
|
+
|
|
5476
|
+
/**
|
|
5477
|
+
* Decodes a nullish value `T` to a required `Option<T>` value.
|
|
5478
|
+
*
|
|
5479
|
+
* Decoding:
|
|
5480
|
+
* - `null` and `undefined` are decoded as `None`
|
|
5481
|
+
* - other values are decoded as `Some`
|
|
5482
|
+
*
|
|
5483
|
+
* Encoding:
|
|
5484
|
+
* - `None` is encoded as `null` or `undefined` depending on the provided `options.onNoneEncoding` (defaults to `undefined`)
|
|
5485
|
+
* - `Some` is encoded as the value
|
|
5486
|
+
*
|
|
5487
|
+
* @category Option
|
|
5488
|
+
* @since 4.0.0
|
|
5489
|
+
*/
|
|
5490
|
+
export function OptionFromNullishOr<S extends Top>(
|
|
5491
|
+
schema: S,
|
|
5492
|
+
options?: {
|
|
5493
|
+
onNoneEncoding: null | undefined
|
|
5494
|
+
}
|
|
5495
|
+
): OptionFromNullishOr<S> {
|
|
5496
|
+
return NullishOr(schema).pipe(decodeTo(
|
|
5497
|
+
Option(toType(schema)),
|
|
5498
|
+
Transformation.optionFromNullishOr(options)
|
|
5499
|
+
))
|
|
5500
|
+
}
|
|
5501
|
+
|
|
5366
5502
|
/**
|
|
5367
5503
|
* @since 4.0.0
|
|
5368
5504
|
*/
|
|
@@ -5651,15 +5787,15 @@ export function RedactedFromValue<S extends Top>(value: S, options?: {
|
|
|
5651
5787
|
}
|
|
5652
5788
|
|
|
5653
5789
|
/**
|
|
5654
|
-
* @category
|
|
5790
|
+
* @category CauseReason
|
|
5655
5791
|
* @since 4.0.0
|
|
5656
5792
|
*/
|
|
5657
|
-
export interface
|
|
5793
|
+
export interface CauseReason<E extends Top, D extends Top> extends
|
|
5658
5794
|
declareConstructor<
|
|
5659
5795
|
Cause_.Reason<E["Type"]>,
|
|
5660
5796
|
Cause_.Reason<E["Encoded"]>,
|
|
5661
5797
|
readonly [E, D],
|
|
5662
|
-
|
|
5798
|
+
CauseReasonIso<E, D>
|
|
5663
5799
|
>
|
|
5664
5800
|
{
|
|
5665
5801
|
readonly error: E
|
|
@@ -5667,10 +5803,10 @@ export interface CauseFailure<E extends Top, D extends Top> extends
|
|
|
5667
5803
|
}
|
|
5668
5804
|
|
|
5669
5805
|
/**
|
|
5670
|
-
* @category
|
|
5806
|
+
* @category CauseReason
|
|
5671
5807
|
* @since 4.0.0
|
|
5672
5808
|
*/
|
|
5673
|
-
export type
|
|
5809
|
+
export type CauseReasonIso<E extends Top, D extends Top> = {
|
|
5674
5810
|
readonly _tag: "Fail"
|
|
5675
5811
|
readonly error: E["Iso"]
|
|
5676
5812
|
} | {
|
|
@@ -5682,11 +5818,11 @@ export type CauseFailureIso<E extends Top, D extends Top> = {
|
|
|
5682
5818
|
}
|
|
5683
5819
|
|
|
5684
5820
|
/**
|
|
5685
|
-
* @category
|
|
5821
|
+
* @category CauseReason
|
|
5686
5822
|
* @since 4.0.0
|
|
5687
5823
|
*/
|
|
5688
|
-
export function
|
|
5689
|
-
const schema = declareConstructor<Cause_.Reason<E["Type"]>, Cause_.Reason<E["Encoded"]>,
|
|
5824
|
+
export function CauseReason<E extends Top, D extends Top>(error: E, defect: D): CauseReason<E, D> {
|
|
5825
|
+
const schema = declareConstructor<Cause_.Reason<E["Type"]>, Cause_.Reason<E["Encoded"]>, CauseReasonIso<E, D>>()(
|
|
5690
5826
|
[error, defect],
|
|
5691
5827
|
([error, defect]) => (input, ast, options) => {
|
|
5692
5828
|
if (!Cause_.isReason(input)) {
|
|
@@ -5719,7 +5855,7 @@ export function CauseFailure<E extends Top, D extends Top>(error: E, defect: D):
|
|
|
5719
5855
|
_tag: "effect/Cause/Failure"
|
|
5720
5856
|
},
|
|
5721
5857
|
generation: {
|
|
5722
|
-
runtime: `Schema.
|
|
5858
|
+
runtime: `Schema.CauseReason(?, ?)`,
|
|
5723
5859
|
Type: `Cause.Failure<?, ?>`,
|
|
5724
5860
|
importDeclaration: `import * as Cause from "effect/Cause"`
|
|
5725
5861
|
},
|
|
@@ -5745,15 +5881,15 @@ export function CauseFailure<E extends Top, D extends Top>(error: E, defect: D):
|
|
|
5745
5881
|
encode: identity
|
|
5746
5882
|
})
|
|
5747
5883
|
),
|
|
5748
|
-
toArbitrary: ([error, defect]) =>
|
|
5749
|
-
toEquivalence: ([error, defect]) =>
|
|
5750
|
-
toFormatter: ([error, defect]) =>
|
|
5884
|
+
toArbitrary: ([error, defect]) => causeReasonToArbitrary(error, defect),
|
|
5885
|
+
toEquivalence: ([error, defect]) => causeReasonToEquivalence(error, defect),
|
|
5886
|
+
toFormatter: ([error, defect]) => causeReasonToFormatter(error, defect)
|
|
5751
5887
|
}
|
|
5752
5888
|
)
|
|
5753
5889
|
return make(schema.ast, { error, defect })
|
|
5754
5890
|
}
|
|
5755
5891
|
|
|
5756
|
-
function
|
|
5892
|
+
function causeReasonToArbitrary<E, D>(error: FastCheck.Arbitrary<E>, defect: FastCheck.Arbitrary<D>) {
|
|
5757
5893
|
return (fc: typeof FastCheck, ctx: Annotations.ToArbitrary.Context | undefined) => {
|
|
5758
5894
|
return fc.oneof(
|
|
5759
5895
|
ctx?.isSuspend ? { maxDepth: 2, depthIdentifier: "Cause.Failure" } : {},
|
|
@@ -5765,7 +5901,7 @@ function causeFailureToArbitrary<E, D>(error: FastCheck.Arbitrary<E>, defect: Fa
|
|
|
5765
5901
|
}
|
|
5766
5902
|
}
|
|
5767
5903
|
|
|
5768
|
-
function
|
|
5904
|
+
function causeReasonToEquivalence<E>(error: Equivalence.Equivalence<E>, defect: Equivalence.Equivalence<unknown>) {
|
|
5769
5905
|
return (a: Cause_.Reason<E>, b: Cause_.Reason<E>) => {
|
|
5770
5906
|
if (a._tag !== b._tag) return false
|
|
5771
5907
|
switch (a._tag) {
|
|
@@ -5779,7 +5915,7 @@ function causeFailureToEquivalence<E>(error: Equivalence.Equivalence<E>, defect:
|
|
|
5779
5915
|
}
|
|
5780
5916
|
}
|
|
5781
5917
|
|
|
5782
|
-
function
|
|
5918
|
+
function causeReasonToFormatter<E>(error: Formatter<E>, defect: Formatter<unknown>) {
|
|
5783
5919
|
return (t: Cause_.Reason<E>) => {
|
|
5784
5920
|
switch (t._tag) {
|
|
5785
5921
|
case "Fail":
|
|
@@ -5812,7 +5948,7 @@ export interface Cause<E extends Top, D extends Top> extends
|
|
|
5812
5948
|
* @category Cause
|
|
5813
5949
|
* @since 4.0.0
|
|
5814
5950
|
*/
|
|
5815
|
-
export type CauseIso<E extends Top, D extends Top> = ReadonlyArray<
|
|
5951
|
+
export type CauseIso<E extends Top, D extends Top> = ReadonlyArray<CauseReasonIso<E, D>>
|
|
5816
5952
|
|
|
5817
5953
|
/**
|
|
5818
5954
|
* @category Cause
|
|
@@ -5821,15 +5957,17 @@ export type CauseIso<E extends Top, D extends Top> = ReadonlyArray<CauseFailureI
|
|
|
5821
5957
|
export function Cause<E extends Top, D extends Top>(error: E, defect: D): Cause<E, D> {
|
|
5822
5958
|
const schema = declareConstructor<Cause_.Cause<E["Type"]>, Cause_.Cause<E["Encoded"]>, CauseIso<E, D>>()(
|
|
5823
5959
|
[error, defect],
|
|
5824
|
-
([error, defect]) =>
|
|
5825
|
-
|
|
5826
|
-
|
|
5960
|
+
([error, defect]) => {
|
|
5961
|
+
const failures = Array(CauseReason(error, defect))
|
|
5962
|
+
return (input, ast, options) => {
|
|
5963
|
+
if (!Cause_.isCause(input)) {
|
|
5964
|
+
return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
|
|
5965
|
+
}
|
|
5966
|
+
return Effect.mapBothEager(Parser.decodeUnknownEffect(failures)(input.reasons, options), {
|
|
5967
|
+
onSuccess: Cause_.fromReasons,
|
|
5968
|
+
onFailure: (issue) => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["failures"], issue)])
|
|
5969
|
+
})
|
|
5827
5970
|
}
|
|
5828
|
-
const failures = Array(CauseFailure(error, defect))
|
|
5829
|
-
return Effect.mapBothEager(Parser.decodeUnknownEffect(failures)(input.reasons, options), {
|
|
5830
|
-
onSuccess: Cause_.fromReasons,
|
|
5831
|
-
onFailure: (issue) => new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["failures"], issue)])
|
|
5832
|
-
})
|
|
5833
5971
|
},
|
|
5834
5972
|
{
|
|
5835
5973
|
typeConstructor: {
|
|
@@ -5843,7 +5981,7 @@ export function Cause<E extends Top, D extends Top>(error: E, defect: D): Cause<
|
|
|
5843
5981
|
expected: "Cause",
|
|
5844
5982
|
toCodec: ([error, defect]) =>
|
|
5845
5983
|
link<Cause_.Cause<E["Encoded"]>>()(
|
|
5846
|
-
Array(
|
|
5984
|
+
Array(CauseReason(error, defect)),
|
|
5847
5985
|
Transformation.transform({
|
|
5848
5986
|
decode: Cause_.fromReasons,
|
|
5849
5987
|
encode: ({ reasons: failures }) => failures
|
|
@@ -5859,18 +5997,18 @@ export function Cause<E extends Top, D extends Top>(error: E, defect: D): Cause<
|
|
|
5859
5997
|
|
|
5860
5998
|
function causeToArbitrary<E, D>(error: FastCheck.Arbitrary<E>, defect: FastCheck.Arbitrary<D>) {
|
|
5861
5999
|
return (fc: typeof FastCheck, ctx: Annotations.ToArbitrary.Context | undefined) => {
|
|
5862
|
-
return fc.array(
|
|
6000
|
+
return fc.array(causeReasonToArbitrary(error, defect)(fc, ctx)).map(Cause_.fromReasons)
|
|
5863
6001
|
}
|
|
5864
6002
|
}
|
|
5865
6003
|
|
|
5866
6004
|
function causeToEquivalence<E>(error: Equivalence.Equivalence<E>, defect: Equivalence.Equivalence<unknown>) {
|
|
5867
|
-
const failures = Equivalence.Array(
|
|
6005
|
+
const failures = Equivalence.Array(causeReasonToEquivalence(error, defect))
|
|
5868
6006
|
return (a: Cause_.Cause<E>, b: Cause_.Cause<E>) => failures(a.reasons, b.reasons)
|
|
5869
6007
|
}
|
|
5870
6008
|
|
|
5871
6009
|
function causeToFormatter<E>(error: Formatter<E>, defect: Formatter<unknown>) {
|
|
5872
|
-
const
|
|
5873
|
-
return (t: Cause_.Cause<E>) => `Cause([${t.reasons.map(
|
|
6010
|
+
const causeReason = causeReasonToFormatter(error, defect)
|
|
6011
|
+
return (t: Cause_.Cause<E>) => `Cause([${t.reasons.map(causeReason).join(", ")}])`
|
|
5874
6012
|
}
|
|
5875
6013
|
|
|
5876
6014
|
/**
|
|
@@ -6044,28 +6182,32 @@ export function Exit<A extends Top, E extends Top, D extends Top>(value: A, erro
|
|
|
6044
6182
|
ExitIso<A, E, D>
|
|
6045
6183
|
>()(
|
|
6046
6184
|
[value, error, defect],
|
|
6047
|
-
([value, error, defect]) =>
|
|
6048
|
-
if (!Exit_.isExit(input)) {
|
|
6049
|
-
return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
|
|
6050
|
-
}
|
|
6185
|
+
([value, error, defect]) => {
|
|
6051
6186
|
const cause = Cause(error, defect)
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
return Effect.
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6187
|
+
return (input, ast, options) => {
|
|
6188
|
+
if (!Exit_.isExit(input)) {
|
|
6189
|
+
return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
|
|
6190
|
+
}
|
|
6191
|
+
switch (input._tag) {
|
|
6192
|
+
case "Success":
|
|
6193
|
+
return Effect.mapBothEager(
|
|
6194
|
+
Parser.decodeUnknownEffect(value)(input.value, options),
|
|
6195
|
+
{
|
|
6196
|
+
onSuccess: Exit_.succeed,
|
|
6197
|
+
onFailure: (issue) =>
|
|
6198
|
+
new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["value"], issue)])
|
|
6199
|
+
}
|
|
6200
|
+
)
|
|
6201
|
+
case "Failure":
|
|
6202
|
+
return Effect.mapBothEager(
|
|
6203
|
+
Parser.decodeUnknownEffect(cause)(input.cause, options),
|
|
6204
|
+
{
|
|
6205
|
+
onSuccess: Exit_.failCause,
|
|
6206
|
+
onFailure: (issue) =>
|
|
6207
|
+
new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["cause"], issue)])
|
|
6208
|
+
}
|
|
6209
|
+
)
|
|
6210
|
+
}
|
|
6069
6211
|
}
|
|
6070
6212
|
},
|
|
6071
6213
|
{
|
|
@@ -6131,7 +6273,7 @@ export function Exit<A extends Top, E extends Top, D extends Top>(value: A, erro
|
|
|
6131
6273
|
* @category ReadonlyMap
|
|
6132
6274
|
* @since 4.0.0
|
|
6133
6275
|
*/
|
|
6134
|
-
export interface ReadonlyMap
|
|
6276
|
+
export interface $ReadonlyMap<Key extends Top, Value extends Top> extends
|
|
6135
6277
|
declareConstructor<
|
|
6136
6278
|
globalThis.ReadonlyMap<Key["Type"], Value["Type"]>,
|
|
6137
6279
|
globalThis.ReadonlyMap<Key["Encoded"], Value["Encoded"]>,
|
|
@@ -6156,25 +6298,28 @@ export type ReadonlyMapIso<Key extends Top, Value extends Top> = ReadonlyArray<r
|
|
|
6156
6298
|
* @category ReadonlyMap
|
|
6157
6299
|
* @since 4.0.0
|
|
6158
6300
|
*/
|
|
6159
|
-
export function ReadonlyMap<Key extends Top, Value extends Top>(key: Key, value: Value): ReadonlyMap
|
|
6301
|
+
export function ReadonlyMap<Key extends Top, Value extends Top>(key: Key, value: Value): $ReadonlyMap<Key, Value> {
|
|
6160
6302
|
const schema = declareConstructor<
|
|
6161
6303
|
globalThis.ReadonlyMap<Key["Type"], Value["Type"]>,
|
|
6162
6304
|
globalThis.ReadonlyMap<Key["Encoded"], Value["Encoded"]>,
|
|
6163
6305
|
ReadonlyMapIso<Key, Value>
|
|
6164
6306
|
>()(
|
|
6165
6307
|
[key, value],
|
|
6166
|
-
([key, value]) =>
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6308
|
+
([key, value]) => {
|
|
6309
|
+
const array = Array(Tuple([key, value]))
|
|
6310
|
+
return (input, ast, options) => {
|
|
6311
|
+
if (input instanceof globalThis.Map) {
|
|
6312
|
+
return Effect.mapBothEager(
|
|
6313
|
+
Parser.decodeUnknownEffect(array)([...input], options),
|
|
6314
|
+
{
|
|
6315
|
+
onSuccess: (array: ReadonlyArray<readonly [Key["Type"], Value["Type"]]>) => new globalThis.Map(array),
|
|
6316
|
+
onFailure: (issue) =>
|
|
6317
|
+
new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["entries"], issue)])
|
|
6318
|
+
}
|
|
6319
|
+
)
|
|
6320
|
+
}
|
|
6321
|
+
return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
|
|
6176
6322
|
}
|
|
6177
|
-
return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
|
|
6178
6323
|
},
|
|
6179
6324
|
{
|
|
6180
6325
|
typeConstructor: {
|
|
@@ -6214,11 +6359,102 @@ export function ReadonlyMap<Key extends Top, Value extends Top>(key: Key, value:
|
|
|
6214
6359
|
return make(schema.ast, { key, value })
|
|
6215
6360
|
}
|
|
6216
6361
|
|
|
6362
|
+
/**
|
|
6363
|
+
* @category HashMap
|
|
6364
|
+
* @since 4.0.0
|
|
6365
|
+
*/
|
|
6366
|
+
export interface HashMap<Key extends Top, Value extends Top> extends
|
|
6367
|
+
declareConstructor<
|
|
6368
|
+
HashMap_.HashMap<Key["Type"], Value["Type"]>,
|
|
6369
|
+
HashMap_.HashMap<Key["Encoded"], Value["Encoded"]>,
|
|
6370
|
+
readonly [Key, Value],
|
|
6371
|
+
HashMapIso<Key, Value>
|
|
6372
|
+
>
|
|
6373
|
+
{
|
|
6374
|
+
readonly key: Key
|
|
6375
|
+
readonly value: Value
|
|
6376
|
+
}
|
|
6377
|
+
|
|
6378
|
+
/**
|
|
6379
|
+
* @category HashMap
|
|
6380
|
+
* @since 4.0.0
|
|
6381
|
+
*/
|
|
6382
|
+
export type HashMapIso<Key extends Top, Value extends Top> = ReadonlyArray<readonly [Key["Iso"], Value["Iso"]]>
|
|
6383
|
+
|
|
6384
|
+
/**
|
|
6385
|
+
* Creates a schema that validates a `HashMap` where keys and values must
|
|
6386
|
+
* conform to the provided schemas.
|
|
6387
|
+
*
|
|
6388
|
+
* @category HashMap
|
|
6389
|
+
* @since 4.0.0
|
|
6390
|
+
*/
|
|
6391
|
+
export function HashMap<Key extends Top, Value extends Top>(key: Key, value: Value): HashMap<Key, Value> {
|
|
6392
|
+
const schema = declareConstructor<
|
|
6393
|
+
HashMap_.HashMap<Key["Type"], Value["Type"]>,
|
|
6394
|
+
HashMap_.HashMap<Key["Encoded"], Value["Encoded"]>,
|
|
6395
|
+
HashMapIso<Key, Value>
|
|
6396
|
+
>()(
|
|
6397
|
+
[key, value],
|
|
6398
|
+
([key, value]) => {
|
|
6399
|
+
const entries = Array(Tuple([key, value]))
|
|
6400
|
+
return (input, ast, options) => {
|
|
6401
|
+
if (HashMap_.isHashMap(input)) {
|
|
6402
|
+
return Effect.mapBothEager(
|
|
6403
|
+
Parser.decodeUnknownEffect(entries)(HashMap_.toEntries(input), options),
|
|
6404
|
+
{
|
|
6405
|
+
onSuccess: HashMap_.fromIterable,
|
|
6406
|
+
onFailure: (issue) =>
|
|
6407
|
+
new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["entries"], issue)])
|
|
6408
|
+
}
|
|
6409
|
+
)
|
|
6410
|
+
}
|
|
6411
|
+
return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
|
|
6412
|
+
}
|
|
6413
|
+
},
|
|
6414
|
+
{
|
|
6415
|
+
typeConstructor: {
|
|
6416
|
+
_tag: "effect/HashMap"
|
|
6417
|
+
},
|
|
6418
|
+
generation: {
|
|
6419
|
+
runtime: `Schema.HashMap(?, ?)`,
|
|
6420
|
+
Type: `HashMap.HashMap<?, ?>`,
|
|
6421
|
+
importDeclaration: `import * as HashMap from "effect/HashMap"`
|
|
6422
|
+
},
|
|
6423
|
+
expected: "HashMap",
|
|
6424
|
+
toCodec: ([key, value]) =>
|
|
6425
|
+
link<HashMap_.HashMap<Key["Encoded"], Value["Encoded"]>>()(
|
|
6426
|
+
Array(Tuple([key, value])),
|
|
6427
|
+
Transformation.transform({
|
|
6428
|
+
decode: HashMap_.fromIterable,
|
|
6429
|
+
encode: HashMap_.toEntries
|
|
6430
|
+
})
|
|
6431
|
+
),
|
|
6432
|
+
toArbitrary: ([key, value]) => (fc, ctx) => {
|
|
6433
|
+
return fc.oneof(
|
|
6434
|
+
ctx?.isSuspend ? { maxDepth: 2, depthIdentifier: "HashMap" } : {},
|
|
6435
|
+
fc.constant([]),
|
|
6436
|
+
fc.array(fc.tuple(key, value), ctx?.constraints?.array)
|
|
6437
|
+
).map(HashMap_.fromIterable)
|
|
6438
|
+
},
|
|
6439
|
+
toEquivalence: ([key, value]) => Equal.makeCompareMap(key, value),
|
|
6440
|
+
toFormatter: ([key, value]) => (t) => {
|
|
6441
|
+
const size = HashMap_.size(t)
|
|
6442
|
+
if (size === 0) {
|
|
6443
|
+
return "HashMap(0) {}"
|
|
6444
|
+
}
|
|
6445
|
+
const entries = HashMap_.toEntries(t).sort().map(([k, v]) => `${key(k)} => ${value(v)}`)
|
|
6446
|
+
return `HashMap(${size}) { ${entries.join(", ")} }`
|
|
6447
|
+
}
|
|
6448
|
+
}
|
|
6449
|
+
)
|
|
6450
|
+
return make(schema.ast, { key, value })
|
|
6451
|
+
}
|
|
6452
|
+
|
|
6217
6453
|
/**
|
|
6218
6454
|
* @category ReadonlySet
|
|
6219
6455
|
* @since 4.0.0
|
|
6220
6456
|
*/
|
|
6221
|
-
export interface ReadonlySet
|
|
6457
|
+
export interface $ReadonlySet<Value extends Top> extends
|
|
6222
6458
|
declareConstructor<
|
|
6223
6459
|
globalThis.ReadonlySet<Value["Type"]>,
|
|
6224
6460
|
globalThis.ReadonlySet<Value["Encoded"]>,
|
|
@@ -6239,25 +6475,28 @@ export type ReadonlySetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>
|
|
|
6239
6475
|
* @category ReadonlySet
|
|
6240
6476
|
* @since 4.0.0
|
|
6241
6477
|
*/
|
|
6242
|
-
export function ReadonlySet<Value extends Top>(value: Value): ReadonlySet
|
|
6478
|
+
export function ReadonlySet<Value extends Top>(value: Value): $ReadonlySet<Value> {
|
|
6243
6479
|
const schema = declareConstructor<
|
|
6244
6480
|
globalThis.ReadonlySet<Value["Type"]>,
|
|
6245
6481
|
globalThis.ReadonlySet<Value["Encoded"]>,
|
|
6246
6482
|
ReadonlySetIso<Value>
|
|
6247
6483
|
>()(
|
|
6248
6484
|
[value],
|
|
6249
|
-
([value]) =>
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6485
|
+
([value]) => {
|
|
6486
|
+
const array = Array(value)
|
|
6487
|
+
return (input, ast, options) => {
|
|
6488
|
+
if (input instanceof globalThis.Set) {
|
|
6489
|
+
return Effect.mapBothEager(
|
|
6490
|
+
Parser.decodeUnknownEffect(array)([...input], options),
|
|
6491
|
+
{
|
|
6492
|
+
onSuccess: (array: ReadonlyArray<Value["Type"]>) => new globalThis.Set(array),
|
|
6493
|
+
onFailure: (issue) =>
|
|
6494
|
+
new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["values"], issue)])
|
|
6495
|
+
}
|
|
6496
|
+
)
|
|
6497
|
+
}
|
|
6498
|
+
return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
|
|
6259
6499
|
}
|
|
6260
|
-
return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
|
|
6261
6500
|
},
|
|
6262
6501
|
{
|
|
6263
6502
|
typeConstructor: {
|
|
@@ -6297,6 +6536,95 @@ export function ReadonlySet<Value extends Top>(value: Value): ReadonlySet$<Value
|
|
|
6297
6536
|
return make(schema.ast, { value })
|
|
6298
6537
|
}
|
|
6299
6538
|
|
|
6539
|
+
/**
|
|
6540
|
+
* @category HashSet
|
|
6541
|
+
* @since 4.0.0
|
|
6542
|
+
*/
|
|
6543
|
+
export interface HashSet<Value extends Top> extends
|
|
6544
|
+
declareConstructor<
|
|
6545
|
+
HashSet_.HashSet<Value["Type"]>,
|
|
6546
|
+
HashSet_.HashSet<Value["Encoded"]>,
|
|
6547
|
+
readonly [Value],
|
|
6548
|
+
HashSetIso<Value>
|
|
6549
|
+
>
|
|
6550
|
+
{
|
|
6551
|
+
readonly value: Value
|
|
6552
|
+
}
|
|
6553
|
+
|
|
6554
|
+
/**
|
|
6555
|
+
* @category HashSet
|
|
6556
|
+
* @since 4.0.0
|
|
6557
|
+
*/
|
|
6558
|
+
export type HashSetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>
|
|
6559
|
+
|
|
6560
|
+
/**
|
|
6561
|
+
* Creates a schema that validates a `HashSet` where values must conform to the
|
|
6562
|
+
* provided schema.
|
|
6563
|
+
*
|
|
6564
|
+
* @category HashSet
|
|
6565
|
+
* @since 4.0.0
|
|
6566
|
+
*/
|
|
6567
|
+
export function HashSet<Value extends Top>(value: Value): HashSet<Value> {
|
|
6568
|
+
const schema = declareConstructor<
|
|
6569
|
+
HashSet_.HashSet<Value["Type"]>,
|
|
6570
|
+
HashSet_.HashSet<Value["Encoded"]>,
|
|
6571
|
+
HashSetIso<Value>
|
|
6572
|
+
>()(
|
|
6573
|
+
[value],
|
|
6574
|
+
([value]) => {
|
|
6575
|
+
const values = Array(value)
|
|
6576
|
+
return (input, ast, options) => {
|
|
6577
|
+
if (HashSet_.isHashSet(input)) {
|
|
6578
|
+
return Effect.mapBothEager(
|
|
6579
|
+
Parser.decodeUnknownEffect(values)(Arr.fromIterable(input), options),
|
|
6580
|
+
{
|
|
6581
|
+
onSuccess: HashSet_.fromIterable,
|
|
6582
|
+
onFailure: (issue) =>
|
|
6583
|
+
new Issue.Composite(ast, Option_.some(input), [new Issue.Pointer(["values"], issue)])
|
|
6584
|
+
}
|
|
6585
|
+
)
|
|
6586
|
+
}
|
|
6587
|
+
return Effect.fail(new Issue.InvalidType(ast, Option_.some(input)))
|
|
6588
|
+
}
|
|
6589
|
+
},
|
|
6590
|
+
{
|
|
6591
|
+
typeConstructor: {
|
|
6592
|
+
_tag: "effect/HashSet"
|
|
6593
|
+
},
|
|
6594
|
+
generation: {
|
|
6595
|
+
runtime: `Schema.HashSet(?)`,
|
|
6596
|
+
Type: `HashSet.HashSet<?>`
|
|
6597
|
+
},
|
|
6598
|
+
expected: "HashSet",
|
|
6599
|
+
toCodec: ([value]) =>
|
|
6600
|
+
link<HashSet_.HashSet<Value["Encoded"]>>()(
|
|
6601
|
+
Array(value),
|
|
6602
|
+
Transformation.transform({
|
|
6603
|
+
decode: HashSet_.fromIterable,
|
|
6604
|
+
encode: Arr.fromIterable
|
|
6605
|
+
})
|
|
6606
|
+
),
|
|
6607
|
+
toArbitrary: ([value]) => (fc, ctx) => {
|
|
6608
|
+
return fc.oneof(
|
|
6609
|
+
ctx?.isSuspend ? { maxDepth: 2, depthIdentifier: "HashSet" } : {},
|
|
6610
|
+
fc.constant([]),
|
|
6611
|
+
fc.array(value, ctx?.constraints?.array)
|
|
6612
|
+
).map(HashSet_.fromIterable)
|
|
6613
|
+
},
|
|
6614
|
+
toEquivalence: ([value]) => Equal.makeCompareSet(value),
|
|
6615
|
+
toFormatter: ([value]) => (t) => {
|
|
6616
|
+
const size = HashSet_.size(t)
|
|
6617
|
+
if (size === 0) {
|
|
6618
|
+
return "HashSet(0) {}"
|
|
6619
|
+
}
|
|
6620
|
+
const values = globalThis.Array.from(t).sort().map((v) => `${value(v)}`)
|
|
6621
|
+
return `HashSet(${size}) { ${values.join(", ")} }`
|
|
6622
|
+
}
|
|
6623
|
+
}
|
|
6624
|
+
)
|
|
6625
|
+
return make(schema.ast, { value })
|
|
6626
|
+
}
|
|
6627
|
+
|
|
6300
6628
|
/**
|
|
6301
6629
|
* @since 4.0.0
|
|
6302
6630
|
*/
|
|
@@ -6588,6 +6916,45 @@ export const DurationFromMillis: DurationFromMillis = Number.check(isGreaterThan
|
|
|
6588
6916
|
decodeTo(Duration, Transformation.durationFromMillis)
|
|
6589
6917
|
)
|
|
6590
6918
|
|
|
6919
|
+
/**
|
|
6920
|
+
* @since 4.0.0
|
|
6921
|
+
*/
|
|
6922
|
+
export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {}
|
|
6923
|
+
|
|
6924
|
+
/**
|
|
6925
|
+
* A schema for `BigDecimal` values.
|
|
6926
|
+
*
|
|
6927
|
+
* **Default JSON serializer**
|
|
6928
|
+
*
|
|
6929
|
+
* - encodes `BigDecimal` as a `string`
|
|
6930
|
+
*
|
|
6931
|
+
* @since 4.0.0
|
|
6932
|
+
*/
|
|
6933
|
+
export const BigDecimal: BigDecimal = declare(
|
|
6934
|
+
BigDecimal_.isBigDecimal,
|
|
6935
|
+
{
|
|
6936
|
+
typeConstructor: {
|
|
6937
|
+
_tag: "effect/BigDecimal"
|
|
6938
|
+
},
|
|
6939
|
+
generation: {
|
|
6940
|
+
runtime: `Schema.BigDecimal`,
|
|
6941
|
+
Type: `BigDecimal.BigDecimal`,
|
|
6942
|
+
importDeclaration: `import * as BigDecimal from "effect/BigDecimal"`
|
|
6943
|
+
},
|
|
6944
|
+
expected: "BigDecimal",
|
|
6945
|
+
toCodecJson: () =>
|
|
6946
|
+
link<BigDecimal_.BigDecimal>()(
|
|
6947
|
+
String.annotate({ expected: "a string that will be decoded as a BigDecimal" }),
|
|
6948
|
+
Transformation.bigDecimalFromString
|
|
6949
|
+
),
|
|
6950
|
+
toArbitrary: () => (fc) =>
|
|
6951
|
+
fc.tuple(fc.bigInt(), fc.integer({ min: 0, max: 20 }))
|
|
6952
|
+
.map(([value, scale]) => BigDecimal_.make(value, scale)),
|
|
6953
|
+
toFormatter: () => (bd) => BigDecimal_.format(bd),
|
|
6954
|
+
toEquivalence: () => BigDecimal_.Equivalence
|
|
6955
|
+
}
|
|
6956
|
+
)
|
|
6957
|
+
|
|
6591
6958
|
/**
|
|
6592
6959
|
* @since 4.0.0
|
|
6593
6960
|
*/
|
|
@@ -6720,7 +7087,7 @@ export const File: File = instanceOf(globalThis.File, {
|
|
|
6720
7087
|
}),
|
|
6721
7088
|
Transformation.transformOrFail({
|
|
6722
7089
|
decode: (e) =>
|
|
6723
|
-
Result_.match(
|
|
7090
|
+
Result_.match(Encoding.decodeBase64(e.data), {
|
|
6724
7091
|
onFailure: (error) =>
|
|
6725
7092
|
Effect.fail(
|
|
6726
7093
|
new Issue.InvalidValue(Option_.some(e.data), {
|
|
@@ -6739,7 +7106,7 @@ export const File: File = instanceOf(globalThis.File, {
|
|
|
6739
7106
|
try: async () => {
|
|
6740
7107
|
const bytes = new globalThis.Uint8Array(await file.arrayBuffer())
|
|
6741
7108
|
return {
|
|
6742
|
-
data:
|
|
7109
|
+
data: Encoding.encodeBase64(bytes),
|
|
6743
7110
|
type: file.type,
|
|
6744
7111
|
name: file.name,
|
|
6745
7112
|
lastModified: file.lastModified
|
|
@@ -7273,7 +7640,7 @@ export const DateTimeUtc: DateTimeUtc = declare(
|
|
|
7273
7640
|
(u) => DateTime.isDateTime(u) && DateTime.isUtc(u),
|
|
7274
7641
|
{
|
|
7275
7642
|
typeConstructor: {
|
|
7276
|
-
_tag: "DateTime.Utc"
|
|
7643
|
+
_tag: "effect/DateTime.Utc"
|
|
7277
7644
|
},
|
|
7278
7645
|
generation: {
|
|
7279
7646
|
runtime: `Schema.DateTimeUtc`,
|
|
@@ -7284,10 +7651,7 @@ export const DateTimeUtc: DateTimeUtc = declare(
|
|
|
7284
7651
|
toCodecJson: () =>
|
|
7285
7652
|
link<DateTime.Utc>()(
|
|
7286
7653
|
String,
|
|
7287
|
-
|
|
7288
|
-
decode: Getter.dateTimeUtcFromInput(),
|
|
7289
|
-
encode: Getter.transform(DateTime.formatIso)
|
|
7290
|
-
}
|
|
7654
|
+
Transformation.dateTimeUtcFromString
|
|
7291
7655
|
),
|
|
7292
7656
|
toArbitrary: () => (fc, ctx) =>
|
|
7293
7657
|
fc.date({ noInvalidDate: true, ...ctx?.constraints?.date }).map((date) => DateTime.fromDateUnsafe(date)),
|
|
@@ -7344,10 +7708,7 @@ export const DateTimeUtcFromString: DateTimeUtcFromString = String.annotate({
|
|
|
7344
7708
|
}).pipe(
|
|
7345
7709
|
decodeTo(
|
|
7346
7710
|
DateTimeUtc,
|
|
7347
|
-
Transformation.
|
|
7348
|
-
decode: DateTime.makeUnsafe,
|
|
7349
|
-
encode: DateTime.formatIso
|
|
7350
|
-
})
|
|
7711
|
+
Transformation.dateTimeUtcFromString
|
|
7351
7712
|
)
|
|
7352
7713
|
)
|
|
7353
7714
|
|
|
@@ -7375,6 +7736,183 @@ export const DateTimeUtcFromMillis: DateTimeUtcFromMillis = Number.pipe(
|
|
|
7375
7736
|
})
|
|
7376
7737
|
)
|
|
7377
7738
|
|
|
7739
|
+
/**
|
|
7740
|
+
* @since 4.0.0
|
|
7741
|
+
*/
|
|
7742
|
+
export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {}
|
|
7743
|
+
|
|
7744
|
+
/**
|
|
7745
|
+
* A schema for `DateTime.TimeZone.Offset` values.
|
|
7746
|
+
*
|
|
7747
|
+
* **Default JSON serializer**
|
|
7748
|
+
*
|
|
7749
|
+
* - encodes `DateTime.TimeZone.Offset` as a number (offset in milliseconds)
|
|
7750
|
+
*
|
|
7751
|
+
* @category DateTime
|
|
7752
|
+
* @since 4.0.0
|
|
7753
|
+
*/
|
|
7754
|
+
export const TimeZoneOffset: TimeZoneOffset = declare(
|
|
7755
|
+
DateTime.isTimeZoneOffset,
|
|
7756
|
+
{
|
|
7757
|
+
typeConstructor: {
|
|
7758
|
+
_tag: "effect/DateTime.TimeZone.Offset"
|
|
7759
|
+
},
|
|
7760
|
+
generation: {
|
|
7761
|
+
runtime: `Schema.TimeZoneOffset`,
|
|
7762
|
+
Type: `DateTime.TimeZone.Offset`,
|
|
7763
|
+
importDeclaration: `import * as DateTime from "effect/DateTime"`
|
|
7764
|
+
},
|
|
7765
|
+
expected: "DateTime.TimeZone.Offset",
|
|
7766
|
+
toCodecJson: () =>
|
|
7767
|
+
link<DateTime.TimeZone.Offset>()(
|
|
7768
|
+
Number,
|
|
7769
|
+
Transformation.timeZoneOffsetFromNumber
|
|
7770
|
+
),
|
|
7771
|
+
toArbitrary: () => (fc) =>
|
|
7772
|
+
fc.integer({ min: -12 * 60 * 60 * 1000, max: 14 * 60 * 60 * 1000 }).map((n) => DateTime.zoneMakeOffset(n)),
|
|
7773
|
+
toFormatter: () => (tz) => DateTime.zoneToString(tz),
|
|
7774
|
+
toEquivalence: () => (a, b) => a.offset === b.offset
|
|
7775
|
+
}
|
|
7776
|
+
)
|
|
7777
|
+
|
|
7778
|
+
/**
|
|
7779
|
+
* @since 4.0.0
|
|
7780
|
+
*/
|
|
7781
|
+
export interface TimeZoneNamed extends declare<DateTime.TimeZone.Named> {}
|
|
7782
|
+
|
|
7783
|
+
/**
|
|
7784
|
+
* A schema for `DateTime.TimeZone.Named` values.
|
|
7785
|
+
*
|
|
7786
|
+
* **Default JSON serializer**
|
|
7787
|
+
*
|
|
7788
|
+
* - encodes `DateTime.TimeZone.Named` as a string (IANA time zone identifier)
|
|
7789
|
+
*
|
|
7790
|
+
* @category DateTime
|
|
7791
|
+
* @since 4.0.0
|
|
7792
|
+
*/
|
|
7793
|
+
export const TimeZoneNamed: TimeZoneNamed = declare(
|
|
7794
|
+
DateTime.isTimeZoneNamed,
|
|
7795
|
+
{
|
|
7796
|
+
typeConstructor: {
|
|
7797
|
+
_tag: "effect/DateTime.TimeZone.Named"
|
|
7798
|
+
},
|
|
7799
|
+
generation: {
|
|
7800
|
+
runtime: `Schema.TimeZoneNamed`,
|
|
7801
|
+
Type: `DateTime.TimeZone.Named`,
|
|
7802
|
+
importDeclaration: `import * as DateTime from "effect/DateTime"`
|
|
7803
|
+
},
|
|
7804
|
+
expected: "DateTime.TimeZone.Named",
|
|
7805
|
+
toCodecJson: () =>
|
|
7806
|
+
link<DateTime.TimeZone.Named>()(
|
|
7807
|
+
String.annotate({ expected: "an IANA time zone identifier" }),
|
|
7808
|
+
Transformation.timeZoneNamedFromString
|
|
7809
|
+
),
|
|
7810
|
+
toArbitrary: () => (fc) =>
|
|
7811
|
+
fc.constantFrom(
|
|
7812
|
+
...["UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney"].map(
|
|
7813
|
+
DateTime.zoneMakeNamedUnsafe
|
|
7814
|
+
)
|
|
7815
|
+
),
|
|
7816
|
+
toFormatter: () => (tz) => DateTime.zoneToString(tz),
|
|
7817
|
+
toEquivalence: () => (a, b) => a.id === b.id
|
|
7818
|
+
}
|
|
7819
|
+
)
|
|
7820
|
+
|
|
7821
|
+
/**
|
|
7822
|
+
* @since 4.0.0
|
|
7823
|
+
*/
|
|
7824
|
+
export interface TimeZone extends declare<DateTime.TimeZone> {}
|
|
7825
|
+
|
|
7826
|
+
/**
|
|
7827
|
+
* A schema for `DateTime.TimeZone` values.
|
|
7828
|
+
*
|
|
7829
|
+
* **Default JSON serializer**
|
|
7830
|
+
*
|
|
7831
|
+
* - encodes `DateTime.TimeZone` as a string (IANA identifier or offset like
|
|
7832
|
+
* `+03:00`)
|
|
7833
|
+
*
|
|
7834
|
+
* @category DateTime
|
|
7835
|
+
* @since 4.0.0
|
|
7836
|
+
*/
|
|
7837
|
+
export const TimeZone: TimeZone = declare(
|
|
7838
|
+
DateTime.isTimeZone,
|
|
7839
|
+
{
|
|
7840
|
+
typeConstructor: {
|
|
7841
|
+
_tag: "effect/DateTime.TimeZone"
|
|
7842
|
+
},
|
|
7843
|
+
generation: {
|
|
7844
|
+
runtime: `Schema.TimeZone`,
|
|
7845
|
+
Type: `DateTime.TimeZone`,
|
|
7846
|
+
importDeclaration: `import * as DateTime from "effect/DateTime"`
|
|
7847
|
+
},
|
|
7848
|
+
expected: "DateTime.TimeZone",
|
|
7849
|
+
toCodecJson: () =>
|
|
7850
|
+
link<DateTime.TimeZone>()(
|
|
7851
|
+
String.annotate({ expected: "a time zone string (IANA identifier or offset like +03:00)" }),
|
|
7852
|
+
Transformation.timeZoneFromString
|
|
7853
|
+
),
|
|
7854
|
+
toArbitrary: () => (fc) =>
|
|
7855
|
+
fc.oneof(
|
|
7856
|
+
fc.integer({ min: -12 * 60 * 60 * 1000, max: 14 * 60 * 60 * 1000 }).map((n) => DateTime.zoneMakeOffset(n)),
|
|
7857
|
+
fc.constantFrom(
|
|
7858
|
+
...["UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney"].map(
|
|
7859
|
+
DateTime.zoneMakeNamedUnsafe
|
|
7860
|
+
)
|
|
7861
|
+
)
|
|
7862
|
+
),
|
|
7863
|
+
toFormatter: () => (tz) => DateTime.zoneToString(tz),
|
|
7864
|
+
toEquivalence: () => (a, b) => DateTime.zoneToString(a) === DateTime.zoneToString(b)
|
|
7865
|
+
}
|
|
7866
|
+
)
|
|
7867
|
+
|
|
7868
|
+
/**
|
|
7869
|
+
* @since 4.0.0
|
|
7870
|
+
*/
|
|
7871
|
+
export interface DateTimeZoned extends declare<DateTime.Zoned> {}
|
|
7872
|
+
|
|
7873
|
+
/**
|
|
7874
|
+
* A schema for `DateTime.Zoned` values.
|
|
7875
|
+
*
|
|
7876
|
+
* **Default JSON serializer**
|
|
7877
|
+
*
|
|
7878
|
+
* - encodes `DateTime.Zoned` as a string in the format
|
|
7879
|
+
* `YYYY-MM-DDTHH:mm:ss.sss+HH:MM[Time/Zone]`
|
|
7880
|
+
*
|
|
7881
|
+
* @category DateTime
|
|
7882
|
+
* @since 4.0.0
|
|
7883
|
+
*/
|
|
7884
|
+
export const DateTimeZoned: DateTimeZoned = declare(
|
|
7885
|
+
(u) => DateTime.isDateTime(u) && DateTime.isZoned(u),
|
|
7886
|
+
{
|
|
7887
|
+
typeConstructor: {
|
|
7888
|
+
_tag: "effect/DateTime.Zoned"
|
|
7889
|
+
},
|
|
7890
|
+
generation: {
|
|
7891
|
+
runtime: `Schema.DateTimeZoned`,
|
|
7892
|
+
Type: `DateTime.Zoned`,
|
|
7893
|
+
importDeclaration: `import * as DateTime from "effect/DateTime"`
|
|
7894
|
+
},
|
|
7895
|
+
expected: "DateTime.Zoned",
|
|
7896
|
+
toCodecJson: () =>
|
|
7897
|
+
link<DateTime.Zoned>()(
|
|
7898
|
+
String.annotate({ expected: "a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])" }),
|
|
7899
|
+
Transformation.dateTimeZonedFromString
|
|
7900
|
+
),
|
|
7901
|
+
toArbitrary: () => (fc, ctx) =>
|
|
7902
|
+
fc.tuple(
|
|
7903
|
+
fc.date({
|
|
7904
|
+
noInvalidDate: true,
|
|
7905
|
+
min: new globalThis.Date(-8640000000000000 + 14 * 60 * 60 * 1000),
|
|
7906
|
+
max: new globalThis.Date(8640000000000000 - 14 * 60 * 60 * 1000),
|
|
7907
|
+
...ctx?.constraints?.date
|
|
7908
|
+
}),
|
|
7909
|
+
fc.constantFrom("UTC", "Europe/London", "America/New_York", "Asia/Tokyo", "Australia/Sydney")
|
|
7910
|
+
).map(([date, zone]) => DateTime.makeZonedUnsafe(date, { timeZone: zone })),
|
|
7911
|
+
toFormatter: () => (zoned) => DateTime.formatIsoZoned(zoned),
|
|
7912
|
+
toEquivalence: () => DateTime.Equivalence
|
|
7913
|
+
}
|
|
7914
|
+
)
|
|
7915
|
+
|
|
7378
7916
|
// -----------------------------------------------------------------------------
|
|
7379
7917
|
// Class
|
|
7380
7918
|
// -----------------------------------------------------------------------------
|
|
@@ -7402,7 +7940,10 @@ export interface Class<Self, S extends Top & { readonly fields: Struct.Fields },
|
|
|
7402
7940
|
>
|
|
7403
7941
|
{
|
|
7404
7942
|
// intentionally left without `readonly "~rebuild.out": this`
|
|
7405
|
-
new(
|
|
7943
|
+
new(
|
|
7944
|
+
...args: {} extends S["~type.make.in"] ? [props?: S["~type.make.in"], options?: MakeOptions]
|
|
7945
|
+
: [props: S["~type.make.in"], options?: MakeOptions]
|
|
7946
|
+
): S["Type"] & Inherited
|
|
7406
7947
|
readonly identifier: string
|
|
7407
7948
|
readonly fields: S["fields"]
|
|
7408
7949
|
/**
|
|
@@ -7463,11 +8004,12 @@ function makeClass<
|
|
|
7463
8004
|
|
|
7464
8005
|
return class extends Inherited {
|
|
7465
8006
|
constructor(...[input, options]: ReadonlyArray<any>) {
|
|
8007
|
+
const props = input ?? {}
|
|
7466
8008
|
if (options?.disableValidation) {
|
|
7467
|
-
super(
|
|
8009
|
+
super(props, options)
|
|
7468
8010
|
} else {
|
|
7469
|
-
const validated = struct.makeUnsafe(
|
|
7470
|
-
super({ ...
|
|
8011
|
+
const validated = struct.makeUnsafe(props, options)
|
|
8012
|
+
super({ ...props, ...validated }, { ...options, disableValidation: true })
|
|
7471
8013
|
}
|
|
7472
8014
|
}
|
|
7473
8015
|
|
|
@@ -7516,6 +8058,9 @@ function makeClass<
|
|
|
7516
8058
|
static makeUnsafe(input: S["~type.make.in"], options?: MakeOptions): Self {
|
|
7517
8059
|
return new this(input, options)
|
|
7518
8060
|
}
|
|
8061
|
+
static makeOption(input: S["~type.make.in"], options?: MakeOptions): Option_.Option<Self> {
|
|
8062
|
+
return Parser.makeOption(getClassSchema(this) as any)(input, options) as any
|
|
8063
|
+
}
|
|
7519
8064
|
static annotate(annotations: Annotations.Declaration<Self, readonly [S]>) {
|
|
7520
8065
|
return this.rebuild(AST.annotate(this.ast, annotations))
|
|
7521
8066
|
}
|