effect 4.0.1 → 4.0.2
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/ai-docs/package.json +2 -2
- package/ai-docs/tsconfig.json +2 -1
- package/dist/Array.d.ts +339 -0
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +143 -3
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +88 -0
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +44 -0
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +68 -0
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +36 -0
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +34 -0
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +18 -0
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +9 -0
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +6 -0
- package/dist/Brand.js.map +1 -1
- package/dist/ByteSize.d.ts +86 -0
- package/dist/ByteSize.d.ts.map +1 -1
- package/dist/ByteSize.js +51 -0
- package/dist/ByteSize.js.map +1 -1
- package/dist/Cache.d.ts +38 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +27 -7
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +82 -0
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +60 -0
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +327 -4
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +168 -8
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +11 -0
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +6 -0
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +192 -0
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +78 -0
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +7 -0
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +5 -0
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +10 -0
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +8 -0
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +52 -12
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +55 -5
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +28 -0
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +19 -0
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +22 -0
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +20 -0
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +50 -0
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +21 -0
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +16 -0
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +26 -1
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +5 -0
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +3 -0
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +13 -0
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +5 -0
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +171 -0
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +89 -0
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +51 -0
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +22 -0
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Differ.js +1 -0
- package/dist/Duration.d.ts +90 -0
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +53 -0
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +527 -0
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +240 -5
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +4 -0
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -0
- package/dist/Effectable.js.map +1 -1
- package/dist/Equal.d.ts +8 -0
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +9 -1
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +21 -0
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +16 -0
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +36 -0
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +11 -0
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +49 -8
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +7 -0
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +40 -0
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +27 -0
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +20 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +11 -0
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +21 -0
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +21 -4
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +35 -0
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +19 -0
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +20 -0
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +14 -0
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +15 -0
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +8 -0
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +55 -0
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +28 -0
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +3 -0
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +39 -1
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +30 -0
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +20 -0
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +247 -12
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +149 -28
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +5 -0
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +14 -0
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +12 -0
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +91 -0
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +39 -0
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +17 -0
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +9 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +49 -0
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +19 -0
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +7 -0
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +6 -0
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +127 -0
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +51 -0
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +4 -0
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +3 -0
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +5 -0
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +5 -0
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +16 -0
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +11 -0
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +14 -0
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +10 -0
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +100 -0
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +45 -1
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +7 -0
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +4 -0
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +5 -0
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +3 -0
- package/dist/LayerRef.js.map +1 -1
- package/dist/LogLevel.d.ts +20 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +9 -0
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +25 -0
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +30 -4
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +5 -0
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +9 -1
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +51 -0
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +39 -0
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +59 -0
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +31 -0
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +32 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +16 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +16 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +10 -0
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +20 -0
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +18 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +31 -0
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +17 -0
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +9 -0
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -0
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +4 -0
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +2 -0
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +61 -0
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +31 -0
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +41 -0
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +20 -0
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +134 -0
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +61 -0
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +29 -0
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +24 -0
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +7 -0
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +3 -0
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +24 -0
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +47 -21
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +6 -0
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +4 -0
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +7 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +5 -0
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +8 -0
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +7 -0
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +19 -0
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +8 -1
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +84 -0
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +48 -0
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +5 -0
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +4 -0
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +67 -5
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +60 -8
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +20 -0
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +10 -0
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +60 -0
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +58 -8
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +13 -0
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +9 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +23 -0
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +8 -0
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +6 -0
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +3 -0
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +100 -0
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +43 -0
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +6 -0
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +4 -0
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +8 -0
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +6 -0
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +4 -0
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +3 -0
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +20 -0
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +16 -0
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +21 -0
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +19 -0
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +3 -0
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +4 -0
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +32 -0
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +12 -0
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +42 -0
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +27 -6
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +6 -0
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +6 -0
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +91 -0
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +41 -0
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +9 -0
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +7 -0
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +57 -0
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +32 -0
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +7 -0
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +5 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +496 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +280 -1
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +107 -0
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +81 -1
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +69 -2
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +63 -4
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +33 -0
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +18 -0
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +25 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +26 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +147 -0
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +99 -0
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +53 -0
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +46 -0
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +19 -0
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -0
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +34 -0
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +26 -3
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +9 -0
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +6 -0
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +26 -0
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +10 -0
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +125 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +75 -1
- package/dist/Sink.js.map +1 -1
- package/dist/StandardSchema.d.ts +1 -0
- package/dist/StandardSchema.d.ts.map +1 -1
- package/dist/StandardSchema.js +1 -0
- package/dist/Stdio.d.ts +7 -0
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +5 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +558 -0
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +261 -13
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +87 -0
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +61 -0
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +46 -0
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +19 -0
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +65 -0
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +25 -0
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +2 -0
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +2 -0
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +63 -0
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +24 -0
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +3 -0
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +1 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +8 -0
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +4 -0
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +23 -0
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +12 -0
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +68 -0
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +28 -0
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +38 -0
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +18 -0
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +52 -0
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +23 -0
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +15 -0
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +8 -0
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +83 -0
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +52 -7
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +51 -0
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +29 -4
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +30 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +22 -1
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +25 -0
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +19 -0
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +51 -0
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +30 -0
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +24 -0
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +32 -18
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +14 -0
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +7 -0
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +25 -0
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +29 -13
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +25 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +12 -0
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +36 -0
- package/dist/Types.d.ts.map +1 -1
- package/dist/Types.js +1 -0
- package/dist/UndefinedOr.d.ts +15 -0
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +9 -0
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +15 -0
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +2 -0
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +4 -0
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +1 -0
- package/dist/Utils.js.map +1 -1
- package/dist/Version.d.ts +26 -0
- package/dist/Version.d.ts.map +1 -0
- package/dist/Version.js +36 -0
- package/dist/Version.js.map +1 -0
- package/dist/ai/Chat.js +1 -1
- package/dist/ai/Chat.js.map +1 -1
- package/dist/ai/DecisionModel.d.ts +22 -0
- package/dist/ai/DecisionModel.d.ts.map +1 -1
- package/dist/ai/DecisionModel.js +22 -4
- package/dist/ai/DecisionModel.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +14 -13
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpServer.d.ts +32 -11
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +213 -169
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Telemetry.d.ts +49 -41
- package/dist/ai/Telemetry.d.ts.map +1 -1
- package/dist/ai/Telemetry.js +6 -8
- package/dist/ai/Telemetry.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +79 -46
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/ai/internal/mcpStatefulRuntime.js +1 -0
- package/dist/ai/internal/mcpStatefulRuntime.js.map +1 -1
- package/dist/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/cluster/K8sHttpClient.js +5 -2
- package/dist/cluster/K8sHttpClient.js.map +1 -1
- package/dist/encoding/Base64.d.ts +4 -0
- package/dist/encoding/Base64.d.ts.map +1 -1
- package/dist/encoding/Base64.js +4 -0
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts +4 -0
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +4 -0
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/EncodingError.d.ts +4 -0
- package/dist/encoding/EncodingError.d.ts.map +1 -1
- package/dist/encoding/EncodingError.js +4 -0
- package/dist/encoding/EncodingError.js.map +1 -1
- package/dist/encoding/Hex.d.ts +5 -0
- package/dist/encoding/Hex.d.ts.map +1 -1
- package/dist/encoding/Hex.js +5 -0
- package/dist/encoding/Hex.js.map +1 -1
- package/dist/encoding/Toml.js +2 -2
- package/dist/encoding/Toml.js.map +1 -1
- package/dist/encoding/Yaml.d.ts.map +1 -1
- package/dist/encoding/Yaml.js +6 -4
- package/dist/encoding/Yaml.js.map +1 -1
- package/dist/encoding/index.d.ts +4 -0
- package/dist/encoding/index.d.ts.map +1 -1
- package/dist/encoding/index.js +4 -0
- package/dist/encoding/index.js.map +1 -1
- package/dist/eventlog/SqlEventJournal.js +8 -4
- package/dist/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts +27 -10
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.js +49 -7
- package/dist/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/http/Headers.d.ts +3 -1
- package/dist/http/Headers.d.ts.map +1 -1
- package/dist/http/Headers.js +4 -2
- package/dist/http/Headers.js.map +1 -1
- package/dist/http/HttpClient.d.ts +9 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +40 -21
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientResponse.js +3 -1
- package/dist/http/HttpClientResponse.js.map +1 -1
- package/dist/http/HttpEffect.d.ts +3 -0
- package/dist/http/HttpEffect.d.ts.map +1 -1
- package/dist/http/HttpEffect.js +5 -2
- package/dist/http/HttpEffect.js.map +1 -1
- package/dist/http/HttpMiddleware.d.ts +17 -0
- package/dist/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/http/HttpMiddleware.js +56 -39
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpServer.d.ts +1 -1
- package/dist/http/HttpServer.d.ts.map +1 -1
- package/dist/http/internal/tracing.d.ts +2 -0
- package/dist/http/internal/tracing.d.ts.map +1 -0
- package/dist/http/internal/tracing.js +37 -0
- package/dist/http/internal/tracing.js.map +1 -0
- package/dist/http-api/HttpApiBuilder.js +2 -1
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts +12 -3
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiError.d.ts +4 -3
- package/dist/http-api/HttpApiError.d.ts.map +1 -1
- package/dist/http-api/HttpApiError.js +7 -4
- package/dist/http-api/HttpApiError.js.map +1 -1
- package/dist/http-api/HttpApiSecurity.d.ts +8 -8
- package/dist/http-api/HttpApiSecurity.js +8 -8
- package/dist/index.d.ts +155 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +155 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/arbitrary/array.js +3 -3
- package/dist/internal/arbitrary/array.js.map +1 -1
- package/dist/internal/arbitrary/model.js +26 -11
- package/dist/internal/arbitrary/model.js.map +1 -1
- package/dist/internal/arbitrary/runner.js +8 -8
- package/dist/internal/arbitrary/runner.js.map +1 -1
- package/dist/internal/arbitrary/schema.js +4 -5
- package/dist/internal/arbitrary/schema.js.map +1 -1
- package/dist/internal/effect.js +41 -39
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schedule.js +7 -5
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/standardSchema.js +2 -2
- package/dist/internal/schema/standardSchema.js.map +1 -1
- package/dist/internal/version.d.ts +2 -0
- package/dist/internal/version.d.ts.map +1 -0
- package/dist/internal/version.js +3 -0
- package/dist/internal/version.js.map +1 -0
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +5 -6
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +23 -27
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/OtlpMetrics.d.ts +5 -3
- package/dist/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/observability/OtlpMetrics.js +21 -94
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/OtlpResource.d.ts +4 -3
- package/dist/observability/OtlpResource.d.ts.map +1 -1
- package/dist/observability/OtlpResource.js +20 -23
- package/dist/observability/OtlpResource.js.map +1 -1
- package/dist/observability/OtlpTracer.d.ts +1 -0
- package/dist/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/observability/OtlpTracer.js +32 -36
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/observability/internal/otlpProtobuf.js +32 -1
- package/dist/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/reactivity/AsyncResult.d.ts +1 -1
- package/dist/reactivity/Atom.d.ts +5 -5
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +9 -5
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/reactivity/AtomHttpApi.d.ts +2 -2
- package/dist/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/reactivity/AtomRegistry.d.ts +8 -0
- package/dist/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/reactivity/AtomRegistry.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts +21 -3
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +38 -20
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +18 -21
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/rpc/internal/tracing.d.ts +2 -0
- package/dist/rpc/internal/tracing.d.ts.map +1 -0
- package/dist/rpc/internal/tracing.js +18 -0
- package/dist/rpc/internal/tracing.js.map +1 -0
- package/dist/schema/SchemaCompiler/runtime.js +9 -1
- package/dist/schema/SchemaCompiler/runtime.js.map +1 -1
- package/dist/sql/SqlClient.js +4 -4
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/sql/Statement.d.ts +21 -1
- package/dist/sql/Statement.d.ts.map +1 -1
- package/dist/sql/Statement.js +55 -7
- package/dist/sql/Statement.js.map +1 -1
- package/dist/testing/TestClock.d.ts +8 -0
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +7 -0
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +7 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +6 -0
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -1
- package/package.json +3 -3
- package/src/Array.ts +351 -3
- package/src/BigDecimal.ts +88 -0
- package/src/BigInt.ts +68 -0
- package/src/Boolean.ts +34 -0
- package/src/Brand.ts +10 -0
- package/src/ByteSize.ts +87 -0
- package/src/Cache.ts +50 -8
- package/src/Cause.ts +82 -0
- package/src/Channel.ts +368 -18
- package/src/ChannelSchema.ts +13 -0
- package/src/Chunk.ts +193 -0
- package/src/Clock.ts +7 -0
- package/src/Combiner.ts +10 -0
- package/src/Config.ts +82 -8
- package/src/ConfigProvider.ts +28 -0
- package/src/Console.ts +26 -0
- package/src/Context.ts +50 -0
- package/src/Cron.ts +32 -1
- package/src/Crypto.ts +5 -0
- package/src/Data.ts +13 -0
- package/src/DateTime.ts +171 -0
- package/src/Deferred.ts +51 -0
- package/src/Differ.ts +2 -0
- package/src/Duration.ts +90 -0
- package/src/Effect.ts +539 -5
- package/src/Effectable.ts +4 -0
- package/src/Equal.ts +12 -1
- package/src/Equivalence.ts +22 -0
- package/src/ErrorReporter.ts +36 -0
- package/src/ExecutionPlan.ts +58 -14
- package/src/Exit.ts +40 -0
- package/src/Fiber.ts +20 -0
- package/src/FiberHandle.ts +29 -4
- package/src/FiberMap.ts +38 -0
- package/src/FiberSet.ts +21 -0
- package/src/FileSystem.ts +16 -0
- package/src/Filter.ts +55 -0
- package/src/Formatter.ts +42 -1
- package/src/Function.ts +30 -0
- package/src/Graph.ts +317 -36
- package/src/HKT.ts +5 -0
- package/src/Hash.ts +15 -0
- package/src/HashMap.ts +91 -0
- package/src/HashRing.ts +18 -0
- package/src/HashSet.ts +53 -0
- package/src/Inspectable.ts +8 -0
- package/src/Iterable.ts +127 -0
- package/src/JsonPatch.ts +5 -0
- package/src/JsonPointer.ts +5 -0
- package/src/JsonSchema.ts +17 -0
- package/src/Latch.ts +14 -0
- package/src/Layer.ts +101 -1
- package/src/LayerMap.ts +7 -0
- package/src/LayerRef.ts +5 -0
- package/src/LogLevel.ts +20 -0
- package/src/Logger.ts +41 -5
- package/src/ManagedRuntime.ts +12 -1
- package/src/Match.ts +52 -0
- package/src/Metric.ts +69 -0
- package/src/MutableHashMap.ts +44 -0
- package/src/MutableHashSet.ts +17 -0
- package/src/MutableList.ts +21 -0
- package/src/MutableRef.ts +32 -0
- package/src/Newtype.ts +9 -0
- package/src/NonEmptyIterable.ts +4 -0
- package/src/Number.ts +61 -0
- package/src/Optic.ts +57 -0
- package/src/Option.ts +134 -0
- package/src/Order.ts +30 -0
- package/src/Ordering.ts +7 -0
- package/src/PartitionedSemaphore.ts +61 -22
- package/src/Path.ts +6 -0
- package/src/Pipeable.ts +7 -0
- package/src/PlatformError.ts +8 -0
- package/src/Pool.ts +20 -1
- package/src/Predicate.ts +85 -0
- package/src/PrimaryKey.ts +5 -0
- package/src/PubSub.ts +90 -9
- package/src/Pull.ts +20 -0
- package/src/Queue.ts +80 -10
- package/src/Random.ts +13 -0
- package/src/RcMap.ts +23 -0
- package/src/RcRef.ts +6 -0
- package/src/Record.ts +100 -0
- package/src/Redactable.ts +6 -0
- package/src/Redacted.ts +8 -0
- package/src/Reducer.ts +4 -0
- package/src/Ref.ts +42 -0
- package/src/References.ts +21 -0
- package/src/RegExp.ts +4 -0
- package/src/Request.ts +32 -0
- package/src/RequestResolver.ts +59 -10
- package/src/Resource.ts +7 -0
- package/src/Result.ts +93 -0
- package/src/Runtime.ts +10 -0
- package/src/Schedule.ts +61 -0
- package/src/Scheduler.ts +7 -0
- package/src/Schema.ts +499 -4
- package/src/SchemaAST.ts +115 -1
- package/src/SchemaGetter.ts +80 -4
- package/src/SchemaIssue.ts +34 -0
- package/src/SchemaParser.ts +26 -0
- package/src/SchemaRepresentation.ts +148 -0
- package/src/SchemaTransformation.ts +53 -0
- package/src/Scope.ts +19 -0
- package/src/ScopedCache.ts +55 -3
- package/src/ScopedRef.ts +9 -0
- package/src/Semaphore.ts +26 -0
- package/src/Sink.ts +126 -2
- package/src/StandardSchema.ts +1 -0
- package/src/Stdio.ts +7 -0
- package/src/Stream.ts +622 -15
- package/src/String.ts +87 -0
- package/src/Struct.ts +46 -0
- package/src/SubscriptionRef.ts +65 -0
- package/src/Symbol.ts +2 -0
- package/src/SynchronizedRef.ts +63 -0
- package/src/Take.ts +3 -0
- package/src/Terminal.ts +8 -0
- package/src/Tracer.ts +23 -0
- package/src/Trie.ts +68 -0
- package/src/Tuple.ts +38 -0
- package/src/TxChunk.ts +52 -0
- package/src/TxDeferred.ts +15 -0
- package/src/TxHashMap.ts +97 -6
- package/src/TxHashSet.ts +83 -3
- package/src/TxPriorityQueue.ts +34 -2
- package/src/TxPubSub.ts +26 -0
- package/src/TxQueue.ts +51 -0
- package/src/TxReentrantLock.ts +53 -36
- package/src/TxRef.ts +14 -0
- package/src/TxSemaphore.ts +47 -31
- package/src/TxSubscriptionRef.ts +25 -0
- package/src/Types.ts +36 -0
- package/src/UndefinedOr.ts +15 -0
- package/src/Unify.ts +15 -0
- package/src/Utils.ts +4 -0
- package/src/Version.ts +38 -0
- package/src/ai/Chat.ts +1 -1
- package/src/ai/DecisionModel.ts +42 -1
- package/src/ai/LanguageModel.ts +16 -19
- package/src/ai/McpServer.ts +107 -36
- package/src/ai/Telemetry.ts +62 -58
- package/src/ai/internal/mcpRuntime.ts +84 -43
- package/src/ai/internal/mcpStatefulRuntime.ts +2 -0
- package/src/cluster/K8sHttpClient.ts +12 -2
- package/src/encoding/Base64.ts +4 -0
- package/src/encoding/Base64Url.ts +4 -0
- package/src/encoding/EncodingError.ts +5 -0
- package/src/encoding/Hex.ts +5 -0
- package/src/encoding/Toml.ts +2 -2
- package/src/encoding/Yaml.ts +8 -4
- package/src/encoding/index.ts +4 -0
- package/src/eventlog/SqlEventJournal.ts +18 -4
- package/src/eventlog/SqlEventLogServerUnencrypted.ts +282 -235
- package/src/http/Headers.ts +8 -2
- package/src/http/HttpClient.ts +44 -27
- package/src/http/HttpClientResponse.ts +3 -1
- package/src/http/HttpEffect.ts +11 -2
- package/src/http/HttpMiddleware.ts +60 -45
- package/src/http/HttpServer.ts +1 -1
- package/src/http/internal/tracing.ts +52 -0
- package/src/http-api/HttpApiBuilder.ts +5 -1
- package/src/http-api/HttpApiClient.ts +13 -4
- package/src/http-api/HttpApiError.ts +8 -4
- package/src/http-api/HttpApiSecurity.ts +8 -8
- package/src/index.ts +156 -0
- package/src/internal/arbitrary/array.ts +3 -3
- package/src/internal/arbitrary/model.ts +37 -14
- package/src/internal/arbitrary/runner.ts +7 -7
- package/src/internal/arbitrary/schema.ts +4 -3
- package/src/internal/effect.ts +47 -45
- package/src/internal/schedule.ts +23 -17
- package/src/internal/schema/standardSchema.ts +2 -2
- package/src/internal/version.ts +2 -0
- package/src/observability/OtlpExporter.ts +9 -6
- package/src/observability/OtlpLogger.ts +20 -21
- package/src/observability/OtlpMetrics.ts +34 -93
- package/src/observability/OtlpResource.ts +18 -27
- package/src/observability/OtlpTracer.ts +34 -40
- package/src/observability/internal/otlpProtobuf.ts +60 -0
- package/src/reactivity/AsyncResult.ts +1 -1
- package/src/reactivity/Atom.ts +10 -6
- package/src/reactivity/AtomHttpApi.ts +2 -4
- package/src/reactivity/AtomRegistry.ts +7 -0
- package/src/rpc/RpcClient.ts +48 -24
- package/src/rpc/RpcServer.ts +26 -24
- package/src/rpc/internal/tracing.ts +22 -0
- package/src/schema/SchemaCompiler/runtime.ts +4 -1
- package/src/sql/SqlClient.ts +4 -4
- package/src/sql/Statement.ts +59 -7
- package/src/testing/TestClock.ts +9 -0
- package/src/testing/TestConsole.ts +8 -0
- package/src/testing/index.ts +3 -0
package/src/http/Headers.ts
CHANGED
|
@@ -749,7 +749,9 @@ export const isRedactedName = (
|
|
|
749
749
|
*
|
|
750
750
|
* **Details**
|
|
751
751
|
*
|
|
752
|
-
* Defaults include `authorization`, `cookie`, `set-cookie`,
|
|
752
|
+
* Defaults include `authorization`, `cookie`, `set-cookie`, `x-api-key` and
|
|
753
|
+
* `AWSAccessKeyId`, `Signature`, `sig` and `X-Goog-Signature`. Names match
|
|
754
|
+
* case-insensitively, and providing a new list replaces the defaults.
|
|
753
755
|
*
|
|
754
756
|
* @stability unstable
|
|
755
757
|
* @category services
|
|
@@ -762,6 +764,10 @@ export const CurrentRedactedNames = Context.Reference<
|
|
|
762
764
|
"authorization",
|
|
763
765
|
"cookie",
|
|
764
766
|
"set-cookie",
|
|
765
|
-
"x-api-key"
|
|
767
|
+
"x-api-key",
|
|
768
|
+
"AWSAccessKeyId",
|
|
769
|
+
"Signature",
|
|
770
|
+
"sig",
|
|
771
|
+
"X-Goog-Signature"
|
|
766
772
|
]
|
|
767
773
|
})
|
package/src/http/HttpClient.ts
CHANGED
|
@@ -18,15 +18,18 @@ import { Clock } from "../Clock.ts"
|
|
|
18
18
|
import * as Context from "../Context.ts"
|
|
19
19
|
import * as Duration from "../Duration.ts"
|
|
20
20
|
import * as Effect from "../Effect.ts"
|
|
21
|
+
import * as Exit from "../Exit.ts"
|
|
21
22
|
import * as Fiber from "../Fiber.ts"
|
|
22
23
|
import { constant, constFalse, constTrue, dual, flow, identity } from "../Function.ts"
|
|
23
24
|
import * as Inspectable from "../Inspectable.ts"
|
|
25
|
+
import { getStackTraceLimit, setStackTraceLimit } from "../internal/stackTraceLimit.ts"
|
|
24
26
|
import * as Layer from "../Layer.ts"
|
|
25
27
|
import * as Option from "../Option.ts"
|
|
26
28
|
import type * as RateLimiter from "../persistence/RateLimiter.ts"
|
|
27
29
|
import { type Pipeable, pipeArguments } from "../Pipeable.ts"
|
|
28
30
|
import * as Predicate from "../Predicate.ts"
|
|
29
31
|
import * as Ref from "../Ref.ts"
|
|
32
|
+
import * as References from "../References.ts"
|
|
30
33
|
import * as Result from "../Result.ts"
|
|
31
34
|
import * as Schedule from "../Schedule.ts"
|
|
32
35
|
import type * as Scope from "../Scope.ts"
|
|
@@ -42,6 +45,7 @@ import * as HttpClientResponse from "./HttpClientResponse.ts"
|
|
|
42
45
|
import * as HttpIncomingMessage from "./HttpIncomingMessage.ts"
|
|
43
46
|
import * as HttpMethod from "./HttpMethod.ts"
|
|
44
47
|
import * as TraceContext from "./HttpTraceContext.ts"
|
|
48
|
+
import * as tracing from "./internal/tracing.ts"
|
|
45
49
|
import * as Url from "./Url.ts"
|
|
46
50
|
|
|
47
51
|
const TypeId = "~effect/http/HttpClient"
|
|
@@ -900,26 +904,10 @@ export const make = (
|
|
|
900
904
|
{ kind: "client" },
|
|
901
905
|
(span) => {
|
|
902
906
|
span.attribute("http.request.method", request.method)
|
|
903
|
-
span.attribute("server.address", url.origin)
|
|
904
|
-
if (url.port !== "") {
|
|
905
|
-
span.attribute("server.port", +url.port)
|
|
906
|
-
}
|
|
907
|
-
span.attribute("url.full", url.toString())
|
|
908
|
-
span.attribute("url.path", url.pathname)
|
|
909
|
-
span.attribute("url.scheme", url.protocol.slice(0, -1))
|
|
910
|
-
const query = url.search.slice(1)
|
|
911
|
-
if (query !== "") {
|
|
912
|
-
span.attribute("url.query", query)
|
|
913
|
-
}
|
|
914
907
|
const redactedHeaderNames = fiber.getRef(Headers.CurrentRedactedNames)
|
|
908
|
+
tracing.addUrlAttributes(span, url)
|
|
915
909
|
const headerFilter = fiber.getRef(TracerHeaderFilter)
|
|
916
|
-
|
|
917
|
-
if (!headerFilter(name, "request")) continue
|
|
918
|
-
span.attribute(
|
|
919
|
-
`http.request.header.${name}`,
|
|
920
|
-
Headers.isRedactedName(name, redactedHeaderNames) ? "<redacted>" : request.headers[name]
|
|
921
|
-
)
|
|
922
|
-
}
|
|
910
|
+
tracing.addHeaderAttributes(span, "request", request.headers, headerFilter, redactedHeaderNames)
|
|
923
911
|
request = fiber.getRef(TracerPropagationEnabled)
|
|
924
912
|
? HttpClientRequest.setHeaders(request, TraceContext.toHeaders(span))
|
|
925
913
|
: request
|
|
@@ -929,12 +917,12 @@ export const make = (
|
|
|
929
917
|
Effect.matchCauseEffect({
|
|
930
918
|
onSuccess: (response) => {
|
|
931
919
|
span.attribute("http.response.status_code", response.status)
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
)
|
|
920
|
+
tracing.addHeaderAttributes(span, "response", response.headers, headerFilter, redactedHeaderNames)
|
|
921
|
+
// OpenTelemetry marks client spans as failed for 4xx and
|
|
922
|
+
// 5xx responses, while the response itself still succeeds.
|
|
923
|
+
if (response.status >= 400 && response.status < 600) {
|
|
924
|
+
span.attribute("error.type", String(response.status))
|
|
925
|
+
endSpanWithStatusError(fiber, span, request, response)
|
|
938
926
|
}
|
|
939
927
|
|
|
940
928
|
if (scopedController) return Effect.succeed(response)
|
|
@@ -954,6 +942,26 @@ export const make = (
|
|
|
954
942
|
)
|
|
955
943
|
})), Effect.succeed as HttpClient.Preprocess<never, never>)
|
|
956
944
|
|
|
945
|
+
const endSpanWithStatusError = (
|
|
946
|
+
fiber: Fiber.Fiber<unknown, unknown>,
|
|
947
|
+
span: Tracer.Span,
|
|
948
|
+
request: HttpClientRequest.HttpClientRequest,
|
|
949
|
+
response: HttpClientResponse.HttpClientResponse
|
|
950
|
+
): void => {
|
|
951
|
+
const stackTraceLimit = getStackTraceLimit()
|
|
952
|
+
setStackTraceLimit(0)
|
|
953
|
+
let exit: Exit.Exit<never, Error.HttpClientError>
|
|
954
|
+
try {
|
|
955
|
+
exit = Exit.fail(new Error.HttpClientError({ reason: new Error.StatusCodeError({ request, response }) }))
|
|
956
|
+
} finally {
|
|
957
|
+
setStackTraceLimit(stackTraceLimit)
|
|
958
|
+
}
|
|
959
|
+
span.end(
|
|
960
|
+
fiber.getRef(References.TracerTimingEnabled) ? fiber.getRef(Clock).currentTimeNanosUnsafe() : BigInt(0),
|
|
961
|
+
exit
|
|
962
|
+
)
|
|
963
|
+
}
|
|
964
|
+
|
|
957
965
|
/**
|
|
958
966
|
* Appends a transformation of the request object before sending it.
|
|
959
967
|
*
|
|
@@ -2153,6 +2161,11 @@ export const TracerDisabledWhen = Context.Reference<
|
|
|
2153
2161
|
/**
|
|
2154
2162
|
* Context reference for filtering request and response headers added to client spans.
|
|
2155
2163
|
*
|
|
2164
|
+
* **Details**
|
|
2165
|
+
*
|
|
2166
|
+
* Header capture is opt-in: the default filter records no headers. Captured
|
|
2167
|
+
* headers listed in `Headers.CurrentRedactedNames` are recorded as `<redacted>`.
|
|
2168
|
+
*
|
|
2156
2169
|
* @stability unstable
|
|
2157
2170
|
* @category services
|
|
2158
2171
|
* @since 4.0.0
|
|
@@ -2160,7 +2173,7 @@ export const TracerDisabledWhen = Context.Reference<
|
|
|
2160
2173
|
export const TracerHeaderFilter = Context.Reference<
|
|
2161
2174
|
(headerName: string, phase: "request" | "response") => boolean
|
|
2162
2175
|
>("effect/http/HttpClient/TracerHeaderFilter", {
|
|
2163
|
-
defaultValue: () =>
|
|
2176
|
+
defaultValue: () => constFalse
|
|
2164
2177
|
})
|
|
2165
2178
|
|
|
2166
2179
|
/**
|
|
@@ -2177,6 +2190,10 @@ export const TracerPropagationEnabled = Context.Reference<boolean>("effect/http/
|
|
|
2177
2190
|
/**
|
|
2178
2191
|
* Context reference for generating the span name used for outgoing client request spans.
|
|
2179
2192
|
*
|
|
2193
|
+
* **Details**
|
|
2194
|
+
*
|
|
2195
|
+
* Defaults to the request method unchanged.
|
|
2196
|
+
*
|
|
2180
2197
|
* @stability unstable
|
|
2181
2198
|
* @category services
|
|
2182
2199
|
* @since 4.0.0
|
|
@@ -2184,7 +2201,7 @@ export const TracerPropagationEnabled = Context.Reference<boolean>("effect/http/
|
|
|
2184
2201
|
export const SpanNameGenerator = Context.Reference<
|
|
2185
2202
|
(request: HttpClientRequest.HttpClientRequest) => string
|
|
2186
2203
|
>("effect/http/HttpClient/SpanNameGenerator", {
|
|
2187
|
-
defaultValue: () => (request) =>
|
|
2204
|
+
defaultValue: () => (request) => request.method
|
|
2188
2205
|
})
|
|
2189
2206
|
|
|
2190
2207
|
/**
|
|
@@ -2226,7 +2243,7 @@ const responseRegistry = (() => {
|
|
|
2226
2243
|
}
|
|
2227
2244
|
}
|
|
2228
2245
|
|
|
2229
|
-
const timers = new
|
|
2246
|
+
const timers = new WeakMap<HttpClientResponse.HttpClientResponse, any>()
|
|
2230
2247
|
return {
|
|
2231
2248
|
register(response: HttpClientResponse.HttpClientResponse, controller: AbortController) {
|
|
2232
2249
|
timers.set(response, setTimeout(() => controller.abort(), 5000))
|
|
@@ -341,7 +341,9 @@ class WebHttpClientResponse extends Inspectable.Class implements HttpClientRespo
|
|
|
341
341
|
if (this.cachedCookies) {
|
|
342
342
|
return this.cachedCookies
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
// React Native's Headers does not implement getSetCookie, and it never
|
|
345
|
+
// exposes Set-Cookie to JavaScript anyway.
|
|
346
|
+
return this.cachedCookies = Cookies.fromSetCookie(this.source.headers.getSetCookie?.() ?? [])
|
|
345
347
|
}
|
|
346
348
|
|
|
347
349
|
get remoteAddress(): Option.Option<string> {
|
package/src/http/HttpEffect.ts
CHANGED
|
@@ -33,6 +33,9 @@ import * as preResponseHandler from "./internal/preResponseHandler.ts"
|
|
|
33
33
|
/**
|
|
34
34
|
* Runs an HTTP server effect, sends the produced response with the supplied handler, and converts failures into HTTP responses.
|
|
35
35
|
* On handler failure, the request scope closes with the original cause.
|
|
36
|
+
* If the send handler returns an `HttpServerResponse`, such as the `101`
|
|
37
|
+
* response of an upgraded request, middleware observes it in place of the
|
|
38
|
+
* handler's response.
|
|
36
39
|
*
|
|
37
40
|
* @stability unstable
|
|
38
41
|
* @category combinators
|
|
@@ -81,11 +84,17 @@ export const toHandled = <E, R, EH, RH>(
|
|
|
81
84
|
const handler = preResponseHandler.requestPreResponseHandlers.get(request.source)
|
|
82
85
|
if (handler === undefined) {
|
|
83
86
|
;(request as any)[handledSymbol] = true
|
|
84
|
-
return Effect.mapEager(
|
|
87
|
+
return Effect.mapEager(
|
|
88
|
+
handleResponse(request, response),
|
|
89
|
+
(sent) => Response.isHttpServerResponse(sent) ? sent : response
|
|
90
|
+
)
|
|
85
91
|
}
|
|
86
92
|
return Effect.flatMapEager(handler(request, response), (sentResponse) => {
|
|
87
93
|
;(request as any)[handledSymbol] = true
|
|
88
|
-
return Effect.mapEager(
|
|
94
|
+
return Effect.mapEager(
|
|
95
|
+
handleResponse(request, sentResponse),
|
|
96
|
+
(sent) => Response.isHttpServerResponse(sent) ? sent : response
|
|
97
|
+
)
|
|
89
98
|
})
|
|
90
99
|
}
|
|
91
100
|
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* @stability unstable
|
|
12
12
|
* @since 4.0.0
|
|
13
13
|
*/
|
|
14
|
+
import * as Cause from "../Cause.ts"
|
|
14
15
|
import { Clock } from "../Clock.ts"
|
|
15
16
|
import * as Context from "../Context.ts"
|
|
16
17
|
import * as Effect from "../Effect.ts"
|
|
@@ -18,6 +19,7 @@ import * as Exit from "../Exit.ts"
|
|
|
18
19
|
import type * as Fiber from "../Fiber.ts"
|
|
19
20
|
import { constant, constFalse } from "../Function.ts"
|
|
20
21
|
import * as internalEffect from "../internal/effect.ts"
|
|
22
|
+
import { getStackTraceLimit, setStackTraceLimit } from "../internal/stackTraceLimit.ts"
|
|
21
23
|
import * as Layer from "../Layer.ts"
|
|
22
24
|
import * as Option from "../Option.ts"
|
|
23
25
|
import type { Predicate } from "../Predicate.ts"
|
|
@@ -26,7 +28,7 @@ import { nativeTracer, ParentSpan, Tracer } from "../Tracer.ts"
|
|
|
26
28
|
import * as Headers from "./Headers.ts"
|
|
27
29
|
import type { CompressionAlgorithm } from "./HttpPlatform.ts"
|
|
28
30
|
import { HttpPlatform } from "./HttpPlatform.ts"
|
|
29
|
-
import { causeResponseStripped, ClientAbort } from "./HttpServerError.ts"
|
|
31
|
+
import { causeResponseStripped, ClientAbort, HttpServerError, ResponseError } from "./HttpServerError.ts"
|
|
30
32
|
import { HttpServerRequest } from "./HttpServerRequest.ts"
|
|
31
33
|
import * as Request from "./HttpServerRequest.ts"
|
|
32
34
|
import * as Response from "./HttpServerResponse.ts"
|
|
@@ -35,6 +37,7 @@ import * as TraceContext from "./HttpTraceContext.ts"
|
|
|
35
37
|
import * as compressionInternal from "./internal/compression.ts"
|
|
36
38
|
import * as bodyInternal from "./internal/httpBody.ts"
|
|
37
39
|
import { appendPreResponseHandlerUnsafe } from "./internal/preResponseHandler.ts"
|
|
40
|
+
import * as tracing from "./internal/tracing.ts"
|
|
38
41
|
|
|
39
42
|
/**
|
|
40
43
|
* Middleware that transforms an HTTP server app effect into another HTTP server app effect.
|
|
@@ -130,15 +133,37 @@ export const layerTracerDisabledForUrls = (
|
|
|
130
133
|
/**
|
|
131
134
|
* Context reference for generating server span names from HTTP server requests.
|
|
132
135
|
*
|
|
136
|
+
* **Details**
|
|
137
|
+
*
|
|
138
|
+
* Defaults to the request method unchanged.
|
|
139
|
+
*
|
|
133
140
|
* @stability unstable
|
|
134
141
|
* @category services
|
|
135
142
|
* @since 4.0.0
|
|
136
143
|
*/
|
|
137
144
|
export const SpanNameGenerator = Context.Reference<(request: HttpServerRequest) => string>(
|
|
138
145
|
"@effect/platform/HttpMiddleware/SpanNameGenerator",
|
|
139
|
-
{ defaultValue: () => (request) =>
|
|
146
|
+
{ defaultValue: () => (request) => request.method }
|
|
140
147
|
)
|
|
141
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Context reference for filtering request and response headers added to server spans.
|
|
151
|
+
*
|
|
152
|
+
* **Details**
|
|
153
|
+
*
|
|
154
|
+
* Header capture is opt-in: the default filter records no headers. Captured
|
|
155
|
+
* headers listed in `Headers.CurrentRedactedNames` are recorded as `<redacted>`.
|
|
156
|
+
*
|
|
157
|
+
* @stability unstable
|
|
158
|
+
* @category services
|
|
159
|
+
* @since 4.0.0
|
|
160
|
+
*/
|
|
161
|
+
export const TracerHeaderFilter = Context.Reference<
|
|
162
|
+
(headerName: string, phase: "request" | "response") => boolean
|
|
163
|
+
>("effect/http/HttpMiddleware/TracerHeaderFilter", {
|
|
164
|
+
defaultValue: () => constFalse
|
|
165
|
+
})
|
|
166
|
+
|
|
142
167
|
/**
|
|
143
168
|
* Middleware that logs sent HTTP responses with request method, request URL, and response status annotations.
|
|
144
169
|
*
|
|
@@ -195,6 +220,23 @@ export const isTracerDisabledUnsafe = (
|
|
|
195
220
|
request: HttpServerRequest
|
|
196
221
|
): boolean => !fiber.cache.tracerEnabled || fiber.getRef(TracerDisabledWhen)(request)
|
|
197
222
|
|
|
223
|
+
// OpenTelemetry requires failed server spans for 5xx responses.
|
|
224
|
+
const responseSpanExit = (
|
|
225
|
+
request: HttpServerRequest,
|
|
226
|
+
response: HttpServerResponse
|
|
227
|
+
): Exit.Exit<HttpServerResponse, HttpServerError> => {
|
|
228
|
+
if (!(response.status >= 500 && response.status < 600)) {
|
|
229
|
+
return Exit.succeed(response)
|
|
230
|
+
}
|
|
231
|
+
const stackTraceLimit = getStackTraceLimit()
|
|
232
|
+
setStackTraceLimit(0)
|
|
233
|
+
try {
|
|
234
|
+
return Exit.fail(new HttpServerError({ reason: new ResponseError({ request, response }) }))
|
|
235
|
+
} finally {
|
|
236
|
+
setStackTraceLimit(stackTraceLimit)
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
198
240
|
/**
|
|
199
241
|
* Middleware that creates a server trace span for each request and records request and response HTTP attributes.
|
|
200
242
|
*
|
|
@@ -221,71 +263,44 @@ export const tracer: <E, R>(
|
|
|
221
263
|
fiber.setContext(prevServices)
|
|
222
264
|
const endTime = fiber.getRef(Clock).currentTimeNanosUnsafe()
|
|
223
265
|
if (Exit.isSuccess(exit) && (!span.sampled || fiber.getRef(Tracer) === nativeTracer)) {
|
|
224
|
-
span.end(endTime, exit)
|
|
266
|
+
span.end(endTime, responseSpanExit(request, exit.value))
|
|
225
267
|
return undefined
|
|
226
268
|
}
|
|
227
269
|
const redactedHeaderNames = fiber.getRef(Headers.CurrentRedactedNames)
|
|
270
|
+
const headerFilter = fiber.getRef(TracerHeaderFilter)
|
|
228
271
|
fiber.currentDispatcher.scheduleTask(() => {
|
|
229
272
|
let response: HttpServerResponse
|
|
230
|
-
let spanExit
|
|
273
|
+
let spanExit: Exit.Exit<HttpServerResponse, unknown>
|
|
231
274
|
if (Exit.isFailure(exit)) {
|
|
232
275
|
const [failureResponse, cause] = causeResponseStripped(exit.cause)
|
|
233
276
|
response = failureResponse
|
|
234
|
-
|
|
277
|
+
// OpenTelemetry only treats 5xx responses as server span errors; interrupts still fail the span.
|
|
278
|
+
spanExit = Option.isSome(cause) && (response.status >= 500 || Cause.hasInterrupts(cause.value))
|
|
279
|
+
? Exit.failCause(cause.value)
|
|
280
|
+
: responseSpanExit(request, response)
|
|
235
281
|
} else {
|
|
236
282
|
response = exit.value
|
|
283
|
+
spanExit = responseSpanExit(request, response)
|
|
237
284
|
}
|
|
238
285
|
if (span.sampled) {
|
|
239
286
|
span.attribute("http.request.method", request.method)
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
if (queryIndex === -1) {
|
|
246
|
-
span.attribute("url.path", request.url)
|
|
247
|
-
} else {
|
|
248
|
-
span.attribute("url.path", request.url.slice(0, queryIndex))
|
|
249
|
-
if (queryIndex < request.url.length - 1) {
|
|
250
|
-
span.attribute("url.query", request.url.slice(queryIndex + 1))
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
span.attribute("url.scheme", protocol)
|
|
254
|
-
} else {
|
|
255
|
-
const url = Request.toURL(request)
|
|
256
|
-
if (Option.isSome(url)) {
|
|
257
|
-
if (url.value.username !== "" || url.value.password !== "") {
|
|
258
|
-
url.value.username = "REDACTED"
|
|
259
|
-
url.value.password = "REDACTED"
|
|
260
|
-
}
|
|
261
|
-
span.attribute("url.full", url.value.toString())
|
|
262
|
-
span.attribute("url.path", url.value.pathname)
|
|
263
|
-
const query = url.value.search.slice(1)
|
|
264
|
-
if (query !== "") {
|
|
265
|
-
span.attribute("url.query", query)
|
|
266
|
-
}
|
|
267
|
-
span.attribute("url.scheme", url.value.protocol.slice(0, -1))
|
|
287
|
+
const url = Request.toURL(request)
|
|
288
|
+
if (Option.isSome(url)) {
|
|
289
|
+
if (!request.url.startsWith("/") && (url.value.username !== "" || url.value.password !== "")) {
|
|
290
|
+
url.value.username = "REDACTED"
|
|
291
|
+
url.value.password = "REDACTED"
|
|
268
292
|
}
|
|
293
|
+
tracing.addUrlAttributes(span, url.value)
|
|
269
294
|
}
|
|
270
295
|
if (request.headers["user-agent"] !== undefined) {
|
|
271
296
|
span.attribute("user_agent.original", request.headers["user-agent"])
|
|
272
297
|
}
|
|
273
|
-
|
|
274
|
-
span.attribute(
|
|
275
|
-
`http.request.header.${name}`,
|
|
276
|
-
Headers.isRedactedName(name, redactedHeaderNames) ? "<redacted>" : request.headers[name]
|
|
277
|
-
)
|
|
278
|
-
}
|
|
298
|
+
tracing.addHeaderAttributes(span, "request", request.headers, headerFilter, redactedHeaderNames)
|
|
279
299
|
if (Option.isSome(request.remoteAddress)) {
|
|
280
300
|
span.attribute("client.address", request.remoteAddress.value)
|
|
281
301
|
}
|
|
282
302
|
span.attribute("http.response.status_code", response.status)
|
|
283
|
-
|
|
284
|
-
span.attribute(
|
|
285
|
-
`http.response.header.${name}`,
|
|
286
|
-
Headers.isRedactedName(name, redactedHeaderNames) ? "<redacted>" : response.headers[name]
|
|
287
|
-
)
|
|
288
|
-
}
|
|
303
|
+
tracing.addHeaderAttributes(span, "response", response.headers, headerFilter, redactedHeaderNames)
|
|
289
304
|
}
|
|
290
305
|
span.end(endTime, spanExit)
|
|
291
306
|
}, 0)
|
package/src/http/HttpServer.ts
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type * as Tracer from "../../Tracer.ts"
|
|
2
|
+
import * as Headers from "../Headers.ts"
|
|
3
|
+
|
|
4
|
+
const defaultPorts: Record<string, number> = {
|
|
5
|
+
"http:": 80,
|
|
6
|
+
"https:": 443,
|
|
7
|
+
"ws:": 80,
|
|
8
|
+
"wss:": 443
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Records the `url.*` and `server.*` attributes for a request URL.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export const addUrlAttributes = (
|
|
17
|
+
span: Tracer.Span,
|
|
18
|
+
url: URL
|
|
19
|
+
): void => {
|
|
20
|
+
const query = url.search.slice(1)
|
|
21
|
+
span.attribute("url.full", url.toString())
|
|
22
|
+
span.attribute("url.path", url.pathname)
|
|
23
|
+
if (query !== "") {
|
|
24
|
+
span.attribute("url.query", query)
|
|
25
|
+
}
|
|
26
|
+
span.attribute("url.scheme", url.protocol.slice(0, -1))
|
|
27
|
+
if (url.hostname !== "") {
|
|
28
|
+
// URL keeps IPv6 brackets in the hostname, but the semantic conventions do not.
|
|
29
|
+
span.attribute("server.address", url.hostname.startsWith("[") ? url.hostname.slice(1, -1) : url.hostname)
|
|
30
|
+
const port = url.port === "" ? defaultPorts[url.protocol] : Number(url.port)
|
|
31
|
+
if (port !== undefined) {
|
|
32
|
+
span.attribute("server.port", port)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const addHeaderAttributes = (
|
|
39
|
+
span: Tracer.Span,
|
|
40
|
+
phase: "request" | "response",
|
|
41
|
+
headers: Headers.Headers,
|
|
42
|
+
filter: (headerName: string, phase: "request" | "response") => boolean,
|
|
43
|
+
redactedNames: ReadonlyArray<string | RegExp>
|
|
44
|
+
): void => {
|
|
45
|
+
for (const name in headers) {
|
|
46
|
+
if (!filter(name, phase)) continue
|
|
47
|
+
span.attribute(
|
|
48
|
+
`http.${phase}.header.${name}`,
|
|
49
|
+
Headers.isRedactedName(name, redactedNames) ? "<redacted>" : headers[name]
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -746,7 +746,11 @@ function buildPayloadDecoders(
|
|
|
746
746
|
): Map<string, PayloadDecoder> {
|
|
747
747
|
const result = new Map<string, PayloadDecoder>()
|
|
748
748
|
payloadMap.forEach(({ encoding, schemas }, contentType) => {
|
|
749
|
-
const
|
|
749
|
+
const schema = Schema.Union(schemas)
|
|
750
|
+
const decode = Schema.decodeUnknownEffect(
|
|
751
|
+
encoding._tag === "FormUrlEncoded" ? Schema.toCodecArrayFromSingle(schema) : schema,
|
|
752
|
+
options
|
|
753
|
+
)
|
|
750
754
|
if (encoding._tag === "Multipart") {
|
|
751
755
|
result.set(contentType, { _tag: "Multipart", mode: encoding.mode, limits: encoding.limits, decode })
|
|
752
756
|
} else {
|
|
@@ -72,7 +72,16 @@ export type ForApi<Api extends HttpApi.Constraint, E = never, R = never> = Api e
|
|
|
72
72
|
HttpApi.HttpApi<infer _Id, infer Groups> ? Client<Groups, E, R> :
|
|
73
73
|
never
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Computes the decoded success value a client receives for an endpoint
|
|
77
|
+
* success schema, including headers, streaming Server-Sent Events, and
|
|
78
|
+
* streaming byte responses.
|
|
79
|
+
*
|
|
80
|
+
* @stability unstable
|
|
81
|
+
* @category utility types
|
|
82
|
+
* @since 4.0.0
|
|
83
|
+
*/
|
|
84
|
+
export type SuccessType<S> = S extends HttpApiSchema.WithHeaders<
|
|
76
85
|
infer _Inner,
|
|
77
86
|
infer _Headers
|
|
78
87
|
> ? HttpApiSchema.withHeaders<SuccessType<_Inner>, _Headers["Type"]>
|
|
@@ -126,9 +135,9 @@ export declare namespace Client {
|
|
|
126
135
|
* @category models
|
|
127
136
|
* @since 4.0.0
|
|
128
137
|
*/
|
|
129
|
-
export type Response<Success, Mode extends ResponseMode> =
|
|
138
|
+
export type Response<Success, Mode extends ResponseMode> = Mode extends "decoded-and-response"
|
|
130
139
|
? [Success, HttpClientResponse.HttpClientResponse]
|
|
131
|
-
:
|
|
140
|
+
: Mode extends "response-only" ? HttpClientResponse.HttpClientResponse
|
|
132
141
|
: Success
|
|
133
142
|
|
|
134
143
|
type GroupByEndpoint<Group extends HttpApiGroup.Constraint, E, R> = Group["endpoints"] extends
|
|
@@ -184,7 +193,7 @@ export declare namespace Client {
|
|
|
184
193
|
Endpoint extends HttpApiEndpoint.ConstraintRequest,
|
|
185
194
|
E,
|
|
186
195
|
R
|
|
187
|
-
> = <Mode extends ResponseMode =
|
|
196
|
+
> = <Mode extends ResponseMode = "decoded-only">(
|
|
188
197
|
request: Simplify<
|
|
189
198
|
HttpApiEndpoint.ClientRequest<
|
|
190
199
|
Endpoint["~Params"],
|
|
@@ -467,8 +467,9 @@ export const HttpApiSchemaErrorTypeId: HttpApiSchemaErrorTypeId = "~effect/http-
|
|
|
467
467
|
|
|
468
468
|
/**
|
|
469
469
|
* Error raised when an HTTP API request or response component fails schema
|
|
470
|
-
* decoding or encoding.
|
|
471
|
-
*
|
|
470
|
+
* decoding or encoding. Request decoding failures respond with an empty
|
|
471
|
+
* `400 Bad Request` and are ignored by error reporters. Response encoding
|
|
472
|
+
* failures respond with an empty `500 Internal Server Error` and are reported.
|
|
472
473
|
*
|
|
473
474
|
* @stability unstable
|
|
474
475
|
* @category errors
|
|
@@ -479,7 +480,10 @@ export class HttpApiSchemaError extends Data.TaggedClass("HttpApiSchemaError")<{
|
|
|
479
480
|
readonly cause: Schema.SchemaError
|
|
480
481
|
}> {
|
|
481
482
|
readonly [HttpApiSchemaErrorTypeId]: HttpApiSchemaErrorTypeId = HttpApiSchemaErrorTypeId
|
|
482
|
-
|
|
483
|
+
|
|
484
|
+
get [ErrorReporter.ignore](): boolean {
|
|
485
|
+
return this.kind !== "Body" && this.kind !== "ResponseHeaders"
|
|
486
|
+
}
|
|
483
487
|
|
|
484
488
|
static is(u: unknown): u is HttpApiSchemaError {
|
|
485
489
|
return hasProperty(u, HttpApiSchemaErrorTypeId)
|
|
@@ -498,6 +502,6 @@ export class HttpApiSchemaError extends Data.TaggedClass("HttpApiSchemaError")<{
|
|
|
498
502
|
readonly message = this.kind;
|
|
499
503
|
|
|
500
504
|
[HttpServerRespondable.symbol]() {
|
|
501
|
-
return Effect.succeed(badRequestResponse)
|
|
505
|
+
return Effect.succeed(this[ErrorReporter.ignore] ? badRequestResponse : internalServerErrorResponse)
|
|
502
506
|
}
|
|
503
507
|
}
|
|
@@ -126,8 +126,8 @@ const Proto = {
|
|
|
126
126
|
*
|
|
127
127
|
* **Details**
|
|
128
128
|
*
|
|
129
|
-
* Use `
|
|
130
|
-
* security scheme.
|
|
129
|
+
* Use `HttpApiMiddleware.Service` with a `security` option to implement API
|
|
130
|
+
* middleware for this security scheme.
|
|
131
131
|
*
|
|
132
132
|
* @see {@link apiKey} for an API-key security scheme
|
|
133
133
|
* @see {@link basic} for an HTTP Basic security scheme
|
|
@@ -155,8 +155,8 @@ export const http = (options: {
|
|
|
155
155
|
*
|
|
156
156
|
* **Details**
|
|
157
157
|
*
|
|
158
|
-
* Use `
|
|
159
|
-
* security scheme.
|
|
158
|
+
* Use `HttpApiMiddleware.Service` with a `security` option to implement API
|
|
159
|
+
* middleware for this security scheme.
|
|
160
160
|
*
|
|
161
161
|
* @see {@link apiKey} for an API-key security scheme
|
|
162
162
|
* @see {@link basic} for an HTTP Basic security scheme
|
|
@@ -176,8 +176,8 @@ export const bearer: Http = http({ scheme: "Bearer" })
|
|
|
176
176
|
*
|
|
177
177
|
* **Details**
|
|
178
178
|
*
|
|
179
|
-
* Use `
|
|
180
|
-
* security scheme.
|
|
179
|
+
* Use `HttpApiMiddleware.Service` with a `security` option to implement API
|
|
180
|
+
* middleware for this security scheme.
|
|
181
181
|
*
|
|
182
182
|
* Use `HttpApiBuilder.securitySetCookie` to set the correct cookie in a
|
|
183
183
|
* handler. By default, `in` is `"header"`.
|
|
@@ -208,8 +208,8 @@ export const apiKey = (options: {
|
|
|
208
208
|
*
|
|
209
209
|
* **Details**
|
|
210
210
|
*
|
|
211
|
-
* Use `
|
|
212
|
-
* security scheme.
|
|
211
|
+
* Use `HttpApiMiddleware.Service` with a `security` option to implement API
|
|
212
|
+
* middleware for this security scheme.
|
|
213
213
|
*
|
|
214
214
|
* @see {@link bearer} for a Bearer token security scheme
|
|
215
215
|
* @see {@link apiKey} for an API-key security scheme
|