effect 4.0.0-beta.6 → 4.0.0-beta.60
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 +213 -385
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +149 -102
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +82 -45
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +105 -52
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +39 -32
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +36 -33
- package/dist/BigInt.js.map +1 -1
- package/dist/Brand.d.ts +3 -5
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +1 -1
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +14 -45
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +21 -47
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +53 -22
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +108 -10
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +166 -48
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +176 -87
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +112 -304
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +56 -88
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +2 -2
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +280 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +198 -7
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +189 -29
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +85 -35
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +6 -6
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +5 -5
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +2 -2
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +1150 -0
- package/dist/Context.d.ts.map +1 -0
- package/dist/{ServiceMap.js → Context.js} +181 -165
- package/dist/Context.js.map +1 -0
- package/dist/Cron.d.ts +11 -7
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +120 -63
- package/dist/Cron.js.map +1 -1
- package/dist/Data.d.ts +533 -365
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +125 -73
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +74 -255
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +17 -62
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +12 -5
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +13 -5
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +74 -40
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +126 -87
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +1391 -927
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +472 -328
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +29 -0
- package/dist/Effectable.d.ts.map +1 -0
- package/dist/Effectable.js +31 -0
- package/dist/Effectable.js.map +1 -0
- package/dist/Encoding.d.ts +1 -1
- package/dist/Equal.d.ts +276 -109
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +140 -48
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +60 -3
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +70 -13
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +374 -0
- package/dist/ErrorReporter.d.ts.map +1 -0
- package/dist/ErrorReporter.js +245 -0
- package/dist/ErrorReporter.js.map +1 -0
- package/dist/ExecutionPlan.d.ts +6 -6
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +4 -4
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +24 -12
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +8 -4
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +10 -8
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +11 -10
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +12 -11
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +22 -21
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +10 -10
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +2 -2
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +4 -4
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +20 -19
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +15 -11
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +4 -37
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +0 -13
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +131 -47
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +243 -55
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +1 -9
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +2 -10
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +65 -65
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +58 -60
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.js +1 -1
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +26 -19
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +7 -5
- package/dist/HashMap.js.map +1 -1
- package/dist/Inspectable.d.ts +0 -4
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +4 -13
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +50 -50
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +106 -34
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonSchema.d.ts +299 -10
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +323 -4
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +69 -3
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +58 -0
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +599 -379
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +249 -180
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +27 -26
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +21 -18
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +32 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +28 -100
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +31 -97
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +2 -3
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +8 -8
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +34 -25
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Metric.d.ts +23 -25
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +24 -26
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +7 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +8 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +7 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +8 -0
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +3 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/Newtype.d.ts +291 -0
- package/dist/Newtype.d.ts.map +1 -0
- package/dist/Newtype.js +161 -0
- package/dist/Newtype.js.map +1 -0
- package/dist/Number.d.ts +74 -18
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +46 -18
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +947 -18
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +454 -5
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +25 -16
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +15 -9
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +6 -1
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +19 -14
- package/dist/Order.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +183 -0
- package/dist/PartitionedSemaphore.d.ts.map +1 -0
- package/dist/PartitionedSemaphore.js +231 -0
- package/dist/PartitionedSemaphore.js.map +1 -0
- package/dist/Path.d.ts +2 -2
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +2 -2
- package/dist/Path.js.map +1 -1
- package/dist/PlatformError.d.ts +2 -2
- package/dist/Pool.d.ts +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +5 -5
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +1 -1
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/PubSub.d.ts +5 -4
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +15 -8
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +1 -1
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +9 -6
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +7 -5
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +36 -2
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +46 -35
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +4 -4
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +13 -13
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +1 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/Record.d.ts +63 -160
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +37 -56
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +139 -62
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +59 -55
- package/dist/Redactable.js.map +1 -1
- package/dist/Reducer.d.ts +166 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +135 -1
- package/dist/Reducer.js.map +1 -1
- package/dist/References.d.ts +257 -229
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +240 -259
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +5 -5
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +25 -25
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +15 -16
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +0 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +5 -4
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +1 -2
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +66 -0
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +79 -6
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +174 -291
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +132 -120
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +36 -125
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +37 -126
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +3213 -392
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +2058 -252
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +13 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +340 -257
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +55 -13
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +73 -11
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +29 -11
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +44 -54
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +69 -4
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +2 -2
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +63 -39
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +245 -3
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +297 -33
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +2 -2
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +2 -2
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +5 -5
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts +148 -52
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +135 -117
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +22 -19
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +54 -7
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +18 -6
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +20 -2
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +465 -542
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +329 -145
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +114 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +29 -47
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +7 -7
- package/dist/Struct.d.ts.map +1 -1
- package/dist/SubscriptionRef.d.ts +1 -2
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +83 -116
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Terminal.d.ts +5 -4
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +2 -2
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +21 -20
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +13 -9
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +44 -31
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +13 -9
- package/dist/Trie.js.map +1 -1
- package/dist/TxChunk.d.ts +4 -4
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +4 -4
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +328 -0
- package/dist/TxDeferred.d.ts.map +1 -0
- package/dist/TxDeferred.js +197 -0
- package/dist/TxDeferred.js.map +1 -0
- package/dist/TxHashMap.d.ts +105 -86
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +51 -44
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +2 -2
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +16 -15
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +609 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -0
- package/dist/TxPriorityQueue.js +416 -0
- package/dist/TxPriorityQueue.js.map +1 -0
- package/dist/TxPubSub.d.ts +585 -0
- package/dist/TxPubSub.d.ts.map +1 -0
- package/dist/TxPubSub.js +521 -0
- package/dist/TxPubSub.js.map +1 -0
- package/dist/TxQueue.d.ts +1 -1
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +42 -57
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +500 -0
- package/dist/TxReentrantLock.d.ts.map +1 -0
- package/dist/TxReentrantLock.js +481 -0
- package/dist/TxReentrantLock.js.map +1 -0
- package/dist/TxRef.d.ts +14 -20
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +8 -10
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +162 -2
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +25 -10
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +508 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -0
- package/dist/TxSubscriptionRef.js +293 -0
- package/dist/TxSubscriptionRef.js.map +1 -0
- package/dist/Types.d.ts +80 -22
- package/dist/Types.d.ts.map +1 -1
- package/dist/Unify.d.ts +8 -2
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +137 -65
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +38 -66
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +886 -71
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +886 -71
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +77 -71
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +488 -326
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +7 -5
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/layer.js +3 -3
- package/dist/internal/layer.js.map +1 -1
- package/dist/internal/option.js +6 -0
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/random.d.ts +2 -0
- package/dist/internal/random.d.ts.map +1 -0
- package/dist/internal/random.js +13 -0
- package/dist/internal/random.js.map +1 -0
- package/dist/internal/rcRef.js +9 -9
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/references.d.ts +2 -0
- package/dist/internal/references.d.ts.map +1 -0
- package/dist/internal/references.js +51 -0
- package/dist/internal/references.js.map +1 -0
- package/dist/internal/request.js +6 -6
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schedule.js +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/annotations.js +2 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/representation.js +87 -109
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.d.ts +10 -1
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +59 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/trie.js +8 -7
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/TestClock.d.ts +5 -5
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +2 -2
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +267 -33
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +296 -23
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +64 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +64 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +127 -45
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +29 -23
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +9 -2
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +39 -11
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +40 -47
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +130 -0
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -0
- package/dist/unstable/ai/EmbeddingModel.js +127 -0
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -0
- package/dist/unstable/ai/IdGenerator.d.ts +2 -2
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +2 -2
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +119 -49
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +260 -61
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +207 -112
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +71 -19
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +68 -15
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +225 -73
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +27 -9
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +25 -9
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +9 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +17 -17
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +6 -9
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +24 -24
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +7 -8
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +38 -0
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -0
- package/dist/unstable/ai/ResponseIdTracker.js +68 -0
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -0
- package/dist/unstable/ai/Telemetry.d.ts +35 -2
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +2 -2
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +2 -2
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +2 -2
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +46 -16
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +68 -22
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +4 -4
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +14 -21
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +22 -1
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +22 -1
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +5 -7
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +4 -7
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -3
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +51 -63
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +32 -57
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +5 -4
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +67 -12
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +372 -59
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +328 -66
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +97 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -0
- package/dist/unstable/cli/Completions.js +25 -0
- package/dist/unstable/cli/Completions.js.map +1 -0
- package/dist/unstable/cli/Flag.d.ts +4 -5
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +125 -0
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -0
- package/dist/unstable/cli/GlobalFlag.js +118 -0
- package/dist/unstable/cli/GlobalFlag.js.map +1 -0
- package/dist/unstable/cli/HelpDoc.d.ts +81 -11
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +34 -6
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +24 -14
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +2 -2
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +266 -86
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +10 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +10 -0
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +41 -15
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +84 -47
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.d.ts +2 -0
- package/dist/unstable/cli/internal/completions/descriptor.d.ts.map +1 -0
- package/dist/unstable/cli/internal/completions/{CommandDescriptor.js → descriptor.js} +17 -5
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -0
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
- package/dist/unstable/cli/internal/config.js +42 -0
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts +33 -0
- package/dist/unstable/cli/internal/help.d.ts.map +1 -0
- package/dist/unstable/cli/internal/help.js +125 -0
- package/dist/unstable/cli/internal/help.js.map +1 -0
- package/dist/unstable/cli/internal/parser.js +155 -58
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +7 -7
- package/dist/unstable/cluster/ClusterSchema.d.ts +28 -7
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +28 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +4 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +96 -63
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +17 -16
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +31 -25
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +2 -2
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +1 -1
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +3 -3
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +6 -6
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +4 -4
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +2 -2
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +3 -3
- package/dist/unstable/cluster/HttpRunner.js +2 -2
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +4 -4
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +6 -6
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +16 -10
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +16 -8
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +46 -23
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +40 -25
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +7 -6
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +8 -7
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +1 -1
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +2 -2
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +10 -9
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +12 -12
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +3 -3
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +5 -4
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +16 -14
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +35 -49
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +65 -67
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +4 -4
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +59 -49
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +28 -27
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +27 -27
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts +2 -2
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +2 -2
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +24 -20
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +7 -7
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +30 -24
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -2
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +3 -3
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +2 -2
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +9 -8
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +4 -4
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +9 -2
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +9 -9
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +3 -3
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +0 -6
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +0 -5
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +0 -2
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +0 -2
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +27 -10
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +130 -71
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +94 -37
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +225 -151
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +11 -9
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +15 -17
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +228 -0
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogMessage.js +214 -0
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -0
- package/dist/unstable/eventlog/EventLogRemote.d.ts +112 -194
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +168 -322
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +26 -48
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +128 -199
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +60 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +166 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +183 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +461 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +117 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.js +284 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogJournal.d.ts → SqlEventJournal.d.ts} +2 -2
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogJournal.js → SqlEventJournal.js} +28 -21
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogServer.d.ts → SqlEventLogServerEncrypted.d.ts} +5 -5
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogServer.js → SqlEventLogServerEncrypted.js} +69 -27
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +25 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +355 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -0
- package/dist/unstable/eventlog/index.d.ts +22 -2
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +22 -2
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts +2 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts.map +1 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js +89 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -0
- package/dist/unstable/http/Cookies.d.ts +51 -6
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +27 -6
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +2 -2
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +7 -3
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +6 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +5 -5
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +24 -4
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +42 -13
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +1 -1
- package/dist/unstable/http/HttpClient.d.ts +125 -21
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +197 -19
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +8 -8
- package/dist/unstable/http/HttpClientRequest.d.ts +43 -15
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +131 -21
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +2 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +18 -3
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +13 -11
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +51 -51
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +5 -4
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +6 -10
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -4
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +3 -3
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +4 -9
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +47 -43
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +2 -2
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +5 -4
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +9 -8
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +36 -36
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +2 -2
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +4 -4
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +22 -34
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +39 -45
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +19 -7
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +307 -13
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +5 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +52 -5
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +240 -5
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +69 -0
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -0
- package/dist/unstable/http/HttpStaticServer.js +353 -0
- package/dist/unstable/http/HttpStaticServer.js.map +1 -0
- package/dist/unstable/http/HttpTraceContext.d.ts +3 -2
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +27 -15
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +7 -7
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +7 -7
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +604 -0
- package/dist/unstable/http/Url.d.ts.map +1 -0
- package/dist/unstable/http/Url.js +256 -0
- package/dist/unstable/http/Url.js.map +1 -0
- package/dist/unstable/http/UrlParams.d.ts +18 -9
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +6 -7
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +8 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +8 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
- package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js +10 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
- package/dist/unstable/httpapi/HttpApi.d.ts +11 -11
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +8 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +12 -9
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +59 -40
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +82 -7
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +79 -11
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +210 -105
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +52 -47
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +66 -29
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +138 -32
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +9 -8
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +4 -4
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +49 -17
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +38 -8
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +88 -9
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +86 -11
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +9 -6
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +6 -6
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +17 -25
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +59 -60
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +12 -12
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +8 -8
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +7 -4
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +2 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +2 -2
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +2 -2
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +7 -3
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +4 -33
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/internal/protobuf.js +4 -4
- package/dist/unstable/observability/internal/protobuf.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +24 -3
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +144 -2
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +1 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +1 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +10 -11
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +16 -16
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +9 -9
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +5 -5
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +5 -5
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +9 -9
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +4 -4
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +3 -3
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +2 -2
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +5 -128
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +1 -65
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +83 -8
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +22 -2
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +37 -17
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +9 -0
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +108 -47
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +105 -25
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +25 -20
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +58 -26
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +8 -2
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +57 -14
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +12 -12
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +59 -31
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +2 -2
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +6 -6
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +137 -19
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +99 -7
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +26 -47
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +117 -75
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
- package/dist/unstable/rpc/RpcGroup.d.ts +15 -11
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +30 -20
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +12 -12
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +5 -5
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +14 -1
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +17 -2
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +13 -2
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +60 -27
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +8 -12
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +73 -43
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +2 -2
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +4 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +6 -3
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +46 -5
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +24 -3
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +17 -4
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +7 -7
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +7 -18
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +35 -15
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +34 -27
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +8 -5
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +2 -2
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +2 -2
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +24 -6
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +37 -32
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +2 -2
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +5 -2
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +237 -17
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +260 -4
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +8 -9
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +12 -38
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +24 -17
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +17 -6
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +17 -7
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +3 -5
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +14 -13
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +4 -4
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +7 -7
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +3 -3
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +6 -3
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +5 -5
- package/dist/unstable/workers/WorkerRunner.d.ts +2 -2
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +5 -2
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +8 -3
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +25 -11
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +3 -6
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +6 -6
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +2 -5
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +33 -15
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +12 -14
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +30 -26
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +24 -7
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +165 -16
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +4 -4
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +11 -10
- package/src/Array.ts +304 -447
- package/src/BigDecimal.ts +137 -82
- package/src/BigInt.ts +53 -45
- package/src/Brand.ts +3 -5
- package/src/Cache.ts +27 -54
- package/src/Cause.ts +57 -22
- package/src/Channel.ts +687 -220
- package/src/Chunk.ts +149 -331
- package/src/Clock.ts +2 -2
- package/src/Combiner.ts +280 -13
- package/src/Config.ts +214 -52
- package/src/ConfigProvider.ts +5 -5
- package/src/Console.ts +2 -2
- package/src/Context.ts +1454 -0
- package/src/Cron.ts +155 -63
- package/src/Data.ts +530 -368
- package/src/DateTime.ts +77 -258
- package/src/Deferred.ts +15 -6
- package/src/Duration.ts +151 -81
- package/src/Effect.ts +1581 -1050
- package/src/Effectable.ts +47 -0
- package/src/Equal.ts +293 -109
- package/src/Equivalence.ts +114 -52
- package/src/ErrorReporter.ts +458 -0
- package/src/ExecutionPlan.ts +8 -9
- package/src/Exit.ts +24 -12
- package/src/Fiber.ts +17 -8
- package/src/FiberHandle.ts +15 -14
- package/src/FiberMap.ts +27 -27
- package/src/FiberSet.ts +5 -5
- package/src/FileSystem.ts +30 -26
- package/src/Filter.ts +4 -62
- package/src/Formatter.ts +268 -60
- package/src/Function.ts +2 -10
- package/src/Graph.ts +123 -112
- package/src/Hash.ts +2 -2
- package/src/HashMap.ts +26 -19
- package/src/Inspectable.ts +2 -22
- package/src/Iterable.ts +117 -63
- package/src/JsonSchema.ts +383 -10
- package/src/Latch.ts +85 -3
- package/src/Layer.ts +728 -441
- package/src/LayerMap.ts +38 -35
- package/src/LogLevel.ts +37 -0
- package/src/Logger.ts +35 -102
- package/src/ManagedRuntime.ts +61 -48
- package/src/Metric.ts +64 -66
- package/src/MutableHashMap.ts +9 -0
- package/src/MutableHashSet.ts +9 -0
- package/src/MutableList.ts +3 -0
- package/src/Newtype.ts +308 -0
- package/src/Number.ts +98 -29
- package/src/Optic.ts +948 -19
- package/src/Option.ts +34 -24
- package/src/Order.ts +39 -32
- package/src/PartitionedSemaphore.ts +414 -0
- package/src/Path.ts +2 -2
- package/src/Pool.ts +9 -9
- package/src/Predicate.ts +1 -1
- package/src/PubSub.ts +20 -11
- package/src/Pull.ts +1 -1
- package/src/Queue.ts +11 -9
- package/src/Random.ts +51 -14
- package/src/RcMap.ts +19 -19
- package/src/RcRef.ts +1 -1
- package/src/Record.ts +94 -199
- package/src/Redactable.ts +146 -72
- package/src/Reducer.ts +166 -7
- package/src/References.ts +283 -287
- package/src/Request.ts +5 -5
- package/src/RequestResolver.ts +34 -35
- package/src/Resource.ts +6 -5
- package/src/Result.ts +2 -4
- package/src/Runtime.ts +102 -6
- package/src/Schedule.ts +243 -336
- package/src/Scheduler.ts +52 -129
- package/src/Schema.ts +3769 -597
- package/src/SchemaAST.ts +480 -302
- package/src/SchemaGetter.ts +80 -24
- package/src/SchemaIssue.ts +28 -15
- package/src/SchemaParser.ts +100 -29
- package/src/SchemaRepresentation.ts +57 -33
- package/src/SchemaTransformation.ts +321 -32
- package/src/Scope.ts +2 -2
- package/src/ScopedCache.ts +8 -8
- package/src/Semaphore.ts +268 -182
- package/src/Sink.ts +89 -34
- package/src/Stdio.ts +29 -6
- package/src/Stream.ts +908 -752
- package/src/String.ts +122 -69
- package/src/Struct.ts +7 -7
- package/src/SubscriptionRef.ts +98 -118
- package/src/Terminal.ts +5 -4
- package/src/Tracer.ts +23 -22
- package/src/Trie.ts +44 -31
- package/src/TxChunk.ts +26 -16
- package/src/TxDeferred.ts +391 -0
- package/src/TxHashMap.ts +347 -291
- package/src/TxHashSet.ts +54 -61
- package/src/TxPriorityQueue.ts +762 -0
- package/src/TxPubSub.ts +787 -0
- package/src/TxQueue.ts +221 -245
- package/src/TxReentrantLock.ts +729 -0
- package/src/TxRef.ts +31 -31
- package/src/TxSemaphore.ts +203 -31
- package/src/TxSubscriptionRef.ts +637 -0
- package/src/Types.ts +75 -23
- package/src/Unify.ts +26 -2
- package/src/Utils.ts +137 -111
- package/src/index.ts +896 -73
- package/src/internal/core.ts +9 -10
- package/src/internal/dateTime.ts +91 -96
- package/src/internal/effect.ts +1168 -621
- package/src/internal/hashMap.ts +12 -10
- package/src/internal/layer.ts +7 -7
- package/src/internal/option.ts +7 -0
- package/src/internal/random.ts +20 -0
- package/src/internal/rcRef.ts +12 -12
- package/src/internal/references.ts +72 -0
- package/src/internal/request.ts +8 -8
- package/src/internal/schedule.ts +3 -1
- package/src/internal/schema/annotations.ts +2 -0
- package/src/internal/schema/representation.ts +82 -97
- package/src/internal/schema/schema.ts +68 -1
- package/src/internal/trie.ts +21 -15
- package/src/testing/TestClock.ts +6 -6
- package/src/testing/TestSchema.ts +333 -36
- package/src/testing/index.ts +64 -1
- package/src/unstable/ai/AiError.ts +111 -53
- package/src/unstable/ai/AnthropicStructuredOutput.ts +7 -3
- package/src/unstable/ai/Chat.ts +136 -88
- package/src/unstable/ai/EmbeddingModel.ts +209 -0
- package/src/unstable/ai/IdGenerator.ts +2 -2
- package/src/unstable/ai/LanguageModel.ts +685 -255
- package/src/unstable/ai/McpSchema.ts +84 -22
- package/src/unstable/ai/McpServer.ts +307 -87
- package/src/unstable/ai/Model.ts +44 -13
- package/src/unstable/ai/OpenAiStructuredOutput.ts +9 -2
- package/src/unstable/ai/Prompt.ts +23 -29
- package/src/unstable/ai/Response.ts +29 -31
- package/src/unstable/ai/ResponseIdTracker.ts +95 -0
- package/src/unstable/ai/Telemetry.ts +2 -2
- package/src/unstable/ai/Tokenizer.ts +2 -2
- package/src/unstable/ai/Tool.ts +62 -36
- package/src/unstable/ai/Toolkit.ts +17 -26
- package/src/unstable/ai/index.ts +24 -1
- package/src/unstable/ai/internal/codec-transformer.ts +3 -9
- package/src/unstable/cli/Argument.ts +5 -8
- package/src/unstable/cli/CliError.ts +67 -66
- package/src/unstable/cli/CliOutput.ts +87 -15
- package/src/unstable/cli/Command.ts +808 -193
- package/src/unstable/cli/Completions.ts +107 -0
- package/src/unstable/cli/Flag.ts +5 -6
- package/src/unstable/cli/GlobalFlag.ts +242 -0
- package/src/unstable/cli/HelpDoc.ts +91 -11
- package/src/unstable/cli/Param.ts +54 -27
- package/src/unstable/cli/Primitive.ts +2 -2
- package/src/unstable/cli/Prompt.ts +275 -104
- package/src/unstable/cli/index.ts +12 -0
- package/src/unstable/cli/internal/command.ts +125 -64
- package/src/unstable/cli/internal/completions/bash.ts +7 -7
- package/src/unstable/cli/internal/completions/{CommandDescriptor.ts → descriptor.ts} +16 -58
- package/src/unstable/cli/internal/completions/fish.ts +7 -7
- package/src/unstable/cli/internal/completions/zsh.ts +8 -14
- package/src/unstable/cli/internal/config.ts +49 -0
- package/src/unstable/cli/internal/help.ts +171 -0
- package/src/unstable/cli/internal/parser.ts +201 -84
- package/src/unstable/cluster/ClusterCron.ts +2 -2
- package/src/unstable/cluster/ClusterSchema.ts +38 -10
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +142 -80
- package/src/unstable/cluster/DeliverAt.ts +1 -1
- package/src/unstable/cluster/Entity.ts +58 -45
- package/src/unstable/cluster/EntityAddress.ts +1 -1
- package/src/unstable/cluster/EntityProxy.ts +3 -3
- package/src/unstable/cluster/EntityProxyServer.ts +6 -6
- package/src/unstable/cluster/EntityResource.ts +6 -6
- package/src/unstable/cluster/HttpRunner.ts +2 -2
- package/src/unstable/cluster/K8sHttpClient.ts +7 -7
- package/src/unstable/cluster/Message.ts +30 -17
- package/src/unstable/cluster/MessageStorage.ts +74 -45
- package/src/unstable/cluster/Reply.ts +13 -10
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerAddress.ts +1 -1
- package/src/unstable/cluster/RunnerHealth.ts +2 -2
- package/src/unstable/cluster/RunnerServer.ts +11 -14
- package/src/unstable/cluster/RunnerStorage.ts +9 -9
- package/src/unstable/cluster/Runners.ts +22 -18
- package/src/unstable/cluster/ShardId.ts +84 -74
- package/src/unstable/cluster/Sharding.ts +75 -60
- package/src/unstable/cluster/ShardingConfig.ts +39 -40
- package/src/unstable/cluster/Snowflake.ts +2 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +29 -20
- package/src/unstable/cluster/SqlRunnerStorage.ts +13 -7
- package/src/unstable/cluster/internal/entityManager.ts +60 -41
- package/src/unstable/cluster/internal/entityReaper.ts +2 -2
- package/src/unstable/cluster/internal/resourceMap.ts +3 -3
- package/src/unstable/devtools/DevToolsClient.ts +26 -21
- package/src/unstable/devtools/DevToolsSchema.ts +16 -3
- package/src/unstable/encoding/Ndjson.ts +17 -17
- package/src/unstable/encoding/Sse.ts +3 -5
- package/src/unstable/eventlog/Event.ts +0 -8
- package/src/unstable/eventlog/EventGroup.ts +0 -4
- package/src/unstable/eventlog/EventJournal.ts +148 -80
- package/src/unstable/eventlog/EventLog.ts +360 -234
- package/src/unstable/eventlog/EventLogEncryption.ts +18 -32
- package/src/unstable/eventlog/EventLogMessage.ts +277 -0
- package/src/unstable/eventlog/EventLogRemote.ts +264 -410
- package/src/unstable/eventlog/EventLogServer.ts +183 -275
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +206 -0
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +749 -0
- package/src/unstable/eventlog/EventLogSessionAuth.ts +437 -0
- package/src/unstable/eventlog/{SqlEventLogJournal.ts → SqlEventJournal.ts} +38 -22
- package/src/unstable/eventlog/{SqlEventLogServer.ts → SqlEventLogServerEncrypted.ts} +110 -43
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +506 -0
- package/src/unstable/eventlog/index.ts +27 -2
- package/src/unstable/eventlog/internal/identityRootSecretDerivation.ts +153 -0
- package/src/unstable/http/Cookies.ts +94 -11
- package/src/unstable/http/Etag.ts +7 -5
- package/src/unstable/http/FetchHttpClient.ts +5 -5
- package/src/unstable/http/Headers.ts +70 -20
- package/src/unstable/http/HttpClient.ts +385 -42
- package/src/unstable/http/HttpClientRequest.ts +151 -39
- package/src/unstable/http/HttpClientResponse.ts +24 -8
- package/src/unstable/http/HttpEffect.ts +71 -77
- package/src/unstable/http/HttpIncomingMessage.ts +9 -8
- package/src/unstable/http/HttpMethod.ts +16 -4
- package/src/unstable/http/HttpMiddleware.ts +50 -50
- package/src/unstable/http/HttpPlatform.ts +5 -4
- package/src/unstable/http/HttpRouter.ts +46 -46
- package/src/unstable/http/HttpServer.ts +5 -11
- package/src/unstable/http/HttpServerError.ts +45 -47
- package/src/unstable/http/HttpServerRequest.ts +414 -23
- package/src/unstable/http/HttpServerRespondable.ts +6 -6
- package/src/unstable/http/HttpServerResponse.ts +351 -13
- package/src/unstable/http/HttpStaticServer.ts +456 -0
- package/src/unstable/http/HttpTraceContext.ts +31 -17
- package/src/unstable/http/Multipart.ts +8 -8
- package/src/unstable/http/Url.ts +650 -0
- package/src/unstable/http/UrlParams.ts +30 -18
- package/src/unstable/http/index.ts +10 -0
- package/src/unstable/http/internal/preResponseHandler.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +22 -22
- package/src/unstable/httpapi/HttpApiBuilder.ts +134 -54
- package/src/unstable/httpapi/HttpApiClient.ts +185 -34
- package/src/unstable/httpapi/HttpApiEndpoint.ts +225 -114
- package/src/unstable/httpapi/HttpApiError.ts +129 -30
- package/src/unstable/httpapi/HttpApiGroup.ts +18 -17
- package/src/unstable/httpapi/HttpApiMiddleware.ts +95 -32
- package/src/unstable/httpapi/HttpApiSchema.ts +106 -11
- package/src/unstable/httpapi/HttpApiSecurity.ts +13 -13
- package/src/unstable/httpapi/OpenApi.ts +74 -73
- package/src/unstable/observability/Otlp.ts +12 -12
- package/src/unstable/observability/OtlpExporter.ts +14 -10
- package/src/unstable/observability/OtlpLogger.ts +13 -9
- package/src/unstable/observability/OtlpMetrics.ts +6 -6
- package/src/unstable/observability/OtlpSerialization.ts +2 -2
- package/src/unstable/observability/OtlpTracer.ts +14 -10
- package/src/unstable/observability/PrometheusMetrics.ts +5 -5
- package/src/unstable/observability/internal/protobuf.ts +4 -4
- package/src/unstable/persistence/KeyValueStore.ts +226 -3
- package/src/unstable/persistence/Persistable.ts +3 -3
- package/src/unstable/persistence/PersistedCache.ts +20 -17
- package/src/unstable/persistence/PersistedQueue.ts +21 -21
- package/src/unstable/persistence/Persistence.ts +7 -7
- package/src/unstable/persistence/RateLimiter.ts +7 -7
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcess.ts +6 -208
- package/src/unstable/process/ChildProcessSpawner.ts +114 -15
- package/src/unstable/reactivity/AsyncResult.ts +59 -17
- package/src/unstable/reactivity/Atom.ts +280 -124
- package/src/unstable/reactivity/AtomHttpApi.ts +127 -61
- package/src/unstable/reactivity/AtomRegistry.ts +70 -16
- package/src/unstable/reactivity/AtomRpc.ts +82 -37
- package/src/unstable/reactivity/Reactivity.ts +6 -6
- package/src/unstable/rpc/Rpc.ts +212 -32
- package/src/unstable/rpc/RpcClient.ts +161 -142
- package/src/unstable/rpc/RpcGroup.ts +51 -34
- package/src/unstable/rpc/RpcMiddleware.ts +28 -22
- package/src/unstable/rpc/RpcSchema.ts +24 -6
- package/src/unstable/rpc/RpcSerialization.ts +97 -54
- package/src/unstable/rpc/RpcServer.ts +91 -65
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/rpc/Utils.ts +63 -4
- package/src/unstable/schema/Model.ts +35 -6
- package/src/unstable/schema/VariantSchema.ts +14 -27
- package/src/unstable/socket/Socket.ts +102 -62
- package/src/unstable/socket/SocketServer.ts +2 -2
- package/src/unstable/sql/Migrator.ts +7 -5
- package/src/unstable/sql/SqlClient.ts +48 -19
- package/src/unstable/sql/SqlConnection.ts +2 -2
- package/src/unstable/sql/SqlError.ts +365 -11
- package/src/unstable/sql/SqlModel.ts +57 -85
- package/src/unstable/sql/SqlResolver.ts +28 -20
- package/src/unstable/sql/SqlSchema.ts +42 -26
- package/src/unstable/sql/Statement.ts +21 -25
- package/src/unstable/workers/Transferable.ts +17 -19
- package/src/unstable/workers/Worker.ts +4 -4
- package/src/unstable/workers/WorkerRunner.ts +2 -2
- package/src/unstable/workflow/Activity.ts +36 -13
- package/src/unstable/workflow/DurableClock.ts +11 -11
- package/src/unstable/workflow/DurableDeferred.ts +36 -18
- package/src/unstable/workflow/Workflow.ts +46 -35
- package/src/unstable/workflow/WorkflowEngine.ts +236 -23
- package/src/unstable/workflow/WorkflowProxyServer.ts +4 -4
- package/dist/NullOr.d.ts +0 -149
- package/dist/NullOr.d.ts.map +0 -1
- package/dist/NullOr.js +0 -152
- package/dist/NullOr.js.map +0 -1
- package/dist/ServiceMap.d.ts +0 -1126
- package/dist/ServiceMap.d.ts.map +0 -1
- package/dist/ServiceMap.js.map +0 -1
- package/dist/internal/schema/to-codec.d.ts +0 -2
- package/dist/internal/schema/to-codec.d.ts.map +0 -1
- package/dist/internal/schema/to-codec.js +0 -129
- package/dist/internal/schema/to-codec.js.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.d.ts +0 -7
- package/dist/unstable/cli/internal/builtInFlags.d.ts.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.js +0 -44
- package/dist/unstable/cli/internal/builtInFlags.js.map +0 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.d.ts +0 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.d.ts.map +0 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.d.ts +0 -2
- package/dist/unstable/cli/internal/completions/Completions.d.ts.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.js +0 -23
- package/dist/unstable/cli/internal/completions/Completions.js.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogJournal.d.ts.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogJournal.js.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogServer.d.ts.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogServer.js.map +0 -1
- package/src/NullOr.ts +0 -204
- package/src/ServiceMap.ts +0 -1410
- package/src/internal/schema/to-codec.ts +0 -148
- package/src/unstable/cli/internal/builtInFlags.ts +0 -78
- package/src/unstable/cli/internal/completions/Completions.ts +0 -31
package/src/Channel.ts
CHANGED
|
@@ -60,10 +60,11 @@
|
|
|
60
60
|
import * as Arr from "./Array.ts"
|
|
61
61
|
import * as Cause from "./Cause.ts"
|
|
62
62
|
import * as Chunk from "./Chunk.ts"
|
|
63
|
+
import * as Context from "./Context.ts"
|
|
63
64
|
import * as Effect from "./Effect.ts"
|
|
64
65
|
import * as Exit from "./Exit.ts"
|
|
65
66
|
import * as Fiber from "./Fiber.ts"
|
|
66
|
-
import * as Filter from "./Filter.ts"
|
|
67
|
+
import type * as Filter from "./Filter.ts"
|
|
67
68
|
import type { LazyArg } from "./Function.ts"
|
|
68
69
|
import { constant, constTrue, constVoid, dual, identity as identity_ } from "./Function.ts"
|
|
69
70
|
import { ClockRef, endSpan } from "./internal/effect.ts"
|
|
@@ -71,7 +72,7 @@ import { addSpanStackTrace } from "./internal/tracer.ts"
|
|
|
71
72
|
import * as Iterable from "./Iterable.ts"
|
|
72
73
|
import * as Latch from "./Latch.ts"
|
|
73
74
|
import * as Layer from "./Layer.ts"
|
|
74
|
-
import type {
|
|
75
|
+
import type { Severity } from "./LogLevel.ts"
|
|
75
76
|
import * as Option from "./Option.ts"
|
|
76
77
|
import type { Pipeable } from "./Pipeable.ts"
|
|
77
78
|
import { pipeArguments } from "./Pipeable.ts"
|
|
@@ -85,14 +86,23 @@ import * as Result from "./Result.ts"
|
|
|
85
86
|
import * as Schedule from "./Schedule.ts"
|
|
86
87
|
import * as Scope from "./Scope.ts"
|
|
87
88
|
import * as Semaphore from "./Semaphore.ts"
|
|
88
|
-
import * as ServiceMap from "./ServiceMap.ts"
|
|
89
89
|
import * as String from "./String.ts"
|
|
90
90
|
import * as Take from "./Take.ts"
|
|
91
91
|
import { ParentSpan, type SpanOptions } from "./Tracer.ts"
|
|
92
92
|
import type * as Types from "./Types.ts"
|
|
93
93
|
import type * as Unify from "./Unify.ts"
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
/**
|
|
96
|
+
* @since 4.0.0
|
|
97
|
+
* @category Type Identifiers
|
|
98
|
+
*/
|
|
99
|
+
export type TypeId = "~effect/Channel"
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @since 4.0.0
|
|
103
|
+
* @category Type Identifiers
|
|
104
|
+
*/
|
|
105
|
+
export const TypeId: TypeId = "~effect/Channel"
|
|
96
106
|
|
|
97
107
|
/**
|
|
98
108
|
* Tests if a value is a `Channel`.
|
|
@@ -190,8 +200,8 @@ export interface ChannelUnify<A extends { [Unify.typeSymbol]?: any }> extends Ef
|
|
|
190
200
|
* @category models
|
|
191
201
|
* @since 2.0.0
|
|
192
202
|
*/
|
|
193
|
-
export interface ChannelUnifyIgnore
|
|
194
|
-
|
|
203
|
+
export interface ChannelUnifyIgnore {
|
|
204
|
+
Effect?: true
|
|
195
205
|
}
|
|
196
206
|
|
|
197
207
|
type TagsWithReason<E> = {
|
|
@@ -2082,7 +2092,7 @@ const mapEffectConcurrent = <
|
|
|
2082
2092
|
const queue = yield* Queue.bounded<OutElem2, OutErr | EX | Cause.Done<OutDone>>(0)
|
|
2083
2093
|
yield* Scope.addFinalizer(forkedScope, Queue.shutdown(queue))
|
|
2084
2094
|
|
|
2085
|
-
const runFork = Effect.runForkWith(yield* Effect.
|
|
2095
|
+
const runFork = Effect.runForkWith(yield* Effect.context<RX>())
|
|
2086
2096
|
const trackFiber = Fiber.runIn(forkedScope)
|
|
2087
2097
|
|
|
2088
2098
|
if (options.unordered) {
|
|
@@ -3564,9 +3574,9 @@ export const filter: {
|
|
|
3564
3574
|
* @since 2.0.0
|
|
3565
3575
|
* @category Filtering
|
|
3566
3576
|
*/
|
|
3567
|
-
<OutElem
|
|
3577
|
+
<OutElem>(predicate: Predicate.Predicate<OutElem>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3568
3578
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3569
|
-
) => Channel<
|
|
3579
|
+
) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3570
3580
|
/**
|
|
3571
3581
|
* Filters the output elements of a channel using a predicate function.
|
|
3572
3582
|
* Elements that don't match the predicate are discarded.
|
|
@@ -3625,24 +3635,59 @@ export const filter: {
|
|
|
3625
3635
|
* @since 2.0.0
|
|
3626
3636
|
* @category Filtering
|
|
3627
3637
|
*/
|
|
3628
|
-
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env
|
|
3638
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3629
3639
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3630
|
-
|
|
3631
|
-
): Channel<
|
|
3632
|
-
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env
|
|
3640
|
+
predicate: Predicate.Predicate<OutElem>
|
|
3641
|
+
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3642
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3633
3643
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3634
|
-
|
|
3635
|
-
): Channel<
|
|
3644
|
+
predicate: Predicate.Predicate<OutElem>
|
|
3645
|
+
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env> =>
|
|
3636
3646
|
fromTransform((upstream, scope) =>
|
|
3637
3647
|
Effect.map(
|
|
3638
3648
|
toTransform(self)(upstream, scope),
|
|
3639
3649
|
(pull) =>
|
|
3640
|
-
Effect.flatMap(pull, function loop(elem): Pull.Pull<
|
|
3650
|
+
Effect.flatMap(pull, function loop(elem): Pull.Pull<OutElem, OutErr, OutDone> {
|
|
3651
|
+
return predicate(elem)
|
|
3652
|
+
? Effect.succeed(elem)
|
|
3653
|
+
: Effect.flatMap(pull, loop)
|
|
3654
|
+
})
|
|
3655
|
+
)
|
|
3656
|
+
))
|
|
3657
|
+
|
|
3658
|
+
/**
|
|
3659
|
+
* @since 4.0.0
|
|
3660
|
+
* @category Filtering
|
|
3661
|
+
*/
|
|
3662
|
+
export const filterMap: {
|
|
3663
|
+
/**
|
|
3664
|
+
* @since 4.0.0
|
|
3665
|
+
* @category Filtering
|
|
3666
|
+
*/
|
|
3667
|
+
<OutElem, B, X>(filter: Filter.Filter<OutElem, B, X>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3668
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3669
|
+
) => Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3670
|
+
/**
|
|
3671
|
+
* @since 4.0.0
|
|
3672
|
+
* @category Filtering
|
|
3673
|
+
*/
|
|
3674
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
|
|
3675
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3676
|
+
filter: Filter.Filter<OutElem, B, X>
|
|
3677
|
+
): Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3678
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
|
|
3679
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3680
|
+
filter: Filter.Filter<OutElem, B, X>
|
|
3681
|
+
): Channel<B, OutErr, OutDone, InElem, InErr, InDone, Env> =>
|
|
3682
|
+
fromTransform((upstream, scope) =>
|
|
3683
|
+
Effect.map(
|
|
3684
|
+
toTransform(self)(upstream, scope),
|
|
3685
|
+
(pull) =>
|
|
3686
|
+
Effect.flatMap(pull, function loop(elem): Pull.Pull<B, OutErr, OutDone> {
|
|
3641
3687
|
const result = filter(elem)
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
return Effect.flatMap(pull, loop)
|
|
3688
|
+
return Result.isFailure(result)
|
|
3689
|
+
? Effect.flatMap(pull, loop)
|
|
3690
|
+
: Effect.succeed(result.success)
|
|
3646
3691
|
})
|
|
3647
3692
|
)
|
|
3648
3693
|
))
|
|
@@ -3652,6 +3697,46 @@ export const filter: {
|
|
|
3652
3697
|
* @category Filtering
|
|
3653
3698
|
*/
|
|
3654
3699
|
export const filterEffect: {
|
|
3700
|
+
/**
|
|
3701
|
+
* @since 4.0.0
|
|
3702
|
+
* @category Filtering
|
|
3703
|
+
*/
|
|
3704
|
+
<OutElem, E, R>(predicate: (a: OutElem) => Effect.Effect<boolean, E, R>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3705
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3706
|
+
) => Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
|
|
3707
|
+
/**
|
|
3708
|
+
* @since 4.0.0
|
|
3709
|
+
* @category Filtering
|
|
3710
|
+
*/
|
|
3711
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(
|
|
3712
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3713
|
+
predicate: (a: OutElem) => Effect.Effect<boolean, E, R>
|
|
3714
|
+
): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
|
|
3715
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(
|
|
3716
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3717
|
+
predicate: (a: OutElem) => Effect.Effect<boolean, E, R>
|
|
3718
|
+
): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Env | R> =>
|
|
3719
|
+
fromTransform((upstream, scope) =>
|
|
3720
|
+
Effect.map(
|
|
3721
|
+
toTransform(self)(upstream, scope),
|
|
3722
|
+
(pull) =>
|
|
3723
|
+
Effect.flatMap(pull, function loop(elem): Pull.Pull<OutElem, OutErr | E, OutDone, R> {
|
|
3724
|
+
return Effect.flatMap(
|
|
3725
|
+
predicate(elem),
|
|
3726
|
+
(passes) =>
|
|
3727
|
+
passes
|
|
3728
|
+
? Effect.succeed(elem)
|
|
3729
|
+
: Effect.flatMap(pull, loop)
|
|
3730
|
+
)
|
|
3731
|
+
})
|
|
3732
|
+
)
|
|
3733
|
+
))
|
|
3734
|
+
|
|
3735
|
+
/**
|
|
3736
|
+
* @since 4.0.0
|
|
3737
|
+
* @category Filtering
|
|
3738
|
+
*/
|
|
3739
|
+
export const filterMapEffect: {
|
|
3655
3740
|
/**
|
|
3656
3741
|
* @since 4.0.0
|
|
3657
3742
|
* @category Filtering
|
|
@@ -3796,9 +3881,9 @@ export const filterArray: {
|
|
|
3796
3881
|
* @since 4.0.0
|
|
3797
3882
|
* @category Filtering
|
|
3798
3883
|
*/
|
|
3799
|
-
<OutElem
|
|
3884
|
+
<OutElem>(predicate: Predicate.Predicate<Types.NoInfer<OutElem>>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3800
3885
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3801
|
-
) => Channel<Arr.NonEmptyReadonlyArray<
|
|
3886
|
+
) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3802
3887
|
/**
|
|
3803
3888
|
* Filters arrays of elements emitted by a channel, applying the filter
|
|
3804
3889
|
* to each element within the arrays and only emitting non-empty filtered arrays.
|
|
@@ -3873,19 +3958,24 @@ export const filterArray: {
|
|
|
3873
3958
|
* @since 4.0.0
|
|
3874
3959
|
* @category Filtering
|
|
3875
3960
|
*/
|
|
3876
|
-
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env
|
|
3961
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3877
3962
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3878
|
-
|
|
3879
|
-
): Channel<Arr.NonEmptyReadonlyArray<
|
|
3880
|
-
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env
|
|
3963
|
+
predicate: Predicate.Predicate<Types.NoInfer<OutElem>>
|
|
3964
|
+
): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3965
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3881
3966
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3882
|
-
|
|
3883
|
-
): Channel<Arr.NonEmptyReadonlyArray<
|
|
3967
|
+
predicate: Predicate.Predicate<Types.NoInfer<OutElem>>
|
|
3968
|
+
): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env> =>
|
|
3884
3969
|
transformPull(self, (pull) =>
|
|
3885
3970
|
Effect.succeed(Effect.flatMap(
|
|
3886
3971
|
pull,
|
|
3887
|
-
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<
|
|
3888
|
-
const
|
|
3972
|
+
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone> {
|
|
3973
|
+
const passes: Array<OutElem> = []
|
|
3974
|
+
for (let i = 0; i < arr.length; i++) {
|
|
3975
|
+
if (predicate(arr[i] as Types.NoInfer<OutElem>)) {
|
|
3976
|
+
passes.push(arr[i])
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3889
3979
|
return Arr.isReadonlyArrayNonEmpty(passes)
|
|
3890
3980
|
? Effect.succeed(passes)
|
|
3891
3981
|
: Effect.flatMap(pull, loop)
|
|
@@ -3896,23 +3986,57 @@ export const filterArray: {
|
|
|
3896
3986
|
* @since 4.0.0
|
|
3897
3987
|
* @category Filtering
|
|
3898
3988
|
*/
|
|
3899
|
-
export const
|
|
3989
|
+
export const filterMapArray: {
|
|
3900
3990
|
/**
|
|
3901
3991
|
* @since 4.0.0
|
|
3902
3992
|
* @category Filtering
|
|
3903
3993
|
*/
|
|
3904
|
-
<OutElem,
|
|
3905
|
-
predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
|
|
3906
|
-
): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3994
|
+
<OutElem, B, X>(filter: Filter.Filter<Types.NoInfer<OutElem>, B, X>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3907
3995
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3908
|
-
) => Channel<Arr.NonEmptyReadonlyArray<
|
|
3996
|
+
) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3909
3997
|
/**
|
|
3910
3998
|
* @since 4.0.0
|
|
3911
3999
|
* @category Filtering
|
|
3912
4000
|
*/
|
|
3913
|
-
<OutElem,
|
|
4001
|
+
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
|
|
4002
|
+
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4003
|
+
filter: Filter.Filter<OutElem, B, X>
|
|
4004
|
+
): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
4005
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X>(
|
|
4006
|
+
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4007
|
+
filter: Filter.Filter<OutElem, B, X>
|
|
4008
|
+
): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone, InElem, InErr, InDone, Env> =>
|
|
4009
|
+
transformPull(self, (pull) =>
|
|
4010
|
+
Effect.succeed(Effect.flatMap(
|
|
4011
|
+
pull,
|
|
4012
|
+
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<B>, OutErr, OutDone> {
|
|
4013
|
+
const passes: Array<B> = []
|
|
4014
|
+
for (let i = 0; i < arr.length; i++) {
|
|
4015
|
+
const result = filter(arr[i])
|
|
4016
|
+
if (Result.isSuccess(result)) {
|
|
4017
|
+
passes.push(result.success)
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
return Arr.isReadonlyArrayNonEmpty(passes)
|
|
4021
|
+
? Effect.succeed(passes)
|
|
4022
|
+
: Effect.flatMap(pull, loop)
|
|
4023
|
+
}
|
|
4024
|
+
))))
|
|
4025
|
+
|
|
4026
|
+
/**
|
|
4027
|
+
* @since 4.0.0
|
|
4028
|
+
* @category Filtering
|
|
4029
|
+
*/
|
|
4030
|
+
export const filterArrayEffect: {
|
|
4031
|
+
/**
|
|
4032
|
+
* @since 4.0.0
|
|
4033
|
+
* @category Filtering
|
|
4034
|
+
*/
|
|
4035
|
+
<OutElem, E, R>(
|
|
4036
|
+
predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
|
|
4037
|
+
): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
3914
4038
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
3915
|
-
) => Channel<Arr.NonEmptyReadonlyArray<
|
|
4039
|
+
) => Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
|
|
3916
4040
|
/**
|
|
3917
4041
|
* @since 4.0.0
|
|
3918
4042
|
* @category Filtering
|
|
@@ -3921,6 +4045,32 @@ export const filterArrayEffect: {
|
|
|
3921
4045
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3922
4046
|
predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
|
|
3923
4047
|
): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R>
|
|
4048
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, E, R>(
|
|
4049
|
+
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4050
|
+
predicate: (a: Types.NoInfer<OutElem>, index: number) => Effect.Effect<boolean, E, R>
|
|
4051
|
+
): Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, InElem, InErr, InDone, Env | R> =>
|
|
4052
|
+
transformPull(self, (pull) => {
|
|
4053
|
+
const f = Effect.flatMap(pull, (arr) => Effect.filter(arr, predicate))
|
|
4054
|
+
return Effect.succeed(Effect.flatMap(
|
|
4055
|
+
f,
|
|
4056
|
+
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<OutElem>, OutErr | E, OutDone, R> {
|
|
4057
|
+
return Arr.isReadonlyArrayNonEmpty(arr) ? Effect.succeed(arr) : Effect.flatMap(f, loop)
|
|
4058
|
+
}
|
|
4059
|
+
))
|
|
4060
|
+
}))
|
|
4061
|
+
|
|
4062
|
+
/**
|
|
4063
|
+
* @since 4.0.0
|
|
4064
|
+
* @category Filtering
|
|
4065
|
+
*/
|
|
4066
|
+
export const filterMapArrayEffect: {
|
|
4067
|
+
/**
|
|
4068
|
+
* @since 4.0.0
|
|
4069
|
+
* @category Filtering
|
|
4070
|
+
*/
|
|
4071
|
+
<OutElem, B, X, EX, RX>(filter: Filter.FilterEffect<Types.NoInfer<OutElem>, B, X, EX, RX>): <OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
4072
|
+
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
4073
|
+
) => Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>
|
|
3924
4074
|
/**
|
|
3925
4075
|
* @since 4.0.0
|
|
3926
4076
|
* @category Filtering
|
|
@@ -3929,32 +4079,23 @@ export const filterArrayEffect: {
|
|
|
3929
4079
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3930
4080
|
filter: Filter.FilterEffect<OutElem, B, X, EX, RX>
|
|
3931
4081
|
): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX>
|
|
3932
|
-
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
4082
|
+
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, B, X, EX, RX>(
|
|
3933
4083
|
self: Channel<Arr.NonEmptyReadonlyArray<OutElem>, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
3934
|
-
filter:
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
})
|
|
3950
|
-
}
|
|
3951
|
-
// FilterEffect: (a) => Effect<pass|fail>
|
|
3952
|
-
return filterEffect(self, (arr) =>
|
|
3953
|
-
Effect.map(
|
|
3954
|
-
Effect.filter(arr, filter as any),
|
|
3955
|
-
(passes) => Arr.isReadonlyArrayNonEmpty(passes) ? Result.succeed(passes) : Result.fail(undefined)
|
|
3956
|
-
))
|
|
3957
|
-
})
|
|
4084
|
+
filter: Filter.FilterEffect<OutElem, B, X, EX, RX>
|
|
4085
|
+
): Channel<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, InElem, InErr, InDone, Env | RX> =>
|
|
4086
|
+
transformPull(self, (pull) =>
|
|
4087
|
+
Effect.succeed(Effect.flatMap(
|
|
4088
|
+
pull,
|
|
4089
|
+
function loop(arr): Pull.Pull<Arr.NonEmptyReadonlyArray<B>, OutErr | EX, OutDone, RX> {
|
|
4090
|
+
return Effect.flatMap(
|
|
4091
|
+
Effect.filterMapEffect(arr, filter as any),
|
|
4092
|
+
(passes) =>
|
|
4093
|
+
Arr.isReadonlyArrayNonEmpty(passes)
|
|
4094
|
+
? Effect.succeed(passes as Arr.NonEmptyReadonlyArray<B>)
|
|
4095
|
+
: Effect.flatMap(pull, loop)
|
|
4096
|
+
)
|
|
4097
|
+
}
|
|
4098
|
+
))))
|
|
3958
4099
|
|
|
3959
4100
|
/**
|
|
3960
4101
|
* Statefully maps over a channel with an accumulator, where each element can produce multiple output values.
|
|
@@ -4449,17 +4590,19 @@ export const scanEffect: {
|
|
|
4449
4590
|
Effect.map(toTransform(self)(upstream, scope), (pull) => {
|
|
4450
4591
|
let state = initial
|
|
4451
4592
|
let isFirst = true
|
|
4452
|
-
|
|
4453
|
-
isFirst
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
return Effect.map(
|
|
4457
|
-
Effect.flatMap(pull, (a) => f(state, a)),
|
|
4458
|
-
(newState) => {
|
|
4459
|
-
state = newState
|
|
4460
|
-
return state
|
|
4593
|
+
return Effect.suspend(() => {
|
|
4594
|
+
if (isFirst) {
|
|
4595
|
+
isFirst = false
|
|
4596
|
+
return Effect.succeed(state)
|
|
4461
4597
|
}
|
|
4462
|
-
|
|
4598
|
+
return Effect.map(
|
|
4599
|
+
Effect.flatMap(pull, (a) => f(state, a)),
|
|
4600
|
+
(newState) => {
|
|
4601
|
+
state = newState
|
|
4602
|
+
return state
|
|
4603
|
+
}
|
|
4604
|
+
)
|
|
4605
|
+
})
|
|
4463
4606
|
})
|
|
4464
4607
|
))
|
|
4465
4608
|
|
|
@@ -4757,7 +4900,6 @@ export const catchCauseIf: {
|
|
|
4757
4900
|
*/
|
|
4758
4901
|
<
|
|
4759
4902
|
OutErr,
|
|
4760
|
-
Result extends Filter.ResultOrBool<Cause.Cause<any>>,
|
|
4761
4903
|
OutElem1,
|
|
4762
4904
|
OutErr1,
|
|
4763
4905
|
OutDone1,
|
|
@@ -4766,11 +4908,8 @@ export const catchCauseIf: {
|
|
|
4766
4908
|
InDone1,
|
|
4767
4909
|
Env1
|
|
4768
4910
|
>(
|
|
4769
|
-
|
|
4770
|
-
f: (
|
|
4771
|
-
failure: Filter.Pass<Cause.Cause<OutErr>, Result>,
|
|
4772
|
-
cause: Cause.Cause<OutErr>
|
|
4773
|
-
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4911
|
+
predicate: Predicate.Predicate<Cause.Cause<OutErr>>,
|
|
4912
|
+
f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4774
4913
|
): <
|
|
4775
4914
|
OutElem,
|
|
4776
4915
|
OutDone,
|
|
@@ -4780,7 +4919,7 @@ export const catchCauseIf: {
|
|
|
4780
4919
|
Env
|
|
4781
4920
|
>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<
|
|
4782
4921
|
OutElem | OutElem1,
|
|
4783
|
-
|
|
4922
|
+
OutErr | OutErr1,
|
|
4784
4923
|
OutDone | OutDone1,
|
|
4785
4924
|
InElem & InElem1,
|
|
4786
4925
|
InErr & InErr1,
|
|
@@ -4802,7 +4941,6 @@ export const catchCauseIf: {
|
|
|
4802
4941
|
InErr,
|
|
4803
4942
|
InDone,
|
|
4804
4943
|
Env,
|
|
4805
|
-
Result extends Filter.ResultOrBool<Cause.Cause<any>>,
|
|
4806
4944
|
OutElem1,
|
|
4807
4945
|
OutErr1,
|
|
4808
4946
|
OutDone1,
|
|
@@ -4812,14 +4950,137 @@ export const catchCauseIf: {
|
|
|
4812
4950
|
Env1
|
|
4813
4951
|
>(
|
|
4814
4952
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4815
|
-
|
|
4953
|
+
predicate: Predicate.Predicate<Cause.Cause<OutErr>>,
|
|
4954
|
+
f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4955
|
+
): Channel<
|
|
4956
|
+
OutElem | OutElem1,
|
|
4957
|
+
OutErr | OutErr1,
|
|
4958
|
+
OutDone | OutDone1,
|
|
4959
|
+
InElem & InElem1,
|
|
4960
|
+
InErr & InErr1,
|
|
4961
|
+
InDone & InDone1,
|
|
4962
|
+
Env | Env1
|
|
4963
|
+
>
|
|
4964
|
+
} = dual(3, <
|
|
4965
|
+
OutElem,
|
|
4966
|
+
OutErr,
|
|
4967
|
+
OutDone,
|
|
4968
|
+
InElem,
|
|
4969
|
+
InErr,
|
|
4970
|
+
InDone,
|
|
4971
|
+
Env,
|
|
4972
|
+
OutElem1,
|
|
4973
|
+
OutErr1,
|
|
4974
|
+
OutDone1,
|
|
4975
|
+
InElem1,
|
|
4976
|
+
InErr1,
|
|
4977
|
+
InDone1,
|
|
4978
|
+
Env1
|
|
4979
|
+
>(
|
|
4980
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4981
|
+
predicate: Predicate.Predicate<Cause.Cause<OutErr>>,
|
|
4982
|
+
f: (cause: Cause.Cause<OutErr>) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4983
|
+
): Channel<
|
|
4984
|
+
OutElem | OutElem1,
|
|
4985
|
+
OutErr | OutErr1,
|
|
4986
|
+
OutDone | OutDone1,
|
|
4987
|
+
InElem & InElem1,
|
|
4988
|
+
InErr & InErr1,
|
|
4989
|
+
InDone & InDone1,
|
|
4990
|
+
Env | Env1
|
|
4991
|
+
> =>
|
|
4992
|
+
catchCause(
|
|
4993
|
+
self,
|
|
4994
|
+
(
|
|
4995
|
+
cause
|
|
4996
|
+
): Channel<
|
|
4997
|
+
OutElem1,
|
|
4998
|
+
OutErr | OutErr1,
|
|
4999
|
+
OutDone1,
|
|
5000
|
+
InElem1,
|
|
5001
|
+
InErr1,
|
|
5002
|
+
InDone1,
|
|
5003
|
+
Env1
|
|
5004
|
+
> => {
|
|
5005
|
+
return predicate(cause)
|
|
5006
|
+
? f(cause)
|
|
5007
|
+
: failCause(cause as any)
|
|
5008
|
+
}
|
|
5009
|
+
))
|
|
5010
|
+
|
|
5011
|
+
/**
|
|
5012
|
+
* @since 4.0.0
|
|
5013
|
+
* @category Error handling
|
|
5014
|
+
*/
|
|
5015
|
+
export const catchCauseFilter: {
|
|
5016
|
+
/**
|
|
5017
|
+
* @since 4.0.0
|
|
5018
|
+
* @category Error handling
|
|
5019
|
+
*/
|
|
5020
|
+
<
|
|
5021
|
+
OutErr,
|
|
5022
|
+
EB,
|
|
5023
|
+
X extends Cause.Cause<any>,
|
|
5024
|
+
OutElem1,
|
|
5025
|
+
OutErr1,
|
|
5026
|
+
OutDone1,
|
|
5027
|
+
InElem1,
|
|
5028
|
+
InErr1,
|
|
5029
|
+
InDone1,
|
|
5030
|
+
Env1
|
|
5031
|
+
>(
|
|
5032
|
+
filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>,
|
|
5033
|
+
f: (
|
|
5034
|
+
failure: EB,
|
|
5035
|
+
cause: Cause.Cause<OutErr>
|
|
5036
|
+
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
5037
|
+
): <
|
|
5038
|
+
OutElem,
|
|
5039
|
+
OutDone,
|
|
5040
|
+
InElem,
|
|
5041
|
+
InErr,
|
|
5042
|
+
InDone,
|
|
5043
|
+
Env
|
|
5044
|
+
>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<
|
|
5045
|
+
OutElem | OutElem1,
|
|
5046
|
+
Cause.Cause.Error<X> | OutErr1,
|
|
5047
|
+
OutDone | OutDone1,
|
|
5048
|
+
InElem & InElem1,
|
|
5049
|
+
InErr & InErr1,
|
|
5050
|
+
InDone & InDone1,
|
|
5051
|
+
Env | Env1
|
|
5052
|
+
>
|
|
5053
|
+
/**
|
|
5054
|
+
* @since 4.0.0
|
|
5055
|
+
* @category Error handling
|
|
5056
|
+
*/
|
|
5057
|
+
<
|
|
5058
|
+
OutElem,
|
|
5059
|
+
OutErr,
|
|
5060
|
+
OutDone,
|
|
5061
|
+
InElem,
|
|
5062
|
+
InErr,
|
|
5063
|
+
InDone,
|
|
5064
|
+
Env,
|
|
5065
|
+
EB,
|
|
5066
|
+
X extends Cause.Cause<any>,
|
|
5067
|
+
OutElem1,
|
|
5068
|
+
OutErr1,
|
|
5069
|
+
OutDone1,
|
|
5070
|
+
InElem1,
|
|
5071
|
+
InErr1,
|
|
5072
|
+
InDone1,
|
|
5073
|
+
Env1
|
|
5074
|
+
>(
|
|
5075
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5076
|
+
filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>,
|
|
4816
5077
|
f: (
|
|
4817
|
-
failure:
|
|
5078
|
+
failure: EB,
|
|
4818
5079
|
cause: Cause.Cause<OutErr>
|
|
4819
5080
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4820
5081
|
): Channel<
|
|
4821
5082
|
OutElem | OutElem1,
|
|
4822
|
-
Cause.Cause.Error<
|
|
5083
|
+
Cause.Cause.Error<X> | OutErr1,
|
|
4823
5084
|
OutDone | OutDone1,
|
|
4824
5085
|
InElem & InElem1,
|
|
4825
5086
|
InErr & InErr1,
|
|
@@ -4834,7 +5095,8 @@ export const catchCauseIf: {
|
|
|
4834
5095
|
InErr,
|
|
4835
5096
|
InDone,
|
|
4836
5097
|
Env,
|
|
4837
|
-
|
|
5098
|
+
EB,
|
|
5099
|
+
X extends Cause.Cause<any>,
|
|
4838
5100
|
OutElem1,
|
|
4839
5101
|
OutErr1,
|
|
4840
5102
|
OutDone1,
|
|
@@ -4844,14 +5106,14 @@ export const catchCauseIf: {
|
|
|
4844
5106
|
Env1
|
|
4845
5107
|
>(
|
|
4846
5108
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
4847
|
-
filter: Filter.
|
|
5109
|
+
filter: Filter.Filter<Cause.Cause<OutErr>, EB, X>,
|
|
4848
5110
|
f: (
|
|
4849
|
-
failure:
|
|
5111
|
+
failure: EB,
|
|
4850
5112
|
cause: Cause.Cause<OutErr>
|
|
4851
5113
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>
|
|
4852
5114
|
): Channel<
|
|
4853
5115
|
OutElem | OutElem1,
|
|
4854
|
-
Cause.Cause.Error<
|
|
5116
|
+
Cause.Cause.Error<X> | OutErr1,
|
|
4855
5117
|
OutDone | OutDone1,
|
|
4856
5118
|
InElem & InElem1,
|
|
4857
5119
|
InErr & InErr1,
|
|
@@ -4864,18 +5126,17 @@ export const catchCauseIf: {
|
|
|
4864
5126
|
cause
|
|
4865
5127
|
): Channel<
|
|
4866
5128
|
OutElem1,
|
|
4867
|
-
Cause.Cause.Error<
|
|
5129
|
+
Cause.Cause.Error<X> | OutErr1,
|
|
4868
5130
|
OutDone1,
|
|
4869
5131
|
InElem1,
|
|
4870
5132
|
InErr1,
|
|
4871
5133
|
InDone1,
|
|
4872
5134
|
Env1
|
|
4873
5135
|
> => {
|
|
4874
|
-
const
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
return failCause(eb.failure)
|
|
5136
|
+
const result = filter(cause)
|
|
5137
|
+
return Result.isFailure(result)
|
|
5138
|
+
? failCause(result.failure)
|
|
5139
|
+
: f(result.success, cause)
|
|
4879
5140
|
}
|
|
4880
5141
|
))
|
|
4881
5142
|
|
|
@@ -4951,7 +5212,7 @@ const catch_: {
|
|
|
4951
5212
|
InErr & InErr1,
|
|
4952
5213
|
InDone & InDone1,
|
|
4953
5214
|
Env | Env1
|
|
4954
|
-
> =>
|
|
5215
|
+
> => catchCauseFilter(self, Cause.findError, (e) => f(e)))
|
|
4955
5216
|
|
|
4956
5217
|
export {
|
|
4957
5218
|
/**
|
|
@@ -5101,7 +5362,6 @@ export const catchIf: {
|
|
|
5101
5362
|
*/
|
|
5102
5363
|
<
|
|
5103
5364
|
OutErr,
|
|
5104
|
-
Result extends Filter.ResultOrBool,
|
|
5105
5365
|
OutElem1,
|
|
5106
5366
|
OutErr1,
|
|
5107
5367
|
OutDone1,
|
|
@@ -5110,18 +5370,18 @@ export const catchIf: {
|
|
|
5110
5370
|
InDone1,
|
|
5111
5371
|
Env1,
|
|
5112
5372
|
OutElem2 = never,
|
|
5113
|
-
OutErr2 =
|
|
5373
|
+
OutErr2 = OutErr,
|
|
5114
5374
|
OutDone2 = never,
|
|
5115
5375
|
InElem2 = unknown,
|
|
5116
5376
|
InErr2 = unknown,
|
|
5117
5377
|
InDone2 = unknown,
|
|
5118
5378
|
Env2 = never
|
|
5119
5379
|
>(
|
|
5120
|
-
|
|
5121
|
-
f: (failure:
|
|
5380
|
+
predicate: Predicate.Predicate<OutErr>,
|
|
5381
|
+
f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5122
5382
|
orElse?:
|
|
5123
5383
|
| ((
|
|
5124
|
-
failure:
|
|
5384
|
+
failure: OutErr
|
|
5125
5385
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5126
5386
|
| undefined
|
|
5127
5387
|
): <
|
|
@@ -5197,7 +5457,6 @@ export const catchIf: {
|
|
|
5197
5457
|
InErr,
|
|
5198
5458
|
InDone,
|
|
5199
5459
|
Env,
|
|
5200
|
-
Result extends Filter.ResultOrBool,
|
|
5201
5460
|
OutElem1,
|
|
5202
5461
|
OutErr1,
|
|
5203
5462
|
OutDone1,
|
|
@@ -5206,7 +5465,7 @@ export const catchIf: {
|
|
|
5206
5465
|
InDone1,
|
|
5207
5466
|
Env1,
|
|
5208
5467
|
OutElem2 = never,
|
|
5209
|
-
OutErr2 =
|
|
5468
|
+
OutErr2 = OutErr,
|
|
5210
5469
|
OutDone2 = never,
|
|
5211
5470
|
InElem2 = unknown,
|
|
5212
5471
|
InErr2 = unknown,
|
|
@@ -5214,11 +5473,11 @@ export const catchIf: {
|
|
|
5214
5473
|
Env2 = never
|
|
5215
5474
|
>(
|
|
5216
5475
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5217
|
-
|
|
5218
|
-
f: (failure:
|
|
5476
|
+
predicate: Predicate.Predicate<OutErr>,
|
|
5477
|
+
f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5219
5478
|
orElse?:
|
|
5220
5479
|
| ((
|
|
5221
|
-
failure:
|
|
5480
|
+
failure: OutErr
|
|
5222
5481
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5223
5482
|
| undefined
|
|
5224
5483
|
): Channel<
|
|
@@ -5238,7 +5497,6 @@ export const catchIf: {
|
|
|
5238
5497
|
InErr,
|
|
5239
5498
|
InDone,
|
|
5240
5499
|
Env,
|
|
5241
|
-
Result extends Filter.ResultOrBool,
|
|
5242
5500
|
OutElem1,
|
|
5243
5501
|
OutErr1,
|
|
5244
5502
|
OutDone1,
|
|
@@ -5247,7 +5505,7 @@ export const catchIf: {
|
|
|
5247
5505
|
InDone1,
|
|
5248
5506
|
Env1,
|
|
5249
5507
|
OutElem2 = never,
|
|
5250
|
-
OutErr2 =
|
|
5508
|
+
OutErr2 = OutErr,
|
|
5251
5509
|
OutDone2 = never,
|
|
5252
5510
|
InElem2 = unknown,
|
|
5253
5511
|
InErr2 = unknown,
|
|
@@ -5255,11 +5513,11 @@ export const catchIf: {
|
|
|
5255
5513
|
Env2 = never
|
|
5256
5514
|
>(
|
|
5257
5515
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5258
|
-
|
|
5259
|
-
f: (failure:
|
|
5516
|
+
predicate: Predicate.Predicate<OutErr>,
|
|
5517
|
+
f: (failure: OutErr) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5260
5518
|
orElse?:
|
|
5261
5519
|
| ((
|
|
5262
|
-
failure:
|
|
5520
|
+
failure: OutErr
|
|
5263
5521
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5264
5522
|
| undefined
|
|
5265
5523
|
): Channel<
|
|
@@ -5282,12 +5540,170 @@ export const catchIf: {
|
|
|
5282
5540
|
InDone1 & InDone2,
|
|
5283
5541
|
Env1 | Env2
|
|
5284
5542
|
> => {
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
? f(eb.success as any)
|
|
5543
|
+
return predicate(err)
|
|
5544
|
+
? f(err)
|
|
5288
5545
|
: orElse
|
|
5289
|
-
? orElse(
|
|
5290
|
-
: fail(
|
|
5546
|
+
? orElse(err)
|
|
5547
|
+
: fail(err as any) as any
|
|
5548
|
+
}
|
|
5549
|
+
))
|
|
5550
|
+
|
|
5551
|
+
/**
|
|
5552
|
+
* @since 4.0.0
|
|
5553
|
+
* @category Error handling
|
|
5554
|
+
*/
|
|
5555
|
+
export const catchFilter: {
|
|
5556
|
+
/**
|
|
5557
|
+
* @since 4.0.0
|
|
5558
|
+
* @category Error handling
|
|
5559
|
+
*/
|
|
5560
|
+
<
|
|
5561
|
+
OutErr,
|
|
5562
|
+
EB,
|
|
5563
|
+
X,
|
|
5564
|
+
OutElem1,
|
|
5565
|
+
OutErr1,
|
|
5566
|
+
OutDone1,
|
|
5567
|
+
InElem1,
|
|
5568
|
+
InErr1,
|
|
5569
|
+
InDone1,
|
|
5570
|
+
Env1,
|
|
5571
|
+
OutElem2 = never,
|
|
5572
|
+
OutErr2 = X,
|
|
5573
|
+
OutDone2 = never,
|
|
5574
|
+
InElem2 = unknown,
|
|
5575
|
+
InErr2 = unknown,
|
|
5576
|
+
InDone2 = unknown,
|
|
5577
|
+
Env2 = never
|
|
5578
|
+
>(
|
|
5579
|
+
filter: Filter.Filter<OutErr, EB, X>,
|
|
5580
|
+
f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5581
|
+
orElse?:
|
|
5582
|
+
| ((
|
|
5583
|
+
failure: X
|
|
5584
|
+
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5585
|
+
| undefined
|
|
5586
|
+
): <
|
|
5587
|
+
OutElem,
|
|
5588
|
+
OutDone,
|
|
5589
|
+
InElem,
|
|
5590
|
+
InErr,
|
|
5591
|
+
InDone,
|
|
5592
|
+
Env
|
|
5593
|
+
>(self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>) => Channel<
|
|
5594
|
+
OutElem | OutElem1 | OutElem2,
|
|
5595
|
+
OutErr1 | OutErr2,
|
|
5596
|
+
OutDone | OutDone1 | OutDone2,
|
|
5597
|
+
InElem & InElem1 & InElem2,
|
|
5598
|
+
InErr & InErr1 & InErr2,
|
|
5599
|
+
InDone & InDone1 & InDone2,
|
|
5600
|
+
Env | Env1 | Env2
|
|
5601
|
+
>
|
|
5602
|
+
/**
|
|
5603
|
+
* @since 4.0.0
|
|
5604
|
+
* @category Error handling
|
|
5605
|
+
*/
|
|
5606
|
+
<
|
|
5607
|
+
OutElem,
|
|
5608
|
+
OutErr,
|
|
5609
|
+
OutDone,
|
|
5610
|
+
InElem,
|
|
5611
|
+
InErr,
|
|
5612
|
+
InDone,
|
|
5613
|
+
Env,
|
|
5614
|
+
EB,
|
|
5615
|
+
X,
|
|
5616
|
+
OutElem1,
|
|
5617
|
+
OutErr1,
|
|
5618
|
+
OutDone1,
|
|
5619
|
+
InElem1,
|
|
5620
|
+
InErr1,
|
|
5621
|
+
InDone1,
|
|
5622
|
+
Env1,
|
|
5623
|
+
OutElem2 = never,
|
|
5624
|
+
OutErr2 = X,
|
|
5625
|
+
OutDone2 = never,
|
|
5626
|
+
InElem2 = unknown,
|
|
5627
|
+
InErr2 = unknown,
|
|
5628
|
+
InDone2 = unknown,
|
|
5629
|
+
Env2 = never
|
|
5630
|
+
>(
|
|
5631
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5632
|
+
filter: Filter.Filter<OutErr, EB, X>,
|
|
5633
|
+
f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5634
|
+
orElse?:
|
|
5635
|
+
| ((
|
|
5636
|
+
failure: X
|
|
5637
|
+
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5638
|
+
| undefined
|
|
5639
|
+
): Channel<
|
|
5640
|
+
OutElem | OutElem1 | OutElem2,
|
|
5641
|
+
OutErr1 | OutErr2,
|
|
5642
|
+
OutDone | OutDone1 | OutDone2,
|
|
5643
|
+
InElem & InElem1 & InElem2,
|
|
5644
|
+
InErr & InErr1 & InErr2,
|
|
5645
|
+
InDone & InDone1 & InDone2,
|
|
5646
|
+
Env | Env1 | Env2
|
|
5647
|
+
>
|
|
5648
|
+
} = dual((args) => isChannel(args[0]), <
|
|
5649
|
+
OutElem,
|
|
5650
|
+
OutErr,
|
|
5651
|
+
OutDone,
|
|
5652
|
+
InElem,
|
|
5653
|
+
InErr,
|
|
5654
|
+
InDone,
|
|
5655
|
+
Env,
|
|
5656
|
+
EB,
|
|
5657
|
+
X,
|
|
5658
|
+
OutElem1,
|
|
5659
|
+
OutErr1,
|
|
5660
|
+
OutDone1,
|
|
5661
|
+
InElem1,
|
|
5662
|
+
InErr1,
|
|
5663
|
+
InDone1,
|
|
5664
|
+
Env1,
|
|
5665
|
+
OutElem2 = never,
|
|
5666
|
+
OutErr2 = X,
|
|
5667
|
+
OutDone2 = never,
|
|
5668
|
+
InElem2 = unknown,
|
|
5669
|
+
InErr2 = unknown,
|
|
5670
|
+
InDone2 = unknown,
|
|
5671
|
+
Env2 = never
|
|
5672
|
+
>(
|
|
5673
|
+
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
5674
|
+
filter: Filter.Filter<OutErr, EB, X>,
|
|
5675
|
+
f: (failure: EB) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5676
|
+
orElse?:
|
|
5677
|
+
| ((
|
|
5678
|
+
failure: X
|
|
5679
|
+
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5680
|
+
| undefined
|
|
5681
|
+
): Channel<
|
|
5682
|
+
OutElem | OutElem1 | OutElem2,
|
|
5683
|
+
OutErr1 | OutErr2,
|
|
5684
|
+
OutDone | OutDone1 | OutDone2,
|
|
5685
|
+
InElem & InElem1 & InElem2,
|
|
5686
|
+
InErr & InErr1 & InErr2,
|
|
5687
|
+
InDone & InDone1 & InDone2,
|
|
5688
|
+
Env | Env1 | Env2
|
|
5689
|
+
> =>
|
|
5690
|
+
catch_(
|
|
5691
|
+
self,
|
|
5692
|
+
(err): Channel<
|
|
5693
|
+
OutElem1 | OutElem2,
|
|
5694
|
+
OutErr1 | OutErr2,
|
|
5695
|
+
OutDone1 | OutDone2,
|
|
5696
|
+
InElem1 & InElem2,
|
|
5697
|
+
InErr1 & InErr2,
|
|
5698
|
+
InDone1 & InDone2,
|
|
5699
|
+
Env1 | Env2
|
|
5700
|
+
> => {
|
|
5701
|
+
const result = filter(err)
|
|
5702
|
+
return Result.isFailure(result)
|
|
5703
|
+
? orElse
|
|
5704
|
+
? orElse(result.failure)
|
|
5705
|
+
: fail(result.failure as any) as any
|
|
5706
|
+
: f(result.success)
|
|
5291
5707
|
}
|
|
5292
5708
|
))
|
|
5293
5709
|
|
|
@@ -5528,11 +5944,13 @@ export const catchReason: {
|
|
|
5528
5944
|
errorTag: K,
|
|
5529
5945
|
reasonTag: RK,
|
|
5530
5946
|
f: (
|
|
5531
|
-
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
5947
|
+
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
5948
|
+
error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5532
5949
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5533
5950
|
orElse?:
|
|
5534
5951
|
| ((
|
|
5535
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
5952
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
5953
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5536
5954
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5537
5955
|
| undefined
|
|
5538
5956
|
): <
|
|
@@ -5615,11 +6033,13 @@ export const catchReason: {
|
|
|
5615
6033
|
errorTag: K,
|
|
5616
6034
|
reasonTag: RK,
|
|
5617
6035
|
f: (
|
|
5618
|
-
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6036
|
+
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6037
|
+
error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5619
6038
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5620
6039
|
orElse?:
|
|
5621
6040
|
| ((
|
|
5622
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6041
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6042
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5623
6043
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5624
6044
|
| undefined
|
|
5625
6045
|
): Channel<
|
|
@@ -5660,11 +6080,13 @@ export const catchReason: {
|
|
|
5660
6080
|
errorTag: K,
|
|
5661
6081
|
reasonTag: RK,
|
|
5662
6082
|
f: (
|
|
5663
|
-
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6083
|
+
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6084
|
+
error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5664
6085
|
) => Channel<OutElem1, OutErr1, OutDone1, InElem1, InErr1, InDone1, Env1>,
|
|
5665
6086
|
orElse?:
|
|
5666
6087
|
| ((
|
|
5667
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6088
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6089
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5668
6090
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5669
6091
|
| undefined
|
|
5670
6092
|
): Channel<
|
|
@@ -5690,9 +6112,9 @@ export const catchReason: {
|
|
|
5690
6112
|
if (isTagged(error, errorTag) && hasProperty(error, "reason")) {
|
|
5691
6113
|
const reason = error.reason as Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5692
6114
|
if (isTagged(reason, reasonTag)) {
|
|
5693
|
-
return f(reason as any)
|
|
6115
|
+
return f(reason as any, error as any)
|
|
5694
6116
|
}
|
|
5695
|
-
return orElse ? orElse(reason) as any : fail(error) as any
|
|
6117
|
+
return orElse ? orElse(reason, error as any) as any : fail(error) as any
|
|
5696
6118
|
}
|
|
5697
6119
|
return fail(error) as any
|
|
5698
6120
|
}
|
|
@@ -5716,7 +6138,8 @@ export const catchReasons: {
|
|
|
5716
6138
|
OutErr,
|
|
5717
6139
|
Cases extends {
|
|
5718
6140
|
[RK in Types.ReasonTags<Types.ExtractTag<Types.NoInfer<OutErr>, K>>]+?: (
|
|
5719
|
-
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK
|
|
6141
|
+
reason: Types.ExtractReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>,
|
|
6142
|
+
error: Types.NarrowReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, RK>
|
|
5720
6143
|
) => Channel<any, any, any, any, any, any, any>
|
|
5721
6144
|
},
|
|
5722
6145
|
OutElem2 = Types.unassigned,
|
|
@@ -5731,7 +6154,8 @@ export const catchReasons: {
|
|
|
5731
6154
|
cases: Cases,
|
|
5732
6155
|
orElse?:
|
|
5733
6156
|
| ((
|
|
5734
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string
|
|
6157
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>,
|
|
6158
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>
|
|
5735
6159
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5736
6160
|
| undefined
|
|
5737
6161
|
): <OutElem, OutDone, InElem, InErr, InDone, Env>(
|
|
@@ -5797,7 +6221,8 @@ export const catchReasons: {
|
|
|
5797
6221
|
K extends Types.Tags<OutErr>,
|
|
5798
6222
|
Cases extends {
|
|
5799
6223
|
[RK in Types.ReasonTags<Types.ExtractTag<OutErr, K>>]+?: (
|
|
5800
|
-
reason: Types.ExtractReason<Types.ExtractTag<OutErr, K>, RK
|
|
6224
|
+
reason: Types.ExtractReason<Types.ExtractTag<OutErr, K>, RK>,
|
|
6225
|
+
error: Types.NarrowReason<Types.ExtractTag<OutErr, K>, RK>
|
|
5801
6226
|
) => Channel<any, any, any, any, any, any, any>
|
|
5802
6227
|
},
|
|
5803
6228
|
OutElem2 = Types.unassigned,
|
|
@@ -5813,7 +6238,8 @@ export const catchReasons: {
|
|
|
5813
6238
|
cases: Cases,
|
|
5814
6239
|
orElse?:
|
|
5815
6240
|
| ((
|
|
5816
|
-
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string
|
|
6241
|
+
reason: Types.ExcludeReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>,
|
|
6242
|
+
error: Types.OmitReason<Types.ExtractTag<Types.NoInfer<OutErr>, K>, Extract<keyof Cases, string>>
|
|
5817
6243
|
) => Channel<OutElem2, OutErr2, OutDone2, InElem2, InErr2, InDone2, Env2>)
|
|
5818
6244
|
| undefined
|
|
5819
6245
|
): Channel<
|
|
@@ -5862,7 +6288,7 @@ export const catchReasons: {
|
|
|
5862
6288
|
>
|
|
5863
6289
|
} = dual((args) => isChannel(args[0]), (self, errorTag, cases, orElse) => {
|
|
5864
6290
|
let keys: Set<string>
|
|
5865
|
-
return catch_(self, (error
|
|
6291
|
+
return catch_(self, (error) => {
|
|
5866
6292
|
if (
|
|
5867
6293
|
isTagged(error, errorTag) &&
|
|
5868
6294
|
hasProperty(error, "reason") &&
|
|
@@ -5872,9 +6298,9 @@ export const catchReasons: {
|
|
|
5872
6298
|
const reason = error.reason as { readonly _tag: string }
|
|
5873
6299
|
keys ??= new Set(Object.keys(cases))
|
|
5874
6300
|
if (keys.has(reason._tag)) {
|
|
5875
|
-
return (cases as any)[reason._tag](reason as any)
|
|
6301
|
+
return (cases as any)[reason._tag](reason as any, error)
|
|
5876
6302
|
}
|
|
5877
|
-
return orElse ? orElse(reason) as any : fail(error) as any
|
|
6303
|
+
return orElse ? orElse(reason, error) as any : fail(error) as any
|
|
5878
6304
|
}
|
|
5879
6305
|
return fail(error) as any
|
|
5880
6306
|
})
|
|
@@ -6024,11 +6450,11 @@ export const unwrapReason: {
|
|
|
6024
6450
|
InDone,
|
|
6025
6451
|
Env
|
|
6026
6452
|
> =>
|
|
6027
|
-
|
|
6453
|
+
catchFilter(
|
|
6028
6454
|
self,
|
|
6029
|
-
(error
|
|
6455
|
+
(error) =>
|
|
6030
6456
|
isTagged(error, errorTag) && hasProperty(error, "reason") ? Result.succeed(error.reason) : Result.fail(error),
|
|
6031
|
-
fail
|
|
6457
|
+
fail
|
|
6032
6458
|
) as any)
|
|
6033
6459
|
|
|
6034
6460
|
/**
|
|
@@ -6114,14 +6540,14 @@ export const orDie = <
|
|
|
6114
6540
|
*/
|
|
6115
6541
|
export const ignore: <
|
|
6116
6542
|
Arg extends Channel<any, any, any, any, any, any, any> | {
|
|
6117
|
-
readonly log?: boolean |
|
|
6543
|
+
readonly log?: boolean | Severity | undefined
|
|
6118
6544
|
} | undefined = {
|
|
6119
|
-
readonly log?: boolean |
|
|
6545
|
+
readonly log?: boolean | Severity | undefined
|
|
6120
6546
|
}
|
|
6121
6547
|
>(
|
|
6122
6548
|
selfOrOptions: Arg,
|
|
6123
6549
|
options?: {
|
|
6124
|
-
readonly log?: boolean |
|
|
6550
|
+
readonly log?: boolean | Severity | undefined
|
|
6125
6551
|
} | undefined
|
|
6126
6552
|
) => [Arg] extends
|
|
6127
6553
|
[Channel<infer OutElem, infer _OutErr, infer OutDone, infer InElem, infer InErr, infer InDone, infer Env>]
|
|
@@ -6133,7 +6559,7 @@ export const ignore: <
|
|
|
6133
6559
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
6134
6560
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
6135
6561
|
options?: {
|
|
6136
|
-
readonly log?: boolean |
|
|
6562
|
+
readonly log?: boolean | Severity | undefined
|
|
6137
6563
|
} | undefined
|
|
6138
6564
|
): Channel<OutElem, never, OutDone | void, InElem, InErr, InDone, Env> => {
|
|
6139
6565
|
if (!options?.log) {
|
|
@@ -6169,14 +6595,14 @@ const ignoreCause_ = <
|
|
|
6169
6595
|
*/
|
|
6170
6596
|
export const ignoreCause: <
|
|
6171
6597
|
Arg extends Channel<any, any, any, any, any, any, any> | {
|
|
6172
|
-
readonly log?: boolean |
|
|
6598
|
+
readonly log?: boolean | Severity | undefined
|
|
6173
6599
|
} | undefined = {
|
|
6174
|
-
readonly log?: boolean |
|
|
6600
|
+
readonly log?: boolean | Severity | undefined
|
|
6175
6601
|
}
|
|
6176
6602
|
>(
|
|
6177
6603
|
selfOrOptions: Arg,
|
|
6178
6604
|
options?: {
|
|
6179
|
-
readonly log?: boolean |
|
|
6605
|
+
readonly log?: boolean | Severity | undefined
|
|
6180
6606
|
} | undefined
|
|
6181
6607
|
) => [Arg] extends
|
|
6182
6608
|
[Channel<infer OutElem, infer _OutErr, infer OutDone, infer InElem, infer InErr, infer InDone, infer Env>]
|
|
@@ -6187,7 +6613,7 @@ export const ignoreCause: <
|
|
|
6187
6613
|
(args) => isChannel(args[0]),
|
|
6188
6614
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
6189
6615
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
6190
|
-
options?: { readonly log?: boolean |
|
|
6616
|
+
options?: { readonly log?: boolean | Severity | undefined } | undefined
|
|
6191
6617
|
): Channel<OutElem, never, OutDone | void, InElem, InErr, InDone, Env> => {
|
|
6192
6618
|
if (!options?.log) return ignoreCause_(self)
|
|
6193
6619
|
const logEffect = Effect.logWithLevel(options.log === true ? undefined : options.log)
|
|
@@ -7077,6 +7503,29 @@ export const mergeEffect: {
|
|
|
7077
7503
|
) as any)
|
|
7078
7504
|
|
|
7079
7505
|
/**
|
|
7506
|
+
* Splits upstream string chunks into lines, recognizing `\n`, `\r\n`, and
|
|
7507
|
+
* standalone `\r` as line terminators. The behavior matches
|
|
7508
|
+
* `String.linesIterator` regardless of how the input is chunked.
|
|
7509
|
+
*
|
|
7510
|
+
* A line terminator at the very end of the stream does **not** produce a
|
|
7511
|
+
* trailing empty line (consistent with `String.linesIterator`). Conversely,
|
|
7512
|
+
* if the stream ends without a terminator the final partial line is still
|
|
7513
|
+
* emitted.
|
|
7514
|
+
*
|
|
7515
|
+
* **Example**
|
|
7516
|
+
*
|
|
7517
|
+
* ```ts
|
|
7518
|
+
* import { Effect, Stream } from "effect"
|
|
7519
|
+
*
|
|
7520
|
+
* Effect.runPromise(Effect.gen(function*() {
|
|
7521
|
+
* const result = yield* Stream.runCollect(
|
|
7522
|
+
* Stream.splitLines(Stream.make("hel", "lo\r\nwor", "ld\n"))
|
|
7523
|
+
* )
|
|
7524
|
+
* console.log(result)
|
|
7525
|
+
* // [ 'hello', 'world' ]
|
|
7526
|
+
* }))
|
|
7527
|
+
* ```
|
|
7528
|
+
*
|
|
7080
7529
|
* @since 2.0.0
|
|
7081
7530
|
* @category String manipulation
|
|
7082
7531
|
*/
|
|
@@ -7090,11 +7539,30 @@ export const splitLines = <Err, Done>(): Channel<
|
|
|
7090
7539
|
> =>
|
|
7091
7540
|
fromTransform((upstream, _scope) =>
|
|
7092
7541
|
Effect.sync(() => {
|
|
7542
|
+
// Accumulates text that has not yet been terminated by a line break.
|
|
7543
|
+
// Content is carried across chunks until a terminator is found.
|
|
7093
7544
|
let stringBuilder = ""
|
|
7545
|
+
// Set when a chunk ends with \r so the next chunk can check whether
|
|
7546
|
+
// the following character is \n (completing a \r\n pair) or not
|
|
7547
|
+
// (standalone \r, which is itself a line terminator).
|
|
7094
7548
|
let midCRLF = false
|
|
7549
|
+
// Remembers the upstream Done value after the first time the upstream
|
|
7550
|
+
// signals completion, so subsequent pulls return Done immediately
|
|
7551
|
+
// without pulling upstream again.
|
|
7552
|
+
let done = Option.none<Done>()
|
|
7095
7553
|
|
|
7096
|
-
|
|
7554
|
+
function splitLinesArray(chunk: Arr.NonEmptyReadonlyArray<string>): Arr.NonEmptyReadonlyArray<string> | null {
|
|
7097
7555
|
const chunkBuilder: Array<string> = []
|
|
7556
|
+
|
|
7557
|
+
function pushLine(segment: string): void {
|
|
7558
|
+
if (stringBuilder.length === 0) {
|
|
7559
|
+
chunkBuilder.push(segment)
|
|
7560
|
+
} else {
|
|
7561
|
+
chunkBuilder.push(stringBuilder + segment)
|
|
7562
|
+
stringBuilder = ""
|
|
7563
|
+
}
|
|
7564
|
+
}
|
|
7565
|
+
|
|
7098
7566
|
for (let i = 0; i < chunk.length; i++) {
|
|
7099
7567
|
const str = chunk[i]
|
|
7100
7568
|
if (str.length !== 0) {
|
|
@@ -7103,23 +7571,17 @@ export const splitLines = <Err, Done>(): Channel<
|
|
|
7103
7571
|
let indexOfLF = str.indexOf("\n")
|
|
7104
7572
|
if (midCRLF) {
|
|
7105
7573
|
if (indexOfLF === 0) {
|
|
7106
|
-
|
|
7107
|
-
stringBuilder = ""
|
|
7574
|
+
pushLine("")
|
|
7108
7575
|
from = 1
|
|
7109
7576
|
indexOfLF = str.indexOf("\n", from)
|
|
7110
7577
|
} else {
|
|
7111
|
-
|
|
7578
|
+
pushLine("")
|
|
7112
7579
|
}
|
|
7113
7580
|
midCRLF = false
|
|
7114
7581
|
}
|
|
7115
7582
|
while (indexOfCR !== -1 || indexOfLF !== -1) {
|
|
7116
7583
|
if (indexOfCR === -1 || (indexOfLF !== -1 && indexOfLF < indexOfCR)) {
|
|
7117
|
-
|
|
7118
|
-
chunkBuilder.push(str.substring(from, indexOfLF))
|
|
7119
|
-
} else {
|
|
7120
|
-
chunkBuilder.push(stringBuilder + str.substring(from, indexOfLF))
|
|
7121
|
-
stringBuilder = ""
|
|
7122
|
-
}
|
|
7584
|
+
pushLine(str.substring(from, indexOfLF))
|
|
7123
7585
|
from = indexOfLF + 1
|
|
7124
7586
|
indexOfLF = str.indexOf("\n", from)
|
|
7125
7587
|
} else {
|
|
@@ -7127,40 +7589,45 @@ export const splitLines = <Err, Done>(): Channel<
|
|
|
7127
7589
|
midCRLF = true
|
|
7128
7590
|
indexOfCR = -1
|
|
7129
7591
|
} else {
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
stringBuilder = stringBuilder + str.substring(from, indexOfCR)
|
|
7135
|
-
chunkBuilder.push(stringBuilder)
|
|
7136
|
-
stringBuilder = ""
|
|
7137
|
-
}
|
|
7138
|
-
from = indexOfCR + 2
|
|
7139
|
-
indexOfCR = str.indexOf("\r", from)
|
|
7140
|
-
indexOfLF = str.indexOf("\n", from)
|
|
7141
|
-
} else {
|
|
7142
|
-
indexOfCR = str.indexOf("\r", indexOfCR + 1)
|
|
7143
|
-
}
|
|
7592
|
+
pushLine(str.substring(from, indexOfCR))
|
|
7593
|
+
from = indexOfCR + (indexOfLF === indexOfCR + 1 ? 2 : 1)
|
|
7594
|
+
indexOfCR = str.indexOf("\r", from)
|
|
7595
|
+
indexOfLF = str.indexOf("\n", from)
|
|
7144
7596
|
}
|
|
7145
7597
|
}
|
|
7146
7598
|
}
|
|
7147
|
-
|
|
7148
|
-
stringBuilder = stringBuilder + str.substring(from, str.length - 1)
|
|
7149
|
-
} else {
|
|
7150
|
-
stringBuilder = stringBuilder + str.substring(from, str.length)
|
|
7151
|
-
}
|
|
7599
|
+
stringBuilder = stringBuilder + str.substring(from, str.length - (midCRLF ? 1 : 0))
|
|
7152
7600
|
}
|
|
7153
7601
|
}
|
|
7154
7602
|
return Arr.isReadonlyArrayNonEmpty(chunkBuilder) ? chunkBuilder : null
|
|
7155
7603
|
}
|
|
7156
7604
|
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
const lines = splitLinesArray(chunk)
|
|
7161
|
-
return lines !== null ? Effect.succeed(lines) : Effect.flatMap(upstream, loop)
|
|
7605
|
+
const pullOrFlush: Pull.Pull<Arr.NonEmptyReadonlyArray<string>, Err, Done> = Effect.suspend(() => {
|
|
7606
|
+
if (done._tag === "Some") {
|
|
7607
|
+
return Cause.done(done.value)
|
|
7162
7608
|
}
|
|
7163
|
-
|
|
7609
|
+
return Pull.matchEffect(upstream, {
|
|
7610
|
+
onSuccess: loop,
|
|
7611
|
+
onFailure: Effect.failCause,
|
|
7612
|
+
onDone: (leftover) => {
|
|
7613
|
+
done = Option.some(leftover)
|
|
7614
|
+
if (stringBuilder.length > 0 || midCRLF) {
|
|
7615
|
+
const last = stringBuilder
|
|
7616
|
+
stringBuilder = ""
|
|
7617
|
+
midCRLF = false
|
|
7618
|
+
return Effect.succeed([last] as Arr.NonEmptyReadonlyArray<string>)
|
|
7619
|
+
}
|
|
7620
|
+
return Cause.done(leftover)
|
|
7621
|
+
}
|
|
7622
|
+
})
|
|
7623
|
+
})
|
|
7624
|
+
|
|
7625
|
+
function loop(chunk: Arr.NonEmptyReadonlyArray<string>): Pull.Pull<Arr.NonEmptyReadonlyArray<string>, Err, Done> {
|
|
7626
|
+
const lines = splitLinesArray(chunk)
|
|
7627
|
+
return lines !== null ? Effect.succeed(lines) : pullOrFlush
|
|
7628
|
+
}
|
|
7629
|
+
|
|
7630
|
+
return pullOrFlush
|
|
7164
7631
|
})
|
|
7165
7632
|
)
|
|
7166
7633
|
|
|
@@ -7172,7 +7639,7 @@ export const decodeText = <Err, Done>(encoding?: string, options?: TextDecoderOp
|
|
|
7172
7639
|
Arr.NonEmptyReadonlyArray<string>,
|
|
7173
7640
|
Err,
|
|
7174
7641
|
Done,
|
|
7175
|
-
Arr.NonEmptyReadonlyArray<Uint8Array
|
|
7642
|
+
Arr.NonEmptyReadonlyArray<Uint8Array>,
|
|
7176
7643
|
Err,
|
|
7177
7644
|
Done
|
|
7178
7645
|
> =>
|
|
@@ -7188,7 +7655,7 @@ export const decodeText = <Err, Done>(encoding?: string, options?: TextDecoderOp
|
|
|
7188
7655
|
* @category String manipulation
|
|
7189
7656
|
*/
|
|
7190
7657
|
export const encodeText = <Err, Done>(): Channel<
|
|
7191
|
-
Arr.NonEmptyReadonlyArray<Uint8Array
|
|
7658
|
+
Arr.NonEmptyReadonlyArray<Uint8Array>,
|
|
7192
7659
|
Err,
|
|
7193
7660
|
Done,
|
|
7194
7661
|
Arr.NonEmptyReadonlyArray<string>,
|
|
@@ -7198,7 +7665,7 @@ export const encodeText = <Err, Done>(): Channel<
|
|
|
7198
7665
|
fromTransform((upstream, _scope) =>
|
|
7199
7666
|
Effect.sync(() => {
|
|
7200
7667
|
const encoder = new TextEncoder()
|
|
7201
|
-
return Effect.map(upstream, Arr.map((line) => encoder.encode(line)
|
|
7668
|
+
return Effect.map(upstream, Arr.map((line) => encoder.encode(line)))
|
|
7202
7669
|
})
|
|
7203
7670
|
)
|
|
7204
7671
|
|
|
@@ -8151,35 +8618,35 @@ const runWith = <
|
|
|
8151
8618
|
* @since 2.0.0
|
|
8152
8619
|
* @category Services
|
|
8153
8620
|
*/
|
|
8154
|
-
export const
|
|
8155
|
-
f: (
|
|
8621
|
+
export const contextWith = <Env, OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2>(
|
|
8622
|
+
f: (context: Context.Context<Env>) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env2>
|
|
8156
8623
|
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env | Env2> =>
|
|
8157
8624
|
fromTransform((upstream, scope) =>
|
|
8158
|
-
Effect.
|
|
8625
|
+
Effect.contextWith((context: Context.Context<Env>) => toTransform(f(context))(upstream, scope))
|
|
8159
8626
|
)
|
|
8160
8627
|
|
|
8161
8628
|
/**
|
|
8162
|
-
* Provides a layer or
|
|
8629
|
+
* Provides a layer or context to the channel, removing the corresponding
|
|
8163
8630
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
8164
8631
|
* default, layers are shared between provide calls.
|
|
8165
8632
|
*
|
|
8166
8633
|
* @since 4.0.0
|
|
8167
8634
|
* @category Services
|
|
8168
8635
|
*/
|
|
8169
|
-
export const
|
|
8636
|
+
export const provideContext: {
|
|
8170
8637
|
/**
|
|
8171
|
-
* Provides a layer or
|
|
8638
|
+
* Provides a layer or context to the channel, removing the corresponding
|
|
8172
8639
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
8173
8640
|
* default, layers are shared between provide calls.
|
|
8174
8641
|
*
|
|
8175
8642
|
* @since 4.0.0
|
|
8176
8643
|
* @category Services
|
|
8177
8644
|
*/
|
|
8178
|
-
<R2>(
|
|
8645
|
+
<R2>(context: Context.Context<R2>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
8179
8646
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
8180
8647
|
) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, R2>>
|
|
8181
8648
|
/**
|
|
8182
|
-
* Provides a layer or
|
|
8649
|
+
* Provides a layer or context to the channel, removing the corresponding
|
|
8183
8650
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
8184
8651
|
* default, layers are shared between provide calls.
|
|
8185
8652
|
*
|
|
@@ -8188,16 +8655,16 @@ export const provideServices: {
|
|
|
8188
8655
|
*/
|
|
8189
8656
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, R2>(
|
|
8190
8657
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8191
|
-
|
|
8658
|
+
context: Context.Context<R2>
|
|
8192
8659
|
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, R2>>
|
|
8193
8660
|
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, R2>(
|
|
8194
8661
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8195
|
-
|
|
8662
|
+
context: Context.Context<R2>
|
|
8196
8663
|
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, R2>> =>
|
|
8197
8664
|
fromTransform((upstream, scope) =>
|
|
8198
8665
|
Effect.map(
|
|
8199
|
-
Effect.
|
|
8200
|
-
Effect.
|
|
8666
|
+
Effect.provideContext(toTransform(self)(upstream, scope), context),
|
|
8667
|
+
Effect.provideContext(context)
|
|
8201
8668
|
)
|
|
8202
8669
|
))
|
|
8203
8670
|
|
|
@@ -8210,7 +8677,7 @@ export const provideService: {
|
|
|
8210
8677
|
* @since 4.0.0
|
|
8211
8678
|
* @category Services
|
|
8212
8679
|
*/
|
|
8213
|
-
<I, S>(key:
|
|
8680
|
+
<I, S>(key: Context.Key<I, S>, service: NoInfer<S>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
8214
8681
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
8215
8682
|
) => Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>>
|
|
8216
8683
|
/**
|
|
@@ -8219,12 +8686,12 @@ export const provideService: {
|
|
|
8219
8686
|
*/
|
|
8220
8687
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
|
|
8221
8688
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8222
|
-
key:
|
|
8689
|
+
key: Context.Key<I, S>,
|
|
8223
8690
|
service: NoInfer<S>
|
|
8224
8691
|
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>>
|
|
8225
8692
|
} = dual(3, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
|
|
8226
8693
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8227
|
-
key:
|
|
8694
|
+
key: Context.Key<I, S>,
|
|
8228
8695
|
service: NoInfer<S>
|
|
8229
8696
|
): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Exclude<Env, I>> =>
|
|
8230
8697
|
fromTransform((upstream, scope) =>
|
|
@@ -8243,7 +8710,7 @@ export const provideServiceEffect: {
|
|
|
8243
8710
|
* @since 4.0.0
|
|
8244
8711
|
* @category Services
|
|
8245
8712
|
*/
|
|
8246
|
-
<I, S, ES, RS>(key:
|
|
8713
|
+
<I, S, ES, RS>(key: Context.Key<I, S>, service: Effect.Effect<NoInfer<S>, ES, RS>): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
8247
8714
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>
|
|
8248
8715
|
) => Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS>
|
|
8249
8716
|
/**
|
|
@@ -8252,12 +8719,12 @@ export const provideServiceEffect: {
|
|
|
8252
8719
|
*/
|
|
8253
8720
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S, ES, RS>(
|
|
8254
8721
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8255
|
-
key:
|
|
8722
|
+
key: Context.Key<I, S>,
|
|
8256
8723
|
service: Effect.Effect<NoInfer<S>, ES, RS>
|
|
8257
8724
|
): Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS>
|
|
8258
8725
|
} = dual(3, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S, ES, RS>(
|
|
8259
8726
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8260
|
-
key:
|
|
8727
|
+
key: Context.Key<I, S>,
|
|
8261
8728
|
service: Effect.Effect<NoInfer<S>, ES, RS>
|
|
8262
8729
|
): Channel<OutElem, OutErr | ES, OutDone, InElem, InErr, InDone, Exclude<Env, I> | RS> =>
|
|
8263
8730
|
fromTransform((upstream, scope) =>
|
|
@@ -8277,7 +8744,7 @@ export const provide: {
|
|
|
8277
8744
|
* @category Services
|
|
8278
8745
|
*/
|
|
8279
8746
|
<A, E = never, R = never>(
|
|
8280
|
-
layer: Layer.Layer<A, E, R> |
|
|
8747
|
+
layer: Layer.Layer<A, E, R> | Context.Context<A>,
|
|
8281
8748
|
options?: {
|
|
8282
8749
|
readonly local?: boolean | undefined
|
|
8283
8750
|
} | undefined
|
|
@@ -8290,27 +8757,27 @@ export const provide: {
|
|
|
8290
8757
|
*/
|
|
8291
8758
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, A, E = never, R = never>(
|
|
8292
8759
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8293
|
-
layer: Layer.Layer<A, E, R> |
|
|
8760
|
+
layer: Layer.Layer<A, E, R> | Context.Context<A>,
|
|
8294
8761
|
options?: {
|
|
8295
8762
|
readonly local?: boolean | undefined
|
|
8296
8763
|
} | undefined
|
|
8297
8764
|
): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Exclude<Env, A> | R>
|
|
8298
8765
|
} = dual((args) => isChannel(args[0]), <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, A, E = never, R = never>(
|
|
8299
8766
|
self: Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>,
|
|
8300
|
-
layer: Layer.Layer<A, E, R> |
|
|
8767
|
+
layer: Layer.Layer<A, E, R> | Context.Context<A>,
|
|
8301
8768
|
options?: {
|
|
8302
8769
|
readonly local?: boolean | undefined
|
|
8303
8770
|
} | undefined
|
|
8304
8771
|
): Channel<OutElem, OutErr | E, OutDone, InElem, InErr, InDone, Exclude<Env, A> | R> =>
|
|
8305
|
-
|
|
8772
|
+
Context.isContext(layer) ? provideContext(self, layer) : fromTransform((upstream, scope) =>
|
|
8306
8773
|
Effect.flatMap(
|
|
8307
8774
|
options?.local
|
|
8308
8775
|
? Layer.buildWithMemoMap(layer, Layer.makeMemoMapUnsafe(), scope)
|
|
8309
8776
|
: Layer.buildWithScope(layer, scope),
|
|
8310
|
-
(
|
|
8777
|
+
(context) =>
|
|
8311
8778
|
Effect.map(
|
|
8312
|
-
Effect.
|
|
8313
|
-
Effect.
|
|
8779
|
+
Effect.provideContext(toTransform(self)(upstream, scope), context),
|
|
8780
|
+
Effect.provideContext(context)
|
|
8314
8781
|
)
|
|
8315
8782
|
)
|
|
8316
8783
|
))
|
|
@@ -8319,12 +8786,12 @@ export const provide: {
|
|
|
8319
8786
|
* @since 2.0.0
|
|
8320
8787
|
* @category Services
|
|
8321
8788
|
*/
|
|
8322
|
-
export const
|
|
8789
|
+
export const updateContext: {
|
|
8323
8790
|
/**
|
|
8324
8791
|
* @since 2.0.0
|
|
8325
8792
|
* @category Services
|
|
8326
8793
|
*/
|
|
8327
|
-
<Env, R2>(f: (
|
|
8794
|
+
<Env, R2>(f: (context: Context.Context<R2>) => Context.Context<Env>): <OutElem, OutErr, OutDone, InElem, InErr, InDone>(
|
|
8328
8795
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
8329
8796
|
) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R2>
|
|
8330
8797
|
/**
|
|
@@ -8333,16 +8800,16 @@ export const updateServices: {
|
|
|
8333
8800
|
*/
|
|
8334
8801
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, R2>(
|
|
8335
8802
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
8336
|
-
f: (
|
|
8803
|
+
f: (context: Context.Context<R2>) => Context.Context<Env>
|
|
8337
8804
|
): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R2>
|
|
8338
8805
|
} = dual(2, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, R2>(
|
|
8339
8806
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
8340
|
-
f: (
|
|
8807
|
+
f: (context: Context.Context<R2>) => Context.Context<Env>
|
|
8341
8808
|
): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, R2> =>
|
|
8342
8809
|
fromTransform((upstream, scope) =>
|
|
8343
|
-
Effect.
|
|
8344
|
-
const toProvide = f(
|
|
8345
|
-
return toTransform(
|
|
8810
|
+
Effect.contextWith((context) => {
|
|
8811
|
+
const toProvide = f(context)
|
|
8812
|
+
return toTransform(provideContext(self, toProvide))(upstream, scope)
|
|
8346
8813
|
})
|
|
8347
8814
|
))
|
|
8348
8815
|
|
|
@@ -8355,7 +8822,7 @@ export const updateService: {
|
|
|
8355
8822
|
* @since 2.0.0
|
|
8356
8823
|
* @category Services
|
|
8357
8824
|
*/
|
|
8358
|
-
<I, S>(key:
|
|
8825
|
+
<I, S>(key: Context.Key<I, S>, f: (service: NoInfer<S>) => S): <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
|
|
8359
8826
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
8360
8827
|
) => Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I>
|
|
8361
8828
|
/**
|
|
@@ -8364,19 +8831,19 @@ export const updateService: {
|
|
|
8364
8831
|
*/
|
|
8365
8832
|
<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
|
|
8366
8833
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
8367
|
-
service:
|
|
8834
|
+
service: Context.Key<I, S>,
|
|
8368
8835
|
f: (service: NoInfer<S>) => S
|
|
8369
8836
|
): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I>
|
|
8370
8837
|
} = dual(3, <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env, I, S>(
|
|
8371
8838
|
self: Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
8372
|
-
service:
|
|
8839
|
+
service: Context.Key<I, S>,
|
|
8373
8840
|
f: (service: NoInfer<S>) => S
|
|
8374
8841
|
): Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | I> =>
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8842
|
+
updateContext(self, (context) =>
|
|
8843
|
+
Context.add(
|
|
8844
|
+
context,
|
|
8378
8845
|
service,
|
|
8379
|
-
f(
|
|
8846
|
+
f(Context.get(context, service))
|
|
8380
8847
|
)))
|
|
8381
8848
|
|
|
8382
8849
|
/**
|
|
@@ -9088,11 +9555,11 @@ export const toPull: <OutElem, OutErr, OutDone, Env>(
|
|
|
9088
9555
|
self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>
|
|
9089
9556
|
) {
|
|
9090
9557
|
const semaphore = Semaphore.makeUnsafe(1)
|
|
9091
|
-
const context = yield* Effect.
|
|
9092
|
-
const scope =
|
|
9558
|
+
const context = yield* Effect.context<Env | Scope.Scope>()
|
|
9559
|
+
const scope = Context.get(context, Scope.Scope)
|
|
9093
9560
|
const pull = yield* toTransform(self)(Cause.done(), scope)
|
|
9094
9561
|
return pull.pipe(
|
|
9095
|
-
Effect.
|
|
9562
|
+
Effect.provideContext(context),
|
|
9096
9563
|
semaphore.withPermits(1)
|
|
9097
9564
|
)
|
|
9098
9565
|
},
|