effect 4.0.0-beta.94 → 4.0.0-beta.98
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.map +1 -1
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +44 -6
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +63 -24
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts.map +1 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Cron.d.ts +4 -1
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +98 -53
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/DateTime.d.ts +12 -12
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ExecutionPlan.d.ts +2 -2
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/FiberHandle.d.ts +8 -8
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberMap.d.ts +8 -8
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberSet.d.ts +4 -4
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Function.d.ts.map +1 -1
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Layer.d.ts.map +1 -1
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerRef.d.ts +5 -7
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +4 -6
- package/dist/LayerRef.js.map +1 -1
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/Logger.d.ts.map +1 -1
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/Metric.d.ts.map +1 -1
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +28 -10
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Option.d.ts.map +1 -1
- package/dist/Order.d.ts.map +1 -1
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/Record.d.ts.map +1 -1
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Ref.d.ts.map +1 -1
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/Request.d.ts +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Schedule.d.ts +1206 -4013
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +244 -1348
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +71 -22
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +76 -33
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +25 -10
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaError.d.ts +53 -0
- package/dist/SchemaError.d.ts.map +1 -0
- package/dist/SchemaError.js +61 -0
- package/dist/SchemaError.js.map +1 -0
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +17 -12
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaRepresentation.d.ts +106 -106
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +186 -224
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +38 -2
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +38 -2
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stream.d.ts +2 -2
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +1 -1
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts.map +1 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/Take.d.ts.map +1 -1
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/Types.d.ts +1 -1
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/Utils.d.ts.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js +26 -8
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schema/equivalence.js +1 -2
- package/dist/internal/schema/equivalence.js.map +1 -1
- package/dist/internal/schema/representation.js +1 -3
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.d.ts +0 -13
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +4 -29
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +1 -1
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +1 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +278 -278
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +8 -16
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +8 -16
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/Command.d.ts +4 -3
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +3 -3
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +6 -8
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +6 -6
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts.map +1 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +2 -4
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +25 -29
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +8 -8
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +3 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +6 -8
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +1 -1
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +26 -24
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +2 -2
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +21 -21
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +3 -4
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +1 -1
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +1 -1
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +1 -1
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +2 -2
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +2 -1
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +36 -15
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +19 -20
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +51 -62
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +68 -58
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +53 -53
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +40 -30
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +171 -170
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +31 -19
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +23 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +31 -0
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +55 -30
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +22 -29
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +8 -8
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +4 -3
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +8 -0
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +4 -4
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +9 -8
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +77 -37
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/internal/html.js +6 -2
- package/dist/unstable/httpapi/internal/html.js.map +1 -1
- package/dist/unstable/httpapi/internal/mediaType.d.ts +2 -0
- package/dist/unstable/httpapi/internal/mediaType.d.ts.map +1 -0
- package/dist/unstable/httpapi/internal/mediaType.js +7 -0
- package/dist/unstable/httpapi/internal/mediaType.js.map +1 -0
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +3 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +16 -12
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +2 -2
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +1 -1
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +7 -7
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +3 -2
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +28 -37
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +2 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +5 -5
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +7 -7
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +2 -2
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +8 -8
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +5 -3
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +11 -8
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/schema/Model.d.ts +24 -38
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -1
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +1 -1
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +1 -1
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +1 -1
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +1 -2
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +11 -12
- package/src/ConfigProvider.ts +79 -27
- package/src/Cron.ts +109 -57
- package/src/LayerRef.ts +4 -6
- package/src/Number.ts +29 -10
- package/src/Schedule.ts +1437 -4445
- package/src/Schema.ts +95 -34
- package/src/SchemaAST.ts +25 -13
- package/src/SchemaError.ts +64 -0
- package/src/SchemaGetter.ts +22 -16
- package/src/SchemaRepresentation.ts +165 -202
- package/src/SchemaTransformation.ts +42 -2
- package/src/Stream.ts +1 -1
- package/src/index.ts +10 -0
- package/src/internal/effect.ts +39 -22
- package/src/internal/schema/equivalence.ts +1 -2
- package/src/internal/schema/representation.ts +4 -4
- package/src/internal/schema/schema.ts +4 -37
- package/src/unstable/cli/CliError.ts +24 -16
- package/src/unstable/cli/Command.ts +8 -8
- package/src/unstable/cli/GlobalFlag.ts +22 -33
- package/src/unstable/cluster/ClusterCron.ts +4 -3
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -3
- package/src/unstable/cluster/EntityProxyServer.ts +15 -17
- package/src/unstable/cluster/Sharding.ts +4 -4
- package/src/unstable/cluster/Snowflake.ts +2 -2
- package/src/unstable/cluster/internal/entityManager.ts +61 -47
- package/src/unstable/eventlog/EventLog.ts +4 -3
- package/src/unstable/httpapi/HttpApi.ts +72 -47
- package/src/unstable/httpapi/HttpApiBuilder.ts +320 -217
- package/src/unstable/httpapi/HttpApiClient.ts +196 -151
- package/src/unstable/httpapi/HttpApiEndpoint.ts +251 -447
- package/src/unstable/httpapi/HttpApiError.ts +33 -0
- package/src/unstable/httpapi/HttpApiGroup.ts +95 -74
- package/src/unstable/httpapi/HttpApiMiddleware.ts +10 -7
- package/src/unstable/httpapi/HttpApiScalar.ts +15 -12
- package/src/unstable/httpapi/HttpApiSchema.ts +8 -0
- package/src/unstable/httpapi/HttpApiSwagger.ts +2 -2
- package/src/unstable/httpapi/HttpApiTest.ts +15 -14
- package/src/unstable/httpapi/OpenApi.ts +74 -36
- package/src/unstable/httpapi/internal/html.ts +9 -2
- package/src/unstable/httpapi/internal/mediaType.ts +6 -0
- package/src/unstable/observability/OtlpExporter.ts +1 -1
- package/src/unstable/persistence/PersistedQueue.ts +16 -14
- package/src/unstable/reactivity/Atom.ts +1 -1
- package/src/unstable/reactivity/AtomHttpApi.ts +164 -162
- package/src/unstable/reactivity/AtomRegistry.ts +35 -44
- package/src/unstable/rpc/RpcClient.ts +10 -9
- package/src/unstable/rpc/RpcMessage.ts +8 -9
- package/src/unstable/rpc/RpcSerialization.ts +16 -16
- package/src/unstable/rpc/RpcServer.ts +15 -9
- package/src/unstable/workflow/Activity.ts +6 -5
- package/src/unstable/workflow/DurableDeferred.ts +1 -1
- package/src/unstable/workflow/DurableQueue.ts +4 -3
- package/src/unstable/workflow/WorkflowEngine.ts +4 -3
- package/src/unstable/workflow/WorkflowProxyServer.ts +11 -12
|
@@ -18,6 +18,7 @@ import { collectBrands } from "./internal/schema/annotations.ts"
|
|
|
18
18
|
import * as InternalRepresentation from "./internal/schema/representation.ts"
|
|
19
19
|
import { unescapeToken } from "./JsonPointer.ts"
|
|
20
20
|
import type * as JsonSchema from "./JsonSchema.ts"
|
|
21
|
+
import { remainder } from "./Number.ts"
|
|
21
22
|
import * as Option from "./Option.ts"
|
|
22
23
|
import * as Predicate from "./Predicate.ts"
|
|
23
24
|
import * as Rec from "./Record.ts"
|
|
@@ -3038,63 +3039,37 @@ export function fromJsonSchemaDocument(document: JsonSchema.Document<"draft-2020
|
|
|
3038
3039
|
export function fromJsonSchemaMultiDocument(document: JsonSchema.MultiDocument<"draft-2020-12">, options?: {
|
|
3039
3040
|
readonly onEnter?: ((js: JsonSchema.JsonSchema) => JsonSchema.JsonSchema) | undefined
|
|
3040
3041
|
}): MultiDocument {
|
|
3041
|
-
let
|
|
3042
|
+
let definitionIdentifier: string | undefined
|
|
3042
3043
|
const references: Record<string, Representation> = {}
|
|
3043
3044
|
|
|
3044
|
-
type
|
|
3045
|
-
|
|
3046
|
-
state: 0 | 1 | 2
|
|
3047
|
-
value: Exclude<Representation, { _tag: "Reference" }> | undefined
|
|
3048
|
-
}
|
|
3045
|
+
type ResolvedReference = Exclude<Representation, { _tag: "Reference" }>
|
|
3046
|
+
const resolvedReferences = new Map<string, ResolvedReference | null>()
|
|
3049
3047
|
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
function getSlot(identifier: string): Slot {
|
|
3053
|
-
const existing = slots.get(identifier)
|
|
3054
|
-
if (existing) return existing
|
|
3055
|
-
|
|
3056
|
-
// Create the slot *before* resolving, so self-references can see it.
|
|
3057
|
-
const slot: Slot = {
|
|
3058
|
-
state: 0,
|
|
3059
|
-
value: undefined
|
|
3060
|
-
}
|
|
3061
|
-
slots.set(identifier, slot)
|
|
3062
|
-
return slot
|
|
3063
|
-
}
|
|
3064
|
-
|
|
3065
|
-
function resolveReference($ref: string): Exclude<Representation, { _tag: "Reference" }> {
|
|
3048
|
+
function resolveReference($ref: string): ResolvedReference {
|
|
3066
3049
|
const definition = document.definitions[$ref]
|
|
3067
3050
|
if (definition === undefined) {
|
|
3068
3051
|
throw new Error(`Reference ${$ref} not found`)
|
|
3069
3052
|
}
|
|
3070
3053
|
|
|
3071
|
-
const
|
|
3072
|
-
|
|
3073
|
-
if (slot.state === 2) {
|
|
3074
|
-
// Already built: return the built schema directly
|
|
3075
|
-
return slot.value!
|
|
3076
|
-
}
|
|
3077
|
-
|
|
3078
|
-
if (slot.state === 1) {
|
|
3079
|
-
// Circular: we're currently building this identifier.
|
|
3054
|
+
const resolved = resolvedReferences.get($ref)
|
|
3055
|
+
if (resolved === null) {
|
|
3080
3056
|
throw new Error(`Circular reference detected: ${$ref}`)
|
|
3081
3057
|
}
|
|
3058
|
+
if (resolved !== undefined) return resolved
|
|
3082
3059
|
|
|
3083
|
-
|
|
3084
|
-
slot.state = 1
|
|
3060
|
+
resolvedReferences.set($ref, null)
|
|
3085
3061
|
const value = recur(definition)
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
return slot.value
|
|
3062
|
+
const out = value._tag === "Reference" ? resolveReference(value.$ref) : value
|
|
3063
|
+
resolvedReferences.set($ref, out)
|
|
3064
|
+
return out
|
|
3090
3065
|
}
|
|
3091
3066
|
|
|
3092
|
-
Object.entries(document.definitions)
|
|
3093
|
-
|
|
3067
|
+
for (const [identifier, definition] of Object.entries(document.definitions)) {
|
|
3068
|
+
definitionIdentifier = identifier
|
|
3094
3069
|
references[identifier] = unknownToJson(recur(definition))
|
|
3095
|
-
}
|
|
3070
|
+
}
|
|
3096
3071
|
|
|
3097
|
-
|
|
3072
|
+
definitionIdentifier = undefined
|
|
3098
3073
|
const representations = Arr.map(document.schemas, (schema) => unknownToJson(recur(schema)))
|
|
3099
3074
|
return {
|
|
3100
3075
|
representations,
|
|
@@ -3143,7 +3118,7 @@ export function fromJsonSchemaMultiDocument(document: JsonSchema.MultiDocument<"
|
|
|
3143
3118
|
const $ref = js.$ref.slice(2).split("/").at(-1)
|
|
3144
3119
|
if ($ref !== undefined) {
|
|
3145
3120
|
const reference: Reference = { _tag: "Reference", $ref: unescapeToken($ref) }
|
|
3146
|
-
if (
|
|
3121
|
+
if (definitionIdentifier === $ref) {
|
|
3147
3122
|
return { _tag: "Suspend", thunk: reference, checks: [] }
|
|
3148
3123
|
} else {
|
|
3149
3124
|
return reference
|
|
@@ -3250,168 +3225,159 @@ export function fromJsonSchemaMultiDocument(document: JsonSchema.MultiDocument<"
|
|
|
3250
3225
|
return combine(resolveReference(a.$ref), b)
|
|
3251
3226
|
case "Never":
|
|
3252
3227
|
return a
|
|
3253
|
-
case "Unknown":
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
default:
|
|
3258
|
-
return { ...b, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3259
|
-
}
|
|
3228
|
+
case "Unknown": {
|
|
3229
|
+
const resolved = b._tag === "Reference" ? resolveReference(b.$ref) : b
|
|
3230
|
+
return { ...resolved, ...combineAnnotations(a.annotations, resolved.annotations) }
|
|
3231
|
+
}
|
|
3260
3232
|
case "Null":
|
|
3261
|
-
switch (b._tag) {
|
|
3262
|
-
case "Unknown":
|
|
3263
|
-
case "Null":
|
|
3264
|
-
return { ...a, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3265
|
-
case "Union":
|
|
3266
|
-
return combine(b, a)
|
|
3267
|
-
case "Reference":
|
|
3268
|
-
return combine(a, resolveReference(b.$ref))
|
|
3269
|
-
default:
|
|
3270
|
-
return never
|
|
3271
|
-
}
|
|
3272
3233
|
case "String":
|
|
3273
|
-
switch (b._tag) {
|
|
3274
|
-
case "Unknown":
|
|
3275
|
-
return { ...a, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3276
|
-
case "String": {
|
|
3277
|
-
const checks = combineChecks(a.checks, b.checks, b.annotations)
|
|
3278
|
-
return {
|
|
3279
|
-
_tag: "String",
|
|
3280
|
-
checks: checks ?? a.checks,
|
|
3281
|
-
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
3282
|
-
}
|
|
3283
|
-
}
|
|
3284
|
-
case "Literal":
|
|
3285
|
-
return typeof b.literal === "string" ? { ...b, ...combineAnnotations(a.annotations, b.annotations) } : never
|
|
3286
|
-
case "Union":
|
|
3287
|
-
return combine(b, a)
|
|
3288
|
-
case "Reference":
|
|
3289
|
-
return combine(a, resolveReference(b.$ref))
|
|
3290
|
-
default:
|
|
3291
|
-
return never
|
|
3292
|
-
}
|
|
3293
3234
|
case "Number":
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3235
|
+
case "Boolean":
|
|
3236
|
+
case "Literal":
|
|
3237
|
+
case "Arrays":
|
|
3238
|
+
case "Objects":
|
|
3239
|
+
case "Union":
|
|
3240
|
+
break
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
if (b._tag === "Reference") {
|
|
3244
|
+
return combine(a, resolveReference(b.$ref))
|
|
3245
|
+
}
|
|
3246
|
+
if (b._tag === "Unknown") {
|
|
3247
|
+
return { ...a, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3248
|
+
}
|
|
3249
|
+
if (a._tag === "Union") {
|
|
3250
|
+
const types = a.types.map((s) => combine(s, b)).filter((s) => s !== never)
|
|
3251
|
+
if (types.length === 0) return never
|
|
3252
|
+
return {
|
|
3253
|
+
_tag: "Union",
|
|
3254
|
+
types,
|
|
3255
|
+
mode: a.mode,
|
|
3256
|
+
...makeAnnotations(a.annotations)
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
if (b._tag === "Union") {
|
|
3260
|
+
return combine(b, a)
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
switch (a._tag) {
|
|
3264
|
+
case "Null":
|
|
3265
|
+
return b._tag === "Null" ? { ...a, ...combineAnnotations(a.annotations, b.annotations) } : never
|
|
3266
|
+
case "String": {
|
|
3267
|
+
if (b._tag === "Literal") {
|
|
3268
|
+
return satisfiesLiteral(a, b) ? { ...b, ...combineAnnotations(a.annotations, b.annotations) } : never
|
|
3269
|
+
}
|
|
3270
|
+
if (b._tag !== "String") return never
|
|
3271
|
+
const checks = combineChecks(a.checks, b.checks, b.annotations)
|
|
3272
|
+
return {
|
|
3273
|
+
_tag: "String",
|
|
3274
|
+
checks: checks ?? a.checks,
|
|
3275
|
+
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
case "Number": {
|
|
3279
|
+
if (b._tag === "Literal") {
|
|
3280
|
+
return satisfiesLiteral(a, b) ? { ...b, ...combineAnnotations(a.annotations, b.annotations) } : never
|
|
3281
|
+
}
|
|
3282
|
+
if (b._tag !== "Number") return never
|
|
3283
|
+
const checks = combineNumberChecks(a.checks, b.checks, b.annotations)
|
|
3284
|
+
return {
|
|
3285
|
+
_tag: "Number",
|
|
3286
|
+
checks: checks ?? a.checks,
|
|
3287
|
+
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
3313
3288
|
}
|
|
3289
|
+
}
|
|
3314
3290
|
case "Boolean":
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
return { ...a, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3318
|
-
case "Boolean":
|
|
3319
|
-
return { _tag: "Boolean", ...combineAnnotations(a.annotations, b.annotations) }
|
|
3320
|
-
case "Literal":
|
|
3321
|
-
return typeof b.literal === "boolean"
|
|
3322
|
-
? { ...b, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3323
|
-
: never
|
|
3324
|
-
case "Union":
|
|
3325
|
-
return combine(b, a)
|
|
3326
|
-
case "Reference":
|
|
3327
|
-
return combine(a, resolveReference(b.$ref))
|
|
3328
|
-
default:
|
|
3329
|
-
return never
|
|
3291
|
+
if (b._tag === "Boolean") {
|
|
3292
|
+
return { _tag: "Boolean", ...combineAnnotations(a.annotations, b.annotations) }
|
|
3330
3293
|
}
|
|
3294
|
+
return b._tag === "Literal" && typeof b.literal === "boolean"
|
|
3295
|
+
? { ...b, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3296
|
+
: never
|
|
3331
3297
|
case "Literal":
|
|
3332
3298
|
switch (b._tag) {
|
|
3333
|
-
case "Unknown":
|
|
3334
|
-
return { ...a, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3335
3299
|
case "Literal":
|
|
3336
3300
|
return a.literal === b.literal
|
|
3337
3301
|
? { ...a, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3338
3302
|
: never
|
|
3339
3303
|
case "String":
|
|
3340
|
-
return typeof a.literal === "string" ? { ...a, ...combineAnnotations(a.annotations, b.annotations) } : never
|
|
3341
3304
|
case "Number":
|
|
3342
|
-
return
|
|
3305
|
+
return satisfiesLiteral(b, a) ? { ...a, ...combineAnnotations(a.annotations, b.annotations) } : never
|
|
3343
3306
|
case "Boolean":
|
|
3344
3307
|
return typeof a.literal === "boolean"
|
|
3345
3308
|
? { ...a, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3346
3309
|
: never
|
|
3347
|
-
case "Union":
|
|
3348
|
-
return combine(b, a)
|
|
3349
|
-
case "Reference":
|
|
3350
|
-
return combine(a, resolveReference(b.$ref))
|
|
3351
3310
|
default:
|
|
3352
3311
|
return never
|
|
3353
3312
|
}
|
|
3354
|
-
case "Arrays":
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
3366
|
-
}
|
|
3367
|
-
}
|
|
3368
|
-
case "Union":
|
|
3369
|
-
return combine(b, a)
|
|
3370
|
-
case "Reference":
|
|
3371
|
-
return combine(a, resolveReference(b.$ref))
|
|
3372
|
-
default:
|
|
3373
|
-
return never
|
|
3374
|
-
}
|
|
3375
|
-
case "Objects":
|
|
3376
|
-
switch (b._tag) {
|
|
3377
|
-
case "Unknown":
|
|
3378
|
-
return { ...a, ...combineAnnotations(a.annotations, b.annotations) }
|
|
3379
|
-
case "Objects": {
|
|
3380
|
-
const checks = combineChecks(a.checks, b.checks, b.annotations)
|
|
3381
|
-
return {
|
|
3382
|
-
_tag: "Objects",
|
|
3383
|
-
propertySignatures: combinePropertySignatures(a.propertySignatures, b.propertySignatures),
|
|
3384
|
-
indexSignatures: combineIndexSignatures(a.indexSignatures, b.indexSignatures),
|
|
3385
|
-
checks: checks ?? a.checks,
|
|
3386
|
-
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
3387
|
-
}
|
|
3388
|
-
}
|
|
3389
|
-
case "Union":
|
|
3390
|
-
return combine(b, a)
|
|
3391
|
-
case "Reference":
|
|
3392
|
-
return combine(a, resolveReference(b.$ref))
|
|
3393
|
-
default:
|
|
3394
|
-
return never
|
|
3313
|
+
case "Arrays": {
|
|
3314
|
+
if (b._tag !== "Arrays") return never
|
|
3315
|
+
const arrays = combineArrays(a, b)
|
|
3316
|
+
if (arrays === undefined) return never
|
|
3317
|
+
const checks = combineArraysChecks(a.checks, b.checks, b.annotations)
|
|
3318
|
+
return {
|
|
3319
|
+
_tag: "Arrays",
|
|
3320
|
+
elements: arrays.elements,
|
|
3321
|
+
rest: arrays.rest,
|
|
3322
|
+
checks: checks ?? a.checks,
|
|
3323
|
+
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
3395
3324
|
}
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
mode: a.mode,
|
|
3407
|
-
...makeAnnotations(a.annotations)
|
|
3408
|
-
}
|
|
3409
|
-
}
|
|
3325
|
+
}
|
|
3326
|
+
case "Objects": {
|
|
3327
|
+
if (b._tag !== "Objects") return never
|
|
3328
|
+
const checks = combineChecks(a.checks, b.checks, b.annotations)
|
|
3329
|
+
return {
|
|
3330
|
+
_tag: "Objects",
|
|
3331
|
+
propertySignatures: combinePropertySignatures(a.propertySignatures, b.propertySignatures),
|
|
3332
|
+
indexSignatures: combineIndexSignatures(a.indexSignatures, b.indexSignatures),
|
|
3333
|
+
checks: checks ?? a.checks,
|
|
3334
|
+
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
3410
3335
|
}
|
|
3411
3336
|
}
|
|
3337
|
+
default:
|
|
3338
|
+
return never
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
|
|
3342
|
+
function satisfiesPrimitiveCheck(check: Check<Meta>, value: unknown): boolean {
|
|
3343
|
+
if (check._tag === "FilterGroup") {
|
|
3344
|
+
return check.checks.every((check) => satisfiesPrimitiveCheck(check, value))
|
|
3345
|
+
}
|
|
3346
|
+
const meta = check.meta
|
|
3347
|
+
switch (meta._tag) {
|
|
3348
|
+
case "isMinLength":
|
|
3349
|
+
return typeof value === "string" && value.length >= meta.minLength
|
|
3350
|
+
case "isMaxLength":
|
|
3351
|
+
return typeof value === "string" && value.length <= meta.maxLength
|
|
3352
|
+
case "isPattern":
|
|
3353
|
+
return typeof value === "string" && meta.regExp.test(value)
|
|
3354
|
+
case "isFinite":
|
|
3355
|
+
return typeof value === "number" && globalThis.Number.isFinite(value)
|
|
3356
|
+
case "isInt":
|
|
3357
|
+
return typeof value === "number" && globalThis.Number.isSafeInteger(value)
|
|
3358
|
+
case "isMultipleOf":
|
|
3359
|
+
return typeof value === "number" && remainder(value, meta.divisor) === 0
|
|
3360
|
+
case "isGreaterThan":
|
|
3361
|
+
return typeof value === "number" && value > meta.exclusiveMinimum
|
|
3362
|
+
case "isGreaterThanOrEqualTo":
|
|
3363
|
+
return typeof value === "number" && value >= meta.minimum
|
|
3364
|
+
case "isLessThan":
|
|
3365
|
+
return typeof value === "number" && value < meta.exclusiveMaximum
|
|
3366
|
+
case "isLessThanOrEqualTo":
|
|
3367
|
+
return typeof value === "number" && value <= meta.maximum
|
|
3368
|
+
default:
|
|
3369
|
+
return false
|
|
3412
3370
|
}
|
|
3413
3371
|
}
|
|
3414
3372
|
|
|
3373
|
+
function satisfiesLiteral(type: String | Number, literal: Literal): boolean {
|
|
3374
|
+
const value = literal.literal
|
|
3375
|
+
if (type._tag === "String" ? typeof value !== "string" : typeof value !== "number") {
|
|
3376
|
+
return false
|
|
3377
|
+
}
|
|
3378
|
+
return type.checks.every((check) => satisfiesPrimitiveCheck(check, value))
|
|
3379
|
+
}
|
|
3380
|
+
|
|
3415
3381
|
function collectProperties(js: JsonSchema.JsonSchema): Array<PropertySignature> {
|
|
3416
3382
|
const properties: Record<string, unknown> = Predicate.isObject(js.properties) ? js.properties : {}
|
|
3417
3383
|
const required = Array.isArray(js.required) ? js.required : []
|
|
@@ -3446,35 +3412,32 @@ export function fromJsonSchemaMultiDocument(document: JsonSchema.MultiDocument<"
|
|
|
3446
3412
|
return out
|
|
3447
3413
|
}
|
|
3448
3414
|
|
|
3449
|
-
function
|
|
3450
|
-
const
|
|
3451
|
-
|
|
3415
|
+
function combineArrays(a: Arrays, b: Arrays): Pick<Arrays, "elements" | "rest"> | undefined {
|
|
3416
|
+
const elements: Array<Element> = []
|
|
3417
|
+
const len = Math.max(a.elements.length, b.elements.length)
|
|
3452
3418
|
for (let i = 0; i < len; i++) {
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3419
|
+
const ae = a.elements[i]
|
|
3420
|
+
const be = b.elements[i]
|
|
3421
|
+
const isOptional = ae?.isOptional !== false && be?.isOptional !== false
|
|
3422
|
+
const at = ae?.type ?? a.rest[0]
|
|
3423
|
+
const bt = be?.type ?? b.rest[0]
|
|
3424
|
+
if (at === undefined || bt === undefined) {
|
|
3425
|
+
return isOptional ? { elements, rest: [] } : undefined
|
|
3426
|
+
}
|
|
3427
|
+
const type = combine(at, bt)
|
|
3428
|
+
if (type === never) {
|
|
3429
|
+
return isOptional ? { elements, rest: [] } : undefined
|
|
3430
|
+
}
|
|
3431
|
+
elements.push({ isOptional, type })
|
|
3462
3432
|
}
|
|
3463
|
-
return out
|
|
3464
|
-
}
|
|
3465
3433
|
|
|
3466
|
-
|
|
3467
|
-
const
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
out.push(combine(a[i], b[i]))
|
|
3434
|
+
const ar = a.rest[0]
|
|
3435
|
+
const br = b.rest[0]
|
|
3436
|
+
if (ar === undefined || br === undefined) {
|
|
3437
|
+
return { elements, rest: [] }
|
|
3471
3438
|
}
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
} else if (b.length > len) {
|
|
3475
|
-
out = [...out, ...b.slice(len)]
|
|
3476
|
-
}
|
|
3477
|
-
return out
|
|
3439
|
+
const rest = combine(ar, br)
|
|
3440
|
+
return { elements, rest: rest === never ? [] : [rest] }
|
|
3478
3441
|
}
|
|
3479
3442
|
|
|
3480
3443
|
function combinePropertySignatures(
|
|
@@ -871,7 +871,7 @@ export const bigintFromString = new Transformation(
|
|
|
871
871
|
* )
|
|
872
872
|
* ```
|
|
873
873
|
*
|
|
874
|
-
* @see {@link
|
|
874
|
+
* @see {@link dateFromMillis}
|
|
875
875
|
* @see {@link dateTimeUtcFromString}
|
|
876
876
|
*
|
|
877
877
|
* @category Coercions
|
|
@@ -882,6 +882,46 @@ export const dateFromString: Transformation<globalThis.Date, string> = new Trans
|
|
|
882
882
|
SchemaGetter.transform(formatDate)
|
|
883
883
|
)
|
|
884
884
|
|
|
885
|
+
/**
|
|
886
|
+
* Decodes epoch milliseconds into a `Date` and encodes a `Date` back to epoch
|
|
887
|
+
* milliseconds.
|
|
888
|
+
*
|
|
889
|
+
* **When to use**
|
|
890
|
+
*
|
|
891
|
+
* Use when you need a schema transformation for numeric timestamps represented
|
|
892
|
+
* as milliseconds since the Unix epoch.
|
|
893
|
+
*
|
|
894
|
+
* **Details**
|
|
895
|
+
*
|
|
896
|
+
* Decoding creates a `Date` from the number like `new Date(ms)`. Encoding
|
|
897
|
+
* returns the `Date` timestamp like `date.getTime()`.
|
|
898
|
+
*
|
|
899
|
+
* **Gotchas**
|
|
900
|
+
*
|
|
901
|
+
* This transformation does not validate date validity. `NaN`, `Infinity`, and
|
|
902
|
+
* `-Infinity` decode to invalid `Date` instances.
|
|
903
|
+
*
|
|
904
|
+
* **Example** (Converting milliseconds to a Date)
|
|
905
|
+
*
|
|
906
|
+
* ```ts
|
|
907
|
+
* import { Schema, SchemaTransformation } from "effect"
|
|
908
|
+
*
|
|
909
|
+
* const schema = Schema.Number.pipe(
|
|
910
|
+
* Schema.decodeTo(Schema.Date, SchemaTransformation.dateFromMillis)
|
|
911
|
+
* )
|
|
912
|
+
* ```
|
|
913
|
+
*
|
|
914
|
+
* @see {@link dateFromString}
|
|
915
|
+
* @see {@link SchemaGetter.dateTimeUtcFromInput}
|
|
916
|
+
*
|
|
917
|
+
* @category Coercions
|
|
918
|
+
* @since 4.0.0
|
|
919
|
+
*/
|
|
920
|
+
export const dateFromMillis: Transformation<globalThis.Date, number> = new Transformation(
|
|
921
|
+
SchemaGetter.Date(),
|
|
922
|
+
SchemaGetter.transform((date) => date.getTime())
|
|
923
|
+
)
|
|
924
|
+
|
|
885
925
|
/**
|
|
886
926
|
* Decodes a `string` into a `Duration` and encodes a `Duration` back to a
|
|
887
927
|
* parseable `string`.
|
|
@@ -1762,8 +1802,8 @@ export const timeZoneFromString: Transformation<DateTime.TimeZone, string> = tra
|
|
|
1762
1802
|
* UTC, and fails with `InvalidValue` when parsing fails. Encode uses
|
|
1763
1803
|
* `DateTime.formatIso`.
|
|
1764
1804
|
*
|
|
1765
|
-
* @see {@link dateTimeZonedFromString} for ISO strings that should preserve zoned date-time information
|
|
1766
1805
|
* @see {@link dateFromString} for decoding into JavaScript `Date`
|
|
1806
|
+
* @see {@link dateTimeZonedFromString} for ISO strings that should preserve zoned date-time information
|
|
1767
1807
|
*
|
|
1768
1808
|
* @category transforming
|
|
1769
1809
|
* @since 4.0.0
|
package/src/Stream.ts
CHANGED
|
@@ -1471,7 +1471,7 @@ export const fromAsyncIterable = <A, E>(
|
|
|
1471
1471
|
*
|
|
1472
1472
|
* const program = Effect.gen(function*() {
|
|
1473
1473
|
* const schedule = Schedule.spaced("50 millis").pipe(
|
|
1474
|
-
* Schedule.
|
|
1474
|
+
* Schedule.upTo({ times: 3 })
|
|
1475
1475
|
* )
|
|
1476
1476
|
* const stream = Stream.fromSchedule(schedule)
|
|
1477
1477
|
* const values = yield* Stream.runCollect(stream)
|
package/src/index.ts
CHANGED
|
@@ -296,6 +296,11 @@ export * as Layer from "./Layer.ts"
|
|
|
296
296
|
*/
|
|
297
297
|
export * as LayerMap from "./LayerMap.ts"
|
|
298
298
|
|
|
299
|
+
/**
|
|
300
|
+
* @since 4.0.0
|
|
301
|
+
*/
|
|
302
|
+
export * as LayerRef from "./LayerRef.ts"
|
|
303
|
+
|
|
299
304
|
/**
|
|
300
305
|
* @since 2.0.0
|
|
301
306
|
*/
|
|
@@ -521,6 +526,11 @@ export * as Schema from "./Schema.ts"
|
|
|
521
526
|
*/
|
|
522
527
|
export * as SchemaAST from "./SchemaAST.ts"
|
|
523
528
|
|
|
529
|
+
/**
|
|
530
|
+
* @since 4.0.0
|
|
531
|
+
*/
|
|
532
|
+
export * as SchemaError from "./SchemaError.ts"
|
|
533
|
+
|
|
524
534
|
/**
|
|
525
535
|
* @since 4.0.0
|
|
526
536
|
*/
|