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
|
@@ -17,6 +17,7 @@ import { format, formatPropertyKey } from "./Formatter.js";
|
|
|
17
17
|
import { collectBrands } from "./internal/schema/annotations.js";
|
|
18
18
|
import * as InternalRepresentation from "./internal/schema/representation.js";
|
|
19
19
|
import { unescapeToken } from "./JsonPointer.js";
|
|
20
|
+
import { remainder } from "./Number.js";
|
|
20
21
|
import * as Option from "./Option.js";
|
|
21
22
|
import * as Predicate from "./Predicate.js";
|
|
22
23
|
import * as Rec from "./Record.js";
|
|
@@ -2041,46 +2042,30 @@ export function fromJsonSchemaDocument(document, options) {
|
|
|
2041
2042
|
* @since 4.0.0
|
|
2042
2043
|
*/
|
|
2043
2044
|
export function fromJsonSchemaMultiDocument(document, options) {
|
|
2044
|
-
let
|
|
2045
|
+
let definitionIdentifier;
|
|
2045
2046
|
const references = {};
|
|
2046
|
-
const
|
|
2047
|
-
function getSlot(identifier) {
|
|
2048
|
-
const existing = slots.get(identifier);
|
|
2049
|
-
if (existing) return existing;
|
|
2050
|
-
// Create the slot *before* resolving, so self-references can see it.
|
|
2051
|
-
const slot = {
|
|
2052
|
-
state: 0,
|
|
2053
|
-
value: undefined
|
|
2054
|
-
};
|
|
2055
|
-
slots.set(identifier, slot);
|
|
2056
|
-
return slot;
|
|
2057
|
-
}
|
|
2047
|
+
const resolvedReferences = new Map();
|
|
2058
2048
|
function resolveReference($ref) {
|
|
2059
2049
|
const definition = document.definitions[$ref];
|
|
2060
2050
|
if (definition === undefined) {
|
|
2061
2051
|
throw new Error(`Reference ${$ref} not found`);
|
|
2062
2052
|
}
|
|
2063
|
-
const
|
|
2064
|
-
if (
|
|
2065
|
-
// Already built: return the built schema directly
|
|
2066
|
-
return slot.value;
|
|
2067
|
-
}
|
|
2068
|
-
if (slot.state === 1) {
|
|
2069
|
-
// Circular: we're currently building this identifier.
|
|
2053
|
+
const resolved = resolvedReferences.get($ref);
|
|
2054
|
+
if (resolved === null) {
|
|
2070
2055
|
throw new Error(`Circular reference detected: ${$ref}`);
|
|
2071
2056
|
}
|
|
2072
|
-
|
|
2073
|
-
|
|
2057
|
+
if (resolved !== undefined) return resolved;
|
|
2058
|
+
resolvedReferences.set($ref, null);
|
|
2074
2059
|
const value = recur(definition);
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
return
|
|
2060
|
+
const out = value._tag === "Reference" ? resolveReference(value.$ref) : value;
|
|
2061
|
+
resolvedReferences.set($ref, out);
|
|
2062
|
+
return out;
|
|
2078
2063
|
}
|
|
2079
|
-
Object.entries(document.definitions)
|
|
2080
|
-
|
|
2064
|
+
for (const [identifier, definition] of Object.entries(document.definitions)) {
|
|
2065
|
+
definitionIdentifier = identifier;
|
|
2081
2066
|
references[identifier] = unknownToJson(recur(definition));
|
|
2082
|
-
}
|
|
2083
|
-
|
|
2067
|
+
}
|
|
2068
|
+
definitionIdentifier = undefined;
|
|
2084
2069
|
const representations = Arr.map(document.schemas, schema => unknownToJson(recur(schema)));
|
|
2085
2070
|
return {
|
|
2086
2071
|
representations,
|
|
@@ -2141,7 +2126,7 @@ export function fromJsonSchemaMultiDocument(document, options) {
|
|
|
2141
2126
|
_tag: "Reference",
|
|
2142
2127
|
$ref: unescapeToken($ref)
|
|
2143
2128
|
};
|
|
2144
|
-
if (
|
|
2129
|
+
if (definitionIdentifier === $ref) {
|
|
2145
2130
|
return {
|
|
2146
2131
|
_tag: "Suspend",
|
|
2147
2132
|
thunk: reference,
|
|
@@ -2293,129 +2278,104 @@ export function fromJsonSchemaMultiDocument(document, options) {
|
|
|
2293
2278
|
case "Never":
|
|
2294
2279
|
return a;
|
|
2295
2280
|
case "Unknown":
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
...combineAnnotations(a.annotations, b.annotations)
|
|
2303
|
-
};
|
|
2281
|
+
{
|
|
2282
|
+
const resolved = b._tag === "Reference" ? resolveReference(b.$ref) : b;
|
|
2283
|
+
return {
|
|
2284
|
+
...resolved,
|
|
2285
|
+
...combineAnnotations(a.annotations, resolved.annotations)
|
|
2286
|
+
};
|
|
2304
2287
|
}
|
|
2305
2288
|
case "Null":
|
|
2306
|
-
switch (b._tag) {
|
|
2307
|
-
case "Unknown":
|
|
2308
|
-
case "Null":
|
|
2309
|
-
return {
|
|
2310
|
-
...a,
|
|
2311
|
-
...combineAnnotations(a.annotations, b.annotations)
|
|
2312
|
-
};
|
|
2313
|
-
case "Union":
|
|
2314
|
-
return combine(b, a);
|
|
2315
|
-
case "Reference":
|
|
2316
|
-
return combine(a, resolveReference(b.$ref));
|
|
2317
|
-
default:
|
|
2318
|
-
return never;
|
|
2319
|
-
}
|
|
2320
2289
|
case "String":
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2290
|
+
case "Number":
|
|
2291
|
+
case "Boolean":
|
|
2292
|
+
case "Literal":
|
|
2293
|
+
case "Arrays":
|
|
2294
|
+
case "Objects":
|
|
2295
|
+
case "Union":
|
|
2296
|
+
break;
|
|
2297
|
+
}
|
|
2298
|
+
if (b._tag === "Reference") {
|
|
2299
|
+
return combine(a, resolveReference(b.$ref));
|
|
2300
|
+
}
|
|
2301
|
+
if (b._tag === "Unknown") {
|
|
2302
|
+
return {
|
|
2303
|
+
...a,
|
|
2304
|
+
...combineAnnotations(a.annotations, b.annotations)
|
|
2305
|
+
};
|
|
2306
|
+
}
|
|
2307
|
+
if (a._tag === "Union") {
|
|
2308
|
+
const types = a.types.map(s => combine(s, b)).filter(s => s !== never);
|
|
2309
|
+
if (types.length === 0) return never;
|
|
2310
|
+
return {
|
|
2311
|
+
_tag: "Union",
|
|
2312
|
+
types,
|
|
2313
|
+
mode: a.mode,
|
|
2314
|
+
...makeAnnotations(a.annotations)
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
if (b._tag === "Union") {
|
|
2318
|
+
return combine(b, a);
|
|
2319
|
+
}
|
|
2320
|
+
switch (a._tag) {
|
|
2321
|
+
case "Null":
|
|
2322
|
+
return b._tag === "Null" ? {
|
|
2323
|
+
...a,
|
|
2324
|
+
...combineAnnotations(a.annotations, b.annotations)
|
|
2325
|
+
} : never;
|
|
2326
|
+
case "String":
|
|
2327
|
+
{
|
|
2328
|
+
if (b._tag === "Literal") {
|
|
2329
|
+
return satisfiesLiteral(a, b) ? {
|
|
2338
2330
|
...b,
|
|
2339
2331
|
...combineAnnotations(a.annotations, b.annotations)
|
|
2340
2332
|
} : never;
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2333
|
+
}
|
|
2334
|
+
if (b._tag !== "String") return never;
|
|
2335
|
+
const checks = combineChecks(a.checks, b.checks, b.annotations);
|
|
2336
|
+
return {
|
|
2337
|
+
_tag: "String",
|
|
2338
|
+
checks: checks ?? a.checks,
|
|
2339
|
+
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
2340
|
+
};
|
|
2347
2341
|
}
|
|
2348
2342
|
case "Number":
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
return {
|
|
2352
|
-
...a,
|
|
2353
|
-
...combineAnnotations(a.annotations, b.annotations)
|
|
2354
|
-
};
|
|
2355
|
-
case "Number":
|
|
2356
|
-
{
|
|
2357
|
-
const checks = combineNumberChecks(a.checks, b.checks, b.annotations);
|
|
2358
|
-
return {
|
|
2359
|
-
_tag: "Number",
|
|
2360
|
-
checks: checks ?? a.checks,
|
|
2361
|
-
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
2362
|
-
};
|
|
2363
|
-
}
|
|
2364
|
-
case "Literal":
|
|
2365
|
-
return typeof b.literal === "number" ? {
|
|
2343
|
+
{
|
|
2344
|
+
if (b._tag === "Literal") {
|
|
2345
|
+
return satisfiesLiteral(a, b) ? {
|
|
2366
2346
|
...b,
|
|
2367
2347
|
...combineAnnotations(a.annotations, b.annotations)
|
|
2368
2348
|
} : never;
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2349
|
+
}
|
|
2350
|
+
if (b._tag !== "Number") return never;
|
|
2351
|
+
const checks = combineNumberChecks(a.checks, b.checks, b.annotations);
|
|
2352
|
+
return {
|
|
2353
|
+
_tag: "Number",
|
|
2354
|
+
checks: checks ?? a.checks,
|
|
2355
|
+
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
2356
|
+
};
|
|
2375
2357
|
}
|
|
2376
2358
|
case "Boolean":
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
};
|
|
2383
|
-
case "Boolean":
|
|
2384
|
-
return {
|
|
2385
|
-
_tag: "Boolean",
|
|
2386
|
-
...combineAnnotations(a.annotations, b.annotations)
|
|
2387
|
-
};
|
|
2388
|
-
case "Literal":
|
|
2389
|
-
return typeof b.literal === "boolean" ? {
|
|
2390
|
-
...b,
|
|
2391
|
-
...combineAnnotations(a.annotations, b.annotations)
|
|
2392
|
-
} : never;
|
|
2393
|
-
case "Union":
|
|
2394
|
-
return combine(b, a);
|
|
2395
|
-
case "Reference":
|
|
2396
|
-
return combine(a, resolveReference(b.$ref));
|
|
2397
|
-
default:
|
|
2398
|
-
return never;
|
|
2359
|
+
if (b._tag === "Boolean") {
|
|
2360
|
+
return {
|
|
2361
|
+
_tag: "Boolean",
|
|
2362
|
+
...combineAnnotations(a.annotations, b.annotations)
|
|
2363
|
+
};
|
|
2399
2364
|
}
|
|
2365
|
+
return b._tag === "Literal" && typeof b.literal === "boolean" ? {
|
|
2366
|
+
...b,
|
|
2367
|
+
...combineAnnotations(a.annotations, b.annotations)
|
|
2368
|
+
} : never;
|
|
2400
2369
|
case "Literal":
|
|
2401
2370
|
switch (b._tag) {
|
|
2402
|
-
case "Unknown":
|
|
2403
|
-
return {
|
|
2404
|
-
...a,
|
|
2405
|
-
...combineAnnotations(a.annotations, b.annotations)
|
|
2406
|
-
};
|
|
2407
2371
|
case "Literal":
|
|
2408
2372
|
return a.literal === b.literal ? {
|
|
2409
2373
|
...a,
|
|
2410
2374
|
...combineAnnotations(a.annotations, b.annotations)
|
|
2411
2375
|
} : never;
|
|
2412
2376
|
case "String":
|
|
2413
|
-
return typeof a.literal === "string" ? {
|
|
2414
|
-
...a,
|
|
2415
|
-
...combineAnnotations(a.annotations, b.annotations)
|
|
2416
|
-
} : never;
|
|
2417
2377
|
case "Number":
|
|
2418
|
-
return
|
|
2378
|
+
return satisfiesLiteral(b, a) ? {
|
|
2419
2379
|
...a,
|
|
2420
2380
|
...combineAnnotations(a.annotations, b.annotations)
|
|
2421
2381
|
} : never;
|
|
@@ -2424,86 +2384,76 @@ export function fromJsonSchemaMultiDocument(document, options) {
|
|
|
2424
2384
|
...a,
|
|
2425
2385
|
...combineAnnotations(a.annotations, b.annotations)
|
|
2426
2386
|
} : never;
|
|
2427
|
-
case "Union":
|
|
2428
|
-
return combine(b, a);
|
|
2429
|
-
case "Reference":
|
|
2430
|
-
return combine(a, resolveReference(b.$ref));
|
|
2431
2387
|
default:
|
|
2432
2388
|
return never;
|
|
2433
2389
|
}
|
|
2434
2390
|
case "Arrays":
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
rest: combineRest(a.rest, b.rest),
|
|
2448
|
-
checks: checks ?? a.checks,
|
|
2449
|
-
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
2450
|
-
};
|
|
2451
|
-
}
|
|
2452
|
-
case "Union":
|
|
2453
|
-
return combine(b, a);
|
|
2454
|
-
case "Reference":
|
|
2455
|
-
return combine(a, resolveReference(b.$ref));
|
|
2456
|
-
default:
|
|
2457
|
-
return never;
|
|
2391
|
+
{
|
|
2392
|
+
if (b._tag !== "Arrays") return never;
|
|
2393
|
+
const arrays = combineArrays(a, b);
|
|
2394
|
+
if (arrays === undefined) return never;
|
|
2395
|
+
const checks = combineArraysChecks(a.checks, b.checks, b.annotations);
|
|
2396
|
+
return {
|
|
2397
|
+
_tag: "Arrays",
|
|
2398
|
+
elements: arrays.elements,
|
|
2399
|
+
rest: arrays.rest,
|
|
2400
|
+
checks: checks ?? a.checks,
|
|
2401
|
+
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
2402
|
+
};
|
|
2458
2403
|
}
|
|
2459
2404
|
case "Objects":
|
|
2460
|
-
switch (b._tag) {
|
|
2461
|
-
case "Unknown":
|
|
2462
|
-
return {
|
|
2463
|
-
...a,
|
|
2464
|
-
...combineAnnotations(a.annotations, b.annotations)
|
|
2465
|
-
};
|
|
2466
|
-
case "Objects":
|
|
2467
|
-
{
|
|
2468
|
-
const checks = combineChecks(a.checks, b.checks, b.annotations);
|
|
2469
|
-
return {
|
|
2470
|
-
_tag: "Objects",
|
|
2471
|
-
propertySignatures: combinePropertySignatures(a.propertySignatures, b.propertySignatures),
|
|
2472
|
-
indexSignatures: combineIndexSignatures(a.indexSignatures, b.indexSignatures),
|
|
2473
|
-
checks: checks ?? a.checks,
|
|
2474
|
-
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
2475
|
-
};
|
|
2476
|
-
}
|
|
2477
|
-
case "Union":
|
|
2478
|
-
return combine(b, a);
|
|
2479
|
-
case "Reference":
|
|
2480
|
-
return combine(a, resolveReference(b.$ref));
|
|
2481
|
-
default:
|
|
2482
|
-
return never;
|
|
2483
|
-
}
|
|
2484
|
-
case "Union":
|
|
2485
2405
|
{
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
if (types.length === 0) return never;
|
|
2496
|
-
return {
|
|
2497
|
-
_tag: "Union",
|
|
2498
|
-
types,
|
|
2499
|
-
mode: a.mode,
|
|
2500
|
-
...makeAnnotations(a.annotations)
|
|
2501
|
-
};
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2406
|
+
if (b._tag !== "Objects") return never;
|
|
2407
|
+
const checks = combineChecks(a.checks, b.checks, b.annotations);
|
|
2408
|
+
return {
|
|
2409
|
+
_tag: "Objects",
|
|
2410
|
+
propertySignatures: combinePropertySignatures(a.propertySignatures, b.propertySignatures),
|
|
2411
|
+
indexSignatures: combineIndexSignatures(a.indexSignatures, b.indexSignatures),
|
|
2412
|
+
checks: checks ?? a.checks,
|
|
2413
|
+
...combineAnnotations(a.annotations, checks ? undefined : b.annotations)
|
|
2414
|
+
};
|
|
2504
2415
|
}
|
|
2416
|
+
default:
|
|
2417
|
+
return never;
|
|
2505
2418
|
}
|
|
2506
2419
|
}
|
|
2420
|
+
function satisfiesPrimitiveCheck(check, value) {
|
|
2421
|
+
if (check._tag === "FilterGroup") {
|
|
2422
|
+
return check.checks.every(check => satisfiesPrimitiveCheck(check, value));
|
|
2423
|
+
}
|
|
2424
|
+
const meta = check.meta;
|
|
2425
|
+
switch (meta._tag) {
|
|
2426
|
+
case "isMinLength":
|
|
2427
|
+
return typeof value === "string" && value.length >= meta.minLength;
|
|
2428
|
+
case "isMaxLength":
|
|
2429
|
+
return typeof value === "string" && value.length <= meta.maxLength;
|
|
2430
|
+
case "isPattern":
|
|
2431
|
+
return typeof value === "string" && meta.regExp.test(value);
|
|
2432
|
+
case "isFinite":
|
|
2433
|
+
return typeof value === "number" && globalThis.Number.isFinite(value);
|
|
2434
|
+
case "isInt":
|
|
2435
|
+
return typeof value === "number" && globalThis.Number.isSafeInteger(value);
|
|
2436
|
+
case "isMultipleOf":
|
|
2437
|
+
return typeof value === "number" && remainder(value, meta.divisor) === 0;
|
|
2438
|
+
case "isGreaterThan":
|
|
2439
|
+
return typeof value === "number" && value > meta.exclusiveMinimum;
|
|
2440
|
+
case "isGreaterThanOrEqualTo":
|
|
2441
|
+
return typeof value === "number" && value >= meta.minimum;
|
|
2442
|
+
case "isLessThan":
|
|
2443
|
+
return typeof value === "number" && value < meta.exclusiveMaximum;
|
|
2444
|
+
case "isLessThanOrEqualTo":
|
|
2445
|
+
return typeof value === "number" && value <= meta.maximum;
|
|
2446
|
+
default:
|
|
2447
|
+
return false;
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
function satisfiesLiteral(type, literal) {
|
|
2451
|
+
const value = literal.literal;
|
|
2452
|
+
if (type._tag === "String" ? typeof value !== "string" : typeof value !== "number") {
|
|
2453
|
+
return false;
|
|
2454
|
+
}
|
|
2455
|
+
return type.checks.every(check => satisfiesPrimitiveCheck(check, value));
|
|
2456
|
+
}
|
|
2507
2457
|
function collectProperties(js) {
|
|
2508
2458
|
const properties = Predicate.isObject(js.properties) ? js.properties : {};
|
|
2509
2459
|
const required = Array.isArray(js.required) ? js.required : [];
|
|
@@ -2544,34 +2494,46 @@ export function fromJsonSchemaMultiDocument(document, options) {
|
|
|
2544
2494
|
}
|
|
2545
2495
|
return out;
|
|
2546
2496
|
}
|
|
2547
|
-
function
|
|
2548
|
-
const
|
|
2549
|
-
|
|
2497
|
+
function combineArrays(a, b) {
|
|
2498
|
+
const elements = [];
|
|
2499
|
+
const len = Math.max(a.elements.length, b.elements.length);
|
|
2550
2500
|
for (let i = 0; i < len; i++) {
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2501
|
+
const ae = a.elements[i];
|
|
2502
|
+
const be = b.elements[i];
|
|
2503
|
+
const isOptional = ae?.isOptional !== false && be?.isOptional !== false;
|
|
2504
|
+
const at = ae?.type ?? a.rest[0];
|
|
2505
|
+
const bt = be?.type ?? b.rest[0];
|
|
2506
|
+
if (at === undefined || bt === undefined) {
|
|
2507
|
+
return isOptional ? {
|
|
2508
|
+
elements,
|
|
2509
|
+
rest: []
|
|
2510
|
+
} : undefined;
|
|
2511
|
+
}
|
|
2512
|
+
const type = combine(at, bt);
|
|
2513
|
+
if (type === never) {
|
|
2514
|
+
return isOptional ? {
|
|
2515
|
+
elements,
|
|
2516
|
+
rest: []
|
|
2517
|
+
} : undefined;
|
|
2518
|
+
}
|
|
2519
|
+
elements.push({
|
|
2520
|
+
isOptional,
|
|
2521
|
+
type
|
|
2554
2522
|
});
|
|
2555
2523
|
}
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
function combineRest(a, b) {
|
|
2564
|
-
const len = Math.max(a.length, b.length);
|
|
2565
|
-
let out = [];
|
|
2566
|
-
for (let i = 0; i < len; i++) {
|
|
2567
|
-
out.push(combine(a[i], b[i]));
|
|
2568
|
-
}
|
|
2569
|
-
if (a.length > len) {
|
|
2570
|
-
out = [...out, ...a.slice(len)];
|
|
2571
|
-
} else if (b.length > len) {
|
|
2572
|
-
out = [...out, ...b.slice(len)];
|
|
2524
|
+
const ar = a.rest[0];
|
|
2525
|
+
const br = b.rest[0];
|
|
2526
|
+
if (ar === undefined || br === undefined) {
|
|
2527
|
+
return {
|
|
2528
|
+
elements,
|
|
2529
|
+
rest: []
|
|
2530
|
+
};
|
|
2573
2531
|
}
|
|
2574
|
-
|
|
2532
|
+
const rest = combine(ar, br);
|
|
2533
|
+
return {
|
|
2534
|
+
elements,
|
|
2535
|
+
rest: rest === never ? [] : [rest]
|
|
2536
|
+
};
|
|
2575
2537
|
}
|
|
2576
2538
|
function combinePropertySignatures(a, b) {
|
|
2577
2539
|
const propertySignatures = [];
|