effect 4.0.0-rc.111 → 4.0.0-rc.113
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/AGENTS.md +24 -9
- package/CLAUDE.md +24 -9
- package/ai-docs/package.json +2 -2
- package/ai-docs/src/01_effect/01_basics/02_effect-fn.ts +18 -5
- package/ai-docs/src/01_effect/01_basics/index.md +5 -3
- package/ai-docs/src/01_effect/03_services/20_layer-composition.ts +1 -1
- package/ai-docs/src/01_effect/03_services/20_layer-unwrap.ts +2 -2
- package/ai-docs/src/01_effect/05_resources/10_acquire-release.ts +2 -2
- package/ai-docs/src/03_stream/30_encoding.ts +5 -7
- package/ai-docs/src/08_observability/10_logging.ts +1 -1
- package/ai-docs/src/70_cli/10_basics.ts +7 -7
- package/ai-docs/src/71_ai/10_language-model.ts +2 -2
- package/ai-docs/src/71_ai/20_tools.ts +1 -1
- package/ai-docs/src/71_ai/30_chat.ts +1 -1
- package/dist/Array.d.ts +109 -52
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +65 -32
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +5 -1
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +40 -23
- package/dist/BigDecimal.js.map +1 -1
- package/dist/ByteSize.d.ts +633 -0
- package/dist/ByteSize.d.ts.map +1 -0
- package/dist/ByteSize.js +524 -0
- package/dist/ByteSize.js.map +1 -0
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +17 -3
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +1 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Channel.d.ts +97 -24
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +68 -41
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +49 -28
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +27 -18
- package/dist/Chunk.js.map +1 -1
- package/dist/Config.d.ts +162 -201
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +103 -212
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +4 -4
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +7 -7
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Context.d.ts +31 -0
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +2 -2
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +2 -2
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +1 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +3 -2
- package/dist/Crypto.js.map +1 -1
- package/dist/DateTime.d.ts +2 -2
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +6 -6
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +1 -1
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +220 -113
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +27 -26
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +58 -2
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +58 -6
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +3 -1
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +40 -10
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +1 -1
- package/dist/Equal.js.map +1 -1
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +1 -0
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Fiber.d.ts +32 -8
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.js +3 -3
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +12 -6
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +11 -6
- package/dist/FiberMap.js.map +1 -1
- package/dist/FileSystem.d.ts +42 -210
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +16 -148
- package/dist/FileSystem.js.map +1 -1
- package/dist/Formatter.d.ts +1 -0
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +19 -3
- package/dist/Formatter.js.map +1 -1
- package/dist/Graph.d.ts +48 -20
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +20 -5
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.d.ts +1 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +5 -14
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +1 -1
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashRing.d.ts +6 -1
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +9 -2
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +1 -1
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js.map +1 -1
- package/dist/Iterable.d.ts +56 -17
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +65 -45
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.js +4 -4
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +68 -4
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +90 -4
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +67 -94
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +752 -397
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Layer.d.ts +47 -4
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +4 -6
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +24 -3
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +9 -5
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +7 -5
- package/dist/LayerRef.js.map +1 -1
- package/dist/Logger.d.ts +114 -9
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +109 -9
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.js +1 -1
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +43 -31
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +5 -2
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +11 -4
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +14 -18
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +1 -1
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +1 -1
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +1 -1
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +1 -1
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +13 -2
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +18 -2
- package/dist/MutableList.js.map +1 -1
- package/dist/Number.d.ts +6 -0
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +3 -1
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +5 -4
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +1 -1
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +1 -1
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +1 -0
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +3 -1
- package/dist/Order.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +1 -2
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +1 -1
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +1 -1
- package/dist/Path.js.map +1 -1
- package/dist/PlatformError.d.ts +1 -1
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +1 -1
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +137 -10
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +332 -75
- package/dist/Pool.js.map +1 -1
- package/dist/PrimaryKey.d.ts +1 -1
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +1 -1
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +21 -9
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +18 -14
- package/dist/PubSub.js.map +1 -1
- package/dist/Queue.d.ts +82 -6
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +116 -27
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +17 -4
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +1 -1
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +137 -0
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +72 -9
- package/dist/RcMap.js.map +1 -1
- package/dist/Record.d.ts +13 -0
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js.map +1 -1
- package/dist/Redacted.d.ts +1 -1
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +1 -1
- package/dist/Redacted.js.map +1 -1
- package/dist/RequestResolver.d.ts +15 -9
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +33 -15
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Result.d.ts +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +1 -1
- package/dist/Result.js.map +1 -1
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +19 -10
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +2200 -2433
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +2797 -4184
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +359 -176
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +373 -630
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +46 -22
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +56 -53
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +123 -200
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +59 -263
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.js +2 -9
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +1276 -172
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +1371 -29
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +49 -16
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +75 -98
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +9 -2
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +10 -3
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Sink.d.ts +9 -4
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +49 -31
- package/dist/Sink.js.map +1 -1
- package/dist/StandardSchema.d.ts +125 -0
- package/dist/StandardSchema.d.ts.map +1 -0
- package/dist/StandardSchema.js +9 -0
- package/dist/StandardSchema.js.map +1 -0
- package/dist/Stream.d.ts +221 -35
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +168 -84
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +16 -6
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +12 -5
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +7 -4
- package/dist/Struct.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +3 -2
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Terminal.d.ts +3 -3
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +3 -3
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +27 -7
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +38 -13
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +1 -1
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Tuple.d.ts +2 -1
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +1 -1
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +1 -1
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +1 -1
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +1 -1
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +1 -1
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +1 -1
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +1 -1
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +1 -1
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +1 -1
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +1 -1
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +1 -1
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +1 -1
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +9 -9
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +93 -86
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +29 -1
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +29 -1
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +1 -1
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +1 -1
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +1 -1
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +1 -1
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +1 -1
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +1 -1
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +33 -19
- package/dist/Types.d.ts.map +1 -1
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +2 -1
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/arbitrary/model.d.ts +2 -0
- package/dist/internal/arbitrary/model.d.ts.map +1 -0
- package/dist/internal/arbitrary/model.js +495 -0
- package/dist/internal/arbitrary/model.js.map +1 -0
- package/dist/internal/arbitrary/regexp.d.ts +2 -0
- package/dist/internal/arbitrary/regexp.d.ts.map +1 -0
- package/dist/internal/arbitrary/regexp.js +789 -0
- package/dist/internal/arbitrary/regexp.js.map +1 -0
- package/dist/internal/arbitrary/runner.d.ts +2 -0
- package/dist/internal/arbitrary/runner.d.ts.map +1 -0
- package/dist/internal/arbitrary/runner.js +496 -0
- package/dist/internal/arbitrary/runner.js.map +1 -0
- package/dist/internal/arbitrary/schema.d.ts.map +1 -0
- package/dist/internal/arbitrary/schema.js +1340 -0
- package/dist/internal/arbitrary/schema.js.map +1 -0
- package/dist/internal/core.js +27 -13
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/count.d.ts +2 -0
- package/dist/internal/count.d.ts.map +1 -0
- package/dist/internal/count.js +14 -0
- package/dist/internal/count.js.map +1 -0
- package/dist/internal/dateTime.js +4 -10
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +416 -258
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/graph.js +3 -1
- package/dist/internal/graph.js.map +1 -1
- package/dist/internal/hashMap.js +5 -3
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/hashSet.js +1 -1
- package/dist/internal/hashSet.js.map +1 -1
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/metric.js +1 -1
- package/dist/internal/metric.js.map +1 -1
- package/dist/internal/option.js +6 -5
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/random.js +17 -0
- package/dist/internal/random.js.map +1 -1
- package/dist/internal/rcRef.js +10 -7
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/references.js +1 -0
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/request.js +13 -6
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/result.js +11 -9
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schema/annotations.js +1 -1
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js +238 -132
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/fromRepresentation.js +5 -5
- package/dist/internal/schema/fromRepresentation.js.map +1 -1
- package/dist/internal/schema/make.d.ts +2 -0
- package/dist/internal/schema/make.d.ts.map +1 -0
- package/dist/internal/schema/{schema.js → make.js} +1 -25
- package/dist/internal/schema/make.js.map +1 -0
- package/dist/internal/schema/parser.d.ts +0 -12
- package/dist/internal/schema/parser.d.ts.map +1 -1
- package/dist/internal/schema/parser.js +7 -0
- package/dist/internal/schema/parser.js.map +1 -1
- package/dist/internal/schema/standardSchema.d.ts +2 -0
- package/dist/internal/schema/standardSchema.d.ts.map +1 -0
- package/dist/internal/schema/standardSchema.js +112 -0
- package/dist/internal/schema/standardSchema.js.map +1 -0
- package/dist/internal/schema/toCodeDocument.js +34 -22
- package/dist/internal/schema/toCodeDocument.js.map +1 -1
- package/dist/internal/schema/toCodec.d.ts +2 -0
- package/dist/internal/schema/toCodec.d.ts.map +1 -0
- package/dist/internal/schema/toCodec.js +242 -0
- package/dist/internal/schema/toCodec.js.map +1 -0
- package/dist/internal/schema/toDifferJsonPatch.d.ts +2 -0
- package/dist/internal/schema/toDifferJsonPatch.d.ts.map +1 -0
- package/dist/internal/schema/toDifferJsonPatch.js +20 -0
- package/dist/internal/schema/toDifferJsonPatch.js.map +1 -0
- package/dist/internal/schema/toEncoderXml.d.ts +2 -0
- package/dist/internal/schema/toEncoderXml.d.ts.map +1 -0
- package/dist/internal/schema/toEncoderXml.js +104 -0
- package/dist/internal/schema/toEncoderXml.js.map +1 -0
- package/dist/internal/schema/toEquivalence.js +66 -0
- package/dist/internal/schema/toEquivalence.js.map +1 -1
- package/dist/internal/schema/toFormatter.d.ts +2 -0
- package/dist/internal/schema/toFormatter.d.ts.map +1 -0
- package/dist/internal/schema/toFormatter.js +227 -0
- package/dist/internal/schema/toFormatter.js.map +1 -0
- package/dist/internal/schema/toIso.d.ts +2 -0
- package/dist/internal/schema/toIso.d.ts.map +1 -0
- package/dist/internal/schema/toIso.js +17 -0
- package/dist/internal/schema/toIso.js.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.js +122 -71
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/toRepresentation.js +3 -1
- package/dist/internal/schema/toRepresentation.js.map +1 -1
- package/dist/internal/schemaError.d.ts +4 -0
- package/dist/internal/schemaError.d.ts.map +1 -0
- package/dist/internal/schemaError.js +6 -0
- package/dist/internal/schemaError.js.map +1 -0
- package/dist/internal/stream.js +5 -6
- package/dist/internal/stream.js.map +1 -1
- package/dist/internal/tracer.d.ts +1 -3
- package/dist/internal/tracer.d.ts.map +1 -1
- package/dist/internal/tracer.js +6 -0
- package/dist/internal/tracer.js.map +1 -1
- package/dist/internal/trie.js +2 -2
- package/dist/internal/trie.js.map +1 -1
- package/dist/internal/uuid.d.ts +1 -2
- package/dist/internal/uuid.d.ts.map +1 -1
- package/dist/internal/uuid.js +2 -0
- package/dist/internal/uuid.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +9 -11
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +20 -18
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +0 -4
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +0 -4
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +98 -23
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +98 -6
- 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 +5 -16
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +27 -32
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +10 -13
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +23 -16
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +13 -11
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +48 -37
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +150 -47
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +2 -2
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +87 -78
- package/dist/unstable/ai/McpServer.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 +3 -14
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +2 -2
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +15 -4
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +37 -94
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +46 -96
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +4 -5
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +38 -20
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +27 -1
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +30 -18
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +2 -2
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/ai/internal/structured-output.js +28 -5
- package/dist/unstable/ai/internal/structured-output.js.map +1 -1
- package/dist/unstable/arbitrary/Arbitrary.d.ts +626 -0
- package/dist/unstable/arbitrary/Arbitrary.d.ts.map +1 -0
- package/dist/unstable/arbitrary/Arbitrary.js +238 -0
- package/dist/unstable/arbitrary/Arbitrary.js.map +1 -0
- package/dist/unstable/arbitrary/index.d.ts +8 -0
- package/dist/unstable/arbitrary/index.d.ts.map +1 -0
- package/dist/unstable/arbitrary/index.js +9 -0
- package/dist/unstable/arbitrary/index.js.map +1 -0
- package/dist/unstable/cli/Argument.d.ts +104 -108
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +56 -57
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +2 -0
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +2 -0
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.js +27 -4
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +73 -73
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +22 -22
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +4 -4
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +150 -161
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +79 -90
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +3 -3
- package/dist/unstable/cli/GlobalFlag.js +13 -13
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +118 -126
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +104 -113
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +69 -58
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +65 -66
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +113 -59
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +391 -327
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js +109 -38
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js +23 -11
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/completions/fish.js +15 -7
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/completions/zsh.js +6 -4
- package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
- package/dist/unstable/cli/internal/config.js +4 -4
- package/dist/unstable/cli/internal/parser.js +1 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.d.ts +5 -1
- package/dist/unstable/cli/internal/wizard.d.ts.map +1 -1
- package/dist/unstable/cli/internal/wizard.js +34 -26
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +13 -0
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +16 -1
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +57 -14
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +2 -0
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +2 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +22 -5
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +23 -3
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +32 -13
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +17 -5
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +21 -8
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +34 -4
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +33 -12
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +5 -4
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +21 -12
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +12 -6
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +11 -5
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +56 -35
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +32 -17
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +23 -23
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +2 -2
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +4 -3
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +11 -8
- 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 +11 -4
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/clusterAbandon.d.ts +5 -0
- package/dist/unstable/cluster/internal/clusterAbandon.d.ts.map +1 -0
- package/dist/unstable/cluster/internal/clusterAbandon.js +9 -0
- package/dist/unstable/cluster/internal/clusterAbandon.js.map +1 -0
- package/dist/unstable/cluster/internal/entityManager.js +10 -6
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/interruptors.js +30 -1
- package/dist/unstable/cluster/internal/interruptors.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +12 -7
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +12 -7
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/encoding/Ini.d.ts +2 -0
- package/dist/unstable/encoding/Ini.d.ts.map +1 -1
- package/dist/unstable/encoding/Ini.js +2 -0
- package/dist/unstable/encoding/Ini.js.map +1 -1
- package/dist/unstable/encoding/SchemaBinary.d.ts +273 -0
- package/dist/unstable/encoding/SchemaBinary.d.ts.map +1 -0
- package/dist/unstable/encoding/SchemaBinary.js +4573 -0
- package/dist/unstable/encoding/SchemaBinary.js.map +1 -0
- package/dist/unstable/encoding/Sse.js +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/Toml.d.ts +2 -0
- package/dist/unstable/encoding/Toml.d.ts.map +1 -1
- package/dist/unstable/encoding/Toml.js +6 -4
- package/dist/unstable/encoding/Toml.js.map +1 -1
- package/dist/unstable/encoding/Yaml.d.ts +2 -0
- package/dist/unstable/encoding/Yaml.d.ts.map +1 -1
- package/dist/unstable/encoding/Yaml.js +16 -5
- package/dist/unstable/encoding/Yaml.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +2 -2
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +2 -2
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +5 -5
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +3 -3
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +15 -9
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +26 -12
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +13 -9
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +11 -5
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +25 -15
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +7 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +13 -3
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +2 -2
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +0 -10
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +29 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +5 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +1 -45
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +2 -64
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +1 -1
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/FindMyWay/internal/router.js +124 -33
- package/dist/unstable/http/FindMyWay/internal/router.js.map +1 -1
- package/dist/unstable/http/FindMyWay.d.ts +15 -5
- package/dist/unstable/http/FindMyWay.d.ts.map +1 -1
- package/dist/unstable/http/FindMyWay.js +3 -1
- package/dist/unstable/http/FindMyWay.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +0 -22
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +3 -34
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +41 -10
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +64 -10
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +1 -1
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +28 -18
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +28 -6
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +8 -19
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +6 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +10 -6
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +16 -0
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +121 -65
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +3 -3
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +1 -13
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +29 -21
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +12 -11
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +36 -10
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +5 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +22 -8
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +11 -42
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +16 -20
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +11 -11
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +1 -1
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +9 -13
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +34 -44
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +2 -2
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +19 -19
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/Mime.d.ts +28 -0
- package/dist/unstable/http/Mime.d.ts.map +1 -0
- package/dist/unstable/http/Mime.js +72 -0
- package/dist/unstable/http/Mime.js.map +1 -0
- package/dist/unstable/http/Multipart.d.ts +22 -9
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +26 -10
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts +1 -1
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts.map +1 -1
- package/dist/unstable/http/MultipartParser/internal/multipart.js +8 -3
- package/dist/unstable/http/MultipartParser/internal/multipart.js.map +1 -1
- package/dist/unstable/http/MultipartParser.d.ts +4 -3
- package/dist/unstable/http/MultipartParser.d.ts.map +1 -1
- package/dist/unstable/http/MultipartParser.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +0 -97
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +3 -104
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +4 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +4 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/compression.js +8 -11
- package/dist/unstable/http/internal/compression.js.map +1 -1
- package/dist/unstable/http/internal/headers.d.ts +2 -0
- package/dist/unstable/http/internal/headers.d.ts.map +1 -0
- package/dist/unstable/http/internal/headers.js +5 -0
- package/dist/unstable/http/internal/headers.js.map +1 -0
- package/dist/unstable/http/internal/httpBody.js +8 -0
- package/dist/unstable/http/internal/httpBody.js.map +1 -1
- package/dist/unstable/http/internal/mimeTypes.d.ts +361 -0
- package/dist/unstable/http/internal/mimeTypes.d.ts.map +1 -0
- package/dist/unstable/http/internal/mimeTypes.js +363 -0
- package/dist/unstable/http/internal/mimeTypes.js.map +1 -0
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +13 -0
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +28 -11
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +4 -3
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +25 -13
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +8 -3
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +9 -6
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +3 -1
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +7 -5
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +15 -12
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +12 -0
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +8 -10
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +6 -3
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +8 -2
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +31 -20
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/net/IpInterface.d.ts +140 -0
- package/dist/unstable/net/IpInterface.d.ts.map +1 -0
- package/dist/unstable/net/IpInterface.js +149 -0
- package/dist/unstable/net/IpInterface.js.map +1 -0
- package/dist/unstable/net/IpNetwork.d.ts +227 -0
- package/dist/unstable/net/IpNetwork.d.ts.map +1 -0
- package/dist/unstable/net/IpNetwork.js +239 -0
- package/dist/unstable/net/IpNetwork.js.map +1 -0
- package/dist/unstable/net/NetAddress.d.ts +705 -0
- package/dist/unstable/net/NetAddress.d.ts.map +1 -0
- package/dist/unstable/net/NetAddress.js +956 -0
- package/dist/unstable/net/NetAddress.js.map +1 -0
- package/dist/unstable/net/index.d.ts +16 -0
- package/dist/unstable/net/index.d.ts.map +1 -0
- package/dist/unstable/net/index.js +17 -0
- package/dist/unstable/net/index.js.map +1 -0
- package/dist/unstable/observability/OtlpExporter.d.ts +1 -0
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +4 -6
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +9 -9
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +9 -8
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +2 -2
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +82 -55
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.d.ts +1 -1
- package/dist/unstable/observability/internal/otlpEnv.d.ts.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js +5 -9
- package/dist/unstable/observability/internal/otlpEnv.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +1 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +114 -14
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +799 -234
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +28 -15
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +33 -41
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +8 -2
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +7 -2
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +6 -3
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +3 -6
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +6 -3
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +2 -3
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +1 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +6 -4
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +20 -6
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +26 -26
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +10 -12
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +5 -0
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +94 -81
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +66 -7
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +68 -9
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +7 -5
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +28 -33
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +56 -92
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +25 -0
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +125 -68
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +7 -6
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +3 -0
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +287 -102
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +408 -215
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +5 -32
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +3 -3
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +20 -0
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +14 -7
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +15 -0
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +1 -1
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +13 -5
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +29 -15
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Transferable.js +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +3 -1
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +7 -0
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +14 -4
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +1 -1
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +2 -2
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +8 -0
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +8 -0
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +5 -0
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +70 -12
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +6 -0
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +11 -0
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +2 -2
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +4 -2
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/package.json +8 -10
- package/src/Array.ts +142 -70
- package/src/BigDecimal.ts +50 -28
- package/src/ByteSize.ts +838 -0
- package/src/Cache.ts +17 -3
- package/src/Cause.ts +1 -1
- package/src/Channel.ts +185 -50
- package/src/Chunk.ts +65 -36
- package/src/Config.ts +237 -248
- package/src/ConfigProvider.ts +7 -8
- package/src/Context.ts +31 -0
- package/src/Cron.ts +2 -2
- package/src/Crypto.ts +3 -2
- package/src/Deferred.ts +7 -6
- package/src/Duration.ts +1 -1
- package/src/Effect.ts +226 -122
- package/src/Effectable.ts +78 -9
- package/src/Encoding.ts +101 -11
- package/src/Equal.ts +1 -1
- package/src/ExecutionPlan.ts +3 -0
- package/src/Fiber.ts +33 -8
- package/src/FiberHandle.ts +3 -3
- package/src/FiberMap.ts +19 -10
- package/src/FileSystem.ts +55 -230
- package/src/Formatter.ts +21 -3
- package/src/Graph.ts +55 -25
- package/src/Hash.ts +5 -16
- package/src/HashRing.ts +9 -2
- package/src/HashSet.ts +56 -0
- package/src/Iterable.ts +90 -44
- package/src/JsonPatch.ts +4 -4
- package/src/JsonPointer.ts +97 -4
- package/src/JsonSchema.ts +998 -476
- package/src/Layer.ts +59 -18
- package/src/LayerMap.ts +38 -6
- package/src/LayerRef.ts +7 -5
- package/src/Logger.ts +125 -18
- package/src/ManagedRuntime.ts +1 -1
- package/src/Match.ts +33 -14
- package/src/Metric.ts +24 -21
- package/src/MutableHashMap.ts +1 -1
- package/src/MutableHashSet.ts +1 -1
- package/src/MutableList.ts +18 -2
- package/src/Number.ts +7 -1
- package/src/Optic.ts +8 -4
- package/src/Option.ts +1 -1
- package/src/Order.ts +3 -1
- package/src/PartitionedSemaphore.ts +1 -2
- package/src/Path.ts +1 -1
- package/src/PlatformError.ts +1 -1
- package/src/Pool.ts +535 -134
- package/src/PrimaryKey.ts +1 -1
- package/src/PubSub.ts +32 -20
- package/src/Queue.ts +119 -28
- package/src/Random.ts +20 -6
- package/src/RcMap.ts +176 -13
- package/src/Record.ts +15 -0
- package/src/Redacted.ts +1 -1
- package/src/RequestResolver.ts +49 -26
- package/src/Result.ts +1 -1
- package/src/Scheduler.ts +21 -11
- package/src/Schema.ts +5032 -6518
- package/src/SchemaAST.ts +1156 -316
- package/src/SchemaGetter.ts +75 -21
- package/src/SchemaIssue.ts +260 -16
- package/src/SchemaParser.ts +2 -12
- package/src/SchemaRepresentation.ts +1774 -189
- package/src/SchemaTransformation.ts +145 -22
- package/src/Scope.ts +9 -2
- package/src/ScopedCache.ts +10 -3
- package/src/Sink.ts +31 -15
- package/src/StandardSchema.ts +207 -0
- package/src/Stream.ts +294 -76
- package/src/String.ts +20 -9
- package/src/Struct.ts +8 -4
- package/src/SynchronizedRef.ts +3 -5
- package/src/Terminal.ts +3 -3
- package/src/Tracer.ts +43 -14
- package/src/Tuple.ts +3 -1
- package/src/TxChunk.ts +1 -1
- package/src/TxDeferred.ts +1 -1
- package/src/TxHashMap.ts +1 -1
- package/src/TxHashSet.ts +92 -11
- package/src/TxPriorityQueue.ts +1 -1
- package/src/TxPubSub.ts +1 -1
- package/src/TxQueue.ts +22 -17
- package/src/TxReentrantLock.ts +29 -1
- package/src/TxRef.ts +1 -1
- package/src/TxSemaphore.ts +1 -1
- package/src/TxSubscriptionRef.ts +1 -1
- package/src/Types.ts +40 -17
- package/src/Utils.ts +3 -1
- package/src/index.ts +10 -0
- package/src/internal/arbitrary/model.ts +701 -0
- package/src/internal/arbitrary/regexp.ts +855 -0
- package/src/internal/arbitrary/runner.ts +608 -0
- package/src/internal/arbitrary/schema.ts +1800 -0
- package/src/internal/core.ts +48 -22
- package/src/internal/count.ts +14 -0
- package/src/internal/dateTime.ts +8 -10
- package/src/internal/effect.ts +510 -301
- package/src/internal/graph.ts +6 -1
- package/src/internal/hashMap.ts +5 -3
- package/src/internal/hashSet.ts +1 -1
- package/src/internal/matcher.ts +34 -19
- package/src/internal/metric.ts +1 -1
- package/src/internal/option.ts +8 -6
- package/src/internal/random.ts +20 -7
- package/src/internal/rcRef.ts +10 -7
- package/src/internal/references.ts +1 -0
- package/src/internal/request.ts +12 -7
- package/src/internal/result.ts +15 -11
- package/src/internal/schema/annotations.ts +3 -3
- package/src/internal/schema/fromJsonSchemaDocument.ts +326 -160
- package/src/internal/schema/fromRepresentation.ts +5 -3
- package/src/internal/schema/{schema.ts → make.ts} +0 -40
- package/src/internal/schema/parser.ts +8 -0
- package/src/internal/schema/standardSchema.ts +125 -0
- package/src/internal/schema/toCodeDocument.ts +58 -44
- package/src/internal/schema/toCodec.ts +312 -0
- package/src/internal/schema/toDifferJsonPatch.ts +24 -0
- package/src/internal/schema/toEncoderXml.ts +110 -0
- package/src/internal/schema/toEquivalence.ts +76 -0
- package/src/internal/schema/toFormatter.ts +230 -0
- package/src/internal/schema/toIso.ts +20 -0
- package/src/internal/schema/toJsonSchemaDocument.ts +125 -67
- package/src/internal/schema/toRepresentation.ts +1 -1
- package/src/internal/schemaError.ts +8 -0
- package/src/internal/stream.ts +14 -6
- package/src/internal/tracer.ts +4 -0
- package/src/internal/trie.ts +5 -2
- package/src/internal/uuid.ts +4 -0
- package/src/testing/TestSchema.ts +36 -30
- package/src/testing/index.ts +0 -5
- package/src/unstable/ai/AiError.ts +126 -6
- package/src/unstable/ai/AnthropicStructuredOutput.ts +8 -5
- package/src/unstable/ai/Chat.ts +35 -36
- package/src/unstable/ai/EmbeddingModel.ts +27 -15
- package/src/unstable/ai/LanguageModel.ts +283 -100
- package/src/unstable/ai/McpServer.ts +105 -92
- package/src/unstable/ai/OpenAiStructuredOutput.ts +6 -3
- package/src/unstable/ai/Prompt.ts +20 -5
- package/src/unstable/ai/Response.ts +107 -189
- package/src/unstable/ai/Tokenizer.ts +4 -5
- package/src/unstable/ai/Tool.ts +58 -35
- package/src/unstable/ai/Toolkit.ts +43 -37
- package/src/unstable/ai/internal/codec-transformer.ts +3 -2
- package/src/unstable/ai/internal/structured-output.ts +29 -6
- package/src/unstable/arbitrary/Arbitrary.ts +715 -0
- package/src/unstable/arbitrary/index.ts +10 -0
- package/src/unstable/cli/Argument.ts +111 -115
- package/src/unstable/cli/CliError.ts +2 -0
- package/src/unstable/cli/CliOutput.ts +41 -4
- package/src/unstable/cli/Command.ts +79 -78
- package/src/unstable/cli/Completions.ts +4 -4
- package/src/unstable/cli/Flag.ts +158 -169
- package/src/unstable/cli/GlobalFlag.ts +13 -13
- package/src/unstable/cli/Param.ts +150 -159
- package/src/unstable/cli/Primitive.ts +75 -76
- package/src/unstable/cli/Prompt.ts +543 -408
- package/src/unstable/cli/internal/completions/bash.ts +113 -38
- package/src/unstable/cli/internal/completions/descriptor.ts +23 -11
- package/src/unstable/cli/internal/completions/fish.ts +17 -9
- package/src/unstable/cli/internal/completions/zsh.ts +7 -4
- package/src/unstable/cli/internal/config.ts +4 -4
- package/src/unstable/cli/internal/parser.ts +1 -1
- package/src/unstable/cli/internal/wizard.ts +60 -32
- package/src/unstable/cluster/ClusterSchema.ts +19 -1
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +66 -16
- package/src/unstable/cluster/Entity.ts +3 -0
- package/src/unstable/cluster/EntityProxyServer.ts +6 -2
- package/src/unstable/cluster/Envelope.ts +32 -3
- package/src/unstable/cluster/HttpRunner.ts +52 -25
- package/src/unstable/cluster/Message.ts +35 -13
- package/src/unstable/cluster/MessageStorage.ts +69 -24
- package/src/unstable/cluster/Reply.ts +36 -19
- package/src/unstable/cluster/RunnerServer.ts +21 -11
- package/src/unstable/cluster/Runners.ts +93 -80
- package/src/unstable/cluster/Sharding.ts +44 -19
- package/src/unstable/cluster/ShardingConfig.ts +23 -23
- package/src/unstable/cluster/SocketRunner.ts +5 -4
- package/src/unstable/cluster/SqlMessageStorage.ts +12 -8
- package/src/unstable/cluster/SqlRunnerStorage.ts +18 -10
- package/src/unstable/cluster/internal/clusterAbandon.ts +14 -0
- package/src/unstable/cluster/internal/entityManager.ts +15 -6
- package/src/unstable/cluster/internal/interruptors.ts +58 -1
- package/src/unstable/cluster/internal/resourceRef.ts +15 -7
- package/src/unstable/devtools/DevToolsClient.ts +13 -3
- package/src/unstable/encoding/Ini.ts +2 -0
- package/src/unstable/encoding/SchemaBinary.ts +5308 -0
- package/src/unstable/encoding/Sse.ts +1 -1
- package/src/unstable/encoding/Toml.ts +7 -5
- package/src/unstable/encoding/Yaml.ts +18 -5
- package/src/unstable/encoding/index.ts +2 -2
- package/src/unstable/eventlog/Event.ts +7 -7
- package/src/unstable/eventlog/EventJournal.ts +22 -15
- package/src/unstable/eventlog/EventLog.ts +24 -14
- package/src/unstable/eventlog/EventLogMessage.ts +25 -15
- package/src/unstable/eventlog/EventLogRemote.ts +15 -4
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +2 -2
- package/src/unstable/eventlog/SqlEventJournal.ts +35 -10
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +11 -1
- package/src/unstable/http/Cookies.ts +2 -102
- package/src/unstable/http/FetchHttpClient.ts +1 -1
- package/src/unstable/http/FindMyWay/internal/router.ts +139 -33
- package/src/unstable/http/FindMyWay.ts +15 -5
- package/src/unstable/http/Headers.ts +3 -48
- package/src/unstable/http/HttpBody.ts +107 -36
- package/src/unstable/http/HttpClient.ts +41 -30
- package/src/unstable/http/HttpClientRequest.ts +32 -18
- package/src/unstable/http/HttpClientResponse.ts +16 -3
- package/src/unstable/http/HttpEffect.ts +145 -73
- package/src/unstable/http/HttpIncomingMessage.ts +4 -4
- package/src/unstable/http/HttpMiddleware.ts +43 -24
- package/src/unstable/http/HttpPlatform.ts +62 -20
- package/src/unstable/http/HttpRouter.ts +27 -16
- package/src/unstable/http/HttpServer.ts +18 -57
- package/src/unstable/http/HttpServerRequest.ts +17 -15
- package/src/unstable/http/HttpServerRespondable.ts +1 -1
- package/src/unstable/http/HttpServerResponse.ts +49 -40
- package/src/unstable/http/HttpStaticServer.ts +30 -28
- package/src/unstable/http/Mime.ts +76 -0
- package/src/unstable/http/Multipart.ts +35 -18
- package/src/unstable/http/MultipartParser/internal/multipart.ts +10 -3
- package/src/unstable/http/MultipartParser.ts +4 -3
- package/src/unstable/http/UrlParams.ts +3 -161
- package/src/unstable/http/index.ts +5 -0
- package/src/unstable/http/internal/compression.ts +11 -12
- package/src/unstable/http/internal/headers.ts +7 -0
- package/src/unstable/http/internal/httpBody.ts +9 -0
- package/src/unstable/http/internal/mimeTypes.ts +395 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +63 -11
- package/src/unstable/httpapi/HttpApiClient.ts +44 -24
- package/src/unstable/httpapi/HttpApiEndpoint.ts +24 -11
- package/src/unstable/httpapi/HttpApiError.ts +3 -1
- package/src/unstable/httpapi/HttpApiMiddleware.ts +7 -5
- package/src/unstable/httpapi/HttpApiScalar.ts +30 -27
- package/src/unstable/httpapi/HttpApiSchema.ts +14 -7
- package/src/unstable/httpapi/HttpApiSwagger.ts +6 -3
- package/src/unstable/httpapi/HttpApiTest.ts +6 -1
- package/src/unstable/httpapi/OpenApi.ts +32 -22
- package/src/unstable/net/IpInterface.ts +242 -0
- package/src/unstable/net/IpNetwork.ts +357 -0
- package/src/unstable/net/NetAddress.ts +1271 -0
- package/src/unstable/net/index.ts +20 -0
- package/src/unstable/observability/OtlpExporter.ts +5 -6
- package/src/unstable/observability/OtlpLogger.ts +9 -9
- package/src/unstable/observability/OtlpMetrics.ts +9 -8
- package/src/unstable/observability/OtlpResource.ts +5 -4
- package/src/unstable/observability/OtlpTracer.ts +103 -81
- package/src/unstable/observability/internal/otlpEnv.ts +10 -13
- package/src/unstable/persistence/PersistedCache.ts +1 -1
- package/src/unstable/persistence/PersistedQueue.ts +1100 -291
- package/src/unstable/persistence/RateLimiter.ts +64 -58
- package/src/unstable/process/ChildProcess.ts +15 -4
- package/src/unstable/process/ChildProcessSpawner.ts +1 -1
- package/src/unstable/reactivity/Atom.ts +6 -3
- package/src/unstable/reactivity/AtomHttpApi.ts +21 -10
- package/src/unstable/reactivity/AtomRegistry.ts +2 -4
- package/src/unstable/reactivity/AtomRpc.ts +6 -5
- package/src/unstable/reactivity/Hydration.ts +26 -7
- package/src/unstable/reactivity/Reactivity.ts +49 -36
- package/src/unstable/rpc/RpcClient.ts +100 -82
- package/src/unstable/rpc/RpcMessage.ts +78 -11
- package/src/unstable/rpc/RpcMiddleware.ts +7 -5
- package/src/unstable/rpc/RpcSerialization.ts +82 -92
- package/src/unstable/rpc/RpcServer.ts +171 -93
- package/src/unstable/schema/Model.ts +8 -7
- package/src/unstable/schema/VariantSchema.ts +3 -0
- package/src/unstable/socket/Socket.ts +714 -383
- package/src/unstable/socket/SocketServer.ts +5 -35
- package/src/unstable/sql/SqlClient.ts +42 -7
- package/src/unstable/sql/SqlConnection.ts +18 -0
- package/src/unstable/sql/SqlModel.ts +1 -1
- package/src/unstable/sql/Statement.ts +46 -20
- package/src/unstable/workers/Transferable.ts +1 -1
- package/src/unstable/workers/Worker.ts +3 -1
- package/src/unstable/workflow/Activity.ts +20 -9
- package/src/unstable/workflow/DurableClock.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +6 -0
- package/src/unstable/workflow/DurableQueue.ts +8 -0
- package/src/unstable/workflow/Workflow.ts +105 -28
- package/src/unstable/workflow/WorkflowEngine.ts +22 -0
- package/src/unstable/workflow/WorkflowProxy.ts +8 -4
- package/dist/internal/schema/schema.d.ts.map +0 -1
- package/dist/internal/schema/schema.js.map +0 -1
- package/dist/internal/schema/toArbitrary.d.ts +0 -2
- package/dist/internal/schema/toArbitrary.d.ts.map +0 -1
- package/dist/internal/schema/toArbitrary.js +0 -705
- package/dist/internal/schema/toArbitrary.js.map +0 -1
- package/dist/testing/FastCheck.d.ts +0 -90
- package/dist/testing/FastCheck.d.ts.map +0 -1
- package/dist/testing/FastCheck.js +0 -90
- package/dist/testing/FastCheck.js.map +0 -1
- package/dist/unstable/encoding/Msgpack.d.ts +0 -185
- package/dist/unstable/encoding/Msgpack.d.ts.map +0 -1
- package/dist/unstable/encoding/Msgpack.js +0 -227
- package/dist/unstable/encoding/Msgpack.js.map +0 -1
- package/src/internal/schema/toArbitrary.ts +0 -843
- package/src/testing/FastCheck.ts +0 -90
- package/src/unstable/encoding/Msgpack.ts +0 -432
- /package/dist/internal/{schema → arbitrary}/schema.d.ts +0 -0
package/src/Config.ts
CHANGED
|
@@ -40,7 +40,7 @@ const TypeId = "~effect/Config"
|
|
|
40
40
|
* ```ts import.meta.vitest
|
|
41
41
|
* import { Config } from "effect"
|
|
42
42
|
*
|
|
43
|
-
* Config.isConfig(Config.
|
|
43
|
+
* Config.isConfig(Config.String("HOST")) // => true
|
|
44
44
|
* Config.isConfig("not a config") // => false
|
|
45
45
|
* ```
|
|
46
46
|
*
|
|
@@ -236,7 +236,7 @@ const preserveInputEvidence = <T>(
|
|
|
236
236
|
* ```ts import.meta.vitest
|
|
237
237
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
238
238
|
*
|
|
239
|
-
* const upper = Config.
|
|
239
|
+
* const upper = Config.String("name").pipe(
|
|
240
240
|
* Config.map((s) => s.toUpperCase())
|
|
241
241
|
* )
|
|
242
242
|
*
|
|
@@ -244,7 +244,7 @@ const preserveInputEvidence = <T>(
|
|
|
244
244
|
* Effect.runSync(upper.parse(provider)) // => "ALICE"
|
|
245
245
|
* ```
|
|
246
246
|
*
|
|
247
|
-
* @see {@link
|
|
247
|
+
* @see {@link mapEffect} – when the transformation can fail
|
|
248
248
|
*
|
|
249
249
|
* @category mapping
|
|
250
250
|
* @since 2.0.0
|
|
@@ -263,7 +263,7 @@ export const map: {
|
|
|
263
263
|
* ```ts import.meta.vitest
|
|
264
264
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
265
265
|
*
|
|
266
|
-
* const upper = Config.
|
|
266
|
+
* const upper = Config.String("name").pipe(
|
|
267
267
|
* Config.map((s) => s.toUpperCase())
|
|
268
268
|
* )
|
|
269
269
|
*
|
|
@@ -271,7 +271,7 @@ export const map: {
|
|
|
271
271
|
* Effect.runSync(upper.parse(provider)) // => "ALICE"
|
|
272
272
|
* ```
|
|
273
273
|
*
|
|
274
|
-
* @see {@link
|
|
274
|
+
* @see {@link mapEffect} – when the transformation can fail
|
|
275
275
|
*
|
|
276
276
|
* @category mapping
|
|
277
277
|
* @since 2.0.0
|
|
@@ -290,7 +290,7 @@ export const map: {
|
|
|
290
290
|
* ```ts import.meta.vitest
|
|
291
291
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
292
292
|
*
|
|
293
|
-
* const upper = Config.
|
|
293
|
+
* const upper = Config.String("name").pipe(
|
|
294
294
|
* Config.map((s) => s.toUpperCase())
|
|
295
295
|
* )
|
|
296
296
|
*
|
|
@@ -298,7 +298,7 @@ export const map: {
|
|
|
298
298
|
* Effect.runSync(upper.parse(provider)) // => "ALICE"
|
|
299
299
|
* ```
|
|
300
300
|
*
|
|
301
|
-
* @see {@link
|
|
301
|
+
* @see {@link mapEffect} – when the transformation can fail
|
|
302
302
|
*
|
|
303
303
|
* @category mapping
|
|
304
304
|
* @since 2.0.0
|
|
@@ -326,8 +326,8 @@ export const map: {
|
|
|
326
326
|
* ```ts import.meta.vitest
|
|
327
327
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
328
328
|
*
|
|
329
|
-
* const trimmed = Config.
|
|
330
|
-
* Config.
|
|
329
|
+
* const trimmed = Config.String("name").pipe(
|
|
330
|
+
* Config.mapEffect((s) => Effect.succeed(s.trim()))
|
|
331
331
|
* )
|
|
332
332
|
* const provider = ConfigProvider.fromUnknown({ name: " Alice " })
|
|
333
333
|
* Effect.runSync(trimmed.parse(provider)) // => "Alice"
|
|
@@ -338,7 +338,7 @@ export const map: {
|
|
|
338
338
|
* @category mapping
|
|
339
339
|
* @since 2.0.0
|
|
340
340
|
*/
|
|
341
|
-
export const
|
|
341
|
+
export const mapEffect: {
|
|
342
342
|
/**
|
|
343
343
|
* Transforms the parsed value with a function that may fail.
|
|
344
344
|
*
|
|
@@ -352,8 +352,8 @@ export const mapOrFail: {
|
|
|
352
352
|
* ```ts import.meta.vitest
|
|
353
353
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
354
354
|
*
|
|
355
|
-
* const trimmed = Config.
|
|
356
|
-
* Config.
|
|
355
|
+
* const trimmed = Config.String("name").pipe(
|
|
356
|
+
* Config.mapEffect((s) => Effect.succeed(s.trim()))
|
|
357
357
|
* )
|
|
358
358
|
* const provider = ConfigProvider.fromUnknown({ name: " Alice " })
|
|
359
359
|
* Effect.runSync(trimmed.parse(provider)) // => "Alice"
|
|
@@ -378,8 +378,8 @@ export const mapOrFail: {
|
|
|
378
378
|
* ```ts import.meta.vitest
|
|
379
379
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
380
380
|
*
|
|
381
|
-
* const trimmed = Config.
|
|
382
|
-
* Config.
|
|
381
|
+
* const trimmed = Config.String("name").pipe(
|
|
382
|
+
* Config.mapEffect((s) => Effect.succeed(s.trim()))
|
|
383
383
|
* )
|
|
384
384
|
* const provider = ConfigProvider.fromUnknown({ name: " Alice " })
|
|
385
385
|
* Effect.runSync(trimmed.parse(provider)) // => "Alice"
|
|
@@ -429,7 +429,7 @@ export const mapOrFail: {
|
|
|
429
429
|
* ```ts import.meta.vitest
|
|
430
430
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
431
431
|
*
|
|
432
|
-
* const hostConfig = Config.
|
|
432
|
+
* const hostConfig = Config.String("HOST").pipe(
|
|
433
433
|
* Config.orElse(() => Config.succeed("localhost"))
|
|
434
434
|
* )
|
|
435
435
|
* const provider = ConfigProvider.fromUnknown({})
|
|
@@ -468,7 +468,7 @@ export const orElse: {
|
|
|
468
468
|
* ```ts import.meta.vitest
|
|
469
469
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
470
470
|
*
|
|
471
|
-
* const hostConfig = Config.
|
|
471
|
+
* const hostConfig = Config.String("HOST").pipe(
|
|
472
472
|
* Config.orElse(() => Config.succeed("localhost"))
|
|
473
473
|
* )
|
|
474
474
|
* const provider = ConfigProvider.fromUnknown({})
|
|
@@ -507,7 +507,7 @@ export const orElse: {
|
|
|
507
507
|
* ```ts import.meta.vitest
|
|
508
508
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
509
509
|
*
|
|
510
|
-
* const hostConfig = Config.
|
|
510
|
+
* const hostConfig = Config.String("HOST").pipe(
|
|
511
511
|
* Config.orElse(() => Config.succeed("localhost"))
|
|
512
512
|
* )
|
|
513
513
|
* const provider = ConfigProvider.fromUnknown({})
|
|
@@ -547,7 +547,7 @@ export const orElse: {
|
|
|
547
547
|
* ```ts import.meta.vitest
|
|
548
548
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
549
549
|
*
|
|
550
|
-
* const hostConfig = Config.
|
|
550
|
+
* const hostConfig = Config.String("HOST").pipe(
|
|
551
551
|
* Config.orElse(() => Config.succeed("localhost"))
|
|
552
552
|
* )
|
|
553
553
|
* const provider = ConfigProvider.fromUnknown({})
|
|
@@ -602,8 +602,8 @@ export const orElse: {
|
|
|
602
602
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
603
603
|
*
|
|
604
604
|
* const dbConfig = Config.all({
|
|
605
|
-
* host: Config.
|
|
606
|
-
* port: Config.
|
|
605
|
+
* host: Config.String("host"),
|
|
606
|
+
* port: Config.Number("port")
|
|
607
607
|
* })
|
|
608
608
|
*
|
|
609
609
|
* const provider = ConfigProvider.fromUnknown({ host: "localhost", port: 5432 })
|
|
@@ -625,12 +625,12 @@ export function all<const Arg extends Iterable<Config<any>> | Record<string, Con
|
|
|
625
625
|
}
|
|
626
626
|
: never
|
|
627
627
|
> {
|
|
628
|
-
const configs: Array<Config<any>> | Record<string, Config<any>> = Array.isArray(arg)
|
|
628
|
+
const configs: Array<Config<any>> | Record<string, Config<any>> = globalThis.Array.isArray(arg)
|
|
629
629
|
? arg
|
|
630
630
|
: Symbol.iterator in arg
|
|
631
631
|
? [...arg as any]
|
|
632
632
|
: arg
|
|
633
|
-
if (Array.isArray(configs)) {
|
|
633
|
+
if (globalThis.Array.isArray(configs)) {
|
|
634
634
|
return make((provider, pathPrefix) =>
|
|
635
635
|
Effect.flatMapEager(
|
|
636
636
|
Effect.all(configs.map((config) => Effect.result(evaluateAt(config, provider, pathPrefix)))),
|
|
@@ -729,7 +729,7 @@ const resolveRecord = (
|
|
|
729
729
|
* ```ts import.meta.vitest
|
|
730
730
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
731
731
|
*
|
|
732
|
-
* const port = Config.
|
|
732
|
+
* const port = Config.Number("port").pipe(Config.withDefault(3000))
|
|
733
733
|
*
|
|
734
734
|
* const provider = ConfigProvider.fromUnknown({})
|
|
735
735
|
* Effect.runSync(port.parse(provider)) // => 3000
|
|
@@ -763,7 +763,7 @@ export const withDefault: {
|
|
|
763
763
|
* ```ts import.meta.vitest
|
|
764
764
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
765
765
|
*
|
|
766
|
-
* const port = Config.
|
|
766
|
+
* const port = Config.Number("port").pipe(Config.withDefault(3000))
|
|
767
767
|
*
|
|
768
768
|
* const provider = ConfigProvider.fromUnknown({})
|
|
769
769
|
* Effect.runSync(port.parse(provider)) // => 3000
|
|
@@ -797,7 +797,7 @@ export const withDefault: {
|
|
|
797
797
|
* ```ts import.meta.vitest
|
|
798
798
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
799
799
|
*
|
|
800
|
-
* const port = Config.
|
|
800
|
+
* const port = Config.Number("port").pipe(Config.withDefault(3000))
|
|
801
801
|
*
|
|
802
802
|
* const provider = ConfigProvider.fromUnknown({})
|
|
803
803
|
* Effect.runSync(port.parse(provider)) // => 3000
|
|
@@ -832,7 +832,7 @@ export const withDefault: {
|
|
|
832
832
|
* ```ts import.meta.vitest
|
|
833
833
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
834
834
|
*
|
|
835
|
-
* const port = Config.
|
|
835
|
+
* const port = Config.Number("port").pipe(Config.withDefault(3000))
|
|
836
836
|
*
|
|
837
837
|
* const provider = ConfigProvider.fromUnknown({})
|
|
838
838
|
* Effect.runSync(port.parse(provider)) // => 3000
|
|
@@ -873,7 +873,7 @@ export const withDefault: {
|
|
|
873
873
|
* ```ts import.meta.vitest
|
|
874
874
|
* import { Config, ConfigProvider, Effect, Option } from "effect"
|
|
875
875
|
*
|
|
876
|
-
* const maybePort = Config.option(Config.
|
|
876
|
+
* const maybePort = Config.option(Config.Number("port"))
|
|
877
877
|
*
|
|
878
878
|
* const provider = ConfigProvider.fromUnknown({})
|
|
879
879
|
* Effect.runSync(maybePort.parse(provider)) // => Option.none()
|
|
@@ -956,7 +956,7 @@ type IsPlainObject<A> = [A] extends [Record<string, any>]
|
|
|
956
956
|
* const makeConfig = (config: Config.Wrap<Options>): Config.Config<Options> =>
|
|
957
957
|
* Config.unwrap(config)
|
|
958
958
|
*
|
|
959
|
-
* const config = makeConfig({ key: Config.
|
|
959
|
+
* const config = makeConfig({ key: Config.String("key") })
|
|
960
960
|
* const provider = ConfigProvider.fromUnknown({ key: "value" })
|
|
961
961
|
* Effect.runSync(config.parse(provider)) // => { key: "value" }
|
|
962
962
|
* ```
|
|
@@ -1006,7 +1006,7 @@ const decodeFromCursor = (
|
|
|
1006
1006
|
SchemaAST.unknown,
|
|
1007
1007
|
ast,
|
|
1008
1008
|
new SchemaTransformation.Transformation(
|
|
1009
|
-
SchemaGetter.
|
|
1009
|
+
SchemaGetter.transformEffect((input: unknown) => decode(input as ConfigCursor)),
|
|
1010
1010
|
SchemaGetter.passthrough()
|
|
1011
1011
|
)
|
|
1012
1012
|
)
|
|
@@ -1122,7 +1122,7 @@ const toConfigCursorAST = memoize((root: SchemaAST.AST): SchemaAST.AST => {
|
|
|
1122
1122
|
* {@link nested} calls. Pass a single string for a flat key or an array for
|
|
1123
1123
|
* nested paths.
|
|
1124
1124
|
*
|
|
1125
|
-
* Convenience constructors such as `
|
|
1125
|
+
* Convenience constructors such as `String`, `Number`, and `Boolean` delegate
|
|
1126
1126
|
* to this API.
|
|
1127
1127
|
*
|
|
1128
1128
|
* The codec is converted to its canonical `StringTree` form. Its encoded shape
|
|
@@ -1183,7 +1183,7 @@ const toConfigCursorAST = memoize((root: SchemaAST.AST): SchemaAST.AST => {
|
|
|
1183
1183
|
* Effect.runSync(DbConfig.parse(provider)) // => { host: "localhost", port: 5432 }
|
|
1184
1184
|
* ```
|
|
1185
1185
|
*
|
|
1186
|
-
* @see {@link
|
|
1186
|
+
* @see {@link String} / {@link Number} / {@link Boolean} – shortcuts for
|
|
1187
1187
|
* single-value configs
|
|
1188
1188
|
*
|
|
1189
1189
|
* @category schemas
|
|
@@ -1220,172 +1220,20 @@ export function schema<T>(codec: Schema.ConstraintCodec<T, unknown>, path?: stri
|
|
|
1220
1220
|
})
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
|
-
|
|
1224
|
-
export const TrueValues = Schema.Literals(["true", "yes", "on", "1", "y"])
|
|
1223
|
+
const PortSchema = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65535 }))
|
|
1225
1224
|
|
|
1226
|
-
|
|
1227
|
-
export const FalseValues = Schema.Literals(["false", "no", "off", "0", "n"])
|
|
1225
|
+
const LogLevelSchema = Schema.Literals(LogLevel_.values)
|
|
1228
1226
|
|
|
1229
|
-
|
|
1230
|
-
* Schema for boolean values encoded as strings.
|
|
1231
|
-
*
|
|
1232
|
-
* **When to use**
|
|
1233
|
-
*
|
|
1234
|
-
* Use when you need the reusable boolean schema value for `Config.schema` with
|
|
1235
|
-
* custom paths.
|
|
1236
|
-
*
|
|
1237
|
-
* **Details**
|
|
1238
|
-
*
|
|
1239
|
-
* Accepted string values: `true`, `false`, `yes`, `no`, `on`, `off`, `1`,
|
|
1240
|
-
* `0`, `y`, `n` (case-sensitive).
|
|
1241
|
-
*
|
|
1242
|
-
* @see {@link boolean} – convenience constructor
|
|
1243
|
-
*
|
|
1244
|
-
* @category schemas
|
|
1245
|
-
* @since 4.0.0
|
|
1246
|
-
*/
|
|
1247
|
-
export const Boolean = Schema.Literals([...TrueValues.literals, ...FalseValues.literals]).pipe(
|
|
1248
|
-
Schema.decodeTo(
|
|
1249
|
-
Schema.Boolean,
|
|
1250
|
-
SchemaTransformation.transform({
|
|
1251
|
-
decode: (value) => value === "true" || value === "yes" || value === "on" || value === "1" || value === "y",
|
|
1252
|
-
encode: (value) => value ? "true" : "false"
|
|
1253
|
-
})
|
|
1254
|
-
)
|
|
1255
|
-
)
|
|
1256
|
-
|
|
1257
|
-
/**
|
|
1258
|
-
* Schema for port numbers (integers in 1–65535).
|
|
1259
|
-
*
|
|
1260
|
-
* **When to use**
|
|
1261
|
-
*
|
|
1262
|
-
* Use when you need the reusable port schema value for `Config.schema` with
|
|
1263
|
-
* custom paths.
|
|
1264
|
-
*
|
|
1265
|
-
* @see {@link port} – convenience constructor
|
|
1266
|
-
*
|
|
1267
|
-
* @category schemas
|
|
1268
|
-
* @since 4.0.0
|
|
1269
|
-
*/
|
|
1270
|
-
export const Port = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65535 }))
|
|
1271
|
-
|
|
1272
|
-
/**
|
|
1273
|
-
* Schema for `LogLevel` string literals.
|
|
1274
|
-
*
|
|
1275
|
-
* **When to use**
|
|
1276
|
-
*
|
|
1277
|
-
* Use when you need the reusable log-level schema value for `Config.schema`
|
|
1278
|
-
* with custom paths.
|
|
1279
|
-
*
|
|
1280
|
-
* **Details**
|
|
1281
|
-
*
|
|
1282
|
-
* Accepted values: `"All"`, `"Fatal"`, `"Error"`, `"Warn"`, `"Info"`,
|
|
1283
|
-
* `"Debug"`, `"Trace"`, `"None"`.
|
|
1284
|
-
*
|
|
1285
|
-
* @see {@link logLevel} – convenience constructor
|
|
1286
|
-
*
|
|
1287
|
-
* @category schemas
|
|
1288
|
-
* @since 4.0.0
|
|
1289
|
-
*/
|
|
1290
|
-
export const LogLevel = Schema.Literals(LogLevel_.values)
|
|
1291
|
-
|
|
1292
|
-
/**
|
|
1293
|
-
* Schema for key-value record types that can also be parsed from
|
|
1294
|
-
* a flat comma-separated string.
|
|
1295
|
-
*
|
|
1296
|
-
* **When to use**
|
|
1297
|
-
*
|
|
1298
|
-
* Use when reading key-value maps from a single env var (e.g. OpenTelemetry
|
|
1299
|
-
* resource attributes).
|
|
1300
|
-
*
|
|
1301
|
-
* **Details**
|
|
1302
|
-
*
|
|
1303
|
-
* Accepts either a JSON-like record from the provider or a flat string like
|
|
1304
|
-
* `"key1=val1,key2=val2"`. The `separator` (default `","`) and
|
|
1305
|
-
* `keyValueSeparator` (default `"="`) can be customized.
|
|
1306
|
-
*
|
|
1307
|
-
* **Example** (Parsing a comma-separated record)
|
|
1308
|
-
*
|
|
1309
|
-
* ```ts import.meta.vitest
|
|
1310
|
-
* import { Config, ConfigProvider, Effect, Schema } from "effect"
|
|
1311
|
-
*
|
|
1312
|
-
* const schema = Config.Record(Schema.String, Schema.String)
|
|
1313
|
-
* const config = Config.schema(schema, "OTEL_RESOURCE_ATTRIBUTES")
|
|
1314
|
-
*
|
|
1315
|
-
* const provider = ConfigProvider.fromEnv({
|
|
1316
|
-
* env: {
|
|
1317
|
-
* OTEL_RESOURCE_ATTRIBUTES:
|
|
1318
|
-
* "service.name=my-service,service.version=1.0.0,custom.attribute=value"
|
|
1319
|
-
* }
|
|
1320
|
-
* })
|
|
1321
|
-
*
|
|
1322
|
-
* const result = Effect.runSync(config.parse(provider))
|
|
1323
|
-
* result["service.name"] // => "my-service"
|
|
1324
|
-
* result["service.version"] // => "1.0.0"
|
|
1325
|
-
* result["custom.attribute"] // => "value"
|
|
1326
|
-
* ```
|
|
1327
|
-
*
|
|
1328
|
-
* @see {@link Array} for separated or structural array input
|
|
1329
|
-
*
|
|
1330
|
-
* @category schemas
|
|
1331
|
-
* @since 4.0.0
|
|
1332
|
-
*/
|
|
1333
|
-
export const Record = <K extends Schema.Record.Key, V extends Schema.Constraint>(key: K, value: V, options?: {
|
|
1227
|
+
interface ArrayOptions {
|
|
1334
1228
|
readonly separator?: string | undefined
|
|
1335
|
-
readonly keyValueSeparator?: string | undefined
|
|
1336
|
-
}) => {
|
|
1337
|
-
const record = Schema.Record(key, value)
|
|
1338
|
-
const split = SchemaTransformation.splitKeyValue(options)
|
|
1339
|
-
const recordString = Schema.String.pipe(
|
|
1340
|
-
Schema.decodeTo(Schema.toCodecStringTree(record), {
|
|
1341
|
-
decode: split.decode,
|
|
1342
|
-
encode: SchemaGetter.passthrough<Record<string, string>, Schema.StringTree>({ strict: false }).compose(
|
|
1343
|
-
split.encode
|
|
1344
|
-
)
|
|
1345
|
-
})
|
|
1346
|
-
)
|
|
1347
|
-
|
|
1348
|
-
return Schema.Union([record, recordString])
|
|
1349
1229
|
}
|
|
1350
1230
|
|
|
1351
|
-
|
|
1231
|
+
interface RecordOptions {
|
|
1352
1232
|
readonly separator?: string | undefined
|
|
1353
|
-
|
|
1354
|
-
const array = Schema.Array(value)
|
|
1355
|
-
const separator = options?.separator ?? ","
|
|
1356
|
-
const arrayString = Schema.String.pipe(
|
|
1357
|
-
Schema.decodeTo(Schema.toCodecStringTree(array), {
|
|
1358
|
-
decode: SchemaGetter.split(options),
|
|
1359
|
-
encode: SchemaGetter.passthrough<ReadonlyArray<string>, Schema.StringTree>({ strict: false }).compose(
|
|
1360
|
-
SchemaGetter.transform((input) => input.join(separator))
|
|
1361
|
-
)
|
|
1362
|
-
})
|
|
1363
|
-
)
|
|
1364
|
-
|
|
1365
|
-
return Schema.Union([arrayString, array])
|
|
1233
|
+
readonly keyValueSeparator?: string | undefined
|
|
1366
1234
|
}
|
|
1367
1235
|
|
|
1368
|
-
|
|
1369
|
-
/**
|
|
1370
|
-
* Schema for array types that can also be parsed from a flat separated string.
|
|
1371
|
-
*
|
|
1372
|
-
* **When to use**
|
|
1373
|
-
*
|
|
1374
|
-
* Use when reading array values from a single env var, such as comma-separated
|
|
1375
|
-
* exporter names.
|
|
1376
|
-
*
|
|
1377
|
-
* **Details**
|
|
1378
|
-
*
|
|
1379
|
-
* Accepts either a JSON-like array from the provider or a flat string like
|
|
1380
|
-
* `"a,b,c"`. The `separator` defaults to `","` and can be customized.
|
|
1381
|
-
*
|
|
1382
|
-
* @see {@link Record} for separated or structural record input
|
|
1383
|
-
*
|
|
1384
|
-
* @category schemas
|
|
1385
|
-
* @since 4.0.0
|
|
1386
|
-
*/
|
|
1387
|
-
ArrayConfig as Array
|
|
1388
|
-
}
|
|
1236
|
+
const isPath = (u: unknown): u is string | Path => Predicate.isString(u) || globalThis.Array.isArray(u)
|
|
1389
1237
|
|
|
1390
1238
|
// -----------------------------------------------------------------------------
|
|
1391
1239
|
// constructors
|
|
@@ -1420,7 +1268,7 @@ export function fail(err: SourceError | Schema.SchemaError) {
|
|
|
1420
1268
|
* ```ts import.meta.vitest
|
|
1421
1269
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1422
1270
|
*
|
|
1423
|
-
* const host = Config.
|
|
1271
|
+
* const host = Config.String("HOST").pipe(
|
|
1424
1272
|
* Config.orElse(() => Config.succeed("localhost"))
|
|
1425
1273
|
* )
|
|
1426
1274
|
* const provider = ConfigProvider.fromUnknown({})
|
|
@@ -1450,19 +1298,19 @@ export function succeed<T>(value: T) {
|
|
|
1450
1298
|
* ```ts import.meta.vitest
|
|
1451
1299
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1452
1300
|
*
|
|
1453
|
-
* const host = Config.
|
|
1301
|
+
* const host = Config.String("HOST")
|
|
1454
1302
|
*
|
|
1455
1303
|
* const provider = ConfigProvider.fromUnknown({ HOST: "localhost" })
|
|
1456
1304
|
* Effect.runSync(host.parse(provider)) // => "localhost"
|
|
1457
1305
|
* ```
|
|
1458
1306
|
*
|
|
1459
|
-
* @see {@link
|
|
1307
|
+
* @see {@link NonEmptyString} – rejects empty strings
|
|
1460
1308
|
* @see {@link schema} – for more complex types
|
|
1461
1309
|
*
|
|
1462
1310
|
* @category constructors
|
|
1463
1311
|
* @since 2.0.0
|
|
1464
1312
|
*/
|
|
1465
|
-
export function
|
|
1313
|
+
export function String(name?: string) {
|
|
1466
1314
|
return schema(Schema.String, name)
|
|
1467
1315
|
}
|
|
1468
1316
|
|
|
@@ -1478,12 +1326,12 @@ export function string(name?: string) {
|
|
|
1478
1326
|
*
|
|
1479
1327
|
* Shortcut for `Config.schema(Schema.NonEmptyString, name)`.
|
|
1480
1328
|
*
|
|
1481
|
-
* @see {@link
|
|
1329
|
+
* @see {@link String} for allowing empty strings
|
|
1482
1330
|
*
|
|
1483
1331
|
* @category constructors
|
|
1484
1332
|
* @since 3.7.0
|
|
1485
1333
|
*/
|
|
1486
|
-
export function
|
|
1334
|
+
export function NonEmptyString(name?: string) {
|
|
1487
1335
|
return schema(Schema.NonEmptyString, name)
|
|
1488
1336
|
}
|
|
1489
1337
|
|
|
@@ -1499,13 +1347,13 @@ export function nonEmptyString(name?: string) {
|
|
|
1499
1347
|
*
|
|
1500
1348
|
* Shortcut for `Config.schema(Schema.Number, name)`.
|
|
1501
1349
|
*
|
|
1502
|
-
* @see {@link
|
|
1503
|
-
* @see {@link
|
|
1350
|
+
* @see {@link Finite} for rejecting `NaN` and `Infinity`
|
|
1351
|
+
* @see {@link Int} for accepting only integers
|
|
1504
1352
|
*
|
|
1505
1353
|
* @category constructors
|
|
1506
1354
|
* @since 2.0.0
|
|
1507
1355
|
*/
|
|
1508
|
-
export function
|
|
1356
|
+
export function Number(name?: string) {
|
|
1509
1357
|
return schema(Schema.Number, name)
|
|
1510
1358
|
}
|
|
1511
1359
|
|
|
@@ -1520,13 +1368,13 @@ export function number(name?: string) {
|
|
|
1520
1368
|
*
|
|
1521
1369
|
* Shortcut for `Config.schema(Schema.Finite, name)`.
|
|
1522
1370
|
*
|
|
1523
|
-
* @see {@link
|
|
1524
|
-
* @see {@link
|
|
1371
|
+
* @see {@link Number} for accepting `NaN` and `Infinity`
|
|
1372
|
+
* @see {@link Int} for accepting only integers
|
|
1525
1373
|
*
|
|
1526
1374
|
* @category constructors
|
|
1527
1375
|
* @since 4.0.0
|
|
1528
1376
|
*/
|
|
1529
|
-
export function
|
|
1377
|
+
export function Finite(name?: string) {
|
|
1530
1378
|
return schema(Schema.Finite, name)
|
|
1531
1379
|
}
|
|
1532
1380
|
|
|
@@ -1541,13 +1389,13 @@ export function finite(name?: string) {
|
|
|
1541
1389
|
*
|
|
1542
1390
|
* Shortcut for `Config.schema(Schema.Int, name)`.
|
|
1543
1391
|
*
|
|
1544
|
-
* @see {@link
|
|
1545
|
-
* @see {@link
|
|
1392
|
+
* @see {@link Number} for accepting any number
|
|
1393
|
+
* @see {@link Port} for accepting only integers in `1` through `65535`
|
|
1546
1394
|
*
|
|
1547
1395
|
* @category constructors
|
|
1548
1396
|
* @since 4.0.0
|
|
1549
1397
|
*/
|
|
1550
|
-
export function
|
|
1398
|
+
export function Int(name?: string) {
|
|
1551
1399
|
return schema(Schema.Int, name)
|
|
1552
1400
|
}
|
|
1553
1401
|
|
|
@@ -1567,16 +1415,16 @@ export function int(name?: string) {
|
|
|
1567
1415
|
* ```ts import.meta.vitest
|
|
1568
1416
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1569
1417
|
*
|
|
1570
|
-
* const env = Config.
|
|
1418
|
+
* const env = Config.Literal("production", "ENV")
|
|
1571
1419
|
* const provider = ConfigProvider.fromUnknown({ ENV: "production" })
|
|
1572
1420
|
* Effect.runSync(env.parse(provider)) // => "production"
|
|
1573
1421
|
* ```
|
|
1574
1422
|
*
|
|
1575
|
-
* @see {@link
|
|
1423
|
+
* @see {@link Literals} – accepts multiple literal values
|
|
1576
1424
|
* @category constructors
|
|
1577
1425
|
* @since 2.0.0
|
|
1578
1426
|
*/
|
|
1579
|
-
export function
|
|
1427
|
+
export function Literal<L extends SchemaAST.LiteralValue>(literal: L, name?: string) {
|
|
1580
1428
|
return schema(Schema.Literal(literal), name)
|
|
1581
1429
|
}
|
|
1582
1430
|
|
|
@@ -1596,20 +1444,155 @@ export function literal<L extends SchemaAST.LiteralValue>(literal: L, name?: str
|
|
|
1596
1444
|
* ```ts import.meta.vitest
|
|
1597
1445
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1598
1446
|
*
|
|
1599
|
-
* const env = Config.
|
|
1447
|
+
* const env = Config.Literals(["development", "production"], "ENV")
|
|
1600
1448
|
* const provider = ConfigProvider.fromUnknown({ ENV: "development" })
|
|
1601
1449
|
* Effect.runSync(env.parse(provider)) // => "development"
|
|
1602
1450
|
* ```
|
|
1603
1451
|
*
|
|
1604
|
-
* @see {@link
|
|
1452
|
+
* @see {@link Literal} for accepting one specific literal value
|
|
1605
1453
|
*
|
|
1606
1454
|
* @category constructors
|
|
1607
1455
|
* @since 4.0.0
|
|
1608
1456
|
*/
|
|
1609
|
-
export function
|
|
1457
|
+
export function Literals<const L extends ReadonlyArray<SchemaAST.LiteralValue>>(literals: L, name?: string) {
|
|
1610
1458
|
return schema(Schema.Literals(literals), name)
|
|
1611
1459
|
}
|
|
1612
1460
|
|
|
1461
|
+
/**
|
|
1462
|
+
* Creates a config for array values that may also be read from a separated string.
|
|
1463
|
+
*
|
|
1464
|
+
* **When to use**
|
|
1465
|
+
*
|
|
1466
|
+
* Use when you need to read either structural array input or a flat value such as
|
|
1467
|
+
* `"otlp,console"` from an environment variable.
|
|
1468
|
+
*
|
|
1469
|
+
* **Details**
|
|
1470
|
+
*
|
|
1471
|
+
* Pass a string or `ConfigProvider.Path` as the second argument to set the lookup
|
|
1472
|
+
* path. When no path is needed, pass the options object directly. The `separator`
|
|
1473
|
+
* defaults to `","`.
|
|
1474
|
+
*
|
|
1475
|
+
* **Example** (Reading a comma-separated array)
|
|
1476
|
+
*
|
|
1477
|
+
* ```ts import.meta.vitest
|
|
1478
|
+
* import { Config, ConfigProvider, Effect, Schema } from "effect"
|
|
1479
|
+
*
|
|
1480
|
+
* const config = Config.Array(Schema.String, "EXPORTERS")
|
|
1481
|
+
* const provider = ConfigProvider.fromEnv({ env: { EXPORTERS: "otlp,console" } })
|
|
1482
|
+
*
|
|
1483
|
+
* Effect.runSync(config.parse(provider)) // => ["otlp", "console"]
|
|
1484
|
+
* ```
|
|
1485
|
+
*
|
|
1486
|
+
* @see {@link Record} for key-value input from structural records or separated strings.
|
|
1487
|
+
* @category constructors
|
|
1488
|
+
* @since 4.0.0
|
|
1489
|
+
*/
|
|
1490
|
+
export function Array<V extends Schema.ConstraintCodec<unknown, unknown>>(
|
|
1491
|
+
value: V,
|
|
1492
|
+
options?: ArrayOptions
|
|
1493
|
+
): Config<ReadonlyArray<V["Type"]>>
|
|
1494
|
+
export function Array<V extends Schema.ConstraintCodec<unknown, unknown>>(
|
|
1495
|
+
value: V,
|
|
1496
|
+
path: string | Path,
|
|
1497
|
+
options?: ArrayOptions
|
|
1498
|
+
): Config<ReadonlyArray<V["Type"]>>
|
|
1499
|
+
export function Array<V extends Schema.ConstraintCodec<unknown, unknown>>(
|
|
1500
|
+
value: V,
|
|
1501
|
+
pathOrOptions?: string | Path | ArrayOptions,
|
|
1502
|
+
options?: ArrayOptions
|
|
1503
|
+
) {
|
|
1504
|
+
const hasPath = isPath(pathOrOptions)
|
|
1505
|
+
const resolvedOptions = hasPath ? options : pathOrOptions
|
|
1506
|
+
const array = Schema.Array(value)
|
|
1507
|
+
const separator = resolvedOptions?.separator ?? ","
|
|
1508
|
+
const arrayString = Schema.String.pipe(
|
|
1509
|
+
Schema.decodeTo(Schema.toCodecStringTree(array), {
|
|
1510
|
+
decode: SchemaGetter.split(resolvedOptions),
|
|
1511
|
+
encode: SchemaGetter.passthrough<ReadonlyArray<string>, Schema.StringTree>({ strict: false }).compose(
|
|
1512
|
+
SchemaGetter.transform((input) => input.join(separator))
|
|
1513
|
+
)
|
|
1514
|
+
})
|
|
1515
|
+
)
|
|
1516
|
+
return schema(Schema.Union([arrayString, array]), hasPath ? pathOrOptions : undefined)
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
/**
|
|
1520
|
+
* Creates a config for record values that may also be read from a separated key-value string.
|
|
1521
|
+
*
|
|
1522
|
+
* **When to use**
|
|
1523
|
+
*
|
|
1524
|
+
* Use when you need to read either structural record input or a flat value such as
|
|
1525
|
+
* `"service.name=my-service,service.version=1.0.0"` from an environment variable.
|
|
1526
|
+
*
|
|
1527
|
+
* **Details**
|
|
1528
|
+
*
|
|
1529
|
+
* Pass a string or `ConfigProvider.Path` as the third argument to set the lookup
|
|
1530
|
+
* path. When no path is needed, pass the options object directly. The `separator`
|
|
1531
|
+
* defaults to `","` and `keyValueSeparator` defaults to `"="`.
|
|
1532
|
+
*
|
|
1533
|
+
* **Example** (Reading a comma-separated record)
|
|
1534
|
+
*
|
|
1535
|
+
* ```ts import.meta.vitest
|
|
1536
|
+
* import { Config, ConfigProvider, Effect, Schema } from "effect"
|
|
1537
|
+
*
|
|
1538
|
+
* const config = Config.Record(Schema.String, Schema.String, "OTEL_RESOURCE_ATTRIBUTES")
|
|
1539
|
+
* const provider = ConfigProvider.fromEnv({
|
|
1540
|
+
* env: {
|
|
1541
|
+
* OTEL_RESOURCE_ATTRIBUTES:
|
|
1542
|
+
* "service.name=my-service,service.version=1.0.0,custom.attribute=value"
|
|
1543
|
+
* }
|
|
1544
|
+
* })
|
|
1545
|
+
*
|
|
1546
|
+
* const result = Effect.runSync(config.parse(provider))
|
|
1547
|
+
* result["service.name"] // => "my-service"
|
|
1548
|
+
* result["service.version"] // => "1.0.0"
|
|
1549
|
+
* result["custom.attribute"] // => "value"
|
|
1550
|
+
* ```
|
|
1551
|
+
*
|
|
1552
|
+
* @see {@link Array} for array input from structural arrays or separated strings.
|
|
1553
|
+
* @category constructors
|
|
1554
|
+
* @since 4.0.0
|
|
1555
|
+
*/
|
|
1556
|
+
export function Record<
|
|
1557
|
+
K extends Schema.Record.Key & Schema.ConstraintCodec<unknown, unknown>,
|
|
1558
|
+
V extends Schema.ConstraintCodec<unknown, unknown>
|
|
1559
|
+
>(
|
|
1560
|
+
key: K,
|
|
1561
|
+
value: V,
|
|
1562
|
+
options?: RecordOptions
|
|
1563
|
+
): Config<Schema.Record.Type<K, V>>
|
|
1564
|
+
export function Record<
|
|
1565
|
+
K extends Schema.Record.Key & Schema.ConstraintCodec<unknown, unknown>,
|
|
1566
|
+
V extends Schema.ConstraintCodec<unknown, unknown>
|
|
1567
|
+
>(
|
|
1568
|
+
key: K,
|
|
1569
|
+
value: V,
|
|
1570
|
+
path: string | Path,
|
|
1571
|
+
options?: RecordOptions
|
|
1572
|
+
): Config<Schema.Record.Type<K, V>>
|
|
1573
|
+
export function Record<
|
|
1574
|
+
K extends Schema.Record.Key & Schema.ConstraintCodec<unknown, unknown>,
|
|
1575
|
+
V extends Schema.ConstraintCodec<unknown, unknown>
|
|
1576
|
+
>(
|
|
1577
|
+
key: K,
|
|
1578
|
+
value: V,
|
|
1579
|
+
pathOrOptions?: string | Path | RecordOptions,
|
|
1580
|
+
options?: RecordOptions
|
|
1581
|
+
) {
|
|
1582
|
+
const hasPath = isPath(pathOrOptions)
|
|
1583
|
+
const record = Schema.Record(key, value)
|
|
1584
|
+
const split = SchemaTransformation.splitKeyValue(hasPath ? options : pathOrOptions)
|
|
1585
|
+
const recordString = Schema.String.pipe(
|
|
1586
|
+
Schema.decodeTo(Schema.toCodecStringTree(record), {
|
|
1587
|
+
decode: split.decode,
|
|
1588
|
+
encode: SchemaGetter.passthrough<Record<string, string>, Schema.StringTree>({ strict: false }).compose(
|
|
1589
|
+
split.encode
|
|
1590
|
+
)
|
|
1591
|
+
})
|
|
1592
|
+
)
|
|
1593
|
+
return schema(Schema.Union([record, recordString]), hasPath ? pathOrOptions : undefined)
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1613
1596
|
/**
|
|
1614
1597
|
* Creates a config for a boolean value parsed from common string
|
|
1615
1598
|
* representations.
|
|
@@ -1620,8 +1603,6 @@ export function literals<const L extends ReadonlyArray<SchemaAST.LiteralValue>>(
|
|
|
1620
1603
|
*
|
|
1621
1604
|
* **Details**
|
|
1622
1605
|
*
|
|
1623
|
-
* Shortcut for `Config.schema(Config.Boolean, name)`.
|
|
1624
|
-
*
|
|
1625
1606
|
* Accepted values: `true`, `false`, `yes`, `no`, `on`, `off`, `1`, `0`,
|
|
1626
1607
|
* `y`, `n`.
|
|
1627
1608
|
*
|
|
@@ -1630,7 +1611,7 @@ export function literals<const L extends ReadonlyArray<SchemaAST.LiteralValue>>(
|
|
|
1630
1611
|
* ```ts import.meta.vitest
|
|
1631
1612
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1632
1613
|
*
|
|
1633
|
-
* const program = Config.
|
|
1614
|
+
* const program = Config.Boolean("FEATURE_FLAG")
|
|
1634
1615
|
*
|
|
1635
1616
|
* const provider = ConfigProvider.fromEnv({
|
|
1636
1617
|
* env: {
|
|
@@ -1643,13 +1624,11 @@ export function literals<const L extends ReadonlyArray<SchemaAST.LiteralValue>>(
|
|
|
1643
1624
|
* ) // => true
|
|
1644
1625
|
* ```
|
|
1645
1626
|
*
|
|
1646
|
-
* @see {@link Boolean} for the underlying boolean codec
|
|
1647
|
-
*
|
|
1648
1627
|
* @category constructors
|
|
1649
1628
|
* @since 2.0.0
|
|
1650
1629
|
*/
|
|
1651
|
-
export function
|
|
1652
|
-
return schema(
|
|
1630
|
+
export function Boolean(name?: string) {
|
|
1631
|
+
return schema(Schema.BooleanLiterals, name)
|
|
1653
1632
|
}
|
|
1654
1633
|
|
|
1655
1634
|
/**
|
|
@@ -1672,7 +1651,7 @@ export function boolean(name?: string) {
|
|
|
1672
1651
|
* ```ts import.meta.vitest
|
|
1673
1652
|
* import { Config, ConfigProvider, Duration, Effect } from "effect"
|
|
1674
1653
|
*
|
|
1675
|
-
* const program = Config.
|
|
1654
|
+
* const program = Config.Duration("DURATION").pipe(Effect.map(Duration.toMillis))
|
|
1676
1655
|
*
|
|
1677
1656
|
* const provider = ConfigProvider.fromEnv({
|
|
1678
1657
|
* env: {
|
|
@@ -1690,10 +1669,25 @@ export function boolean(name?: string) {
|
|
|
1690
1669
|
* @category constructors
|
|
1691
1670
|
* @since 2.5.0
|
|
1692
1671
|
*/
|
|
1693
|
-
export function
|
|
1672
|
+
export function Duration(name?: string) {
|
|
1694
1673
|
return schema(Schema.DurationFromString, name)
|
|
1695
1674
|
}
|
|
1696
1675
|
|
|
1676
|
+
/**
|
|
1677
|
+
* Creates a config for an exact, human-readable byte-size value.
|
|
1678
|
+
*
|
|
1679
|
+
* **Details**
|
|
1680
|
+
*
|
|
1681
|
+
* Decimal symbols such as `kB` use powers of 1,000, while binary symbols such
|
|
1682
|
+
* as `KiB` use powers of 1,024.
|
|
1683
|
+
*
|
|
1684
|
+
* @category constructors
|
|
1685
|
+
* @since 4.0.0
|
|
1686
|
+
*/
|
|
1687
|
+
export function ByteSize(name?: string) {
|
|
1688
|
+
return schema(Schema.ByteSize, name)
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1697
1691
|
/**
|
|
1698
1692
|
* Creates a config for a port number (integer in 1–65535).
|
|
1699
1693
|
*
|
|
@@ -1703,14 +1697,14 @@ export function duration(name?: string) {
|
|
|
1703
1697
|
*
|
|
1704
1698
|
* **Details**
|
|
1705
1699
|
*
|
|
1706
|
-
*
|
|
1700
|
+
* Accepts integers from `1` through `65535`.
|
|
1707
1701
|
*
|
|
1708
1702
|
* **Example** (Reading a port)
|
|
1709
1703
|
*
|
|
1710
1704
|
* ```ts import.meta.vitest
|
|
1711
1705
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1712
1706
|
*
|
|
1713
|
-
* const program = Config.
|
|
1707
|
+
* const program = Config.Port("PORT")
|
|
1714
1708
|
*
|
|
1715
1709
|
* const provider = ConfigProvider.fromEnv({
|
|
1716
1710
|
* env: {
|
|
@@ -1723,14 +1717,13 @@ export function duration(name?: string) {
|
|
|
1723
1717
|
* ) // => 8080
|
|
1724
1718
|
* ```
|
|
1725
1719
|
*
|
|
1726
|
-
* @see {@link
|
|
1727
|
-
* @see {@link Port} for the underlying port codec
|
|
1720
|
+
* @see {@link Int} for integer config values outside the port range
|
|
1728
1721
|
*
|
|
1729
1722
|
* @category constructors
|
|
1730
1723
|
* @since 3.16.0
|
|
1731
1724
|
*/
|
|
1732
|
-
export function
|
|
1733
|
-
return schema(
|
|
1725
|
+
export function Port(name?: string) {
|
|
1726
|
+
return schema(PortSchema, name)
|
|
1734
1727
|
}
|
|
1735
1728
|
|
|
1736
1729
|
/**
|
|
@@ -1742,8 +1735,6 @@ export function port(name?: string) {
|
|
|
1742
1735
|
*
|
|
1743
1736
|
* **Details**
|
|
1744
1737
|
*
|
|
1745
|
-
* Shortcut for `Config.schema(Config.LogLevel, name)`.
|
|
1746
|
-
*
|
|
1747
1738
|
* Accepted values: `"All"`, `"Fatal"`, `"Error"`, `"Warn"`, `"Info"`,
|
|
1748
1739
|
* `"Debug"`, `"Trace"`, `"None"`.
|
|
1749
1740
|
*
|
|
@@ -1752,7 +1743,7 @@ export function port(name?: string) {
|
|
|
1752
1743
|
* ```ts import.meta.vitest
|
|
1753
1744
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1754
1745
|
*
|
|
1755
|
-
* const program = Config.
|
|
1746
|
+
* const program = Config.LogLevel("LOG_LEVEL")
|
|
1756
1747
|
*
|
|
1757
1748
|
* const provider = ConfigProvider.fromEnv({
|
|
1758
1749
|
* env: {
|
|
@@ -1765,13 +1756,11 @@ export function port(name?: string) {
|
|
|
1765
1756
|
* ) // => "Info"
|
|
1766
1757
|
* ```
|
|
1767
1758
|
*
|
|
1768
|
-
* @see {@link LogLevel} for the underlying log-level codec
|
|
1769
|
-
*
|
|
1770
1759
|
* @category constructors
|
|
1771
1760
|
* @since 2.0.0
|
|
1772
1761
|
*/
|
|
1773
|
-
export function
|
|
1774
|
-
return schema(
|
|
1762
|
+
export function LogLevel(name?: string) {
|
|
1763
|
+
return schema(LogLevelSchema, name)
|
|
1775
1764
|
}
|
|
1776
1765
|
|
|
1777
1766
|
/**
|
|
@@ -1792,7 +1781,7 @@ export function logLevel(name?: string) {
|
|
|
1792
1781
|
* ```ts import.meta.vitest
|
|
1793
1782
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1794
1783
|
*
|
|
1795
|
-
* const program = Config.
|
|
1784
|
+
* const program = Config.Redacted("API_KEY").pipe(Effect.map(String))
|
|
1796
1785
|
*
|
|
1797
1786
|
* const provider = ConfigProvider.fromEnv({
|
|
1798
1787
|
* env: {
|
|
@@ -1805,12 +1794,12 @@ export function logLevel(name?: string) {
|
|
|
1805
1794
|
* ) // => "<redacted>"
|
|
1806
1795
|
* ```
|
|
1807
1796
|
*
|
|
1808
|
-
* @see {@link
|
|
1797
|
+
* @see {@link String} for non-secret string settings
|
|
1809
1798
|
*
|
|
1810
1799
|
* @category constructors
|
|
1811
1800
|
* @since 2.0.0
|
|
1812
1801
|
*/
|
|
1813
|
-
export function
|
|
1802
|
+
export function Redacted(name?: string) {
|
|
1814
1803
|
return schema(Schema.Redacted(Schema.String), name)
|
|
1815
1804
|
}
|
|
1816
1805
|
|
|
@@ -1834,7 +1823,7 @@ export function redacted(name?: string) {
|
|
|
1834
1823
|
* ```ts import.meta.vitest
|
|
1835
1824
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1836
1825
|
*
|
|
1837
|
-
* const program = Config.
|
|
1826
|
+
* const program = Config.URL("URL").pipe(Effect.map((url) => url.href))
|
|
1838
1827
|
*
|
|
1839
1828
|
* const provider = ConfigProvider.fromEnv({
|
|
1840
1829
|
* env: {
|
|
@@ -1852,7 +1841,7 @@ export function redacted(name?: string) {
|
|
|
1852
1841
|
* @category constructors
|
|
1853
1842
|
* @since 3.11.0
|
|
1854
1843
|
*/
|
|
1855
|
-
export function
|
|
1844
|
+
export function URL(name?: string) {
|
|
1856
1845
|
return schema(Schema.URL, name)
|
|
1857
1846
|
}
|
|
1858
1847
|
|
|
@@ -1876,7 +1865,7 @@ export function url(name?: string) {
|
|
|
1876
1865
|
* ```ts import.meta.vitest
|
|
1877
1866
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1878
1867
|
*
|
|
1879
|
-
* const createdAt = Config.
|
|
1868
|
+
* const createdAt = Config.Date("CREATED_AT")
|
|
1880
1869
|
*
|
|
1881
1870
|
* const provider = ConfigProvider.fromUnknown({ CREATED_AT: "2024-01-15" })
|
|
1882
1871
|
* Effect.runSync(createdAt.parse(provider)).toISOString() // => "2024-01-15T00:00:00.000Z"
|
|
@@ -1885,7 +1874,7 @@ export function url(name?: string) {
|
|
|
1885
1874
|
* @category constructors
|
|
1886
1875
|
* @since 2.0.0
|
|
1887
1876
|
*/
|
|
1888
|
-
export function
|
|
1877
|
+
export function Date(name?: string) {
|
|
1889
1878
|
return schema(Schema.Date, name)
|
|
1890
1879
|
}
|
|
1891
1880
|
|
|
@@ -1911,8 +1900,8 @@ export function date(name?: string) {
|
|
|
1911
1900
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1912
1901
|
*
|
|
1913
1902
|
* const dbConfig = Config.all({
|
|
1914
|
-
* host: Config.
|
|
1915
|
-
* port: Config.
|
|
1903
|
+
* host: Config.String("host"),
|
|
1904
|
+
* port: Config.Number("port")
|
|
1916
1905
|
* }).pipe(Config.nested("database"))
|
|
1917
1906
|
*
|
|
1918
1907
|
* const provider = ConfigProvider.fromUnknown({
|
|
@@ -1926,7 +1915,7 @@ export function date(name?: string) {
|
|
|
1926
1915
|
* ```ts import.meta.vitest
|
|
1927
1916
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1928
1917
|
*
|
|
1929
|
-
* const host = Config.
|
|
1918
|
+
* const host = Config.String("host").pipe(Config.nested("database"))
|
|
1930
1919
|
*
|
|
1931
1920
|
* const provider = ConfigProvider.fromEnv({
|
|
1932
1921
|
* env: { database_host: "localhost" }
|
|
@@ -1963,8 +1952,8 @@ export const nested: {
|
|
|
1963
1952
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1964
1953
|
*
|
|
1965
1954
|
* const dbConfig = Config.all({
|
|
1966
|
-
* host: Config.
|
|
1967
|
-
* port: Config.
|
|
1955
|
+
* host: Config.String("host"),
|
|
1956
|
+
* port: Config.Number("port")
|
|
1968
1957
|
* }).pipe(Config.nested("database"))
|
|
1969
1958
|
*
|
|
1970
1959
|
* const provider = ConfigProvider.fromUnknown({
|
|
@@ -1978,7 +1967,7 @@ export const nested: {
|
|
|
1978
1967
|
* ```ts import.meta.vitest
|
|
1979
1968
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
1980
1969
|
*
|
|
1981
|
-
* const host = Config.
|
|
1970
|
+
* const host = Config.String("host").pipe(Config.nested("database"))
|
|
1982
1971
|
*
|
|
1983
1972
|
* const provider = ConfigProvider.fromEnv({
|
|
1984
1973
|
* env: { database_host: "localhost" }
|
|
@@ -2015,8 +2004,8 @@ export const nested: {
|
|
|
2015
2004
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
2016
2005
|
*
|
|
2017
2006
|
* const dbConfig = Config.all({
|
|
2018
|
-
* host: Config.
|
|
2019
|
-
* port: Config.
|
|
2007
|
+
* host: Config.String("host"),
|
|
2008
|
+
* port: Config.Number("port")
|
|
2020
2009
|
* }).pipe(Config.nested("database"))
|
|
2021
2010
|
*
|
|
2022
2011
|
* const provider = ConfigProvider.fromUnknown({
|
|
@@ -2030,7 +2019,7 @@ export const nested: {
|
|
|
2030
2019
|
* ```ts import.meta.vitest
|
|
2031
2020
|
* import { Config, ConfigProvider, Effect } from "effect"
|
|
2032
2021
|
*
|
|
2033
|
-
* const host = Config.
|
|
2022
|
+
* const host = Config.String("host").pipe(Config.nested("database"))
|
|
2034
2023
|
*
|
|
2035
2024
|
* const provider = ConfigProvider.fromEnv({
|
|
2036
2025
|
* env: { database_host: "localhost" }
|