effect 4.0.0-beta.69 → 4.0.0-beta.70
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 +454 -0
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +152 -0
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +87 -33
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +37 -11
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +71 -14
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +35 -10
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +4 -0
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +4 -0
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +16 -11
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +16 -11
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +13 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +8 -0
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +95 -3
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +56 -2
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +312 -0
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +126 -0
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +20 -0
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +12 -0
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +59 -22
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +29 -10
- package/dist/Chunk.js.map +1 -1
- package/dist/Combiner.d.ts +75 -71
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +67 -62
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +167 -46
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +108 -28
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +235 -158
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +144 -93
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +21 -79
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +20 -75
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +4 -4
- package/dist/Context.js +2 -2
- package/dist/Cron.d.ts +42 -16
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +33 -13
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +6 -0
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +132 -70
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +44 -29
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +227 -14
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +115 -6
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +94 -27
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +33 -8
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Duration.d.ts +64 -6
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +26 -2
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +907 -603
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +360 -233
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +3 -1
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -1
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +16 -0
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +16 -0
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +52 -40
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +32 -26
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +190 -153
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +129 -104
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +35 -14
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +18 -6
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +10 -3
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +4 -3
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +212 -6
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +139 -2
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +8 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +4 -0
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +46 -23
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +27 -11
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +43 -4
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +27 -4
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +21 -6
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +17 -6
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +64 -0
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +26 -0
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +53 -21
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +20 -9
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +21 -22
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +12 -12
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +67 -75
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +29 -19
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +51 -13
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +19 -3
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +22 -21
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +33 -10
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +27 -10
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +50 -9
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +17 -3
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +4 -0
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +2 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +2 -0
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +15 -2
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +11 -2
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +104 -22
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +46 -12
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +61 -80
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +35 -42
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +16 -20
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +16 -20
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +123 -73
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +95 -53
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +28 -2
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +22 -2
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +781 -335
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +324 -129
- package/dist/Layer.js.map +1 -1
- package/dist/LogLevel.d.ts +86 -13
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +30 -4
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +63 -51
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +61 -51
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +12 -0
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +1 -0
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +83 -1
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +31 -1
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +89 -12
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +53 -8
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +14 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +4 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +2 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +24 -6
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +22 -6
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +2 -0
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +69 -30
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +52 -22
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +6 -0
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +2 -0
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +16 -30
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +6 -12
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +90 -40
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +48 -24
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +121 -111
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +56 -54
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +169 -167
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +135 -135
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +4 -0
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +2 -0
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +7 -5
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +5 -5
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +8 -0
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +4 -0
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +10 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +8 -0
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +12 -0
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +10 -0
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +30 -16
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +30 -16
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +520 -352
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +271 -184
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +4 -0
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +2 -0
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +22 -4
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +17 -3
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +16 -0
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +10 -0
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +44 -0
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +28 -0
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +25 -6
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +11 -2
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +10 -6
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +2 -2
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +3 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +24 -3
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +12 -3
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +54 -41
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +42 -32
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +10 -0
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +6 -0
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +20 -11
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +10 -6
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +45 -24
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +41 -21
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +18 -1
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +17 -1
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +3 -3
- package/dist/Request.js +2 -2
- package/dist/RequestResolver.d.ts +7 -17
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +3 -5
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +2 -0
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +2 -0
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +188 -6
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +84 -2
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +14 -11
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +11 -9
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +27 -3
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +21 -2
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +22 -19
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +14 -12
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +547 -130
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +409 -121
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +123 -65
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +90 -39
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +269 -234
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +245 -215
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +48 -46
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +34 -34
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +58 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +58 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +198 -96
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +107 -45
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +272 -203
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +249 -187
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +2 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +2 -0
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +18 -0
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -0
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +44 -0
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +18 -0
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +9 -3
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +3 -1
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +6 -0
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +4 -0
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +108 -0
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +54 -0
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +7 -3
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +2 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +416 -16
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +164 -8
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +14 -0
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +6 -0
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +371 -191
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +144 -77
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +7 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +5 -1
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +2 -0
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +2 -0
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Tracer.d.ts +17 -27
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +8 -12
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +23 -9
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +13 -3
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +287 -144
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +135 -66
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +182 -93
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +68 -35
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +3 -4
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +163 -86
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +57 -30
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +24 -27
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +9 -6
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +2 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +36 -35
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +22 -21
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +77 -114
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +45 -62
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxRef.d.ts +4 -0
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +2 -0
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +66 -27
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +38 -15
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/Types.d.ts +202 -75
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +31 -29
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +27 -21
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +28 -0
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +2 -0
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +29 -35
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +11 -13
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +18 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/testing/TestClock.d.ts +17 -17
- package/dist/testing/TestClock.js +1 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +2 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +43 -55
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +43 -55
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +62 -11
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +58 -11
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +4 -4
- package/dist/unstable/ai/AnthropicStructuredOutput.js +4 -4
- package/dist/unstable/ai/Chat.d.ts +29 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +15 -1
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +10 -0
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +8 -0
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +32 -46
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +5 -14
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +84 -32
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +73 -28
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +8 -0
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +6 -0
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +9 -5
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +4 -0
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +3 -2
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +3 -2
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +62 -35
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +16 -15
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +40 -21
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +10 -0
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +8 -0
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +4 -0
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +30 -5
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +7 -1
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +6 -0
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +4 -0
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +68 -0
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +36 -0
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +12 -0
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +6 -0
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +14 -4
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +4 -0
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +6 -0
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +4 -0
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +123 -12
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +57 -4
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +31 -14
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +23 -10
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +10 -0
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +46 -5
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +10 -0
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +10 -0
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +47 -40
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +25 -20
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +1 -0
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +10 -2
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js +3 -0
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +8 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +10 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +2 -0
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -0
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +8 -0
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +4 -0
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +4 -0
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +3 -4
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +24 -0
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +12 -0
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +10 -4
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +6 -0
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +4 -0
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +10 -0
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +8 -0
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +16 -0
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +10 -0
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +16 -0
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +16 -0
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +8 -0
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +8 -0
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +24 -0
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +18 -0
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +64 -20
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +8 -0
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +6 -6
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -3
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +2 -0
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +2 -0
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +13 -2
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +13 -2
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +8 -8
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +8 -8
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +2 -0
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +2 -0
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +4 -0
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +4 -0
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +2 -0
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +2 -0
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +3 -2
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +3 -2
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +34 -2
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +14 -0
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +4 -0
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +2 -0
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +24 -0
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +18 -0
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +46 -2
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +30 -2
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +24 -17
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +20 -11
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +16 -0
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +4 -0
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +2 -0
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +20 -0
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +18 -0
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +22 -0
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +18 -0
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +10 -0
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +10 -0
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +4 -0
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +4 -0
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +4 -0
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +4 -0
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +6 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +6 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +8 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +8 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +11 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +11 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +2 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +2 -0
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +34 -0
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +18 -0
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +4 -0
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +4 -0
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +4 -0
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +60 -0
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +24 -0
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +32 -0
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +22 -0
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +44 -0
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +14 -0
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +2 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +2 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +6 -0
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +6 -0
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +4 -0
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +4 -0
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +2 -0
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +2 -0
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +54 -16
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +26 -1
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +35 -1
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +17 -1
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +17 -3
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +16 -0
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +30 -0
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +28 -0
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +8 -0
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +6 -0
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +96 -0
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +50 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +12 -0
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +10 -0
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +49 -2
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +35 -2
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +14 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +4 -0
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +64 -0
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +28 -0
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +10 -4
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +4 -0
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +9 -4
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +5 -4
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +2 -0
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +2 -0
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +23 -14
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +6 -3
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +14 -0
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +6 -0
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +38 -15
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +4 -0
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +14 -3
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +10 -0
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +17 -11
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +17 -11
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +2 -4
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +2 -4
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +2 -0
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +2 -0
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +2 -0
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +2 -0
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +2 -0
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js +2 -0
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -0
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +2 -0
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -0
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +4 -0
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +8 -9
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +3 -3
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +8 -0
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +8 -0
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +3 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +3 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +6 -2
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +6 -2
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +10 -0
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +8 -0
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -0
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +2 -0
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +2 -0
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +2 -0
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +21 -6
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +10 -0
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +14 -0
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +14 -0
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +6 -3
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +4 -0
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +6 -0
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +4 -0
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +70 -19
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +10 -0
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +20 -4
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +105 -14
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +53 -8
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +4 -0
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +2 -0
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +8 -0
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +2 -0
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +32 -0
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +12 -0
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +8 -6
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +4 -3
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +6 -0
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +4 -0
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +27 -3
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +15 -3
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +38 -2
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +12 -2
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +6 -0
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +6 -0
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +5 -3
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +5 -3
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +43 -12
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +41 -12
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +6 -4
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +6 -4
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +8 -4
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +3 -0
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +3 -0
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +42 -34
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +18 -19
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +454 -0
- package/src/BigDecimal.ts +87 -33
- package/src/BigInt.ts +71 -14
- package/src/Boolean.ts +4 -0
- package/src/Brand.ts +16 -11
- package/src/Cache.ts +17 -1
- package/src/Cause.ts +95 -3
- package/src/Channel.ts +326 -0
- package/src/ChannelSchema.ts +24 -0
- package/src/Chunk.ts +59 -22
- package/src/Combiner.ts +75 -71
- package/src/Config.ts +167 -46
- package/src/ConfigProvider.ts +235 -158
- package/src/Console.ts +25 -99
- package/src/Context.ts +4 -4
- package/src/Cron.ts +42 -16
- package/src/Crypto.ts +6 -0
- package/src/Data.ts +132 -70
- package/src/DateTime.ts +227 -14
- package/src/Deferred.ts +94 -27
- package/src/Differ.ts +2 -0
- package/src/Duration.ts +64 -6
- package/src/Effect.ts +909 -605
- package/src/Effectable.ts +3 -1
- package/src/Encoding.ts +16 -0
- package/src/Equal.ts +52 -40
- package/src/Equivalence.ts +190 -153
- package/src/ErrorReporter.ts +35 -14
- package/src/ExecutionPlan.ts +10 -3
- package/src/Exit.ts +212 -6
- package/src/Fiber.ts +8 -0
- package/src/FiberHandle.ts +46 -23
- package/src/FiberMap.ts +43 -4
- package/src/FiberSet.ts +21 -6
- package/src/FileSystem.ts +64 -0
- package/src/Filter.ts +53 -21
- package/src/Formatter.ts +21 -22
- package/src/Function.ts +67 -75
- package/src/Graph.ts +51 -13
- package/src/HKT.ts +22 -21
- package/src/Hash.ts +33 -10
- package/src/HashMap.ts +50 -9
- package/src/HashRing.ts +4 -0
- package/src/HashSet.ts +2 -0
- package/src/Inspectable.ts +15 -2
- package/src/Iterable.ts +104 -22
- package/src/JsonPatch.ts +61 -80
- package/src/JsonPointer.ts +16 -20
- package/src/JsonSchema.ts +123 -73
- package/src/Latch.ts +28 -2
- package/src/Layer.ts +781 -335
- package/src/LogLevel.ts +86 -13
- package/src/Logger.ts +71 -51
- package/src/ManagedRuntime.ts +12 -0
- package/src/Match.ts +83 -1
- package/src/Metric.ts +105 -12
- package/src/MutableHashMap.ts +18 -0
- package/src/MutableHashSet.ts +2 -0
- package/src/MutableList.ts +24 -6
- package/src/MutableRef.ts +2 -0
- package/src/Newtype.ts +69 -30
- package/src/NonEmptyIterable.ts +6 -0
- package/src/Number.ts +16 -30
- package/src/Optic.ts +90 -40
- package/src/Option.ts +121 -111
- package/src/Order.ts +169 -167
- package/src/Ordering.ts +4 -0
- package/src/PartitionedSemaphore.ts +7 -5
- package/src/Path.ts +8 -0
- package/src/Pipeable.ts +10 -0
- package/src/PlatformError.ts +12 -0
- package/src/Pool.ts +30 -16
- package/src/Predicate.ts +520 -352
- package/src/PrimaryKey.ts +4 -0
- package/src/PubSub.ts +23 -5
- package/src/Pull.ts +16 -0
- package/src/Queue.ts +44 -0
- package/src/Random.ts +25 -6
- package/src/RcMap.ts +10 -6
- package/src/RcRef.ts +3 -1
- package/src/Record.ts +24 -3
- package/src/Redactable.ts +54 -41
- package/src/Redacted.ts +10 -0
- package/src/Reducer.ts +20 -11
- package/src/Ref.ts +95 -58
- package/src/References.ts +18 -1
- package/src/Request.ts +3 -3
- package/src/RequestResolver.ts +8 -22
- package/src/Resource.ts +2 -0
- package/src/Result.ts +192 -6
- package/src/Runtime.ts +14 -11
- package/src/Schedule.ts +35 -3
- package/src/Scheduler.ts +22 -19
- package/src/Schema.ts +547 -130
- package/src/SchemaAST.ts +123 -65
- package/src/SchemaGetter.ts +269 -234
- package/src/SchemaIssue.ts +48 -46
- package/src/SchemaParser.ts +58 -0
- package/src/SchemaRepresentation.ts +198 -96
- package/src/SchemaTransformation.ts +272 -203
- package/src/SchemaUtils.ts +2 -0
- package/src/Scope.ts +19 -1
- package/src/ScopedCache.ts +56 -0
- package/src/ScopedRef.ts +9 -3
- package/src/Semaphore.ts +6 -0
- package/src/Sink.ts +108 -0
- package/src/Stdio.ts +7 -3
- package/src/Stream.ts +464 -16
- package/src/String.ts +14 -0
- package/src/Struct.ts +371 -191
- package/src/SubscriptionRef.ts +7 -1
- package/src/SynchronizedRef.ts +2 -0
- package/src/Tracer.ts +17 -27
- package/src/Trie.ts +23 -9
- package/src/Tuple.ts +287 -144
- package/src/TxChunk.ts +182 -93
- package/src/TxDeferred.ts +3 -4
- package/src/TxHashMap.ts +171 -90
- package/src/TxHashSet.ts +36 -35
- package/src/TxPriorityQueue.ts +2 -0
- package/src/TxPubSub.ts +36 -35
- package/src/TxQueue.ts +77 -114
- package/src/TxRef.ts +4 -0
- package/src/TxSemaphore.ts +66 -27
- package/src/Types.ts +202 -75
- package/src/UndefinedOr.ts +31 -29
- package/src/Unify.ts +28 -0
- package/src/Utils.ts +29 -35
- package/src/index.ts +18 -7
- package/src/testing/TestClock.ts +16 -16
- package/src/testing/TestConsole.ts +2 -0
- package/src/testing/TestSchema.ts +43 -55
- package/src/unstable/ai/AiError.ts +62 -11
- package/src/unstable/ai/AnthropicStructuredOutput.ts +4 -4
- package/src/unstable/ai/Chat.ts +29 -1
- package/src/unstable/ai/IdGenerator.ts +10 -0
- package/src/unstable/ai/LanguageModel.ts +32 -46
- package/src/unstable/ai/McpSchema.ts +84 -32
- package/src/unstable/ai/McpServer.ts +8 -0
- package/src/unstable/ai/Model.ts +9 -5
- package/src/unstable/ai/OpenAiStructuredOutput.ts +3 -2
- package/src/unstable/ai/Prompt.ts +62 -35
- package/src/unstable/ai/Response.ts +40 -21
- package/src/unstable/ai/ResponseIdTracker.ts +8 -0
- package/src/unstable/ai/Telemetry.ts +30 -5
- package/src/unstable/ai/Tokenizer.ts +6 -0
- package/src/unstable/ai/Tool.ts +68 -0
- package/src/unstable/ai/Toolkit.ts +12 -0
- package/src/unstable/cli/Argument.ts +14 -4
- package/src/unstable/cli/CliError.ts +6 -0
- package/src/unstable/cli/Command.ts +128 -12
- package/src/unstable/cli/Flag.ts +31 -14
- package/src/unstable/cli/Param.ts +96 -9
- package/src/unstable/cli/Primitive.ts +10 -0
- package/src/unstable/cli/Prompt.ts +47 -40
- package/src/unstable/cli/internal/command.ts +11 -2
- package/src/unstable/cli/internal/completions/descriptor.ts +3 -0
- package/src/unstable/cli/internal/parser.ts +8 -1
- package/src/unstable/cluster/ClusterCron.ts +10 -1
- package/src/unstable/cluster/ClusterSchema.ts +8 -0
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -0
- package/src/unstable/cluster/DeliverAt.ts +3 -4
- package/src/unstable/cluster/Entity.ts +24 -0
- package/src/unstable/cluster/EntityProxy.ts +10 -4
- package/src/unstable/cluster/EntityProxyServer.ts +6 -0
- package/src/unstable/cluster/EntityResource.ts +10 -0
- package/src/unstable/cluster/Envelope.ts +16 -0
- package/src/unstable/cluster/HttpRunner.ts +16 -0
- package/src/unstable/cluster/K8sHttpClient.ts +8 -0
- package/src/unstable/cluster/Message.ts +24 -0
- package/src/unstable/cluster/MessageStorage.ts +44 -10
- package/src/unstable/cluster/Reply.ts +6 -6
- package/src/unstable/cluster/Runner.ts +2 -0
- package/src/unstable/cluster/RunnerHealth.ts +13 -2
- package/src/unstable/cluster/RunnerServer.ts +8 -8
- package/src/unstable/cluster/RunnerStorage.ts +2 -0
- package/src/unstable/cluster/ShardId.ts +4 -0
- package/src/unstable/cluster/Snowflake.ts +2 -0
- package/src/unstable/cluster/TestRunner.ts +3 -2
- package/src/unstable/devtools/DevToolsSchema.ts +34 -2
- package/src/unstable/devtools/DevToolsServer.ts +4 -0
- package/src/unstable/encoding/Msgpack.ts +24 -0
- package/src/unstable/encoding/Ndjson.ts +46 -2
- package/src/unstable/encoding/Sse.ts +24 -17
- package/src/unstable/eventlog/Event.ts +16 -0
- package/src/unstable/eventlog/EventGroup.ts +4 -0
- package/src/unstable/eventlog/EventJournal.ts +20 -0
- package/src/unstable/eventlog/EventLog.ts +22 -0
- package/src/unstable/eventlog/EventLogMessage.ts +10 -0
- package/src/unstable/eventlog/EventLogRemote.ts +4 -0
- package/src/unstable/eventlog/EventLogServer.ts +4 -0
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +6 -0
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +8 -0
- package/src/unstable/eventlog/EventLogSessionAuth.ts +11 -1
- package/src/unstable/eventlog/SqlEventJournal.ts +2 -0
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +2 -0
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +2 -0
- package/src/unstable/http/Cookies.ts +34 -0
- package/src/unstable/http/Etag.ts +4 -0
- package/src/unstable/http/FetchHttpClient.ts +4 -0
- package/src/unstable/http/Headers.ts +88 -0
- package/src/unstable/http/HttpBody.ts +32 -0
- package/src/unstable/http/HttpClient.ts +44 -0
- package/src/unstable/http/HttpClientRequest.ts +2 -0
- package/src/unstable/http/HttpClientResponse.ts +6 -0
- package/src/unstable/http/HttpEffect.ts +4 -0
- package/src/unstable/http/HttpPlatform.ts +2 -0
- package/src/unstable/http/HttpRouter.ts +54 -16
- package/src/unstable/http/HttpServer.ts +35 -1
- package/src/unstable/http/HttpServerError.ts +17 -3
- package/src/unstable/http/HttpServerRequest.ts +30 -0
- package/src/unstable/http/HttpServerRespondable.ts +8 -0
- package/src/unstable/http/HttpServerResponse.ts +96 -0
- package/src/unstable/http/HttpTraceContext.ts +12 -0
- package/src/unstable/http/Multipart.ts +49 -2
- package/src/unstable/http/Template.ts +14 -0
- package/src/unstable/http/UrlParams.ts +64 -0
- package/src/unstable/httpapi/HttpApi.ts +10 -4
- package/src/unstable/httpapi/HttpApiBuilder.ts +9 -4
- package/src/unstable/httpapi/HttpApiEndpoint.ts +2 -0
- package/src/unstable/httpapi/HttpApiGroup.ts +23 -14
- package/src/unstable/httpapi/HttpApiMiddleware.ts +14 -0
- package/src/unstable/httpapi/HttpApiScalar.ts +38 -15
- package/src/unstable/httpapi/HttpApiSchema.ts +14 -3
- package/src/unstable/httpapi/HttpApiSecurity.ts +17 -11
- package/src/unstable/httpapi/HttpApiSwagger.ts +2 -4
- package/src/unstable/httpapi/HttpApiTest.ts +2 -0
- package/src/unstable/httpapi/OpenApi.ts +2 -0
- package/src/unstable/observability/Otlp.ts +2 -0
- package/src/unstable/observability/OtlpExporter.ts +2 -0
- package/src/unstable/observability/OtlpLogger.ts +4 -0
- package/src/unstable/observability/OtlpMetrics.ts +8 -9
- package/src/unstable/observability/OtlpResource.ts +8 -0
- package/src/unstable/observability/OtlpTracer.ts +3 -2
- package/src/unstable/observability/PrometheusMetrics.ts +6 -2
- package/src/unstable/persistence/KeyValueStore.ts +10 -0
- package/src/unstable/persistence/Persistable.ts +2 -0
- package/src/unstable/persistence/PersistedCache.ts +2 -0
- package/src/unstable/persistence/PersistedQueue.ts +21 -6
- package/src/unstable/persistence/Persistence.ts +14 -0
- package/src/unstable/persistence/RateLimiter.ts +6 -3
- package/src/unstable/persistence/Redis.ts +6 -0
- package/src/unstable/process/ChildProcess.ts +70 -19
- package/src/unstable/process/ChildProcessSpawner.ts +20 -4
- package/src/unstable/reactivity/Atom.ts +119 -14
- package/src/unstable/reactivity/AtomHttpApi.ts +4 -0
- package/src/unstable/reactivity/AtomRef.ts +8 -0
- package/src/unstable/reactivity/AtomRegistry.ts +34 -0
- package/src/unstable/reactivity/AtomRpc.ts +8 -6
- package/src/unstable/reactivity/Hydration.ts +6 -0
- package/src/unstable/reactivity/Reactivity.ts +27 -3
- package/src/unstable/rpc/Rpc.ts +38 -2
- package/src/unstable/rpc/RpcSerialization.ts +6 -0
- package/src/unstable/rpc/RpcServer.ts +5 -3
- package/src/unstable/schema/Model.ts +43 -12
- package/src/unstable/sql/SqlClient.ts +1 -1
- package/src/unstable/sql/SqlResolver.ts +6 -4
- package/src/unstable/sql/Statement.ts +8 -4
- package/src/unstable/workflow/DurableClock.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +3 -0
- package/src/unstable/workflow/Workflow.ts +42 -34
package/dist/Effect.js
CHANGED
|
@@ -45,7 +45,7 @@ export const isEffect = core.isEffect;
|
|
|
45
45
|
* first failure; with concurrent execution, effects that have already started
|
|
46
46
|
* may be interrupted, while effects not yet started are skipped.
|
|
47
47
|
*
|
|
48
|
-
*
|
|
48
|
+
* Options:
|
|
49
49
|
*
|
|
50
50
|
* Use `concurrency` to control sequential or concurrent execution. Use
|
|
51
51
|
* `mode: "result"` to run every effect and collect each success or failure as a
|
|
@@ -159,7 +159,6 @@ export const isEffect = core.isEffect;
|
|
|
159
159
|
* ```
|
|
160
160
|
*
|
|
161
161
|
* @see {@link forEach} for iterating over elements and applying an effect.
|
|
162
|
-
*
|
|
163
162
|
* @category Collecting
|
|
164
163
|
* @since 2.0.0
|
|
165
164
|
*/
|
|
@@ -168,6 +167,8 @@ export const all = internal.all;
|
|
|
168
167
|
* Applies an effectful function to each element and partitions failures and
|
|
169
168
|
* successes.
|
|
170
169
|
*
|
|
170
|
+
* **Details**
|
|
171
|
+
*
|
|
171
172
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
172
173
|
*
|
|
173
174
|
* - `excluded` contains all failures.
|
|
@@ -196,6 +197,8 @@ export const partition = internal.partition;
|
|
|
196
197
|
/**
|
|
197
198
|
* Applies an effectful function to each element and accumulates all failures.
|
|
198
199
|
*
|
|
200
|
+
* **Details**
|
|
201
|
+
*
|
|
199
202
|
* This function always evaluates every element. If at least one effect fails,
|
|
200
203
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
201
204
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -233,6 +236,8 @@ export const validate = internal.validate;
|
|
|
233
236
|
/**
|
|
234
237
|
* Returns the first element that satisfies an effectful predicate.
|
|
235
238
|
*
|
|
239
|
+
* **Details**
|
|
240
|
+
*
|
|
236
241
|
* The predicate receives the element and its index. Evaluation short-circuits
|
|
237
242
|
* as soon as an element matches.
|
|
238
243
|
*
|
|
@@ -254,6 +259,8 @@ export const findFirst = internal.findFirst;
|
|
|
254
259
|
/**
|
|
255
260
|
* Returns the first value that passes an effectful `FilterEffect`.
|
|
256
261
|
*
|
|
262
|
+
* **Details**
|
|
263
|
+
*
|
|
257
264
|
* The filter receives the element and index. Evaluation short-circuits on the
|
|
258
265
|
* first `Result.succeed` and returns the transformed value in `Option.some`.
|
|
259
266
|
*
|
|
@@ -272,18 +279,16 @@ export const findFirstFilter = internal.findFirstFilter;
|
|
|
272
279
|
* If any effect fails, the iteration stops immediately (short-circuiting), and
|
|
273
280
|
* the error is propagated.
|
|
274
281
|
*
|
|
275
|
-
*
|
|
282
|
+
* Concurrency:
|
|
276
283
|
*
|
|
277
284
|
* The `concurrency` option controls how many operations are performed
|
|
278
285
|
* concurrently. By default, the operations are performed sequentially.
|
|
279
286
|
*
|
|
280
|
-
*
|
|
287
|
+
* Discarding Results:
|
|
281
288
|
*
|
|
282
289
|
* If the `discard` option is set to `true`, the intermediate results are not
|
|
283
290
|
* collected, and the final result of the operation is `void`.
|
|
284
291
|
*
|
|
285
|
-
* @see {@link all} for combining multiple effects into one.
|
|
286
|
-
*
|
|
287
292
|
* **Example** (Mapping over an iterable with effects)
|
|
288
293
|
*
|
|
289
294
|
* ```ts
|
|
@@ -328,6 +333,7 @@ export const findFirstFilter = internal.findFirstFilter;
|
|
|
328
333
|
* // undefined
|
|
329
334
|
* ```
|
|
330
335
|
*
|
|
336
|
+
* @see {@link all} for combining multiple effects into one.
|
|
331
337
|
* @category Collecting
|
|
332
338
|
* @since 2.0.0
|
|
333
339
|
*/
|
|
@@ -368,7 +374,7 @@ export const whileLoop = internal.whileLoop;
|
|
|
368
374
|
* Creates an `Effect` that represents an asynchronous computation guaranteed to
|
|
369
375
|
* succeed.
|
|
370
376
|
*
|
|
371
|
-
* **When to
|
|
377
|
+
* **When to use**
|
|
372
378
|
*
|
|
373
379
|
* Use `promise` when you are sure the operation will not reject.
|
|
374
380
|
*
|
|
@@ -382,13 +388,11 @@ export const whileLoop = internal.whileLoop;
|
|
|
382
388
|
* crash in the program, which can be further managed or logged using tools like
|
|
383
389
|
* {@link catchDefect}.
|
|
384
390
|
*
|
|
385
|
-
*
|
|
391
|
+
* Interruptions:
|
|
386
392
|
*
|
|
387
393
|
* An optional `AbortSignal` can be provided to allow for interruption of the
|
|
388
394
|
* wrapped `Promise` API.
|
|
389
395
|
*
|
|
390
|
-
* @see {@link tryPromise} for a version that can handle failures.
|
|
391
|
-
*
|
|
392
396
|
* **Example** (Wrapping a non-rejecting Promise)
|
|
393
397
|
*
|
|
394
398
|
* ```ts
|
|
@@ -409,6 +413,7 @@ export const whileLoop = internal.whileLoop;
|
|
|
409
413
|
* const program = delay("Async operation completed successfully!")
|
|
410
414
|
* ```
|
|
411
415
|
*
|
|
416
|
+
* @see {@link tryPromise} for a version that can handle failures.
|
|
412
417
|
* @category Creating Effects
|
|
413
418
|
* @since 2.0.0
|
|
414
419
|
*/
|
|
@@ -417,7 +422,7 @@ export const promise = internal.promise;
|
|
|
417
422
|
* Creates an `Effect` that represents an asynchronous computation that might
|
|
418
423
|
* fail.
|
|
419
424
|
*
|
|
420
|
-
* **When to
|
|
425
|
+
* **When to use**
|
|
421
426
|
*
|
|
422
427
|
* In situations where you need to perform asynchronous operations that might
|
|
423
428
|
* fail, such as fetching data from an API, you can use the `tryPromise`
|
|
@@ -425,7 +430,9 @@ export const promise = internal.promise;
|
|
|
425
430
|
* throw exceptions by capturing those exceptions and transforming them into
|
|
426
431
|
* manageable errors.
|
|
427
432
|
*
|
|
428
|
-
* **
|
|
433
|
+
* **Details**
|
|
434
|
+
*
|
|
435
|
+
* Error Handling:
|
|
429
436
|
*
|
|
430
437
|
* There are two ways to handle errors with `tryPromise`:
|
|
431
438
|
*
|
|
@@ -434,7 +441,7 @@ export const promise = internal.promise;
|
|
|
434
441
|
* 2. If you provide a `catch` function, the error is caught and the `catch`
|
|
435
442
|
* function maps it to an error of type `E`.
|
|
436
443
|
*
|
|
437
|
-
*
|
|
444
|
+
* Interruptions:
|
|
438
445
|
*
|
|
439
446
|
* An optional `AbortSignal` can be provided to allow for interruption of the
|
|
440
447
|
* wrapped `Promise` API.
|
|
@@ -475,7 +482,6 @@ export const promise = internal.promise;
|
|
|
475
482
|
* ```
|
|
476
483
|
*
|
|
477
484
|
* @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
|
|
478
|
-
*
|
|
479
485
|
* @category Creating Effects
|
|
480
486
|
* @since 2.0.0
|
|
481
487
|
*/
|
|
@@ -483,13 +489,11 @@ export const tryPromise = internal.tryPromise;
|
|
|
483
489
|
/**
|
|
484
490
|
* Creates an `Effect` that always succeeds with a given value.
|
|
485
491
|
*
|
|
486
|
-
* **When to
|
|
492
|
+
* **When to use**
|
|
487
493
|
*
|
|
488
494
|
* Use this function when you need an effect that completes successfully with a
|
|
489
495
|
* specific value without any errors or external dependencies.
|
|
490
496
|
*
|
|
491
|
-
* @see {@link fail} to create an effect that represents a failure.
|
|
492
|
-
*
|
|
493
497
|
* **Example** (Creating a successful effect)
|
|
494
498
|
*
|
|
495
499
|
* ```ts
|
|
@@ -502,6 +506,7 @@ export const tryPromise = internal.tryPromise;
|
|
|
502
506
|
* const success = Effect.succeed(42)
|
|
503
507
|
* ```
|
|
504
508
|
*
|
|
509
|
+
* @see {@link fail} to create an effect that represents a failure.
|
|
505
510
|
* @category Creating Effects
|
|
506
511
|
* @since 2.0.0
|
|
507
512
|
*/
|
|
@@ -545,7 +550,7 @@ export const succeedSome = internal.succeedSome;
|
|
|
545
550
|
/**
|
|
546
551
|
* Delays the creation of an `Effect` until it is actually needed.
|
|
547
552
|
*
|
|
548
|
-
* **When to
|
|
553
|
+
* **When to use**
|
|
549
554
|
*
|
|
550
555
|
* Use `suspend` when you need to defer the evaluation of an effect until it is required. This is particularly useful for optimizing expensive computations, managing circular dependencies, or resolving type inference issues.
|
|
551
556
|
*
|
|
@@ -632,7 +637,7 @@ export const suspend = internal.suspend;
|
|
|
632
637
|
/**
|
|
633
638
|
* Creates an `Effect` that represents a synchronous side-effectful computation.
|
|
634
639
|
*
|
|
635
|
-
* **When to
|
|
640
|
+
* **When to use**
|
|
636
641
|
*
|
|
637
642
|
* Use `sync` when you are sure the operation will not fail.
|
|
638
643
|
*
|
|
@@ -646,8 +651,6 @@ export const suspend = internal.suspend;
|
|
|
646
651
|
* crash in the program, which can be further managed or logged using tools like
|
|
647
652
|
* {@link catchDefect}.
|
|
648
653
|
*
|
|
649
|
-
* @see {@link try_ | try} for a version that can handle failures.
|
|
650
|
-
*
|
|
651
654
|
* **Example** (Capturing synchronous logging in an Effect)
|
|
652
655
|
*
|
|
653
656
|
* ```ts
|
|
@@ -663,6 +666,7 @@ export const suspend = internal.suspend;
|
|
|
663
666
|
* const program = log("Hello, World!")
|
|
664
667
|
* ```
|
|
665
668
|
*
|
|
669
|
+
* @see {@link try_ | try} for a version that can handle failures.
|
|
666
670
|
* @category Creating Effects
|
|
667
671
|
* @since 2.0.0
|
|
668
672
|
*/
|
|
@@ -670,6 +674,8 @@ export const sync = internal.sync;
|
|
|
670
674
|
const void_ = internal.void;
|
|
671
675
|
export {
|
|
672
676
|
/**
|
|
677
|
+
* Returns an effect that succeeds with `void`.
|
|
678
|
+
*
|
|
673
679
|
* @category Creating Effects
|
|
674
680
|
* @since 2.0.0
|
|
675
681
|
*/
|
|
@@ -677,6 +683,8 @@ void_ as void };
|
|
|
677
683
|
const undefined_ = internal.undefined;
|
|
678
684
|
export {
|
|
679
685
|
/**
|
|
686
|
+
* Returns an effect that succeeds with `undefined`.
|
|
687
|
+
*
|
|
680
688
|
* @category Creating Effects
|
|
681
689
|
* @since 4.0.0
|
|
682
690
|
*/
|
|
@@ -684,6 +692,11 @@ undefined_ as undefined };
|
|
|
684
692
|
/**
|
|
685
693
|
* Creates an `Effect` from a callback-based asynchronous API.
|
|
686
694
|
*
|
|
695
|
+
* **When to use**
|
|
696
|
+
*
|
|
697
|
+
* Use `Effect.callback` when integrating APIs that complete through callbacks
|
|
698
|
+
* instead of returning a `Promise`.
|
|
699
|
+
*
|
|
687
700
|
* **Details**
|
|
688
701
|
*
|
|
689
702
|
* The registration function receives a `resume` callback and, when requested,
|
|
@@ -691,11 +704,6 @@ undefined_ as undefined };
|
|
|
691
704
|
* complete the fiber; later calls are ignored. Return an optional cleanup
|
|
692
705
|
* effect from the registration function to run if the fiber is interrupted.
|
|
693
706
|
*
|
|
694
|
-
* **When to Use**
|
|
695
|
-
*
|
|
696
|
-
* Use `Effect.callback` when integrating APIs that complete through callbacks
|
|
697
|
-
* instead of returning a `Promise`.
|
|
698
|
-
*
|
|
699
707
|
* **Example** (Integrating callback APIs)
|
|
700
708
|
*
|
|
701
709
|
* ```ts
|
|
@@ -789,7 +797,7 @@ export const bind = internal.bind;
|
|
|
789
797
|
* Provides a way to write effectful code using generator functions, simplifying
|
|
790
798
|
* control flow and error handling.
|
|
791
799
|
*
|
|
792
|
-
* **When to
|
|
800
|
+
* **When to use**
|
|
793
801
|
*
|
|
794
802
|
* `gen` allows you to write code that looks and behaves like synchronous
|
|
795
803
|
* code, but it can handle asynchronous tasks, errors, and complex control flow
|
|
@@ -840,14 +848,12 @@ export const gen = internal.gen;
|
|
|
840
848
|
/**
|
|
841
849
|
* Creates an `Effect` that represents a recoverable error.
|
|
842
850
|
*
|
|
843
|
-
* **When to
|
|
851
|
+
* **When to use**
|
|
844
852
|
*
|
|
845
853
|
* Use this function to explicitly signal an error in an `Effect`. The error
|
|
846
854
|
* will keep propagating unless it is handled. You can handle the error with
|
|
847
855
|
* functions like {@link catchTag} or {@link catchTags}.
|
|
848
856
|
*
|
|
849
|
-
* @see {@link succeed} to create an effect that represents a successful value.
|
|
850
|
-
*
|
|
851
857
|
* **Example** (Creating a failed effect)
|
|
852
858
|
*
|
|
853
859
|
* ```ts
|
|
@@ -862,6 +868,7 @@ export const gen = internal.gen;
|
|
|
862
868
|
* )
|
|
863
869
|
* ```
|
|
864
870
|
*
|
|
871
|
+
* @see {@link succeed} to create an effect that represents a successful value.
|
|
865
872
|
* @category Creating Effects
|
|
866
873
|
* @since 2.0.0
|
|
867
874
|
*/
|
|
@@ -869,6 +876,8 @@ export const fail = internal.fail;
|
|
|
869
876
|
/**
|
|
870
877
|
* Creates an `Effect` that represents a recoverable error using a lazy evaluation.
|
|
871
878
|
*
|
|
879
|
+
* **Details**
|
|
880
|
+
*
|
|
872
881
|
* This function is useful when you need to create an error effect but want to
|
|
873
882
|
* defer the computation of the error value until the effect is actually run.
|
|
874
883
|
*
|
|
@@ -892,6 +901,8 @@ export const failSync = internal.failSync;
|
|
|
892
901
|
/**
|
|
893
902
|
* Creates an `Effect` that represents a failure with a specific `Cause`.
|
|
894
903
|
*
|
|
904
|
+
* **Details**
|
|
905
|
+
*
|
|
895
906
|
* This function allows you to create effects that fail with complex error
|
|
896
907
|
* structures, including multiple errors, defects, interruptions, and more.
|
|
897
908
|
*
|
|
@@ -915,6 +926,8 @@ export const failCause = internal.failCause;
|
|
|
915
926
|
/**
|
|
916
927
|
* Creates an `Effect` that represents a failure with a `Cause` computed lazily.
|
|
917
928
|
*
|
|
929
|
+
* **Details**
|
|
930
|
+
*
|
|
918
931
|
* This function is useful when you need to create a failure effect with a
|
|
919
932
|
* complex cause but want to defer the computation until the effect is run.
|
|
920
933
|
*
|
|
@@ -938,7 +951,7 @@ export const failCauseSync = internal.failCauseSync;
|
|
|
938
951
|
/**
|
|
939
952
|
* Creates an effect that terminates a fiber with a specified error.
|
|
940
953
|
*
|
|
941
|
-
* **When to
|
|
954
|
+
* **When to use**
|
|
942
955
|
*
|
|
943
956
|
* Use `die` when encountering unexpected conditions in your code that should
|
|
944
957
|
* not be handled as regular errors but instead represent unrecoverable defects.
|
|
@@ -952,8 +965,6 @@ export const failCauseSync = internal.failCauseSync;
|
|
|
952
965
|
* The error channel of the resulting effect is of type `never`, indicating that
|
|
953
966
|
* it cannot recover from this failure.
|
|
954
967
|
*
|
|
955
|
-
* @see {@link die} for a variant that dies with an already computed defect.
|
|
956
|
-
*
|
|
957
968
|
* **Example** (Failing when division by zero)
|
|
958
969
|
*
|
|
959
970
|
* ```ts
|
|
@@ -974,6 +985,7 @@ export const failCauseSync = internal.failCauseSync;
|
|
|
974
985
|
* // ...stack trace...
|
|
975
986
|
* ```
|
|
976
987
|
*
|
|
988
|
+
* @see {@link die} for a variant that dies with an already computed defect.
|
|
977
989
|
* @category Creating Effects
|
|
978
990
|
* @since 2.0.0
|
|
979
991
|
*/
|
|
@@ -984,14 +996,16 @@ export {
|
|
|
984
996
|
* Creates an `Effect` that represents a synchronous computation that might
|
|
985
997
|
* fail.
|
|
986
998
|
*
|
|
987
|
-
* **When to
|
|
999
|
+
* **When to use**
|
|
988
1000
|
*
|
|
989
1001
|
* In situations where you need to perform synchronous operations that might
|
|
990
1002
|
* fail, such as parsing JSON, you can use the `try` constructor. This
|
|
991
1003
|
* constructor is designed to handle operations that could throw exceptions by
|
|
992
1004
|
* capturing those exceptions and transforming them into manageable errors.
|
|
993
1005
|
*
|
|
994
|
-
* **
|
|
1006
|
+
* **Details**
|
|
1007
|
+
*
|
|
1008
|
+
* Error Handling:
|
|
995
1009
|
*
|
|
996
1010
|
* There are two ways to handle errors with `try`:
|
|
997
1011
|
*
|
|
@@ -1000,9 +1014,6 @@ export {
|
|
|
1000
1014
|
* 2. If you provide a `catch` function, the error is caught and the `catch`
|
|
1001
1015
|
* function maps it to an error of type `E`.
|
|
1002
1016
|
*
|
|
1003
|
-
* @see {@link sync} if the effectful computation is synchronous and does not
|
|
1004
|
-
* throw errors.
|
|
1005
|
-
*
|
|
1006
1017
|
* **Example** (Parsing JSON with typed error mapping)
|
|
1007
1018
|
*
|
|
1008
1019
|
* ```ts
|
|
@@ -1040,6 +1051,8 @@ export {
|
|
|
1040
1051
|
* // Output: Exit.failure with custom Error message
|
|
1041
1052
|
* ```
|
|
1042
1053
|
*
|
|
1054
|
+
* @see {@link sync} if the effectful computation is synchronous and does not
|
|
1055
|
+
* throw errors.
|
|
1043
1056
|
* @category Creating Effects
|
|
1044
1057
|
* @since 2.0.0
|
|
1045
1058
|
*/
|
|
@@ -1135,6 +1148,8 @@ export const fromResult = internal.fromResult;
|
|
|
1135
1148
|
/**
|
|
1136
1149
|
* Converts an `Option` into an `Effect`.
|
|
1137
1150
|
*
|
|
1151
|
+
* **Details**
|
|
1152
|
+
*
|
|
1138
1153
|
* `Option.some` becomes a successful effect with the contained value, while
|
|
1139
1154
|
* `Option.none` becomes a failed effect with `NoSuchElementError`.
|
|
1140
1155
|
*
|
|
@@ -1191,15 +1206,11 @@ export const fromNullishOr = internal.fromNullishOr;
|
|
|
1191
1206
|
* Chains effects to produce new `Effect` instances, useful for combining
|
|
1192
1207
|
* operations that depend on previous results.
|
|
1193
1208
|
*
|
|
1194
|
-
* **
|
|
1209
|
+
* **When to use**
|
|
1195
1210
|
*
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
* const flatMappedEffect = Effect.flatMap(myEffect, transformation)
|
|
1200
|
-
* // or
|
|
1201
|
-
* const flatMappedEffect = myEffect.pipe(Effect.flatMap(transformation))
|
|
1202
|
-
* ```
|
|
1211
|
+
* Use `flatMap` when you need to chain multiple effects, ensuring that each
|
|
1212
|
+
* step produces a new `Effect` while flattening any nested effects that may
|
|
1213
|
+
* occur.
|
|
1203
1214
|
*
|
|
1204
1215
|
* **Details**
|
|
1205
1216
|
*
|
|
@@ -1211,11 +1222,18 @@ export const fromNullishOr = internal.fromNullishOr;
|
|
|
1211
1222
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
1212
1223
|
* changing the original one.
|
|
1213
1224
|
*
|
|
1214
|
-
* **
|
|
1225
|
+
* **Example** (Syntax)
|
|
1215
1226
|
*
|
|
1216
|
-
*
|
|
1217
|
-
*
|
|
1218
|
-
*
|
|
1227
|
+
* ```ts
|
|
1228
|
+
* import { Effect, pipe } from "effect"
|
|
1229
|
+
*
|
|
1230
|
+
* const myEffect = Effect.succeed(1)
|
|
1231
|
+
* const transformation = (n: number) => Effect.succeed(n + 1)
|
|
1232
|
+
*
|
|
1233
|
+
* const flatMappedWithPipe = pipe(myEffect, Effect.flatMap(transformation))
|
|
1234
|
+
* const flatMappedWithDataFirst = Effect.flatMap(myEffect, transformation)
|
|
1235
|
+
* const flatMappedWithMethod = myEffect.pipe(Effect.flatMap(transformation))
|
|
1236
|
+
* ```
|
|
1219
1237
|
*
|
|
1220
1238
|
* **Example** (Sequencing dependent effects)
|
|
1221
1239
|
*
|
|
@@ -1247,7 +1265,6 @@ export const fromNullishOr = internal.fromNullishOr;
|
|
|
1247
1265
|
* ```
|
|
1248
1266
|
*
|
|
1249
1267
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
1250
|
-
*
|
|
1251
1268
|
* @category sequencing
|
|
1252
1269
|
* @since 2.0.0
|
|
1253
1270
|
*/
|
|
@@ -1277,17 +1294,7 @@ export const flatten = internal.flatten;
|
|
|
1277
1294
|
* Runs this effect and then runs another effect, optionally using the first
|
|
1278
1295
|
* effect's success value to choose the next effect.
|
|
1279
1296
|
*
|
|
1280
|
-
* **
|
|
1281
|
-
*
|
|
1282
|
-
* ```ts skip-type-checking
|
|
1283
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
1284
|
-
* // or
|
|
1285
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
1286
|
-
* // or
|
|
1287
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
1288
|
-
* ```
|
|
1289
|
-
*
|
|
1290
|
-
* **When to Use**
|
|
1297
|
+
* **When to use**
|
|
1291
1298
|
*
|
|
1292
1299
|
* Use `andThen` when one effect must run after another and the second effect
|
|
1293
1300
|
* may depend on the first effect's success value.
|
|
@@ -1302,6 +1309,19 @@ export const flatten = internal.flatten;
|
|
|
1302
1309
|
* Failures or requirements from either effect are preserved in the returned
|
|
1303
1310
|
* effect.
|
|
1304
1311
|
*
|
|
1312
|
+
* **Example** (Syntax)
|
|
1313
|
+
*
|
|
1314
|
+
* ```ts
|
|
1315
|
+
* import { Effect, pipe } from "effect"
|
|
1316
|
+
*
|
|
1317
|
+
* const myEffect = Effect.succeed(1)
|
|
1318
|
+
* const anotherEffect = Effect.succeed("done")
|
|
1319
|
+
*
|
|
1320
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
1321
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
1322
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
1323
|
+
* ```
|
|
1324
|
+
*
|
|
1305
1325
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
1306
1326
|
*
|
|
1307
1327
|
* ```ts
|
|
@@ -1350,7 +1370,7 @@ export const andThen = internal.andThen;
|
|
|
1350
1370
|
* Runs a side effect with the result of an effect without changing the original
|
|
1351
1371
|
* value.
|
|
1352
1372
|
*
|
|
1353
|
-
* **When to
|
|
1373
|
+
* **When to use**
|
|
1354
1374
|
*
|
|
1355
1375
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
1356
1376
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -1522,16 +1542,6 @@ export const exit = internal.exit;
|
|
|
1522
1542
|
/**
|
|
1523
1543
|
* Transforms the value inside an effect by applying a function to it.
|
|
1524
1544
|
*
|
|
1525
|
-
* **Syntax**
|
|
1526
|
-
*
|
|
1527
|
-
* ```ts skip-type-checking
|
|
1528
|
-
* const mappedEffect = pipe(myEffect, Effect.map(transformation))
|
|
1529
|
-
* // or
|
|
1530
|
-
* const mappedEffect = Effect.map(myEffect, transformation)
|
|
1531
|
-
* // or
|
|
1532
|
-
* const mappedEffect = myEffect.pipe(Effect.map(transformation))
|
|
1533
|
-
* ```
|
|
1534
|
-
*
|
|
1535
1545
|
* **Details**
|
|
1536
1546
|
*
|
|
1537
1547
|
* `map` takes a function and applies it to the value contained within an
|
|
@@ -1541,6 +1551,19 @@ export const exit = internal.exit;
|
|
|
1541
1551
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
1542
1552
|
* value.
|
|
1543
1553
|
*
|
|
1554
|
+
* **Example** (Syntax)
|
|
1555
|
+
*
|
|
1556
|
+
* ```ts
|
|
1557
|
+
* import { Effect, pipe } from "effect"
|
|
1558
|
+
*
|
|
1559
|
+
* const myEffect = Effect.succeed(1)
|
|
1560
|
+
* const transformation = (n: number) => n + 1
|
|
1561
|
+
*
|
|
1562
|
+
* const mappedWithPipe = pipe(myEffect, Effect.map(transformation))
|
|
1563
|
+
* const mappedWithDataFirst = Effect.map(myEffect, transformation)
|
|
1564
|
+
* const mappedWithMethod = myEffect.pipe(Effect.map(transformation))
|
|
1565
|
+
* ```
|
|
1566
|
+
*
|
|
1544
1567
|
* **Example** (Adding a service charge)
|
|
1545
1568
|
*
|
|
1546
1569
|
* ```ts
|
|
@@ -1562,7 +1585,6 @@ export const exit = internal.exit;
|
|
|
1562
1585
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
1563
1586
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
1564
1587
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
1565
|
-
*
|
|
1566
1588
|
* @category mapping
|
|
1567
1589
|
* @since 2.0.0
|
|
1568
1590
|
*/
|
|
@@ -1570,6 +1592,8 @@ export const map = internal.map;
|
|
|
1570
1592
|
/**
|
|
1571
1593
|
* Replaces the value inside an effect with a constant value.
|
|
1572
1594
|
*
|
|
1595
|
+
* **Details**
|
|
1596
|
+
*
|
|
1573
1597
|
* `as` allows you to ignore the original value inside an effect and
|
|
1574
1598
|
* replace it with a new constant value.
|
|
1575
1599
|
*
|
|
@@ -1634,6 +1658,8 @@ export const asVoid = internal.asVoid;
|
|
|
1634
1658
|
* The `flip` function swaps the success and error channels of an effect,
|
|
1635
1659
|
* so that the success becomes the error, and the error becomes the success.
|
|
1636
1660
|
*
|
|
1661
|
+
* **Details**
|
|
1662
|
+
*
|
|
1637
1663
|
* This function is useful when you need to reverse the flow of an effect,
|
|
1638
1664
|
* treating the previously successful values as errors and vice versa. This can
|
|
1639
1665
|
* be helpful in scenarios where you want to handle a success as a failure or
|
|
@@ -1663,17 +1689,16 @@ export const flip = internal.flip;
|
|
|
1663
1689
|
/**
|
|
1664
1690
|
* Combines two effects into a single effect, producing a tuple with the results of both effects.
|
|
1665
1691
|
*
|
|
1692
|
+
* **Details**
|
|
1693
|
+
*
|
|
1666
1694
|
* The `zip` function executes the first effect (left) and then the second effect (right).
|
|
1667
1695
|
* Once both effects succeed, their results are combined into a tuple.
|
|
1668
1696
|
*
|
|
1669
|
-
*
|
|
1697
|
+
* Concurrency:
|
|
1670
1698
|
*
|
|
1671
1699
|
* By default, `zip` processes the effects sequentially. To execute the effects concurrently,
|
|
1672
1700
|
* use the `{ concurrent: true }` option.
|
|
1673
1701
|
*
|
|
1674
|
-
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
1675
|
-
* @see {@link validate} for a version that accumulates errors.
|
|
1676
|
-
*
|
|
1677
1702
|
* **Example** (Combining two effects sequentially)
|
|
1678
1703
|
*
|
|
1679
1704
|
* ```ts
|
|
@@ -1725,6 +1750,8 @@ export const flip = internal.flip;
|
|
|
1725
1750
|
* // [ 1, 'hello' ]
|
|
1726
1751
|
* ```
|
|
1727
1752
|
*
|
|
1753
|
+
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
1754
|
+
* @see {@link validate} for a version that accumulates errors.
|
|
1728
1755
|
* @category zipping
|
|
1729
1756
|
* @since 2.0.0
|
|
1730
1757
|
*/
|
|
@@ -1733,13 +1760,15 @@ export const zip = internal.zip;
|
|
|
1733
1760
|
* Combines two effects sequentially and applies a function to their results to
|
|
1734
1761
|
* produce a single value.
|
|
1735
1762
|
*
|
|
1736
|
-
* **When to
|
|
1763
|
+
* **When to use**
|
|
1737
1764
|
*
|
|
1738
1765
|
* The `zipWith` function is similar to {@link zip}, but instead of returning a
|
|
1739
1766
|
* tuple of results, it applies a provided function to the results of the two
|
|
1740
1767
|
* effects, combining them into a single value.
|
|
1741
1768
|
*
|
|
1742
|
-
* **
|
|
1769
|
+
* **Details**
|
|
1770
|
+
*
|
|
1771
|
+
* Concurrency:
|
|
1743
1772
|
*
|
|
1744
1773
|
* By default, the effects are run sequentially. To execute them concurrently,
|
|
1745
1774
|
* use the `{ concurrent: true }` option.
|
|
@@ -1804,7 +1833,7 @@ catch_ as catch };
|
|
|
1804
1833
|
* Catches and handles specific errors by their `_tag` field, which is used as a
|
|
1805
1834
|
* discriminator.
|
|
1806
1835
|
*
|
|
1807
|
-
* **When to
|
|
1836
|
+
* **When to use**
|
|
1808
1837
|
*
|
|
1809
1838
|
* `catchTag` is useful when your errors are tagged with a readonly `_tag` field
|
|
1810
1839
|
* that identifies the error type. You can use this function to handle specific
|
|
@@ -1845,7 +1874,7 @@ export const catchTag = internal.catchTag;
|
|
|
1845
1874
|
/**
|
|
1846
1875
|
* Handles multiple errors in a single block of code using their `_tag` field.
|
|
1847
1876
|
*
|
|
1848
|
-
* **When to
|
|
1877
|
+
* **When to use**
|
|
1849
1878
|
*
|
|
1850
1879
|
* `catchTags` is a convenient way to handle multiple error types at
|
|
1851
1880
|
* once. Instead of using {@link catchTag} multiple times, you can pass an
|
|
@@ -1889,6 +1918,8 @@ export const catchTags = internal.catchTags;
|
|
|
1889
1918
|
/**
|
|
1890
1919
|
* Catches a specific reason within a tagged error.
|
|
1891
1920
|
*
|
|
1921
|
+
* **Details**
|
|
1922
|
+
*
|
|
1892
1923
|
* Use this to handle nested error causes without removing the parent error
|
|
1893
1924
|
* from the error channel. The handler receives the unwrapped reason.
|
|
1894
1925
|
*
|
|
@@ -1995,14 +2026,16 @@ export const unwrapReason = internal.unwrapReason;
|
|
|
1995
2026
|
* Handles both recoverable and unrecoverable errors by providing a recovery
|
|
1996
2027
|
* effect.
|
|
1997
2028
|
*
|
|
1998
|
-
* **When to
|
|
2029
|
+
* **When to use**
|
|
1999
2030
|
*
|
|
2000
2031
|
* The `catchCause` function allows you to handle all errors, including
|
|
2001
2032
|
* unrecoverable defects, by providing a recovery effect. The recovery logic is
|
|
2002
2033
|
* based on the `Cause` of the error, which provides detailed information about
|
|
2003
2034
|
* the failure.
|
|
2004
2035
|
*
|
|
2005
|
-
* **
|
|
2036
|
+
* **Details**
|
|
2037
|
+
*
|
|
2038
|
+
* When to Recover from Defects:
|
|
2006
2039
|
*
|
|
2007
2040
|
* Defects are unexpected errors that typically shouldn't be recovered from, as
|
|
2008
2041
|
* they often indicate serious issues. However, in some cases, such as
|
|
@@ -2034,7 +2067,7 @@ export const catchCause = internal.catchCause;
|
|
|
2034
2067
|
/**
|
|
2035
2068
|
* Recovers from defects using a provided recovery function.
|
|
2036
2069
|
*
|
|
2037
|
-
* **When to
|
|
2070
|
+
* **When to use**
|
|
2038
2071
|
*
|
|
2039
2072
|
* Use this sparingly, usually at integration boundaries where defects must be
|
|
2040
2073
|
* reported or translated for an external system.
|
|
@@ -2044,7 +2077,7 @@ export const catchCause = internal.catchCause;
|
|
|
2044
2077
|
* `catchDefect` handles unexpected defects, such as thrown exceptions or
|
|
2045
2078
|
* values passed to `die`, without catching typed failures or interruptions.
|
|
2046
2079
|
*
|
|
2047
|
-
*
|
|
2080
|
+
* When to Recover from Defects:
|
|
2048
2081
|
*
|
|
2049
2082
|
* Defects are unexpected errors that typically should not be recovered from, as
|
|
2050
2083
|
* they often indicate serious issues. In some cases, such as dynamically loaded
|
|
@@ -2075,7 +2108,7 @@ export const catchDefect = internal.catchDefect;
|
|
|
2075
2108
|
/**
|
|
2076
2109
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
2077
2110
|
*
|
|
2078
|
-
* **When to
|
|
2111
|
+
* **When to use**
|
|
2079
2112
|
*
|
|
2080
2113
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
2081
2114
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -2122,6 +2155,8 @@ export const catchFilter = internal.catchFilter;
|
|
|
2122
2155
|
/**
|
|
2123
2156
|
* Catches `NoSuchElementError` failures and converts them to `Option.none`.
|
|
2124
2157
|
*
|
|
2158
|
+
* **Details**
|
|
2159
|
+
*
|
|
2125
2160
|
* Success values become `Option.some`, `NoSuchElementError` becomes
|
|
2126
2161
|
* `Option.none`, and all other errors are preserved.
|
|
2127
2162
|
*
|
|
@@ -2144,6 +2179,8 @@ export const catchNoSuchElement = internal.catchNoSuchElement;
|
|
|
2144
2179
|
/**
|
|
2145
2180
|
* Recovers from specific failures based on a predicate.
|
|
2146
2181
|
*
|
|
2182
|
+
* **Details**
|
|
2183
|
+
*
|
|
2147
2184
|
* This function allows you to conditionally catch and recover from failures
|
|
2148
2185
|
* that match a specific predicate. This is useful when you want to handle
|
|
2149
2186
|
* only certain types of errors while letting others propagate.
|
|
@@ -2186,15 +2223,13 @@ export const catchCauseFilter = internal.catchCauseFilter;
|
|
|
2186
2223
|
* The `mapError` function is used to transform or modify the error
|
|
2187
2224
|
* produced by an effect, without affecting its success value.
|
|
2188
2225
|
*
|
|
2226
|
+
* **Details**
|
|
2227
|
+
*
|
|
2189
2228
|
* This function is helpful when you want to enhance the error with additional
|
|
2190
2229
|
* information, change the error type, or apply custom error handling while
|
|
2191
2230
|
* keeping the original behavior of the effect's success values intact. It only
|
|
2192
2231
|
* operates on the error channel and leaves the success channel unchanged.
|
|
2193
2232
|
*
|
|
2194
|
-
* @see {@link map} for a version that operates on the success channel.
|
|
2195
|
-
* @see {@link mapBoth} for a version that operates on both channels.
|
|
2196
|
-
* @see {@link mapError} if you want to replace the error with a new one.
|
|
2197
|
-
*
|
|
2198
2233
|
* **Example** (Transforming the error channel)
|
|
2199
2234
|
*
|
|
2200
2235
|
* ```ts
|
|
@@ -2214,6 +2249,9 @@ export const catchCauseFilter = internal.catchCauseFilter;
|
|
|
2214
2249
|
* )
|
|
2215
2250
|
* ```
|
|
2216
2251
|
*
|
|
2252
|
+
* @see {@link map} for a version that operates on the success channel.
|
|
2253
|
+
* @see {@link mapBoth} for a version that operates on both channels.
|
|
2254
|
+
* @see {@link mapError} if you want to replace the error with a new one.
|
|
2217
2255
|
* @category error handling
|
|
2218
2256
|
* @since 2.0.0
|
|
2219
2257
|
*/
|
|
@@ -2258,13 +2296,11 @@ export const mapBoth = internal.mapBoth;
|
|
|
2258
2296
|
* Converts typed failures from the error channel into defects, removing the
|
|
2259
2297
|
* error type from the returned effect.
|
|
2260
2298
|
*
|
|
2261
|
-
* **When to
|
|
2299
|
+
* **When to use**
|
|
2262
2300
|
*
|
|
2263
2301
|
* Use `orDie` when a typed failure represents an unrecoverable bug or invalid
|
|
2264
2302
|
* state and should not be handled as a recoverable error.
|
|
2265
2303
|
*
|
|
2266
|
-
* @see {@link mapError} to transform the error before converting it into a defect with {@link orDie}.
|
|
2267
|
-
*
|
|
2268
2304
|
* **Example** (Converting typed failures into defects)
|
|
2269
2305
|
*
|
|
2270
2306
|
* ```ts
|
|
@@ -2287,6 +2323,7 @@ export const mapBoth = internal.mapBoth;
|
|
|
2287
2323
|
* // ...stack trace...
|
|
2288
2324
|
* ```
|
|
2289
2325
|
*
|
|
2326
|
+
* @see {@link mapError} to transform the error before converting it into a defect with {@link orDie}.
|
|
2290
2327
|
* @category Converting Failures to Defects
|
|
2291
2328
|
* @since 2.0.0
|
|
2292
2329
|
*/
|
|
@@ -2327,6 +2364,8 @@ export const tapError = internal.tapError;
|
|
|
2327
2364
|
/**
|
|
2328
2365
|
* Runs an effectful handler when a failure's `_tag` matches.
|
|
2329
2366
|
*
|
|
2367
|
+
* **Details**
|
|
2368
|
+
*
|
|
2330
2369
|
* Use this with tagged-union errors to perform side effects for one tag or a
|
|
2331
2370
|
* list of tags. When the handler succeeds, the original failure is preserved;
|
|
2332
2371
|
* if the handler fails, its error is also included in the returned effect.
|
|
@@ -2394,6 +2433,8 @@ export const tapCause = internal.tapCause;
|
|
|
2394
2433
|
/**
|
|
2395
2434
|
* Conditionally executes a side effect based on the cause of a failed effect.
|
|
2396
2435
|
*
|
|
2436
|
+
* **Details**
|
|
2437
|
+
*
|
|
2397
2438
|
* This function allows you to tap into the cause of an effect's failure only when
|
|
2398
2439
|
* the cause matches a specific predicate. This is useful for conditional logging,
|
|
2399
2440
|
* monitoring, or other side effects based on the type of failure.
|
|
@@ -2479,6 +2520,8 @@ export const tapDefect = internal.tapDefect;
|
|
|
2479
2520
|
/**
|
|
2480
2521
|
* Retries an effect until it succeeds, discarding failures.
|
|
2481
2522
|
*
|
|
2523
|
+
* **Details**
|
|
2524
|
+
*
|
|
2482
2525
|
* Yields between attempts so other fibers can run.
|
|
2483
2526
|
*
|
|
2484
2527
|
* **Example** (Retrying until success)
|
|
@@ -2514,6 +2557,11 @@ export const eventually = internal.eventually;
|
|
|
2514
2557
|
/**
|
|
2515
2558
|
* Retries typed failures from an effect according to a retry policy.
|
|
2516
2559
|
*
|
|
2560
|
+
* **When to use**
|
|
2561
|
+
*
|
|
2562
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
2563
|
+
* temporary resource unavailability.
|
|
2564
|
+
*
|
|
2517
2565
|
* **Details**
|
|
2518
2566
|
*
|
|
2519
2567
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -2523,11 +2571,6 @@ export const eventually = internal.eventually;
|
|
|
2523
2571
|
*
|
|
2524
2572
|
* Defects and interruptions are not retried as typed failures.
|
|
2525
2573
|
*
|
|
2526
|
-
* **When to Use**
|
|
2527
|
-
*
|
|
2528
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
2529
|
-
* temporary resource unavailability.
|
|
2530
|
-
*
|
|
2531
2574
|
* **Example** (Retrying with a schedule)
|
|
2532
2575
|
*
|
|
2533
2576
|
* ```ts
|
|
@@ -2554,7 +2597,6 @@ export const eventually = internal.eventually;
|
|
|
2554
2597
|
*
|
|
2555
2598
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
2556
2599
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
2557
|
-
*
|
|
2558
2600
|
* @category error handling
|
|
2559
2601
|
* @since 2.0.0
|
|
2560
2602
|
*/
|
|
@@ -2562,6 +2604,11 @@ export const retry = internalSchedule.retry;
|
|
|
2562
2604
|
/**
|
|
2563
2605
|
* Retries a failing effect and runs a fallback effect if retries are exhausted.
|
|
2564
2606
|
*
|
|
2607
|
+
* **When to use**
|
|
2608
|
+
*
|
|
2609
|
+
* This function is useful when you want to handle failures gracefully by
|
|
2610
|
+
* specifying an alternative action after repeated failures.
|
|
2611
|
+
*
|
|
2565
2612
|
* **Details**
|
|
2566
2613
|
*
|
|
2567
2614
|
* The `Effect.retryOrElse` function attempts to retry a failing effect multiple
|
|
@@ -2570,13 +2617,6 @@ export const retry = internalSchedule.retry;
|
|
|
2570
2617
|
* If the retries are exhausted and the effect still fails, it runs a fallback
|
|
2571
2618
|
* effect instead.
|
|
2572
2619
|
*
|
|
2573
|
-
* **When to Use**
|
|
2574
|
-
*
|
|
2575
|
-
* This function is useful when you want to handle failures gracefully by
|
|
2576
|
-
* specifying an alternative action after repeated failures.
|
|
2577
|
-
*
|
|
2578
|
-
* @see {@link retry} for a version that does not run a fallback effect.
|
|
2579
|
-
*
|
|
2580
2620
|
* **Example** (Falling back after retries are exhausted)
|
|
2581
2621
|
*
|
|
2582
2622
|
* ```ts
|
|
@@ -2613,6 +2653,7 @@ export const retry = internalSchedule.retry;
|
|
|
2613
2653
|
* // Network data
|
|
2614
2654
|
* ```
|
|
2615
2655
|
*
|
|
2656
|
+
* @see {@link retry} for a version that does not run a fallback effect.
|
|
2616
2657
|
* @category error handling
|
|
2617
2658
|
* @since 2.0.0
|
|
2618
2659
|
*/
|
|
@@ -2652,7 +2693,7 @@ export const sandbox = internal.sandbox;
|
|
|
2652
2693
|
/**
|
|
2653
2694
|
* Discards both the success and failure values of an effect.
|
|
2654
2695
|
*
|
|
2655
|
-
* **When to
|
|
2696
|
+
* **When to use**
|
|
2656
2697
|
*
|
|
2657
2698
|
* `ignore` allows you to run an effect without caring about its result, whether
|
|
2658
2699
|
* it succeeds or fails. This is useful when you only care about the side
|
|
@@ -2693,6 +2734,8 @@ export const ignore = internal.ignore;
|
|
|
2693
2734
|
/**
|
|
2694
2735
|
* Ignores the effect's failure cause, including defects and interruptions.
|
|
2695
2736
|
*
|
|
2737
|
+
* **Details**
|
|
2738
|
+
*
|
|
2696
2739
|
* Use the `log` option to emit the full {@link Cause} when the effect fails,
|
|
2697
2740
|
* and `message` to prepend a custom log message.
|
|
2698
2741
|
*
|
|
@@ -2715,6 +2758,8 @@ export const ignoreCause = internal.ignoreCause;
|
|
|
2715
2758
|
* Apply an `ExecutionPlan` to an effect, retrying with step-provided resources
|
|
2716
2759
|
* until it succeeds or the plan is exhausted.
|
|
2717
2760
|
*
|
|
2761
|
+
* **Details**
|
|
2762
|
+
*
|
|
2718
2763
|
* Each attempt updates `ExecutionPlan.CurrentMetadata` (attempt and step index),
|
|
2719
2764
|
* and retry timing is derived per step (the first attempt uses the remaining
|
|
2720
2765
|
* attempts schedule; later retries apply the step schedule at least once).
|
|
@@ -2749,6 +2794,8 @@ export const withExecutionPlan = internalExecutionPlan.withExecutionPlan;
|
|
|
2749
2794
|
/**
|
|
2750
2795
|
* Runs an effect and reports any errors to the configured `ErrorReporter`s.
|
|
2751
2796
|
*
|
|
2797
|
+
* **Details**
|
|
2798
|
+
*
|
|
2752
2799
|
* If the `defectsOnly` option is set to `true`, only defects (unrecoverable
|
|
2753
2800
|
* errors) will be reported, while regular failures will be ignored.
|
|
2754
2801
|
*
|
|
@@ -2800,6 +2847,12 @@ export const orElseSucceed = internal.orElseSucceed;
|
|
|
2800
2847
|
* Runs a sequence of effects and returns the result of the first successful
|
|
2801
2848
|
* one.
|
|
2802
2849
|
*
|
|
2850
|
+
* **When to use**
|
|
2851
|
+
*
|
|
2852
|
+
* Use `firstSuccessOf` when you have prioritized fallback strategies, such as
|
|
2853
|
+
* attempting multiple APIs, reading configuration from several sources, or
|
|
2854
|
+
* trying alternative resource locations in order.
|
|
2855
|
+
*
|
|
2803
2856
|
* **Details**
|
|
2804
2857
|
*
|
|
2805
2858
|
* This function executes the provided effects in sequence, stopping at the
|
|
@@ -2810,12 +2863,6 @@ export const orElseSucceed = internal.orElseSucceed;
|
|
|
2810
2863
|
* effect. If the collection is empty, the returned effect defects with an
|
|
2811
2864
|
* `Error` whose message is `"Received an empty collection of effects"`.
|
|
2812
2865
|
*
|
|
2813
|
-
* **When to Use**
|
|
2814
|
-
*
|
|
2815
|
-
* Use `firstSuccessOf` when you have prioritized fallback strategies, such as
|
|
2816
|
-
* attempting multiple APIs, reading configuration from several sources, or
|
|
2817
|
-
* trying alternative resource locations in order.
|
|
2818
|
-
*
|
|
2819
2866
|
* **Example** (Trying alternatives until one succeeds)
|
|
2820
2867
|
*
|
|
2821
2868
|
* ```ts
|
|
@@ -2848,14 +2895,14 @@ export const firstSuccessOf = internal.firstSuccessOf;
|
|
|
2848
2895
|
* Adds a time limit to an effect, triggering a timeout if the effect exceeds
|
|
2849
2896
|
* the duration.
|
|
2850
2897
|
*
|
|
2898
|
+
* **Details**
|
|
2899
|
+
*
|
|
2851
2900
|
* The `timeout` function allows you to specify a time limit for an
|
|
2852
2901
|
* effect's execution. If the effect does not complete within the given time, a
|
|
2853
2902
|
* `TimeoutException` is raised. This can be useful for controlling how long
|
|
2854
2903
|
* your program waits for a task to finish, ensuring that it doesn't hang
|
|
2855
2904
|
* indefinitely if the task takes too long.
|
|
2856
2905
|
*
|
|
2857
|
-
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
2858
|
-
*
|
|
2859
2906
|
* **Example** (Failing when work takes too long)
|
|
2860
2907
|
*
|
|
2861
2908
|
* ```ts
|
|
@@ -2886,6 +2933,7 @@ export const firstSuccessOf = internal.firstSuccessOf;
|
|
|
2886
2933
|
* // }
|
|
2887
2934
|
* ```
|
|
2888
2935
|
*
|
|
2936
|
+
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
2889
2937
|
* @category Delays & Timeouts
|
|
2890
2938
|
* @since 2.0.0
|
|
2891
2939
|
*/
|
|
@@ -2939,6 +2987,8 @@ export const timeoutOption = internal.timeoutOption;
|
|
|
2939
2987
|
/**
|
|
2940
2988
|
* Applies a timeout to an effect, with a fallback effect executed if the timeout is reached.
|
|
2941
2989
|
*
|
|
2990
|
+
* **Details**
|
|
2991
|
+
*
|
|
2942
2992
|
* This function is useful when you want to set a maximum duration for an operation
|
|
2943
2993
|
* and provide an alternative action if the timeout is exceeded.
|
|
2944
2994
|
*
|
|
@@ -3023,6 +3073,8 @@ export const sleep = internal.sleep;
|
|
|
3023
3073
|
/**
|
|
3024
3074
|
* Measures the runtime of an effect and returns the duration with its result.
|
|
3025
3075
|
*
|
|
3076
|
+
* **Details**
|
|
3077
|
+
*
|
|
3026
3078
|
* The original success, failure, or interruption is preserved; only the success
|
|
3027
3079
|
* value is paired with the duration.
|
|
3028
3080
|
*
|
|
@@ -3047,6 +3099,11 @@ export const timed = internal.timed;
|
|
|
3047
3099
|
/**
|
|
3048
3100
|
* Runs multiple effects concurrently and returns the first successful result.
|
|
3049
3101
|
*
|
|
3102
|
+
* **When to use**
|
|
3103
|
+
*
|
|
3104
|
+
* Use `raceAll` when early failures should be ignored until a success occurs
|
|
3105
|
+
* or all effects fail.
|
|
3106
|
+
*
|
|
3050
3107
|
* **Details**
|
|
3051
3108
|
*
|
|
3052
3109
|
* Early failures do not finish the race; `raceAll` keeps waiting until one
|
|
@@ -3054,13 +3111,6 @@ export const timed = internal.timed;
|
|
|
3054
3111
|
* remaining effects are interrupted. If every effect fails, the returned effect
|
|
3055
3112
|
* fails with a cause containing the collected failure reasons.
|
|
3056
3113
|
*
|
|
3057
|
-
* **When to Use**
|
|
3058
|
-
*
|
|
3059
|
-
* Use `raceAll` when early failures should be ignored until a success occurs
|
|
3060
|
-
* or all effects fail.
|
|
3061
|
-
*
|
|
3062
|
-
* @see {@link race} for a version that handles only two effects.
|
|
3063
|
-
*
|
|
3064
3114
|
* **Example** (Racing many effects)
|
|
3065
3115
|
*
|
|
3066
3116
|
* ```ts
|
|
@@ -3077,6 +3127,7 @@ export const timed = internal.timed;
|
|
|
3077
3127
|
* // Result: "Fast" (after ~100ms)
|
|
3078
3128
|
* ```
|
|
3079
3129
|
*
|
|
3130
|
+
* @see {@link race} for a version that handles only two effects.
|
|
3080
3131
|
* @category Racing
|
|
3081
3132
|
* @since 2.0.0
|
|
3082
3133
|
*/
|
|
@@ -3114,6 +3165,8 @@ export const raceAllFirst = internal.raceAllFirst;
|
|
|
3114
3165
|
/**
|
|
3115
3166
|
* Races two effects and returns the first successful result.
|
|
3116
3167
|
*
|
|
3168
|
+
* **Details**
|
|
3169
|
+
*
|
|
3117
3170
|
* If one effect succeeds, the other is interrupted and `onWinner` can observe the
|
|
3118
3171
|
* winning fiber. If both fail, the race fails.
|
|
3119
3172
|
*
|
|
@@ -3142,6 +3195,8 @@ export const race = internal.race;
|
|
|
3142
3195
|
* Races two effects and returns the result of the first one to complete, whether
|
|
3143
3196
|
* it succeeds or fails.
|
|
3144
3197
|
*
|
|
3198
|
+
* **Details**
|
|
3199
|
+
*
|
|
3145
3200
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
3146
3201
|
*
|
|
3147
3202
|
* **Example** (Observing the winning fiber)
|
|
@@ -3291,6 +3346,11 @@ export const filterMapOrFail = internal.filterMapOrFail;
|
|
|
3291
3346
|
* Conditionally runs an effect based on the result of an effectful boolean
|
|
3292
3347
|
* condition.
|
|
3293
3348
|
*
|
|
3349
|
+
* **When to use**
|
|
3350
|
+
*
|
|
3351
|
+
* Use this when an effectful check decides whether to run another effect while
|
|
3352
|
+
* representing the skipped case explicitly.
|
|
3353
|
+
*
|
|
3294
3354
|
* **Details**
|
|
3295
3355
|
*
|
|
3296
3356
|
* The condition effect is evaluated first. If it succeeds with `true`, the
|
|
@@ -3298,11 +3358,6 @@ export const filterMapOrFail = internal.filterMapOrFail;
|
|
|
3298
3358
|
* succeeds with `false`, the source effect is skipped and the result is
|
|
3299
3359
|
* `Option.none`. If the condition effect fails, that failure is preserved.
|
|
3300
3360
|
*
|
|
3301
|
-
* **When to Use**
|
|
3302
|
-
*
|
|
3303
|
-
* Use this when an effectful check decides whether to run another effect while
|
|
3304
|
-
* representing the skipped case explicitly.
|
|
3305
|
-
*
|
|
3306
3361
|
* **Example** (Conditionally running an effect)
|
|
3307
3362
|
*
|
|
3308
3363
|
* ```ts
|
|
@@ -3321,7 +3376,6 @@ export const filterMapOrFail = internal.filterMapOrFail;
|
|
|
3321
3376
|
* ```
|
|
3322
3377
|
*
|
|
3323
3378
|
* @see {@link when} for conditional execution with a boolean condition.
|
|
3324
|
-
*
|
|
3325
3379
|
* @category Conditional Operators
|
|
3326
3380
|
* @since 2.0.0
|
|
3327
3381
|
*/
|
|
@@ -3333,6 +3387,11 @@ export const when = internal.when;
|
|
|
3333
3387
|
* Handles both success and failure cases of an effect without performing side
|
|
3334
3388
|
* effects.
|
|
3335
3389
|
*
|
|
3390
|
+
* **When to use**
|
|
3391
|
+
*
|
|
3392
|
+
* This is useful for structuring your code to respond differently to success or
|
|
3393
|
+
* failure without triggering side effects.
|
|
3394
|
+
*
|
|
3336
3395
|
* **Details**
|
|
3337
3396
|
*
|
|
3338
3397
|
* `match` lets you define custom handlers for both success and failure
|
|
@@ -3340,13 +3399,6 @@ export const when = internal.when;
|
|
|
3340
3399
|
* to process the result if the effect succeeds, or handle the error if the
|
|
3341
3400
|
* effect fails.
|
|
3342
3401
|
*
|
|
3343
|
-
* **When to Use**
|
|
3344
|
-
*
|
|
3345
|
-
* This is useful for structuring your code to respond differently to success or
|
|
3346
|
-
* failure without triggering side effects.
|
|
3347
|
-
*
|
|
3348
|
-
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
3349
|
-
*
|
|
3350
3402
|
* **Example** (Matching success and failure values)
|
|
3351
3403
|
*
|
|
3352
3404
|
* ```ts
|
|
@@ -3379,6 +3431,7 @@ export const when = internal.when;
|
|
|
3379
3431
|
* // Output: "failure: Uh oh!"
|
|
3380
3432
|
* ```
|
|
3381
3433
|
*
|
|
3434
|
+
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
3382
3435
|
* @category Pattern Matching
|
|
3383
3436
|
* @since 2.0.0
|
|
3384
3437
|
*/
|
|
@@ -3387,6 +3440,12 @@ export const match = internal.match;
|
|
|
3387
3440
|
* Handles both success and failure cases of an effect without performing side
|
|
3388
3441
|
* effects, with eager evaluation for resolved effects.
|
|
3389
3442
|
*
|
|
3443
|
+
* **When to use**
|
|
3444
|
+
*
|
|
3445
|
+
* Use this when you need to handle both success and failure cases and want
|
|
3446
|
+
* optimal performance for resolved effects. This is particularly useful in
|
|
3447
|
+
* scenarios where you frequently work with already computed values.
|
|
3448
|
+
*
|
|
3390
3449
|
* **Details**
|
|
3391
3450
|
*
|
|
3392
3451
|
* `matchEager` works like `match` but provides better performance for resolved
|
|
@@ -3394,12 +3453,6 @@ export const match = internal.match;
|
|
|
3394
3453
|
* the handlers immediately without fiber scheduling. For unresolved effects,
|
|
3395
3454
|
* it falls back to the regular `match` behavior.
|
|
3396
3455
|
*
|
|
3397
|
-
* **When to Use**
|
|
3398
|
-
*
|
|
3399
|
-
* Use this when you need to handle both success and failure cases and want
|
|
3400
|
-
* optimal performance for resolved effects. This is particularly useful in
|
|
3401
|
-
* scenarios where you frequently work with already computed values.
|
|
3402
|
-
*
|
|
3403
3456
|
* **Example** (Pattern matching eagerly when possible)
|
|
3404
3457
|
*
|
|
3405
3458
|
* ```ts
|
|
@@ -3416,7 +3469,6 @@ export const match = internal.match;
|
|
|
3416
3469
|
*
|
|
3417
3470
|
* @see {@link match} for the non-eager version.
|
|
3418
3471
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
3419
|
-
*
|
|
3420
3472
|
* @category Pattern Matching
|
|
3421
3473
|
* @since 4.0.0
|
|
3422
3474
|
*/
|
|
@@ -3424,17 +3476,17 @@ export const matchEager = internal.matchEager;
|
|
|
3424
3476
|
/**
|
|
3425
3477
|
* Handles failures by matching the cause of failure.
|
|
3426
3478
|
*
|
|
3427
|
-
* **
|
|
3428
|
-
*
|
|
3429
|
-
* The `matchCause` function allows you to handle failures with access to the
|
|
3430
|
-
* full cause of the failure within a fiber.
|
|
3431
|
-
*
|
|
3432
|
-
* **When to Use**
|
|
3479
|
+
* **When to use**
|
|
3433
3480
|
*
|
|
3434
3481
|
* This is useful for differentiating between different types of errors, such as
|
|
3435
3482
|
* regular failures, defects, or interruptions. You can provide specific
|
|
3436
3483
|
* handling logic for each failure type based on the cause.
|
|
3437
3484
|
*
|
|
3485
|
+
* **Details**
|
|
3486
|
+
*
|
|
3487
|
+
* The `matchCause` function allows you to handle failures with access to the
|
|
3488
|
+
* full cause of the failure within a fiber.
|
|
3489
|
+
*
|
|
3438
3490
|
* **Example** (Matching on success or failure causes)
|
|
3439
3491
|
*
|
|
3440
3492
|
* ```ts
|
|
@@ -3454,7 +3506,6 @@ export const matchEager = internal.matchEager;
|
|
|
3454
3506
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
3455
3507
|
* handlers.
|
|
3456
3508
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
3457
|
-
*
|
|
3458
3509
|
* @category Pattern Matching
|
|
3459
3510
|
* @since 2.0.0
|
|
3460
3511
|
*/
|
|
@@ -3462,18 +3513,18 @@ export const matchCause = internal.matchCause;
|
|
|
3462
3513
|
/**
|
|
3463
3514
|
* Handles failures by matching the cause of failure with eager evaluation.
|
|
3464
3515
|
*
|
|
3516
|
+
* **When to use**
|
|
3517
|
+
*
|
|
3518
|
+
* This is useful when you have effects that are likely to be already resolved
|
|
3519
|
+
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
3520
|
+
* it automatically falls back to the regular `matchCause` behavior.
|
|
3521
|
+
*
|
|
3465
3522
|
* **Details**
|
|
3466
3523
|
*
|
|
3467
3524
|
* `matchCauseEager` works like `matchCause` but provides better performance for resolved
|
|
3468
3525
|
* effects by immediately applying the matching function instead of deferring it
|
|
3469
3526
|
* through the effect pipeline.
|
|
3470
3527
|
*
|
|
3471
|
-
* **When to Use**
|
|
3472
|
-
*
|
|
3473
|
-
* This is useful when you have effects that are likely to be already resolved
|
|
3474
|
-
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
3475
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
3476
|
-
*
|
|
3477
3528
|
* **Example** (Eagerly matching already completed effects)
|
|
3478
3529
|
*
|
|
3479
3530
|
* ```ts
|
|
@@ -3492,6 +3543,8 @@ export const matchCauseEager = internal.matchCauseEager;
|
|
|
3492
3543
|
/**
|
|
3493
3544
|
* Eagerly handles success or failure with effectful handlers when the effect is already resolved.
|
|
3494
3545
|
*
|
|
3546
|
+
* **Details**
|
|
3547
|
+
*
|
|
3495
3548
|
* If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
|
|
3496
3549
|
* {@link matchCauseEffect}.
|
|
3497
3550
|
*
|
|
@@ -3557,19 +3610,16 @@ export const matchCauseEffect = internal.matchCauseEffect;
|
|
|
3557
3610
|
/**
|
|
3558
3611
|
* Handles both success and failure by running effectful handlers.
|
|
3559
3612
|
*
|
|
3613
|
+
* **When to use**
|
|
3614
|
+
*
|
|
3615
|
+
* Use this when the failure or success branch must run additional effects.
|
|
3616
|
+
*
|
|
3560
3617
|
* **Details**
|
|
3561
3618
|
*
|
|
3562
3619
|
* Use `matchEffect` when either branch needs to return an `Effect`, such as
|
|
3563
3620
|
* performing logging, recovery, notification, or other effectful work. The
|
|
3564
3621
|
* returned effect succeeds or fails according to the handler that is run.
|
|
3565
3622
|
*
|
|
3566
|
-
* **When to Use**
|
|
3567
|
-
*
|
|
3568
|
-
* Use this when the failure or success branch must run additional effects.
|
|
3569
|
-
*
|
|
3570
|
-
* @see {@link match} if you don't need side effects and only want to handle the
|
|
3571
|
-
* result or failure.
|
|
3572
|
-
*
|
|
3573
3623
|
* **Example** (Matching success and failure with effectful handlers)
|
|
3574
3624
|
*
|
|
3575
3625
|
* ```ts
|
|
@@ -3611,6 +3661,8 @@ export const matchCauseEffect = internal.matchCauseEffect;
|
|
|
3611
3661
|
* // failure: Uh oh!
|
|
3612
3662
|
* ```
|
|
3613
3663
|
*
|
|
3664
|
+
* @see {@link match} if you don't need side effects and only want to handle the
|
|
3665
|
+
* result or failure.
|
|
3614
3666
|
* @category Pattern Matching
|
|
3615
3667
|
* @since 2.0.0
|
|
3616
3668
|
*/
|
|
@@ -3621,6 +3673,8 @@ export const matchEffect = internal.matchEffect;
|
|
|
3621
3673
|
/**
|
|
3622
3674
|
* Determines whether an effect fails.
|
|
3623
3675
|
*
|
|
3676
|
+
* **Details**
|
|
3677
|
+
*
|
|
3624
3678
|
* Defects are not converted; if the effect dies, the resulting effect dies too.
|
|
3625
3679
|
*
|
|
3626
3680
|
* **Example** (Checking whether an effect fails)
|
|
@@ -3644,6 +3698,8 @@ export const isFailure = internal.isFailure;
|
|
|
3644
3698
|
/**
|
|
3645
3699
|
* Returns whether an effect completes successfully.
|
|
3646
3700
|
*
|
|
3701
|
+
* **Details**
|
|
3702
|
+
*
|
|
3647
3703
|
* Returns `false` for failures in the error channel, but defects still fail the
|
|
3648
3704
|
* effect.
|
|
3649
3705
|
*
|
|
@@ -3675,6 +3731,8 @@ export const isSuccess = internal.isSuccess;
|
|
|
3675
3731
|
/**
|
|
3676
3732
|
* Returns the complete context.
|
|
3677
3733
|
*
|
|
3734
|
+
* **Details**
|
|
3735
|
+
*
|
|
3678
3736
|
* This function allows you to access all services that are currently available
|
|
3679
3737
|
* in the effect's environment. This can be useful for debugging, introspection,
|
|
3680
3738
|
* or when you need to pass the entire context to another function.
|
|
@@ -3715,6 +3773,8 @@ export const context = internal.context;
|
|
|
3715
3773
|
/**
|
|
3716
3774
|
* Transforms the current context using the provided function.
|
|
3717
3775
|
*
|
|
3776
|
+
* **Details**
|
|
3777
|
+
*
|
|
3718
3778
|
* This function allows you to access the complete context and perform
|
|
3719
3779
|
* computations based on all available services. This is useful when you need
|
|
3720
3780
|
* to conditionally execute logic based on what services are available.
|
|
@@ -3940,6 +4000,8 @@ export const updateContext = internal.updateContext;
|
|
|
3940
4000
|
* Runs an effect with a service implementation transformed by the provided
|
|
3941
4001
|
* function.
|
|
3942
4002
|
*
|
|
4003
|
+
* **Details**
|
|
4004
|
+
*
|
|
3943
4005
|
* The service must be available in the effect's context; `updateService`
|
|
3944
4006
|
* replaces it for the wrapped effect with the value returned by the updater.
|
|
3945
4007
|
*
|
|
@@ -3974,14 +4036,14 @@ export const updateService = internal.updateService;
|
|
|
3974
4036
|
* The `provideService` function is used to provide an actual
|
|
3975
4037
|
* implementation for a service in the context of an effect.
|
|
3976
4038
|
*
|
|
4039
|
+
* **Details**
|
|
4040
|
+
*
|
|
3977
4041
|
* This function allows you to associate a service with its implementation so
|
|
3978
4042
|
* that it can be used in your program. You define the service (e.g., a random
|
|
3979
4043
|
* number generator), and then you use `provideService` to link that
|
|
3980
4044
|
* service to its implementation. Once the implementation is provided, the
|
|
3981
4045
|
* effect can be run successfully without further requirements.
|
|
3982
4046
|
*
|
|
3983
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
3984
|
-
*
|
|
3985
4047
|
* **Example** (Providing a service value)
|
|
3986
4048
|
*
|
|
3987
4049
|
* ```ts
|
|
@@ -4013,6 +4075,7 @@ export const updateService = internal.updateService;
|
|
|
4013
4075
|
* // data
|
|
4014
4076
|
* ```
|
|
4015
4077
|
*
|
|
4078
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
4016
4079
|
* @category Context
|
|
4017
4080
|
* @since 2.0.0
|
|
4018
4081
|
*/
|
|
@@ -4275,6 +4338,8 @@ export const acquireRelease = internal.acquireRelease;
|
|
|
4275
4338
|
* This function constructs a scoped resource from an Effect that acquires a
|
|
4276
4339
|
* disposable value.
|
|
4277
4340
|
*
|
|
4341
|
+
* **Details**
|
|
4342
|
+
*
|
|
4278
4343
|
* The resource is automatically disposed when the surrounding
|
|
4279
4344
|
* {@link Scope} is closed, using {@link Symbol.dispose} for
|
|
4280
4345
|
* synchronous disposables or {@link Symbol.asyncDispose} for asynchronous
|
|
@@ -4284,8 +4349,6 @@ export const acquireRelease = internal.acquireRelease;
|
|
|
4284
4349
|
* JavaScript disposal protocal instead of requiring an explicit release
|
|
4285
4350
|
* function.
|
|
4286
4351
|
*
|
|
4287
|
-
* @see [JavaScript `using` declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using)
|
|
4288
|
-
*
|
|
4289
4352
|
* **Example** (Acquiring a disposable resource)
|
|
4290
4353
|
*
|
|
4291
4354
|
* ```ts
|
|
@@ -4306,6 +4369,7 @@ export const acquireRelease = internal.acquireRelease;
|
|
|
4306
4369
|
* )
|
|
4307
4370
|
* ```
|
|
4308
4371
|
*
|
|
4372
|
+
* @see [JavaScript `using` declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using)
|
|
4309
4373
|
* @category resource management
|
|
4310
4374
|
* @since 4.0.0
|
|
4311
4375
|
*/
|
|
@@ -4316,6 +4380,8 @@ export const acquireDisposable = internal.acquireDisposable;
|
|
|
4316
4380
|
* etc.) will not be interrupted, and that the resource will always be released
|
|
4317
4381
|
* when the `Effect` value completes execution.
|
|
4318
4382
|
*
|
|
4383
|
+
* **Details**
|
|
4384
|
+
*
|
|
4319
4385
|
* `acquireUseRelease` does the following:
|
|
4320
4386
|
*
|
|
4321
4387
|
* 1. Ensures that the `Effect` value that acquires the resource will not be
|
|
@@ -4388,6 +4454,8 @@ export const acquireUseRelease = internal.acquireUseRelease;
|
|
|
4388
4454
|
* The finalizer is guaranteed to be run when the scope is closed, and it may
|
|
4389
4455
|
* depend on the `Exit` value that the scope is closed with.
|
|
4390
4456
|
*
|
|
4457
|
+
* **Details**
|
|
4458
|
+
*
|
|
4391
4459
|
* Finalizers are useful for cleanup operations that must run regardless of
|
|
4392
4460
|
* whether the effect succeeds or fails. They're commonly used for resource
|
|
4393
4461
|
* cleanup, logging, or other side effects that should always occur.
|
|
@@ -4431,6 +4499,8 @@ export const addFinalizer = internal.addFinalizer;
|
|
|
4431
4499
|
* specified `finalizer` is guaranteed to be executed, whether this effect
|
|
4432
4500
|
* succeeds, fails, or is interrupted.
|
|
4433
4501
|
*
|
|
4502
|
+
* **Details**
|
|
4503
|
+
*
|
|
4434
4504
|
* For use cases that need access to the effect's result, see `onExit`.
|
|
4435
4505
|
*
|
|
4436
4506
|
* Finalizers offer very powerful guarantees, but they are low-level, and
|
|
@@ -4605,24 +4675,19 @@ export const onExitFilter = internal.onExitFilter;
|
|
|
4605
4675
|
* Returns an effect that lazily computes a result and caches it for subsequent
|
|
4606
4676
|
* evaluations.
|
|
4607
4677
|
*
|
|
4608
|
-
* **
|
|
4609
|
-
*
|
|
4610
|
-
* This function wraps an effect and ensures that its result is computed only
|
|
4611
|
-
* once. Once the result is computed, it is cached, meaning that subsequent
|
|
4612
|
-
* evaluations of the same effect will return the cached result without
|
|
4613
|
-
* re-executing the logic.
|
|
4614
|
-
*
|
|
4615
|
-
* **When to Use**
|
|
4678
|
+
* **When to use**
|
|
4616
4679
|
*
|
|
4617
4680
|
* Use this function when you have an expensive or time-consuming operation that
|
|
4618
4681
|
* you want to avoid repeating. The first evaluation will compute the result,
|
|
4619
4682
|
* and all following evaluations will immediately return the cached value,
|
|
4620
4683
|
* improving performance and reducing unnecessary work.
|
|
4621
4684
|
*
|
|
4622
|
-
*
|
|
4623
|
-
*
|
|
4624
|
-
*
|
|
4625
|
-
*
|
|
4685
|
+
* **Details**
|
|
4686
|
+
*
|
|
4687
|
+
* This function wraps an effect and ensures that its result is computed only
|
|
4688
|
+
* once. Once the result is computed, it is cached, meaning that subsequent
|
|
4689
|
+
* evaluations of the same effect will return the cached result without
|
|
4690
|
+
* re-executing the logic.
|
|
4626
4691
|
*
|
|
4627
4692
|
* **Example** (Memoizing an effect until invalidated)
|
|
4628
4693
|
*
|
|
@@ -4662,6 +4727,10 @@ export const onExitFilter = internal.onExitFilter;
|
|
|
4662
4727
|
* // result 3
|
|
4663
4728
|
* ```
|
|
4664
4729
|
*
|
|
4730
|
+
* @see {@link cachedWithTTL} for a similar function that includes a
|
|
4731
|
+
* time-to-live duration for the cached value.
|
|
4732
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
4733
|
+
* additional effect for manually invalidating the cached value.
|
|
4665
4734
|
* @category Caching
|
|
4666
4735
|
* @since 2.0.0
|
|
4667
4736
|
*/
|
|
@@ -4670,6 +4739,17 @@ export const cached = internal.cached;
|
|
|
4670
4739
|
* Returns an effect that caches its result for a specified `Duration`,
|
|
4671
4740
|
* known as "timeToLive" (TTL).
|
|
4672
4741
|
*
|
|
4742
|
+
* **When to use**
|
|
4743
|
+
*
|
|
4744
|
+
* Use this function when you have an effect that involves costly operations or
|
|
4745
|
+
* computations, and you want to avoid repeating them within a short time frame.
|
|
4746
|
+
*
|
|
4747
|
+
* It's ideal for scenarios where the result of an effect doesn't change
|
|
4748
|
+
* frequently and can be reused for a specified duration.
|
|
4749
|
+
*
|
|
4750
|
+
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
4751
|
+
* computations, especially in performance-critical applications.
|
|
4752
|
+
*
|
|
4673
4753
|
* **Details**
|
|
4674
4754
|
*
|
|
4675
4755
|
* This function is used to cache the result of an effect for a specified amount
|
|
@@ -4682,22 +4762,6 @@ export const cached = internal.cached;
|
|
|
4682
4762
|
* After the specified duration has passed, the cache expires, and the effect
|
|
4683
4763
|
* will be recomputed upon the next evaluation.
|
|
4684
4764
|
*
|
|
4685
|
-
* **When to Use**
|
|
4686
|
-
*
|
|
4687
|
-
* Use this function when you have an effect that involves costly operations or
|
|
4688
|
-
* computations, and you want to avoid repeating them within a short time frame.
|
|
4689
|
-
*
|
|
4690
|
-
* It's ideal for scenarios where the result of an effect doesn't change
|
|
4691
|
-
* frequently and can be reused for a specified duration.
|
|
4692
|
-
*
|
|
4693
|
-
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
4694
|
-
* computations, especially in performance-critical applications.
|
|
4695
|
-
*
|
|
4696
|
-
* @see {@link cached} for a similar function that caches the result
|
|
4697
|
-
* indefinitely.
|
|
4698
|
-
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
4699
|
-
* additional effect for manually invalidating the cached value.
|
|
4700
|
-
*
|
|
4701
4765
|
* **Example** (Memoizing an effect with TTL)
|
|
4702
4766
|
*
|
|
4703
4767
|
* ```ts
|
|
@@ -4730,6 +4794,10 @@ export const cached = internal.cached;
|
|
|
4730
4794
|
* // result 2
|
|
4731
4795
|
* ```
|
|
4732
4796
|
*
|
|
4797
|
+
* @see {@link cached} for a similar function that caches the result
|
|
4798
|
+
* indefinitely.
|
|
4799
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
4800
|
+
* additional effect for manually invalidating the cached value.
|
|
4733
4801
|
* @category Caching
|
|
4734
4802
|
* @since 2.0.0
|
|
4735
4803
|
*/
|
|
@@ -4738,6 +4806,16 @@ export const cachedWithTTL = internal.cachedWithTTL;
|
|
|
4738
4806
|
* Caches an effect's result for a specified duration and allows manual
|
|
4739
4807
|
* invalidation before expiration.
|
|
4740
4808
|
*
|
|
4809
|
+
* **When to use**
|
|
4810
|
+
*
|
|
4811
|
+
* Use this function when you have an effect whose result needs to be cached for
|
|
4812
|
+
* a certain period, but you also want the option to refresh the cache manually
|
|
4813
|
+
* before the expiration time.
|
|
4814
|
+
*
|
|
4815
|
+
* This is useful when you need to ensure that the cached data remains valid for
|
|
4816
|
+
* a certain period but still want to invalidate it if the underlying data
|
|
4817
|
+
* changes or if you want to force a recomputation.
|
|
4818
|
+
*
|
|
4741
4819
|
* **Details**
|
|
4742
4820
|
*
|
|
4743
4821
|
* This function behaves similarly to {@link cachedWithTTL} by caching the
|
|
@@ -4751,21 +4829,6 @@ export const cachedWithTTL = internal.cachedWithTTL;
|
|
|
4751
4829
|
* Once the cache is invalidated, the next time the effect is evaluated, the
|
|
4752
4830
|
* result will be recomputed, and the cache will be refreshed.
|
|
4753
4831
|
*
|
|
4754
|
-
* **When to Use**
|
|
4755
|
-
*
|
|
4756
|
-
* Use this function when you have an effect whose result needs to be cached for
|
|
4757
|
-
* a certain period, but you also want the option to refresh the cache manually
|
|
4758
|
-
* before the expiration time.
|
|
4759
|
-
*
|
|
4760
|
-
* This is useful when you need to ensure that the cached data remains valid for
|
|
4761
|
-
* a certain period but still want to invalidate it if the underlying data
|
|
4762
|
-
* changes or if you want to force a recomputation.
|
|
4763
|
-
*
|
|
4764
|
-
* @see {@link cached} for a similar function that caches the result
|
|
4765
|
-
* indefinitely.
|
|
4766
|
-
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
4767
|
-
* a specified duration but does not include an effect for manual invalidation.
|
|
4768
|
-
*
|
|
4769
4832
|
* **Example** (Memoizing with TTL and invalidation)
|
|
4770
4833
|
*
|
|
4771
4834
|
* ```ts
|
|
@@ -4801,6 +4864,10 @@ export const cachedWithTTL = internal.cachedWithTTL;
|
|
|
4801
4864
|
* // result 2
|
|
4802
4865
|
* ```
|
|
4803
4866
|
*
|
|
4867
|
+
* @see {@link cached} for a similar function that caches the result
|
|
4868
|
+
* indefinitely.
|
|
4869
|
+
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
4870
|
+
* a specified duration but does not include an effect for manual invalidation.
|
|
4804
4871
|
* @category Caching
|
|
4805
4872
|
* @since 2.0.0
|
|
4806
4873
|
*/
|
|
@@ -5112,6 +5179,8 @@ export const repeatOrElse = internalSchedule.repeatOrElse;
|
|
|
5112
5179
|
/**
|
|
5113
5180
|
* Returns an array of `n` identical effects.
|
|
5114
5181
|
*
|
|
5182
|
+
* **Details**
|
|
5183
|
+
*
|
|
5115
5184
|
* Use with `Effect.all` to run the replicated effects and collect results.
|
|
5116
5185
|
*
|
|
5117
5186
|
* @category Collecting
|
|
@@ -5121,6 +5190,8 @@ export const replicate = internal.replicate;
|
|
|
5121
5190
|
/**
|
|
5122
5191
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
5123
5192
|
*
|
|
5193
|
+
* **Details**
|
|
5194
|
+
*
|
|
5124
5195
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
5125
5196
|
*
|
|
5126
5197
|
* **Example** (Replicating an effect)
|
|
@@ -5477,6 +5548,8 @@ export const spanLinks = internal.spanLinks;
|
|
|
5477
5548
|
/**
|
|
5478
5549
|
* For all spans in this effect, add a link with the provided span.
|
|
5479
5550
|
*
|
|
5551
|
+
* **Details**
|
|
5552
|
+
*
|
|
5480
5553
|
* This is useful for connecting spans that are related but not in a direct
|
|
5481
5554
|
* parent-child relationship. For example, you might want to link spans from
|
|
5482
5555
|
* parallel operations or connect spans across different traces.
|
|
@@ -5556,6 +5629,8 @@ export const makeSpan = internal.makeSpan;
|
|
|
5556
5629
|
* Create a new span for tracing, and automatically close it when the Scope
|
|
5557
5630
|
* finalizes.
|
|
5558
5631
|
*
|
|
5632
|
+
* **Details**
|
|
5633
|
+
*
|
|
5559
5634
|
* The span is not added to the current span stack, so no child spans will be
|
|
5560
5635
|
* created for it.
|
|
5561
5636
|
*
|
|
@@ -5582,6 +5657,8 @@ export const makeSpanScoped = internal.makeSpanScoped;
|
|
|
5582
5657
|
* Create a new span for tracing, and automatically close it when the effect
|
|
5583
5658
|
* completes.
|
|
5584
5659
|
*
|
|
5660
|
+
* **Details**
|
|
5661
|
+
*
|
|
5585
5662
|
* The span is not added to the current span stack, so no child spans will be
|
|
5586
5663
|
* created for it.
|
|
5587
5664
|
*
|
|
@@ -5629,6 +5706,8 @@ export const withSpan = internal.withSpan;
|
|
|
5629
5706
|
/**
|
|
5630
5707
|
* Wraps the effect with a new span for tracing.
|
|
5631
5708
|
*
|
|
5709
|
+
* **Details**
|
|
5710
|
+
*
|
|
5632
5711
|
* The span is ended when the Scope is finalized.
|
|
5633
5712
|
*
|
|
5634
5713
|
* **Example** (Creating a scoped child span)
|
|
@@ -5708,6 +5787,8 @@ export const request = internalRequest.request;
|
|
|
5708
5787
|
* Low-level entry point that registers a request with a resolver and delivers the exit value via `onExit`.
|
|
5709
5788
|
* Use this when you already have a `Context` and need to enqueue a request outside an `Effect`.
|
|
5710
5789
|
*
|
|
5790
|
+
* **Details**
|
|
5791
|
+
*
|
|
5711
5792
|
* It returns a canceler that removes the pending request entry.
|
|
5712
5793
|
*
|
|
5713
5794
|
* @category Requests & Batching
|
|
@@ -5722,6 +5803,8 @@ export const requestUnsafe = internalRequest.requestUnsafe;
|
|
|
5722
5803
|
* returning the fiber immediately, without waiting for it to begin executing
|
|
5723
5804
|
* the effect.
|
|
5724
5805
|
*
|
|
5806
|
+
* **Details**
|
|
5807
|
+
*
|
|
5725
5808
|
* You can use the `forkChild` method whenever you want to execute an effect in a
|
|
5726
5809
|
* new fiber, concurrently and without "blocking" the fiber executing other
|
|
5727
5810
|
* effects. Using fibers can be tricky, so instead of using this method
|
|
@@ -5915,7 +5998,7 @@ export const fiberId = internal.fiberId;
|
|
|
5915
5998
|
* The foundational function for running effects, returning a "fiber" that can
|
|
5916
5999
|
* be observed or interrupted.
|
|
5917
6000
|
*
|
|
5918
|
-
* **When to
|
|
6001
|
+
* **When to use**
|
|
5919
6002
|
*
|
|
5920
6003
|
* `runFork` is used to run an effect in the background by creating a
|
|
5921
6004
|
* fiber. It is the base function for all other run functions. It starts a fiber
|
|
@@ -5983,6 +6066,8 @@ export const runForkWith = internal.runForkWith;
|
|
|
5983
6066
|
/**
|
|
5984
6067
|
* Forks an effect with the provided services, registers `onExit` as a fiber observer, and returns an interruptor.
|
|
5985
6068
|
*
|
|
6069
|
+
* **Details**
|
|
6070
|
+
*
|
|
5986
6071
|
* The returned interruptor calls `fiber.interruptUnsafe`, optionally with an interruptor id.
|
|
5987
6072
|
*
|
|
5988
6073
|
* **Example** (Running with services and a callback)
|
|
@@ -6026,6 +6111,8 @@ export const runCallbackWith = internal.runCallbackWith;
|
|
|
6026
6111
|
* Runs an effect asynchronously, registering `onExit` as a fiber observer and
|
|
6027
6112
|
* returning an interruptor.
|
|
6028
6113
|
*
|
|
6114
|
+
* **Details**
|
|
6115
|
+
*
|
|
6029
6116
|
* The interruptor calls `fiber.interruptUnsafe` with the optional interruptor
|
|
6030
6117
|
* id.
|
|
6031
6118
|
*
|
|
@@ -6064,7 +6151,7 @@ export const runCallback = internal.runCallback;
|
|
|
6064
6151
|
/**
|
|
6065
6152
|
* Executes an effect and returns the result as a `Promise`.
|
|
6066
6153
|
*
|
|
6067
|
-
* **When to
|
|
6154
|
+
* **When to use**
|
|
6068
6155
|
*
|
|
6069
6156
|
* Use `runPromise` when you need to execute an effect and work with the
|
|
6070
6157
|
* result using `Promise` syntax, typically for compatibility with other
|
|
@@ -6073,8 +6160,6 @@ export const runCallback = internal.runCallback;
|
|
|
6073
6160
|
* If the effect succeeds, the promise will resolve with the result. If the
|
|
6074
6161
|
* effect fails, the promise will reject with an error.
|
|
6075
6162
|
*
|
|
6076
|
-
* @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
|
|
6077
|
-
*
|
|
6078
6163
|
* **Example** (Running a successful effect as a Promise)
|
|
6079
6164
|
*
|
|
6080
6165
|
* ```ts
|
|
@@ -6095,6 +6180,7 @@ export const runCallback = internal.runCallback;
|
|
|
6095
6180
|
* // (FiberFailure) Error: my error
|
|
6096
6181
|
* ```
|
|
6097
6182
|
*
|
|
6183
|
+
* @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
|
|
6098
6184
|
* @category Running Effects
|
|
6099
6185
|
* @since 2.0.0
|
|
6100
6186
|
*/
|
|
@@ -6133,7 +6219,7 @@ export const runPromiseWith = internal.runPromiseWith;
|
|
|
6133
6219
|
* Runs an effect and returns a `Promise` that resolves to an `Exit`, which
|
|
6134
6220
|
* represents the outcome (success or failure) of the effect.
|
|
6135
6221
|
*
|
|
6136
|
-
* **When to
|
|
6222
|
+
* **When to use**
|
|
6137
6223
|
*
|
|
6138
6224
|
* Use `runPromiseExit` when you need to determine if an effect succeeded
|
|
6139
6225
|
* or failed, including any defects, and you want to work with a `Promise`.
|
|
@@ -6214,7 +6300,7 @@ export const runPromiseExitWith = internal.runPromiseExitWith;
|
|
|
6214
6300
|
/**
|
|
6215
6301
|
* Executes an effect synchronously and returns its success value.
|
|
6216
6302
|
*
|
|
6217
|
-
* **When to
|
|
6303
|
+
* **When to use**
|
|
6218
6304
|
*
|
|
6219
6305
|
* Use `runSync` only for effects that can complete synchronously.
|
|
6220
6306
|
*
|
|
@@ -6224,9 +6310,6 @@ export const runPromiseExitWith = internal.runPromiseExitWith;
|
|
|
6224
6310
|
* `runSync` throws a `FiberFailure` instead of returning a value. Use
|
|
6225
6311
|
* `runSyncExit` when you want the failure captured as an `Exit`.
|
|
6226
6312
|
*
|
|
6227
|
-
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
6228
|
-
* throwing an error.
|
|
6229
|
-
*
|
|
6230
6313
|
* **Example** (Running a synchronous effect)
|
|
6231
6314
|
*
|
|
6232
6315
|
* ```ts
|
|
@@ -6268,6 +6351,8 @@ export const runPromiseExitWith = internal.runPromiseExitWith;
|
|
|
6268
6351
|
* // (FiberFailure) AsyncFiberException: Fiber #0 cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work
|
|
6269
6352
|
* ```
|
|
6270
6353
|
*
|
|
6354
|
+
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
6355
|
+
* throwing an error.
|
|
6271
6356
|
* @category Running Effects
|
|
6272
6357
|
* @since 2.0.0
|
|
6273
6358
|
*/
|
|
@@ -6307,7 +6392,7 @@ export const runSyncWith = internal.runSyncWith;
|
|
|
6307
6392
|
* Runs an effect synchronously and returns the result as an `Exit` type, which
|
|
6308
6393
|
* represents the outcome (success or failure) of the effect.
|
|
6309
6394
|
*
|
|
6310
|
-
* **When to
|
|
6395
|
+
* **When to use**
|
|
6311
6396
|
*
|
|
6312
6397
|
* Use `runSyncExit` to find out whether an effect succeeded or failed,
|
|
6313
6398
|
* including any defects, without dealing with asynchronous operations.
|
|
@@ -6418,6 +6503,8 @@ export const runSyncExitWith = internal.runSyncExitWith;
|
|
|
6418
6503
|
/**
|
|
6419
6504
|
* Creates an Effect-returning function without tracing.
|
|
6420
6505
|
*
|
|
6506
|
+
* **Details**
|
|
6507
|
+
*
|
|
6421
6508
|
* `Effect.fnUntraced` also acts as a `pipe` function, so you can append transforms after the body.
|
|
6422
6509
|
*
|
|
6423
6510
|
* **Example** (Defining untraced effect functions)
|
|
@@ -6440,6 +6527,8 @@ export const fnUntraced = internal.fnUntraced;
|
|
|
6440
6527
|
/**
|
|
6441
6528
|
* Creates a traced function with an optional span name and `SpanOptionsNoTrace` that adds spans and stack frames, plus pipeable post-processing that receives the Effect and the original arguments.
|
|
6442
6529
|
*
|
|
6530
|
+
* **Details**
|
|
6531
|
+
*
|
|
6443
6532
|
* Pipeable functions run after the body and can transform the resulting Effect.
|
|
6444
6533
|
*
|
|
6445
6534
|
* **Example** (Defining traced effect functions)
|
|
@@ -6500,6 +6589,8 @@ export const clockWith = internal.clockWith;
|
|
|
6500
6589
|
/**
|
|
6501
6590
|
* Creates a logger function that logs at the specified level.
|
|
6502
6591
|
*
|
|
6592
|
+
* **Details**
|
|
6593
|
+
*
|
|
6503
6594
|
* If no level is provided, the logger uses the fiber's current log level and
|
|
6504
6595
|
* extracts any `Cause` values from the message list.
|
|
6505
6596
|
*
|
|
@@ -6801,6 +6892,8 @@ export const annotateLogs = /*#__PURE__*/dual(args => isEffect(args[0]), (effect
|
|
|
6801
6892
|
/**
|
|
6802
6893
|
* Adds log annotations to the current scope.
|
|
6803
6894
|
*
|
|
6895
|
+
* **Details**
|
|
6896
|
+
*
|
|
6804
6897
|
* This differs from `annotateLogs`, which only annotates a specific effect.
|
|
6805
6898
|
* `annotateLogsScoped` updates annotations for the entire current `Scope` and
|
|
6806
6899
|
* restores the previous annotations when the scope closes.
|
|
@@ -6866,6 +6959,8 @@ export const withLogSpan = /*#__PURE__*/dual(2, (effect, label) => internal.flat
|
|
|
6866
6959
|
/**
|
|
6867
6960
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
6868
6961
|
*
|
|
6962
|
+
* **Details**
|
|
6963
|
+
*
|
|
6869
6964
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
6870
6965
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
6871
6966
|
*
|
|
@@ -6921,6 +7016,8 @@ export const track = /*#__PURE__*/dual(args => isEffect(args[0]), (self, metric,
|
|
|
6921
7016
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
6922
7017
|
* a value.
|
|
6923
7018
|
*
|
|
7019
|
+
* **Details**
|
|
7020
|
+
*
|
|
6924
7021
|
* Also accepts an optional function which can be used to map the success value
|
|
6925
7022
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
6926
7023
|
*
|
|
@@ -6972,6 +7069,8 @@ export const trackSuccesses = /*#__PURE__*/dual(args => isEffect(args[0]), (self
|
|
|
6972
7069
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
6973
7070
|
* **expected** error.
|
|
6974
7071
|
*
|
|
7072
|
+
* **Details**
|
|
7073
|
+
*
|
|
6975
7074
|
* Also accepts an optional function which can be used to map the error value
|
|
6976
7075
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
6977
7076
|
*
|
|
@@ -7025,6 +7124,8 @@ export const trackErrors = /*#__PURE__*/dual(args => isEffect(args[0]), (self, m
|
|
|
7025
7124
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
7026
7125
|
* **unexpected** error (i.e. a defect).
|
|
7027
7126
|
*
|
|
7127
|
+
* **Details**
|
|
7128
|
+
*
|
|
7028
7129
|
* Also accepts an optional function which can be used to map the defect value
|
|
7029
7130
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
7030
7131
|
*
|
|
@@ -7079,6 +7180,8 @@ export const trackDefects = /*#__PURE__*/dual(args => isEffect(args[0]), (self,
|
|
|
7079
7180
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
7080
7181
|
* that the wrapped `Effect` took to complete.
|
|
7081
7182
|
*
|
|
7183
|
+
* **Details**
|
|
7184
|
+
*
|
|
7082
7185
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
7083
7186
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
7084
7187
|
* `Metric`.
|
|
@@ -7136,6 +7239,8 @@ export const trackDuration = /*#__PURE__*/dual(args => isEffect(args[0]), (self,
|
|
|
7136
7239
|
/**
|
|
7137
7240
|
* Service that holds the current transaction state, it includes
|
|
7138
7241
|
*
|
|
7242
|
+
* **Details**
|
|
7243
|
+
*
|
|
7139
7244
|
* - a journal that stores any non committed change to TxRef values
|
|
7140
7245
|
* - a retry flag to know if the transaction should be retried
|
|
7141
7246
|
*
|
|
@@ -7160,6 +7265,8 @@ export class Transaction extends /*#__PURE__*/Context.Service()("effect/Effect/T
|
|
|
7160
7265
|
* Defines a transaction boundary. Transactions are "all or nothing" with respect to changes
|
|
7161
7266
|
* made to transactional values (i.e. TxRef) that occur within the transaction body.
|
|
7162
7267
|
*
|
|
7268
|
+
* **Details**
|
|
7269
|
+
*
|
|
7163
7270
|
* If called inside an active transaction, `tx` composes with the current transaction and reuses
|
|
7164
7271
|
* its journal and retry state instead of creating a nested boundary.
|
|
7165
7272
|
*
|
|
@@ -7278,10 +7385,9 @@ function clearTransaction(state) {
|
|
|
7278
7385
|
/**
|
|
7279
7386
|
* Signals that the current transaction needs to be retried.
|
|
7280
7387
|
*
|
|
7281
|
-
*
|
|
7388
|
+
* **Details**
|
|
7282
7389
|
*
|
|
7283
|
-
*
|
|
7284
|
-
* @since 4.0.0
|
|
7390
|
+
* NOTE: the transaction retries on any change to transactional values (i.e. TxRef) accessed in its body.
|
|
7285
7391
|
*
|
|
7286
7392
|
* **Example** (Retrying transactions)
|
|
7287
7393
|
*
|
|
@@ -7311,6 +7417,9 @@ function clearTransaction(state) {
|
|
|
7311
7417
|
*
|
|
7312
7418
|
* Effect.runPromise(program).catch(console.error)
|
|
7313
7419
|
* ```
|
|
7420
|
+
*
|
|
7421
|
+
* @category Transactions
|
|
7422
|
+
* @since 4.0.0
|
|
7314
7423
|
*/
|
|
7315
7424
|
export const txRetry = /*#__PURE__*/flatMap(Transaction, state => {
|
|
7316
7425
|
state.retry = true;
|
|
@@ -7383,6 +7492,8 @@ export const effectify = (fn, onError, onSyncError) => (...args) => callback(res
|
|
|
7383
7492
|
/**
|
|
7384
7493
|
* Ensures that an effect's success type extends a given type `A`.
|
|
7385
7494
|
*
|
|
7495
|
+
* **Details**
|
|
7496
|
+
*
|
|
7386
7497
|
* This function provides compile-time type checking to ensure that the success
|
|
7387
7498
|
* value of an effect conforms to a specific type constraint.
|
|
7388
7499
|
*
|
|
@@ -7410,6 +7521,8 @@ export const satisfiesSuccessType = () => effect => effect;
|
|
|
7410
7521
|
/**
|
|
7411
7522
|
* Ensures that an effect's error type extends a given type `E`.
|
|
7412
7523
|
*
|
|
7524
|
+
* **Details**
|
|
7525
|
+
*
|
|
7413
7526
|
* This function provides compile-time type checking to ensure that the error
|
|
7414
7527
|
* type of an effect conforms to a specific type constraint.
|
|
7415
7528
|
*
|
|
@@ -7439,6 +7552,8 @@ export const satisfiesErrorType = () => effect => effect;
|
|
|
7439
7552
|
/**
|
|
7440
7553
|
* Ensures that an effect's requirements type extends a given type `R`.
|
|
7441
7554
|
*
|
|
7555
|
+
* **Details**
|
|
7556
|
+
*
|
|
7442
7557
|
* This function provides compile-time type checking to ensure that the
|
|
7443
7558
|
* requirements (context) type of an effect conforms to a specific type constraint.
|
|
7444
7559
|
*
|
|
@@ -7467,13 +7582,15 @@ export const satisfiesServicesType = () => effect => effect;
|
|
|
7467
7582
|
* An optimized version of `map` that checks if an effect is already resolved
|
|
7468
7583
|
* and applies the mapping function eagerly when possible.
|
|
7469
7584
|
*
|
|
7470
|
-
* **When to
|
|
7585
|
+
* **When to use**
|
|
7471
7586
|
*
|
|
7472
7587
|
* `mapEager` provides better performance for effects that are already resolved
|
|
7473
7588
|
* by applying the transformation immediately instead of deferring it through
|
|
7474
7589
|
* the effect pipeline.
|
|
7475
7590
|
*
|
|
7476
|
-
* **
|
|
7591
|
+
* **Details**
|
|
7592
|
+
*
|
|
7593
|
+
* Behavior:
|
|
7477
7594
|
*
|
|
7478
7595
|
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
7479
7596
|
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
@@ -7501,13 +7618,15 @@ export const mapEager = internal.mapEager;
|
|
|
7501
7618
|
* An optimized version of `mapError` that checks if an effect is already resolved
|
|
7502
7619
|
* and applies the error mapping function eagerly when possible.
|
|
7503
7620
|
*
|
|
7504
|
-
* **When to
|
|
7621
|
+
* **When to use**
|
|
7505
7622
|
*
|
|
7506
7623
|
* `mapErrorEager` provides better performance for effects that are already resolved
|
|
7507
7624
|
* by applying the error transformation immediately instead of deferring it through
|
|
7508
7625
|
* the effect pipeline.
|
|
7509
7626
|
*
|
|
7510
|
-
* **
|
|
7627
|
+
* **Details**
|
|
7628
|
+
*
|
|
7629
|
+
* Behavior:
|
|
7511
7630
|
*
|
|
7512
7631
|
* - For **Success effects**: Returns the success as-is (no error to transform)
|
|
7513
7632
|
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
@@ -7538,13 +7657,15 @@ export const mapErrorEager = internal.mapErrorEager;
|
|
|
7538
7657
|
* An optimized version of `mapBoth` that checks if an effect is already resolved
|
|
7539
7658
|
* and applies the appropriate mapping function eagerly when possible.
|
|
7540
7659
|
*
|
|
7541
|
-
* **When to
|
|
7660
|
+
* **When to use**
|
|
7542
7661
|
*
|
|
7543
7662
|
* `mapBothEager` provides better performance for effects that are already resolved
|
|
7544
7663
|
* by applying the transformation immediately instead of deferring it through
|
|
7545
7664
|
* the effect pipeline.
|
|
7546
7665
|
*
|
|
7547
|
-
* **
|
|
7666
|
+
* **Details**
|
|
7667
|
+
*
|
|
7668
|
+
* Behavior:
|
|
7548
7669
|
*
|
|
7549
7670
|
* - For **Success effects**: Applies the `onSuccess` function immediately to the value
|
|
7550
7671
|
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
@@ -7577,13 +7698,15 @@ export const mapBothEager = internal.mapBothEager;
|
|
|
7577
7698
|
* An optimized version of `flatMap` that checks if an effect is already resolved
|
|
7578
7699
|
* and applies the flatMap function eagerly when possible.
|
|
7579
7700
|
*
|
|
7580
|
-
* **When to
|
|
7701
|
+
* **When to use**
|
|
7581
7702
|
*
|
|
7582
7703
|
* `flatMapEager` provides better performance for effects that are already resolved
|
|
7583
7704
|
* by applying the transformation immediately instead of deferring it through
|
|
7584
7705
|
* the effect pipeline.
|
|
7585
7706
|
*
|
|
7586
|
-
* **
|
|
7707
|
+
* **Details**
|
|
7708
|
+
*
|
|
7709
|
+
* Behavior:
|
|
7587
7710
|
*
|
|
7588
7711
|
* - For **Success effects**: Applies the flatMap function immediately to the value
|
|
7589
7712
|
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
@@ -7614,13 +7737,15 @@ export const flatMapEager = internal.flatMapEager;
|
|
|
7614
7737
|
* An optimized version of `catch` that checks if an effect is already resolved
|
|
7615
7738
|
* and applies the catch function eagerly when possible.
|
|
7616
7739
|
*
|
|
7617
|
-
* **When to
|
|
7740
|
+
* **When to use**
|
|
7618
7741
|
*
|
|
7619
7742
|
* `catchEager` provides better performance for effects that are already resolved
|
|
7620
7743
|
* by applying the error recovery immediately instead of deferring it through
|
|
7621
7744
|
* the effect pipeline.
|
|
7622
7745
|
*
|
|
7623
|
-
* **
|
|
7746
|
+
* **Details**
|
|
7747
|
+
*
|
|
7748
|
+
* Behavior:
|
|
7624
7749
|
*
|
|
7625
7750
|
* - For **Success effects**: Returns the success as-is (no error to catch)
|
|
7626
7751
|
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
@@ -7660,6 +7785,8 @@ export const catchEager = internal.catchEager;
|
|
|
7660
7785
|
/**
|
|
7661
7786
|
* Creates untraced function effects with eager evaluation optimization.
|
|
7662
7787
|
*
|
|
7788
|
+
* **Details**
|
|
7789
|
+
*
|
|
7663
7790
|
* Executes generator functions eagerly when all yielded effects are synchronous,
|
|
7664
7791
|
* stopping at the first async effect and deferring to normal execution.
|
|
7665
7792
|
*
|