effect 4.0.0-beta.67 → 4.0.0-beta.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Array.d.ts +41 -42
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +23 -23
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +265 -265
- package/dist/BigDecimal.js +128 -128
- package/dist/BigInt.d.ts +175 -177
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +81 -79
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +127 -125
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +55 -53
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +10 -4
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +3 -2
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +36 -36
- package/dist/Cache.js +17 -17
- package/dist/Cause.d.ts +17 -18
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +12 -12
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +234 -241
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +97 -101
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +33 -56
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +17 -26
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +1 -1
- package/dist/Clock.js +1 -1
- package/dist/Combiner.d.ts +9 -1
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +8 -0
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +78 -68
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +53 -49
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +33 -32
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +19 -18
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +19 -19
- package/dist/Console.js +19 -19
- package/dist/Context.d.ts +70 -108
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +30 -44
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +3 -5
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +3 -5
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +208 -0
- package/dist/Crypto.d.ts.map +1 -0
- package/dist/Crypto.js +157 -0
- package/dist/Crypto.js.map +1 -0
- package/dist/Data.d.ts +6 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +29 -31
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +19 -19
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +8 -9
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +6 -6
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -2
- package/dist/Duration.d.ts +30 -27
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +15 -12
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +394 -652
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +157 -247
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +2 -2
- package/dist/Effectable.js +2 -2
- package/dist/Encoding.d.ts +9 -9
- package/dist/Encoding.js +9 -9
- package/dist/Equal.d.ts +4 -3
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +4 -3
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +4 -5
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +2 -2
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +14 -14
- package/dist/ErrorReporter.js +9 -9
- package/dist/ExecutionPlan.d.ts +18 -9
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +6 -4
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +0 -1
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +1 -2
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +5 -5
- package/dist/FiberHandle.js +3 -3
- package/dist/FiberMap.d.ts +10 -10
- package/dist/FiberMap.js +4 -4
- package/dist/FiberSet.d.ts +4 -4
- package/dist/FiberSet.js +2 -2
- package/dist/FileSystem.d.ts +10 -12
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +3 -3
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +54 -54
- package/dist/Filter.js +28 -28
- package/dist/Formatter.d.ts +4 -2
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -69
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +64 -65
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +41 -41
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +157 -175
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +72 -80
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.d.ts +4 -6
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +2 -2
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +121 -157
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +47 -59
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +34 -34
- package/dist/HashRing.js +16 -16
- package/dist/HashSet.d.ts +51 -55
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +19 -20
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +6 -4
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +6 -4
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +37 -83
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +21 -39
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +8 -6
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +5 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +13 -11
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +13 -11
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +16 -0
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +10 -0
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +4 -16
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +2 -14
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +94 -135
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +44 -61
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +15 -16
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +6 -6
- package/dist/LogLevel.d.ts +13 -13
- package/dist/LogLevel.js +4 -4
- package/dist/Logger.d.ts +10 -11
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +10 -11
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +5 -4
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +4 -3
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +2 -4
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +1 -2
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +48 -50
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +22 -22
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +30 -30
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +15 -14
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +0 -2
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +23 -24
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +17 -19
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +0 -1
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +12 -2
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +8 -2
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +5 -12
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +3 -8
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +145 -141
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +65 -61
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +5 -5
- package/dist/Optic.js +5 -5
- package/dist/Option.d.ts +105 -109
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +50 -52
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +6 -6
- package/dist/Order.js +6 -6
- package/dist/Ordering.d.ts +15 -19
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +6 -6
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +3 -3
- package/dist/PartitionedSemaphore.js +2 -2
- package/dist/Path.d.ts +4 -4
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +2 -1
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +10 -7
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +6 -4
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +3 -3
- package/dist/PlatformError.js +2 -2
- package/dist/Predicate.d.ts +2 -4
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +3 -3
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +2 -1
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +2 -1
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +25 -51
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +17 -35
- package/dist/PubSub.js.map +1 -1
- package/dist/Queue.d.ts +45 -60
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +27 -33
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +27 -38
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +17 -54
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +11 -11
- package/dist/RcMap.js +3 -3
- package/dist/RcRef.d.ts +0 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +9 -8
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +7 -5
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +7 -5
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +5 -3
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +2 -3
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +2 -2
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +3 -1
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -0
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +7 -17
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +5 -12
- package/dist/Ref.js.map +1 -1
- package/dist/RegExp.d.ts +1 -1
- package/dist/RegExp.js +1 -1
- package/dist/Request.d.ts +2 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +1 -0
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +2 -3
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +1 -1
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +1 -1
- package/dist/Resource.js +1 -1
- package/dist/Result.d.ts +124 -142
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +51 -63
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +2 -7
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +1 -3
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +69 -72
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +31 -33
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +2 -2
- package/dist/Scheduler.js +2 -2
- package/dist/Schema.d.ts +491 -321
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +220 -172
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +98 -77
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +89 -68
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +23 -23
- package/dist/SchemaGetter.js +20 -20
- package/dist/SchemaIssue.d.ts +18 -16
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +16 -14
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +39 -40
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +48 -51
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +89 -77
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +47 -37
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +36 -5
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +33 -5
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +1 -1
- package/dist/SchemaUtils.js +1 -1
- package/dist/Scope.d.ts +12 -29
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +6 -11
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +37 -37
- package/dist/ScopedCache.js +17 -17
- package/dist/Semaphore.d.ts +4 -16
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +2 -14
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +36 -39
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +18 -18
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +6 -6
- package/dist/Stdio.js +4 -4
- package/dist/Stream.d.ts +671 -808
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +289 -363
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +3 -2
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +3 -2
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +20 -18
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +10 -8
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +2 -2
- package/dist/SubscriptionRef.js +2 -2
- package/dist/Symbol.d.ts +3 -3
- package/dist/Symbol.js +3 -3
- package/dist/SynchronizedRef.d.ts +1 -1
- package/dist/SynchronizedRef.js +1 -1
- package/dist/Take.d.ts +2 -2
- package/dist/Take.js +1 -1
- package/dist/Terminal.d.ts +5 -5
- package/dist/Terminal.js +2 -2
- package/dist/Tracer.d.ts +9 -9
- package/dist/Tracer.js +2 -2
- package/dist/Trie.d.ts +70 -106
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +29 -43
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +34 -32
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +16 -14
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +27 -18
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +15 -10
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +11 -11
- package/dist/TxDeferred.js +5 -5
- package/dist/TxHashMap.d.ts +60 -61
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +23 -23
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +28 -32
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +13 -16
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +30 -30
- package/dist/TxPriorityQueue.js +18 -18
- package/dist/TxPubSub.d.ts +18 -18
- package/dist/TxPubSub.js +14 -14
- package/dist/TxQueue.d.ts +26 -29
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +17 -17
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +21 -21
- package/dist/TxReentrantLock.js +15 -15
- package/dist/TxRef.d.ts +24 -24
- package/dist/TxRef.js +11 -11
- package/dist/TxSemaphore.d.ts +13 -74
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +9 -52
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +24 -24
- package/dist/TxSubscriptionRef.js +11 -11
- package/dist/Types.d.ts +1 -4
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +14 -0
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +8 -0
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +8 -8
- package/dist/Unify.js +1 -1
- package/dist/Utils.d.ts +1 -2
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +1917 -411
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1917 -411
- package/dist/index.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +3 -3
- package/dist/testing/FastCheck.js +3 -3
- package/dist/testing/TestClock.d.ts +2 -3
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +1 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +8 -9
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +5 -5
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +2 -0
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +2 -0
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +34 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +34 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +10 -19
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +0 -9
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +0 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +3 -0
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +2 -0
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +3 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +1 -1
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +2 -6
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +2 -2
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +8 -10
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +4 -4
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +20 -20
- package/dist/unstable/ai/ResponseIdTracker.d.ts +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +5 -5
- package/dist/unstable/ai/Telemetry.js +3 -3
- package/dist/unstable/ai/Tokenizer.d.ts +1 -1
- package/dist/unstable/ai/Tool.d.ts +14 -12
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +10 -9
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +79 -5
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +79 -5
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +5 -6
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +2 -3
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +3 -3
- package/dist/unstable/cli/Command.js +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +4 -4
- package/dist/unstable/cli/Param.d.ts +31 -1
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +37 -38
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Prompt.d.ts +6 -14
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +182 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +205 -6
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +0 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
- package/dist/unstable/cluster/ClusterSchema.js +8 -8
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +2 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +2 -2
- package/dist/unstable/cluster/Entity.d.ts +0 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +10 -14
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +8 -14
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +3 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +2 -2
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.js +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +1 -1
- package/dist/unstable/cluster/Envelope.js +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +11 -11
- package/dist/unstable/cluster/HttpRunner.js +11 -11
- package/dist/unstable/cluster/K8sHttpClient.d.ts +5 -5
- package/dist/unstable/cluster/K8sHttpClient.js +5 -5
- package/dist/unstable/cluster/MachineId.d.ts +1 -1
- package/dist/unstable/cluster/MachineId.js +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +1 -2
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +1 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -2
- package/dist/unstable/cluster/RunnerHealth.js +2 -2
- package/dist/unstable/cluster/RunnerServer.d.ts +4 -4
- package/dist/unstable/cluster/RunnerServer.js +4 -4
- package/dist/unstable/cluster/Runners.d.ts +3 -3
- package/dist/unstable/cluster/Runners.js +3 -3
- package/dist/unstable/cluster/ShardId.d.ts +7 -5
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +6 -4
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.js +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +2 -2
- package/dist/unstable/cluster/ShardingConfig.js +2 -2
- package/dist/unstable/cluster/SingleRunner.d.ts +1 -1
- package/dist/unstable/cluster/SingleRunner.js +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +10 -9
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +4 -3
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +2 -2
- package/dist/unstable/cluster/SocketRunner.js +2 -2
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +3 -3
- package/dist/unstable/cluster/SqlMessageStorage.js +3 -3
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +3 -3
- package/dist/unstable/cluster/SqlRunnerStorage.js +3 -3
- package/dist/unstable/cluster/TestRunner.d.ts +1 -1
- package/dist/unstable/cluster/TestRunner.js +1 -1
- package/dist/unstable/cluster/index.d.ts +790 -0
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +790 -0
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +58 -0
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +58 -0
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +16 -16
- package/dist/unstable/encoding/Sse.js +11 -11
- package/dist/unstable/encoding/index.d.ts +49 -0
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +49 -0
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +2 -2
- package/dist/unstable/eventlog/Event.js +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +2 -2
- package/dist/unstable/eventlog/EventGroup.js +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +6 -7
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +4 -4
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogRemote.js +2 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogServer.js +2 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -2
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
- package/dist/unstable/eventlog/index.d.ts +240 -0
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +240 -0
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +6 -6
- package/dist/unstable/http/Cookies.js +4 -4
- package/dist/unstable/http/Etag.d.ts +2 -2
- package/dist/unstable/http/Etag.js +2 -2
- package/dist/unstable/http/Headers.d.ts +2 -2
- package/dist/unstable/http/Headers.js +1 -1
- package/dist/unstable/http/HttpClient.d.ts +5 -6
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +5 -4
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +1 -1
- package/dist/unstable/http/HttpClientError.js +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +4 -4
- package/dist/unstable/http/HttpClientRequest.js +4 -4
- package/dist/unstable/http/HttpClientResponse.d.ts +6 -6
- package/dist/unstable/http/HttpClientResponse.js +6 -6
- package/dist/unstable/http/HttpEffect.d.ts +5 -5
- package/dist/unstable/http/HttpEffect.js +5 -5
- package/dist/unstable/http/HttpIncomingMessage.d.ts +7 -6
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +7 -6
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -2
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +4 -1
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -0
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +23 -25
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +23 -22
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +4 -1
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +4 -1
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +15 -15
- package/dist/unstable/http/HttpServerRequest.js +15 -15
- package/dist/unstable/http/HttpServerRespondable.d.ts +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +5 -4
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +5 -4
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +2 -4
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +2 -4
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +20 -19
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +19 -17
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +0 -1
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +17 -17
- package/dist/unstable/http/Url.js +8 -8
- package/dist/unstable/http/UrlParams.d.ts +14 -12
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +12 -10
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +452 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +452 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +0 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +0 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -2
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +19 -8
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +11 -8
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +0 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +0 -2
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +0 -2
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +310 -25
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +310 -25
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +3 -3
- package/dist/unstable/observability/Otlp.js +3 -3
- package/dist/unstable/observability/OtlpExporter.d.ts +1 -1
- package/dist/unstable/observability/OtlpExporter.js +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +3 -2
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +2 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +5 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +2 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +9 -9
- package/dist/unstable/observability/OtlpResource.js +2 -2
- package/dist/unstable/observability/OtlpSerialization.d.ts +3 -3
- package/dist/unstable/observability/OtlpSerialization.js +3 -3
- package/dist/unstable/observability/OtlpTracer.d.ts +5 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +2 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +7 -7
- package/dist/unstable/observability/PrometheusMetrics.js +2 -2
- package/dist/unstable/observability/index.d.ts +158 -2
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +158 -2
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +4 -4
- package/dist/unstable/persistence/KeyValueStore.js +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +11 -11
- package/dist/unstable/persistence/Persistable.js +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +2 -2
- package/dist/unstable/persistence/PersistedCache.js +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
- package/dist/unstable/persistence/PersistedQueue.js +3 -3
- package/dist/unstable/persistence/Persistence.d.ts +2 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +2 -1
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +19 -15
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +14 -10
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +3 -3
- package/dist/unstable/persistence/Redis.js +3 -3
- package/dist/unstable/persistence/index.d.ts +147 -0
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +147 -0
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +41 -41
- package/dist/unstable/process/ChildProcess.js +11 -11
- package/dist/unstable/process/ChildProcessSpawner.d.ts +10 -10
- package/dist/unstable/process/ChildProcessSpawner.js +5 -5
- package/dist/unstable/reactivity/AsyncResult.d.ts +8 -6
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +3 -3
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +25 -20
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +12 -12
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +2 -2
- package/dist/unstable/reactivity/AtomHttpApi.js +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRef.js +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +16 -16
- package/dist/unstable/reactivity/AtomRegistry.js +7 -7
- package/dist/unstable/reactivity/AtomRpc.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRpc.js +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +2 -3
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +2 -3
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +167 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +167 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +0 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +0 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +2 -2
- package/dist/unstable/rpc/RpcClientError.js +2 -2
- package/dist/unstable/rpc/RpcMiddleware.d.ts +2 -2
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +0 -1
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +2 -0
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +2 -0
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +272 -0
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +272 -0
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +63 -8
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +44 -5
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -4
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +1 -1
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/schema/index.d.ts +37 -0
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +37 -0
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +5 -4
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +4 -3
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/index.d.ts +44 -0
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +44 -0
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +5 -5
- package/dist/unstable/sql/Migrator.js +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +4 -0
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +2 -0
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +3 -3
- package/dist/unstable/sql/SqlError.d.ts +18 -0
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +17 -0
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +0 -1
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +5 -5
- package/dist/unstable/sql/SqlSchema.js +5 -5
- package/dist/unstable/sql/SqlStream.d.ts +1 -0
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.js +1 -0
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +27 -24
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +9 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +178 -0
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +178 -0
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +7 -7
- package/dist/unstable/workers/Transferable.js +4 -4
- package/dist/unstable/workers/Worker.d.ts +1 -0
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +1 -0
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +8 -8
- package/dist/unstable/workers/WorkerError.js +7 -7
- package/dist/unstable/workers/index.d.ts +80 -0
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +80 -0
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +7 -7
- package/dist/unstable/workflow/Activity.js +2 -2
- package/dist/unstable/workflow/DurableClock.d.ts +2 -2
- package/dist/unstable/workflow/DurableClock.js +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +22 -20
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +8 -7
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +7 -5
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +5 -3
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +12 -10
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +3 -3
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +4 -4
- package/dist/unstable/workflow/WorkflowEngine.js +4 -4
- package/dist/unstable/workflow/WorkflowProxy.d.ts +10 -12
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +8 -12
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts +3 -2
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +2 -2
- package/dist/unstable/workflow/index.d.ts +160 -0
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +160 -0
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +41 -42
- package/src/BigDecimal.ts +265 -265
- package/src/BigInt.ts +175 -177
- package/src/Boolean.ts +127 -125
- package/src/Brand.ts +10 -4
- package/src/Cache.ts +42 -42
- package/src/Cause.ts +17 -18
- package/src/Channel.ts +250 -256
- package/src/Chunk.ts +33 -56
- package/src/Clock.ts +1 -1
- package/src/Combiner.ts +9 -1
- package/src/Config.ts +78 -68
- package/src/ConfigProvider.ts +33 -32
- package/src/Console.ts +23 -23
- package/src/Context.ts +70 -108
- package/src/Cron.ts +3 -5
- package/src/Crypto.ts +327 -0
- package/src/Data.ts +6 -1
- package/src/DateTime.ts +29 -31
- package/src/Deferred.ts +8 -9
- package/src/Differ.ts +2 -2
- package/src/Duration.ts +30 -27
- package/src/Effect.ts +402 -660
- package/src/Effectable.ts +2 -2
- package/src/Encoding.ts +9 -9
- package/src/Equal.ts +4 -3
- package/src/Equivalence.ts +4 -5
- package/src/ErrorReporter.ts +14 -14
- package/src/ExecutionPlan.ts +18 -9
- package/src/Exit.ts +0 -1
- package/src/Fiber.ts +1 -2
- package/src/FiberHandle.ts +5 -5
- package/src/FiberMap.ts +10 -10
- package/src/FiberSet.ts +4 -4
- package/src/FileSystem.ts +10 -12
- package/src/Filter.ts +54 -54
- package/src/Formatter.ts +4 -70
- package/src/Function.ts +64 -65
- package/src/Graph.ts +157 -175
- package/src/Hash.ts +4 -6
- package/src/HashMap.ts +121 -157
- package/src/HashRing.ts +34 -34
- package/src/HashSet.ts +51 -55
- package/src/Inspectable.ts +8 -7
- package/src/Iterable.ts +37 -83
- package/src/JsonPatch.ts +9 -7
- package/src/JsonPointer.ts +13 -11
- package/src/JsonSchema.ts +16 -0
- package/src/Latch.ts +4 -16
- package/src/Layer.ts +94 -135
- package/src/LayerMap.ts +15 -16
- package/src/LogLevel.ts +13 -13
- package/src/Logger.ts +16 -17
- package/src/ManagedRuntime.ts +5 -4
- package/src/Match.ts +2 -4
- package/src/Metric.ts +56 -58
- package/src/MutableHashMap.ts +42 -44
- package/src/MutableHashSet.ts +0 -2
- package/src/MutableList.ts +23 -26
- package/src/MutableRef.ts +0 -1
- package/src/Newtype.ts +12 -2
- package/src/NonEmptyIterable.ts +5 -12
- package/src/Number.ts +145 -141
- package/src/Optic.ts +5 -5
- package/src/Option.ts +105 -109
- package/src/Order.ts +6 -6
- package/src/Ordering.ts +15 -19
- package/src/PartitionedSemaphore.ts +3 -3
- package/src/Path.ts +4 -4
- package/src/Pipeable.ts +10 -7
- package/src/PlatformError.ts +3 -3
- package/src/Predicate.ts +3 -5
- package/src/PrimaryKey.ts +2 -1
- package/src/PubSub.ts +25 -51
- package/src/Queue.ts +45 -60
- package/src/Random.ts +31 -74
- package/src/RcMap.ts +11 -11
- package/src/RcRef.ts +0 -1
- package/src/Record.ts +9 -8
- package/src/Redactable.ts +7 -5
- package/src/Redacted.ts +2 -3
- package/src/Reducer.ts +3 -1
- package/src/Ref.ts +15 -33
- package/src/RegExp.ts +1 -1
- package/src/Request.ts +2 -1
- package/src/RequestResolver.ts +2 -3
- package/src/Resource.ts +1 -1
- package/src/Result.ts +124 -142
- package/src/Runtime.ts +2 -7
- package/src/Schedule.ts +74 -77
- package/src/Scheduler.ts +2 -2
- package/src/Schema.ts +491 -321
- package/src/SchemaAST.ts +98 -77
- package/src/SchemaGetter.ts +23 -23
- package/src/SchemaIssue.ts +18 -16
- package/src/SchemaParser.ts +46 -49
- package/src/SchemaRepresentation.ts +89 -77
- package/src/SchemaTransformation.ts +36 -5
- package/src/SchemaUtils.ts +1 -1
- package/src/Scope.ts +12 -29
- package/src/ScopedCache.ts +43 -43
- package/src/Semaphore.ts +4 -16
- package/src/Sink.ts +36 -39
- package/src/Stdio.ts +6 -6
- package/src/Stream.ts +789 -828
- package/src/String.ts +3 -2
- package/src/Struct.ts +20 -18
- package/src/SubscriptionRef.ts +2 -2
- package/src/Symbol.ts +3 -3
- package/src/SynchronizedRef.ts +1 -1
- package/src/Take.ts +2 -2
- package/src/Terminal.ts +5 -5
- package/src/Tracer.ts +9 -9
- package/src/Trie.ts +70 -106
- package/src/Tuple.ts +34 -32
- package/src/TxChunk.ts +27 -18
- package/src/TxDeferred.ts +11 -11
- package/src/TxHashMap.ts +62 -63
- package/src/TxHashSet.ts +38 -42
- package/src/TxPriorityQueue.ts +31 -31
- package/src/TxPubSub.ts +18 -18
- package/src/TxQueue.ts +26 -29
- package/src/TxReentrantLock.ts +21 -21
- package/src/TxRef.ts +24 -24
- package/src/TxSemaphore.ts +13 -74
- package/src/TxSubscriptionRef.ts +24 -24
- package/src/Types.ts +1 -4
- package/src/UndefinedOr.ts +14 -0
- package/src/Unify.ts +8 -8
- package/src/Utils.ts +1 -2
- package/src/index.ts +1915 -408
- package/src/testing/FastCheck.ts +3 -3
- package/src/testing/TestClock.ts +2 -3
- package/src/testing/TestConsole.ts +8 -9
- package/src/testing/TestSchema.ts +2 -0
- package/src/testing/index.ts +34 -0
- package/src/unstable/ai/AiError.ts +10 -19
- package/src/unstable/ai/Chat.ts +0 -1
- package/src/unstable/ai/McpSchema.ts +3 -0
- package/src/unstable/ai/McpServer.ts +3 -1
- package/src/unstable/ai/Model.ts +2 -6
- package/src/unstable/ai/Prompt.ts +8 -10
- package/src/unstable/ai/Response.ts +20 -20
- package/src/unstable/ai/ResponseIdTracker.ts +1 -1
- package/src/unstable/ai/Telemetry.ts +5 -5
- package/src/unstable/ai/Tokenizer.ts +1 -1
- package/src/unstable/ai/Tool.ts +14 -12
- package/src/unstable/ai/index.ts +79 -5
- package/src/unstable/cli/CliOutput.ts +5 -6
- package/src/unstable/cli/Command.ts +3 -3
- package/src/unstable/cli/HelpDoc.ts +4 -4
- package/src/unstable/cli/Param.ts +69 -72
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/Prompt.ts +6 -14
- package/src/unstable/cli/index.ts +205 -6
- package/src/unstable/cli/internal/parser.ts +0 -1
- package/src/unstable/cluster/ClusterCron.ts +1 -1
- package/src/unstable/cluster/ClusterSchema.ts +8 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +2 -2
- package/src/unstable/cluster/Entity.ts +0 -1
- package/src/unstable/cluster/EntityProxy.ts +10 -14
- package/src/unstable/cluster/EntityProxyServer.ts +3 -2
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/Envelope.ts +1 -1
- package/src/unstable/cluster/HttpRunner.ts +11 -11
- package/src/unstable/cluster/K8sHttpClient.ts +5 -5
- package/src/unstable/cluster/MachineId.ts +1 -1
- package/src/unstable/cluster/MessageStorage.ts +1 -2
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerHealth.ts +2 -2
- package/src/unstable/cluster/RunnerServer.ts +4 -4
- package/src/unstable/cluster/Runners.ts +3 -3
- package/src/unstable/cluster/ShardId.ts +7 -5
- package/src/unstable/cluster/Sharding.ts +1 -1
- package/src/unstable/cluster/ShardingConfig.ts +2 -2
- package/src/unstable/cluster/SingleRunner.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +10 -9
- package/src/unstable/cluster/SocketRunner.ts +2 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +3 -3
- package/src/unstable/cluster/SqlRunnerStorage.ts +3 -3
- package/src/unstable/cluster/TestRunner.ts +1 -1
- package/src/unstable/cluster/index.ts +790 -0
- package/src/unstable/devtools/index.ts +58 -0
- package/src/unstable/encoding/Sse.ts +16 -16
- package/src/unstable/encoding/index.ts +49 -0
- package/src/unstable/eventlog/Event.ts +2 -2
- package/src/unstable/eventlog/EventGroup.ts +2 -2
- package/src/unstable/eventlog/EventLog.ts +6 -7
- package/src/unstable/eventlog/EventLogRemote.ts +2 -2
- package/src/unstable/eventlog/EventLogServer.ts +2 -2
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -2
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +1 -1
- package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
- package/src/unstable/eventlog/index.ts +240 -0
- package/src/unstable/http/Cookies.ts +6 -6
- package/src/unstable/http/Etag.ts +2 -2
- package/src/unstable/http/Headers.ts +2 -2
- package/src/unstable/http/HttpClient.ts +5 -6
- package/src/unstable/http/HttpClientError.ts +1 -1
- package/src/unstable/http/HttpClientRequest.ts +4 -4
- package/src/unstable/http/HttpClientResponse.ts +6 -6
- package/src/unstable/http/HttpEffect.ts +5 -5
- package/src/unstable/http/HttpIncomingMessage.ts +7 -6
- package/src/unstable/http/HttpMethod.ts +4 -2
- package/src/unstable/http/HttpMiddleware.ts +1 -0
- package/src/unstable/http/HttpRouter.ts +23 -25
- package/src/unstable/http/HttpServerError.ts +4 -1
- package/src/unstable/http/HttpServerRequest.ts +15 -15
- package/src/unstable/http/HttpServerRespondable.ts +1 -1
- package/src/unstable/http/HttpServerResponse.ts +5 -4
- package/src/unstable/http/HttpStaticServer.ts +2 -4
- package/src/unstable/http/Multipart.ts +20 -19
- package/src/unstable/http/Template.ts +0 -1
- package/src/unstable/http/Url.ts +17 -17
- package/src/unstable/http/UrlParams.ts +14 -12
- package/src/unstable/http/index.ts +452 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +0 -1
- package/src/unstable/httpapi/HttpApiClient.ts +0 -1
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -2
- package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
- package/src/unstable/httpapi/HttpApiSchema.ts +19 -8
- package/src/unstable/httpapi/HttpApiSecurity.ts +0 -1
- package/src/unstable/httpapi/HttpApiSwagger.ts +0 -2
- package/src/unstable/httpapi/index.ts +310 -25
- package/src/unstable/observability/Otlp.ts +3 -3
- package/src/unstable/observability/OtlpExporter.ts +1 -1
- package/src/unstable/observability/OtlpLogger.ts +3 -2
- package/src/unstable/observability/OtlpMetrics.ts +5 -4
- package/src/unstable/observability/OtlpResource.ts +9 -9
- package/src/unstable/observability/OtlpSerialization.ts +3 -3
- package/src/unstable/observability/OtlpTracer.ts +5 -2
- package/src/unstable/observability/PrometheusMetrics.ts +7 -7
- package/src/unstable/observability/index.ts +158 -2
- package/src/unstable/persistence/KeyValueStore.ts +4 -4
- package/src/unstable/persistence/Persistable.ts +11 -11
- package/src/unstable/persistence/PersistedCache.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +6 -6
- package/src/unstable/persistence/Persistence.ts +2 -1
- package/src/unstable/persistence/RateLimiter.ts +19 -15
- package/src/unstable/persistence/Redis.ts +3 -3
- package/src/unstable/persistence/index.ts +147 -0
- package/src/unstable/process/ChildProcess.ts +42 -42
- package/src/unstable/process/ChildProcessSpawner.ts +10 -10
- package/src/unstable/reactivity/AsyncResult.ts +8 -6
- package/src/unstable/reactivity/Atom.ts +25 -20
- package/src/unstable/reactivity/AtomHttpApi.ts +2 -2
- package/src/unstable/reactivity/AtomRef.ts +2 -2
- package/src/unstable/reactivity/AtomRegistry.ts +17 -17
- package/src/unstable/reactivity/AtomRpc.ts +2 -2
- package/src/unstable/reactivity/Reactivity.ts +2 -3
- package/src/unstable/reactivity/index.ts +167 -0
- package/src/unstable/rpc/Rpc.ts +0 -1
- package/src/unstable/rpc/RpcClient.ts +0 -1
- package/src/unstable/rpc/RpcClientError.ts +2 -2
- package/src/unstable/rpc/RpcMiddleware.ts +2 -2
- package/src/unstable/rpc/RpcWorker.ts +0 -1
- package/src/unstable/rpc/Utils.ts +2 -0
- package/src/unstable/rpc/index.ts +272 -0
- package/src/unstable/schema/Model.ts +98 -10
- package/src/unstable/schema/VariantSchema.ts +1 -4
- package/src/unstable/schema/index.ts +37 -0
- package/src/unstable/socket/Socket.ts +5 -4
- package/src/unstable/socket/index.ts +44 -0
- package/src/unstable/sql/Migrator.ts +5 -5
- package/src/unstable/sql/SqlClient.ts +4 -0
- package/src/unstable/sql/SqlConnection.ts +3 -3
- package/src/unstable/sql/SqlError.ts +18 -0
- package/src/unstable/sql/SqlModel.ts +0 -1
- package/src/unstable/sql/SqlSchema.ts +5 -5
- package/src/unstable/sql/SqlStream.ts +1 -0
- package/src/unstable/sql/Statement.ts +27 -24
- package/src/unstable/sql/index.ts +178 -0
- package/src/unstable/workers/Transferable.ts +7 -7
- package/src/unstable/workers/Worker.ts +1 -0
- package/src/unstable/workers/WorkerError.ts +8 -8
- package/src/unstable/workers/index.ts +80 -0
- package/src/unstable/workflow/Activity.ts +7 -7
- package/src/unstable/workflow/DurableClock.ts +2 -2
- package/src/unstable/workflow/DurableDeferred.ts +22 -20
- package/src/unstable/workflow/DurableQueue.ts +7 -5
- package/src/unstable/workflow/Workflow.ts +12 -10
- package/src/unstable/workflow/WorkflowEngine.ts +4 -4
- package/src/unstable/workflow/WorkflowProxy.ts +10 -12
- package/src/unstable/workflow/WorkflowProxyServer.ts +3 -2
- package/src/unstable/workflow/index.ts +160 -0
package/dist/Schema.js
CHANGED
|
@@ -143,10 +143,7 @@ const TypeId = InternalSchema.TypeId;
|
|
|
143
143
|
* **Example** (Schema for a parametric `Box<A>` type)
|
|
144
144
|
*
|
|
145
145
|
* ```ts
|
|
146
|
-
* import { Effect, Schema } from "effect"
|
|
147
|
-
* import * as SchemaParser from "effect/SchemaParser"
|
|
148
|
-
* import * as Issue from "effect/SchemaIssue"
|
|
149
|
-
* import * as Option from "effect/Option"
|
|
146
|
+
* import { Effect, Option, Schema, SchemaIssue as Issue, SchemaParser } from "effect"
|
|
150
147
|
*
|
|
151
148
|
* interface Box<A> {
|
|
152
149
|
* readonly value: A
|
|
@@ -173,7 +170,7 @@ const TypeId = InternalSchema.TypeId;
|
|
|
173
170
|
* const schema = Box(Schema.Number)
|
|
174
171
|
* ```
|
|
175
172
|
*
|
|
176
|
-
* @category
|
|
173
|
+
* @category constructors
|
|
177
174
|
* @since 4.0.0
|
|
178
175
|
*/
|
|
179
176
|
export function declareConstructor() {
|
|
@@ -207,8 +204,8 @@ export function declareConstructor() {
|
|
|
207
204
|
*
|
|
208
205
|
* @see {@link declareConstructor} for creating schemas for parametric types.
|
|
209
206
|
*
|
|
210
|
-
* @category
|
|
211
|
-
* @since
|
|
207
|
+
* @category constructors
|
|
208
|
+
* @since 3.10.0
|
|
212
209
|
*/
|
|
213
210
|
export function declare(is, annotations) {
|
|
214
211
|
return declareConstructor()([], () => (input, ast) => is(input) ? Effect.succeed(input) : Effect.fail(new Issue.InvalidType(ast, Option_.some(input))), annotations);
|
|
@@ -237,6 +234,7 @@ export function declare(is, annotations) {
|
|
|
237
234
|
* type E = typeof bottom["Encoded"] // string
|
|
238
235
|
* ```
|
|
239
236
|
*
|
|
237
|
+
* @category utils
|
|
240
238
|
* @since 4.0.0
|
|
241
239
|
*/
|
|
242
240
|
export function revealBottom(bottom) {
|
|
@@ -265,7 +263,7 @@ export function revealBottom(bottom) {
|
|
|
265
263
|
*
|
|
266
264
|
* @see {@link annotateEncoded} to annotate the encoded side instead.
|
|
267
265
|
*
|
|
268
|
-
* @category
|
|
266
|
+
* @category annotations
|
|
269
267
|
* @since 4.0.0
|
|
270
268
|
*/
|
|
271
269
|
export function annotate(annotations) {
|
|
@@ -296,7 +294,7 @@ export function annotate(annotations) {
|
|
|
296
294
|
*
|
|
297
295
|
* @see {@link annotate} to annotate the type side instead.
|
|
298
296
|
*
|
|
299
|
-
* @category
|
|
297
|
+
* @category annotations
|
|
300
298
|
* @since 4.0.0
|
|
301
299
|
*/
|
|
302
300
|
export function annotateEncoded(annotations) {
|
|
@@ -327,7 +325,7 @@ export function annotateEncoded(annotations) {
|
|
|
327
325
|
* })
|
|
328
326
|
* ```
|
|
329
327
|
*
|
|
330
|
-
* @category
|
|
328
|
+
* @category annotations
|
|
331
329
|
* @since 4.0.0
|
|
332
330
|
*/
|
|
333
331
|
export function annotateKey(annotations) {
|
|
@@ -355,6 +353,7 @@ export function annotateKey(annotations) {
|
|
|
355
353
|
* type Enc = typeof codec["Encoded"] // string
|
|
356
354
|
* ```
|
|
357
355
|
*
|
|
356
|
+
* @category utils
|
|
358
357
|
* @since 4.0.0
|
|
359
358
|
*/
|
|
360
359
|
export function revealCodec(codec) {
|
|
@@ -407,6 +406,7 @@ SchemaError };
|
|
|
407
406
|
* }
|
|
408
407
|
* ```
|
|
409
408
|
*
|
|
409
|
+
* @category guards
|
|
410
410
|
* @since 4.0.0
|
|
411
411
|
*/
|
|
412
412
|
export function isSchemaError(u) {
|
|
@@ -550,7 +550,6 @@ function toBaseStandardJSONSchemaV1(self, target) {
|
|
|
550
550
|
*
|
|
551
551
|
* @category Standard Schema
|
|
552
552
|
* @since 4.0.0
|
|
553
|
-
* @experimental
|
|
554
553
|
*/
|
|
555
554
|
export function toStandardJSONSchemaV1(self) {
|
|
556
555
|
const jsonSchema = {
|
|
@@ -604,8 +603,8 @@ export function toStandardJSONSchemaV1(self) {
|
|
|
604
603
|
* }
|
|
605
604
|
* ```
|
|
606
605
|
*
|
|
607
|
-
* @category
|
|
608
|
-
* @since
|
|
606
|
+
* @category guards
|
|
607
|
+
* @since 3.10.0
|
|
609
608
|
*/
|
|
610
609
|
export const is = Parser.is;
|
|
611
610
|
/**
|
|
@@ -621,27 +620,22 @@ export const is = Parser.is;
|
|
|
621
620
|
* ```ts
|
|
622
621
|
* import { Schema } from "effect"
|
|
623
622
|
*
|
|
624
|
-
* const
|
|
625
|
-
* Schema.String
|
|
626
|
-
* )
|
|
623
|
+
* const input: unknown = "hello"
|
|
627
624
|
*
|
|
628
|
-
* // This will pass silently (no return value)
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
* console.log("String assertion passed")
|
|
632
|
-
* } catch (error) {
|
|
633
|
-
* console.log("String assertion failed")
|
|
634
|
-
* }
|
|
625
|
+
* // This will pass silently (no return value) and narrow input to string
|
|
626
|
+
* Schema.asserts(Schema.String, input)
|
|
627
|
+
* console.log(input.toUpperCase())
|
|
635
628
|
*
|
|
636
629
|
* // This will throw an error
|
|
637
630
|
* try {
|
|
638
|
-
*
|
|
631
|
+
* const invalid: unknown = 123
|
|
632
|
+
* Schema.asserts(Schema.String, invalid)
|
|
639
633
|
* } catch (error) {
|
|
640
634
|
* console.log("Non-string assertion failed as expected")
|
|
641
635
|
* }
|
|
642
636
|
* ```
|
|
643
637
|
*
|
|
644
|
-
* @category
|
|
638
|
+
* @category guards
|
|
645
639
|
* @since 4.0.0
|
|
646
640
|
*/
|
|
647
641
|
export const asserts = Parser.asserts;
|
|
@@ -653,7 +647,7 @@ export const asserts = Parser.asserts;
|
|
|
653
647
|
* Options may be provided either when creating the decoder or when applying it;
|
|
654
648
|
* application options override creation options.
|
|
655
649
|
*
|
|
656
|
-
* @category
|
|
650
|
+
* @category decoding
|
|
657
651
|
* @since 4.0.0
|
|
658
652
|
*/
|
|
659
653
|
export function decodeUnknownEffect(schema, options) {
|
|
@@ -670,7 +664,7 @@ export function decodeUnknownEffect(schema, options) {
|
|
|
670
664
|
* Options may be provided either when creating the decoder or when applying it;
|
|
671
665
|
* application options override creation options.
|
|
672
666
|
*
|
|
673
|
-
* @category
|
|
667
|
+
* @category decoding
|
|
674
668
|
* @since 4.0.0
|
|
675
669
|
*/
|
|
676
670
|
export const decodeEffect = decodeUnknownEffect;
|
|
@@ -683,7 +677,7 @@ export const decodeEffect = decodeUnknownEffect;
|
|
|
683
677
|
* Options may be provided either when creating the decoder or when applying it;
|
|
684
678
|
* application options override creation options.
|
|
685
679
|
*
|
|
686
|
-
* @category
|
|
680
|
+
* @category decoding
|
|
687
681
|
* @since 4.0.0
|
|
688
682
|
*/
|
|
689
683
|
export function decodeUnknownExit(schema, options) {
|
|
@@ -701,7 +695,7 @@ export function decodeUnknownExit(schema, options) {
|
|
|
701
695
|
* Options may be provided either when creating the decoder or when applying it;
|
|
702
696
|
* application options override creation options.
|
|
703
697
|
*
|
|
704
|
-
* @category
|
|
698
|
+
* @category decoding
|
|
705
699
|
* @since 4.0.0
|
|
706
700
|
*/
|
|
707
701
|
export const decodeExit = decodeUnknownExit;
|
|
@@ -714,8 +708,8 @@ export const decodeExit = decodeUnknownExit;
|
|
|
714
708
|
* Options may be provided either when creating the decoder or when applying it;
|
|
715
709
|
* application options override creation options.
|
|
716
710
|
*
|
|
717
|
-
* @category
|
|
718
|
-
* @since
|
|
711
|
+
* @category decoding
|
|
712
|
+
* @since 3.10.0
|
|
719
713
|
*/
|
|
720
714
|
export const decodeUnknownOption = Parser.decodeUnknownOption;
|
|
721
715
|
/**
|
|
@@ -725,8 +719,8 @@ export const decodeUnknownOption = Parser.decodeUnknownOption;
|
|
|
725
719
|
* Options may be provided either when creating the decoder or when applying it;
|
|
726
720
|
* application options override creation options.
|
|
727
721
|
*
|
|
728
|
-
* @category
|
|
729
|
-
* @since
|
|
722
|
+
* @category decoding
|
|
723
|
+
* @since 3.10.0
|
|
730
724
|
*/
|
|
731
725
|
export const decodeOption = Parser.decodeOption;
|
|
732
726
|
/**
|
|
@@ -736,7 +730,7 @@ export const decodeOption = Parser.decodeOption;
|
|
|
736
730
|
* Options may be provided either when creating the decoder or when applying it;
|
|
737
731
|
* application options override creation options.
|
|
738
732
|
*
|
|
739
|
-
* @category
|
|
733
|
+
* @category decoding
|
|
740
734
|
* @since 4.0.0
|
|
741
735
|
*/
|
|
742
736
|
export const decodeUnknownResult = Parser.decodeUnknownResult;
|
|
@@ -747,7 +741,7 @@ export const decodeUnknownResult = Parser.decodeUnknownResult;
|
|
|
747
741
|
* Options may be provided either when creating the decoder or when applying it;
|
|
748
742
|
* application options override creation options.
|
|
749
743
|
*
|
|
750
|
-
* @category
|
|
744
|
+
* @category decoding
|
|
751
745
|
* @since 4.0.0
|
|
752
746
|
*/
|
|
753
747
|
export const decodeResult = Parser.decodeResult;
|
|
@@ -759,8 +753,8 @@ export const decodeResult = Parser.decodeResult;
|
|
|
759
753
|
* Options may be provided either when creating the decoder or when applying it;
|
|
760
754
|
* application options override creation options.
|
|
761
755
|
*
|
|
762
|
-
* @category
|
|
763
|
-
* @since
|
|
756
|
+
* @category decoding
|
|
757
|
+
* @since 3.10.0
|
|
764
758
|
*/
|
|
765
759
|
export const decodeUnknownPromise = Parser.decodeUnknownPromise;
|
|
766
760
|
/**
|
|
@@ -772,8 +766,8 @@ export const decodeUnknownPromise = Parser.decodeUnknownPromise;
|
|
|
772
766
|
* Options may be provided either when creating the decoder or when applying it;
|
|
773
767
|
* application options override creation options.
|
|
774
768
|
*
|
|
775
|
-
* @category
|
|
776
|
-
* @since
|
|
769
|
+
* @category decoding
|
|
770
|
+
* @since 3.10.0
|
|
777
771
|
*/
|
|
778
772
|
export const decodePromise = Parser.decodePromise;
|
|
779
773
|
/**
|
|
@@ -805,7 +799,7 @@ export const decodePromise = Parser.decodePromise;
|
|
|
805
799
|
* // └─ Expected a numeric string, actual "not a number"
|
|
806
800
|
* ```
|
|
807
801
|
*
|
|
808
|
-
* @category
|
|
802
|
+
* @category decoding
|
|
809
803
|
* @since 4.0.0
|
|
810
804
|
*/
|
|
811
805
|
export const decodeUnknownSync = Parser.decodeUnknownSync;
|
|
@@ -819,7 +813,7 @@ export const decodeUnknownSync = Parser.decodeUnknownSync;
|
|
|
819
813
|
* provided either when creating the decoder or when applying it; application
|
|
820
814
|
* options override creation options.
|
|
821
815
|
*
|
|
822
|
-
* @category
|
|
816
|
+
* @category decoding
|
|
823
817
|
* @since 4.0.0
|
|
824
818
|
*/
|
|
825
819
|
export const decodeSync = Parser.decodeSync;
|
|
@@ -842,7 +836,7 @@ export const decodeSync = Parser.decodeSync;
|
|
|
842
836
|
* // Output: "42"
|
|
843
837
|
* ```
|
|
844
838
|
*
|
|
845
|
-
* @category
|
|
839
|
+
* @category encoding
|
|
846
840
|
* @since 4.0.0
|
|
847
841
|
*/
|
|
848
842
|
export function encodeUnknownEffect(schema, options) {
|
|
@@ -859,7 +853,7 @@ export function encodeUnknownEffect(schema, options) {
|
|
|
859
853
|
* Options may be provided either when creating the encoder or when applying it;
|
|
860
854
|
* application options override creation options.
|
|
861
855
|
*
|
|
862
|
-
* @category
|
|
856
|
+
* @category encoding
|
|
863
857
|
* @since 4.0.0
|
|
864
858
|
*/
|
|
865
859
|
export const encodeEffect = encodeUnknownEffect;
|
|
@@ -872,7 +866,7 @@ export const encodeEffect = encodeUnknownEffect;
|
|
|
872
866
|
* Options may be provided either when creating the encoder or when applying it;
|
|
873
867
|
* application options override creation options.
|
|
874
868
|
*
|
|
875
|
-
* @category
|
|
869
|
+
* @category encoding
|
|
876
870
|
* @since 4.0.0
|
|
877
871
|
*/
|
|
878
872
|
export function encodeUnknownExit(schema, options) {
|
|
@@ -890,7 +884,7 @@ export function encodeUnknownExit(schema, options) {
|
|
|
890
884
|
* Options may be provided either when creating the encoder or when applying it;
|
|
891
885
|
* application options override creation options.
|
|
892
886
|
*
|
|
893
|
-
* @category
|
|
887
|
+
* @category encoding
|
|
894
888
|
* @since 4.0.0
|
|
895
889
|
*/
|
|
896
890
|
export const encodeExit = encodeUnknownExit;
|
|
@@ -903,8 +897,8 @@ export const encodeExit = encodeUnknownExit;
|
|
|
903
897
|
* Options may be provided either when creating the encoder or when applying it;
|
|
904
898
|
* application options override creation options.
|
|
905
899
|
*
|
|
906
|
-
* @category
|
|
907
|
-
* @since
|
|
900
|
+
* @category encoding
|
|
901
|
+
* @since 3.10.0
|
|
908
902
|
*/
|
|
909
903
|
export const encodeUnknownOption = Parser.encodeUnknownOption;
|
|
910
904
|
/**
|
|
@@ -914,8 +908,8 @@ export const encodeUnknownOption = Parser.encodeUnknownOption;
|
|
|
914
908
|
* Options may be provided either when creating the encoder or when applying it;
|
|
915
909
|
* application options override creation options.
|
|
916
910
|
*
|
|
917
|
-
* @category
|
|
918
|
-
* @since
|
|
911
|
+
* @category encoding
|
|
912
|
+
* @since 3.10.0
|
|
919
913
|
*/
|
|
920
914
|
export const encodeOption = Parser.encodeOption;
|
|
921
915
|
/**
|
|
@@ -925,7 +919,7 @@ export const encodeOption = Parser.encodeOption;
|
|
|
925
919
|
* Options may be provided either when creating the encoder or when applying it;
|
|
926
920
|
* application options override creation options.
|
|
927
921
|
*
|
|
928
|
-
* @category
|
|
922
|
+
* @category encoding
|
|
929
923
|
* @since 4.0.0
|
|
930
924
|
*/
|
|
931
925
|
export const encodeUnknownResult = Parser.encodeUnknownResult;
|
|
@@ -936,7 +930,7 @@ export const encodeUnknownResult = Parser.encodeUnknownResult;
|
|
|
936
930
|
* Options may be provided either when creating the encoder or when applying it;
|
|
937
931
|
* application options override creation options.
|
|
938
932
|
*
|
|
939
|
-
* @category
|
|
933
|
+
* @category encoding
|
|
940
934
|
* @since 4.0.0
|
|
941
935
|
*/
|
|
942
936
|
export const encodeResult = Parser.encodeResult;
|
|
@@ -948,8 +942,8 @@ export const encodeResult = Parser.encodeResult;
|
|
|
948
942
|
* Options may be provided either when creating the encoder or when applying it;
|
|
949
943
|
* application options override creation options.
|
|
950
944
|
*
|
|
951
|
-
* @category
|
|
952
|
-
* @since
|
|
945
|
+
* @category encoding
|
|
946
|
+
* @since 3.10.0
|
|
953
947
|
*/
|
|
954
948
|
export const encodeUnknownPromise = Parser.encodeUnknownPromise;
|
|
955
949
|
/**
|
|
@@ -959,8 +953,8 @@ export const encodeUnknownPromise = Parser.encodeUnknownPromise;
|
|
|
959
953
|
* Options may be provided either when creating the encoder or when applying it;
|
|
960
954
|
* application options override creation options.
|
|
961
955
|
*
|
|
962
|
-
* @category
|
|
963
|
-
* @since
|
|
956
|
+
* @category encoding
|
|
957
|
+
* @since 3.10.0
|
|
964
958
|
*/
|
|
965
959
|
export const encodePromise = Parser.encodePromise;
|
|
966
960
|
/**
|
|
@@ -973,7 +967,7 @@ export const encodePromise = Parser.encodePromise;
|
|
|
973
967
|
* Options may be provided either when creating the encoder or when applying it;
|
|
974
968
|
* application options override creation options.
|
|
975
969
|
*
|
|
976
|
-
* @category
|
|
970
|
+
* @category encoding
|
|
977
971
|
* @since 4.0.0
|
|
978
972
|
*/
|
|
979
973
|
export const encodeUnknownSync = Parser.encodeUnknownSync;
|
|
@@ -984,7 +978,7 @@ export const encodeUnknownSync = Parser.encodeUnknownSync;
|
|
|
984
978
|
* Options may be provided either when creating the encoder or when applying it;
|
|
985
979
|
* application options override creation options.
|
|
986
980
|
*
|
|
987
|
-
* @category
|
|
981
|
+
* @category encoding
|
|
988
982
|
* @since 4.0.0
|
|
989
983
|
*/
|
|
990
984
|
export const encodeSync = Parser.encodeSync;
|
|
@@ -1000,8 +994,8 @@ export const encodeSync = Parser.encodeSync;
|
|
|
1000
994
|
* the bridge between the untyped AST representation and the strongly-typed
|
|
1001
995
|
* schema.
|
|
1002
996
|
*
|
|
1003
|
-
* @category
|
|
1004
|
-
* @since
|
|
997
|
+
* @category constructors
|
|
998
|
+
* @since 3.10.0
|
|
1005
999
|
*/
|
|
1006
1000
|
export const make = InternalSchema.make;
|
|
1007
1001
|
/**
|
|
@@ -1022,6 +1016,7 @@ export const make = InternalSchema.make;
|
|
|
1022
1016
|
* // "a"
|
|
1023
1017
|
* ```
|
|
1024
1018
|
*
|
|
1019
|
+
* @category constructors
|
|
1025
1020
|
* @since 4.0.0
|
|
1026
1021
|
*/
|
|
1027
1022
|
export function asClass(schema) {
|
|
@@ -1032,8 +1027,8 @@ export function asClass(schema) {
|
|
|
1032
1027
|
/**
|
|
1033
1028
|
* Tests if a value is a `Schema`.
|
|
1034
1029
|
*
|
|
1035
|
-
* @category
|
|
1036
|
-
* @since
|
|
1030
|
+
* @category guards
|
|
1031
|
+
* @since 3.10.0
|
|
1037
1032
|
*/
|
|
1038
1033
|
export function isSchema(u) {
|
|
1039
1034
|
return Predicate.hasProperty(u, TypeId) && u[TypeId] === TypeId;
|
|
@@ -1057,6 +1052,7 @@ export function isSchema(u) {
|
|
|
1057
1052
|
* type Person = typeof schema["Type"]
|
|
1058
1053
|
* ```
|
|
1059
1054
|
*
|
|
1055
|
+
* @category combinators
|
|
1060
1056
|
* @since 4.0.0
|
|
1061
1057
|
*/
|
|
1062
1058
|
export const optionalKey = /*#__PURE__*/Struct_.lambda(schema => make(AST.optionalKey(schema.ast), {
|
|
@@ -1066,6 +1062,7 @@ export const optionalKey = /*#__PURE__*/Struct_.lambda(schema => make(AST.option
|
|
|
1066
1062
|
* Reverses {@link optionalKey}, returning the inner required schema. Only
|
|
1067
1063
|
* applicable to schemas already wrapped with `optionalKey`.
|
|
1068
1064
|
*
|
|
1065
|
+
* @category combinators
|
|
1069
1066
|
* @since 4.0.0
|
|
1070
1067
|
*/
|
|
1071
1068
|
export const requiredKey = /*#__PURE__*/Struct_.lambda(self => self.schema);
|
|
@@ -1092,20 +1089,23 @@ export const requiredKey = /*#__PURE__*/Struct_.lambda(self => self.schema);
|
|
|
1092
1089
|
* type Person = typeof schema.Type
|
|
1093
1090
|
* ```
|
|
1094
1091
|
*
|
|
1095
|
-
* @
|
|
1092
|
+
* @category combinators
|
|
1093
|
+
* @since 3.10.0
|
|
1096
1094
|
*/
|
|
1097
1095
|
export const optional = /*#__PURE__*/Struct_.lambda(self => optionalKey(UndefinedOr(self)));
|
|
1098
1096
|
/**
|
|
1099
1097
|
* Reverses {@link optional}, returning the inner schema (unwrapping `UndefinedOr`).
|
|
1100
1098
|
* Only applicable to schemas already wrapped with `optional`.
|
|
1101
1099
|
*
|
|
1102
|
-
* @
|
|
1100
|
+
* @category combinators
|
|
1101
|
+
* @since 3.10.0
|
|
1103
1102
|
*/
|
|
1104
1103
|
export const required = /*#__PURE__*/Struct_.lambda(self => self.schema.members[0]);
|
|
1105
1104
|
/**
|
|
1106
1105
|
* Makes a struct field mutable (removes the `readonly` modifier on the property).
|
|
1107
1106
|
* Use {@link readonlyKey} to reverse.
|
|
1108
1107
|
*
|
|
1108
|
+
* @category combinators
|
|
1109
1109
|
* @since 4.0.0
|
|
1110
1110
|
*/
|
|
1111
1111
|
export const mutableKey = /*#__PURE__*/Struct_.lambda(schema => make(AST.mutableKey(schema.ast), {
|
|
@@ -1115,6 +1115,7 @@ export const mutableKey = /*#__PURE__*/Struct_.lambda(schema => make(AST.mutable
|
|
|
1115
1115
|
* Reverses {@link mutableKey}, returning the inner schema as readonly again.
|
|
1116
1116
|
* Only applicable to schemas already wrapped with `mutableKey`.
|
|
1117
1117
|
*
|
|
1118
|
+
* @category combinators
|
|
1118
1119
|
* @since 4.0.0
|
|
1119
1120
|
*/
|
|
1120
1121
|
export const readonlyKey = /*#__PURE__*/Struct_.lambda(self => self.schema);
|
|
@@ -1122,6 +1123,7 @@ export const readonlyKey = /*#__PURE__*/Struct_.lambda(self => self.schema);
|
|
|
1122
1123
|
* Extracts the type-side schema: sets `Encoded` to equal the decoded `Type`,
|
|
1123
1124
|
* discarding the encoding transformation path.
|
|
1124
1125
|
*
|
|
1126
|
+
* @category transforming
|
|
1125
1127
|
* @since 4.0.0
|
|
1126
1128
|
*/
|
|
1127
1129
|
export const toType = /*#__PURE__*/Struct_.lambda(schema => make(AST.toType(schema.ast), {
|
|
@@ -1131,6 +1133,7 @@ export const toType = /*#__PURE__*/Struct_.lambda(schema => make(AST.toType(sche
|
|
|
1131
1133
|
* Extracts the encoded-side schema: sets `Type` to equal the `Encoded`,
|
|
1132
1134
|
* discarding the decoding transformation path.
|
|
1133
1135
|
*
|
|
1136
|
+
* @category transforming
|
|
1134
1137
|
* @since 4.0.0
|
|
1135
1138
|
*/
|
|
1136
1139
|
export const toEncoded = /*#__PURE__*/Struct_.lambda(schema => make(AST.toEncoded(schema.ast), {
|
|
@@ -1153,6 +1156,7 @@ export function flip(schema) {
|
|
|
1153
1156
|
* Creates a schema for a single literal value (string, number, bigint, boolean, or null).
|
|
1154
1157
|
*
|
|
1155
1158
|
* **Example** (String literal)
|
|
1159
|
+
*
|
|
1156
1160
|
* ```ts
|
|
1157
1161
|
* import { Schema } from "effect"
|
|
1158
1162
|
*
|
|
@@ -1163,7 +1167,8 @@ export function flip(schema) {
|
|
|
1163
1167
|
* @see {@link Literals} for a schema that represents a union of literals.
|
|
1164
1168
|
* @see {@link tag} for a schema that represents a literal value that can be
|
|
1165
1169
|
* used as a discriminator field in tagged unions and has a constructor default.
|
|
1166
|
-
* @
|
|
1170
|
+
* @category constructors
|
|
1171
|
+
* @since 3.10.0
|
|
1167
1172
|
*/
|
|
1168
1173
|
export function Literal(literal) {
|
|
1169
1174
|
const out = make(new AST.Literal(literal), {
|
|
@@ -1185,6 +1190,7 @@ function templateLiteralFromParts(parts) {
|
|
|
1185
1190
|
* a literal string/number/bigint or a schema whose encoded type is a string, number, or bigint.
|
|
1186
1191
|
*
|
|
1187
1192
|
* **Example** (URL path pattern)
|
|
1193
|
+
*
|
|
1188
1194
|
* ```ts
|
|
1189
1195
|
* import { Schema } from "effect"
|
|
1190
1196
|
*
|
|
@@ -1193,7 +1199,8 @@ function templateLiteralFromParts(parts) {
|
|
|
1193
1199
|
* ```
|
|
1194
1200
|
*
|
|
1195
1201
|
* @see {@link TemplateLiteralParser} for a schema that also parses matched parts into a tuple.
|
|
1196
|
-
* @
|
|
1202
|
+
* @category constructors
|
|
1203
|
+
* @since 3.10.0
|
|
1197
1204
|
*/
|
|
1198
1205
|
export function TemplateLiteral(parts) {
|
|
1199
1206
|
return make(templateLiteralFromParts(parts), {
|
|
@@ -1205,6 +1212,7 @@ export function TemplateLiteral(parts) {
|
|
|
1205
1212
|
* one element per schema part.
|
|
1206
1213
|
*
|
|
1207
1214
|
* **Example** (Parse path parameters)
|
|
1215
|
+
*
|
|
1208
1216
|
* ```ts
|
|
1209
1217
|
* import { Schema } from "effect"
|
|
1210
1218
|
*
|
|
@@ -1213,7 +1221,8 @@ export function TemplateLiteral(parts) {
|
|
|
1213
1221
|
* ```
|
|
1214
1222
|
*
|
|
1215
1223
|
* @see {@link TemplateLiteral} for a validation-only version that keeps the string encoded.
|
|
1216
|
-
* @
|
|
1224
|
+
* @category constructors
|
|
1225
|
+
* @since 3.10.0
|
|
1217
1226
|
*/
|
|
1218
1227
|
export function TemplateLiteralParser(parts) {
|
|
1219
1228
|
return make(templateLiteralFromParts(parts).asTemplateLiteralParser(), {
|
|
@@ -1224,6 +1233,7 @@ export function TemplateLiteralParser(parts) {
|
|
|
1224
1233
|
* Creates a schema from a TypeScript enum object. Validates that the input is one of the enum's values.
|
|
1225
1234
|
*
|
|
1226
1235
|
* **Example** (Direction enum)
|
|
1236
|
+
*
|
|
1227
1237
|
* ```ts
|
|
1228
1238
|
* import { Schema } from "effect"
|
|
1229
1239
|
*
|
|
@@ -1236,6 +1246,7 @@ export function TemplateLiteralParser(parts) {
|
|
|
1236
1246
|
* // accepts "Up" or "Down"
|
|
1237
1247
|
* ```
|
|
1238
1248
|
*
|
|
1249
|
+
* @category constructors
|
|
1239
1250
|
* @since 4.0.0
|
|
1240
1251
|
*/
|
|
1241
1252
|
export function Enum(enums) {
|
|
@@ -1246,40 +1257,46 @@ export function Enum(enums) {
|
|
|
1246
1257
|
/**
|
|
1247
1258
|
* Schema for the `never` type. Always fails validation — no value satisfies it.
|
|
1248
1259
|
*
|
|
1249
|
-
* @
|
|
1260
|
+
* @category schemas
|
|
1261
|
+
* @since 3.10.0
|
|
1250
1262
|
*/
|
|
1251
1263
|
export const Never = /*#__PURE__*/make(AST.never);
|
|
1252
1264
|
/**
|
|
1253
1265
|
* Schema for the `any` type. Accepts any value without validation.
|
|
1254
1266
|
*
|
|
1255
1267
|
* @see {@link Unknown} for a safer alternative that uses `unknown`.
|
|
1256
|
-
* @
|
|
1268
|
+
* @category schemas
|
|
1269
|
+
* @since 3.10.0
|
|
1257
1270
|
*/
|
|
1258
1271
|
export const Any = /*#__PURE__*/make(AST.any);
|
|
1259
1272
|
/**
|
|
1260
1273
|
* Schema for the `unknown` type. Accepts any value without validation.
|
|
1261
1274
|
*
|
|
1262
1275
|
* @see {@link Any} for the `any` variant.
|
|
1263
|
-
* @
|
|
1276
|
+
* @category schemas
|
|
1277
|
+
* @since 3.10.0
|
|
1264
1278
|
*/
|
|
1265
1279
|
export const Unknown = /*#__PURE__*/make(AST.unknown);
|
|
1266
1280
|
/**
|
|
1267
1281
|
* Schema for the `null` literal. Validates that the input is strictly `null`.
|
|
1268
1282
|
*
|
|
1269
1283
|
* @see {@link NullOr} for a union with another schema.
|
|
1270
|
-
* @
|
|
1284
|
+
* @category schemas
|
|
1285
|
+
* @since 3.10.0
|
|
1271
1286
|
*/
|
|
1272
1287
|
export const Null = /*#__PURE__*/make(AST.null);
|
|
1273
1288
|
/**
|
|
1274
1289
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
1275
1290
|
*
|
|
1276
1291
|
* @see {@link UndefinedOr} for a union with another schema.
|
|
1277
|
-
* @
|
|
1292
|
+
* @category schemas
|
|
1293
|
+
* @since 3.10.0
|
|
1278
1294
|
*/
|
|
1279
1295
|
export const Undefined = /*#__PURE__*/make(AST.undefined);
|
|
1280
1296
|
/**
|
|
1281
1297
|
* Schema for `string` values. Validates that the input is `typeof` `"string"`.
|
|
1282
1298
|
*
|
|
1299
|
+
* @category schemas
|
|
1283
1300
|
* @since 4.0.0
|
|
1284
1301
|
*/
|
|
1285
1302
|
export const String = /*#__PURE__*/make(AST.string);
|
|
@@ -1292,6 +1309,7 @@ export const String = /*#__PURE__*/make(AST.string);
|
|
|
1292
1309
|
* - Non-finite values are serialized as strings (`"NaN"`, `"Infinity"`, `"-Infinity"`).
|
|
1293
1310
|
*
|
|
1294
1311
|
* @see {@link Finite} for a schema that excludes non-finite values.
|
|
1312
|
+
* @category schemas
|
|
1295
1313
|
* @since 4.0.0
|
|
1296
1314
|
*/
|
|
1297
1315
|
export const Number = /*#__PURE__*/make(AST.number);
|
|
@@ -1306,25 +1324,29 @@ export const Boolean = /*#__PURE__*/make(AST.boolean);
|
|
|
1306
1324
|
* Schema for `symbol` values. Validates that the input is `typeof` `"symbol"`.
|
|
1307
1325
|
*
|
|
1308
1326
|
* @see {@link UniqueSymbol} for a schema that matches a specific symbol.
|
|
1327
|
+
* @category schemas
|
|
1309
1328
|
* @since 4.0.0
|
|
1310
1329
|
*/
|
|
1311
1330
|
export const Symbol = /*#__PURE__*/make(AST.symbol);
|
|
1312
1331
|
/**
|
|
1313
1332
|
* Schema for `bigint` values. Validates that the input is `typeof` `"bigint"`.
|
|
1314
1333
|
*
|
|
1334
|
+
* @category schemas
|
|
1315
1335
|
* @since 4.0.0
|
|
1316
1336
|
*/
|
|
1317
1337
|
export const BigInt = /*#__PURE__*/make(AST.bigInt);
|
|
1318
1338
|
/**
|
|
1319
1339
|
* Schema for the `void` type. Accepts `undefined` as the encoded value.
|
|
1320
1340
|
*
|
|
1321
|
-
* @
|
|
1341
|
+
* @category schemas
|
|
1342
|
+
* @since 3.10.0
|
|
1322
1343
|
*/
|
|
1323
1344
|
export const Void = /*#__PURE__*/make(AST.void);
|
|
1324
1345
|
/**
|
|
1325
1346
|
* Schema for the `object` type. Validates that the input is a non-null object or function
|
|
1326
1347
|
* (i.e. `typeof value === "object" && value !== null || typeof value === "function"`).
|
|
1327
1348
|
*
|
|
1349
|
+
* @category schemas
|
|
1328
1350
|
* @since 4.0.0
|
|
1329
1351
|
*/
|
|
1330
1352
|
export const ObjectKeyword = /*#__PURE__*/make(AST.objectKeyword);
|
|
@@ -1332,6 +1354,7 @@ export const ObjectKeyword = /*#__PURE__*/make(AST.objectKeyword);
|
|
|
1332
1354
|
* Creates a schema for a specific symbol. Only that exact symbol satisfies the schema.
|
|
1333
1355
|
*
|
|
1334
1356
|
* **Example** (Specific symbol)
|
|
1357
|
+
*
|
|
1335
1358
|
* ```ts
|
|
1336
1359
|
* import { Schema } from "effect"
|
|
1337
1360
|
*
|
|
@@ -1340,6 +1363,7 @@ export const ObjectKeyword = /*#__PURE__*/make(AST.objectKeyword);
|
|
|
1340
1363
|
* ```
|
|
1341
1364
|
*
|
|
1342
1365
|
* @see {@link Symbol} for a schema that accepts any symbol.
|
|
1366
|
+
* @category constructors
|
|
1343
1367
|
* @since 4.0.0
|
|
1344
1368
|
*/
|
|
1345
1369
|
export function UniqueSymbol(symbol) {
|
|
@@ -1382,8 +1406,8 @@ function makeStruct(ast, fields) {
|
|
|
1382
1406
|
* // { name: 'Alice', age: 30 }
|
|
1383
1407
|
* ```
|
|
1384
1408
|
*
|
|
1385
|
-
* @category
|
|
1386
|
-
* @since
|
|
1409
|
+
* @category constructors
|
|
1410
|
+
* @since 3.10.0
|
|
1387
1411
|
*/
|
|
1388
1412
|
export function Struct(fields) {
|
|
1389
1413
|
return makeStruct(AST.struct(fields, undefined), fields);
|
|
@@ -1404,6 +1428,7 @@ export function Struct(fields) {
|
|
|
1404
1428
|
* ]).mapMembers(Tuple.map(Schema.fieldsAssign({ c: Schema.Number })))
|
|
1405
1429
|
* ```
|
|
1406
1430
|
*
|
|
1431
|
+
* @category combinators
|
|
1407
1432
|
* @since 4.0.0
|
|
1408
1433
|
*/
|
|
1409
1434
|
export function fieldsAssign(fields) {
|
|
@@ -1430,7 +1455,7 @@ export function fieldsAssign(fields) {
|
|
|
1430
1455
|
* // { name: 'Alice', age: 30 }
|
|
1431
1456
|
* ```
|
|
1432
1457
|
*
|
|
1433
|
-
* @category
|
|
1458
|
+
* @category transforming
|
|
1434
1459
|
* @since 4.0.0
|
|
1435
1460
|
*/
|
|
1436
1461
|
export function encodeKeys(mapping) {
|
|
@@ -1478,8 +1503,8 @@ export function encodeKeys(mapping) {
|
|
|
1478
1503
|
* // Alice Smith
|
|
1479
1504
|
* ```
|
|
1480
1505
|
*
|
|
1506
|
+
* @category transforming
|
|
1481
1507
|
* @since 4.0.0
|
|
1482
|
-
* @experimental
|
|
1483
1508
|
*/
|
|
1484
1509
|
export function extendTo(/** The new fields to add */
|
|
1485
1510
|
fields, /** A function per field to derive its value from the original input */
|
|
@@ -1534,8 +1559,8 @@ derive) {
|
|
|
1534
1559
|
* // { a: 1, b: 2 }
|
|
1535
1560
|
* ```
|
|
1536
1561
|
*
|
|
1537
|
-
* @category
|
|
1538
|
-
* @since
|
|
1562
|
+
* @category constructors
|
|
1563
|
+
* @since 3.10.0
|
|
1539
1564
|
*/
|
|
1540
1565
|
export function Record(key, value, options) {
|
|
1541
1566
|
const keyValueCombiner = options?.keyValueCombiner?.decode || options?.keyValueCombiner?.encode ? new AST.KeyValueCombiner(options.keyValueCombiner.decode, options.keyValueCombiner.encode) : undefined;
|
|
@@ -1562,7 +1587,7 @@ export function Record(key, value, options) {
|
|
|
1562
1587
|
* type T = typeof schema.Type
|
|
1563
1588
|
* ```
|
|
1564
1589
|
*
|
|
1565
|
-
* @category
|
|
1590
|
+
* @category constructors
|
|
1566
1591
|
* @since 4.0.0
|
|
1567
1592
|
*/
|
|
1568
1593
|
export function StructWithRest(schema, records) {
|
|
@@ -1595,8 +1620,8 @@ function makeTuple(ast, elements) {
|
|
|
1595
1620
|
* // [ 'hello', 42 ]
|
|
1596
1621
|
* ```
|
|
1597
1622
|
*
|
|
1598
|
-
* @category
|
|
1599
|
-
* @since
|
|
1623
|
+
* @category constructors
|
|
1624
|
+
* @since 3.10.0
|
|
1600
1625
|
*/
|
|
1601
1626
|
export function Tuple(elements) {
|
|
1602
1627
|
return makeTuple(AST.tuple(elements), elements);
|
|
@@ -1627,7 +1652,7 @@ export function Tuple(elements) {
|
|
|
1627
1652
|
* // [ 'hello', 1, true, false ]
|
|
1628
1653
|
* ```
|
|
1629
1654
|
*
|
|
1630
|
-
* @category
|
|
1655
|
+
* @category constructors
|
|
1631
1656
|
* @since 4.0.0
|
|
1632
1657
|
*/
|
|
1633
1658
|
export function TupleWithRest(schema, rest) {
|
|
@@ -1637,7 +1662,7 @@ export function TupleWithRest(schema, rest) {
|
|
|
1637
1662
|
});
|
|
1638
1663
|
}
|
|
1639
1664
|
/**
|
|
1640
|
-
* @category
|
|
1665
|
+
* @category constructors
|
|
1641
1666
|
* @since 4.0.0
|
|
1642
1667
|
*/
|
|
1643
1668
|
const ArraySchema = /*#__PURE__*/Struct_.lambda(schema => make(new AST.Arrays(false, [], [schema.ast]), {
|
|
@@ -1659,7 +1684,7 @@ export {
|
|
|
1659
1684
|
* // [ 'a', 'b', 'c' ]
|
|
1660
1685
|
* ```
|
|
1661
1686
|
*
|
|
1662
|
-
* @category
|
|
1687
|
+
* @category constructors
|
|
1663
1688
|
* @since 4.0.0
|
|
1664
1689
|
*/
|
|
1665
1690
|
ArraySchema as Array };
|
|
@@ -1678,8 +1703,8 @@ ArraySchema as Array };
|
|
|
1678
1703
|
* Schema.decodeUnknownSync(schema)([]) // throws
|
|
1679
1704
|
* ```
|
|
1680
1705
|
*
|
|
1681
|
-
* @category
|
|
1682
|
-
* @since
|
|
1706
|
+
* @category constructors
|
|
1707
|
+
* @since 3.10.0
|
|
1683
1708
|
*/
|
|
1684
1709
|
export const NonEmptyArray = /*#__PURE__*/Struct_.lambda(schema => make(new AST.Arrays(false, [schema.ast], [schema.ast]), {
|
|
1685
1710
|
schema
|
|
@@ -1697,7 +1722,7 @@ export const NonEmptyArray = /*#__PURE__*/Struct_.lambda(schema => make(new AST.
|
|
|
1697
1722
|
* arrays and arrays with two or more elements are encoded as arrays.
|
|
1698
1723
|
*
|
|
1699
1724
|
* @category Arrays
|
|
1700
|
-
* @since
|
|
1725
|
+
* @since 3.10.0
|
|
1701
1726
|
*/
|
|
1702
1727
|
export function ArrayEnsure(schema) {
|
|
1703
1728
|
return Union([schema, ArraySchema(schema)]).pipe(decodeTo(ArraySchema(toType(schema)), Transformation.transform({
|
|
@@ -1711,7 +1736,7 @@ export function ArrayEnsure(schema) {
|
|
|
1711
1736
|
* The equivalence used to determine uniqueness is the one provided by
|
|
1712
1737
|
* `Schema.toEquivalence(item)`.
|
|
1713
1738
|
*
|
|
1714
|
-
* @category
|
|
1739
|
+
* @category constructors
|
|
1715
1740
|
* @since 4.0.0
|
|
1716
1741
|
*/
|
|
1717
1742
|
export function UniqueArray(item) {
|
|
@@ -1731,7 +1756,8 @@ export function UniqueArray(item) {
|
|
|
1731
1756
|
* type T = typeof schema.Type
|
|
1732
1757
|
* ```
|
|
1733
1758
|
*
|
|
1734
|
-
* @
|
|
1759
|
+
* @category transforming
|
|
1760
|
+
* @since 3.10.0
|
|
1735
1761
|
*/
|
|
1736
1762
|
export const mutable = /*#__PURE__*/Struct_.lambda(schema => {
|
|
1737
1763
|
return make(new AST.Arrays(true, schema.ast.elements, schema.ast.rest), {
|
|
@@ -1766,8 +1792,8 @@ function makeUnion(ast, members) {
|
|
|
1766
1792
|
* Schema.decodeUnknownSync(schema)(42) // 42
|
|
1767
1793
|
* ```
|
|
1768
1794
|
*
|
|
1769
|
-
* @category
|
|
1770
|
-
* @since
|
|
1795
|
+
* @category constructors
|
|
1796
|
+
* @since 3.10.0
|
|
1771
1797
|
*/
|
|
1772
1798
|
export function Union(members, options) {
|
|
1773
1799
|
return makeUnion(AST.union(members, options?.mode ?? "anyOf", undefined), members);
|
|
@@ -1776,6 +1802,7 @@ export function Union(members, options) {
|
|
|
1776
1802
|
* Creates a union schema from an array of literal values.
|
|
1777
1803
|
*
|
|
1778
1804
|
* **Example** (Status codes)
|
|
1805
|
+
*
|
|
1779
1806
|
* ```ts
|
|
1780
1807
|
* import { Schema } from "effect"
|
|
1781
1808
|
*
|
|
@@ -1784,7 +1811,7 @@ export function Union(members, options) {
|
|
|
1784
1811
|
* ```
|
|
1785
1812
|
*
|
|
1786
1813
|
* @see {@link Literal} for a schema that represents a single literal.
|
|
1787
|
-
* @category
|
|
1814
|
+
* @category constructors
|
|
1788
1815
|
* @since 4.0.0
|
|
1789
1816
|
*/
|
|
1790
1817
|
export function Literals(literals) {
|
|
@@ -1806,21 +1833,21 @@ export function Literals(literals) {
|
|
|
1806
1833
|
/**
|
|
1807
1834
|
* Creates a union schema of `S | null`.
|
|
1808
1835
|
*
|
|
1809
|
-
* @category
|
|
1810
|
-
* @since
|
|
1836
|
+
* @category constructors
|
|
1837
|
+
* @since 3.10.0
|
|
1811
1838
|
*/
|
|
1812
1839
|
export const NullOr = /*#__PURE__*/Struct_.lambda(self => Union([self, Null]));
|
|
1813
1840
|
/**
|
|
1814
1841
|
* Creates a union schema of `S | undefined`.
|
|
1815
1842
|
*
|
|
1816
|
-
* @category
|
|
1817
|
-
* @since
|
|
1843
|
+
* @category constructors
|
|
1844
|
+
* @since 3.10.0
|
|
1818
1845
|
*/
|
|
1819
1846
|
export const UndefinedOr = /*#__PURE__*/Struct_.lambda(self => Union([self, Undefined]));
|
|
1820
1847
|
/**
|
|
1821
1848
|
* Creates a union schema of `S | null | undefined`.
|
|
1822
|
-
* @category
|
|
1823
|
-
* @since
|
|
1849
|
+
* @category constructors
|
|
1850
|
+
* @since 3.10.0
|
|
1824
1851
|
*/
|
|
1825
1852
|
export const NullishOr = /*#__PURE__*/Struct_.lambda(self => Union([self, Null, Undefined]));
|
|
1826
1853
|
/**
|
|
@@ -1829,6 +1856,7 @@ export const NullishOr = /*#__PURE__*/Struct_.lambda(self => Union([self, Null,
|
|
|
1829
1856
|
* preventing infinite recursion during schema definition.
|
|
1830
1857
|
*
|
|
1831
1858
|
* **Example** (Recursive tree schema)
|
|
1859
|
+
*
|
|
1832
1860
|
* ```ts
|
|
1833
1861
|
* import { Schema } from "effect"
|
|
1834
1862
|
*
|
|
@@ -1843,8 +1871,8 @@ export const NullishOr = /*#__PURE__*/Struct_.lambda(self => Union([self, Null,
|
|
|
1843
1871
|
* })
|
|
1844
1872
|
* ```
|
|
1845
1873
|
*
|
|
1846
|
-
* @category
|
|
1847
|
-
* @since
|
|
1874
|
+
* @category constructors
|
|
1875
|
+
* @since 3.10.0
|
|
1848
1876
|
*/
|
|
1849
1877
|
export function suspend(f) {
|
|
1850
1878
|
return make(new AST.Suspend(() => f().ast));
|
|
@@ -1854,6 +1882,7 @@ export function suspend(f) {
|
|
|
1854
1882
|
* changing the TypeScript type.
|
|
1855
1883
|
*
|
|
1856
1884
|
* **Example** (Adding checks to a schema)
|
|
1885
|
+
*
|
|
1857
1886
|
* ```ts
|
|
1858
1887
|
* import { Schema } from "effect"
|
|
1859
1888
|
*
|
|
@@ -1862,7 +1891,7 @@ export function suspend(f) {
|
|
|
1862
1891
|
* )
|
|
1863
1892
|
* ```
|
|
1864
1893
|
*
|
|
1865
|
-
* @category
|
|
1894
|
+
* @category filtering
|
|
1866
1895
|
* @since 4.0.0
|
|
1867
1896
|
*/
|
|
1868
1897
|
export function check(...checks) {
|
|
@@ -1878,8 +1907,8 @@ export function check(...checks) {
|
|
|
1878
1907
|
* names type-level failures before the refinement runs; it does not name the
|
|
1879
1908
|
* failed refinement itself.
|
|
1880
1909
|
*
|
|
1881
|
-
* @category
|
|
1882
|
-
* @since
|
|
1910
|
+
* @category filtering
|
|
1911
|
+
* @since 3.10.0
|
|
1883
1912
|
*/
|
|
1884
1913
|
export function refine(refinement, annotations) {
|
|
1885
1914
|
return schema => make(AST.appendChecks(schema.ast, [AST.makeFilterByGuard(refinement, annotations)]), {
|
|
@@ -1890,8 +1919,8 @@ export function refine(refinement, annotations) {
|
|
|
1890
1919
|
* Adds a nominal brand to a schema, intersecting the output type with
|
|
1891
1920
|
* `Brand.Brand<B>` to prevent accidental mixing of structurally identical types.
|
|
1892
1921
|
*
|
|
1893
|
-
* @category
|
|
1894
|
-
* @since
|
|
1922
|
+
* @category branding
|
|
1923
|
+
* @since 3.10.0
|
|
1895
1924
|
*/
|
|
1896
1925
|
export function brand(identifier) {
|
|
1897
1926
|
return schema => make(AST.brand(schema.ast, identifier), {
|
|
@@ -1903,8 +1932,8 @@ export function brand(identifier) {
|
|
|
1903
1932
|
* Creates a branded schema from a {@link Brand.Constructor}, applying the
|
|
1904
1933
|
* constructor's checks and brand tag to the underlying schema.
|
|
1905
1934
|
*
|
|
1906
|
-
* @category
|
|
1907
|
-
* @since
|
|
1935
|
+
* @category branding
|
|
1936
|
+
* @since 3.10.0
|
|
1908
1937
|
*/
|
|
1909
1938
|
export function fromBrand(identifier, ctor) {
|
|
1910
1939
|
return self => {
|
|
@@ -1931,6 +1960,7 @@ export function fromBrand(identifier, ctor) {
|
|
|
1931
1960
|
* ```
|
|
1932
1961
|
*
|
|
1933
1962
|
* @see {@link catchDecoding} for a simpler error-recovery variant
|
|
1963
|
+
* @category decoding
|
|
1934
1964
|
* @since 4.0.0
|
|
1935
1965
|
*/
|
|
1936
1966
|
export function middlewareDecoding(decode) {
|
|
@@ -1958,6 +1988,7 @@ export function middlewareDecoding(decode) {
|
|
|
1958
1988
|
* ```
|
|
1959
1989
|
*
|
|
1960
1990
|
* @see {@link catchEncoding} for a simpler error-recovery variant
|
|
1991
|
+
* @category encoding
|
|
1961
1992
|
* @since 4.0.0
|
|
1962
1993
|
*/
|
|
1963
1994
|
export function middlewareEncoding(encode) {
|
|
@@ -1982,6 +2013,7 @@ export function middlewareEncoding(encode) {
|
|
|
1982
2013
|
* ```
|
|
1983
2014
|
*
|
|
1984
2015
|
* @see {@link catchDecodingWithContext} to add service requirements to the handler
|
|
2016
|
+
* @category error handling
|
|
1985
2017
|
* @since 4.0.0
|
|
1986
2018
|
*/
|
|
1987
2019
|
export function catchDecoding(f) {
|
|
@@ -1990,6 +2022,7 @@ export function catchDecoding(f) {
|
|
|
1990
2022
|
/**
|
|
1991
2023
|
* Like {@link catchDecoding}, but the handler may require Effect services (`R`).
|
|
1992
2024
|
*
|
|
2025
|
+
* @category error handling
|
|
1993
2026
|
* @since 4.0.0
|
|
1994
2027
|
*/
|
|
1995
2028
|
export function catchDecodingWithContext(f) {
|
|
@@ -2002,6 +2035,7 @@ export function catchDecodingWithContext(f) {
|
|
|
2002
2035
|
* succeeds with a fallback value or re-fails with a (possibly different) issue.
|
|
2003
2036
|
*
|
|
2004
2037
|
* @see {@link catchEncodingWithContext} to add service requirements to the handler
|
|
2038
|
+
* @category error handling
|
|
2005
2039
|
* @since 4.0.0
|
|
2006
2040
|
*/
|
|
2007
2041
|
export function catchEncoding(f) {
|
|
@@ -2010,6 +2044,7 @@ export function catchEncoding(f) {
|
|
|
2010
2044
|
/**
|
|
2011
2045
|
* Like {@link catchEncoding}, but the handler may require Effect services (`R`).
|
|
2012
2046
|
*
|
|
2047
|
+
* @category error handling
|
|
2013
2048
|
* @since 4.0.0
|
|
2014
2049
|
*/
|
|
2015
2050
|
export function catchEncodingWithContext(f) {
|
|
@@ -2058,7 +2093,8 @@ export function decodeTo(to, transformation) {
|
|
|
2058
2093
|
* // result: "hello"
|
|
2059
2094
|
* ```
|
|
2060
2095
|
*
|
|
2061
|
-
* @
|
|
2096
|
+
* @category transforming
|
|
2097
|
+
* @since 3.10.0
|
|
2062
2098
|
*/
|
|
2063
2099
|
export function decode(transformation) {
|
|
2064
2100
|
return self => {
|
|
@@ -2090,7 +2126,8 @@ export function encodeTo(to, transformation) {
|
|
|
2090
2126
|
* )
|
|
2091
2127
|
* ```
|
|
2092
2128
|
*
|
|
2093
|
-
* @
|
|
2129
|
+
* @category transforming
|
|
2130
|
+
* @since 3.10.0
|
|
2094
2131
|
*/
|
|
2095
2132
|
export function encode(transformation) {
|
|
2096
2133
|
return self => {
|
|
@@ -2119,7 +2156,8 @@ export function encode(transformation) {
|
|
|
2119
2156
|
* // value: { name: "anonymous" }
|
|
2120
2157
|
* ```
|
|
2121
2158
|
*
|
|
2122
|
-
* @
|
|
2159
|
+
* @category constructors
|
|
2160
|
+
* @since 3.10.0
|
|
2123
2161
|
*/
|
|
2124
2162
|
export function withConstructorDefault(
|
|
2125
2163
|
// `S["~type.make.in"]` instead of `S["Type"]` is intentional here because
|
|
@@ -2158,6 +2196,7 @@ defaultValue) {
|
|
|
2158
2196
|
*
|
|
2159
2197
|
* @see {@link withDecodingDefault} for the value-level variant (key absent **or** `undefined`)
|
|
2160
2198
|
* @see {@link withDecodingDefaultTypeKey} for the variant where the default is a `Type` value
|
|
2199
|
+
* @category decoding
|
|
2161
2200
|
* @since 4.0.0
|
|
2162
2201
|
*/
|
|
2163
2202
|
export function withDecodingDefaultKey(defaultValue, options) {
|
|
@@ -2186,6 +2225,7 @@ export function withDecodingDefaultKey(defaultValue, options) {
|
|
|
2186
2225
|
*
|
|
2187
2226
|
* @see {@link withDecodingDefaultKey} for the variant where the default is an `Encoded` value
|
|
2188
2227
|
* @see {@link withDecodingDefaultType} for the value-level variant
|
|
2228
|
+
* @category decoding
|
|
2189
2229
|
* @since 4.0.0
|
|
2190
2230
|
*/
|
|
2191
2231
|
export function withDecodingDefaultTypeKey(defaultValue, options) {
|
|
@@ -2222,7 +2262,8 @@ export function withDecodingDefaultTypeKey(defaultValue, options) {
|
|
|
2222
2262
|
*
|
|
2223
2263
|
* @see {@link withDecodingDefaultKey} for the key-level variant (key absent only, not `undefined`)
|
|
2224
2264
|
* @see {@link withDecodingDefaultType} for the variant where the default is a `Type` value
|
|
2225
|
-
* @
|
|
2265
|
+
* @category decoding
|
|
2266
|
+
* @since 3.10.0
|
|
2226
2267
|
*/
|
|
2227
2268
|
export function withDecodingDefault(defaultValue, options) {
|
|
2228
2269
|
const encode = options?.encodingStrategy === "omit" ? Getter.omit() : Getter.passthrough();
|
|
@@ -2250,6 +2291,7 @@ export function withDecodingDefault(defaultValue, options) {
|
|
|
2250
2291
|
*
|
|
2251
2292
|
* @see {@link withDecodingDefault} for the variant where the default is an `Encoded` value
|
|
2252
2293
|
* @see {@link withDecodingDefaultTypeKey} for the key-level variant
|
|
2294
|
+
* @category decoding
|
|
2253
2295
|
* @since 4.0.0
|
|
2254
2296
|
*/
|
|
2255
2297
|
export function withDecodingDefaultType(defaultValue, options) {
|
|
@@ -2276,7 +2318,8 @@ export function withDecodingDefaultType(defaultValue, options) {
|
|
|
2276
2318
|
*
|
|
2277
2319
|
* @see {@link tagDefaultOmit} to also omit the tag during encoding
|
|
2278
2320
|
* @see {@link TaggedStruct} for a shorthand that adds `_tag` automatically
|
|
2279
|
-
* @
|
|
2321
|
+
* @category constructors
|
|
2322
|
+
* @since 3.10.0
|
|
2280
2323
|
*/
|
|
2281
2324
|
export function tag(literal) {
|
|
2282
2325
|
return Literal(literal).pipe(withConstructorDefault(Effect.succeed(literal)));
|
|
@@ -2302,6 +2345,7 @@ export function tag(literal) {
|
|
|
2302
2345
|
* ```
|
|
2303
2346
|
*
|
|
2304
2347
|
* @see {@link tag} for the variant that keeps the tag during encoding
|
|
2348
|
+
* @category constructors
|
|
2305
2349
|
* @since 4.0.0
|
|
2306
2350
|
*/
|
|
2307
2351
|
export function tagDefaultOmit(literal) {
|
|
@@ -2348,8 +2392,8 @@ export function tagDefaultOmit(literal) {
|
|
|
2348
2392
|
* const literal = tagged.fields._tag.schema.literal
|
|
2349
2393
|
* ```
|
|
2350
2394
|
*
|
|
2351
|
-
* @category
|
|
2352
|
-
* @since
|
|
2395
|
+
* @category constructors
|
|
2396
|
+
* @since 3.10.0
|
|
2353
2397
|
*/
|
|
2354
2398
|
export function TaggedStruct(value, fields) {
|
|
2355
2399
|
return Struct({
|
|
@@ -2378,8 +2422,8 @@ export function TaggedStruct(value, fields) {
|
|
|
2378
2422
|
* ```
|
|
2379
2423
|
*
|
|
2380
2424
|
* @see {@link TaggedUnion} for a shorthand that builds the union from scratch
|
|
2425
|
+
* @category combinators
|
|
2381
2426
|
* @since 4.0.0
|
|
2382
|
-
* @experimental
|
|
2383
2427
|
*/
|
|
2384
2428
|
export function toTaggedUnion(tag) {
|
|
2385
2429
|
return self => {
|
|
@@ -2445,7 +2489,7 @@ export function toTaggedUnion(tag) {
|
|
|
2445
2489
|
* ```
|
|
2446
2490
|
*
|
|
2447
2491
|
* @see {@link toTaggedUnion} to augment an existing union instead
|
|
2448
|
-
* @category
|
|
2492
|
+
* @category constructors
|
|
2449
2493
|
* @since 4.0.0
|
|
2450
2494
|
*/
|
|
2451
2495
|
export function TaggedUnion(casesByTag) {
|
|
@@ -2488,6 +2532,7 @@ export function TaggedUnion(casesByTag) {
|
|
|
2488
2532
|
* // person: Person
|
|
2489
2533
|
* ```
|
|
2490
2534
|
*
|
|
2535
|
+
* @category constructors
|
|
2491
2536
|
* @since 4.0.0
|
|
2492
2537
|
*/
|
|
2493
2538
|
export function Opaque() {
|
|
@@ -2512,8 +2557,8 @@ export function Opaque() {
|
|
|
2512
2557
|
* // decoded: Date
|
|
2513
2558
|
* ```
|
|
2514
2559
|
*
|
|
2515
|
-
* @category
|
|
2516
|
-
* @since
|
|
2560
|
+
* @category constructors
|
|
2561
|
+
* @since 3.10.0
|
|
2517
2562
|
*/
|
|
2518
2563
|
export function instanceOf(constructor, annotations) {
|
|
2519
2564
|
return declare(u => u instanceof constructor, annotations);
|
|
@@ -2522,6 +2567,7 @@ export function instanceOf(constructor, annotations) {
|
|
|
2522
2567
|
* Constructs an `AST.Link` that describes how a value of type `T` encodes to and decodes from a `To` schema.
|
|
2523
2568
|
* Used when building low-level AST transformations that bridge two schema types.
|
|
2524
2569
|
*
|
|
2570
|
+
* @category transforming
|
|
2525
2571
|
* @since 4.0.0
|
|
2526
2572
|
*/
|
|
2527
2573
|
export function link() {
|
|
@@ -3812,6 +3858,7 @@ export const isBetweenBigDecimal = /*#__PURE__*/makeIsBetween({
|
|
|
3812
3858
|
* length.
|
|
3813
3859
|
*
|
|
3814
3860
|
* **Example** (Minimum length check)
|
|
3861
|
+
*
|
|
3815
3862
|
* ```ts
|
|
3816
3863
|
* import { Schema } from "effect"
|
|
3817
3864
|
*
|
|
@@ -4234,21 +4281,21 @@ export function isUnique(annotations) {
|
|
|
4234
4281
|
* character.
|
|
4235
4282
|
*
|
|
4236
4283
|
* @category String
|
|
4237
|
-
* @since
|
|
4284
|
+
* @since 3.10.0
|
|
4238
4285
|
*/
|
|
4239
4286
|
export const NonEmptyString = /*#__PURE__*/String.check(/*#__PURE__*/isNonEmpty());
|
|
4240
4287
|
/**
|
|
4241
4288
|
* A schema representing a single character.
|
|
4242
4289
|
*
|
|
4243
4290
|
* @category String
|
|
4244
|
-
* @since
|
|
4291
|
+
* @since 3.10.0
|
|
4245
4292
|
*/
|
|
4246
4293
|
export const Char = /*#__PURE__*/String.check(/*#__PURE__*/isLengthBetween(1, 1));
|
|
4247
4294
|
/**
|
|
4248
4295
|
* Creates a schema for `Option<A>`. See {@link Option} for details.
|
|
4249
4296
|
*
|
|
4250
4297
|
* @category Option
|
|
4251
|
-
* @since
|
|
4298
|
+
* @since 3.10.0
|
|
4252
4299
|
*/
|
|
4253
4300
|
export function Option(value) {
|
|
4254
4301
|
const schema = declareConstructor()([value], ([value]) => (input, ast, options) => {
|
|
@@ -4314,7 +4361,7 @@ export function Option(value) {
|
|
|
4314
4361
|
* - `Some` is encoded as the value
|
|
4315
4362
|
*
|
|
4316
4363
|
* @category Option
|
|
4317
|
-
* @since
|
|
4364
|
+
* @since 3.10.0
|
|
4318
4365
|
*/
|
|
4319
4366
|
export function OptionFromNullOr(schema) {
|
|
4320
4367
|
return NullOr(schema).pipe(decodeTo(Option(toType(schema)), Transformation.optionFromNullOr()));
|
|
@@ -4331,7 +4378,7 @@ export function OptionFromNullOr(schema) {
|
|
|
4331
4378
|
* - `Some` is encoded as the value
|
|
4332
4379
|
*
|
|
4333
4380
|
* @category Option
|
|
4334
|
-
* @since
|
|
4381
|
+
* @since 3.10.0
|
|
4335
4382
|
*/
|
|
4336
4383
|
export function OptionFromUndefinedOr(schema) {
|
|
4337
4384
|
return UndefinedOr(schema).pipe(decodeTo(Option(toType(schema)), Transformation.optionFromUndefinedOr()));
|
|
@@ -4348,7 +4395,7 @@ export function OptionFromUndefinedOr(schema) {
|
|
|
4348
4395
|
* - `Some` is encoded as the value
|
|
4349
4396
|
*
|
|
4350
4397
|
* @category Option
|
|
4351
|
-
* @since
|
|
4398
|
+
* @since 3.10.0
|
|
4352
4399
|
*/
|
|
4353
4400
|
export function OptionFromNullishOr(schema, options) {
|
|
4354
4401
|
return NullishOr(schema).pipe(decodeTo(Option(toType(schema)), Transformation.optionFromNullishOr(options)));
|
|
@@ -4503,7 +4550,7 @@ export function Result(success, failure) {
|
|
|
4503
4550
|
* but it will deserialize a value into a `Redacted` instance.
|
|
4504
4551
|
*
|
|
4505
4552
|
* @category Redacted
|
|
4506
|
-
* @since
|
|
4553
|
+
* @since 3.10.0
|
|
4507
4554
|
*/
|
|
4508
4555
|
export function Redacted(value, options) {
|
|
4509
4556
|
const decodeLabel = typeof options?.label === "string" ? Parser.decodeUnknownEffect(Literal(options.label)) : undefined;
|
|
@@ -4679,7 +4726,7 @@ function causeReasonToFormatter(error, defect) {
|
|
|
4679
4726
|
* and unexpected defects.
|
|
4680
4727
|
*
|
|
4681
4728
|
* @category Cause
|
|
4682
|
-
* @since
|
|
4729
|
+
* @since 3.10.0
|
|
4683
4730
|
*/
|
|
4684
4731
|
export function Cause(error, defect) {
|
|
4685
4732
|
const schema = declareConstructor()([error, defect], ([error, defect]) => {
|
|
@@ -4744,7 +4791,7 @@ const ErrorJsonEncoded = /*#__PURE__*/Struct({
|
|
|
4744
4791
|
* and decodes that object back into an `Error`. The stack trace is omitted from
|
|
4745
4792
|
* the encoded form for security.
|
|
4746
4793
|
*
|
|
4747
|
-
* @category
|
|
4794
|
+
* @category schemas
|
|
4748
4795
|
* @since 4.0.0
|
|
4749
4796
|
*/
|
|
4750
4797
|
export const Error = /*#__PURE__*/instanceOf(globalThis.Error, {
|
|
@@ -4767,7 +4814,7 @@ export const Error = /*#__PURE__*/instanceOf(globalThis.Error, {
|
|
|
4767
4814
|
* Encodes an `Error` as an object with `message`, optional `name`, and optional
|
|
4768
4815
|
* `stack` properties, and decodes that object back into an `Error`.
|
|
4769
4816
|
*
|
|
4770
|
-
* @category
|
|
4817
|
+
* @category schemas
|
|
4771
4818
|
* @since 4.0.0
|
|
4772
4819
|
*/
|
|
4773
4820
|
export const ErrorWithStack = /*#__PURE__*/instanceOf(globalThis.Error, {
|
|
@@ -4799,8 +4846,8 @@ const defectTransformation = /*#__PURE__*/new Transformation.Transformation(/*#_
|
|
|
4799
4846
|
* Unknown defects are serialized with `JSON.stringify` when possible and fall
|
|
4800
4847
|
* back to Effect's formatted representation when JSON serialization fails.
|
|
4801
4848
|
*
|
|
4802
|
-
* @category
|
|
4803
|
-
* @since
|
|
4849
|
+
* @category constructors
|
|
4850
|
+
* @since 3.10.0
|
|
4804
4851
|
*/
|
|
4805
4852
|
export const Defect = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded.pipe(/*#__PURE__*/decodeTo(Error, /*#__PURE__*/Transformation.errorFromErrorJsonEncoded())), /*#__PURE__*/Any.pipe(/*#__PURE__*/decodeTo(/*#__PURE__*/Unknown.annotate({
|
|
4806
4853
|
toCodecJson: () => link()(Any, defectTransformation),
|
|
@@ -4824,7 +4871,7 @@ export const DefectWithStack = /*#__PURE__*/Union([/*#__PURE__*/ErrorJsonEncoded
|
|
|
4824
4871
|
* failure, and unexpected defect channels.
|
|
4825
4872
|
*
|
|
4826
4873
|
* @category Exit
|
|
4827
|
-
* @since
|
|
4874
|
+
* @since 3.10.0
|
|
4828
4875
|
*/
|
|
4829
4876
|
export function Exit(value, error, defect) {
|
|
4830
4877
|
const schema = declareConstructor()([value, error, defect], ([value, error, defect]) => {
|
|
@@ -4911,7 +4958,7 @@ export function Exit(value, error, defect) {
|
|
|
4911
4958
|
* conform to the provided schemas.
|
|
4912
4959
|
*
|
|
4913
4960
|
* @category ReadonlyMap
|
|
4914
|
-
* @since
|
|
4961
|
+
* @since 3.10.0
|
|
4915
4962
|
*/
|
|
4916
4963
|
export function ReadonlyMap(key, value) {
|
|
4917
4964
|
const schema = declareConstructor()([key, value], ([key, value]) => {
|
|
@@ -4964,7 +5011,7 @@ export function ReadonlyMap(key, value) {
|
|
|
4964
5011
|
* conform to the provided schemas.
|
|
4965
5012
|
*
|
|
4966
5013
|
* @category HashMap
|
|
4967
|
-
* @since
|
|
5014
|
+
* @since 3.10.0
|
|
4968
5015
|
*/
|
|
4969
5016
|
export function HashMap(key, value) {
|
|
4970
5017
|
const schema = declareConstructor()([key, value], ([key, value]) => {
|
|
@@ -5018,7 +5065,7 @@ export function HashMap(key, value) {
|
|
|
5018
5065
|
* provided element schema.
|
|
5019
5066
|
*
|
|
5020
5067
|
* @category ReadonlySet
|
|
5021
|
-
* @since
|
|
5068
|
+
* @since 3.10.0
|
|
5022
5069
|
*/
|
|
5023
5070
|
export function ReadonlySet(value) {
|
|
5024
5071
|
const schema = declareConstructor()([value], ([value]) => {
|
|
@@ -5070,7 +5117,7 @@ export function ReadonlySet(value) {
|
|
|
5070
5117
|
* provided schema.
|
|
5071
5118
|
*
|
|
5072
5119
|
* @category HashSet
|
|
5073
|
-
* @since
|
|
5120
|
+
* @since 3.10.0
|
|
5074
5121
|
*/
|
|
5075
5122
|
export function HashSet(value) {
|
|
5076
5123
|
const schema = declareConstructor()([value], ([value]) => {
|
|
@@ -5122,7 +5169,7 @@ export function HashSet(value) {
|
|
|
5122
5169
|
* provided schema.
|
|
5123
5170
|
*
|
|
5124
5171
|
* @category Chunk
|
|
5125
|
-
* @since
|
|
5172
|
+
* @since 3.10.0
|
|
5126
5173
|
*/
|
|
5127
5174
|
export function Chunk(value) {
|
|
5128
5175
|
const schema = declareConstructor()([value], ([value]) => {
|
|
@@ -5294,7 +5341,7 @@ export const Date = /*#__PURE__*/instanceOf(globalThis.Date, {
|
|
|
5294
5341
|
* `"Invalid Date"`.
|
|
5295
5342
|
*
|
|
5296
5343
|
* @category Date
|
|
5297
|
-
* @since
|
|
5344
|
+
* @since 3.10.0
|
|
5298
5345
|
*/
|
|
5299
5346
|
export const DateFromString = /*#__PURE__*/DateString.pipe(/*#__PURE__*/decodeTo(Date, Transformation.dateFromString));
|
|
5300
5347
|
/**
|
|
@@ -5316,8 +5363,7 @@ export const DateValid = /*#__PURE__*/Date.check(/*#__PURE__*/isDateValid());
|
|
|
5316
5363
|
* **Example** (Duration schema)
|
|
5317
5364
|
*
|
|
5318
5365
|
* ```ts
|
|
5319
|
-
* import { Schema } from "effect"
|
|
5320
|
-
* import { Duration } from "effect"
|
|
5366
|
+
* import { Duration, Schema } from "effect"
|
|
5321
5367
|
*
|
|
5322
5368
|
* Schema.decodeUnknownSync(Schema.Duration)(Duration.seconds(5))
|
|
5323
5369
|
* // => Duration(5s)
|
|
@@ -5325,7 +5371,7 @@ export const DateValid = /*#__PURE__*/Date.check(/*#__PURE__*/isDateValid());
|
|
|
5325
5371
|
*
|
|
5326
5372
|
* @category Duration
|
|
5327
5373
|
*
|
|
5328
|
-
* @since
|
|
5374
|
+
* @since 3.10.0
|
|
5329
5375
|
*/
|
|
5330
5376
|
export const Duration = /*#__PURE__*/declare(Duration_.isDuration, {
|
|
5331
5377
|
typeConstructor: {
|
|
@@ -5418,7 +5464,7 @@ const bigint0 = /*#__PURE__*/globalThis.BigInt(0);
|
|
|
5418
5464
|
* `Duration.infinity`.
|
|
5419
5465
|
*
|
|
5420
5466
|
* @category Duration
|
|
5421
|
-
* @since
|
|
5467
|
+
* @since 3.10.0
|
|
5422
5468
|
*/
|
|
5423
5469
|
export const DurationFromNanos = /*#__PURE__*/BigInt.check(isGreaterThanOrEqualToBigInt(bigint0)).pipe(/*#__PURE__*/decodeTo(Duration, Transformation.durationFromNanos));
|
|
5424
5470
|
/**
|
|
@@ -5435,7 +5481,7 @@ export const DurationFromNanos = /*#__PURE__*/BigInt.check(isGreaterThanOrEqualT
|
|
|
5435
5481
|
* representing milliseconds
|
|
5436
5482
|
*
|
|
5437
5483
|
* @category Duration
|
|
5438
|
-
* @since
|
|
5484
|
+
* @since 3.10.0
|
|
5439
5485
|
*/
|
|
5440
5486
|
export const DurationFromMillis = /*#__PURE__*/Number.check(isGreaterThanOrEqualTo(0)).pipe(/*#__PURE__*/decodeTo(Duration, Transformation.durationFromMillis));
|
|
5441
5487
|
const BigDecimalString = /*#__PURE__*/String.annotate({
|
|
@@ -5449,7 +5495,7 @@ const BigDecimalString = /*#__PURE__*/String.annotate({
|
|
|
5449
5495
|
* - encodes `BigDecimal` as a `string`
|
|
5450
5496
|
*
|
|
5451
5497
|
* @category BigDecimal
|
|
5452
|
-
* @since
|
|
5498
|
+
* @since 3.10.0
|
|
5453
5499
|
*/
|
|
5454
5500
|
export const BigDecimal = /*#__PURE__*/declare(BigDecimal_.isBigDecimal, {
|
|
5455
5501
|
typeConstructor: {
|
|
@@ -5493,7 +5539,7 @@ export const BigDecimalFromString = /*#__PURE__*/BigDecimalString.pipe(/*#__PURE
|
|
|
5493
5539
|
* - Any value is encoded as a JSON string using `JSON.stringify`.
|
|
5494
5540
|
* - If the value is not a valid JSON value, encoding fails.
|
|
5495
5541
|
*
|
|
5496
|
-
* **Example**
|
|
5542
|
+
* **Example** (Decoding unknown JSON strings)
|
|
5497
5543
|
*
|
|
5498
5544
|
* ```ts
|
|
5499
5545
|
* import { Schema } from "effect"
|
|
@@ -5516,7 +5562,7 @@ export const UnknownFromJsonString = /*#__PURE__*/fromJsonString(Unknown);
|
|
|
5516
5562
|
* The resulting schema first parses the input string as JSON, and then runs the
|
|
5517
5563
|
* provided schema on the parsed result.
|
|
5518
5564
|
*
|
|
5519
|
-
* **Example**
|
|
5565
|
+
* **Example** (Decoding JSON strings with a schema)
|
|
5520
5566
|
*
|
|
5521
5567
|
* ```ts
|
|
5522
5568
|
* import { Schema } from "effect"
|
|
@@ -5534,7 +5580,7 @@ export const UnknownFromJsonString = /*#__PURE__*/fromJsonString(Unknown);
|
|
|
5534
5580
|
* resulting schema will be a JSON Schema with a `contentSchema` property that
|
|
5535
5581
|
* contains the JSON Schema for the given schema.
|
|
5536
5582
|
*
|
|
5537
|
-
* **Example**
|
|
5583
|
+
* **Example** (Emitting JSON Schema for a JSON string decoder)
|
|
5538
5584
|
*
|
|
5539
5585
|
* ```ts
|
|
5540
5586
|
* import { Schema } from "effect"
|
|
@@ -5759,6 +5805,7 @@ export const FormData = /*#__PURE__*/instanceOf(globalThis.FormData, {
|
|
|
5759
5805
|
* // Success({"a":1}) // Note: the value is a number
|
|
5760
5806
|
* ```
|
|
5761
5807
|
*
|
|
5808
|
+
* @category decoding
|
|
5762
5809
|
* @since 4.0.0
|
|
5763
5810
|
*/
|
|
5764
5811
|
export function fromFormData(schema) {
|
|
@@ -5860,6 +5907,7 @@ export const URLSearchParams = /*#__PURE__*/instanceOf(globalThis.URLSearchParam
|
|
|
5860
5907
|
* // Success({"a":1}) // Note: the value is a number
|
|
5861
5908
|
* ```
|
|
5862
5909
|
*
|
|
5910
|
+
* @category decoding
|
|
5863
5911
|
* @since 4.0.0
|
|
5864
5912
|
*/
|
|
5865
5913
|
export function fromURLSearchParams(schema) {
|
|
@@ -5869,14 +5917,14 @@ export function fromURLSearchParams(schema) {
|
|
|
5869
5917
|
* A schema for finite numbers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
5870
5918
|
*
|
|
5871
5919
|
* @category Number
|
|
5872
|
-
* @since
|
|
5920
|
+
* @since 3.10.0
|
|
5873
5921
|
*/
|
|
5874
5922
|
export const Finite = /*#__PURE__*/Number.check(/*#__PURE__*/isFinite());
|
|
5875
5923
|
/**
|
|
5876
5924
|
* A schema for integers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
5877
5925
|
*
|
|
5878
5926
|
* @category Number
|
|
5879
|
-
* @since
|
|
5927
|
+
* @since 3.10.0
|
|
5880
5928
|
*/
|
|
5881
5929
|
export const Int = /*#__PURE__*/Number.check(/*#__PURE__*/isInt());
|
|
5882
5930
|
/**
|
|
@@ -5892,7 +5940,7 @@ export const Int = /*#__PURE__*/Number.check(/*#__PURE__*/isInt());
|
|
|
5892
5940
|
* A number is encoded as a `string`.
|
|
5893
5941
|
*
|
|
5894
5942
|
* @category Number
|
|
5895
|
-
* @since
|
|
5943
|
+
* @since 3.10.0
|
|
5896
5944
|
*/
|
|
5897
5945
|
export const NumberFromString = /*#__PURE__*/String.annotate({
|
|
5898
5946
|
expected: "a string that will be decoded as a number"
|
|
@@ -5930,7 +5978,7 @@ export const BigIntFromString = /*#__PURE__*/make(AST.bigIntString).pipe(/*#__PU
|
|
|
5930
5978
|
* A schema for strings that contains no leading or trailing whitespaces.
|
|
5931
5979
|
*
|
|
5932
5980
|
* @category String
|
|
5933
|
-
* @since
|
|
5981
|
+
* @since 3.10.0
|
|
5934
5982
|
*/
|
|
5935
5983
|
export const Trimmed = /*#__PURE__*/String.check(/*#__PURE__*/isTrimmed());
|
|
5936
5984
|
/**
|
|
@@ -5943,7 +5991,7 @@ export const Trimmed = /*#__PURE__*/String.check(/*#__PURE__*/isTrimmed());
|
|
|
5943
5991
|
* - The trimmed string is encoded as is.
|
|
5944
5992
|
*
|
|
5945
5993
|
* @category String
|
|
5946
|
-
* @since
|
|
5994
|
+
* @since 3.10.0
|
|
5947
5995
|
*/
|
|
5948
5996
|
export const Trim = /*#__PURE__*/String.annotate({
|
|
5949
5997
|
expected: "a string that will be decoded as a trimmed string"
|
|
@@ -5958,7 +6006,7 @@ export const Trim = /*#__PURE__*/String.annotate({
|
|
|
5958
6006
|
* - A `string` is encoded as a base64-encoded string.
|
|
5959
6007
|
*
|
|
5960
6008
|
* @category String
|
|
5961
|
-
* @since
|
|
6009
|
+
* @since 3.10.0
|
|
5962
6010
|
*/
|
|
5963
6011
|
export const StringFromBase64 = /*#__PURE__*/String.annotate({
|
|
5964
6012
|
expected: "a base64 encoded string that will be decoded as a UTF-8 string"
|
|
@@ -5973,7 +6021,7 @@ export const StringFromBase64 = /*#__PURE__*/String.annotate({
|
|
|
5973
6021
|
* - A `string` is encoded as a base64 (URL) encoded string.
|
|
5974
6022
|
*
|
|
5975
6023
|
* @category String
|
|
5976
|
-
* @since
|
|
6024
|
+
* @since 3.10.0
|
|
5977
6025
|
*/
|
|
5978
6026
|
export const StringFromBase64Url = /*#__PURE__*/String.annotate({
|
|
5979
6027
|
expected: "a base64 (URL) encoded string that will be decoded as a UTF-8 string"
|
|
@@ -5988,7 +6036,7 @@ export const StringFromBase64Url = /*#__PURE__*/String.annotate({
|
|
|
5988
6036
|
* - A `string` is encoded as a hex string.
|
|
5989
6037
|
*
|
|
5990
6038
|
* @category String
|
|
5991
|
-
* @since
|
|
6039
|
+
* @since 3.10.0
|
|
5992
6040
|
*/
|
|
5993
6041
|
export const StringFromHex = /*#__PURE__*/String.annotate({
|
|
5994
6042
|
expected: "a hex encoded string that will be decoded as a UTF-8 string"
|
|
@@ -6003,7 +6051,7 @@ export const StringFromHex = /*#__PURE__*/String.annotate({
|
|
|
6003
6051
|
* Encoding:
|
|
6004
6052
|
* - A `string` is encoded as a URI component encoded string.
|
|
6005
6053
|
*
|
|
6006
|
-
* **Example**
|
|
6054
|
+
* **Example** (Decoding URI component strings)
|
|
6007
6055
|
*
|
|
6008
6056
|
* ```ts
|
|
6009
6057
|
* import { Schema } from "effect"
|
|
@@ -6022,7 +6070,7 @@ export const StringFromHex = /*#__PURE__*/String.annotate({
|
|
|
6022
6070
|
* ```
|
|
6023
6071
|
*
|
|
6024
6072
|
* @category String
|
|
6025
|
-
* @since
|
|
6073
|
+
* @since 3.12.0
|
|
6026
6074
|
*/
|
|
6027
6075
|
export const StringFromUriComponent = /*#__PURE__*/String.annotate({
|
|
6028
6076
|
expected: "a URI component encoded string that will be decoded as a UTF-8 string"
|
|
@@ -6100,7 +6148,7 @@ export const Uint8Array = /*#__PURE__*/instanceOf(globalThis.Uint8Array, {
|
|
|
6100
6148
|
* - A `Uint8Array` is encoded as a base64-encoded string.
|
|
6101
6149
|
*
|
|
6102
6150
|
* @category Uint8Array
|
|
6103
|
-
* @since
|
|
6151
|
+
* @since 3.10.0
|
|
6104
6152
|
*/
|
|
6105
6153
|
export const Uint8ArrayFromBase64 = /*#__PURE__*/Base64String.pipe(/*#__PURE__*/decodeTo(Uint8Array, Transformation.uint8ArrayFromBase64String));
|
|
6106
6154
|
/**
|
|
@@ -6114,7 +6162,7 @@ export const Uint8ArrayFromBase64 = /*#__PURE__*/Base64String.pipe(/*#__PURE__*/
|
|
|
6114
6162
|
* - A `Uint8Array` is encoded as a base64 (URL) encoded string.
|
|
6115
6163
|
*
|
|
6116
6164
|
* @category Uint8Array
|
|
6117
|
-
* @since
|
|
6165
|
+
* @since 3.10.0
|
|
6118
6166
|
*/
|
|
6119
6167
|
export const Uint8ArrayFromBase64Url = /*#__PURE__*/String.annotate({
|
|
6120
6168
|
expected: "a base64 (URL) encoded string that will be decoded as a Uint8Array"
|
|
@@ -6133,7 +6181,7 @@ export const Uint8ArrayFromBase64Url = /*#__PURE__*/String.annotate({
|
|
|
6133
6181
|
* - A `Uint8Array` is encoded as a hex encoded string.
|
|
6134
6182
|
*
|
|
6135
6183
|
* @category Uint8Array
|
|
6136
|
-
* @since
|
|
6184
|
+
* @since 3.10.0
|
|
6137
6185
|
*/
|
|
6138
6186
|
export const Uint8ArrayFromHex = /*#__PURE__*/String.annotate({
|
|
6139
6187
|
expected: "a hex encoded string that will be decoded as a Uint8Array"
|
|
@@ -6149,7 +6197,7 @@ export const Uint8ArrayFromHex = /*#__PURE__*/String.annotate({
|
|
|
6149
6197
|
* - encodes `DateTime.Utc` as a UTC ISO string
|
|
6150
6198
|
*
|
|
6151
6199
|
* @category DateTime
|
|
6152
|
-
* @since
|
|
6200
|
+
* @since 3.10.0
|
|
6153
6201
|
*/
|
|
6154
6202
|
export const DateTimeUtc = /*#__PURE__*/declare(u => DateTime.isDateTime(u) && DateTime.isUtc(u), {
|
|
6155
6203
|
typeConstructor: {
|
|
@@ -6179,7 +6227,7 @@ export const DateTimeUtc = /*#__PURE__*/declare(u => DateTime.isDateTime(u) && D
|
|
|
6179
6227
|
* - A `DateTime.Utc` is encoded as a `Date`
|
|
6180
6228
|
*
|
|
6181
6229
|
* @category DateTime
|
|
6182
|
-
* @since
|
|
6230
|
+
* @since 3.12.0
|
|
6183
6231
|
*/
|
|
6184
6232
|
export const DateTimeUtcFromDate = /*#__PURE__*/DateValid.pipe(/*#__PURE__*/decodeTo(DateTimeUtc, {
|
|
6185
6233
|
decode: /*#__PURE__*/Getter.dateTimeUtcFromInput(),
|
|
@@ -6227,7 +6275,7 @@ export const DateTimeUtcFromMillis = /*#__PURE__*/Number.pipe(/*#__PURE__*/decod
|
|
|
6227
6275
|
* - encodes `DateTime.TimeZone.Offset` as a number (offset in milliseconds)
|
|
6228
6276
|
*
|
|
6229
6277
|
* @category DateTime
|
|
6230
|
-
* @since
|
|
6278
|
+
* @since 3.10.0
|
|
6231
6279
|
*/
|
|
6232
6280
|
export const TimeZoneOffset = /*#__PURE__*/declare(DateTime.isTimeZoneOffset, {
|
|
6233
6281
|
typeConstructor: {
|
|
@@ -6258,7 +6306,7 @@ const TimeZoneNamedString = /*#__PURE__*/String.annotate({
|
|
|
6258
6306
|
* - encodes `DateTime.TimeZone.Named` as a string (IANA time zone identifier)
|
|
6259
6307
|
*
|
|
6260
6308
|
* @category DateTime
|
|
6261
|
-
* @since
|
|
6309
|
+
* @since 3.10.0
|
|
6262
6310
|
*/
|
|
6263
6311
|
export const TimeZoneNamed = /*#__PURE__*/declare(DateTime.isTimeZoneNamed, {
|
|
6264
6312
|
typeConstructor: {
|
|
@@ -6300,7 +6348,7 @@ const TimeZoneString = /*#__PURE__*/String.annotate({
|
|
|
6300
6348
|
* `+03:00`)
|
|
6301
6349
|
*
|
|
6302
6350
|
* @category DateTime
|
|
6303
|
-
* @since
|
|
6351
|
+
* @since 3.10.0
|
|
6304
6352
|
*/
|
|
6305
6353
|
export const TimeZone = /*#__PURE__*/declare(DateTime.isTimeZone, {
|
|
6306
6354
|
typeConstructor: {
|
|
@@ -6347,7 +6395,7 @@ const DateTimeZonedString = /*#__PURE__*/String.annotate({
|
|
|
6347
6395
|
* `YYYY-MM-DDTHH:mm:ss.sss+HH:MM[Time/Zone]`
|
|
6348
6396
|
*
|
|
6349
6397
|
* @category DateTime
|
|
6350
|
-
* @since
|
|
6398
|
+
* @since 3.10.0
|
|
6351
6399
|
*/
|
|
6352
6400
|
export const DateTimeZoned = /*#__PURE__*/declare(u => DateTime.isDateTime(u) && DateTime.isZoned(u), {
|
|
6353
6401
|
typeConstructor: {
|
|
@@ -6525,8 +6573,8 @@ function isStruct(schema) {
|
|
|
6525
6573
|
* console.log(dog.breed) // "Labrador"
|
|
6526
6574
|
* ```
|
|
6527
6575
|
*
|
|
6528
|
-
* @category
|
|
6529
|
-
* @since
|
|
6576
|
+
* @category constructors
|
|
6577
|
+
* @since 3.10.0
|
|
6530
6578
|
*/
|
|
6531
6579
|
export const Class = identifier => (schema, annotations) => {
|
|
6532
6580
|
const struct = isStruct(schema) ? schema : Struct(schema);
|
|
@@ -6560,8 +6608,8 @@ export const Class = identifier => (schema, annotations) => {
|
|
|
6560
6608
|
* console.log(c.radius) // 5
|
|
6561
6609
|
* ```
|
|
6562
6610
|
*
|
|
6563
|
-
* @category
|
|
6564
|
-
* @since
|
|
6611
|
+
* @category constructors
|
|
6612
|
+
* @since 3.10.0
|
|
6565
6613
|
*/
|
|
6566
6614
|
export const TaggedClass = identifier => {
|
|
6567
6615
|
return (tagValue, schema, annotations) => {
|
|
@@ -6594,7 +6642,7 @@ export const TaggedClass = identifier => {
|
|
|
6594
6642
|
* })
|
|
6595
6643
|
* ```
|
|
6596
6644
|
*
|
|
6597
|
-
* @category
|
|
6645
|
+
* @category constructors
|
|
6598
6646
|
* @since 4.0.0
|
|
6599
6647
|
*/
|
|
6600
6648
|
export const ErrorClass = identifier => (schema, annotations) => {
|
|
@@ -6623,8 +6671,8 @@ export const ErrorClass = identifier => (schema, annotations) => {
|
|
|
6623
6671
|
* })
|
|
6624
6672
|
* ```
|
|
6625
6673
|
*
|
|
6626
|
-
* @category
|
|
6627
|
-
* @since
|
|
6674
|
+
* @category constructors
|
|
6675
|
+
* @since 3.10.0
|
|
6628
6676
|
*/
|
|
6629
6677
|
export const TaggedErrorClass = identifier => {
|
|
6630
6678
|
return (tagValue, schema, annotations) => {
|