effect 4.0.0-beta.100 → 4.0.0-beta.102
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/Array.js +81 -5
- package/dist/Array.js.map +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +27 -9
- package/dist/Channel.js.map +1 -1
- package/dist/Config.d.ts +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +6 -5
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.js +7 -7
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +2 -1
- package/dist/Data.js.map +1 -1
- package/dist/Effect.d.ts +61 -100
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +66 -39
- package/dist/Effect.js.map +1 -1
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +3 -2
- package/dist/FiberHandle.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +2 -1
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +4 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +9 -11
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +3 -2
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +9 -0
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +3 -0
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +4 -3
- package/dist/Metric.js.map +1 -1
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +4 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +5 -4
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +2 -1
- package/dist/Option.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +1 -4
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Record.d.ts +93 -1
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +57 -19
- package/dist/Record.js.map +1 -1
- package/dist/References.d.ts +0 -45
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +0 -45
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +9 -6
- package/dist/Request.js.map +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +2 -1
- package/dist/Result.js.map +1 -1
- package/dist/Schema.d.ts +1269 -496
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +2308 -614
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +2 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +189 -130
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaError.js +1 -1
- package/dist/SchemaError.js.map +1 -1
- package/dist/SchemaGetter.d.ts +13 -11
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +34 -24
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.js +1 -1
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +1 -12
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +403 -1504
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +294 -2852
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +2 -2
- package/dist/SchemaTransformation.js +3 -3
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Semaphore.d.ts +5 -3
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js.map +1 -1
- package/dist/Stream.d.ts +15 -9
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +46 -16
- package/dist/Stream.js.map +1 -1
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +5 -4
- package/dist/Struct.js.map +1 -1
- package/dist/Types.d.ts +1 -3
- package/dist/Types.d.ts.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js +3 -2
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/effect.js +119 -53
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/record.d.ts +0 -3
- package/dist/internal/record.d.ts.map +1 -1
- package/dist/internal/record.js +10 -5
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/references.js +0 -4
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/schema/annotations.js +12 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.d.ts +2 -0
- package/dist/internal/schema/fromJsonSchemaDocument.d.ts.map +1 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js +743 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -0
- package/dist/internal/schema/fromRepresentation.d.ts +2 -0
- package/dist/internal/schema/fromRepresentation.d.ts.map +1 -0
- package/dist/internal/schema/fromRepresentation.js +252 -0
- package/dist/internal/schema/fromRepresentation.js.map +1 -0
- package/dist/internal/schema/schema.js +28 -40
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/schema/{arbitrary.d.ts → toArbitrary.d.ts} +1 -1
- package/dist/internal/schema/toArbitrary.d.ts.map +1 -0
- package/dist/internal/schema/{arbitrary.js → toArbitrary.js} +8 -9
- package/dist/internal/schema/toArbitrary.js.map +1 -0
- package/dist/internal/schema/toCodeDocument.d.ts +2 -0
- package/dist/internal/schema/toCodeDocument.d.ts.map +1 -0
- package/dist/internal/schema/toCodeDocument.js +438 -0
- package/dist/internal/schema/toCodeDocument.js.map +1 -0
- package/dist/internal/schema/toEquivalence.d.ts +2 -0
- package/dist/internal/schema/toEquivalence.d.ts.map +1 -0
- package/dist/internal/schema/{equivalence.js → toEquivalence.js} +15 -13
- package/dist/internal/schema/toEquivalence.js.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.d.ts +2 -0
- package/dist/internal/schema/toJsonSchemaDocument.d.ts.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.js +466 -0
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -0
- package/dist/internal/schema/toRepresentation.d.ts +2 -0
- package/dist/internal/schema/toRepresentation.d.ts.map +1 -0
- package/dist/internal/schema/toRepresentation.js +369 -0
- package/dist/internal/schema/toRepresentation.js.map +1 -0
- package/dist/internal/stackTraceLimit.js +3 -6
- package/dist/internal/stackTraceLimit.js.map +1 -1
- package/dist/testing/TestClock.js +4 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +26 -26
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +5 -4
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +21 -6
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +86 -316
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +1 -1
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +4 -1
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +19 -17
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +197 -197
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +13 -13
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +4 -4
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +116 -49
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +32 -10
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +193 -377
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +19 -19
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +14 -14
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +4 -0
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +11 -3
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +9 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +14 -10
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +15 -12
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/ai/internal/structured-output.d.ts +2 -0
- package/dist/unstable/ai/internal/structured-output.d.ts.map +1 -0
- package/dist/unstable/ai/internal/structured-output.js +316 -0
- package/dist/unstable/ai/internal/structured-output.js.map +1 -0
- package/dist/unstable/cli/CliError.d.ts +40 -2
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +45 -6
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/Command.js +14 -5
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Param.js +3 -3
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +3 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +11 -4
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/config.d.ts +0 -48
- package/dist/unstable/cli/internal/config.d.ts.map +1 -1
- package/dist/unstable/cli/internal/config.js +8 -10
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.js +1 -1
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +2 -1
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/Reply.js +1 -1
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +1 -1
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/ShardId.js +1 -1
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +125 -24
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +10 -2
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +4 -2
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +2 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +7 -4
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +55 -24
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +109 -62
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +19 -7
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/shardLock.d.ts +2 -0
- package/dist/unstable/cluster/internal/shardLock.d.ts.map +1 -0
- package/dist/unstable/cluster/internal/shardLock.js +4 -0
- package/dist/unstable/cluster/internal/shardLock.js.map +1 -0
- package/dist/unstable/devtools/DevToolsSchema.d.ts +20 -20
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +8 -5
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
- package/dist/unstable/eventlog/EventJournal.js +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 +15 -11
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +26 -26
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +8 -3
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +2 -2
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +3 -3
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +24 -22
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Headers.js +8 -8
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +44 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +14 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +2 -2
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +5 -4
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +17 -15
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.js +1 -1
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +17 -14
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +3 -3
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +5 -5
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +37 -24
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +72 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +69 -4
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -3
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +2 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +7 -3
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +5 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -3
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +2 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +2 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +2 -2
- package/dist/unstable/persistence/RateLimiter.js +2 -2
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +2 -2
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +3 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +4 -3
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +83 -0
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +31 -0
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +2 -1
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -2
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +13 -10
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +1 -1
- package/dist/unstable/socket/Socket.js +1 -1
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.js +2 -2
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +7 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +86 -25
- package/src/Channel.ts +32 -14
- package/src/Config.ts +6 -5
- package/src/ConfigProvider.ts +7 -7
- package/src/Data.ts +3 -2
- package/src/Effect.ts +70 -116
- package/src/FiberHandle.ts +3 -2
- package/src/Iterable.ts +2 -1
- package/src/JsonPatch.ts +4 -3
- package/src/JsonSchema.ts +9 -11
- package/src/Logger.ts +3 -2
- package/src/ManagedRuntime.ts +13 -0
- package/src/Metric.ts +4 -3
- package/src/MutableList.ts +4 -0
- package/src/Optic.ts +5 -4
- package/src/Option.ts +2 -1
- package/src/PartitionedSemaphore.ts +1 -4
- package/src/Record.ts +119 -22
- package/src/References.ts +0 -46
- package/src/Request.ts +5 -7
- package/src/Result.ts +2 -1
- package/src/Schema.ts +2538 -987
- package/src/SchemaAST.ts +228 -149
- package/src/SchemaError.ts +1 -1
- package/src/SchemaGetter.ts +36 -29
- package/src/SchemaIssue.ts +1 -1
- package/src/SchemaParser.ts +1 -25
- package/src/SchemaRepresentation.ts +697 -3398
- package/src/SchemaTransformation.ts +3 -3
- package/src/Semaphore.ts +5 -3
- package/src/Stream.ts +63 -19
- package/src/Struct.ts +5 -4
- package/src/Types.ts +1 -3
- package/src/index.ts +0 -5
- package/src/internal/core.ts +4 -3
- package/src/internal/effect.ts +132 -70
- package/src/internal/matcher.ts +1 -1
- package/src/internal/record.ts +11 -7
- package/src/internal/references.ts +0 -5
- package/src/internal/schema/annotations.ts +44 -0
- package/src/internal/schema/fromJsonSchemaDocument.ts +957 -0
- package/src/internal/schema/fromRepresentation.ts +345 -0
- package/src/internal/schema/schema.ts +45 -46
- package/src/internal/schema/{arbitrary.ts → toArbitrary.ts} +8 -10
- package/src/internal/schema/toCodeDocument.ts +572 -0
- package/src/internal/schema/{equivalence.ts → toEquivalence.ts} +12 -7
- package/src/internal/schema/toJsonSchemaDocument.ts +475 -0
- package/src/internal/schema/toRepresentation.ts +401 -0
- package/src/internal/stackTraceLimit.ts +3 -7
- package/src/testing/TestClock.ts +1 -1
- package/src/unstable/ai/AiError.ts +5 -4
- package/src/unstable/ai/AnthropicStructuredOutput.ts +102 -333
- package/src/unstable/ai/EmbeddingModel.ts +1 -1
- package/src/unstable/ai/LanguageModel.ts +30 -28
- package/src/unstable/ai/McpSchema.ts +15 -15
- package/src/unstable/ai/McpServer.ts +172 -56
- package/src/unstable/ai/OpenAiStructuredOutput.ts +230 -395
- package/src/unstable/ai/Response.ts +24 -24
- package/src/unstable/ai/Tool.ts +22 -4
- package/src/unstable/ai/Toolkit.ts +19 -7
- package/src/unstable/ai/internal/codec-transformer.ts +13 -7
- package/src/unstable/ai/internal/structured-output.ts +458 -0
- package/src/unstable/cli/CliError.ts +51 -5
- package/src/unstable/cli/Command.ts +4 -4
- package/src/unstable/cli/Param.ts +3 -3
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/internal/command.ts +13 -5
- package/src/unstable/cli/internal/config.ts +8 -10
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +3 -3
- package/src/unstable/cluster/Entity.ts +1 -1
- package/src/unstable/cluster/Envelope.ts +2 -1
- package/src/unstable/cluster/Reply.ts +1 -1
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerAddress.ts +1 -1
- package/src/unstable/cluster/ShardId.ts +1 -1
- package/src/unstable/cluster/Sharding.ts +161 -34
- package/src/unstable/cluster/ShardingConfig.ts +5 -1
- package/src/unstable/cluster/SingleRunner.ts +4 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +83 -35
- package/src/unstable/cluster/SqlRunnerStorage.ts +186 -116
- package/src/unstable/cluster/internal/entityManager.ts +31 -10
- package/src/unstable/cluster/internal/shardLock.ts +9 -0
- package/src/unstable/devtools/DevToolsSchema.ts +10 -5
- package/src/unstable/eventlog/EventJournal.ts +1 -1
- package/src/unstable/eventlog/EventLog.ts +21 -11
- package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
- package/src/unstable/eventlog/EventLogMessage.ts +10 -3
- package/src/unstable/eventlog/SqlEventJournal.ts +2 -2
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +1 -1
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +6 -3
- package/src/unstable/http/Cookies.ts +29 -24
- package/src/unstable/http/Headers.ts +8 -8
- package/src/unstable/http/HttpClientRequest.ts +57 -0
- package/src/unstable/http/HttpRouter.ts +6 -3
- package/src/unstable/http/HttpServerRequest.ts +5 -4
- package/src/unstable/http/Multipart.ts +16 -13
- package/src/unstable/http/Template.ts +1 -1
- package/src/unstable/http/UrlParams.ts +17 -14
- package/src/unstable/httpapi/HttpApi.ts +3 -3
- package/src/unstable/httpapi/HttpApiClient.ts +5 -5
- package/src/unstable/httpapi/HttpApiGroup.ts +1 -1
- package/src/unstable/httpapi/OpenApi.ts +52 -28
- package/src/unstable/observability/OtlpExporter.ts +109 -5
- package/src/unstable/observability/OtlpLogger.ts +5 -5
- package/src/unstable/observability/OtlpMetrics.ts +8 -4
- package/src/unstable/observability/OtlpTracer.ts +8 -4
- package/src/unstable/persistence/Persistable.ts +3 -2
- package/src/unstable/persistence/RateLimiter.ts +2 -2
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcessSpawner.ts +1 -1
- package/src/unstable/reactivity/AsyncResult.ts +4 -3
- package/src/unstable/reactivity/Atom.ts +92 -0
- package/src/unstable/reactivity/AtomRegistry.ts +1 -1
- package/src/unstable/rpc/RpcClient.ts +2 -1
- package/src/unstable/schema/VariantSchema.ts +14 -24
- package/src/unstable/socket/Socket.ts +1 -1
- package/src/unstable/sql/SqlError.ts +2 -2
- package/src/unstable/sql/Statement.ts +7 -6
- package/dist/SchemaUtils.d.ts +0 -28
- package/dist/SchemaUtils.d.ts.map +0 -1
- package/dist/SchemaUtils.js +0 -45
- package/dist/SchemaUtils.js.map +0 -1
- package/dist/internal/schema/arbitrary.d.ts.map +0 -1
- package/dist/internal/schema/arbitrary.js.map +0 -1
- package/dist/internal/schema/equivalence.d.ts +0 -2
- package/dist/internal/schema/equivalence.d.ts.map +0 -1
- package/dist/internal/schema/equivalence.js.map +0 -1
- package/dist/internal/schema/representation.d.ts +0 -2
- package/dist/internal/schema/representation.d.ts.map +0 -1
- package/dist/internal/schema/representation.js +0 -865
- package/dist/internal/schema/representation.js.map +0 -1
- package/src/SchemaUtils.ts +0 -51
- package/src/internal/schema/representation.ts +0 -795
package/src/Record.ts
CHANGED
|
@@ -15,6 +15,7 @@ import * as Equal from "./Equal.ts"
|
|
|
15
15
|
import type { Equivalence } from "./Equivalence.ts"
|
|
16
16
|
import { dual, identity } from "./Function.ts"
|
|
17
17
|
import type { TypeLambda } from "./HKT.ts"
|
|
18
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
18
19
|
import * as Option from "./Option.ts"
|
|
19
20
|
import * as Reducer from "./Reducer.ts"
|
|
20
21
|
import type { Result } from "./Result.ts"
|
|
@@ -285,7 +286,7 @@ export const fromIterableWith: {
|
|
|
285
286
|
const out: Record<string, B> = empty()
|
|
286
287
|
for (const a of self) {
|
|
287
288
|
const [k, b] = f(a)
|
|
288
|
-
out
|
|
289
|
+
InternalRecord.assignProperty(out, k, b)
|
|
289
290
|
}
|
|
290
291
|
return out
|
|
291
292
|
}
|
|
@@ -317,10 +318,68 @@ export const fromIterableWith: {
|
|
|
317
318
|
* @category constructors
|
|
318
319
|
* @since 2.0.0
|
|
319
320
|
*/
|
|
320
|
-
export const fromIterableBy
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
export const fromIterableBy: {
|
|
322
|
+
/**
|
|
323
|
+
* Creates a new record from an iterable, utilizing the provided function to determine the key for each element.
|
|
324
|
+
*
|
|
325
|
+
* **Example** (Building a record keyed by iterable values)
|
|
326
|
+
*
|
|
327
|
+
* ```ts
|
|
328
|
+
* import { Record } from "effect"
|
|
329
|
+
* import * as assert from "node:assert"
|
|
330
|
+
*
|
|
331
|
+
* const users = [
|
|
332
|
+
* { id: "2", name: "name2" },
|
|
333
|
+
* { id: "1", name: "name1" }
|
|
334
|
+
* ]
|
|
335
|
+
*
|
|
336
|
+
* assert.deepStrictEqual(
|
|
337
|
+
* Record.fromIterableBy(users, (user) => user.id),
|
|
338
|
+
* {
|
|
339
|
+
* "2": { id: "2", name: "name2" },
|
|
340
|
+
* "1": { id: "1", name: "name1" }
|
|
341
|
+
* }
|
|
342
|
+
* )
|
|
343
|
+
* ```
|
|
344
|
+
*
|
|
345
|
+
* @category constructors
|
|
346
|
+
* @since 2.0.0
|
|
347
|
+
*/
|
|
348
|
+
<A, K extends string | symbol>(f: (a: A) => K): (items: Iterable<A>) => Record<ReadonlyRecord.NonLiteralKey<K>, A>
|
|
349
|
+
/**
|
|
350
|
+
* Creates a new record from an iterable, utilizing the provided function to determine the key for each element.
|
|
351
|
+
*
|
|
352
|
+
* **Example** (Building a record keyed by iterable values)
|
|
353
|
+
*
|
|
354
|
+
* ```ts
|
|
355
|
+
* import { Record } from "effect"
|
|
356
|
+
* import * as assert from "node:assert"
|
|
357
|
+
*
|
|
358
|
+
* const users = [
|
|
359
|
+
* { id: "2", name: "name2" },
|
|
360
|
+
* { id: "1", name: "name1" }
|
|
361
|
+
* ]
|
|
362
|
+
*
|
|
363
|
+
* assert.deepStrictEqual(
|
|
364
|
+
* Record.fromIterableBy(users, (user) => user.id),
|
|
365
|
+
* {
|
|
366
|
+
* "2": { id: "2", name: "name2" },
|
|
367
|
+
* "1": { id: "1", name: "name1" }
|
|
368
|
+
* }
|
|
369
|
+
* )
|
|
370
|
+
* ```
|
|
371
|
+
*
|
|
372
|
+
* @category constructors
|
|
373
|
+
* @since 2.0.0
|
|
374
|
+
*/
|
|
375
|
+
<A, K extends string | symbol>(items: Iterable<A>, f: (a: A) => K): Record<ReadonlyRecord.NonLiteralKey<K>, A>
|
|
376
|
+
} = dual(
|
|
377
|
+
2,
|
|
378
|
+
<A, K extends string | symbol>(
|
|
379
|
+
items: Iterable<A>,
|
|
380
|
+
f: (a: A) => K
|
|
381
|
+
): Record<ReadonlyRecord.NonLiteralKey<K>, A> => fromIterableWith(items, (a) => [f(a), a])
|
|
382
|
+
)
|
|
324
383
|
|
|
325
384
|
/**
|
|
326
385
|
* Builds a record from an iterable of key-value pairs.
|
|
@@ -576,7 +635,7 @@ export const get: {
|
|
|
576
635
|
} = dual(
|
|
577
636
|
2,
|
|
578
637
|
<K extends string | symbol, A>(self: ReadonlyRecord<K, A>, key: NoInfer<K>): Option.Option<A> =>
|
|
579
|
-
|
|
638
|
+
Object.hasOwn(self, key) ? Option.some(self[key]) : Option.none()
|
|
580
639
|
)
|
|
581
640
|
|
|
582
641
|
/**
|
|
@@ -953,7 +1012,7 @@ export const map: {
|
|
|
953
1012
|
<K extends string, A, B>(self: ReadonlyRecord<K, A>, f: (a: A, key: NoInfer<K>) => B): Record<K, B> => {
|
|
954
1013
|
const out: Record<K, B> = { ...self } as any
|
|
955
1014
|
for (const key of keys(self)) {
|
|
956
|
-
out
|
|
1015
|
+
InternalRecord.assignProperty(out, key, f(self[key], key))
|
|
957
1016
|
}
|
|
958
1017
|
return out
|
|
959
1018
|
}
|
|
@@ -1025,7 +1084,7 @@ export const mapKeys: {
|
|
|
1025
1084
|
const out: Record<K2, A> = {} as any
|
|
1026
1085
|
for (const key of keys(self)) {
|
|
1027
1086
|
const a = self[key]
|
|
1028
|
-
out
|
|
1087
|
+
InternalRecord.assignProperty(out, f(key, a), a)
|
|
1029
1088
|
}
|
|
1030
1089
|
return out
|
|
1031
1090
|
}
|
|
@@ -1097,7 +1156,7 @@ export const mapEntries: {
|
|
|
1097
1156
|
const out = {} as Record<K2, B>
|
|
1098
1157
|
for (const key of keys(self)) {
|
|
1099
1158
|
const [k, b] = f(self[key], key)
|
|
1100
|
-
out
|
|
1159
|
+
InternalRecord.assignProperty(out, k, b)
|
|
1101
1160
|
}
|
|
1102
1161
|
return out
|
|
1103
1162
|
}
|
|
@@ -1170,7 +1229,7 @@ export const filterMap: {
|
|
|
1170
1229
|
for (const key of keys(self)) {
|
|
1171
1230
|
const result = f(self[key], key)
|
|
1172
1231
|
if (R.isSuccess(result)) {
|
|
1173
|
-
out
|
|
1232
|
+
InternalRecord.assignProperty(out, key, result.success)
|
|
1174
1233
|
}
|
|
1175
1234
|
}
|
|
1176
1235
|
return out
|
|
@@ -1271,7 +1330,7 @@ export const filter: {
|
|
|
1271
1330
|
const out: Record<string, A> = empty()
|
|
1272
1331
|
for (const key of keys(self)) {
|
|
1273
1332
|
if (predicate(self[key], key)) {
|
|
1274
|
-
out
|
|
1333
|
+
InternalRecord.assignProperty(out, key, self[key])
|
|
1275
1334
|
}
|
|
1276
1335
|
}
|
|
1277
1336
|
return out
|
|
@@ -1306,7 +1365,7 @@ export const getSomes: <K extends string, A>(
|
|
|
1306
1365
|
for (const key of keys(self)) {
|
|
1307
1366
|
const option = self[key]
|
|
1308
1367
|
if (Option.isSome(option)) {
|
|
1309
|
-
out
|
|
1368
|
+
InternalRecord.assignProperty(out, key, option.value)
|
|
1310
1369
|
}
|
|
1311
1370
|
}
|
|
1312
1371
|
return out
|
|
@@ -1342,7 +1401,7 @@ export const getFailures = <K extends string, A, E>(
|
|
|
1342
1401
|
for (const key of keys(self)) {
|
|
1343
1402
|
const value = self[key]
|
|
1344
1403
|
if (R.isFailure(value)) {
|
|
1345
|
-
out
|
|
1404
|
+
InternalRecord.assignProperty(out, key, value.failure)
|
|
1346
1405
|
}
|
|
1347
1406
|
}
|
|
1348
1407
|
|
|
@@ -1379,7 +1438,7 @@ export const getSuccesses = <K extends string, A, E>(
|
|
|
1379
1438
|
for (const key of keys(self)) {
|
|
1380
1439
|
const value = self[key]
|
|
1381
1440
|
if (R.isSuccess(value)) {
|
|
1382
|
-
out
|
|
1441
|
+
InternalRecord.assignProperty(out, key, value.success)
|
|
1383
1442
|
}
|
|
1384
1443
|
}
|
|
1385
1444
|
|
|
@@ -1471,9 +1530,9 @@ export const partition: {
|
|
|
1471
1530
|
for (const key of keys(self)) {
|
|
1472
1531
|
const e = f(self[key], key)
|
|
1473
1532
|
if (R.isFailure(e)) {
|
|
1474
|
-
left
|
|
1533
|
+
InternalRecord.assignProperty(left, key, e.failure)
|
|
1475
1534
|
} else {
|
|
1476
|
-
right
|
|
1535
|
+
InternalRecord.assignProperty(right, key, e.success)
|
|
1477
1536
|
}
|
|
1478
1537
|
}
|
|
1479
1538
|
return [left, right]
|
|
@@ -1600,6 +1659,44 @@ export const set: {
|
|
|
1600
1659
|
}
|
|
1601
1660
|
)
|
|
1602
1661
|
|
|
1662
|
+
/**
|
|
1663
|
+
* Mutates a record by assigning a value to a property.
|
|
1664
|
+
*
|
|
1665
|
+
* **When to use**
|
|
1666
|
+
*
|
|
1667
|
+
* Use when incrementally constructing a new record and copying it for every
|
|
1668
|
+
* property would be unnecessary.
|
|
1669
|
+
*
|
|
1670
|
+
* **Gotchas**
|
|
1671
|
+
*
|
|
1672
|
+
* This function mutates `self`. When `key` is `"__proto__"`, it creates an
|
|
1673
|
+
* own data property instead of changing the object's prototype.
|
|
1674
|
+
*
|
|
1675
|
+
* **Example** (Assigning an external key safely)
|
|
1676
|
+
*
|
|
1677
|
+
* ```ts
|
|
1678
|
+
* import { Record } from "effect"
|
|
1679
|
+
* import * as assert from "node:assert"
|
|
1680
|
+
*
|
|
1681
|
+
* const key: string = "__proto__" // Assume this comes from external input
|
|
1682
|
+
* const value = { polluted: true }
|
|
1683
|
+
*
|
|
1684
|
+
* const unsafe: Record<string, unknown> = {}
|
|
1685
|
+
* unsafe[key] = value
|
|
1686
|
+
* assert.strictEqual(Object.getPrototypeOf(unsafe), value)
|
|
1687
|
+
*
|
|
1688
|
+
* const safe: Record<string, unknown> = {}
|
|
1689
|
+
* Record.assignProperty(safe, key, value)
|
|
1690
|
+
* assert.strictEqual(Object.getPrototypeOf(safe), Object.prototype)
|
|
1691
|
+
* assert.strictEqual(safe[key], value)
|
|
1692
|
+
* ```
|
|
1693
|
+
*
|
|
1694
|
+
* @see {@link set} for an immutable update
|
|
1695
|
+
* @category mutations
|
|
1696
|
+
* @since 4.0.0
|
|
1697
|
+
*/
|
|
1698
|
+
export const assignProperty: (self: object, key: PropertyKey, value: unknown) => void = InternalRecord.assignProperty
|
|
1699
|
+
|
|
1603
1700
|
/**
|
|
1604
1701
|
* Checks whether all the keys and values in one record are also found in another record.
|
|
1605
1702
|
* Uses the provided equivalence function to compare values.
|
|
@@ -2051,14 +2148,14 @@ export const union: {
|
|
|
2051
2148
|
const out: Record<string, A | B | C> = empty()
|
|
2052
2149
|
for (const key of keys(self)) {
|
|
2053
2150
|
if (has(that, key as any)) {
|
|
2054
|
-
out
|
|
2151
|
+
InternalRecord.assignProperty(out, key, combine(self[key], that[key as unknown as K1]))
|
|
2055
2152
|
} else {
|
|
2056
|
-
out
|
|
2153
|
+
InternalRecord.assignProperty(out, key, self[key])
|
|
2057
2154
|
}
|
|
2058
2155
|
}
|
|
2059
2156
|
for (const key of keys(that)) {
|
|
2060
2157
|
if (!has(out, key)) {
|
|
2061
|
-
out
|
|
2158
|
+
InternalRecord.assignProperty(out, key, that[key])
|
|
2062
2159
|
}
|
|
2063
2160
|
}
|
|
2064
2161
|
return out
|
|
@@ -2142,7 +2239,7 @@ export const intersection: {
|
|
|
2142
2239
|
}
|
|
2143
2240
|
for (const key of keys(self)) {
|
|
2144
2241
|
if (has(that, key as any)) {
|
|
2145
|
-
out
|
|
2242
|
+
InternalRecord.assignProperty(out, key, combine(self[key], that[key as unknown as K1]))
|
|
2146
2243
|
}
|
|
2147
2244
|
}
|
|
2148
2245
|
return out
|
|
@@ -2222,12 +2319,12 @@ export const difference: {
|
|
|
2222
2319
|
const out = {} as Record<K0 | K1, A | B>
|
|
2223
2320
|
for (const key of keys(self)) {
|
|
2224
2321
|
if (!has(that, key as any)) {
|
|
2225
|
-
out
|
|
2322
|
+
InternalRecord.assignProperty(out, key, self[key])
|
|
2226
2323
|
}
|
|
2227
2324
|
}
|
|
2228
2325
|
for (const key of keys(that)) {
|
|
2229
2326
|
if (!has(self, key as any)) {
|
|
2230
|
-
out
|
|
2327
|
+
InternalRecord.assignProperty(out, key, that[key])
|
|
2231
2328
|
}
|
|
2232
2329
|
}
|
|
2233
2330
|
return out
|
package/src/References.ts
CHANGED
|
@@ -124,52 +124,6 @@ export {
|
|
|
124
124
|
Tracer
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/**
|
|
128
|
-
* Context reference for controlling the current concurrency limit. Can be set to "unbounded"
|
|
129
|
-
* for unlimited concurrency or a specific number to limit concurrent operations.
|
|
130
|
-
*
|
|
131
|
-
* **When to use**
|
|
132
|
-
*
|
|
133
|
-
* Use to configure the default concurrency limit for operations that read
|
|
134
|
-
* concurrency from the current context.
|
|
135
|
-
*
|
|
136
|
-
* **Example** (Setting current concurrency)
|
|
137
|
-
*
|
|
138
|
-
* ```ts
|
|
139
|
-
* import { Effect, References } from "effect"
|
|
140
|
-
*
|
|
141
|
-
* const limitConcurrency = Effect.gen(function*() {
|
|
142
|
-
* // Get current setting
|
|
143
|
-
* const current = yield* References.CurrentConcurrency
|
|
144
|
-
* console.log(current) // "unbounded" (default)
|
|
145
|
-
*
|
|
146
|
-
* // Run with limited concurrency
|
|
147
|
-
* yield* Effect.provideService(
|
|
148
|
-
* Effect.gen(function*() {
|
|
149
|
-
* const limited = yield* References.CurrentConcurrency
|
|
150
|
-
* console.log(limited) // 10
|
|
151
|
-
* }),
|
|
152
|
-
* References.CurrentConcurrency,
|
|
153
|
-
* 10
|
|
154
|
-
* )
|
|
155
|
-
*
|
|
156
|
-
* // Run with unlimited concurrency
|
|
157
|
-
* yield* Effect.provideService(
|
|
158
|
-
* Effect.gen(function*() {
|
|
159
|
-
* const unlimited = yield* References.CurrentConcurrency
|
|
160
|
-
* console.log(unlimited) // "unbounded"
|
|
161
|
-
* }),
|
|
162
|
-
* References.CurrentConcurrency,
|
|
163
|
-
* "unbounded"
|
|
164
|
-
* )
|
|
165
|
-
* })
|
|
166
|
-
* ```
|
|
167
|
-
*
|
|
168
|
-
* @category references
|
|
169
|
-
* @since 4.0.0
|
|
170
|
-
*/
|
|
171
|
-
export const CurrentConcurrency: Context.Reference<number | "unbounded"> = references.CurrentConcurrency
|
|
172
|
-
|
|
173
127
|
/**
|
|
174
128
|
* Context reference for managing log annotations that are automatically added to all log entries.
|
|
175
129
|
* These annotations provide contextual metadata that appears in every log message.
|
package/src/Request.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type * as Exit from "./Exit.ts"
|
|
|
17
17
|
import { dual } from "./Function.ts"
|
|
18
18
|
import * as core from "./internal/core.ts"
|
|
19
19
|
import * as internalEffect from "./internal/effect.ts"
|
|
20
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
20
21
|
import { hasProperty } from "./Predicate.ts"
|
|
21
22
|
import type * as Types from "./Types.ts"
|
|
22
23
|
|
|
@@ -280,7 +281,7 @@ export const isRequest = (u: unknown): u is Request<unknown, unknown, unknown> =
|
|
|
280
281
|
* @since 2.0.0
|
|
281
282
|
*/
|
|
282
283
|
export const of = <R extends Request<any, any, any>>(): Constructor<R> => (args) =>
|
|
283
|
-
Object.
|
|
284
|
+
Object.setPrototypeOf({ ...(args as R) }, RequestPrototype)
|
|
284
285
|
|
|
285
286
|
/**
|
|
286
287
|
* Creates a constructor function for a tagged Request type. The tag is automatically
|
|
@@ -328,10 +329,7 @@ export const tagged = <R extends Request<any, any, any> & { _tag: string }>(
|
|
|
328
329
|
tag: R["_tag"]
|
|
329
330
|
): Constructor<R, "_tag"> =>
|
|
330
331
|
(args) => {
|
|
331
|
-
|
|
332
|
-
if (args) Object.assign(request, args)
|
|
333
|
-
request._tag = tag
|
|
334
|
-
return request
|
|
332
|
+
return Object.setPrototypeOf({ ...(args as R), _tag: tag }, RequestPrototype)
|
|
335
333
|
}
|
|
336
334
|
|
|
337
335
|
/**
|
|
@@ -364,9 +362,9 @@ export const Class: new<A extends Record<string, any>, Success, Error = never, C
|
|
|
364
362
|
args: Types.Equals<Omit<A, keyof Request<unknown, unknown>>, {}> extends true ? void
|
|
365
363
|
: { readonly [P in keyof A as P extends keyof Request<any, any, any> ? never : P]: A[P] }
|
|
366
364
|
) => Request<Success, Error, Context> & Readonly<A> = (function() {
|
|
367
|
-
function Class(this:
|
|
365
|
+
function Class(this: object, args: object | undefined) {
|
|
368
366
|
if (args) {
|
|
369
|
-
|
|
367
|
+
InternalRecord.assignProperties(this, args)
|
|
370
368
|
}
|
|
371
369
|
}
|
|
372
370
|
Class.prototype = RequestPrototype
|
package/src/Result.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type { TypeLambda } from "./HKT.ts"
|
|
|
17
17
|
import type { Inspectable } from "./Inspectable.ts"
|
|
18
18
|
import * as doNotation from "./internal/doNotation.ts"
|
|
19
19
|
import * as option_ from "./internal/option.ts"
|
|
20
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
20
21
|
import * as result from "./internal/result.ts"
|
|
21
22
|
import type { Option } from "./Option.ts"
|
|
22
23
|
import type { Pipeable } from "./Pipeable.ts"
|
|
@@ -2847,7 +2848,7 @@ export const all: <const I extends Iterable<Result<any, any>> | Record<string, R
|
|
|
2847
2848
|
if (isFailure(e)) {
|
|
2848
2849
|
return e
|
|
2849
2850
|
}
|
|
2850
|
-
out
|
|
2851
|
+
InternalRecord.assignProperty(out, key, e.success)
|
|
2851
2852
|
}
|
|
2852
2853
|
return succeed(out)
|
|
2853
2854
|
}
|